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