Skip to content

Halas/CTC-50: restrict check in to event timing - #43

Open
halasgraden wants to merge 2 commits into
mainfrom
halas/CTC-50
Open

halasgraden wants to merge 2 commits into
mainfrom
halas/CTC-50

Conversation

@halasgraden

Copy link
Copy Markdown
Contributor
  • 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

@halasgraden
halasgraden requested review from a team as code owners November 19, 2026 01:56
@linear-code

linear-code Bot commented Nov 19, 2026

Copy link
Copy Markdown

CTC-50

@github-actions

Copy link
Copy Markdown

Preview deployment

Open preview ↗

Last deployed 2026-11-19T01:57:31Z

Commit Workflow
dcd4e13 Run #70 · attempt 1

Fallback preview

Comment thread README.md
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." }`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread tests/data.test.ts
checkIn: CheckIn;
};

now.mockReturnValue(Date.parse("2026-10-26T00:59:59.999Z"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread tests/data.test.ts
});
it.each([
["before the event", "2026-10-25T23:59:59.999Z"],
["at the event end", "2026-10-26T01:00:00.000Z"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The timing rule looks correct and stays simple. I left a few non-blocking suggestions to strengthen the tests. Approved

This branch was successfully deployed

1 active deployment
pr-43 — dcd4e139 Deployed Nov 19, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants