Facturas de cliente
This commit is contained in:
parent
c8c71cf91c
commit
56b37c4256
@ -1,2 +1,3 @@
|
|||||||
export * from "./presenter-registry";
|
export * from "./presenter-registry";
|
||||||
export * from "./presenter-registry.interface";
|
export * from "./presenter-registry.interface";
|
||||||
|
export * from "./presenter.interface";
|
||||||
|
|||||||
@ -4,9 +4,8 @@ import { IPresenter } from "./presenter.interface";
|
|||||||
* 🔑 Claves de proyección comunes para seleccionar presenters
|
* 🔑 Claves de proyección comunes para seleccionar presenters
|
||||||
*/
|
*/
|
||||||
export type PresenterKey = {
|
export type PresenterKey = {
|
||||||
resource: string; // "customer-invoice"
|
projection: "FULL" | "LIST" | "REPORT" | (string & {});
|
||||||
projection: string; //"detail" | "summary" | "created" | "status" | "export";
|
format?: "JSON" | "PDF" | "CSV" | (string & {});
|
||||||
format: string; //"json" | "pdf" | "csv" | "xml";
|
|
||||||
version?: number; // 1 | 2
|
version?: number; // 1 | 2
|
||||||
locale?: string; // es | en | fr
|
locale?: string; // es | en | fr
|
||||||
};
|
};
|
||||||
@ -53,5 +52,9 @@ export interface IPresenterRegistry {
|
|||||||
registerPresenter<TSource, TOutput>(
|
registerPresenter<TSource, TOutput>(
|
||||||
key: PresenterKey,
|
key: PresenterKey,
|
||||||
presenter: IPresenter<TSource, TOutput>
|
presenter: IPresenter<TSource, TOutput>
|
||||||
): void;
|
): this;
|
||||||
|
|
||||||
|
registerPresenters(
|
||||||
|
presenters: Array<{ key: PresenterKey; presenter: IPresenter<any, any> }>
|
||||||
|
): this;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,8 +5,23 @@ import { IPresenter } from "./presenter.interface";
|
|||||||
export class InMemoryPresenterRegistry implements IPresenterRegistry {
|
export class InMemoryPresenterRegistry implements IPresenterRegistry {
|
||||||
private registry: Map<string, IPresenter<any, any>> = new Map();
|
private registry: Map<string, IPresenter<any, any>> = new Map();
|
||||||
|
|
||||||
|
private _normalizeKey(key: PresenterKey): PresenterKey {
|
||||||
|
return {
|
||||||
|
...key,
|
||||||
|
format: key.format ?? "JSON", // 👈 valor por defecto
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private _registerPresenter<TSource, TOutput>(
|
||||||
|
key: PresenterKey,
|
||||||
|
presenter: IPresenter<TSource, TOutput>
|
||||||
|
): void {
|
||||||
|
const exactKey = this._buildKey(this._normalizeKey(key));
|
||||||
|
this.registry.set(exactKey, presenter);
|
||||||
|
}
|
||||||
|
|
||||||
getPresenter<TSource, TOutput>(key: PresenterKey): IPresenter<TSource, TOutput> {
|
getPresenter<TSource, TOutput>(key: PresenterKey): IPresenter<TSource, TOutput> {
|
||||||
const exactKey = this._buildKey(key);
|
const exactKey = this._buildKey(this._normalizeKey(key));
|
||||||
|
|
||||||
// 1) Intentar clave exacta
|
// 1) Intentar clave exacta
|
||||||
if (this.registry.has(exactKey)) {
|
if (this.registry.has(exactKey)) {
|
||||||
@ -43,20 +58,28 @@ export class InMemoryPresenterRegistry implements IPresenterRegistry {
|
|||||||
registerPresenter<TSource, TOutput>(
|
registerPresenter<TSource, TOutput>(
|
||||||
key: PresenterKey,
|
key: PresenterKey,
|
||||||
presenter: IPresenter<TSource, TOutput>
|
presenter: IPresenter<TSource, TOutput>
|
||||||
): void {
|
): this {
|
||||||
const exactKey = this._buildKey(key);
|
this._registerPresenter(key, presenter);
|
||||||
this.registry.set(exactKey, presenter);
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* ✅ Registro en lote de presentadores.
|
||||||
|
*/
|
||||||
|
registerPresenters(
|
||||||
|
presenters: Array<{ key: PresenterKey; presenter: IPresenter<any, any> }>
|
||||||
|
): this {
|
||||||
|
presenters.forEach(({ key, presenter }) => this._registerPresenter(key, presenter));
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 🔹 Construye la clave única para el registro.
|
* 🔹 Construye la clave única para el registro.
|
||||||
*/
|
*/
|
||||||
private _buildKey(key: PresenterKey): string {
|
private _buildKey(key: PresenterKey): string {
|
||||||
const { resource, projection, format, version, locale } = key;
|
const { projection, format, version, locale } = key;
|
||||||
return [
|
return [
|
||||||
resource.toLowerCase(),
|
|
||||||
projection.toLowerCase(),
|
projection.toLowerCase(),
|
||||||
format.toLowerCase(),
|
format!.toLowerCase(),
|
||||||
version ?? "latest",
|
version ?? "latest",
|
||||||
locale ?? "default",
|
locale ?? "default",
|
||||||
].join("::");
|
].join("::");
|
||||||
|
|||||||
@ -1,32 +1,6 @@
|
|||||||
export type DTO<T = unknown> = T;
|
export type DTO<T = unknown> = T;
|
||||||
export type BinaryOutput = Buffer; // Puedes ampliar a Readable si usas streams
|
export type BinaryOutput = Buffer; // Puedes ampliar a Readable si usas streams
|
||||||
|
|
||||||
interface ISyncPresenter<TSource, TOutput = DTO> {
|
export interface IPresenter<TSource = unknown, TOutput = DTO> {
|
||||||
toOutput(source: TSource): TOutput;
|
toOutput(source: TSource): TOutput | Promise<TOutput>;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IAsyncPresenter<TSource, TOutput = DTO> {
|
|
||||||
toOutput(source: TSource): Promise<TOutput>;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Proyección SINCRÓNICA de colecciones.
|
|
||||||
* Útil para listados paginados, exportaciones ligeras, etc.
|
|
||||||
*/
|
|
||||||
/*export interface ISyncBulkPresenter<TSource, TOutput = BinaryOutput> {
|
|
||||||
toOutput(source: TSource): TOutput;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Proyección ASÍNCRONA de colecciones.
|
|
||||||
* Útil para generar varios PDFs/CSVs.
|
|
||||||
*/
|
|
||||||
/*export interface IAsyncBulkPresenter<TSource, TOutput = BinaryOutput> {
|
|
||||||
toOutput(source: TSource): Promise<TOutput>;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
export type IPresenter<TSource, TOutput = DTO | BinaryOutput> =
|
|
||||||
| ISyncPresenter<TSource, TOutput>
|
|
||||||
| IAsyncPresenter<TSource, TOutput>;
|
|
||||||
//| ISyncBulkPresenter<TSource, TOutput>
|
|
||||||
//| IAsyncBulkPresenter<TSource, TOutput>;
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
* 🔑 Claves de proyección comunes para seleccionar mappers en lectura.
|
* 🔑 Claves de proyección comunes para seleccionar mappers en lectura.
|
||||||
* Puedes extender con otras cadenas según tus necesidades ("SUMMARY", "EXPORT", etc.).
|
* Puedes extender con otras cadenas según tus necesidades ("SUMMARY", "EXPORT", etc.).
|
||||||
*/
|
*/
|
||||||
export type MapperProjectionKey = "FULL" | "LIST" | "REPORTS" | (string & {});
|
export type MapperProjectionKey = "FULL" | "LIST" | "REPORT" | (string & {});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 🏗️ Registro/Fábrica de mappers (Strategy/Factory)
|
* 🏗️ Registro/Fábrica de mappers (Strategy/Factory)
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
export * from "./create-customer-invoices.assembler";
|
|
||||||
@ -1,2 +1,2 @@
|
|||||||
export * from "./assembler";
|
export * from "./presenter";
|
||||||
export * from "./create-customer-invoice.use-case";
|
export * from "./create-customer-invoice.use-case";
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { CustomerInvoice } from "../../../domain";
|
|||||||
|
|
||||||
type CreateCustomerInvoiceItemsByInvoiceIdResponseDTO = CreateCustomerInvoiceResponseDTO["items"];
|
type CreateCustomerInvoiceItemsByInvoiceIdResponseDTO = CreateCustomerInvoiceResponseDTO["items"];
|
||||||
|
|
||||||
export class CreateCustomerInvoiceItemsAssembler {
|
export class CreateCustomerInvoiceItemsPresenter {
|
||||||
toDTO(invoice: CustomerInvoice): CreateCustomerInvoiceItemsByInvoiceIdResponseDTO {
|
toDTO(invoice: CustomerInvoice): CreateCustomerInvoiceItemsByInvoiceIdResponseDTO {
|
||||||
const { items } = invoice;
|
const { items } = invoice;
|
||||||
return items.map((item, index) => ({
|
return items.map((item, index) => ({
|
||||||
@ -1,17 +1,17 @@
|
|||||||
import { UpdateCustomerInvoiceByIdResponseDTO } from "@erp/customer-invoices/common/dto";
|
import { UpdateCustomerInvoiceByIdResponseDTO } from "@erp/customer-invoices/common/dto";
|
||||||
import { toEmptyString } from "@repo/rdx-ddd";
|
import { toEmptyString } from "@repo/rdx-ddd";
|
||||||
import { CustomerInvoice } from "../../../domain";
|
import { CustomerInvoice } from "../../../domain";
|
||||||
import { CreateCustomerInvoiceItemsAssembler } from "./create-customer-invoice-items.assembler";
|
import { CreateCustomerInvoiceItemsPresenter } from "./create-customer-invoice-items.presenter";
|
||||||
|
|
||||||
export class CreateCustomerInvoiceAssembler {
|
export class CreateCustomerInvoicePresenter {
|
||||||
private _itemsAssembler!: CreateCustomerInvoiceItemsAssembler;
|
private _itemsPresenter!: CreateCustomerInvoiceItemsPresenter;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this._itemsAssembler = new CreateCustomerInvoiceItemsAssembler();
|
this._itemsPresenter = new CreateCustomerInvoiceItemsPresenter();
|
||||||
}
|
}
|
||||||
|
|
||||||
public toDTO(invoice: CustomerInvoice): UpdateCustomerInvoiceByIdResponseDTO {
|
public toDTO(invoice: CustomerInvoice): UpdateCustomerInvoiceByIdResponseDTO {
|
||||||
const items = this._itemsAssembler.toDTO(invoice);
|
const items = this._itemsPresenter.toDTO(invoice);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: invoice.id.toPrimitive(),
|
id: invoice.id.toPrimitive(),
|
||||||
@ -0,0 +1 @@
|
|||||||
|
export * from "./create-customer-invoices.presenter";
|
||||||
@ -1 +0,0 @@
|
|||||||
export * from "./get-invoice.assembler";
|
|
||||||
@ -1,2 +1,2 @@
|
|||||||
export * from "./assembler";
|
export * from "./presenter";
|
||||||
export * from "./get-customer-invoice.use-case";
|
export * from "./get-customer-invoice.use-case";
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { CustomerInvoiceItem } from "#/server/domain";
|
|||||||
import { IInvoicingContext } from "#/server/intrastructure";
|
import { IInvoicingContext } from "#/server/intrastructure";
|
||||||
import { Collection } from "@rdx/core";
|
import { Collection } from "@rdx/core";
|
||||||
|
|
||||||
export const customerInvoiceItemAssembler = (items: Collection<CustomerInvoiceItem>, context: IInvoicingContext) =>
|
export const customerInvoiceItemPresenter = (items: Collection<CustomerInvoiceItem>, context: IInvoicingContext) =>
|
||||||
items.totalCount > 0
|
items.totalCount > 0
|
||||||
? items.items.map((item: CustomerInvoiceItem) => ({
|
? items.items.map((item: CustomerInvoiceItem) => ({
|
||||||
description: item.description.toString(),
|
description: item.description.toString(),
|
||||||
@ -1,9 +1,9 @@
|
|||||||
import { ICustomerInvoiceParticipant } from "@/contexts/invoicing/domain";
|
import { ICustomerInvoiceParticipant } from "@/contexts/invoicing/domain";
|
||||||
import { IInvoicingContext } from "@/contexts/invoicing/intrastructure/InvoicingContext";
|
import { IInvoicingContext } from "@/contexts/invoicing/intrastructure/InvoicingContext";
|
||||||
import { ICreateCustomerInvoice_Participant_Response_DTO } from "@shared/contexts";
|
import { ICreateCustomerInvoice_Participant_Response_DTO } from "@shared/contexts";
|
||||||
import { CustomerInvoiceParticipantAddressAssembler } from "./CustomerInvoiceParticipantAddress.assembler";
|
import { CustomerInvoiceParticipantAddressPresenter } from "./CustomerInvoiceParticipantAddress.presenter";
|
||||||
|
|
||||||
export const CustomerInvoiceParticipantAssembler = async (
|
export const CustomerInvoiceParticipantPresenter = async (
|
||||||
participant: ICustomerInvoiceParticipant,
|
participant: ICustomerInvoiceParticipant,
|
||||||
context: IInvoicingContext,
|
context: IInvoicingContext,
|
||||||
): Promise<ICreateCustomerInvoice_Participant_Response_DTO | undefined> => {
|
): Promise<ICreateCustomerInvoice_Participant_Response_DTO | undefined> => {
|
||||||
@ -14,11 +14,11 @@ export const CustomerInvoiceParticipantAssembler = async (
|
|||||||
last_name: participant.lastName.toString(),
|
last_name: participant.lastName.toString(),
|
||||||
company_name: participant.companyName.toString(),
|
company_name: participant.companyName.toString(),
|
||||||
|
|
||||||
billing_address: await CustomerInvoiceParticipantAddressAssembler(
|
billing_address: await CustomerInvoiceParticipantAddressPresenter(
|
||||||
participant.billingAddress!,
|
participant.billingAddress!,
|
||||||
context,
|
context,
|
||||||
),
|
),
|
||||||
shipping_address: await CustomerInvoiceParticipantAddressAssembler(
|
shipping_address: await CustomerInvoiceParticipantAddressPresenter(
|
||||||
participant.shippingAddress!,
|
participant.shippingAddress!,
|
||||||
context,
|
context,
|
||||||
),
|
),
|
||||||
@ -2,7 +2,7 @@ import { CustomerInvoiceParticipantAddress } from "@/contexts/invoicing/domain";
|
|||||||
import { IInvoicingContext } from "@/contexts/invoicing/intrastructure/InvoicingContext";
|
import { IInvoicingContext } from "@/contexts/invoicing/intrastructure/InvoicingContext";
|
||||||
import { ICreateCustomerInvoice_AddressParticipant_Response_DTO } from "@shared/contexts";
|
import { ICreateCustomerInvoice_AddressParticipant_Response_DTO } from "@shared/contexts";
|
||||||
|
|
||||||
export const CustomerInvoiceParticipantAddressAssembler = async (
|
export const CustomerInvoiceParticipantAddressPresenter = async (
|
||||||
address: CustomerInvoiceParticipantAddress,
|
address: CustomerInvoiceParticipantAddress,
|
||||||
context: IInvoicingContext,
|
context: IInvoicingContext,
|
||||||
): Promise<ICreateCustomerInvoice_AddressParticipant_Response_DTO> => {
|
): Promise<ICreateCustomerInvoice_AddressParticipant_Response_DTO> => {
|
||||||
@ -4,7 +4,7 @@ import { CustomerInvoice } from "../../../domain";
|
|||||||
|
|
||||||
type GetCustomerInvoiceItemsByInvoiceIdResponseDTO = GetCustomerInvoiceByIdResponseDTO["items"];
|
type GetCustomerInvoiceItemsByInvoiceIdResponseDTO = GetCustomerInvoiceByIdResponseDTO["items"];
|
||||||
|
|
||||||
export class GetCustomerInvoiceItemsAssembler {
|
export class GetCustomerInvoiceItemsPresenter {
|
||||||
toDTO(invoice: CustomerInvoice): GetCustomerInvoiceItemsByInvoiceIdResponseDTO {
|
toDTO(invoice: CustomerInvoice): GetCustomerInvoiceItemsByInvoiceIdResponseDTO {
|
||||||
const { items } = invoice;
|
const { items } = invoice;
|
||||||
|
|
||||||
@ -1,17 +1,17 @@
|
|||||||
import { UpdateCustomerInvoiceByIdResponseDTO } from "@erp/customer-invoices/common/dto";
|
import { UpdateCustomerInvoiceByIdResponseDTO } from "@erp/customer-invoices/common/dto";
|
||||||
import { toEmptyString } from "@repo/rdx-ddd";
|
import { toEmptyString } from "@repo/rdx-ddd";
|
||||||
import { CustomerInvoice } from "../../../domain";
|
import { CustomerInvoice } from "../../../domain";
|
||||||
import { GetCustomerInvoiceItemsAssembler } from "./get-invoice-items.assembler";
|
import { GetCustomerInvoiceItemsPresenter } from "./get-invoice-items.presenter";
|
||||||
|
|
||||||
export class GetCustomerInvoiceAssembler {
|
export class GetCustomerInvoicePresenter {
|
||||||
private _itemsAssembler!: GetCustomerInvoiceItemsAssembler;
|
private _itemsPresenter!: GetCustomerInvoiceItemsPresenter;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this._itemsAssembler = new GetCustomerInvoiceItemsAssembler();
|
this._itemsPresenter = new GetCustomerInvoiceItemsPresenter();
|
||||||
}
|
}
|
||||||
|
|
||||||
public toDTO(invoice: CustomerInvoice): UpdateCustomerInvoiceByIdResponseDTO {
|
public toDTO(invoice: CustomerInvoice): UpdateCustomerInvoiceByIdResponseDTO {
|
||||||
const items = this._itemsAssembler.toDTO(invoice);
|
const items = this._itemsPresenter.toDTO(invoice);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: invoice.id.toString(),
|
id: invoice.id.toString(),
|
||||||
@ -0,0 +1 @@
|
|||||||
|
export * from "./get-invoice.presenter";
|
||||||
@ -1 +0,0 @@
|
|||||||
export * from "./list-customer-invoices.assembler";
|
|
||||||
@ -1,2 +1,2 @@
|
|||||||
export * from "./assembler";
|
export * from "./presenter";
|
||||||
export * from "./list-customer-invoices.use-case";
|
export * from "./list-customer-invoices.use-case";
|
||||||
|
|||||||
@ -0,0 +1 @@
|
|||||||
|
export * from "./list-customer-invoices.presenter";
|
||||||
@ -1,14 +1,17 @@
|
|||||||
|
import { IPresenter } from "@erp/core/api";
|
||||||
import { CustomerInvoiceListDTO } from "@erp/customer-invoices/api/infrastructure";
|
import { CustomerInvoiceListDTO } from "@erp/customer-invoices/api/infrastructure";
|
||||||
import { Criteria } from "@repo/rdx-criteria/server";
|
import { Criteria } from "@repo/rdx-criteria/server";
|
||||||
import { toEmptyString } from "@repo/rdx-ddd";
|
import { toEmptyString } from "@repo/rdx-ddd";
|
||||||
import { ArrayElement, Collection } from "@repo/rdx-utils";
|
import { ArrayElement, Collection } from "@repo/rdx-utils";
|
||||||
import { CustomerInvoiceListResponseDTO } from "../../../../common/dto";
|
import { CustomerInvoiceListResponseDTO } from "../../../../common/dto";
|
||||||
|
|
||||||
export class ListCustomerInvoicesAssembler {
|
export class ListCustomerInvoicesPresenter implements IPresenter {
|
||||||
toDTO(
|
toOutput(params: {
|
||||||
customerInvoices: Collection<CustomerInvoiceListDTO>,
|
customerInvoices: Collection<CustomerInvoiceListDTO>;
|
||||||
criteria: Criteria
|
criteria: Criteria;
|
||||||
): CustomerInvoiceListResponseDTO {
|
}): CustomerInvoiceListResponseDTO {
|
||||||
|
const { customerInvoices, criteria } = params;
|
||||||
|
|
||||||
const invoices = customerInvoices.map((invoice) => {
|
const invoices = customerInvoices.map((invoice) => {
|
||||||
const recipientDTO = invoice.recipient.toObjectString();
|
const recipientDTO = invoice.recipient.toObjectString();
|
||||||
|
|
||||||
@ -1 +0,0 @@
|
|||||||
export * from "./update-invoice.assembler";
|
|
||||||
@ -1,2 +1,2 @@
|
|||||||
export * from "./assembler";
|
export * from "./presenter";
|
||||||
export * from "./update-customer-invoice.use-case";
|
export * from "./update-customer-invoice.use-case";
|
||||||
|
|||||||
@ -0,0 +1 @@
|
|||||||
|
export * from "./update-invoice.presenter";
|
||||||
@ -5,7 +5,7 @@ import { CustomerInvoice } from "../../../domain";
|
|||||||
type UpdateCustomerInvoiceItemsByInvoiceIdResponseDTO =
|
type UpdateCustomerInvoiceItemsByInvoiceIdResponseDTO =
|
||||||
UpdateCustomerInvoiceByIdResponseDTO["items"];
|
UpdateCustomerInvoiceByIdResponseDTO["items"];
|
||||||
|
|
||||||
export class UpdateCustomerInvoiceItemsAssembler {
|
export class UpdateCustomerInvoiceItemsPresenter {
|
||||||
toDTO(invoice: CustomerInvoice): UpdateCustomerInvoiceItemsByInvoiceIdResponseDTO {
|
toDTO(invoice: CustomerInvoice): UpdateCustomerInvoiceItemsByInvoiceIdResponseDTO {
|
||||||
const { items } = invoice;
|
const { items } = invoice;
|
||||||
return items.map((item, index) => ({
|
return items.map((item, index) => ({
|
||||||
@ -1,17 +1,17 @@
|
|||||||
import { toEmptyString } from "@repo/rdx-ddd";
|
import { toEmptyString } from "@repo/rdx-ddd";
|
||||||
import { UpdateCustomerInvoiceByIdResponseDTO } from "../../../../common/dto";
|
import { UpdateCustomerInvoiceByIdResponseDTO } from "../../../../common/dto";
|
||||||
import { CustomerInvoice } from "../../../domain";
|
import { CustomerInvoice } from "../../../domain";
|
||||||
import { UpdateCustomerInvoiceItemsAssembler } from "./update-invoice-items.assembler";
|
import { UpdateCustomerInvoiceItemsPresenter } from "./update-invoice-items.presenter";
|
||||||
|
|
||||||
export class UpdateCustomerInvoiceAssembler {
|
export class UpdateCustomerInvoicePresenter {
|
||||||
private _itemsAssembler!: UpdateCustomerInvoiceItemsAssembler;
|
private _itemsPresenter!: UpdateCustomerInvoiceItemsPresenter;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this._itemsAssembler = new UpdateCustomerInvoiceItemsAssembler();
|
this._itemsPresenter = new UpdateCustomerInvoiceItemsPresenter();
|
||||||
}
|
}
|
||||||
|
|
||||||
public toDTO(invoice: CustomerInvoice): UpdateCustomerInvoiceByIdResponseDTO {
|
public toDTO(invoice: CustomerInvoice): UpdateCustomerInvoiceByIdResponseDTO {
|
||||||
const items = this._itemsAssembler.toDTO(invoice);
|
const items = this._itemsPresenter.toDTO(invoice);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: invoice.id.toPrimitive(),
|
id: invoice.id.toPrimitive(),
|
||||||
@ -82,10 +82,10 @@ export class UpdateCustomerInvoiceAssembler {
|
|||||||
}))
|
}))
|
||||||
: [],*/
|
: [],*/
|
||||||
|
|
||||||
//sender: {}, //await CustomerInvoiceParticipantAssembler(customerInvoice.senderId, context),
|
//sender: {}, //await CustomerInvoiceParticipantPresenter(customerInvoice.senderId, context),
|
||||||
|
|
||||||
/*recipient: await CustomerInvoiceParticipantAssembler(customerInvoice.recipient, context),
|
/*recipient: await CustomerInvoiceParticipantPresenter(customerInvoice.recipient, context),
|
||||||
items: customerInvoiceItemAssembler(customerInvoice.items, context),
|
items: customerInvoiceItemPresenter(customerInvoice.items, context),
|
||||||
|
|
||||||
payment_term: {
|
payment_term: {
|
||||||
payment_type: "",
|
payment_type: "",
|
||||||
@ -6,15 +6,12 @@ import {
|
|||||||
SequelizeTransactionManager,
|
SequelizeTransactionManager,
|
||||||
} from "@erp/core/api";
|
} from "@erp/core/api";
|
||||||
import {
|
import {
|
||||||
CreateCustomerInvoiceAssembler,
|
|
||||||
CreateCustomerInvoiceUseCase,
|
CreateCustomerInvoiceUseCase,
|
||||||
DeleteCustomerInvoiceUseCase,
|
DeleteCustomerInvoiceUseCase,
|
||||||
GetCustomerInvoiceAssembler,
|
|
||||||
GetCustomerInvoiceUseCase,
|
GetCustomerInvoiceUseCase,
|
||||||
ListCustomerInvoicesAssembler,
|
ListCustomerInvoicesPresenter,
|
||||||
ListCustomerInvoicesUseCase,
|
ListCustomerInvoicesUseCase,
|
||||||
ReportCustomerInvoiceUseCase,
|
ReportCustomerInvoiceUseCase,
|
||||||
UpdateCustomerInvoiceAssembler,
|
|
||||||
UpdateCustomerInvoiceUseCase,
|
UpdateCustomerInvoiceUseCase,
|
||||||
} from "../application";
|
} from "../application";
|
||||||
import { CustomerInvoiceService } from "../domain";
|
import { CustomerInvoiceService } from "../domain";
|
||||||
@ -24,17 +21,12 @@ import { CustomerInvoiceRepository } from "./sequelize";
|
|||||||
type InvoiceDeps = {
|
type InvoiceDeps = {
|
||||||
transactionManager: SequelizeTransactionManager;
|
transactionManager: SequelizeTransactionManager;
|
||||||
mapperRegistry: IMapperRegistry;
|
mapperRegistry: IMapperRegistry;
|
||||||
|
presenterRegistry: IPresenterRegistry;
|
||||||
repo: CustomerInvoiceRepository;
|
repo: CustomerInvoiceRepository;
|
||||||
service: CustomerInvoiceService;
|
service: CustomerInvoiceService;
|
||||||
catalogs: {
|
catalogs: {
|
||||||
taxes: JsonTaxCatalogProvider;
|
taxes: JsonTaxCatalogProvider;
|
||||||
};
|
};
|
||||||
presenters: {
|
|
||||||
list: ListCustomerInvoicesAssembler;
|
|
||||||
get: GetCustomerInvoiceAssembler;
|
|
||||||
create: CreateCustomerInvoiceAssembler;
|
|
||||||
update: UpdateCustomerInvoiceAssembler;
|
|
||||||
};
|
|
||||||
build: {
|
build: {
|
||||||
list: () => ListCustomerInvoicesUseCase;
|
list: () => ListCustomerInvoicesUseCase;
|
||||||
get: () => GetCustomerInvoiceUseCase;
|
get: () => GetCustomerInvoiceUseCase;
|
||||||
@ -50,7 +42,6 @@ let _mapperRegistry: IMapperRegistry | null = null;
|
|||||||
|
|
||||||
let _repo: CustomerInvoiceRepository | null = null;
|
let _repo: CustomerInvoiceRepository | null = null;
|
||||||
let _service: CustomerInvoiceService | null = null;
|
let _service: CustomerInvoiceService | null = null;
|
||||||
const _presenters: InvoiceDeps["presenters"] | null = null;
|
|
||||||
let _catalogs: InvoiceDeps["catalogs"] | null = null;
|
let _catalogs: InvoiceDeps["catalogs"] | null = null;
|
||||||
|
|
||||||
export function getInvoiceDependencies(params: ModuleParams): InvoiceDeps {
|
export function getInvoiceDependencies(params: ModuleParams): InvoiceDeps {
|
||||||
@ -73,43 +64,56 @@ export function getInvoiceDependencies(params: ModuleParams): InvoiceDeps {
|
|||||||
|
|
||||||
if (!_presenterRegistry) {
|
if (!_presenterRegistry) {
|
||||||
_presenterRegistry = new InMemoryPresenterRegistry();
|
_presenterRegistry = new InMemoryPresenterRegistry();
|
||||||
_presenterRegistry.registerPresenter(key, mapper);
|
_presenterRegistry.registerPresenter(
|
||||||
/*_presenters = {
|
{
|
||||||
list: new ListCustomerInvoicesAssembler(), // transforma domain → ListDTO
|
projection: "LIST",
|
||||||
get: new GetCustomerInvoiceAssembler(), // transforma domain → DetailDTO
|
},
|
||||||
create: new CreateCustomerInvoiceAssembler(), // transforma domain → CreatedDTO
|
new ListCustomerInvoicesPresenter()
|
||||||
update: new UpdateCustomerInvoiceAssembler(), // transforma domain -> UpdateDTO
|
);
|
||||||
};*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
transactionManager,
|
transactionManager,
|
||||||
repo: _repo,
|
repo: _repo,
|
||||||
mapperRegistry: _mapperRegistry,
|
mapperRegistry: _mapperRegistry,
|
||||||
|
presenterRegistry: _presenterRegistry,
|
||||||
service: _service,
|
service: _service,
|
||||||
presenters: _presenters,
|
|
||||||
catalogs: _catalogs,
|
catalogs: _catalogs,
|
||||||
|
|
||||||
build: {
|
build: {
|
||||||
list: () =>
|
list: () =>
|
||||||
new ListCustomerInvoicesUseCase(_service!, transactionManager!, _presenters!.list),
|
new ListCustomerInvoicesUseCase(
|
||||||
get: () => new GetCustomerInvoiceUseCase(_service!, transactionManager!, _presenters!.get),
|
_service!,
|
||||||
|
transactionManager!,
|
||||||
|
_presenterRegistry?.getPresenter({ projection: "LIST" })
|
||||||
|
),
|
||||||
|
get: () =>
|
||||||
|
new GetCustomerInvoiceUseCase(
|
||||||
|
_service!,
|
||||||
|
transactionManager!,
|
||||||
|
_presenterRegistry?.getPresenter({ projection: "FULL" })
|
||||||
|
),
|
||||||
create: () =>
|
create: () =>
|
||||||
new CreateCustomerInvoiceUseCase(
|
new CreateCustomerInvoiceUseCase(
|
||||||
_service!,
|
_service!,
|
||||||
transactionManager!,
|
transactionManager!,
|
||||||
_presenters!.create,
|
_presenterRegistry?.getPresenter({ projection: "FULL" }),
|
||||||
_catalogs!.taxes
|
_catalogs!.taxes
|
||||||
),
|
),
|
||||||
update: () =>
|
update: () =>
|
||||||
new UpdateCustomerInvoiceUseCase(
|
new UpdateCustomerInvoiceUseCase(
|
||||||
_service!,
|
_service!,
|
||||||
transactionManager!,
|
transactionManager!,
|
||||||
_presenters!.update,
|
_presenterRegistry?.getPresenter({ projection: "FULL" }),
|
||||||
_catalogs!.taxes
|
_catalogs!.taxes
|
||||||
),
|
),
|
||||||
delete: () => new DeleteCustomerInvoiceUseCase(_service!, transactionManager!),
|
delete: () => new DeleteCustomerInvoiceUseCase(_service!, transactionManager!),
|
||||||
report: () =>
|
report: () =>
|
||||||
new ReportCustomerInvoiceUseCase(_service!, transactionManager!, _presenters!.get),
|
new ReportCustomerInvoiceUseCase(
|
||||||
|
_service!,
|
||||||
|
transactionManager!,
|
||||||
|
_presenterRegistry?.getPresenter({ projection: "REPORT" })
|
||||||
|
),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
export * from "./create-customers.assembler";
|
|
||||||
@ -1,2 +1,2 @@
|
|||||||
export * from "./assembler";
|
export * from "./presenter";
|
||||||
export * from "./create-customer.use-case";
|
export * from "./create-customer.use-case";
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { toEmptyString } from "@repo/rdx-ddd";
|
|||||||
import { CustomerCreationResponseDTO } from "../../../../common";
|
import { CustomerCreationResponseDTO } from "../../../../common";
|
||||||
import { Customer } from "../../../domain";
|
import { Customer } from "../../../domain";
|
||||||
|
|
||||||
export class CreateCustomersAssembler {
|
export class CreateCustomersPresenter {
|
||||||
public toDTO(customer: Customer): CustomerCreationResponseDTO {
|
public toDTO(customer: Customer): CustomerCreationResponseDTO {
|
||||||
const address = customer.address.toPrimitive();
|
const address = customer.address.toPrimitive();
|
||||||
|
|
||||||
@ -0,0 +1 @@
|
|||||||
|
export * from "./create-customers.presenter";
|
||||||
@ -1 +0,0 @@
|
|||||||
export * from "./get-customer.assembler";
|
|
||||||
@ -1,2 +1,2 @@
|
|||||||
export * from "./assembler";
|
export * from "./presenter";
|
||||||
export * from "./get-customer.use-case";
|
export * from "./get-customer.use-case";
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { CustomerItem } from "#/server/domain";
|
|||||||
import { IInvoicingContext } from "#/server/intrastructure";
|
import { IInvoicingContext } from "#/server/intrastructure";
|
||||||
import { Collection } from "@rdx/core";
|
import { Collection } from "@rdx/core";
|
||||||
|
|
||||||
export const customerItemAssembler = (items: Collection<CustomerItem>, context: IInvoicingContext) =>
|
export const customerItemPresenter = (items: Collection<CustomerItem>, context: IInvoicingContext) =>
|
||||||
items.totalCount > 0
|
items.totalCount > 0
|
||||||
? items.items.map((item: CustomerItem) => ({
|
? items.items.map((item: CustomerItem) => ({
|
||||||
description: item.description.toString(),
|
description: item.description.toString(),
|
||||||
@ -1,9 +1,9 @@
|
|||||||
import { ICustomerParticipant } from "@/contexts/invoicing/domain";
|
import { ICustomerParticipant } from "@/contexts/invoicing/domain";
|
||||||
import { IInvoicingContext } from "@/contexts/invoicing/intrastructure/InvoicingContext";
|
import { IInvoicingContext } from "@/contexts/invoicing/intrastructure/InvoicingContext";
|
||||||
import { ICreateCustomer_Participant_Response_DTO } from "@shared/contexts";
|
import { ICreateCustomer_Participant_Response_DTO } from "@shared/contexts";
|
||||||
import { CustomerParticipantAddressAssembler } from "./CustomerParticipantAddress.assembler";
|
import { CustomerParticipantAddressPresenter } from "./CustomerParticipantAddress.presenter";
|
||||||
|
|
||||||
export const CustomerParticipantAssembler = async (
|
export const CustomerParticipantPresenter = async (
|
||||||
participant: ICustomerParticipant,
|
participant: ICustomerParticipant,
|
||||||
context: IInvoicingContext,
|
context: IInvoicingContext,
|
||||||
): Promise<ICreateCustomer_Participant_Response_DTO | undefined> => {
|
): Promise<ICreateCustomer_Participant_Response_DTO | undefined> => {
|
||||||
@ -14,11 +14,11 @@ export const CustomerParticipantAssembler = async (
|
|||||||
last_name: participant.lastName.toString(),
|
last_name: participant.lastName.toString(),
|
||||||
company_name: participant.companyName.toString(),
|
company_name: participant.companyName.toString(),
|
||||||
|
|
||||||
billing_address: await CustomerParticipantAddressAssembler(
|
billing_address: await CustomerParticipantAddressPresenter(
|
||||||
participant.billingAddress!,
|
participant.billingAddress!,
|
||||||
context,
|
context,
|
||||||
),
|
),
|
||||||
shipping_address: await CustomerParticipantAddressAssembler(
|
shipping_address: await CustomerParticipantAddressPresenter(
|
||||||
participant.shippingAddress!,
|
participant.shippingAddress!,
|
||||||
context,
|
context,
|
||||||
),
|
),
|
||||||
@ -2,7 +2,7 @@ import { CustomerParticipantAddress } from "@/contexts/invoicing/domain";
|
|||||||
import { IInvoicingContext } from "@/contexts/invoicing/intrastructure/InvoicingContext";
|
import { IInvoicingContext } from "@/contexts/invoicing/intrastructure/InvoicingContext";
|
||||||
import { ICreateCustomer_AddressParticipant_Response_DTO } from "@shared/contexts";
|
import { ICreateCustomer_AddressParticipant_Response_DTO } from "@shared/contexts";
|
||||||
|
|
||||||
export const CustomerParticipantAddressAssembler = async (
|
export const CustomerParticipantAddressPresenter = async (
|
||||||
address: CustomerParticipantAddress,
|
address: CustomerParticipantAddress,
|
||||||
context: IInvoicingContext,
|
context: IInvoicingContext,
|
||||||
): Promise<ICreateCustomer_AddressParticipant_Response_DTO> => {
|
): Promise<ICreateCustomer_AddressParticipant_Response_DTO> => {
|
||||||
@ -2,7 +2,7 @@ import { toEmptyString } from "@repo/rdx-ddd";
|
|||||||
import { GetCustomerByIdResponseDTO } from "../../../../common/dto";
|
import { GetCustomerByIdResponseDTO } from "../../../../common/dto";
|
||||||
import { Customer } from "../../../domain";
|
import { Customer } from "../../../domain";
|
||||||
|
|
||||||
export class GetCustomerAssembler {
|
export class GetCustomerPresenter {
|
||||||
toDTO(customer: Customer): GetCustomerByIdResponseDTO {
|
toDTO(customer: Customer): GetCustomerByIdResponseDTO {
|
||||||
const address = customer.address.toPrimitive();
|
const address = customer.address.toPrimitive();
|
||||||
|
|
||||||
@ -0,0 +1 @@
|
|||||||
|
export * from "./get-customer.presenter";
|
||||||
@ -1 +0,0 @@
|
|||||||
export * from "./list-customers.assembler";
|
|
||||||
@ -1,2 +1,2 @@
|
|||||||
export * from "./assembler";
|
export * from "./presenter";
|
||||||
export * from "./list-customers.use-case";
|
export * from "./list-customers.use-case";
|
||||||
|
|||||||
@ -0,0 +1 @@
|
|||||||
|
export * from "./list-customers.presenter";
|
||||||
@ -4,7 +4,7 @@ import { Collection } from "@repo/rdx-utils";
|
|||||||
import { CustomerListResponsetDTO } from "../../../../common/dto";
|
import { CustomerListResponsetDTO } from "../../../../common/dto";
|
||||||
import { Customer } from "../../../domain";
|
import { Customer } from "../../../domain";
|
||||||
|
|
||||||
export class ListCustomersAssembler {
|
export class ListCustomersPresenter {
|
||||||
toDTO(customers: Collection<Customer>, criteria: Criteria): CustomerListResponsetDTO {
|
toDTO(customers: Collection<Customer>, criteria: Criteria): CustomerListResponsetDTO {
|
||||||
const items: CustomerListResponsetDTO["items"] = customers.map((customer) => {
|
const items: CustomerListResponsetDTO["items"] = customers.map((customer) => {
|
||||||
const address = customer.address.toPrimitive();
|
const address = customer.address.toPrimitive();
|
||||||
@ -1 +0,0 @@
|
|||||||
export * from "./update-customer.assembler";
|
|
||||||
@ -1,2 +1,2 @@
|
|||||||
export * from "./assembler";
|
export * from "./presenter";
|
||||||
export * from "./update-customer.use-case";
|
export * from "./update-customer.use-case";
|
||||||
|
|||||||
@ -0,0 +1 @@
|
|||||||
|
export * from "./update-customer.presenter";
|
||||||
@ -2,7 +2,7 @@ import { toEmptyString } from "@repo/rdx-ddd";
|
|||||||
import { UpdateCustomerByIdResponseDTO } from "../../../../common/dto";
|
import { UpdateCustomerByIdResponseDTO } from "../../../../common/dto";
|
||||||
import { Customer } from "../../../domain";
|
import { Customer } from "../../../domain";
|
||||||
|
|
||||||
export class UpdateCustomerAssembler {
|
export class UpdateCustomerPresenter {
|
||||||
toDTO(customer: Customer): UpdateCustomerByIdResponseDTO {
|
toDTO(customer: Customer): UpdateCustomerByIdResponseDTO {
|
||||||
const address = customer.address.toPrimitive();
|
const address = customer.address.toPrimitive();
|
||||||
|
|
||||||
@ -1,15 +1,17 @@
|
|||||||
import type { ModuleParams } from "@erp/core/api";
|
import type { IMapperRegistry, IPresenterRegistry, ModuleParams } from "@erp/core/api";
|
||||||
import { SequelizeTransactionManager } from "@erp/core/api";
|
import {
|
||||||
|
InMemoryMapperRegistry,
|
||||||
|
InMemoryPresenterRegistry,
|
||||||
|
SequelizeTransactionManager,
|
||||||
|
} from "@erp/core/api";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CreateCustomerUseCase,
|
CreateCustomerUseCase,
|
||||||
CreateCustomersAssembler,
|
|
||||||
DeleteCustomerUseCase,
|
DeleteCustomerUseCase,
|
||||||
GetCustomerAssembler,
|
GetCustomerAssembler,
|
||||||
GetCustomerUseCase,
|
GetCustomerUseCase,
|
||||||
ListCustomersAssembler,
|
ListCustomersAssembler,
|
||||||
ListCustomersUseCase,
|
ListCustomersUseCase,
|
||||||
UpdateCustomerAssembler,
|
|
||||||
UpdateCustomerUseCase,
|
UpdateCustomerUseCase,
|
||||||
} from "../application";
|
} from "../application";
|
||||||
import { CustomerService } from "../domain";
|
import { CustomerService } from "../domain";
|
||||||
@ -18,15 +20,10 @@ import { CustomerRepository } from "./sequelize";
|
|||||||
|
|
||||||
type CustomerDeps = {
|
type CustomerDeps = {
|
||||||
transactionManager: SequelizeTransactionManager;
|
transactionManager: SequelizeTransactionManager;
|
||||||
|
mapperRegistry: IMapperRegistry;
|
||||||
|
presenterRegistry: IPresenterRegistry;
|
||||||
repo: CustomerRepository;
|
repo: CustomerRepository;
|
||||||
mapper: CustomerMapper;
|
|
||||||
service: CustomerService;
|
service: CustomerService;
|
||||||
assemblers: {
|
|
||||||
list: ListCustomersAssembler;
|
|
||||||
get: GetCustomerAssembler;
|
|
||||||
create: CreateCustomersAssembler;
|
|
||||||
update: UpdateCustomerAssembler;
|
|
||||||
};
|
|
||||||
build: {
|
build: {
|
||||||
list: () => ListCustomersUseCase;
|
list: () => ListCustomersUseCase;
|
||||||
get: () => GetCustomerUseCase;
|
get: () => GetCustomerUseCase;
|
||||||
@ -34,39 +31,56 @@ type CustomerDeps = {
|
|||||||
update: () => UpdateCustomerUseCase;
|
update: () => UpdateCustomerUseCase;
|
||||||
delete: () => DeleteCustomerUseCase;
|
delete: () => DeleteCustomerUseCase;
|
||||||
};
|
};
|
||||||
presenters: {
|
|
||||||
// list: <T>(res: Response) => ListPresenter<T>;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let _presenterRegistry: IPresenterRegistry | null = null;
|
||||||
|
let _mapperRegistry: IMapperRegistry | null = null;
|
||||||
|
|
||||||
let _repo: CustomerRepository | null = null;
|
let _repo: CustomerRepository | null = null;
|
||||||
let _mapper: CustomerMapper | null = null;
|
|
||||||
let _service: CustomerService | null = null;
|
let _service: CustomerService | null = null;
|
||||||
let _assemblers: CustomerDeps["assemblers"] | null = null;
|
|
||||||
|
|
||||||
export function getCustomerDependencies(params: ModuleParams): CustomerDeps {
|
export function getCustomerDependencies(params: ModuleParams): CustomerDeps {
|
||||||
const { database } = params;
|
const { database } = params;
|
||||||
const transactionManager = new SequelizeTransactionManager(database);
|
const transactionManager = new SequelizeTransactionManager(database);
|
||||||
|
|
||||||
if (!_mapper) _mapper = new CustomerMapper();
|
if (!_mapperRegistry) {
|
||||||
if (!_repo) _repo = new CustomerRepository(_mapper);
|
_mapperRegistry = new InMemoryMapperRegistry();
|
||||||
|
_mapperRegistry.registerDomainMapper("FULL", new CustomerMapper());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_repo) _repo = new CustomerRepository({ mapperRegistry: _mapperRegistry });
|
||||||
if (!_service) _service = new CustomerService(_repo);
|
if (!_service) _service = new CustomerService(_repo);
|
||||||
|
|
||||||
if (!_assemblers) {
|
if (!_presenterRegistry) {
|
||||||
|
_presenterRegistry = new InMemoryPresenterRegistry();
|
||||||
|
|
||||||
|
_presenterRegistry.registerPresenters([
|
||||||
|
{
|
||||||
|
key: { projection: "FULL" },
|
||||||
|
presenter: new ListCustomersAssembler(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: { projection: "LIST" },
|
||||||
|
presenter: new GetCustomerAssembler(),
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
|
/*if (!_assemblers) {
|
||||||
_assemblers = {
|
_assemblers = {
|
||||||
list: new ListCustomersAssembler(), // transforma domain → ListDTO
|
list: new ListCustomersAssembler(), // transforma domain → ListDTO
|
||||||
get: new GetCustomerAssembler(), // transforma domain → DetailDTO
|
get: new GetCustomerAssembler(), // transforma domain → DetailDTO
|
||||||
create: new CreateCustomersAssembler(), // transforma domain → CreatedDTO
|
create: new CreateCustomersAssembler(), // transforma domain → CreatedDTO
|
||||||
update: new UpdateCustomerAssembler(), // transforma domain -> UpdateDTO
|
update: new UpdateCustomerAssembler(), // transforma domain -> UpdateDTO
|
||||||
};
|
};*/
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
transactionManager,
|
transactionManager,
|
||||||
repo: _repo,
|
repo: _repo,
|
||||||
mapper: _mapper,
|
mapperRegistry: _mapperRegistry,
|
||||||
|
presenterRegistry: _presenterRegistry,
|
||||||
service: _service,
|
service: _service,
|
||||||
assemblers: _assemblers,
|
|
||||||
build: {
|
build: {
|
||||||
list: () => new ListCustomersUseCase(_service!, transactionManager!, _assemblers!.list),
|
list: () => new ListCustomersUseCase(_service!, transactionManager!, _assemblers!.list),
|
||||||
get: () => new GetCustomerUseCase(_service!, transactionManager!, _assemblers!.get),
|
get: () => new GetCustomerUseCase(_service!, transactionManager!, _assemblers!.get),
|
||||||
@ -74,9 +88,5 @@ export function getCustomerDependencies(params: ModuleParams): CustomerDeps {
|
|||||||
update: () => new UpdateCustomerUseCase(_service!, transactionManager!, _assemblers!.update),
|
update: () => new UpdateCustomerUseCase(_service!, transactionManager!, _assemblers!.update),
|
||||||
delete: () => new DeleteCustomerUseCase(_service!, transactionManager!),
|
delete: () => new DeleteCustomerUseCase(_service!, transactionManager!),
|
||||||
},
|
},
|
||||||
presenters: {
|
|
||||||
//list: <T>(res: Response) => createListPresenter<T>(res),
|
|
||||||
//json: <T>(res: Response, status: number = 200) => createJsonPresenter<T>(res, status),
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user