From d87e1b6467c4291c87cc060fb9066625f7f0c6ff Mon Sep 17 00:00:00 2001 From: Sara Gowen Date: Fri, 26 Apr 2024 11:29:22 +0100 Subject: [PATCH 1/3] Update seed data to include breaks --- .../Migrations/2024_SeedData.sql | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/PocketDDD.Server/PocketDDD.Server.DB/Migrations/2024_SeedData.sql b/PocketDDD.Server/PocketDDD.Server.DB/Migrations/2024_SeedData.sql index 37e6c8b..5e825cd 100644 --- a/PocketDDD.Server/PocketDDD.Server.DB/Migrations/2024_SeedData.sql +++ b/PocketDDD.Server/PocketDDD.Server.DB/Migrations/2024_SeedData.sql @@ -1,3 +1,6 @@ +-- Before running this script, ensure that FullDBScript.sql has been run to create the tables + +-- Remove all the data delete [UserSessionFeedback] delete [UserEventFeedback] delete [Sessions] @@ -8,18 +11,26 @@ delete EventDetail GO -DBCC CHECKIDENT ('[EventDetail]', RESEED, 1); +-- Reset the identity columns +DBCC CHECKIDENT ('[EventDetail]', RESEED, 1); -- There is hardcoding to EventDetail ID 1 so we reset to 1 not 0 DBCC CHECKIDENT ('[Tracks]', RESEED, 0); DBCC CHECKIDENT ('[TimeSlots]', RESEED, 0); DBCC CHECKIDENT ('[Sessions]', RESEED, 0); GO +-- Add 2024 Sessionize ID Insert into EventDetail values (1, 'kn91wz1x') -Insert into Tracks values (1, 'Track 1','The Junction 🚉', 0) -Insert into Tracks values (1, 'Track 2','Brunel''s Boardroom 🎩🛹', 1) -Insert into Tracks values (1, 'Track 3','Brunel''s Breakout room 🎩☕', 2) -Insert into Tracks values (1, 'Track 4','Clock tower room ⏲', 3) +GO + +-- Add breaks (these don't get imported from Sessionize) +Insert into TimeSlots values (1,'2024-04-27 08:30:00.0000000 +01:00','2024-04-27 09:00:00.0000000 +01:00', 'Registration & Breakfast | Sponsored by Elastic Mint') +Insert into TimeSlots values (1,'2024-04-27 09:00:00.0000000 +01:00','2024-04-27 09:30:00.0000000 +01:00', 'Welcome briefing') +Insert into TimeSlots values (1,'2024-04-27 10:30:00.0000000 +01:00','2024-04-27 10:45:00.0000000 +01:00', 'Tea & Coffee') +Insert into TimeSlots values (1,'2024-04-27 11:45:00.0000000 +01:00','2024-04-27 12:00:00.0000000 +01:00', 'Tea & Coffee') +Insert into TimeSlots values (1,'2024-04-27 13:00:00.0000000 +01:00','2024-04-27 14:15:00.0000000 +01:00', 'Lunch | Sponsored by Just Eat Takeaway.com') +Insert into TimeSlots values (1,'2024-04-27 15:15:00.0000000 +01:00','2024-04-27 15:45:00.0000000 +01:00', 'Afternoon Tea | Sponsored by dxw') +Insert into TimeSlots values (1,'2024-04-27 16:45:00.0000000 +01:00','2024-04-27 17:15:00.0000000 +01:00', 'Closing & Prize draw') -GO \ No newline at end of file +GO From 5e9fee5fe3e4f3f1bd6ec3a648158a1c86964edd Mon Sep 17 00:00:00 2001 From: Sara Gowen Date: Fri, 26 Apr 2024 12:01:57 +0100 Subject: [PATCH 2/3] Make UI show local time Sessionize stores time in UTC - we want to show time as it really is --- .../Features/Home/Store/EventDataMapper.cs | 4 ++-- .../Features/Session/Store/SessionReducer.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PocketDDD.BlazorClient/PocketDDD.BlazorClient/Features/Home/Store/EventDataMapper.cs b/PocketDDD.BlazorClient/PocketDDD.BlazorClient/Features/Home/Store/EventDataMapper.cs index 006e695..aff1af0 100644 --- a/PocketDDD.BlazorClient/PocketDDD.BlazorClient/Features/Home/Store/EventDataMapper.cs +++ b/PocketDDD.BlazorClient/PocketDDD.BlazorClient/Features/Home/Store/EventDataMapper.cs @@ -9,8 +9,8 @@ public static IImmutableList ToHomeStateModel(this EventDataResponseDT eventData.TimeSlots.Select(ts => new TimeSlot { Id = ts.Id, - From = ts.From, - To = ts.To, + From = ts.From.LocalDateTime, + To = ts.To.LocalDateTime, Info = ts.Info, Sessions = eventData.Sessions .Where(s => s.TimeSlotId == ts.Id) diff --git a/PocketDDD.BlazorClient/PocketDDD.BlazorClient/Features/Session/Store/SessionReducer.cs b/PocketDDD.BlazorClient/PocketDDD.BlazorClient/Features/Session/Store/SessionReducer.cs index 07d591b..2d9c632 100644 --- a/PocketDDD.BlazorClient/PocketDDD.BlazorClient/Features/Session/Store/SessionReducer.cs +++ b/PocketDDD.BlazorClient/PocketDDD.BlazorClient/Features/Session/Store/SessionReducer.cs @@ -15,8 +15,8 @@ state with Detail = action.Session.FullDescription, SpeakerName = action.Session.Speaker, - From = action.TimeSlot.From, - To = action.TimeSlot.To, + From = action.TimeSlot.From.LocalDateTime, + To = action.TimeSlot.To.LocalDateTime, TrackName = action.Track.Name, RoomName = action.Track.RoomName, From b24544b989008f56aedeb87301df8afc6bc8a3f4 Mon Sep 17 00:00:00 2001 From: Sara Gowen Date: Fri, 26 Apr 2024 12:15:56 +0100 Subject: [PATCH 3/3] Add disambiguation around reseed identity for EventDetail --- .../PocketDDD.Server.DB/Migrations/2024_SeedData.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PocketDDD.Server/PocketDDD.Server.DB/Migrations/2024_SeedData.sql b/PocketDDD.Server/PocketDDD.Server.DB/Migrations/2024_SeedData.sql index 5e825cd..37fb204 100644 --- a/PocketDDD.Server/PocketDDD.Server.DB/Migrations/2024_SeedData.sql +++ b/PocketDDD.Server/PocketDDD.Server.DB/Migrations/2024_SeedData.sql @@ -12,11 +12,14 @@ delete EventDetail GO -- Reset the identity columns -DBCC CHECKIDENT ('[EventDetail]', RESEED, 1); -- There is hardcoding to EventDetail ID 1 so we reset to 1 not 0 DBCC CHECKIDENT ('[Tracks]', RESEED, 0); DBCC CHECKIDENT ('[TimeSlots]', RESEED, 0); DBCC CHECKIDENT ('[Sessions]', RESEED, 0); +-- There is hardcoding to EventDetail ID 1 so we reset to 1 not 0 +DBCC CHECKIDENT ('[EventDetail]', RESEED, 1); -- Use if this is a brand new table that has never been used before +--DBCC CHECKIDENT ('[EventDetail]', RESEED, 0); -- Use if this is an empty table that used to have rows + GO -- Add 2024 Sessionize ID