토너먼트 준비

This commit is contained in:
2026-01-23 16:45:36 +00:00
parent 835886c7a9
commit 2d87cf881e
19 changed files with 744 additions and 4 deletions
@@ -210,6 +210,29 @@ const normalizeCommand = (envelope: TurnDaemonCommandEnvelope): TurnDaemonComman
officerLevel: command.officerLevel,
};
}
case 'tournamentRefund': {
if (!Array.isArray(command.refunds)) {
return null;
}
const refunds = command.refunds
.filter((entry) =>
entry && typeof entry.generalId === 'number' && typeof entry.amount === 'number'
)
.map((entry) => ({
generalId: entry.generalId,
amount: entry.amount,
}));
if (refunds.length === 0) {
return null;
}
return {
type: 'tournamentRefund',
requestId: envelope.requestId,
bettingId: typeof command.bettingId === 'number' ? command.bettingId : undefined,
reason: typeof command.reason === 'string' ? command.reason : undefined,
refunds,
};
}
case 'getStatus': {
const requestId = typeof command.requestId === 'string' ? command.requestId : envelope.requestId;
return { type: 'getStatus', requestId };