feat: redesign auction engine with redis sot
This commit is contained in:
1 parent
737702d78c
commit
e8bb20d988
75 files changed
+12737
-542
No files matched your search
@@ -7,6 +7,8 @@ import {
|
||||
IsInt,
|
||||
IsMongoId,
|
||||
IsOptional,
|
||||
IsString,
|
||||
IsUUID,
|
||||
Max,
|
||||
Min,
|
||||
ValidateNested,
|
||||
@@ -28,10 +30,13 @@ class CaptainAssignmentDto {
|
||||
@IsInt()
|
||||
@Min(100)
|
||||
@Max(100000)
|
||||
initialPoints?: number;
|
||||
initialTeamBidPointAmount?: number;
|
||||
}
|
||||
|
||||
export class StartAuctionDto {
|
||||
@IsUUID()
|
||||
startAuctionRequestId!: string;
|
||||
|
||||
@IsArray()
|
||||
@ArrayMinSize(2)
|
||||
@ArrayMaxSize(16)
|
||||
@@ -43,50 +48,92 @@ export class StartAuctionDto {
|
||||
@IsInt()
|
||||
@Min(100)
|
||||
@Max(100000)
|
||||
initialPoints?: number;
|
||||
initialTeamBidPointAmount?: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsEnum(AUCTION_TOP_TIER_THRESHOLDS)
|
||||
topTierThreshold?: AuctionTopTierThreshold;
|
||||
topTierAuctionPriorityThreshold?: AuctionTopTierThreshold;
|
||||
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@ArrayMaxSize(100)
|
||||
@IsMongoId({ each: true })
|
||||
manualTopTierUserIds?: string[];
|
||||
manualTopTierAuctionPriorityUserIds?: string[];
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(5)
|
||||
maxTimerSeconds?: number;
|
||||
maximumBidRoundDurationSeconds?: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
bidExtensionSeconds?: number;
|
||||
bidRoundExtensionSeconds?: number;
|
||||
}
|
||||
|
||||
export class PlaceBidDto {
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
teamIndex!: number;
|
||||
@IsOptional()
|
||||
@IsUUID()
|
||||
bidRequestId?: string;
|
||||
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
amount!: number;
|
||||
bidderTeamIndex!: number;
|
||||
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
bidPointAmount!: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsMongoId()
|
||||
bidderUserId?: string;
|
||||
clientObservedAuctionLifecycleId?: string;
|
||||
|
||||
@IsOptional()
|
||||
clientObservedCurrentBidRoundPlayerUserId?: string;
|
||||
}
|
||||
|
||||
export class SoldDto {
|
||||
export class AuctionActionRequestDto {
|
||||
@IsOptional()
|
||||
@IsUUID()
|
||||
auctionActionRequestId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
clientObservedAuctionLifecycleId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
clientObservedRevision?: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
clientObservedPhase?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
clientObservedCurrentBidRoundPlayerUserId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
clientObservedCurrentAuctionPlayerOrderIndex?: number;
|
||||
}
|
||||
|
||||
export class SoldDto extends AuctionActionRequestDto {
|
||||
@IsOptional()
|
||||
@IsEnum(['TOP', 'JGL', 'MID', 'ADC', 'SUP'])
|
||||
assignedPosition?: 'TOP' | 'JGL' | 'MID' | 'ADC' | 'SUP';
|
||||
}
|
||||
|
||||
export class UndoAuctionDto {
|
||||
export class OpenBiddingDto extends AuctionActionRequestDto {}
|
||||
|
||||
export class NextAuctionDto extends AuctionActionRequestDto {}
|
||||
|
||||
export class PassedAuctionDto extends AuctionActionRequestDto {}
|
||||
|
||||
export class ResetAuctionDto extends AuctionActionRequestDto {}
|
||||
|
||||
export class UndoAuctionDto extends AuctionActionRequestDto {
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
sequence!: number;
|
||||
|
||||
Reference in new issue
Block a user