import { Router } from 'express';
import { invoicesService } from './services/index.js';
import { Invoice, Payment, InvoiceItem, PaymentAllocation } from './entities/index.js';

/**
 * Invoices Module - Provides invoice and payment management functionality
 *
 * This module is kept for backwards compatibility but the recommended
 * approach is to use the routes directly via invoices.routes.ts
 */
export class InvoicesModule {
  public router: Router;

  constructor() {
    this.router = Router();
  }

  /**
   * Get service instance
   */
  getService() {
    return invoicesService;
  }

  /**
   * Get all entities managed by this module
   */
  static getEntities(): Function[] {
    return [Invoice, InvoiceItem, Payment, PaymentAllocation];
  }
}

// Export module instance
export const invoicesModule = new InvoicesModule();
