refactor
This commit is contained in:
@@ -1,56 +0,0 @@
|
||||
import type { Team } from '../../domain/entities/Team';
|
||||
import type { TeamMembership } from '../../domain/types/TeamMembership';
|
||||
|
||||
export interface JoinTeamCommandDTO {
|
||||
teamId: string;
|
||||
driverId: string;
|
||||
}
|
||||
|
||||
export interface LeaveTeamCommandDTO {
|
||||
teamId: string;
|
||||
driverId: string;
|
||||
}
|
||||
|
||||
export interface ApproveTeamJoinRequestCommandDTO {
|
||||
teamId: string;
|
||||
requestId: string;
|
||||
}
|
||||
|
||||
export interface RejectTeamJoinRequestCommandDTO {
|
||||
requestId: string;
|
||||
}
|
||||
|
||||
export interface UpdateTeamCommandDTO {
|
||||
teamId: string;
|
||||
updates: Partial<Pick<Team, 'name' | 'tag' | 'description' | 'leagues'>>;
|
||||
updatedBy: string;
|
||||
}
|
||||
|
||||
export type GetAllTeamsQueryResultDTO = Team[];
|
||||
|
||||
export interface GetTeamDetailsQueryParamsDTO {
|
||||
teamId: string;
|
||||
driverId: string;
|
||||
}
|
||||
|
||||
export interface GetTeamDetailsQueryResultDTO {
|
||||
team: Team;
|
||||
membership: TeamMembership | null;
|
||||
}
|
||||
|
||||
export interface GetTeamMembersQueryParamsDTO {
|
||||
teamId: string;
|
||||
}
|
||||
|
||||
export interface GetTeamJoinRequestsQueryParamsDTO {
|
||||
teamId: string;
|
||||
}
|
||||
|
||||
export interface GetDriverTeamQueryParamsDTO {
|
||||
driverId: string;
|
||||
}
|
||||
|
||||
export interface GetDriverTeamQueryResultDTO {
|
||||
team: Team;
|
||||
membership: TeamMembership;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
export interface ApproveTeamJoinRequestCommandDTO {
|
||||
teamId: string;
|
||||
requestId: string;
|
||||
}
|
||||
@@ -1,13 +1,7 @@
|
||||
import type { Team } from '../../domain/entities/Team';
|
||||
|
||||
export interface CreateTeamCommandDTO {
|
||||
name: string;
|
||||
tag: string;
|
||||
description: string;
|
||||
ownerId: string;
|
||||
leagues: string[];
|
||||
}
|
||||
|
||||
export interface CreateTeamResultDTO {
|
||||
team: Team;
|
||||
}
|
||||
5
core/racing/application/dtos/CreateTeamResultDTO.ts
Normal file
5
core/racing/application/dtos/CreateTeamResultDTO.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { Team } from '../../domain/entities/Team';
|
||||
|
||||
export interface CreateTeamResultDTO {
|
||||
team: Team;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import type { Team } from '../../domain/entities/Team';
|
||||
|
||||
export type GetAllTeamsQueryResultDTO = Team[];
|
||||
@@ -0,0 +1,3 @@
|
||||
export interface GetDriverTeamQueryParamsDTO {
|
||||
driverId: string;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import type { Team } from '../../domain/entities/Team';
|
||||
import type { TeamMembership } from '../../domain/types/TeamMembership';
|
||||
|
||||
export interface GetDriverTeamQueryResultDTO {
|
||||
team: Team;
|
||||
membership: TeamMembership;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
export interface GetTeamDetailsQueryParamsDTO {
|
||||
teamId: string;
|
||||
driverId: string;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import type { Team } from '../../domain/entities/Team';
|
||||
import type { TeamMembership } from '../../domain/types/TeamMembership';
|
||||
|
||||
export interface GetTeamDetailsQueryResultDTO {
|
||||
team: Team;
|
||||
membership: TeamMembership | null;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export interface GetTeamJoinRequestsQueryParamsDTO {
|
||||
teamId: string;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export interface GetTeamMembersQueryParamsDTO {
|
||||
teamId: string;
|
||||
}
|
||||
4
core/racing/application/dtos/JoinTeamCommandDTO.ts
Normal file
4
core/racing/application/dtos/JoinTeamCommandDTO.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export interface JoinTeamCommandDTO {
|
||||
teamId: string;
|
||||
driverId: string;
|
||||
}
|
||||
4
core/racing/application/dtos/LeaveTeamCommandDTO.ts
Normal file
4
core/racing/application/dtos/LeaveTeamCommandDTO.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export interface LeaveTeamCommandDTO {
|
||||
teamId: string;
|
||||
driverId: string;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export interface RejectTeamJoinRequestCommandDTO {
|
||||
requestId: string;
|
||||
}
|
||||
7
core/racing/application/dtos/UpdateTeamCommandDTO.ts
Normal file
7
core/racing/application/dtos/UpdateTeamCommandDTO.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { Team } from '../../domain/entities/Team';
|
||||
|
||||
export interface UpdateTeamCommandDTO {
|
||||
teamId: string;
|
||||
updates: Partial<Pick<Team, 'name' | 'tag' | 'description' | 'leagues'>>;
|
||||
updatedBy: string;
|
||||
}
|
||||
@@ -3,7 +3,7 @@ import type {
|
||||
TeamMembership,
|
||||
TeamJoinRequest,
|
||||
} from '../../domain/types/TeamMembership';
|
||||
import type { ApproveTeamJoinRequestCommandDTO } from '../dto/TeamCommandAndQueryDTO';
|
||||
import type { ApproveTeamJoinRequestCommandDTO } from '../dtos/ApproveTeamJoinRequestCommandDTO';
|
||||
import type { AsyncUseCase } from '@core/shared/application';
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
|
||||
@@ -5,7 +5,7 @@ import type {
|
||||
TeamMembershipStatus,
|
||||
TeamRole,
|
||||
} from '../../domain/types/TeamMembership';
|
||||
import type { JoinTeamCommandDTO } from '../dto/TeamCommandAndQueryDTO';
|
||||
import type { JoinTeamCommandDTO } from '../dtos/JoinTeamCommandDTO';
|
||||
import type { AsyncUseCase, Logger } from '@core/shared/application';
|
||||
import { Result as SharedResult } from '@core/shared/application/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { ITeamMembershipRepository } from '../../domain/repositories/ITeamMembershipRepository';
|
||||
import type { LeaveTeamCommandDTO } from '../dto/TeamCommandAndQueryDTO';
|
||||
import type { LeaveTeamCommandDTO } from '../dtos/LeaveTeamCommandDTO';
|
||||
import type { AsyncUseCase, Logger } from '@core/shared/application';
|
||||
import { Result as SharedResult } from '@core/shared/application/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { ITeamMembershipRepository } from '../../domain/repositories/ITeamMembershipRepository';
|
||||
import type { RejectTeamJoinRequestCommandDTO } from '../dto/TeamCommandAndQueryDTO';
|
||||
import type { RejectTeamJoinRequestCommandDTO } from '../dtos/RejectTeamJoinRequestCommandDTO';
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorC
|
||||
import type { ITeamRepository } from '../../domain/repositories/ITeamRepository';
|
||||
import type { ITeamMembershipRepository } from '../../domain/repositories/ITeamMembershipRepository';
|
||||
|
||||
import type { UpdateTeamCommandDTO } from '../dto/TeamCommandAndQueryDTO';
|
||||
import type { UpdateTeamCommandDTO } from '../dtos/UpdateTeamCommandDTO';
|
||||
|
||||
type UpdateTeamErrorCode = 'INSUFFICIENT_PERMISSIONS' | 'TEAM_NOT_FOUND';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user