fix(api,ci): remove type-only imports for DI and isolate CI ports from dev
- Remove `type` keyword from NestJS injectable class imports across all modules to fix runtime DI resolution (330+ handler/listener files) - Offset CI docker-compose ports (5433/6380/8109/9002) to avoid conflicts with running dev containers - Update .env.test, playwright.config.ts, and e2e workflow to use isolated CI ports with configurable overrides - Fix prisma/seed.ts to use deterministic IDs for Prisma 7 upsert compatibility (phoneHash replaced phone as unique index) - Add dedicated Docker bridge network for CI service containers Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { HttpStatus, Inject, InternalServerErrorException } from '@nestjs/common';
|
||||
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, ErrorCode, type LoggerService } from '@modules/shared';
|
||||
import { ORDER_REPOSITORY, type IOrderRepository } from '../../../domain/repositories/order.repository';
|
||||
import { CommandHandler, EventBus, ICommandHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, ErrorCode, LoggerService } from '@modules/shared';
|
||||
import { ORDER_REPOSITORY, IOrderRepository } from '../../../domain/repositories/order.repository';
|
||||
import { CancelOrderCommand } from './cancel-order.command';
|
||||
|
||||
export interface CancelOrderResult {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { CommandHandler, EventBus, ICommandHandler } from '@nestjs/cqrs';
|
||||
import { createId } from '@paralleldrive/cuid2';
|
||||
import { ConflictException, DomainException, ValidationException, type LoggerService } from '@modules/shared';
|
||||
import { ConflictException, DomainException, ValidationException, LoggerService } from '@modules/shared';
|
||||
import { EscrowEntity } from '../../../domain/entities/escrow.entity';
|
||||
import { OrderEntity } from '../../../domain/entities/order.entity';
|
||||
import { ESCROW_REPOSITORY, type IEscrowRepository } from '../../../domain/repositories/escrow.repository';
|
||||
import { ORDER_REPOSITORY, type IOrderRepository } from '../../../domain/repositories/order.repository';
|
||||
import { ESCROW_REPOSITORY, IEscrowRepository } from '../../../domain/repositories/escrow.repository';
|
||||
import { ORDER_REPOSITORY, IOrderRepository } from '../../../domain/repositories/order.repository';
|
||||
import { Money } from '../../../domain/value-objects/money.vo';
|
||||
import { PlatformFee } from '../../../domain/value-objects/platform-fee.vo';
|
||||
import { CreateOrderCommand } from './create-order.command';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { type PaymentProvider, type PaymentType } from '@prisma/client';
|
||||
import { PaymentProvider, PaymentType } from '@prisma/client';
|
||||
|
||||
export class CreatePaymentCommand {
|
||||
constructor(
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { CommandHandler, EventBus, ICommandHandler } from '@nestjs/cqrs';
|
||||
import { createId } from '@paralleldrive/cuid2';
|
||||
import { ConflictException, DomainException, ValidationException, type LoggerService } from '@modules/shared';
|
||||
import { ConflictException, DomainException, ValidationException, LoggerService } from '@modules/shared';
|
||||
import { PaymentEntity } from '../../../domain/entities/payment.entity';
|
||||
import {
|
||||
PAYMENT_REPOSITORY,
|
||||
type IPaymentRepository,
|
||||
IPaymentRepository,
|
||||
} from '../../../domain/repositories/payment.repository';
|
||||
import { Money } from '../../../domain/value-objects/money.vo';
|
||||
import {
|
||||
PAYMENT_GATEWAY_FACTORY,
|
||||
type IPaymentGatewayFactory,
|
||||
IPaymentGatewayFactory,
|
||||
} from '../../../infrastructure/services/payment-gateway.interface';
|
||||
import { CreatePaymentCommand } from './create-payment.command';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { type PaymentProvider } from '@prisma/client';
|
||||
import { PaymentProvider } from '@prisma/client';
|
||||
|
||||
export class HandleCallbackCommand {
|
||||
constructor(
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { type PaymentStatus } from '@prisma/client';
|
||||
import { DomainException, NotFoundException, ValidationException, type LoggerService } from '@modules/shared';
|
||||
import { CommandHandler, EventBus, ICommandHandler } from '@nestjs/cqrs';
|
||||
import { PaymentStatus } from '@prisma/client';
|
||||
import { DomainException, NotFoundException, ValidationException, LoggerService } from '@modules/shared';
|
||||
import {
|
||||
PAYMENT_REPOSITORY,
|
||||
type IPaymentRepository,
|
||||
IPaymentRepository,
|
||||
} from '../../../domain/repositories/payment.repository';
|
||||
import {
|
||||
PAYMENT_GATEWAY_FACTORY,
|
||||
type IPaymentGatewayFactory,
|
||||
IPaymentGatewayFactory,
|
||||
} from '../../../infrastructure/services/payment-gateway.interface';
|
||||
import { HandleCallbackCommand } from './handle-callback.command';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { HttpStatus, Inject, InternalServerErrorException } from '@nestjs/common';
|
||||
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, ErrorCode, type LoggerService } from '@modules/shared';
|
||||
import { ESCROW_REPOSITORY, type IEscrowRepository } from '../../../domain/repositories/escrow.repository';
|
||||
import { ORDER_REPOSITORY, type IOrderRepository } from '../../../domain/repositories/order.repository';
|
||||
import { CommandHandler, EventBus, ICommandHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, ErrorCode, LoggerService } from '@modules/shared';
|
||||
import { ESCROW_REPOSITORY, IEscrowRepository } from '../../../domain/repositories/escrow.repository';
|
||||
import { ORDER_REPOSITORY, IOrderRepository } from '../../../domain/repositories/order.repository';
|
||||
import { HoldEscrowCommand } from './hold-escrow.command';
|
||||
|
||||
export interface HoldEscrowResult {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||
import { CommandHandler, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, NotFoundException, ValidationException, type LoggerService } from '@modules/shared';
|
||||
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, NotFoundException, ValidationException, LoggerService } from '@modules/shared';
|
||||
import {
|
||||
PAYMENT_REPOSITORY,
|
||||
type IPaymentRepository,
|
||||
IPaymentRepository,
|
||||
} from '../../../domain/repositories/payment.repository';
|
||||
import {
|
||||
PAYMENT_GATEWAY_FACTORY,
|
||||
type IPaymentGatewayFactory,
|
||||
IPaymentGatewayFactory,
|
||||
} from '../../../infrastructure/services/payment-gateway.interface';
|
||||
import { RefundPaymentCommand } from './refund-payment.command';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { HttpStatus, Inject, InternalServerErrorException } from '@nestjs/common';
|
||||
import { CommandHandler, type EventBus, type ICommandHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, ErrorCode, type LoggerService } from '@modules/shared';
|
||||
import { ESCROW_REPOSITORY, type IEscrowRepository } from '../../../domain/repositories/escrow.repository';
|
||||
import { ORDER_REPOSITORY, type IOrderRepository } from '../../../domain/repositories/order.repository';
|
||||
import { CommandHandler, EventBus, ICommandHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, ErrorCode, LoggerService } from '@modules/shared';
|
||||
import { ESCROW_REPOSITORY, IEscrowRepository } from '../../../domain/repositories/escrow.repository';
|
||||
import { ORDER_REPOSITORY, IOrderRepository } from '../../../domain/repositories/order.repository';
|
||||
import { ReleaseEscrowCommand } from './release-escrow.command';
|
||||
|
||||
export interface ReleaseEscrowResult {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { HttpStatus, Inject } from '@nestjs/common';
|
||||
import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
|
||||
import { IQueryHandler, QueryHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, ErrorCode } from '@modules/shared';
|
||||
import { ESCROW_REPOSITORY, type IEscrowRepository } from '../../../domain/repositories/escrow.repository';
|
||||
import { ORDER_REPOSITORY, type IOrderRepository } from '../../../domain/repositories/order.repository';
|
||||
import { ESCROW_REPOSITORY, IEscrowRepository } from '../../../domain/repositories/escrow.repository';
|
||||
import { ORDER_REPOSITORY, IOrderRepository } from '../../../domain/repositories/order.repository';
|
||||
import { GetOrderStatusQuery } from './get-order-status.query';
|
||||
|
||||
export interface OrderStatusDto {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||
import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, ForbiddenException, type LoggerService, NotFoundException } from '@modules/shared';
|
||||
import { IQueryHandler, QueryHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, ForbiddenException, LoggerService, NotFoundException } from '@modules/shared';
|
||||
import {
|
||||
PAYMENT_REPOSITORY,
|
||||
type IPaymentRepository,
|
||||
IPaymentRepository,
|
||||
} from '../../../domain/repositories/payment.repository';
|
||||
import { GetPaymentStatusQuery } from './get-payment-status.query';
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Inject, InternalServerErrorException } from '@nestjs/common';
|
||||
import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, type LoggerService } from '@modules/shared';
|
||||
import { IQueryHandler, QueryHandler } from '@nestjs/cqrs';
|
||||
import { DomainException, LoggerService } from '@modules/shared';
|
||||
import {
|
||||
PAYMENT_REPOSITORY,
|
||||
type IPaymentRepository,
|
||||
IPaymentRepository,
|
||||
} from '../../../domain/repositories/payment.repository';
|
||||
import { ListTransactionsQuery } from './list-transactions.query';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { type PaymentStatus } from '@prisma/client';
|
||||
import { PaymentStatus } from '@prisma/client';
|
||||
|
||||
export class ListTransactionsQuery {
|
||||
constructor(
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { HttpStatus } from '@nestjs/common';
|
||||
import { type EscrowStatus } from '@prisma/client';
|
||||
import { EscrowStatus } from '@prisma/client';
|
||||
import { AggregateRoot, DomainException, ErrorCode, Result } from '@modules/shared';
|
||||
import { EscrowDisputedEvent } from '../events/escrow-disputed.event';
|
||||
import { EscrowHeldEvent } from '../events/escrow-held.event';
|
||||
import { EscrowReleasedEvent } from '../events/escrow-released.event';
|
||||
import { type Money } from '../value-objects/money.vo';
|
||||
import { Money } from '../value-objects/money.vo';
|
||||
|
||||
export interface EscrowProps {
|
||||
orderId: string;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { HttpStatus } from '@nestjs/common';
|
||||
import { type OrderStatus } from '@prisma/client';
|
||||
import { OrderStatus } from '@prisma/client';
|
||||
import { AggregateRoot, DomainException, ErrorCode, Result } from '@modules/shared';
|
||||
import { OrderCancelledEvent } from '../events/order-cancelled.event';
|
||||
import { OrderCreatedEvent } from '../events/order-created.event';
|
||||
import { OrderPaidEvent } from '../events/order-paid.event';
|
||||
import { type Money } from '../value-objects/money.vo';
|
||||
import { type PlatformFee } from '../value-objects/platform-fee.vo';
|
||||
import { Money } from '../value-objects/money.vo';
|
||||
import { PlatformFee } from '../value-objects/platform-fee.vo';
|
||||
|
||||
export interface OrderProps {
|
||||
buyerId: string;
|
||||
|
||||
@@ -9,7 +9,7 @@ import { PaymentCompletedEvent } from '../events/payment-completed.event';
|
||||
import { PaymentCreatedEvent } from '../events/payment-created.event';
|
||||
import { PaymentFailedEvent } from '../events/payment-failed.event';
|
||||
import { PaymentRefundedEvent } from '../events/payment-refunded.event';
|
||||
import { type Money } from '../value-objects/money.vo';
|
||||
import { Money } from '../value-objects/money.vo';
|
||||
|
||||
export interface PaymentProps {
|
||||
userId: string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { type DomainEvent } from '@modules/shared';
|
||||
import { DomainEvent } from '@modules/shared';
|
||||
|
||||
export class EscrowDisputedEvent implements DomainEvent {
|
||||
readonly eventName = 'escrow.disputed';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { type DomainEvent } from '@modules/shared';
|
||||
import { DomainEvent } from '@modules/shared';
|
||||
|
||||
export class EscrowHeldEvent implements DomainEvent {
|
||||
readonly eventName = 'escrow.held';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { type DomainEvent } from '@modules/shared';
|
||||
import { DomainEvent } from '@modules/shared';
|
||||
|
||||
export class EscrowReleasedEvent implements DomainEvent {
|
||||
readonly eventName = 'escrow.released';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { type DomainEvent } from '@modules/shared';
|
||||
import { DomainEvent } from '@modules/shared';
|
||||
|
||||
export class OrderCancelledEvent implements DomainEvent {
|
||||
readonly eventName = 'order.cancelled';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { type DomainEvent } from '@modules/shared';
|
||||
import { DomainEvent } from '@modules/shared';
|
||||
|
||||
export class OrderCreatedEvent implements DomainEvent {
|
||||
readonly eventName = 'order.created';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { type DomainEvent } from '@modules/shared';
|
||||
import { DomainEvent } from '@modules/shared';
|
||||
|
||||
export class OrderPaidEvent implements DomainEvent {
|
||||
readonly eventName = 'order.paid';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { type PaymentProvider } from '@prisma/client';
|
||||
import { type DomainEvent } from '@modules/shared';
|
||||
import { PaymentProvider } from '@prisma/client';
|
||||
import { DomainEvent } from '@modules/shared';
|
||||
|
||||
export class PaymentCompletedEvent implements DomainEvent {
|
||||
readonly eventName = 'payment.completed';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { type PaymentProvider, type PaymentType } from '@prisma/client';
|
||||
import { type DomainEvent } from '@modules/shared';
|
||||
import { PaymentProvider, PaymentType } from '@prisma/client';
|
||||
import { DomainEvent } from '@modules/shared';
|
||||
|
||||
export class PaymentCreatedEvent implements DomainEvent {
|
||||
readonly eventName = 'payment.created';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { type PaymentProvider } from '@prisma/client';
|
||||
import { type DomainEvent } from '@modules/shared';
|
||||
import { PaymentProvider } from '@prisma/client';
|
||||
import { DomainEvent } from '@modules/shared';
|
||||
|
||||
export class PaymentFailedEvent implements DomainEvent {
|
||||
readonly eventName = 'payment.failed';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { type PaymentProvider } from '@prisma/client';
|
||||
import { type DomainEvent } from '@modules/shared';
|
||||
import { PaymentProvider } from '@prisma/client';
|
||||
import { DomainEvent } from '@modules/shared';
|
||||
|
||||
export class PaymentRefundedEvent implements DomainEvent {
|
||||
readonly eventName = 'payment.refunded';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { type EscrowEntity } from '../entities/escrow.entity';
|
||||
import { EscrowEntity } from '../entities/escrow.entity';
|
||||
|
||||
export const ESCROW_REPOSITORY = Symbol('ESCROW_REPOSITORY');
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export { ESCROW_REPOSITORY, type IEscrowRepository } from './escrow.repository';
|
||||
export { ORDER_REPOSITORY, type IOrderRepository } from './order.repository';
|
||||
export { PAYMENT_REPOSITORY, type IPaymentRepository } from './payment.repository';
|
||||
export { ESCROW_REPOSITORY, IEscrowRepository } from './escrow.repository';
|
||||
export { ORDER_REPOSITORY, IOrderRepository } from './order.repository';
|
||||
export { PAYMENT_REPOSITORY, IPaymentRepository } from './payment.repository';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { type OrderStatus } from '@prisma/client';
|
||||
import { type OrderEntity } from '../entities/order.entity';
|
||||
import { OrderStatus } from '@prisma/client';
|
||||
import { OrderEntity } from '../entities/order.entity';
|
||||
|
||||
export const ORDER_REPOSITORY = Symbol('ORDER_REPOSITORY');
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { type PaymentStatus } from '@prisma/client';
|
||||
import { type PaymentEntity } from '../entities/payment.entity';
|
||||
import { PaymentStatus } from '@prisma/client';
|
||||
import { PaymentEntity } from '../entities/payment.entity';
|
||||
|
||||
export const PAYMENT_REPOSITORY = Symbol('PAYMENT_REPOSITORY');
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
export { PaymentsModule } from './payments.module';
|
||||
|
||||
// Repositories
|
||||
export { ESCROW_REPOSITORY, type IEscrowRepository } from './domain/repositories/escrow.repository';
|
||||
export { ORDER_REPOSITORY, type IOrderRepository } from './domain/repositories/order.repository';
|
||||
export { PAYMENT_REPOSITORY, type IPaymentRepository } from './domain/repositories/payment.repository';
|
||||
export { ESCROW_REPOSITORY, IEscrowRepository } from './domain/repositories/escrow.repository';
|
||||
export { ORDER_REPOSITORY, IOrderRepository } from './domain/repositories/order.repository';
|
||||
export { PAYMENT_REPOSITORY, IPaymentRepository } from './domain/repositories/payment.repository';
|
||||
|
||||
// Gateway
|
||||
export { PAYMENT_GATEWAY_FACTORY, type IPaymentGatewayFactory } from './infrastructure/services/payment-gateway.interface';
|
||||
export { PAYMENT_GATEWAY_FACTORY, IPaymentGatewayFactory } from './infrastructure/services/payment-gateway.interface';
|
||||
|
||||
// Domain Events — Payment
|
||||
export { PaymentCompletedEvent } from './domain/events/payment-completed.event';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { type Escrow as PrismaEscrow } from '@prisma/client';
|
||||
import { type PrismaService } from '@modules/shared';
|
||||
import { EscrowEntity, type EscrowProps } from '../../domain/entities/escrow.entity';
|
||||
import { type IEscrowRepository } from '../../domain/repositories/escrow.repository';
|
||||
import { Escrow as PrismaEscrow } from '@prisma/client';
|
||||
import { PrismaService } from '@modules/shared';
|
||||
import { EscrowEntity, EscrowProps } from '../../domain/entities/escrow.entity';
|
||||
import { IEscrowRepository } from '../../domain/repositories/escrow.repository';
|
||||
import { Money } from '../../domain/value-objects/money.vo';
|
||||
|
||||
@Injectable()
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { type Prisma, type Order as PrismaOrder, type OrderStatus } from '@prisma/client';
|
||||
import { type PrismaService } from '@modules/shared';
|
||||
import { OrderEntity, type OrderProps } from '../../domain/entities/order.entity';
|
||||
import { type IOrderRepository } from '../../domain/repositories/order.repository';
|
||||
import { Prisma, Order as PrismaOrder, OrderStatus } from '@prisma/client';
|
||||
import { PrismaService } from '@modules/shared';
|
||||
import { OrderEntity, OrderProps } from '../../domain/entities/order.entity';
|
||||
import { IOrderRepository } from '../../domain/repositories/order.repository';
|
||||
import { Money } from '../../domain/value-objects/money.vo';
|
||||
import { PlatformFee } from '../../domain/value-objects/platform-fee.vo';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Prisma, type Payment as PrismaPayment, type PaymentStatus } from '@prisma/client';
|
||||
import { type PrismaService } from '@modules/shared';
|
||||
import { PaymentEntity, type PaymentProps } from '../../domain/entities/payment.entity';
|
||||
import { type IPaymentRepository } from '../../domain/repositories/payment.repository';
|
||||
import { Prisma, Payment as PrismaPayment, PaymentStatus } from '@prisma/client';
|
||||
import { PrismaService } from '@modules/shared';
|
||||
import { PaymentEntity, PaymentProps } from '../../domain/entities/payment.entity';
|
||||
import { IPaymentRepository } from '../../domain/repositories/payment.repository';
|
||||
import { Money } from '../../domain/value-objects/money.vo';
|
||||
|
||||
@Injectable()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export {
|
||||
PAYMENT_GATEWAY_FACTORY,
|
||||
type IPaymentGateway,
|
||||
type IPaymentGatewayFactory,
|
||||
IPaymentGatewayFactory,
|
||||
type CreatePaymentUrlParams,
|
||||
type CreatePaymentUrlResult,
|
||||
type CallbackVerifyResult,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import * as crypto from 'crypto';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { type ConfigService } from '@nestjs/config';
|
||||
import { type PaymentProvider } from '@prisma/client';
|
||||
import { type LoggerService } from '@modules/shared';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { PaymentProvider } from '@prisma/client';
|
||||
import { LoggerService } from '@modules/shared';
|
||||
import {
|
||||
type IPaymentGateway,
|
||||
type CreatePaymentUrlParams,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { type PaymentProvider } from '@prisma/client';
|
||||
import { type MomoService } from './momo.service';
|
||||
import { PaymentProvider } from '@prisma/client';
|
||||
import { MomoService } from './momo.service';
|
||||
import {
|
||||
type IPaymentGateway,
|
||||
type IPaymentGatewayFactory,
|
||||
IPaymentGatewayFactory,
|
||||
} from './payment-gateway.interface';
|
||||
import { type VnpayService } from './vnpay.service';
|
||||
import { type ZalopayService } from './zalopay.service';
|
||||
import { VnpayService } from './vnpay.service';
|
||||
import { ZalopayService } from './zalopay.service';
|
||||
|
||||
@Injectable()
|
||||
export class PaymentGatewayFactory implements IPaymentGatewayFactory {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { type PaymentProvider } from '@prisma/client';
|
||||
import { PaymentProvider } from '@prisma/client';
|
||||
|
||||
export const PAYMENT_GATEWAY_FACTORY = Symbol('PAYMENT_GATEWAY_FACTORY');
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import * as crypto from 'crypto';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { type ConfigService } from '@nestjs/config';
|
||||
import { type PaymentProvider } from '@prisma/client';
|
||||
import { type LoggerService } from '@modules/shared';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { PaymentProvider } from '@prisma/client';
|
||||
import { LoggerService } from '@modules/shared';
|
||||
import {
|
||||
type IPaymentGateway,
|
||||
type CreatePaymentUrlParams,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import * as crypto from 'crypto';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { type ConfigService } from '@nestjs/config';
|
||||
import { type PaymentProvider } from '@prisma/client';
|
||||
import { type LoggerService } from '@modules/shared';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { PaymentProvider } from '@prisma/client';
|
||||
import { LoggerService } from '@modules/shared';
|
||||
import {
|
||||
type IPaymentGateway,
|
||||
type CreatePaymentUrlParams,
|
||||
|
||||
@@ -6,26 +6,26 @@ import {
|
||||
Post,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { type CommandBus, type QueryBus } from '@nestjs/cqrs';
|
||||
import { CommandBus, QueryBus } from '@nestjs/cqrs';
|
||||
import {
|
||||
ApiTags,
|
||||
ApiOperation,
|
||||
ApiResponse,
|
||||
ApiBearerAuth,
|
||||
} from '@nestjs/swagger';
|
||||
import { type JwtPayload, CurrentUser, Roles, JwtAuthGuard, RolesGuard } from '@modules/auth';
|
||||
import { JwtPayload, CurrentUser, Roles, JwtAuthGuard, RolesGuard } from '@modules/auth';
|
||||
import { CancelOrderCommand } from '../../application/commands/cancel-order/cancel-order.command';
|
||||
import { type CancelOrderResult } from '../../application/commands/cancel-order/cancel-order.handler';
|
||||
import { CancelOrderResult } from '../../application/commands/cancel-order/cancel-order.handler';
|
||||
import { CreateOrderCommand } from '../../application/commands/create-order/create-order.command';
|
||||
import { type CreateOrderResult } from '../../application/commands/create-order/create-order.handler';
|
||||
import { CreateOrderResult } from '../../application/commands/create-order/create-order.handler';
|
||||
import { HoldEscrowCommand } from '../../application/commands/hold-escrow/hold-escrow.command';
|
||||
import { type HoldEscrowResult } from '../../application/commands/hold-escrow/hold-escrow.handler';
|
||||
import { HoldEscrowResult } from '../../application/commands/hold-escrow/hold-escrow.handler';
|
||||
import { ReleaseEscrowCommand } from '../../application/commands/release-escrow/release-escrow.command';
|
||||
import { type ReleaseEscrowResult } from '../../application/commands/release-escrow/release-escrow.handler';
|
||||
import { type OrderStatusDto } from '../../application/queries/get-order-status/get-order-status.handler';
|
||||
import { ReleaseEscrowResult } from '../../application/commands/release-escrow/release-escrow.handler';
|
||||
import { OrderStatusDto } from '../../application/queries/get-order-status/get-order-status.handler';
|
||||
import { GetOrderStatusQuery } from '../../application/queries/get-order-status/get-order-status.query';
|
||||
import { type CancelOrderDto } from '../dto/cancel-order.dto';
|
||||
import { type CreateOrderDto } from '../dto/create-order.dto';
|
||||
import { CancelOrderDto } from '../dto/cancel-order.dto';
|
||||
import { CreateOrderDto } from '../dto/create-order.dto';
|
||||
|
||||
@ApiTags('orders')
|
||||
@Controller('orders')
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
Query,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { type CommandBus, type QueryBus } from '@nestjs/cqrs';
|
||||
import { CommandBus, QueryBus } from '@nestjs/cqrs';
|
||||
import {
|
||||
ApiTags,
|
||||
ApiOperation,
|
||||
@@ -17,22 +17,22 @@ import {
|
||||
ApiParam,
|
||||
} from '@nestjs/swagger';
|
||||
import { Throttle } from '@nestjs/throttler';
|
||||
import { type PaymentProvider } from '@prisma/client';
|
||||
import { type JwtPayload, CurrentUser, Roles, JwtAuthGuard, RolesGuard } from '@modules/auth';
|
||||
import { PaymentProvider } from '@prisma/client';
|
||||
import { JwtPayload, CurrentUser, Roles, JwtAuthGuard, RolesGuard } from '@modules/auth';
|
||||
import { EndpointRateLimit, EndpointRateLimitGuard } from '@modules/shared';
|
||||
import { CreatePaymentCommand } from '../../application/commands/create-payment/create-payment.command';
|
||||
import { type CreatePaymentResult } from '../../application/commands/create-payment/create-payment.handler';
|
||||
import { CreatePaymentResult } from '../../application/commands/create-payment/create-payment.handler';
|
||||
import { HandleCallbackCommand } from '../../application/commands/handle-callback/handle-callback.command';
|
||||
import { type HandleCallbackResult } from '../../application/commands/handle-callback/handle-callback.handler';
|
||||
import { HandleCallbackResult } from '../../application/commands/handle-callback/handle-callback.handler';
|
||||
import { RefundPaymentCommand } from '../../application/commands/refund-payment/refund-payment.command';
|
||||
import { type RefundPaymentResult } from '../../application/commands/refund-payment/refund-payment.handler';
|
||||
import { type PaymentStatusDto } from '../../application/queries/get-payment-status/get-payment-status.handler';
|
||||
import { RefundPaymentResult } from '../../application/commands/refund-payment/refund-payment.handler';
|
||||
import { PaymentStatusDto } from '../../application/queries/get-payment-status/get-payment-status.handler';
|
||||
import { GetPaymentStatusQuery } from '../../application/queries/get-payment-status/get-payment-status.query';
|
||||
import { type TransactionListDto } from '../../application/queries/list-transactions/list-transactions.handler';
|
||||
import { TransactionListDto } from '../../application/queries/list-transactions/list-transactions.handler';
|
||||
import { ListTransactionsQuery } from '../../application/queries/list-transactions/list-transactions.query';
|
||||
import { type CreatePaymentDto } from '../dto/create-payment.dto';
|
||||
import { type ListTransactionsDto } from '../dto/list-transactions.dto';
|
||||
import { type RefundPaymentDto } from '../dto/refund-payment.dto';
|
||||
import { CreatePaymentDto } from '../dto/create-payment.dto';
|
||||
import { ListTransactionsDto } from '../dto/list-transactions.dto';
|
||||
import { RefundPaymentDto } from '../dto/refund-payment.dto';
|
||||
|
||||
@ApiTags('payments')
|
||||
@Controller('payments')
|
||||
|
||||
Reference in New Issue
Block a user