Skip to content

Commit

Permalink
Changed updatePaymentService name to UpdatePaymentUsecase to preserve…
Browse files Browse the repository at this point in the history
… clean architecture principles
  • Loading branch information
fmo00 committed Jul 29, 2024
1 parent 83139bf commit 01620b2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# compiled output
*/dist
/dist
*/node_modules
/node_modules
*/build

# Logs
Expand Down
4 changes: 2 additions & 2 deletions snack-bar-api/src/config/modules/payment.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { UpdatePaymentServicePort } from '@/core/interactor/port/payment/update-
import { UpdateOrderUseCases } from '@/core/interactor/usecases/order/update-order.use-cases';
import { CreatePaymentUseCases } from '@/core/interactor/usecases/payment/create-payment.use-cases';
import { FindPaymentByIdUseCases } from '@/core/interactor/usecases/payment/find-payment-by-id.use-cases';
import { UpdatePaymentUseCaseService } from '@/core/interactor/usecases/payment/update.usecase';
import { UpdatePaymentUseCase } from '@/core/interactor/usecases/payment/update-payment.use-cases';
import { IOrderRepository } from '@/core/repository/order/order.respository';
import { IPaymentRepository } from '@/core/repository/payment/payment.repository';
import { OrderPostgresAdapter } from '@/datasource/database/adapter/order/order-postgres.adapter';
Expand Down Expand Up @@ -43,7 +43,7 @@ import { PaymentController } from '@/transport/controller/payment.controller';
paymentRepository: IPaymentRepository,
mercadoPagoAdapter: MercadoPagoServicePort,
) => {
return new UpdatePaymentUseCaseService(paymentRepository, mercadoPagoAdapter);
return new UpdatePaymentUseCase(paymentRepository, mercadoPagoAdapter);
},
inject: [IPaymentRepository, MercadoPagoServicePort],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { IPaymentRepository } from '@/core/repository/payment/payment.repository
import { MercadoPagoServicePort } from '@/datasource/mercado-pago/port/mercado-pago-service.port';
import { UpdatePaymentResponseDto } from '@/transport/dto/payment/response/update-success-response.dto';

export class UpdatePaymentUseCaseService implements UpdatePaymentServicePort {
export class UpdatePaymentUseCase implements UpdatePaymentServicePort {
constructor(
private readonly paymentRepository: IPaymentRepository,
private readonly mercadoPagoAdapterService: MercadoPagoServicePort,
Expand Down
8 changes: 4 additions & 4 deletions snack-bar-api/test/payment/update-usecase.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Payment } from '@/core/domain/payment/payment.entity';
import { UpdatePaymentUseCaseService } from '@/core/interactor/usecases/payment/update.usecase';
import { UpdatePaymentUseCase } from '@/core/interactor/usecases/payment/update-payment.use-cases';
import { IPaymentRepository } from '@/core/repository/payment/payment.repository';
import { MercadoPagoServicePort } from '@/datasource/mercado-pago/port/mercado-pago-service.port';

describe('UpdatePaymentUseCaseService', () => {
let service: UpdatePaymentUseCaseService;
describe('UpdatePaymentUseCase', () => {
let service: UpdatePaymentUseCase;
let paymentRepository: IPaymentRepository;
let mercadoPagoAdapterService: MercadoPagoServicePort;

Expand All @@ -19,7 +19,7 @@ describe('UpdatePaymentUseCaseService', () => {
getPaymentById: jest.fn(),
};

service = new UpdatePaymentUseCaseService(
service = new UpdatePaymentUseCase(
paymentRepository,
mercadoPagoAdapterService,
);
Expand Down

0 comments on commit 01620b2

Please sign in to comment.