module cleanup

This commit is contained in:
2025-12-19 01:22:45 +01:00
parent d617654928
commit d0fac9e6c1
135 changed files with 5104 additions and 1315 deletions

View File

@@ -10,6 +10,7 @@ import type {
IGetPaymentsPresenter,
GetPaymentsResultDTO,
GetPaymentsViewModel,
PaymentDto,
} from '../presenters/IGetPaymentsPresenter';
import type { UseCase } from '@core/shared/application/UseCase';
@@ -30,27 +31,27 @@ export class GetPaymentsUseCase
): Promise<void> {
presenter.reset();
const payments = await this.paymentRepository.findByFilters({
leagueId: input.leagueId,
payerId: input.payerId,
type: input.type,
});
const { leagueId, payerId, type } = input;
const payments = await this.paymentRepository.findByFilters({ leagueId, payerId, type });
const dtos: PaymentDto[] = payments.map(payment => ({
id: payment.id,
type: payment.type,
amount: payment.amount,
platformFee: payment.platformFee,
netAmount: payment.netAmount,
payerId: payment.payerId,
payerType: payment.payerType,
leagueId: payment.leagueId,
seasonId: payment.seasonId,
status: payment.status,
createdAt: payment.createdAt,
completedAt: payment.completedAt,
}));
const dto: GetPaymentsResultDTO = {
payments: payments.map(payment => ({
id: payment.id,
type: payment.type,
amount: payment.amount,
platformFee: payment.platformFee,
netAmount: payment.netAmount,
payerId: payment.payerId,
payerType: payment.payerType,
leagueId: payment.leagueId,
seasonId: payment.seasonId,
status: payment.status,
createdAt: payment.createdAt,
completedAt: payment.completedAt,
})),
payments: dtos,
};
presenter.present(dto);