Files
gridpilot.gg/core/identity/application/dtos/AdminVoteSessionDto.ts
2025-12-29 22:27:33 +01:00

74 lines
1.5 KiB
TypeScript

/**
* DTOs for Admin Vote Session Use Cases
*/
/**
* Input for OpenAdminVoteSessionUseCase
*/
export interface OpenAdminVoteSessionInput {
voteSessionId: string;
leagueId: string;
adminId: string;
startDate: string; // ISO date string
endDate: string; // ISO date string
eligibleVoters: string[]; // User IDs
}
/**
* Output for OpenAdminVoteSessionUseCase
*/
export interface OpenAdminVoteSessionOutput {
success: boolean;
voteSessionId: string;
errors?: string[];
}
/**
* Input for CastAdminVoteUseCase
*/
export interface CastAdminVoteInput {
voteSessionId: string;
voterId: string;
positive: boolean; // true = positive vote, false = negative vote
votedAt?: string; // ISO date string (optional, defaults to now)
}
/**
* Output for CastAdminVoteUseCase
*/
export interface CastAdminVoteOutput {
success: boolean;
voteSessionId: string;
voterId: string;
errors?: string[];
}
/**
* Input for CloseAdminVoteSessionUseCase
*/
export interface CloseAdminVoteSessionInput {
voteSessionId: string;
adminId: string; // For validation
}
/**
* Output for CloseAdminVoteSessionUseCase
*/
export interface CloseAdminVoteSessionOutput {
success: boolean;
voteSessionId: string;
outcome?: {
percentPositive: number;
count: {
positive: number;
negative: number;
total: number;
};
eligibleVoterCount: number;
participationRate: number;
outcome: 'positive' | 'negative' | 'tie';
};
eventsCreated?: number;
errors?: string[];
}