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

export * from "./infrastructure/sequelize";

export const customersAPIModule: IModuleServer = {
  name: "customers",
  version: "1.0.0",
  dependencies: [],

  async init(params: ModuleParams) {
    // const contacts = getService<ContactsService>("contacts");
    const { logger } = params;
    customersRouter(params);
    logger.info("🚀 Customers module initialized", { label: this.name });
  },
  async registerDependencies(params) {
    const { database, logger } = params;
    logger.info("🚀 Customers module dependencies registered", {
      label: this.name,
    });
    return {
      models,
      services: {
        /*...*/
      },
    };
  },
};

export default customersAPIModule;
