feat: 토너먼트 관련 기능 추가 및 베팅 처리 로직 구현

This commit is contained in:
2026-01-23 16:58:59 +00:00
parent b6164868b7
commit 293a5035c6
9 changed files with 314 additions and 15 deletions
@@ -233,6 +233,29 @@ const normalizeCommand = (envelope: TurnDaemonCommandEnvelope): TurnDaemonComman
refunds,
};
}
case 'tournamentBettingPayout': {
if (!Array.isArray(command.payouts)) {
return null;
}
const payouts = command.payouts
.filter((entry) =>
entry && typeof entry.generalId === 'number' && typeof entry.amount === 'number'
)
.map((entry) => ({
generalId: entry.generalId,
amount: entry.amount,
}));
if (payouts.length === 0) {
return null;
}
return {
type: 'tournamentBettingPayout',
requestId: envelope.requestId,
bettingId: typeof command.bettingId === 'number' ? command.bettingId : undefined,
reason: typeof command.reason === 'string' ? command.reason : undefined,
payouts,
};
}
case 'getStatus': {
const requestId = typeof command.requestId === 'string' ? command.requestId : envelope.requestId;
return { type: 'getStatus', requestId };