feat(admin): apply durable runtime clock shifts

This commit is contained in:
2026-07-30 17:21:01 +00:00
parent d6904f2c9d
commit 7f31459385
23 changed files with 1889 additions and 93 deletions
@@ -270,6 +270,12 @@ const zShutdown = z.object({
reason: z.string().optional(),
});
const zShiftSchedule = z.object({
type: z.literal('shiftSchedule'),
actionId: z.string().uuid(),
deltaMinutes: z.number().int().min(-1440).max(1440).refine((value) => value !== 0),
});
const normalizeAuctionFinalize: CommandNormalizer<'auctionFinalize'> = (envelope) => {
const command = parseWith(zAuctionFinalize, envelope.command);
if (!command) {
@@ -506,6 +512,14 @@ const normalizeShutdown: CommandNormalizer<'shutdown'> = (envelope) => {
return command ? { ...command, requestId: envelope.requestId } : null;
};
const normalizeShiftSchedule: CommandNormalizer<'shiftSchedule'> = (envelope) => {
const command = parseWith(zShiftSchedule, envelope.command);
if (!command) {
return null;
}
return { ...command, requestId: envelope.requestId };
};
const normalizers: CommandNormalizerMap = {
auctionFinalize: normalizeAuctionFinalize,
auctionOpen: normalizeAuctionOpen,
@@ -538,6 +552,7 @@ const normalizers: CommandNormalizerMap = {
pause: normalizePause,
resume: normalizeResume,
shutdown: normalizeShutdown,
shiftSchedule: normalizeShiftSchedule,
};
export const normalizeTurnDaemonCommand = (envelope: TurnDaemonCommandEnvelope): TurnDaemonCommand | null => {