Reorganización
This commit is contained in:
parent
32dbd7d31f
commit
0a465de2a8
@ -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";
|
||||
|
||||
@ -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";
|
||||
@ -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(
|
||||
@ -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(
|
||||
@ -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 {
|
||||
@ -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 {
|
||||
@ -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 {
|
||||
@ -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 {
|
||||
@ -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 {
|
||||
@ -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";
|
||||
|
||||
@ -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";
|
||||
@ -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 {
|
||||
@ -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> {}
|
||||
@ -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
|
||||
@ -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",
|
||||
|
||||
@ -1,2 +1 @@
|
||||
export * from "./express";
|
||||
export * from "./persistence";
|
||||
export * from "./payment-methods";
|
||||
|
||||
@ -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,
|
||||
@ -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 {
|
||||
@ -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 {
|
||||
@ -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 {
|
||||
@ -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 {
|
||||
@ -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 {
|
||||
@ -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 {
|
||||
@ -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 {
|
||||
@ -21,7 +21,7 @@ import {
|
||||
isPaymentMethodCannotBeEnabledError,
|
||||
isPaymentMethodCannotBeUpdatedError,
|
||||
isPaymentMethodNotFoundError,
|
||||
} from "../../../domain/payment-methods";
|
||||
} from "../../../../domain/payment-methods";
|
||||
|
||||
const invalidPaymentMethodIdRule: ErrorToApiRule = {
|
||||
priority: 120,
|
||||
@ -9,7 +9,7 @@ import {
|
||||
ListPaymentMethodsRequestSchema,
|
||||
UpdatePaymentMethodByIdParamsRequestSchema,
|
||||
UpdatePaymentMethodByIdRequestSchema,
|
||||
} from "../../../../common";
|
||||
} from "../../../../../common";
|
||||
import type { CatalogsInternalDeps } from "../../di/catalogs.di";
|
||||
|
||||
import {
|
||||
@ -0,0 +1,2 @@
|
||||
export * from "./express";
|
||||
export * from "./persistence";
|
||||
@ -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<
|
||||
@ -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<
|
||||
@ -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";
|
||||
Loading…
Reference in New Issue
Block a user