import { IModuleServer, ModuleParams } from "@erp/core/api";
import { models, verifactuRouter } from "./infrastructure";

export const verifactuAPIModule: IModuleServer = {
  name: "verifactu",
  version: "1.0.0",
  dependencies: ["customer-invoices"],

  async init(params: ModuleParams) {
    const { logger } = params;
    verifactuRouter(params);
    logger.info("🚀 Verifactu module initialized", { label: this.name });
  },
  async registerDependencies(params) {
    const { database, logger } = params;
    logger.info("🚀 Verifactu module dependencies registered", {
      label: this.name,
    });
    return {
      models,
      services: {
        sendInvoiceToVerifactu: () => {},
        /*...*/
      },
    };
  },
};

export default verifactuAPIModule;
