2026-05-20 17:53:23 +00:00
|
|
|
import type { IModuleServer } from "@erp/core/api";
|
|
|
|
|
|
2026-05-22 18:24:50 +00:00
|
|
|
import {
|
|
|
|
|
paymentMethodModels,
|
|
|
|
|
paymentMethodsRouter,
|
|
|
|
|
paymentTermModels,
|
|
|
|
|
paymentTermsRouter,
|
|
|
|
|
} from "./infrastructure";
|
2026-05-20 17:53:23 +00:00
|
|
|
import {
|
|
|
|
|
buildCatalogsDependencies,
|
|
|
|
|
buildCatalogsPublicServices,
|
2026-05-22 18:24:50 +00:00
|
|
|
} from "./infrastructure/di/catalogs.di";
|
2026-05-20 17:53:23 +00:00
|
|
|
|
2026-05-21 10:52:54 +00:00
|
|
|
export * from "./infrastructure/payment-methods/persistence/sequelize";
|
2026-05-20 17:53:23 +00:00
|
|
|
|
|
|
|
|
export const catalogsAPIModule: IModuleServer = {
|
|
|
|
|
name: "catalogs",
|
|
|
|
|
version: "1.0.0",
|
|
|
|
|
dependencies: [],
|
|
|
|
|
|
|
|
|
|
async setup(params) {
|
|
|
|
|
const internal = buildCatalogsDependencies(params);
|
|
|
|
|
const publicServices = buildCatalogsPublicServices(params, internal);
|
|
|
|
|
|
|
|
|
|
params.logger.info("🚀 Catalogs module dependencies registered", {
|
|
|
|
|
label: this.name,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return {
|
2026-05-22 18:24:50 +00:00
|
|
|
models: [...paymentMethodModels, ...paymentTermModels],
|
2026-05-20 17:53:23 +00:00
|
|
|
services: {
|
2026-05-22 18:24:50 +00:00
|
|
|
paymentMethod: publicServices.paymentMethods,
|
|
|
|
|
paymentTerms: publicServices.paymentTerms,
|
2026-05-20 17:53:23 +00:00
|
|
|
},
|
|
|
|
|
internal,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async start(params) {
|
|
|
|
|
const { logger } = params;
|
|
|
|
|
|
|
|
|
|
paymentMethodsRouter(params);
|
2026-05-22 18:24:50 +00:00
|
|
|
paymentTermsRouter(params);
|
2026-05-20 17:53:23 +00:00
|
|
|
|
|
|
|
|
logger.info("🚀 Catalogs module started", {
|
|
|
|
|
label: this.name,
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default catalogsAPIModule;
|