diff --git a/modules/customers/src/api/application/create-customer/assembler/create-customers.assembler.ts b/modules/customers/src/api/application/create-customer/assembler/create-customers.assembler.ts index f810e7c8..64d39e77 100644 --- a/modules/customers/src/api/application/create-customer/assembler/create-customers.assembler.ts +++ b/modules/customers/src/api/application/create-customer/assembler/create-customers.assembler.ts @@ -33,7 +33,7 @@ export class CreateCustomersAssembler { legal_record: toEmptyString(customer.legalRecord, (value) => value.toPrimitive()), - default_taxes: customer.defaultTaxes.map((item) => item.toPrimitive()), + default_taxes: customer.defaultTaxes.getAll().join(","), status: customer.isActive ? "active" : "inactive", language_code: customer.languageCode.toPrimitive(), diff --git a/modules/customers/src/api/application/get-customer/assembler/get-customer.assembler.ts b/modules/customers/src/api/application/get-customer/assembler/get-customer.assembler.ts index 4bc5b194..0eded6b3 100644 --- a/modules/customers/src/api/application/get-customer/assembler/get-customer.assembler.ts +++ b/modules/customers/src/api/application/get-customer/assembler/get-customer.assembler.ts @@ -33,11 +33,15 @@ export class GetCustomerAssembler { legal_record: toEmptyString(customer.legalRecord, (value) => value.toPrimitive()), - default_taxes: customer.defaultTaxes.map((item) => item.toPrimitive()), + default_taxes: customer.defaultTaxes.getAll().join(", "), status: customer.isActive ? "active" : "inactive", language_code: customer.languageCode.toPrimitive(), currency_code: customer.currencyCode.toPrimitive(), + + metadata: { + entity: "customer", + }, }; } } diff --git a/modules/customers/src/api/application/list-customers/assembler/list-customers.assembler.ts b/modules/customers/src/api/application/list-customers/assembler/list-customers.assembler.ts index 3045efa7..1edddd96 100644 --- a/modules/customers/src/api/application/list-customers/assembler/list-customers.assembler.ts +++ b/modules/customers/src/api/application/list-customers/assembler/list-customers.assembler.ts @@ -17,7 +17,7 @@ export class ListCustomersAssembler { () => "" ), - is_company: customer.isCompany, + is_company: String(customer.isCompany), name: customer.name.toPrimitive(), trade_name: customer.tradeName.match( (value) => value.toPrimitive(), @@ -71,7 +71,7 @@ export class ListCustomersAssembler { () => "" ), - default_taxes: customer.defaultTaxes.map((item) => item.toPrimitive()), + default_taxes: customer.defaultTaxes.getAll().join(", "), status: customer.isActive ? "active" : "inactive", language_code: customer.languageCode.toPrimitive(), diff --git a/modules/customers/src/common/dto/response/create-customer.result.dto.ts b/modules/customers/src/common/dto/response/create-customer.result.dto.ts index 99253b30..9a32d008 100644 --- a/modules/customers/src/common/dto/response/create-customer.result.dto.ts +++ b/modules/customers/src/common/dto/response/create-customer.result.dto.ts @@ -25,7 +25,7 @@ export const CreateCustomerResponseSchema = z.object({ legal_record: z.string(), - default_taxes: z.array(z.string()), + default_taxes: z.string(), status: z.string(), language_code: z.string(), currency_code: z.string(), diff --git a/modules/customers/src/common/dto/response/customer-list.response.dto.ts b/modules/customers/src/common/dto/response/customer-list.response.dto.ts index c0ab5824..0a8eea6c 100644 --- a/modules/customers/src/common/dto/response/customer-list.response.dto.ts +++ b/modules/customers/src/common/dto/response/customer-list.response.dto.ts @@ -4,9 +4,10 @@ import * as z from "zod/v4"; export const CustomerListResponseSchema = createListViewResponseSchema( z.object({ id: z.uuid(), + company_id: z.uuid(), reference: z.string(), - is_company: z.boolean(), + is_company: z.string(), name: z.string(), trade_name: z.string(), tin: z.string(), @@ -24,7 +25,7 @@ export const CustomerListResponseSchema = createListViewResponseSchema( legal_record: z.string(), - default_taxes: z.array(z.string()), + default_taxes: z.string(), status: z.string(), language_code: z.string(), currency_code: z.string(), diff --git a/modules/customers/src/common/dto/response/get-customer-by-id.response.dto.ts b/modules/customers/src/common/dto/response/get-customer-by-id.response.dto.ts index 2e874101..f3874833 100644 --- a/modules/customers/src/common/dto/response/get-customer-by-id.response.dto.ts +++ b/modules/customers/src/common/dto/response/get-customer-by-id.response.dto.ts @@ -25,7 +25,7 @@ export const GetCustomerByIdResponseSchema = z.object({ legal_record: z.string(), - default_taxes: z.array(z.string()), + default_taxes: z.string(), status: z.string(), language_code: z.string(), currency_code: z.string(),