17 lines
486 B
TypeScript
17 lines
486 B
TypeScript
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));
|
|
}
|
|
} |