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
@@ -221,9 +221,21 @@ export function useAuctionHistory(
|
||||
export function useUndoAuction(communityId = DEFAULT_COMMUNITY_ID) {
|
||||
return useMutation({
|
||||
mutationFn: ({
|
||||
auctionActionRequestId,
|
||||
clientObservedAuctionLifecycleId,
|
||||
clientObservedCurrentAuctionPlayerOrderIndex,
|
||||
clientObservedCurrentBidRoundPlayerUserId,
|
||||
clientObservedPhase,
|
||||
clientObservedRevision,
|
||||
matchId,
|
||||
sequence,
|
||||
}: {
|
||||
auctionActionRequestId?: string;
|
||||
clientObservedAuctionLifecycleId?: string;
|
||||
clientObservedCurrentAuctionPlayerOrderIndex?: number;
|
||||
clientObservedCurrentBidRoundPlayerUserId?: string;
|
||||
clientObservedPhase?: string;
|
||||
clientObservedRevision?: number;
|
||||
matchId: string;
|
||||
sequence: number;
|
||||
}) =>
|
||||
@@ -231,7 +243,15 @@ export function useUndoAuction(communityId = DEFAULT_COMMUNITY_ID) {
|
||||
`/communities/${communityId}/matches/${matchId}/auction/undo`,
|
||||
{
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ sequence }),
|
||||
body: JSON.stringify({
|
||||
auctionActionRequestId,
|
||||
clientObservedAuctionLifecycleId,
|
||||
clientObservedCurrentAuctionPlayerOrderIndex,
|
||||
clientObservedCurrentBidRoundPlayerUserId,
|
||||
clientObservedPhase,
|
||||
clientObservedRevision,
|
||||
sequence,
|
||||
}),
|
||||
},
|
||||
),
|
||||
});
|
||||
@@ -239,9 +259,33 @@ export function useUndoAuction(communityId = DEFAULT_COMMUNITY_ID) {
|
||||
|
||||
export function useResetAuction(communityId = DEFAULT_COMMUNITY_ID) {
|
||||
return useMutation({
|
||||
mutationFn: ({ matchId }: { matchId: string }) =>
|
||||
mutationFn: ({
|
||||
auctionActionRequestId,
|
||||
clientObservedAuctionLifecycleId,
|
||||
clientObservedCurrentAuctionPlayerOrderIndex,
|
||||
clientObservedCurrentBidRoundPlayerUserId,
|
||||
clientObservedPhase,
|
||||
clientObservedRevision,
|
||||
matchId,
|
||||
}: {
|
||||
auctionActionRequestId?: string;
|
||||
clientObservedAuctionLifecycleId?: string;
|
||||
clientObservedCurrentAuctionPlayerOrderIndex?: number;
|
||||
clientObservedCurrentBidRoundPlayerUserId?: string;
|
||||
clientObservedPhase?: string;
|
||||
clientObservedRevision?: number;
|
||||
matchId: string;
|
||||
}) =>
|
||||
apiFetch<void>(`/communities/${communityId}/matches/${matchId}/auction`, {
|
||||
method: 'DELETE',
|
||||
body: JSON.stringify({
|
||||
auctionActionRequestId,
|
||||
clientObservedAuctionLifecycleId,
|
||||
clientObservedCurrentAuctionPlayerOrderIndex,
|
||||
clientObservedCurrentBidRoundPlayerUserId,
|
||||
clientObservedPhase,
|
||||
clientObservedRevision,
|
||||
}),
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user