.
This commit is contained in:
parent
ee70526376
commit
5ac24e161d
@ -81,9 +81,10 @@ export interface ICustomer {
|
||||
readonly phoneSecondary: Maybe<PhoneNumber>;
|
||||
readonly mobilePrimary: Maybe<PhoneNumber>;
|
||||
readonly mobileSecondary: Maybe<PhoneNumber>;
|
||||
readonly fax: Maybe<PhoneNumber>;
|
||||
|
||||
readonly fax: Maybe<PhoneNumber>;
|
||||
readonly website: Maybe<URLAddress>;
|
||||
|
||||
readonly legalRecord: Maybe<TextValue>;
|
||||
|
||||
readonly defaultTaxes: CustomerTaxes;
|
||||
|
||||
@ -4,7 +4,7 @@ import type { ICustomerPublicServices } from "./application";
|
||||
import { customersRouter, models } from "./infrastructure";
|
||||
import { buildCustomerPublicServices, buildCustomersDependencies } from "./infrastructure/di";
|
||||
|
||||
export * from "./infrastructure/sequelize";
|
||||
export * from "./infrastructure/persistence/sequelize";
|
||||
|
||||
export const customersAPIModule: IModuleServer = {
|
||||
name: "customers",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import type { ICatalogs } from "@erp/core/api";
|
||||
|
||||
import { SequelizeCustomerDomainMapper, SequelizeCustomerSummaryMapper } from "../mappers";
|
||||
import { SequelizeCustomerDomainMapper, SequelizeCustomerSummaryMapper } from "../persistence";
|
||||
|
||||
export interface ICustomerPersistenceMappers {
|
||||
domainMapper: SequelizeCustomerDomainMapper;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import type { Sequelize } from "sequelize";
|
||||
|
||||
import { CustomerRepository } from "../sequelize";
|
||||
import { CustomerRepository } from "../persistence/sequelize";
|
||||
|
||||
import type { ICustomerPersistenceMappers } from "./customer-persistence-mappers.di";
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { ApiErrorMapper, ErrorToApiRule, NotFoundApiError } from "@erp/core/api";
|
||||
import { CustomerNotFoundError, isCustomerNotFoundError } from "../../domain";
|
||||
import { ApiErrorMapper, type ErrorToApiRule, NotFoundApiError } from "@erp/core/api";
|
||||
|
||||
import { type CustomerNotFoundError, isCustomerNotFoundError } from "../../domain";
|
||||
|
||||
// Crea una regla específica (prioridad alta para sobreescribir mensajes)
|
||||
const customerNotFoundRule: ErrorToApiRule = {
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
export * from "./di";
|
||||
export * from "./express";
|
||||
export * from "./mappers";
|
||||
export * from "./sequelize";
|
||||
export * from "./persistence";
|
||||
|
||||
@ -0,0 +1 @@
|
||||
export * from "./sequelize";
|
||||
@ -1,5 +1,6 @@
|
||||
import customerModelInit from "./models/customer.model";
|
||||
import customerModelInit from "./models/sequelize-customer.model";
|
||||
|
||||
export * from "./mappers";
|
||||
export * from "./models";
|
||||
export * from "./repositories";
|
||||
|
||||
@ -29,8 +29,8 @@ import {
|
||||
CustomerStatus,
|
||||
CustomerTaxes,
|
||||
type ICustomerCreateProps,
|
||||
} from "../../../domain";
|
||||
import type { CustomerCreationAttributes, CustomerModel } from "../../sequelize";
|
||||
} from "../../../../../domain";
|
||||
import type { CustomerCreationAttributes, CustomerModel } from "../../models";
|
||||
|
||||
export class SequelizeCustomerDomainMapper extends SequelizeDomainMapper<
|
||||
CustomerModel,
|
||||
@ -22,9 +22,9 @@ import {
|
||||
} from "@repo/rdx-ddd";
|
||||
import { Result } from "@repo/rdx-utils";
|
||||
|
||||
import type { CustomerSummary } from "../../../application";
|
||||
import { CustomerStatus } from "../../../domain";
|
||||
import type { CustomerModel } from "../../sequelize";
|
||||
import type { CustomerSummary } from "../../../../../application";
|
||||
import { CustomerStatus } from "../../../../../domain";
|
||||
import type { CustomerModel } from "../../models";
|
||||
|
||||
export class SequelizeCustomerSummaryMapper extends SequelizeQueryMapper<
|
||||
CustomerModel,
|
||||
@ -0,0 +1 @@
|
||||
export * from "./sequelize-customer.model";
|
||||
@ -9,10 +9,10 @@ import type { TINNumber, UniqueID } from "@repo/rdx-ddd";
|
||||
import { type Collection, Result } from "@repo/rdx-utils";
|
||||
import type { FindOptions, InferAttributes, OrderItem, Sequelize, Transaction } from "sequelize";
|
||||
|
||||
import type { CustomerSummary, ICustomerRepository } from "../../../application";
|
||||
import type { Customer } from "../../../domain";
|
||||
import type { CustomerSummary, ICustomerRepository } from "../../../../application";
|
||||
import type { Customer } from "../../../../domain";
|
||||
import type { SequelizeCustomerDomainMapper, SequelizeCustomerSummaryMapper } from "../../mappers";
|
||||
import { CustomerModel } from "../models/customer.model";
|
||||
import { CustomerModel } from "../models/sequelize-customer.model";
|
||||
|
||||
export class CustomerRepository
|
||||
extends SequelizeRepository<Customer>
|
||||
@ -1 +0,0 @@
|
||||
export * from "./customer.model";
|
||||
Loading…
Reference in New Issue
Block a user