Repository navigation
Halas/CTC-50: restrict check in to event timing - #43
halasgraden wants to merge 2 commits into
Conversation
halasgraden
commented
Nov 19, 2026
- Add a check if attendance submission matches with event time, reject if not
- Build POST attendanceRequest to check if valid
- Added tests simulating edge cases and timing scenarios
Preview deploymentLast deployed
|
| include a timezone (`Z` or an offset such as `-08:00`) and are normalized to UTC. | ||
| The end time must be strictly after the start time; an equal or earlier end time | ||
| returns HTTP 400 with `{ error: "End time must be after start time." }`. | ||
|
|
There was a problem hiding this comment.
add a short README note explaining that check-in is allowed from the event’s start time up to, but excluding, its end time. Mention that requests outside this window return HTTP 409 and that events without an end time cannot accept check-ins.
| checkIn: CheckIn; | ||
| }; | ||
|
|
||
| now.mockReturnValue(Date.parse("2026-10-26T00:59:59.999Z")); |
There was a problem hiding this comment.
can you also test a new attendee checking in at this time? This request repeats an existing check-in, so it doesn’t directly verify that a new attendance record can be created just before closing
| }); | ||
| it.each([ | ||
| ["before the event", "2026-10-25T23:59:59.999Z"], | ||
| ["at the event end", "2026-10-26T01:00:00.000Z"], |
There was a problem hiding this comment.
can you add a case where someone checks in during the event, then retries exactly at the end? Assert that the retry returns 409 and their existing record stays unchanged.
There was a problem hiding this comment.
The timing rule looks correct and stays simple. I left a few non-blocking suggestions to strengthen the tests. Approved