view data fixes

This commit is contained in:
2026-01-24 12:47:49 +01:00
parent 6749fe326b
commit c1750a33dd
105 changed files with 474 additions and 498 deletions

View File

@@ -1,3 +1,5 @@
import { ErrorReporter } from '../../interfaces/ErrorReporter';
import { Logger } from '../../interfaces/Logger';
import { AdminApiClient } from './admin/AdminApiClient';
import { AnalyticsApiClient } from './analytics/AnalyticsApiClient';
import { AuthApiClient } from './auth/AuthApiClient';
@@ -13,10 +15,8 @@ import { RacesApiClient } from './races/RacesApiClient';
import { SponsorsApiClient } from './sponsors/SponsorsApiClient';
import { TeamsApiClient } from './teams/TeamsApiClient';
import { WalletsApiClient } from './wallets/WalletsApiClient';
import { ErrorReporter } from '../interfaces/ErrorReporter';
import { Logger } from '../interfaces/Logger';
import { ConsoleLogger } from '../infrastructure/logging/ConsoleLogger';
import { ConsoleLogger } from '../../infrastructure/logging/ConsoleLogger';
export class ApiClient {
public readonly admin: AdminApiClient;

View File

@@ -1,10 +1,10 @@
import { GetAnalyticsMetricsOutputDTO } from '../../../types/generated/GetAnalyticsMetricsOutputDTO';
import { GetDashboardDataOutputDTO } from '../../../types/generated/GetDashboardDataOutputDTO';
import { RecordEngagementInputDTO } from '../../../types/generated/RecordEngagementInputDTO';
import { RecordEngagementOutputDTO } from '../../../types/generated/RecordEngagementOutputDTO';
import { RecordPageViewInputDTO } from '../../../types/generated/RecordPageViewInputDTO';
import { RecordPageViewOutputDTO } from '../../../types/generated/RecordPageViewOutputDTO';
import { BaseApiClient } from '../base/BaseApiClient';
import { RecordPageViewOutputDTO } from '../../types/generated/RecordPageViewOutputDTO';
import { RecordEngagementOutputDTO } from '../../types/generated/RecordEngagementOutputDTO';
import { GetDashboardDataOutputDTO } from '../../types/generated/GetDashboardDataOutputDTO';
import { GetAnalyticsMetricsOutputDTO } from '../../types/generated/GetAnalyticsMetricsOutputDTO';
import { RecordPageViewInputDTO } from '../../types/generated/RecordPageViewInputDTO';
import { RecordEngagementInputDTO } from '../../types/generated/RecordEngagementInputDTO';
/**
* Analytics API Client

View File

@@ -1,9 +1,9 @@
import { AuthSessionDTO } from '../../../types/generated/AuthSessionDTO';
import { ForgotPasswordDTO } from '../../../types/generated/ForgotPasswordDTO';
import { LoginParamsDTO } from '../../../types/generated/LoginParamsDTO';
import { ResetPasswordDTO } from '../../../types/generated/ResetPasswordDTO';
import { SignupParamsDTO } from '../../../types/generated/SignupParamsDTO';
import { BaseApiClient } from '../base/BaseApiClient';
import { AuthSessionDTO } from '../../types/generated/AuthSessionDTO';
import { LoginParamsDTO } from '../../types/generated/LoginParamsDTO';
import { SignupParamsDTO } from '../../types/generated/SignupParamsDTO';
import { ForgotPasswordDTO } from '../../types/generated/ForgotPasswordDTO';
import { ResetPasswordDTO } from '../../types/generated/ResetPasswordDTO';
/**
* Auth API Client

View File

@@ -5,12 +5,12 @@
* error handling, authentication, retry logic, and circuit breaker.
*/
import { Logger } from '../../interfaces/Logger';
import { ErrorReporter } from '../../interfaces/ErrorReporter';
import { ApiError, ApiErrorType } from './ApiError';
import { RetryHandler, CircuitBreakerRegistry, DEFAULT_RETRY_CONFIG } from './RetryHandler';
import { ApiConnectionMonitor } from './ApiConnectionMonitor';
import { getGlobalApiLogger } from '@/lib/infrastructure/ApiRequestLogger';
import { ErrorReporter } from '../../../interfaces/ErrorReporter';
import { Logger } from '../../../interfaces/Logger';
import { ApiConnectionMonitor } from './ApiConnectionMonitor';
import { ApiError, ApiErrorType } from './ApiError';
import { CircuitBreakerRegistry, DEFAULT_RETRY_CONFIG, RetryHandler } from './RetryHandler';
export interface BaseApiClientOptions {
timeout?: number;

View File

@@ -1,5 +1,5 @@
import type { DashboardOverviewDTO } from '../../../types/generated/DashboardOverviewDTO';
import { BaseApiClient } from '../base/BaseApiClient';
import type { DashboardOverviewDTO } from '../../types/generated/DashboardOverviewDTO';
/**
* Dashboard API Client

View File

@@ -1,10 +1,10 @@
import type { CompleteOnboardingInputDTO } from '../../../types/generated/CompleteOnboardingInputDTO';
import type { CompleteOnboardingOutputDTO } from '../../../types/generated/CompleteOnboardingOutputDTO';
import type { DriverLeaderboardItemDTO } from '../../../types/generated/DriverLeaderboardItemDTO';
import type { DriverRegistrationStatusDTO } from '../../../types/generated/DriverRegistrationStatusDTO';
import type { GetDriverOutputDTO } from '../../../types/generated/GetDriverOutputDTO';
import type { GetDriverProfileOutputDTO } from '../../../types/generated/GetDriverProfileOutputDTO';
import { BaseApiClient } from '../base/BaseApiClient';
import type { CompleteOnboardingInputDTO } from '../../types/generated/CompleteOnboardingInputDTO';
import type { CompleteOnboardingOutputDTO } from '../../types/generated/CompleteOnboardingOutputDTO';
import type { DriverRegistrationStatusDTO } from '../../types/generated/DriverRegistrationStatusDTO';
import type { DriverLeaderboardItemDTO } from '../../types/generated/DriverLeaderboardItemDTO';
import type { GetDriverOutputDTO } from '../../types/generated/GetDriverOutputDTO';
import type { GetDriverProfileOutputDTO } from '../../types/generated/GetDriverProfileOutputDTO';
type DriversLeaderboardDto = {
drivers: DriverLeaderboardItemDTO[];

View File

@@ -1,28 +1,28 @@
import type { AllLeaguesWithCapacityAndScoringDTO } from '../../../types/AllLeaguesWithCapacityAndScoringDTO';
import type { AllLeaguesWithCapacityDTO } from '../../../types/generated/AllLeaguesWithCapacityDTO';
import type { ApproveJoinRequestOutputDTO } from '../../../types/generated/ApproveJoinRequestOutputDTO';
import type { CreateLeagueInputDTO } from '../../../types/generated/CreateLeagueInputDTO';
import type { CreateLeagueOutputDTO } from '../../../types/generated/CreateLeagueOutputDTO';
import type { CreateLeagueScheduleRaceInputDTO } from '../../../types/generated/CreateLeagueScheduleRaceInputDTO';
import type { CreateLeagueScheduleRaceOutputDTO } from '../../../types/generated/CreateLeagueScheduleRaceOutputDTO';
import type { GetLeagueAdminConfigOutputDTO } from '../../../types/generated/GetLeagueAdminConfigOutputDTO';
import type { LeagueMembershipsDTO } from '../../../types/generated/LeagueMembershipsDTO';
import type { LeagueRosterJoinRequestDTO } from '../../../types/generated/LeagueRosterJoinRequestDTO';
import type { LeagueRosterMemberDTO } from '../../../types/generated/LeagueRosterMemberDTO';
import type { LeagueScheduleDTO } from '../../../types/generated/LeagueScheduleDTO';
import type { LeagueScheduleRaceMutationSuccessDTO } from '../../../types/generated/LeagueScheduleRaceMutationSuccessDTO';
import type { LeagueScoringPresetDTO } from '../../../types/generated/LeagueScoringPresetDTO';
import type { LeagueSeasonSchedulePublishOutputDTO } from '../../../types/generated/LeagueSeasonSchedulePublishOutputDTO';
import type { LeagueSeasonSummaryDTO } from '../../../types/generated/LeagueSeasonSummaryDTO';
import type { LeagueStandingsDTO } from '../../../types/generated/LeagueStandingsDTO';
import type { RaceDTO } from '../../../types/generated/RaceDTO';
import type { RejectJoinRequestOutputDTO } from '../../../types/generated/RejectJoinRequestOutputDTO';
import type { RemoveLeagueMemberOutputDTO } from '../../../types/generated/RemoveLeagueMemberOutputDTO';
import type { SponsorshipDetailDTO } from '../../../types/generated/SponsorshipDetailDTO';
import type { TotalLeaguesDTO } from '../../../types/generated/TotalLeaguesDTO';
import type { UpdateLeagueMemberRoleOutputDTO } from '../../../types/generated/UpdateLeagueMemberRoleOutputDTO';
import type { UpdateLeagueScheduleRaceInputDTO } from '../../../types/generated/UpdateLeagueScheduleRaceInputDTO';
import { BaseApiClient } from '../base/BaseApiClient';
import type { AllLeaguesWithCapacityDTO } from '../../types/generated/AllLeaguesWithCapacityDTO';
import type { TotalLeaguesDTO } from '../../types/generated/TotalLeaguesDTO';
import type { LeagueStandingsDTO } from '../../types/generated/LeagueStandingsDTO';
import type { LeagueScheduleDTO } from '../../types/generated/LeagueScheduleDTO';
import type { LeagueMembershipsDTO } from '../../types/generated/LeagueMembershipsDTO';
import type { CreateLeagueInputDTO } from '../../types/generated/CreateLeagueInputDTO';
import type { CreateLeagueOutputDTO } from '../../types/generated/CreateLeagueOutputDTO';
import type { SponsorshipDetailDTO } from '../../types/generated/SponsorshipDetailDTO';
import type { RaceDTO } from '../../types/generated/RaceDTO';
import type { GetLeagueAdminConfigOutputDTO } from '../../types/generated/GetLeagueAdminConfigOutputDTO';
import type { LeagueScoringPresetDTO } from '../../types/generated/LeagueScoringPresetDTO';
import type { LeagueSeasonSummaryDTO } from '../../types/generated/LeagueSeasonSummaryDTO';
import type { CreateLeagueScheduleRaceInputDTO } from '../../types/generated/CreateLeagueScheduleRaceInputDTO';
import type { CreateLeagueScheduleRaceOutputDTO } from '../../types/generated/CreateLeagueScheduleRaceOutputDTO';
import type { UpdateLeagueScheduleRaceInputDTO } from '../../types/generated/UpdateLeagueScheduleRaceInputDTO';
import type { LeagueScheduleRaceMutationSuccessDTO } from '../../types/generated/LeagueScheduleRaceMutationSuccessDTO';
import type { LeagueSeasonSchedulePublishOutputDTO } from '../../types/generated/LeagueSeasonSchedulePublishOutputDTO';
import type { LeagueRosterMemberDTO } from '../../types/generated/LeagueRosterMemberDTO';
import type { LeagueRosterJoinRequestDTO } from '../../types/generated/LeagueRosterJoinRequestDTO';
import type { ApproveJoinRequestOutputDTO } from '../../types/generated/ApproveJoinRequestOutputDTO';
import type { RejectJoinRequestOutputDTO } from '../../types/generated/RejectJoinRequestOutputDTO';
import type { UpdateLeagueMemberRoleOutputDTO } from '../../types/generated/UpdateLeagueMemberRoleOutputDTO';
import type { RemoveLeagueMemberOutputDTO } from '../../types/generated/RemoveLeagueMemberOutputDTO';
import type { AllLeaguesWithCapacityAndScoringDTO } from '../../types/AllLeaguesWithCapacityAndScoringDTO';
function isRecord(value: unknown): value is Record<string, unknown> {
return typeof value === 'object' && value !== null;

View File

@@ -1,13 +1,13 @@
import type { DeleteMediaOutputDTO } from '../../types/generated/DeleteMediaOutputDTO';
import type { GetAvatarOutputDTO } from '../../types/generated/GetAvatarOutputDTO';
import type { GetMediaOutputDTO } from '../../types/generated/GetMediaOutputDTO';
import type { RequestAvatarGenerationInputDTO } from '../../types/generated/RequestAvatarGenerationInputDTO';
import type { RequestAvatarGenerationOutputDTO } from '../../types/generated/RequestAvatarGenerationOutputDTO';
import type { UpdateAvatarInputDTO } from '../../types/generated/UpdateAvatarInputDTO';
import type { UpdateAvatarOutputDTO } from '../../types/generated/UpdateAvatarOutputDTO';
import type { UploadMediaOutputDTO } from '../../types/generated/UploadMediaOutputDTO';
import type { ValidateFaceInputDTO } from '../../types/generated/ValidateFaceInputDTO';
import type { ValidateFaceOutputDTO } from '../../types/generated/ValidateFaceOutputDTO';
import type { DeleteMediaOutputDTO } from '../../../types/generated/DeleteMediaOutputDTO';
import type { GetAvatarOutputDTO } from '../../../types/generated/GetAvatarOutputDTO';
import type { GetMediaOutputDTO } from '../../../types/generated/GetMediaOutputDTO';
import type { RequestAvatarGenerationInputDTO } from '../../../types/generated/RequestAvatarGenerationInputDTO';
import type { RequestAvatarGenerationOutputDTO } from '../../../types/generated/RequestAvatarGenerationOutputDTO';
import type { UpdateAvatarInputDTO } from '../../../types/generated/UpdateAvatarInputDTO';
import type { UpdateAvatarOutputDTO } from '../../../types/generated/UpdateAvatarOutputDTO';
import type { UploadMediaOutputDTO } from '../../../types/generated/UploadMediaOutputDTO';
import type { ValidateFaceInputDTO } from '../../../types/generated/ValidateFaceInputDTO';
import type { ValidateFaceOutputDTO } from '../../../types/generated/ValidateFaceOutputDTO';
import { BaseApiClient } from '../base/BaseApiClient';
/**

View File

@@ -1,11 +1,11 @@
import type { MemberPaymentDTO } from '../../../types/generated/MemberPaymentDTO';
import type { MembershipFeeDTO } from '../../../types/generated/MembershipFeeDTO';
import type { PaymentDTO } from '../../../types/generated/PaymentDTO';
import type { PrizeDTO } from '../../../types/generated/PrizeDTO';
import type { TransactionDTO } from '../../../types/generated/TransactionDTO';
import type { UpdatePaymentStatusInputDTO } from '../../../types/generated/UpdatePaymentStatusInputDTO';
import type { WalletDTO } from '../../../types/generated/WalletDTO';
import { BaseApiClient } from '../base/BaseApiClient';
import type { MembershipFeeDTO } from '../../types/generated/MembershipFeeDTO';
import type { MemberPaymentDTO } from '../../types/generated/MemberPaymentDTO';
import type { PaymentDTO } from '../../types/generated/PaymentDTO';
import type { PrizeDTO } from '../../types/generated/PrizeDTO';
import type { TransactionDTO } from '../../types/generated/TransactionDTO';
import type { UpdatePaymentStatusInputDTO } from '../../types/generated/UpdatePaymentStatusInputDTO';
import type { WalletDTO } from '../../types/generated/WalletDTO';
// Define missing types that are not fully generated
type GetPaymentsOutputDto = { payments: PaymentDTO[] };

View File

@@ -1,7 +1,7 @@
import { ApplyPenaltyCommandDTO } from '../../../types/generated/ApplyPenaltyCommandDTO';
import { RacePenaltiesDTO } from '../../../types/generated/RacePenaltiesDTO';
import type { PenaltyTypesReferenceDTO } from '../../../types/PenaltyTypesReferenceDTO';
import { BaseApiClient } from '../base/BaseApiClient';
import { RacePenaltiesDTO } from '../../types/generated/RacePenaltiesDTO';
import { ApplyPenaltyCommandDTO } from '../../types/generated/ApplyPenaltyCommandDTO';
import type { PenaltyTypesReferenceDTO } from '../../types/PenaltyTypesReferenceDTO';
/**
* Penalties API Client

View File

@@ -1,6 +1,6 @@
import type { ErrorReporter } from '../../../interfaces/ErrorReporter';
import type { Logger } from '../../../interfaces/Logger';
import { BaseApiClient } from '../base/BaseApiClient';
import type { ErrorReporter } from '../../interfaces/ErrorReporter';
import type { Logger } from '../../interfaces/Logger';
export type OperationalMode = 'normal' | 'maintenance' | 'test';
export type FeatureState = 'enabled' | 'disabled' | 'coming_soon' | 'hidden';

View File

@@ -1,9 +1,9 @@
import type { ApplyPenaltyCommandDTO } from '../../../types/generated/ApplyPenaltyCommandDTO';
import type { LeagueAdminProtestsDTO } from '../../../types/generated/LeagueAdminProtestsDTO';
import type { RaceProtestsDTO } from '../../../types/generated/RaceProtestsDTO';
import type { RequestProtestDefenseCommandDTO } from '../../../types/generated/RequestProtestDefenseCommandDTO';
import type { ReviewProtestCommandDTO } from '../../../types/generated/ReviewProtestCommandDTO';
import { BaseApiClient } from '../base/BaseApiClient';
import type { ApplyPenaltyCommandDTO } from '../../types/generated/ApplyPenaltyCommandDTO';
import type { LeagueAdminProtestsDTO } from '../../types/generated/LeagueAdminProtestsDTO';
import type { RaceProtestsDTO } from '../../types/generated/RaceProtestsDTO';
import type { RequestProtestDefenseCommandDTO } from '../../types/generated/RequestProtestDefenseCommandDTO';
import type { ReviewProtestCommandDTO } from '../../types/generated/ReviewProtestCommandDTO';
/**
* Protests API Client

View File

@@ -1,17 +1,17 @@
import type { FileProtestCommandDTO } from '../../../types/generated/FileProtestCommandDTO';
import type { ImportRaceResultsDTO } from '../../../types/generated/ImportRaceResultsDTO';
import type { RaceDetailEntryDTO } from '../../../types/generated/RaceDetailEntryDTO';
import type { RaceDetailLeagueDTO } from '../../../types/generated/RaceDetailLeagueDTO';
import type { RaceDetailRaceDTO } from '../../../types/generated/RaceDetailRaceDTO';
import type { RaceDetailRegistrationDTO } from '../../../types/generated/RaceDetailRegistrationDTO';
import type { RaceDetailUserResultDTO } from '../../../types/generated/RaceDetailUserResultDTO';
import type { RaceResultsDetailDTO } from '../../../types/generated/RaceResultsDetailDTO';
import type { RaceStatsDTO } from '../../../types/generated/RaceStatsDTO';
import type { RaceWithSOFDTO } from '../../../types/generated/RaceWithSOFDTO';
import type { RacesPageDataRaceDTO } from '../../../types/generated/RacesPageDataRaceDTO';
import type { RegisterForRaceParamsDTO } from '../../../types/generated/RegisterForRaceParamsDTO';
import type { WithdrawFromRaceParamsDTO } from '../../../types/generated/WithdrawFromRaceParamsDTO';
import { BaseApiClient } from '../base/BaseApiClient';
import type { RaceStatsDTO } from '../../types/generated/RaceStatsDTO';
import type { RacesPageDataRaceDTO } from '../../types/generated/RacesPageDataRaceDTO';
import type { RaceResultsDetailDTO } from '../../types/generated/RaceResultsDetailDTO';
import type { RaceWithSOFDTO } from '../../types/generated/RaceWithSOFDTO';
import type { RegisterForRaceParamsDTO } from '../../types/generated/RegisterForRaceParamsDTO';
import type { ImportRaceResultsDTO } from '../../types/generated/ImportRaceResultsDTO';
import type { WithdrawFromRaceParamsDTO } from '../../types/generated/WithdrawFromRaceParamsDTO';
import type { RaceDetailRaceDTO } from '../../types/generated/RaceDetailRaceDTO';
import type { RaceDetailLeagueDTO } from '../../types/generated/RaceDetailLeagueDTO';
import type { RaceDetailEntryDTO } from '../../types/generated/RaceDetailEntryDTO';
import type { RaceDetailRegistrationDTO } from '../../types/generated/RaceDetailRegistrationDTO';
import type { RaceDetailUserResultDTO } from '../../types/generated/RaceDetailUserResultDTO';
import type { FileProtestCommandDTO } from '../../types/generated/FileProtestCommandDTO';
// Define missing types
export type RacesPageDataDTO = { races: RacesPageDataRaceDTO[] };

View File

@@ -1,12 +1,12 @@
import type { AcceptSponsorshipRequestInputDTO } from '../../../types/generated/AcceptSponsorshipRequestInputDTO';
import type { CreateSponsorInputDTO } from '../../../types/generated/CreateSponsorInputDTO';
import type { GetPendingSponsorshipRequestsOutputDTO } from '../../../types/generated/GetPendingSponsorshipRequestsOutputDTO';
import type { GetSponsorOutputDTO } from '../../../types/generated/GetSponsorOutputDTO';
import type { RejectSponsorshipRequestInputDTO } from '../../../types/generated/RejectSponsorshipRequestInputDTO';
import type { SponsorDashboardDTO } from '../../../types/generated/SponsorDashboardDTO';
import type { SponsorDTO } from '../../../types/generated/SponsorDTO';
import type { SponsorSponsorshipsDTO } from '../../../types/generated/SponsorSponsorshipsDTO';
import { BaseApiClient } from '../base/BaseApiClient';
import type { CreateSponsorInputDTO } from '../../types/generated/CreateSponsorInputDTO';
import type { SponsorDashboardDTO } from '../../types/generated/SponsorDashboardDTO';
import type { SponsorSponsorshipsDTO } from '../../types/generated/SponsorSponsorshipsDTO';
import type { GetPendingSponsorshipRequestsOutputDTO } from '../../types/generated/GetPendingSponsorshipRequestsOutputDTO';
import type { AcceptSponsorshipRequestInputDTO } from '../../types/generated/AcceptSponsorshipRequestInputDTO';
import type { RejectSponsorshipRequestInputDTO } from '../../types/generated/RejectSponsorshipRequestInputDTO';
import type { GetSponsorOutputDTO } from '../../types/generated/GetSponsorOutputDTO';
import type { SponsorDTO } from '../../types/generated/SponsorDTO';
// Types that are not yet generated
export type CreateSponsorOutputDto = { id: string; name: string };