48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
import type { IModuleServer, ModuleParams } from "@erp/core/api";
|
|
import type { UniqueID } from "@repo/rdx-ddd";
|
|
import type { Transaction } from "sequelize";
|
|
|
|
import { models, proformasRouter } from "./infrastructure";
|
|
import { issuedInvoicesRouter } from "./infrastructure/express/issued-invoices.routes";
|
|
|
|
export const customerInvoicesAPIModule: IModuleServer = {
|
|
name: "customer-invoices",
|
|
version: "1.0.0",
|
|
dependencies: ["customers"],
|
|
|
|
async init(params: ModuleParams) {
|
|
// const contacts = getService<ContactsService>("contacts");
|
|
const { logger } = params;
|
|
proformasRouter(params);
|
|
issuedInvoicesRouter(params);
|
|
logger.info("🚀 CustomerInvoices module initialized", { label: this.name });
|
|
},
|
|
|
|
async registerDependencies(params) {
|
|
const { logger } = params; /* = ModuleParams & {
|
|
getService: (name: string) => any;
|
|
};*/
|
|
|
|
logger.info("🚀 CustomerInvoices module dependencies registered", {
|
|
label: this.name,
|
|
});
|
|
|
|
return {
|
|
models,
|
|
services: {
|
|
getInvoiceByIdInCompany: (
|
|
companyId: UniqueID,
|
|
invoiceId: UniqueID,
|
|
transaction?: Transaction
|
|
) => {
|
|
/*const { service } = deps;
|
|
|
|
return service.getInvoiceByIdInCompany(companyId, invoiceId, transaction);*/
|
|
},
|
|
},
|
|
};
|
|
},
|
|
};
|
|
|
|
export default customerInvoicesAPIModule;
|