services refactor
This commit is contained in:
17
apps/website/lib/presenters/PaymentListPresenter.ts
Normal file
17
apps/website/lib/presenters/PaymentListPresenter.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import type { GetPaymentsOutputDto } from '../dtos';
|
||||
import { PaymentViewModel } from '../view-models';
|
||||
import { presentPayment } from './PaymentPresenter';
|
||||
|
||||
/**
|
||||
* Payment List Presenter
|
||||
*
|
||||
* Transforms payment list DTOs into ViewModels for UI consumption.
|
||||
*/
|
||||
export class PaymentListPresenter {
|
||||
/**
|
||||
* Transform payment list DTO to ViewModels
|
||||
*/
|
||||
present(dto: GetPaymentsOutputDto): PaymentViewModel[] {
|
||||
return dto.payments.map(payment => presentPayment(payment));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user