website refactor

This commit is contained in:
2026-01-16 21:44:26 +01:00
parent 2d322b42e1
commit 83a9092c50
327 changed files with 1086 additions and 1088 deletions

View File

@@ -1,12 +1,12 @@
import { describe, it, expect, beforeEach } from 'vitest';
import { AllLeaguesWithCapacityAndScoringPresenter } from './AllLeaguesWithCapacityAndScoringPresenter';
import { League } from '@core/racing/domain/entities/League';
import { Season } from '@core/racing/domain/entities/season/Season';
import { LeagueScoringConfig } from '@core/racing/domain/entities/LeagueScoringConfig';
import { Game } from '@core/racing/domain/entities/Game';
import { MediaReference } from '@core/domain/media/MediaReference';
import { Game } from '@core/racing/domain/entities/Game';
import { League } from '@core/racing/domain/entities/League';
import { LeagueScoringConfig } from '@core/racing/domain/entities/LeagueScoringConfig';
import { Season } from '@core/racing/domain/entities/season/Season';
import type { LeagueScoringPreset } from '@core/racing/domain/types/LeagueScoringPreset';
import { PointsTable } from '@core/racing/domain/value-objects/PointsTable';
import { beforeEach, describe, expect, it } from 'vitest';
import { AllLeaguesWithCapacityAndScoringPresenter } from './AllLeaguesWithCapacityAndScoringPresenter';
describe('AllLeaguesWithCapacityAndScoringPresenter', () => {
let presenter: AllLeaguesWithCapacityAndScoringPresenter;

View File

@@ -1,11 +1,11 @@
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import type { GetAllLeaguesWithCapacityAndScoringResult } from '@core/racing/application/use-cases/GetAllLeaguesWithCapacityAndScoringUseCase';
import type {
AllLeaguesWithCapacityAndScoringDTO,
LeagueWithCapacityAndScoringDTO,
} from '../dtos/AllLeaguesWithCapacityAndScoringDTO';
import type { MediaResolverPort } from '@core/ports/media/MediaResolverPort';
import { MediaReference } from '@core/domain/media/MediaReference';
import type { MediaResolverPort } from '@core/ports/media/MediaResolverPort';
import type { GetAllLeaguesWithCapacityAndScoringResult } from '@core/racing/application/use-cases/GetAllLeaguesWithCapacityAndScoringUseCase';
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import type {
AllLeaguesWithCapacityAndScoringDTO,
LeagueWithCapacityAndScoringDTO,
} from '../dtos/AllLeaguesWithCapacityAndScoringDTO';
export class AllLeaguesWithCapacityAndScoringPresenter
implements UseCaseOutputPort<GetAllLeaguesWithCapacityAndScoringResult>

View File

@@ -1,6 +1,6 @@
import { describe, it, expect, beforeEach } from 'vitest';
import { AllLeaguesWithCapacityPresenter } from './AllLeaguesWithCapacityPresenter';
import { League } from '@core/racing/domain/entities/League';
import { beforeEach, describe, expect, it } from 'vitest';
import { AllLeaguesWithCapacityPresenter } from './AllLeaguesWithCapacityPresenter';
describe('AllLeaguesWithCapacityPresenter', () => {
let presenter: AllLeaguesWithCapacityPresenter;

View File

@@ -1,6 +1,6 @@
import type { GetAllLeaguesWithCapacityResult } from '@core/racing/application/use-cases/GetAllLeaguesWithCapacityUseCase';
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import { AllLeaguesWithCapacityDTO, LeagueWithCapacityDTO } from '../dtos/AllLeaguesWithCapacityDTO';
import type { GetAllLeaguesWithCapacityResult } from '@core/racing/application/use-cases/GetAllLeaguesWithCapacityUseCase';
export class AllLeaguesWithCapacityPresenter implements UseCaseOutputPort<GetAllLeaguesWithCapacityResult> {
private result: AllLeaguesWithCapacityDTO | null = null;

View File

@@ -1,4 +1,4 @@
import { describe, it, expect, beforeEach } from 'vitest';
import { beforeEach, describe, expect, it } from 'vitest';
import { ApproveLeagueJoinRequestPresenter } from './ApproveLeagueJoinRequestPresenter';
describe('ApproveLeagueJoinRequestPresenter', () => {

View File

@@ -1,6 +1,6 @@
import type { UseCaseOutputPort } from '@core/shared/application';
import { ApproveLeagueJoinRequestResult } from '@core/racing/application/use-cases/ApproveLeagueJoinRequestUseCase';
import type { UseCaseOutputPort } from '@core/shared/application';
import type { ApproveLeagueJoinRequestDTO } from '../dtos/ApproveLeagueJoinRequestDTO';
export class ApproveLeagueJoinRequestPresenter implements UseCaseOutputPort<ApproveLeagueJoinRequestResult> {

View File

@@ -1,9 +1,9 @@
import { describe, it, expect, beforeEach } from 'vitest';
import { CreateLeaguePresenter } from './CreateLeaguePresenter';
import { League } from '@core/racing/domain/entities/League';
import { Season } from '@core/racing/domain/entities/season/Season';
import { LeagueScoringConfig } from '@core/racing/domain/entities/LeagueScoringConfig';
import { Season } from '@core/racing/domain/entities/season/Season';
import { PointsTable } from '@core/racing/domain/value-objects/PointsTable';
import { beforeEach, describe, expect, it } from 'vitest';
import { CreateLeaguePresenter } from './CreateLeaguePresenter';
describe('CreateLeaguePresenter', () => {
let presenter: CreateLeaguePresenter;

View File

@@ -1,5 +1,5 @@
import type { UseCaseOutputPort } from '@core/shared/application';
import type { GetLeagueAdminPermissionsResult } from '@core/racing/application/use-cases/GetLeagueAdminPermissionsUseCase';
import type { UseCaseOutputPort } from '@core/shared/application';
import { LeagueAdminPermissionsDTO } from '../dtos/LeagueAdminPermissionsDTO';
export class GetLeagueAdminPermissionsPresenter implements UseCaseOutputPort<GetLeagueAdminPermissionsResult> {

View File

@@ -1,5 +1,5 @@
import { GetLeagueMembershipsPresenter } from './GetLeagueMembershipsPresenter';
import type { GetLeagueMembershipsResult } from '@core/racing/application/use-cases/GetLeagueMembershipsUseCase';
import { GetLeagueMembershipsPresenter } from './GetLeagueMembershipsPresenter';
describe('GetLeagueMembershipsPresenter', () => {
it('presents memberships correctly', () => {

View File

@@ -1,7 +1,7 @@
import type { UseCaseOutputPort } from '@core/shared/application';
import { GetLeagueMembershipsResult } from '@core/racing/application/use-cases/GetLeagueMembershipsUseCase';
import { LeagueMembershipsDTO } from '../dtos/LeagueMembershipsDTO';
import type { UseCaseOutputPort } from '@core/shared/application';
import type { LeagueMemberDTO } from '../dtos/LeagueMemberDTO';
import { LeagueMembershipsDTO } from '../dtos/LeagueMembershipsDTO';
export interface GetLeagueMembershipsViewModel {
memberships: LeagueMembershipsDTO;

View File

@@ -1,5 +1,5 @@
import type { UseCaseOutputPort } from '@core/shared/application';
import type { GetLeagueOwnerSummaryResult } from '@core/racing/application/use-cases/GetLeagueOwnerSummaryUseCase';
import type { UseCaseOutputPort } from '@core/shared/application';
import { LeagueOwnerSummaryDTO } from '../dtos/LeagueOwnerSummaryDTO';
export class GetLeagueOwnerSummaryPresenter implements UseCaseOutputPort<GetLeagueOwnerSummaryResult> {

View File

@@ -1,9 +1,9 @@
import type { Presenter } from '../../../shared/presentation/Presenter';
import type { GetLeagueProtestsResult } from '@core/racing/application/use-cases/GetLeagueProtestsUseCase';
import type { Presenter } from '../../../shared/presentation/Presenter';
import { DriverDTO } from '../../driver/dtos/DriverDTO';
import { RaceDTO } from '../../race/dtos/RaceDTO';
import { LeagueAdminProtestsDTO } from '../dtos/LeagueAdminProtestsDTO';
import { ProtestDTO } from '../dtos/ProtestDTO';
import { RaceDTO } from '../../race/dtos/RaceDTO';
import { DriverDTO } from '../../driver/dtos/DriverDTO';
function mapProtestStatus(status: string): ProtestDTO['status'] {
switch (status) {

View File

@@ -1,5 +1,5 @@
import type { Presenter } from '../../../shared/presentation/Presenter';
import type { GetLeagueSeasonsResult } from '@core/racing/application/use-cases/GetLeagueSeasonsUseCase';
import type { Presenter } from '../../../shared/presentation/Presenter';
import { LeagueSeasonSummaryDTO } from '../dtos/LeagueSeasonSummaryDTO';
export class GetLeagueSeasonsPresenter implements Presenter<GetLeagueSeasonsResult, LeagueSeasonSummaryDTO[]> {

View File

@@ -1,5 +1,5 @@
import type { UseCaseOutputPort } from '@core/shared/application';
import type { GetLeagueWalletResult } from '@core/racing/application/use-cases/GetLeagueWalletUseCase';
import type { UseCaseOutputPort } from '@core/shared/application';
import { GetLeagueWalletOutputDTO, WalletTransactionDTO } from '../dtos/GetLeagueWalletOutputDTO';
export class GetLeagueWalletPresenter implements UseCaseOutputPort<GetLeagueWalletResult> {

View File

@@ -1,7 +1,7 @@
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import type { GetSeasonSponsorshipsResult } from '@core/racing/application/use-cases/GetSeasonSponsorshipsUseCase';
import { GetSeasonSponsorshipsOutputDTO } from '../dtos/GetSeasonSponsorshipsOutputDTO';
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import { SponsorshipDetailDTO } from '../../sponsor/dtos/SponsorshipDetailDTO';
import { GetSeasonSponsorshipsOutputDTO } from '../dtos/GetSeasonSponsorshipsOutputDTO';
export class GetSeasonSponsorshipsPresenter implements UseCaseOutputPort<GetSeasonSponsorshipsResult> {
private result: GetSeasonSponsorshipsOutputDTO | null = null;

View File

@@ -1,5 +1,5 @@
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import type { JoinLeagueResult } from '@core/racing/application/use-cases/JoinLeagueUseCase';
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import type { JoinLeagueOutputDTO } from '../dtos/JoinLeagueOutputDTO';
export class JoinLeaguePresenter implements UseCaseOutputPort<JoinLeagueResult> {

View File

@@ -1,8 +1,8 @@
import { LeagueAdminDTO } from '../dtos/LeagueAdminDTO';
import { LeagueAdminProtestsDTO } from '../dtos/LeagueAdminProtestsDTO';
import { LeagueConfigFormModelDTO } from '../dtos/LeagueConfigFormModelDTO';
import { LeagueJoinRequestDTO } from '../dtos/LeagueJoinRequestDTO';
import { LeagueOwnerSummaryDTO } from '../dtos/LeagueOwnerSummaryDTO';
import { LeagueConfigFormModelDTO } from '../dtos/LeagueConfigFormModelDTO';
import { LeagueAdminProtestsDTO } from '../dtos/LeagueAdminProtestsDTO';
import { LeagueSeasonSummaryDTO } from '../dtos/LeagueSeasonSummaryDTO';
export class LeagueAdminPresenter {

View File

@@ -1,5 +1,5 @@
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import type { GetLeagueFullConfigResult } from '@core/racing/application/use-cases/GetLeagueFullConfigUseCase';
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import { LeagueConfigFormModelDTO } from '../dtos/LeagueConfigFormModelDTO';
export class LeagueConfigPresenter implements UseCaseOutputPort<GetLeagueFullConfigResult> {

View File

@@ -1,5 +1,5 @@
import { LeagueJoinRequestsPresenter } from './LeagueJoinRequestsPresenter';
import type { GetLeagueJoinRequestsResult } from '@core/racing/application/use-cases/GetLeagueJoinRequestsUseCase';
import { LeagueJoinRequestsPresenter } from './LeagueJoinRequestsPresenter';
describe('LeagueJoinRequestsPresenter', () => {
it('presents join requests correctly', () => {

View File

@@ -1,5 +1,5 @@
import type { UseCaseOutputPort } from '@core/shared/application';
import { GetLeagueJoinRequestsResult } from '@core/racing/application/use-cases/GetLeagueJoinRequestsUseCase';
import type { UseCaseOutputPort } from '@core/shared/application';
import { LeagueJoinRequestWithDriverDTO } from '../dtos/LeagueJoinRequestWithDriverDTO';
export interface LeagueJoinRequestsViewModel {

View File

@@ -1,5 +1,5 @@
import { LeagueOwnerSummaryPresenter } from './LeagueOwnerSummaryPresenter';
import type { GetLeagueOwnerSummaryResult } from '@core/racing/application/use-cases/GetLeagueOwnerSummaryUseCase';
import { LeagueOwnerSummaryPresenter } from './LeagueOwnerSummaryPresenter';
describe('LeagueOwnerSummaryPresenter', () => {
it('presents owner summary correctly', () => {

View File

@@ -1,5 +1,5 @@
import type { UseCaseOutputPort } from '@core/shared/application';
import { GetLeagueOwnerSummaryResult } from '@core/racing/application/use-cases/GetLeagueOwnerSummaryUseCase';
import type { UseCaseOutputPort } from '@core/shared/application';
import { LeagueOwnerSummaryDTO } from '../dtos/LeagueOwnerSummaryDTO';
export class LeagueOwnerSummaryPresenter implements UseCaseOutputPort<GetLeagueOwnerSummaryResult> {

View File

@@ -1,10 +1,10 @@
import { Injectable } from '@nestjs/common';
import type { UseCaseOutputPort } from '@core/shared/application';
import type { GetLeagueRosterMembersResult } from '@core/racing/application/use-cases/GetLeagueRosterMembersUseCase';
import type { GetLeagueRosterJoinRequestsResult } from '@core/racing/application/use-cases/GetLeagueRosterJoinRequestsUseCase';
import type { LeagueRosterMemberDTO } from '../dtos/LeagueRosterMemberDTO';
import type { LeagueRosterJoinRequestDTO } from '../dtos/LeagueRosterJoinRequestDTO';
import type { GetLeagueRosterMembersResult } from '@core/racing/application/use-cases/GetLeagueRosterMembersUseCase';
import type { UseCaseOutputPort } from '@core/shared/application';
import { Injectable } from '@nestjs/common';
import type { DriverDTO } from '../../driver/dtos/DriverDTO';
import type { LeagueRosterJoinRequestDTO } from '../dtos/LeagueRosterJoinRequestDTO';
import type { LeagueRosterMemberDTO } from '../dtos/LeagueRosterMemberDTO';
@Injectable()
export class GetLeagueRosterMembersPresenter implements UseCaseOutputPort<GetLeagueRosterMembersResult> {

View File

@@ -1,6 +1,6 @@
import { Race } from '@core/racing/domain/entities/Race';
import { describe, expect, it } from 'vitest';
import { LeagueSchedulePresenter } from './LeagueSchedulePresenter';
import { Race } from '@core/racing/domain/entities/Race';
describe('LeagueSchedulePresenter', () => {
it('includes seasonId on the schedule DTO and serializes dates to ISO strings', () => {

View File

@@ -1,7 +1,7 @@
import type { UseCaseOutputPort } from '@core/shared/application';
import { GetLeagueScheduleResult } from '@core/racing/application/use-cases/GetLeagueScheduleUseCase';
import { LeagueScheduleDTO } from '../dtos/LeagueScheduleDTO';
import type { UseCaseOutputPort } from '@core/shared/application';
import { RaceDTO } from '../../race/dtos/RaceDTO';
import { LeagueScheduleDTO } from '../dtos/LeagueScheduleDTO';
export class LeagueSchedulePresenter implements UseCaseOutputPort<GetLeagueScheduleResult> {
private result: LeagueScheduleDTO | null = null;

View File

@@ -1,7 +1,7 @@
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import type { GetLeagueScoringConfigResult } from '@core/racing/application/use-cases/GetLeagueScoringConfigUseCase';
import type { ChampionshipConfig } from '@core/racing/domain/types/ChampionshipConfig';
import type { BonusRule } from '@core/racing/domain/types/BonusRule';
import type { ChampionshipConfig } from '@core/racing/domain/types/ChampionshipConfig';
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
export interface LeagueScoringChampionshipViewModel {
id: string;

View File

@@ -1,5 +1,5 @@
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import type { ListLeagueScoringPresetsResult } from '@core/racing/application/use-cases/ListLeagueScoringPresetsUseCase';
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import type { LeagueScoringPresetsDTO } from '../dtos/LeagueScoringPresetsDTO';
export type LeagueScoringPresetsViewModel = LeagueScoringPresetsDTO;

View File

@@ -1,16 +1,16 @@
import type { UseCaseOutputPort } from '@core/shared/application';
import type {
CreateLeagueScheduleRaceOutputDTO,
LeagueScheduleRaceMutationSuccessDTO,
CreateLeagueScheduleRaceOutputDTO,
LeagueScheduleRaceMutationSuccessDTO,
} from '../dtos/LeagueScheduleRaceAdminDTO';
import type { LeagueSeasonSchedulePublishOutputDTO } from '../dtos/LeagueSeasonSchedulePublishDTO';
import type { CreateLeagueSeasonScheduleRaceResult } from '@core/racing/application/use-cases/CreateLeagueSeasonScheduleRaceUseCase';
import type { UpdateLeagueSeasonScheduleRaceResult } from '@core/racing/application/use-cases/UpdateLeagueSeasonScheduleRaceUseCase';
import type { DeleteLeagueSeasonScheduleRaceResult } from '@core/racing/application/use-cases/DeleteLeagueSeasonScheduleRaceUseCase';
import type { PublishLeagueSeasonScheduleResult } from '@core/racing/application/use-cases/PublishLeagueSeasonScheduleUseCase';
import type { UnpublishLeagueSeasonScheduleResult } from '@core/racing/application/use-cases/UnpublishLeagueSeasonScheduleUseCase';
import type { UpdateLeagueSeasonScheduleRaceResult } from '@core/racing/application/use-cases/UpdateLeagueSeasonScheduleRaceUseCase';
export class CreateLeagueSeasonScheduleRacePresenter
implements UseCaseOutputPort<CreateLeagueSeasonScheduleRaceResult>

View File

@@ -1,6 +1,6 @@
import type { GetLeagueStandingsResult } from '@core/racing/application/use-cases/GetLeagueStandingsUseCase';
import { LeagueStandingsDTO } from '../dtos/LeagueStandingsDTO';
import type { Presenter } from '../../../shared/presentation/Presenter';
import { LeagueStandingsDTO } from '../dtos/LeagueStandingsDTO';
export class LeagueStandingsPresenter implements Presenter<GetLeagueStandingsResult, LeagueStandingsDTO> {
private result: LeagueStandingsDTO | null = null;

View File

@@ -1,6 +1,6 @@
import type { GetLeagueStatsResult } from '@core/racing/application/use-cases/GetLeagueStatsUseCase';
import { LeagueStatsDTO } from '../dtos/LeagueStatsDTO';
import type { Presenter } from '../../../shared/presentation/Presenter';
import { LeagueStatsDTO } from '../dtos/LeagueStatsDTO';
export class LeagueStatsPresenter implements Presenter<GetLeagueStatsResult, LeagueStatsDTO> {
private result: LeagueStatsDTO | null = null;

View File

@@ -1,4 +1,4 @@
import { describe, it, expect, beforeEach } from 'vitest';
import { beforeEach, describe, expect, it } from 'vitest';
import { RejectLeagueJoinRequestPresenter } from './RejectLeagueJoinRequestPresenter';
describe('RejectLeagueJoinRequestPresenter', () => {

View File

@@ -1,5 +1,5 @@
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import type { RejectLeagueJoinRequestResult } from '@core/racing/application/use-cases/RejectLeagueJoinRequestUseCase';
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import type { RejectJoinRequestOutputDTO } from '../dtos/RejectJoinRequestOutputDTO';
export class RejectLeagueJoinRequestPresenter implements UseCaseOutputPort<RejectLeagueJoinRequestResult> {

View File

@@ -1,5 +1,5 @@
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import type { RemoveLeagueMemberResult } from '@core/racing/application/use-cases/RemoveLeagueMemberUseCase';
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import type { RemoveLeagueMemberOutputDTO } from '../dtos/RemoveLeagueMemberOutputDTO';
export class RemoveLeagueMemberPresenter implements UseCaseOutputPort<RemoveLeagueMemberResult> {

View File

@@ -1,4 +1,4 @@
import { describe, it, expect, beforeEach } from 'vitest';
import { beforeEach, describe, expect, it } from 'vitest';
import { TotalLeaguesPresenter } from './TotalLeaguesPresenter';
describe('TotalLeaguesPresenter', () => {

View File

@@ -1,5 +1,5 @@
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import type { TransferLeagueOwnershipResult } from '@core/racing/application/use-cases/TransferLeagueOwnershipUseCase';
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import type { TransferLeagueOwnershipOutputDTO } from '../dtos/TransferLeagueOwnershipOutputDTO';
export class TransferLeagueOwnershipPresenter implements UseCaseOutputPort<TransferLeagueOwnershipResult> {

View File

@@ -1,5 +1,5 @@
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import type { UpdateLeagueMemberRoleResult } from '@core/racing/application/use-cases/UpdateLeagueMemberRoleUseCase';
import type { UseCaseOutputPort } from '@core/shared/application/UseCaseOutputPort';
import type { UpdateLeagueMemberRoleOutputDTO } from '../dtos/UpdateLeagueMemberRoleOutputDTO';
export class UpdateLeagueMemberRolePresenter implements UseCaseOutputPort<UpdateLeagueMemberRoleResult> {

View File

@@ -1,5 +1,5 @@
import type { UseCaseOutputPort } from '@core/shared/application';
import type { WithdrawFromLeagueWalletResult } from '@core/racing/application/use-cases/WithdrawFromLeagueWalletUseCase';
import type { UseCaseOutputPort } from '@core/shared/application';
import { WithdrawFromLeagueWalletOutputDTO } from '../dtos/WithdrawFromLeagueWalletOutputDTO';
export class WithdrawFromLeagueWalletPresenter implements UseCaseOutputPort<WithdrawFromLeagueWalletResult> {