website refactor

This commit is contained in:
2026-01-12 01:01:49 +01:00
parent 5ca6023a5a
commit fefd8d1cd6
294 changed files with 4628 additions and 4991 deletions

View File

@@ -1,34 +0,0 @@
import { MembershipFeeDTO } from '@/lib/types/generated/MembershipFeeDTO';
import type { MemberPaymentDTO } from '@/lib/types/generated/MemberPaymentDTO';
import { MembershipFeeViewModel } from '@/lib/view-models/MembershipFeeViewModel';
import { PaymentsApiClient } from '../../api/payments/PaymentsApiClient';
// Response shape as returned by the membership-fees payments endpoint; mirrors the API contract until a generated type is introduced
export interface GetMembershipFeesOutputDto {
fee: MembershipFeeDTO | null;
payments: MemberPaymentDTO[];
}
/**
* 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<{ fee: MembershipFeeViewModel | null; payments: MemberPaymentDTO[] }> {
const dto: GetMembershipFeesOutputDto = await this.apiClient.getMembershipFees({ leagueId });
return {
fee: dto.fee ? new MembershipFeeViewModel(dto.fee) : null,
// Expose raw member payment DTOs; callers may map these into UI-specific view models if needed
payments: dto.payments,
};
}
}