import { MembershipFeeDto } from '@/lib/types/generated/MembershipFeeDto'; import { MembershipFeeViewModel } from '@/lib/view-models/MembershipFeeViewModel'; import { PaymentsApiClient } from '../../api/payments/PaymentsApiClient'; // TODO: This DTO should be generated from OpenAPI spec when the endpoint is added export interface GetMembershipFeesOutputDto { fees: MembershipFeeDto[]; } /** * Membership Fee Service * * Orchestrates membership fee operations by coordinating API calls and view model creation. * All dependencies are injected via constructor. */ export class MembershipFeeService { constructor( private readonly apiClient: PaymentsApiClient ) {} /** * Get membership fees by league ID with view model transformation */ async getMembershipFees(leagueId: string): Promise { const dto = await this.apiClient.getMembershipFees(leagueId); return dto.fees.map((fee: MembershipFeeDto) => new MembershipFeeViewModel(fee)); } }