Reorganización

This commit is contained in:
David Arranz 2026-05-21 12:52:54 +02:00
parent 32dbd7d31f
commit 0a465de2a8
68 changed files with 47 additions and 45 deletions

View File

@ -1,7 +1 @@
export * from "./di";
export * from "./mappers";
export * from "./models";
export * from "./repositories";
export * from "./services";
export * from "./snapshot-builders";
export * from "./use-cases";
export * from "./payment-methods";

View File

@ -0,0 +1,7 @@
export * from "./di";
export * from "./mappers";
export * from "./models";
export * from "./repositories";
export * from "./services";
export * from "./snapshot-builders";
export * from "./use-cases";

View File

@ -10,8 +10,8 @@ import {
} from "@repo/rdx-ddd";
import { Result } from "@repo/rdx-utils";
import type { CreatePaymentMethodRequestDTO } from "../../../common";
import type { IPaymentMethodCreateProps } from "../../domain";
import type { CreatePaymentMethodRequestDTO } from "../../../../common";
import type { IPaymentMethodCreateProps } from "../../../domain";
export interface ICreatePaymentMethodInputMapper {
map(

View File

@ -10,8 +10,8 @@ import {
} from "@repo/rdx-ddd";
import { Result, isNullishOrEmpty, toPatchField } from "@repo/rdx-utils";
import type { UpdatePaymentMethodByIdRequestDTO } from "../../../common";
import type { PaymentMethodPatchProps } from "../../domain";
import type { UpdatePaymentMethodByIdRequestDTO } from "../../../../common";
import type { PaymentMethodPatchProps } from "../../../domain";
export interface IUpdatePaymentMethodInputMapper {
map(

View File

@ -2,7 +2,7 @@ import type { Criteria } from "@repo/rdx-criteria/server";
import type { UniqueID } from "@repo/rdx-ddd";
import type { Collection, Result } from "@repo/rdx-utils";
import type { PaymentMethod } from "../../domain";
import type { PaymentMethod } from "../../../domain";
import type { PaymentMethodSummary } from "../models";
export interface IPaymentMethodRepository {

View File

@ -1,7 +1,7 @@
import type { UniqueID } from "@repo/rdx-ddd";
import { Result } from "@repo/rdx-utils";
import { type IPaymentMethodCreateProps, PaymentMethod } from "../../domain";
import { type IPaymentMethodCreateProps, PaymentMethod } from "../../../domain";
import type { IPaymentMethodRepository } from "../repositories";
export interface IPaymentMethodCreatorParams {

View File

@ -1,7 +1,7 @@
import { Result } from "@repo/rdx-utils";
import type { PaymentMethod } from "../../domain";
import { PaymentMethodCannotBeDeletedError } from "../../domain";
import type { PaymentMethod } from "../../../domain";
import { PaymentMethodCannotBeDeletedError } from "../../../domain";
import type { IPaymentMethodRepository } from "../repositories";
export interface IPaymentMethodDeleter {

View File

@ -1,6 +1,6 @@
import { Result } from "@repo/rdx-utils";
import type { PaymentMethod } from "../../domain";
import type { PaymentMethod } from "../../../domain";
import type { IPaymentMethodRepository } from "../repositories";
export interface IPaymentMethodDisabler {

View File

@ -1,6 +1,6 @@
import { Result } from "@repo/rdx-utils";
import type { PaymentMethod } from "../../domain";
import type { PaymentMethod } from "../../../domain";
import type { IPaymentMethodRepository } from "../repositories";
export interface IPaymentMethodEnabler {

View File

@ -2,7 +2,7 @@ import type { Criteria } from "@repo/rdx-criteria/server";
import type { UniqueID } from "@repo/rdx-ddd";
import type { Collection, Result } from "@repo/rdx-utils";
import type { PaymentMethod } from "../../domain";
import type { PaymentMethod } from "../../../domain";
import type { PaymentMethodSummary } from "../models";
import type { IPaymentMethodRepository } from "../repositories";

View File

@ -1,6 +1,6 @@
import { Result } from "@repo/rdx-utils";
import type { PaymentMethod } from "../../domain";
import type { PaymentMethod } from "../../../domain";
import type { IPaymentMethodRepository } from "../repositories";
export type PaymentMethodStatusChangeAction = "enable" | "disable";

View File

@ -1,7 +1,7 @@
import type { UniqueID } from "@repo/rdx-ddd";
import { Result } from "@repo/rdx-utils";
import type { PaymentMethod, PaymentMethodPatchProps } from "../../domain";
import type { PaymentMethod, PaymentMethodPatchProps } from "../../../domain";
import type { IPaymentMethodRepository } from "../repositories";
export interface IPaymentMethodUpdater {

View File

@ -2,7 +2,7 @@ import type { GetPaymentMethodByIdResponseDTO } from "@erp/catalogs/common";
import type { ISnapshotBuilder } from "@erp/core/api";
import { toNullable } from "@repo/rdx-ddd";
import type { PaymentMethod } from "../../../domain";
import type { PaymentMethod } from "../../../../domain";
export interface IPaymentMethodFullSnapshotBuilder
extends ISnapshotBuilder<PaymentMethod, GetPaymentMethodByIdResponseDTO> {}

View File

@ -1,6 +1,6 @@
import type { ISnapshotBuilder } from "@erp/core/api";
import type { PaymentMethodSummaryDTO } from "../../../../common/";
import type { PaymentMethodSummaryDTO } from "../../../../../common";
import type { PaymentMethodSummary } from "../../models";
export interface IPaymentMethodSummarySnapshotBuilder

View File

@ -4,9 +4,9 @@ import { models, paymentMethodsRouter } from "./infrastructure";
import {
buildCatalogsDependencies,
buildCatalogsPublicServices,
} from "./infrastructure/di/catalogs.di";
} from "./infrastructure/payment-methods/di/catalogs.di";
export * from "./infrastructure/persistence/sequelize";
export * from "./infrastructure/payment-methods/persistence/sequelize";
export const catalogsAPIModule: IModuleServer = {
name: "catalogs",

View File

@ -1,2 +1 @@
export * from "./express";
export * from "./persistence";
export * from "./payment-methods";

View File

@ -9,10 +9,10 @@ import {
buildPaymentMethodSnapshotBuilders,
buildPaymentMethodStatusChanger,
buildPaymentMethodUpdater,
} from "../../application";
import type { IPaymentMethodRepository } from "../../application/repositories";
import type { IPaymentMethodFinder } from "../../application/services";
import { PaymentMethodFinder } from "../../application/services";
} from "../../../application";
import type { IPaymentMethodRepository } from "../../../application/payment-methods/repositories";
import type { IPaymentMethodFinder } from "../../../application/payment-methods/services";
import { PaymentMethodFinder } from "../../../application/payment-methods/services";
import {
CreatePaymentMethodUseCase,
DeletePaymentMethodByIdUseCase,

View File

@ -5,8 +5,8 @@ import {
requireCompanyContextGuard,
} from "@erp/core/api";
import type { CreatePaymentMethodRequestDTO } from "../../../../../common";
import type { CreatePaymentMethodUseCase } from "../../../../application";
import type { CreatePaymentMethodRequestDTO } from "../../../../../../common";
import type { CreatePaymentMethodUseCase } from "../../../../../application";
import { paymentMethodsApiErrorMapper } from "../payment-methods-api-error-mapper";
export class CreatePaymentMethodController extends ExpressController {

View File

@ -5,7 +5,7 @@ import {
requireCompanyContextGuard,
} from "@erp/core/api";
import type { DeletePaymentMethodByIdUseCase } from "../../../../application";
import type { DeletePaymentMethodByIdUseCase } from "../../../../../application";
import { paymentMethodsApiErrorMapper } from "../payment-methods-api-error-mapper";
export class DeletePaymentMethodByIdController extends ExpressController {

View File

@ -5,7 +5,7 @@ import {
requireCompanyContextGuard,
} from "@erp/core/api";
import type { DisablePaymentMethodByIdUseCase } from "../../../../application";
import type { DisablePaymentMethodByIdUseCase } from "../../../../../application";
import { paymentMethodsApiErrorMapper } from "../payment-methods-api-error-mapper";
export class DisablePaymentMethodByIdController extends ExpressController {

View File

@ -5,7 +5,7 @@ import {
requireCompanyContextGuard,
} from "@erp/core/api";
import type { EnablePaymentMethodByIdUseCase } from "../../../../application";
import type { EnablePaymentMethodByIdUseCase } from "../../../../../application";
import { paymentMethodsApiErrorMapper } from "../payment-methods-api-error-mapper";
export class EnablePaymentMethodByIdController extends ExpressController {

View File

@ -5,7 +5,7 @@ import {
requireCompanyContextGuard,
} from "@erp/core/api";
import type { GetPaymentMethodByIdUseCase } from "../../../../application";
import type { GetPaymentMethodByIdUseCase } from "../../../../../application";
import { paymentMethodsApiErrorMapper } from "../payment-methods-api-error-mapper";
export class GetPaymentMethodByIdController extends ExpressController {

View File

@ -6,7 +6,7 @@ import {
} from "@erp/core/api";
import { Criteria } from "@repo/rdx-criteria/server";
import type { ListPaymentMethodsUseCase } from "../../../../application";
import type { ListPaymentMethodsUseCase } from "../../../../../application";
import { paymentMethodsApiErrorMapper } from "../payment-methods-api-error-mapper";
export class ListPaymentMethodsController extends ExpressController {

View File

@ -6,7 +6,7 @@ import {
requireCompanyContextGuard,
} from "@erp/core/api";
import type { UpdatePaymentMethodByIdUseCase } from "../../../../application";
import type { UpdatePaymentMethodByIdUseCase } from "../../../../../application";
import { paymentMethodsApiErrorMapper } from "../payment-methods-api-error-mapper";
export class UpdatePaymentMethodByIdController extends ExpressController {

View File

@ -21,7 +21,7 @@ import {
isPaymentMethodCannotBeEnabledError,
isPaymentMethodCannotBeUpdatedError,
isPaymentMethodNotFoundError,
} from "../../../domain/payment-methods";
} from "../../../../domain/payment-methods";
const invalidPaymentMethodIdRule: ErrorToApiRule = {
priority: 120,

View File

@ -9,7 +9,7 @@ import {
ListPaymentMethodsRequestSchema,
UpdatePaymentMethodByIdParamsRequestSchema,
UpdatePaymentMethodByIdRequestSchema,
} from "../../../../common";
} from "../../../../../common";
import type { CatalogsInternalDeps } from "../../di/catalogs.di";
import {

View File

@ -0,0 +1,2 @@
export * from "./express";
export * from "./persistence";

View File

@ -11,7 +11,7 @@ import {
} from "@repo/rdx-ddd";
import { Result } from "@repo/rdx-utils";
import { PaymentMethod } from "../../../../domain";
import { PaymentMethod } from "../../../../../domain";
import type { PaymentMethodCreationAttributes, PaymentMethodModel } from "../models";
export class SequelizePaymentMethodDomainMapper extends SequelizeDomainMapper<

View File

@ -8,7 +8,7 @@ import {
} from "@repo/rdx-ddd";
import { Result } from "@repo/rdx-utils";
import type { PaymentMethodSummary } from "../../../../application/models";
import type { PaymentMethodSummary } from "../../../../../application/payment-methods/models";
import type { PaymentMethodModel } from "../models";
export class SequelizePaymentMethodSummaryMapper extends SequelizeQueryMapper<

View File

@ -9,9 +9,9 @@ import type { UniqueID } from "@repo/rdx-ddd";
import { type Collection, Result } from "@repo/rdx-utils";
import type { Sequelize, Transaction } from "sequelize";
import type { IPaymentMethodRepository } from "../../../../application";
import type { PaymentMethodSummary } from "../../../../application/models";
import type { PaymentMethod } from "../../../../domain";
import type { IPaymentMethodRepository } from "../../../../../application";
import type { PaymentMethodSummary } from "../../../../../application/payment-methods/models";
import type { PaymentMethod } from "../../../../../domain";
import type { SequelizePaymentMethodSummaryMapper } from "../mappers";
import type { SequelizePaymentMethodDomainMapper } from "../mappers/sequelize-payment-method-domain.mapper";
import { PaymentMethodModel } from "../models";