website refactor
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { GetLeagueAdminPermissionsUseCase } from '@core/racing/application/use-cases/GetLeagueAdminPermissionsUseCase';
|
||||
import { ForbiddenException } from '@nestjs/common';
|
||||
import { getActorFromRequestContext } from '../auth/getActorFromRequestContext';
|
||||
import type { GetLeagueAdminPermissionsUseCase } from '@core/racing/application/use-cases/GetLeagueAdminPermissionsUseCase';
|
||||
|
||||
type GetLeagueAdminPermissionsUseCaseLike = Pick<GetLeagueAdminPermissionsUseCase, 'execute'>;
|
||||
|
||||
|
||||
@@ -4,13 +4,13 @@ import { Reflector } from '@nestjs/core';
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import request from 'supertest';
|
||||
import { vi } from 'vitest';
|
||||
import { LeagueController } from './LeagueController';
|
||||
import { LeagueService } from './LeagueService';
|
||||
import { AuthenticationGuard } from '../auth/AuthenticationGuard';
|
||||
import { AuthorizationGuard } from '../auth/AuthorizationGuard';
|
||||
import type { AuthorizationService } from '../auth/AuthorizationService';
|
||||
import { FeatureAvailabilityGuard } from '../policy/FeatureAvailabilityGuard';
|
||||
import type { PolicyService, PolicySnapshot } from '../policy/PolicyService';
|
||||
import { LeagueController } from './LeagueController';
|
||||
import { LeagueService } from './LeagueService';
|
||||
|
||||
describe('LeagueController', () => {
|
||||
let controller: LeagueController;
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
import { Body, Controller, Delete, Get, HttpCode, Param, Patch, Post, Inject, ValidationPipe, Query, NotFoundException, UnauthorizedException, BadRequestException } from '@nestjs/common';
|
||||
import { BadRequestException, Body, Controller, Delete, Get, HttpCode, Inject, NotFoundException, Param, Patch, Post, Query, UnauthorizedException, ValidationPipe } from '@nestjs/common';
|
||||
import { ApiBody, ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
||||
import { Public } from '../auth/Public';
|
||||
import { LeagueService } from './LeagueService';
|
||||
import { AllLeaguesWithCapacityDTO } from './dtos/AllLeaguesWithCapacityDTO';
|
||||
import { AllLeaguesWithCapacityAndScoringDTO } from './dtos/AllLeaguesWithCapacityAndScoringDTO';
|
||||
import { AllLeaguesWithCapacityDTO } from './dtos/AllLeaguesWithCapacityDTO';
|
||||
import { ApproveJoinRequestInputDTO } from './dtos/ApproveJoinRequestInputDTO';
|
||||
import { ApproveJoinRequestOutputDTO } from './dtos/ApproveJoinRequestOutputDTO';
|
||||
import { CreateLeagueInputDTO } from './dtos/CreateLeagueInputDTO';
|
||||
import { CreateLeagueOutputDTO } from './dtos/CreateLeagueOutputDTO';
|
||||
import { GetLeagueAdminConfigQueryDTO } from './dtos/GetLeagueAdminConfigQueryDTO';
|
||||
import { GetLeagueOwnerSummaryQueryDTO } from './dtos/GetLeagueOwnerSummaryQueryDTO';
|
||||
import { GetLeagueProtestsQueryDTO } from './dtos/GetLeagueProtestsQueryDTO';
|
||||
import { GetLeagueRacesOutputDTO } from './dtos/GetLeagueRacesOutputDTO';
|
||||
import { GetLeagueScheduleQueryDTO } from './dtos/GetLeagueScheduleQueryDTO';
|
||||
import { GetLeagueSeasonsQueryDTO } from './dtos/GetLeagueSeasonsQueryDTO';
|
||||
import { GetLeagueWalletOutputDTO } from './dtos/GetLeagueWalletOutputDTO';
|
||||
import { GetSeasonSponsorshipsOutputDTO } from './dtos/GetSeasonSponsorshipsOutputDTO';
|
||||
import { LeagueAdminDTO } from './dtos/LeagueAdminDTO';
|
||||
import { LeagueAdminPermissionsDTO } from './dtos/LeagueAdminPermissionsDTO';
|
||||
@@ -16,39 +22,33 @@ import { LeagueAdminProtestsDTO } from './dtos/LeagueAdminProtestsDTO';
|
||||
import { LeagueConfigFormModelDTO } from './dtos/LeagueConfigFormModelDTO';
|
||||
import { LeagueJoinRequestDTO } from './dtos/LeagueJoinRequestDTO';
|
||||
import { LeagueMembershipsDTO } from './dtos/LeagueMembershipsDTO';
|
||||
import { LeagueOwnerSummaryDTO } from './dtos/LeagueOwnerSummaryDTO';
|
||||
import { LeagueRosterJoinRequestDTO } from './dtos/LeagueRosterJoinRequestDTO';
|
||||
import { LeagueRosterMemberDTO } from './dtos/LeagueRosterMemberDTO';
|
||||
import { LeagueOwnerSummaryDTO } from './dtos/LeagueOwnerSummaryDTO';
|
||||
import { LeagueScheduleDTO } from './dtos/LeagueScheduleDTO';
|
||||
import {
|
||||
LeagueSeasonSchedulePublishInputDTO,
|
||||
LeagueSeasonSchedulePublishOutputDTO,
|
||||
} from './dtos/LeagueSeasonSchedulePublishDTO';
|
||||
import {
|
||||
CreateLeagueScheduleRaceInputDTO,
|
||||
CreateLeagueScheduleRaceOutputDTO,
|
||||
LeagueScheduleRaceMutationSuccessDTO,
|
||||
UpdateLeagueScheduleRaceInputDTO,
|
||||
CreateLeagueScheduleRaceInputDTO,
|
||||
CreateLeagueScheduleRaceOutputDTO,
|
||||
LeagueScheduleRaceMutationSuccessDTO,
|
||||
UpdateLeagueScheduleRaceInputDTO,
|
||||
} from './dtos/LeagueScheduleRaceAdminDTO';
|
||||
import { LeagueScoringPresetsDTO } from './dtos/LeagueScoringPresetsDTO';
|
||||
import {
|
||||
LeagueSeasonSchedulePublishInputDTO,
|
||||
LeagueSeasonSchedulePublishOutputDTO,
|
||||
} from './dtos/LeagueSeasonSchedulePublishDTO';
|
||||
import { LeagueSeasonSummaryDTO } from './dtos/LeagueSeasonSummaryDTO';
|
||||
import { LeagueStandingsDTO } from './dtos/LeagueStandingsDTO';
|
||||
import { LeagueStatsDTO } from './dtos/LeagueStatsDTO';
|
||||
import { RejectJoinRequestInputDTO } from './dtos/RejectJoinRequestInputDTO';
|
||||
import { RejectJoinRequestOutputDTO } from './dtos/RejectJoinRequestOutputDTO';
|
||||
import { RemoveLeagueMemberOutputDTO } from './dtos/RemoveLeagueMemberOutputDTO';
|
||||
import { TotalLeaguesDTO } from './dtos/TotalLeaguesDTO';
|
||||
import { TransferLeagueOwnershipInputDTO } from './dtos/TransferLeagueOwnershipInputDTO';
|
||||
import { UpdateLeagueMemberRoleInputDTO } from './dtos/UpdateLeagueMemberRoleInputDTO';
|
||||
import { UpdateLeagueMemberRoleOutputDTO } from './dtos/UpdateLeagueMemberRoleOutputDTO';
|
||||
import { GetLeagueOwnerSummaryQueryDTO } from './dtos/GetLeagueOwnerSummaryQueryDTO';
|
||||
import { GetLeagueAdminConfigQueryDTO } from './dtos/GetLeagueAdminConfigQueryDTO';
|
||||
import { GetLeagueProtestsQueryDTO } from './dtos/GetLeagueProtestsQueryDTO';
|
||||
import { GetLeagueSeasonsQueryDTO } from './dtos/GetLeagueSeasonsQueryDTO';
|
||||
import { GetLeagueWalletOutputDTO } from './dtos/GetLeagueWalletOutputDTO';
|
||||
import { TotalLeaguesDTO } from './dtos/TotalLeaguesDTO';
|
||||
import { GetLeagueScheduleQueryDTO } from './dtos/GetLeagueScheduleQueryDTO';
|
||||
import { WithdrawFromLeagueWalletInputDTO } from './dtos/WithdrawFromLeagueWalletInputDTO';
|
||||
import { WithdrawFromLeagueWalletOutputDTO } from './dtos/WithdrawFromLeagueWalletOutputDTO';
|
||||
import { LeagueScoringPresetsDTO } from './dtos/LeagueScoringPresetsDTO';
|
||||
import { TransferLeagueOwnershipInputDTO } from './dtos/TransferLeagueOwnershipInputDTO';
|
||||
|
||||
@ApiTags('leagues')
|
||||
@Controller('leagues')
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { RacingPersistenceModule } from '../../persistence/racing/RacingPersistenceModule';
|
||||
import { LeagueService } from './LeagueService';
|
||||
import { LeagueController } from './LeagueController';
|
||||
import { LeagueProviders } from './LeagueProviders';
|
||||
import { LeagueService } from './LeagueService';
|
||||
|
||||
@Module({
|
||||
imports: [RacingPersistenceModule],
|
||||
|
||||
@@ -4,6 +4,7 @@ import { LeagueService } from './LeagueService';
|
||||
import * as LeagueTokens from './LeagueTokens';
|
||||
|
||||
// Import core interfaces
|
||||
import type { MediaResolverPort } from '@core/ports/media/MediaResolverPort';
|
||||
import type { IDriverRepository } from '@core/racing/domain/repositories/DriverRepository';
|
||||
import type { ILeagueMembershipRepository } from '@core/racing/domain/repositories/LeagueMembershipRepository';
|
||||
import type { ILeagueRepository } from '@core/racing/domain/repositories/LeagueRepository';
|
||||
@@ -13,29 +14,28 @@ import type { ISeasonRepository } from '@core/racing/domain/repositories/SeasonR
|
||||
import type { ISeasonSponsorshipRepository } from '@core/racing/domain/repositories/SeasonSponsorshipRepository';
|
||||
import type { IStandingRepository } from '@core/racing/domain/repositories/StandingRepository';
|
||||
import type { Logger } from '@core/shared/application/Logger';
|
||||
import type { MediaResolverPort } from '@core/ports/media/MediaResolverPort';
|
||||
|
||||
// Import concrete in-memory implementations
|
||||
import type { ILeagueWalletRepository } from "@core/racing/domain/repositories/LeagueWalletRepository";
|
||||
import type { ITransactionRepository } from "@core/racing/domain/repositories/TransactionRepository";
|
||||
import { getLeagueScoringPresetById, listLeagueScoringPresets } from '@adapters/bootstrap/LeagueScoringPresets';
|
||||
import { ConsoleLogger } from '@adapters/logging/ConsoleLogger';
|
||||
import { InMemoryLeagueStandingsRepository } from '@adapters/racing/persistence/inmemory/InMemoryLeagueStandingsRepository';
|
||||
import { MediaResolverAdapter } from '@adapters/media/MediaResolverAdapter';
|
||||
import { InMemoryLeagueStandingsRepository } from '@adapters/racing/persistence/inmemory/InMemoryLeagueStandingsRepository';
|
||||
import type { ILeagueWalletRepository } from "@core/racing/domain/repositories/LeagueWalletRepository";
|
||||
import type { ITransactionRepository } from "@core/racing/domain/repositories/TransactionRepository";
|
||||
|
||||
// Import use cases
|
||||
import { ApproveLeagueJoinRequestUseCase } from '@core/racing/application/use-cases/ApproveLeagueJoinRequestUseCase';
|
||||
import { CreateLeagueWithSeasonAndScoringUseCase } from '@core/racing/application/use-cases/CreateLeagueWithSeasonAndScoringUseCase';
|
||||
import { GetAllLeaguesWithCapacityUseCase } from '@core/racing/application/use-cases/GetAllLeaguesWithCapacityUseCase';
|
||||
import { GetAllLeaguesWithCapacityAndScoringUseCase } from '@core/racing/application/use-cases/GetAllLeaguesWithCapacityAndScoringUseCase';
|
||||
import { GetAllLeaguesWithCapacityUseCase } from '@core/racing/application/use-cases/GetAllLeaguesWithCapacityUseCase';
|
||||
import { GetLeagueAdminPermissionsUseCase } from '@core/racing/application/use-cases/GetLeagueAdminPermissionsUseCase';
|
||||
import { GetLeagueFullConfigUseCase } from '@core/racing/application/use-cases/GetLeagueFullConfigUseCase';
|
||||
import { GetLeagueJoinRequestsUseCase } from '@core/racing/application/use-cases/GetLeagueJoinRequestsUseCase';
|
||||
import { GetLeagueMembershipsUseCase } from '@core/racing/application/use-cases/GetLeagueMembershipsUseCase';
|
||||
import { GetLeagueRosterMembersUseCase } from '@core/racing/application/use-cases/GetLeagueRosterMembersUseCase';
|
||||
import { GetLeagueRosterJoinRequestsUseCase } from '@core/racing/application/use-cases/GetLeagueRosterJoinRequestsUseCase';
|
||||
import { GetLeagueOwnerSummaryUseCase } from '@core/racing/application/use-cases/GetLeagueOwnerSummaryUseCase';
|
||||
import { GetLeagueProtestsUseCase } from '@core/racing/application/use-cases/GetLeagueProtestsUseCase';
|
||||
import { GetLeagueRosterJoinRequestsUseCase } from '@core/racing/application/use-cases/GetLeagueRosterJoinRequestsUseCase';
|
||||
import { GetLeagueRosterMembersUseCase } from '@core/racing/application/use-cases/GetLeagueRosterMembersUseCase';
|
||||
import { GetLeagueScheduleUseCase } from '@core/racing/application/use-cases/GetLeagueScheduleUseCase';
|
||||
import { GetLeagueScoringConfigUseCase } from '@core/racing/application/use-cases/GetLeagueScoringConfigUseCase';
|
||||
import { GetLeagueSeasonsUseCase } from '@core/racing/application/use-cases/GetLeagueSeasonsUseCase';
|
||||
@@ -55,22 +55,18 @@ import { WithdrawFromLeagueWalletUseCase } from '@core/racing/application/use-ca
|
||||
|
||||
// Schedule mutation use cases
|
||||
import { CreateLeagueSeasonScheduleRaceUseCase } from '@core/racing/application/use-cases/CreateLeagueSeasonScheduleRaceUseCase';
|
||||
import { UpdateLeagueSeasonScheduleRaceUseCase } from '@core/racing/application/use-cases/UpdateLeagueSeasonScheduleRaceUseCase';
|
||||
import { DeleteLeagueSeasonScheduleRaceUseCase } from '@core/racing/application/use-cases/DeleteLeagueSeasonScheduleRaceUseCase';
|
||||
import { PublishLeagueSeasonScheduleUseCase } from '@core/racing/application/use-cases/PublishLeagueSeasonScheduleUseCase';
|
||||
import { UnpublishLeagueSeasonScheduleUseCase } from '@core/racing/application/use-cases/UnpublishLeagueSeasonScheduleUseCase';
|
||||
import { UpdateLeagueSeasonScheduleRaceUseCase } from '@core/racing/application/use-cases/UpdateLeagueSeasonScheduleRaceUseCase';
|
||||
|
||||
// Import presenters
|
||||
import { AllLeaguesWithCapacityPresenter } from './presenters/AllLeaguesWithCapacityPresenter';
|
||||
import { AllLeaguesWithCapacityAndScoringPresenter } from './presenters/AllLeaguesWithCapacityAndScoringPresenter';
|
||||
import { AllLeaguesWithCapacityPresenter } from './presenters/AllLeaguesWithCapacityPresenter';
|
||||
import { ApproveLeagueJoinRequestPresenter } from './presenters/ApproveLeagueJoinRequestPresenter';
|
||||
import { CreateLeaguePresenter } from './presenters/CreateLeaguePresenter';
|
||||
import { GetLeagueAdminPermissionsPresenter } from './presenters/GetLeagueAdminPermissionsPresenter';
|
||||
import { GetLeagueMembershipsPresenter } from './presenters/GetLeagueMembershipsPresenter';
|
||||
import {
|
||||
GetLeagueRosterJoinRequestsPresenter,
|
||||
GetLeagueRosterMembersPresenter,
|
||||
} from './presenters/LeagueRosterAdminReadPresenters';
|
||||
import { GetLeagueOwnerSummaryPresenter } from './presenters/GetLeagueOwnerSummaryPresenter';
|
||||
import { GetLeagueProtestsPresenter } from './presenters/GetLeagueProtestsPresenter';
|
||||
import { GetLeagueSeasonsPresenter } from './presenters/GetLeagueSeasonsPresenter';
|
||||
@@ -79,7 +75,11 @@ import { GetSeasonSponsorshipsPresenter } from './presenters/GetSeasonSponsorshi
|
||||
import { JoinLeaguePresenter } from './presenters/JoinLeaguePresenter';
|
||||
import { LeagueConfigPresenter } from './presenters/LeagueConfigPresenter';
|
||||
import { LeagueJoinRequestsPresenter } from './presenters/LeagueJoinRequestsPresenter';
|
||||
import { LeagueSchedulePresenter, LeagueRacesPresenter } from './presenters/LeagueSchedulePresenter';
|
||||
import {
|
||||
GetLeagueRosterJoinRequestsPresenter,
|
||||
GetLeagueRosterMembersPresenter,
|
||||
} from './presenters/LeagueRosterAdminReadPresenters';
|
||||
import { LeagueRacesPresenter, LeagueSchedulePresenter } from './presenters/LeagueSchedulePresenter';
|
||||
import { LeagueScoringConfigPresenter } from './presenters/LeagueScoringConfigPresenter';
|
||||
import { LeagueScoringPresetsPresenter } from './presenters/LeagueScoringPresetsPresenter';
|
||||
import { LeagueStandingsPresenter } from './presenters/LeagueStandingsPresenter';
|
||||
@@ -92,11 +92,11 @@ import { UpdateLeagueMemberRolePresenter } from './presenters/UpdateLeagueMember
|
||||
import { WithdrawFromLeagueWalletPresenter } from './presenters/WithdrawFromLeagueWalletPresenter';
|
||||
|
||||
import {
|
||||
CreateLeagueSeasonScheduleRacePresenter,
|
||||
DeleteLeagueSeasonScheduleRacePresenter,
|
||||
PublishLeagueSeasonSchedulePresenter,
|
||||
UnpublishLeagueSeasonSchedulePresenter,
|
||||
UpdateLeagueSeasonScheduleRacePresenter,
|
||||
CreateLeagueSeasonScheduleRacePresenter,
|
||||
DeleteLeagueSeasonScheduleRacePresenter,
|
||||
PublishLeagueSeasonSchedulePresenter,
|
||||
UnpublishLeagueSeasonSchedulePresenter,
|
||||
UpdateLeagueSeasonScheduleRacePresenter,
|
||||
} from './presenters/LeagueSeasonScheduleMutationPresenters';
|
||||
|
||||
export const LEAGUE_REPOSITORY_TOKEN = 'ILeagueRepository';
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
import 'reflect-metadata';
|
||||
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { Reflector } from '@nestjs/core';
|
||||
import request from 'supertest';
|
||||
import { ValidationPipe } from '@nestjs/common';
|
||||
import { Reflector } from '@nestjs/core';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import request from 'supertest';
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import { LeagueModule } from './LeagueModule';
|
||||
import { AuthenticationGuard } from '../auth/AuthenticationGuard';
|
||||
import { AuthorizationGuard } from '../auth/AuthorizationGuard';
|
||||
import type { AuthorizationService } from '../auth/AuthorizationService';
|
||||
import { LeagueModule } from './LeagueModule';
|
||||
|
||||
import { requestContextMiddleware } from '@adapters/http/RequestContext';
|
||||
|
||||
import {
|
||||
DRIVER_REPOSITORY_TOKEN,
|
||||
LEAGUE_MEMBERSHIP_REPOSITORY_TOKEN,
|
||||
LEAGUE_REPOSITORY_TOKEN,
|
||||
DRIVER_REPOSITORY_TOKEN,
|
||||
LEAGUE_MEMBERSHIP_REPOSITORY_TOKEN,
|
||||
LEAGUE_REPOSITORY_TOKEN,
|
||||
} from '../../persistence/inmemory/InMemoryRacingPersistenceModule';
|
||||
|
||||
import { League } from '@core/racing/domain/entities/League';
|
||||
import { Driver } from '@core/racing/domain/entities/Driver';
|
||||
import { JoinRequest } from '@core/racing/domain/entities/JoinRequest';
|
||||
import { League } from '@core/racing/domain/entities/League';
|
||||
import { LeagueMembership } from '@core/racing/domain/entities/LeagueMembership';
|
||||
|
||||
describe('League roster join request mutations (HTTP)', () => {
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
import 'reflect-metadata';
|
||||
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { Reflector } from '@nestjs/core';
|
||||
import request from 'supertest';
|
||||
import { ValidationPipe } from '@nestjs/common';
|
||||
import { Reflector } from '@nestjs/core';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import request from 'supertest';
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import { LeagueModule } from './LeagueModule';
|
||||
import { AuthenticationGuard } from '../auth/AuthenticationGuard';
|
||||
import { AuthorizationGuard } from '../auth/AuthorizationGuard';
|
||||
import type { AuthorizationService } from '../auth/AuthorizationService';
|
||||
import { LeagueModule } from './LeagueModule';
|
||||
|
||||
import { requestContextMiddleware } from '@adapters/http/RequestContext';
|
||||
|
||||
import {
|
||||
DRIVER_REPOSITORY_TOKEN,
|
||||
LEAGUE_MEMBERSHIP_REPOSITORY_TOKEN,
|
||||
LEAGUE_REPOSITORY_TOKEN,
|
||||
DRIVER_REPOSITORY_TOKEN,
|
||||
LEAGUE_MEMBERSHIP_REPOSITORY_TOKEN,
|
||||
LEAGUE_REPOSITORY_TOKEN,
|
||||
} from '../../persistence/inmemory/InMemoryRacingPersistenceModule';
|
||||
|
||||
import { League } from '@core/racing/domain/entities/League';
|
||||
import { Driver } from '@core/racing/domain/entities/Driver';
|
||||
import { League } from '@core/racing/domain/entities/League';
|
||||
import { LeagueMembership } from '@core/racing/domain/entities/LeagueMembership';
|
||||
|
||||
describe('League roster member mutations (HTTP)', () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import { requestContextMiddleware } from '@adapters/http/RequestContext';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import { LeagueService } from './LeagueService';
|
||||
|
||||
async function withUserId<T>(userId: string, fn: () => Promise<T>): Promise<T> {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsBoolean } from 'class-validator';
|
||||
import { IsBoolean, IsString } from 'class-validator';
|
||||
|
||||
export class ApproveJoinRequestOutputDTO {
|
||||
@ApiProperty()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsEnum } from 'class-validator';
|
||||
import { IsEnum, IsString } from 'class-validator';
|
||||
|
||||
export class CreateLeagueInputDTO {
|
||||
@ApiProperty()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsBoolean } from 'class-validator';
|
||||
import { IsBoolean, IsString } from 'class-validator';
|
||||
|
||||
export class CreateLeagueOutputDTO {
|
||||
@ApiProperty()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsOptional, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsOptional, ValidateNested } from 'class-validator';
|
||||
import { LeagueConfigFormModelDTO } from './LeagueConfigFormModelDTO';
|
||||
|
||||
export class GetLeagueAdminConfigOutputDTO {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsOptional, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsOptional, ValidateNested } from 'class-validator';
|
||||
import { LeagueConfigFormModelDTO } from './LeagueConfigFormModelDTO';
|
||||
|
||||
export class LeagueAdminConfigDTO {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsOptional, IsArray, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { LeagueJoinRequestDTO } from './LeagueJoinRequestDTO';
|
||||
import { LeagueOwnerSummaryDTO } from './LeagueOwnerSummaryDTO';
|
||||
import { IsArray, IsOptional, ValidateNested } from 'class-validator';
|
||||
import { LeagueAdminConfigDTO } from './LeagueAdminConfigDTO';
|
||||
import { LeagueAdminProtestsDTO } from './LeagueAdminProtestsDTO';
|
||||
import { LeagueJoinRequestDTO } from './LeagueJoinRequestDTO';
|
||||
import { LeagueOwnerSummaryDTO } from './LeagueOwnerSummaryDTO';
|
||||
import { LeagueSeasonSummaryDTO } from './LeagueSeasonSummaryDTO';
|
||||
|
||||
export class LeagueAdminDTO {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsArray, ValidateNested, IsObject } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsArray, IsObject, ValidateNested } from 'class-validator';
|
||||
import { DriverDTO } from '../../driver/dtos/DriverDTO';
|
||||
import { RaceDTO } from '../../race/dtos/RaceDTO';
|
||||
import { ProtestDTO } from './ProtestDTO';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsEnum } from 'class-validator';
|
||||
import { IsEnum, IsString } from 'class-validator';
|
||||
|
||||
export class LeagueConfigFormModelBasicsDTO {
|
||||
@ApiProperty()
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsArray, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsArray, IsString, ValidateNested } from 'class-validator';
|
||||
import { LeagueConfigFormModelBasicsDTO } from './LeagueConfigFormModelBasicsDTO';
|
||||
import { LeagueConfigFormModelStructureDTO } from './LeagueConfigFormModelStructureDTO';
|
||||
import { LeagueConfigFormModelScoringDTO } from './LeagueConfigFormModelScoringDTO';
|
||||
import { LeagueConfigFormModelDropPolicyDTO } from './LeagueConfigFormModelDropPolicyDTO';
|
||||
import { LeagueConfigFormModelScoringDTO } from './LeagueConfigFormModelScoringDTO';
|
||||
import { LeagueConfigFormModelStewardingDTO } from './LeagueConfigFormModelStewardingDTO';
|
||||
import { LeagueConfigFormModelStructureDTO } from './LeagueConfigFormModelStructureDTO';
|
||||
import { LeagueConfigFormModelTimingsDTO } from './LeagueConfigFormModelTimingsDTO';
|
||||
|
||||
export class LeagueConfigFormModelDTO {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNumber, IsOptional, IsEnum } from 'class-validator';
|
||||
import { IsEnum, IsNumber, IsOptional } from 'class-validator';
|
||||
|
||||
export class LeagueConfigFormModelDropPolicyDTO {
|
||||
@ApiProperty({ enum: ['none', 'worst_n'] })
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsNumber } from 'class-validator';
|
||||
import { IsNumber, IsString } from 'class-validator';
|
||||
|
||||
export class LeagueConfigFormModelScoringDTO {
|
||||
@ApiProperty()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNumber, IsBoolean, IsOptional, IsEnum } from 'class-validator';
|
||||
import { IsBoolean, IsEnum, IsNumber, IsOptional } from 'class-validator';
|
||||
|
||||
export class LeagueConfigFormModelStewardingDTO {
|
||||
@ApiProperty({ enum: ['single_steward', 'committee_vote'] })
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsEnum } from 'class-validator';
|
||||
import { IsEnum, IsString } from 'class-validator';
|
||||
|
||||
export class LeagueConfigFormModelStructureDTO {
|
||||
@ApiProperty()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsNumber } from 'class-validator';
|
||||
import { IsNumber, IsString } from 'class-validator';
|
||||
|
||||
export class LeagueConfigFormModelTimingsDTO {
|
||||
@ApiProperty()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsDate, IsOptional } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsDate, IsOptional, IsString } from 'class-validator';
|
||||
|
||||
export interface DriverInfo {
|
||||
id: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsEnum, IsString, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsEnum, IsString, ValidateNested } from 'class-validator';
|
||||
import { DriverDTO } from '../../driver/dtos/DriverDTO';
|
||||
|
||||
export class LeagueMemberDTO {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsEnum } from 'class-validator';
|
||||
import { IsEnum, IsString } from 'class-validator';
|
||||
|
||||
export class LeagueMembershipDTO {
|
||||
@ApiProperty()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsArray, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsArray, ValidateNested } from 'class-validator';
|
||||
import { LeagueMemberDTO } from './LeagueMemberDTO';
|
||||
|
||||
export class LeagueMembershipsDTO {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNumber, IsOptional, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsNumber, IsOptional, ValidateNested } from 'class-validator';
|
||||
import { DriverDTO } from '../../driver/dtos/DriverDTO';
|
||||
|
||||
export class LeagueOwnerSummaryDTO {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsArray, IsBoolean, IsString, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsArray, IsBoolean, IsString, ValidateNested } from 'class-validator';
|
||||
import { RaceDTO } from '../../race/dtos/RaceDTO';
|
||||
|
||||
export class LeagueScheduleDTO {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsEnum, IsNumber, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsEnum, IsNumber, IsString, ValidateNested } from 'class-validator';
|
||||
|
||||
export class LeagueScoringPresetTimingDefaultsDTO {
|
||||
@ApiProperty()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsBoolean, IsDate, IsOptional } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsBoolean, IsDate, IsOptional, IsString } from 'class-validator';
|
||||
|
||||
export class LeagueSeasonSummaryDTO {
|
||||
@ApiProperty()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsNumber, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsNumber, IsString, ValidateNested } from 'class-validator';
|
||||
import { DriverDTO } from '../../driver/dtos/DriverDTO';
|
||||
|
||||
export class LeagueStandingDTO {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsArray, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsArray, ValidateNested } from 'class-validator';
|
||||
import { LeagueStandingDTO } from './LeagueStandingDTO';
|
||||
|
||||
export class LeagueStandingsDTO {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsNumber, IsBoolean, IsOptional } from 'class-validator';
|
||||
import { IsBoolean, IsNumber, IsOptional, IsString } from 'class-validator';
|
||||
|
||||
export class LeagueSummaryDTO {
|
||||
@ApiProperty()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsNumber, IsOptional, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsNumber, IsOptional, IsString, ValidateNested } from 'class-validator';
|
||||
import { LeagueSettingsDTO } from './LeagueSettingsDTO';
|
||||
|
||||
export class LeagueWithCapacityDTO {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsDate, IsEnum } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsDate, IsEnum, IsString } from 'class-validator';
|
||||
|
||||
/**
|
||||
* ProtestDTO represents a protest that is filed against a specific race
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsBoolean } from 'class-validator';
|
||||
import { IsBoolean, IsString } from 'class-validator';
|
||||
|
||||
export class RejectJoinRequestOutputDTO {
|
||||
@ApiProperty()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsBoolean, IsDate, IsOptional, IsEnum } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsBoolean, IsDate, IsEnum, IsOptional, IsString } from 'class-validator';
|
||||
|
||||
export class SeasonDTO {
|
||||
@ApiProperty()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsOptional, IsString, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsOptional, IsString, ValidateNested } from 'class-validator';
|
||||
|
||||
export class WizardErrorsBasicsDTO {
|
||||
@ApiProperty({ required: false })
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { describe, it, expect, beforeEach } from 'vitest';
|
||||
import { beforeEach, describe, expect, it } from 'vitest';
|
||||
import { ApproveLeagueJoinRequestPresenter } from './ApproveLeagueJoinRequestPresenter';
|
||||
|
||||
describe('ApproveLeagueJoinRequestPresenter', () => {
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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[]> {
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { describe, it, expect, beforeEach } from 'vitest';
|
||||
import { beforeEach, describe, expect, it } from 'vitest';
|
||||
import { RejectLeagueJoinRequestPresenter } from './RejectLeagueJoinRequestPresenter';
|
||||
|
||||
describe('RejectLeagueJoinRequestPresenter', () => {
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { describe, it, expect, beforeEach } from 'vitest';
|
||||
import { beforeEach, describe, expect, it } from 'vitest';
|
||||
import { TotalLeaguesPresenter } from './TotalLeaguesPresenter';
|
||||
|
||||
describe('TotalLeaguesPresenter', () => {
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user