From 60f898e9864bc7799b0935fdd1a0ae688510a319 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Mon, 30 Jun 2025 15:20:57 +0200 Subject: [PATCH] Set updatedAt in the past in demo schedule Make sure that all of the entities generated in the demo schedule are updated in the past. Otherwise updates for them will end up rejected for being before the current entity's updateAt property. This also sets the origin for the schedule to be yesterday to make it easiser to demo the schedule between friday and tuesday. --- server/generate-demo-schedule.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/server/generate-demo-schedule.ts b/server/generate-demo-schedule.ts index 502a263..72142a8 100644 --- a/server/generate-demo-schedule.ts +++ b/server/generate-demo-schedule.ts @@ -6,31 +6,31 @@ const locations = [ id: 1, name: "Stage", description: "Inside the main building.", - updatedAt: "d0 18:21", + updatedAt: "d-1 18:21", }, { id: 2, name: "Clubhouse", description: "That big red building in the middle of the park.", - updatedAt: "d0 18:25", + updatedAt: "d-1 18:25", }, { id: 4, name: "Summerhouse", description: "Next to the campfire by the lake", - updatedAt: "d0 18:22", + updatedAt: "d-1 18:22", }, { id: 6, name: "Campfire", description: "Next to the big tree by the lake.", - updatedAt: "d0 18:41", + updatedAt: "d-1 18:41", }, { id: 7, name: "Outside", description: "Takes place somewhere outside.", - updatedAt: "d0 18:37", + updatedAt: "d-1 18:37", } ] @@ -154,8 +154,8 @@ const events = [ const idMedic = 1; const idSecurity = 2; const roles = [ - { id: idMedic, name: "Medic", updatedAt: "d1 12:34" }, - { id: idSecurity, name: "Security", updatedAt: "d1 12:39" }, + { id: idMedic, name: "Medic", updatedAt: "d-2 12:34" }, + { id: idSecurity, name: "Security", updatedAt: "d-2 12:39" }, ] const shifts = [ @@ -263,7 +263,7 @@ function toShift(origin: Date, shorthand: string, idToAssigned: Map ({ id, @@ -341,7 +341,7 @@ export function generateDemoSchedule(): ApiSchedule { description, interested: eventCounts.get(id), slots: slots.map(shorthand => toSlot(origin, shorthand, slotCounts, eventSlotIdToAssigned)), - updatedAt: toIso(toDate(origin, "d0", "15:11")), + updatedAt: toIso(toDate(origin, "d-1", "15:11")), }) ), locations: locations.map( @@ -365,7 +365,7 @@ export function generateDemoSchedule(): ApiSchedule { name, roleId, slots: slots.map(shorthand => toShift(origin, shorthand, shiftSlotIdToAssigned)), - updatedAt: toIso(toDate(origin, "d0", "13:23")), + updatedAt: toIso(toDate(origin, "d-1", "13:23")), }) ) };