Skip to content

Event info table update - #178

Merged
jbriones1 merged 17 commits into
mainfrom
event_info_table_update
Aug 29, 2026
Merged

Event info table update#178
jbriones1 merged 17 commits into
mainfrom
event_info_table_update

Conversation

@arunPdl02

@arunPdl02 arunPdl02 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor
Fixes #156

Summary

Adds three new endpoints for managing grouped events, along with a schema migration to event_info that replaces recurrence-based fields (frequency, repeat_start_date, repeat_end_date, start_time, end_time) with a group-based model (group_id) plus new metadata fields (location, organizer, status, url, image_id). Also refactors crud.py for readability.


New Endpoints

POST /event/group

Creates one or more events under the same group key.

Request body: EventCreate[]

Response:

{
  "group_id": "string",
  "events": [ /* Event[] */ ]
}

PATCH /event/group/{group_id}

Updates one or more events belonging to the given group.

Response:

{
  "group_id": "string",
  "events": [ /* Event[] */ ]
}

DELETE /event/group/{group_id}

Deletes one or more events belonging to the given group. Response follows the same shape as the endpoints above.

Response:

{
  "group_id": "string",
  "events": [ /* Event[] */ ]
}

Database Changes

event_info schema

Column Type Nullable Notes
eid int No Autoincrement, PK
description text No  
name text No Event title (widened from varchar(64) → text)
start_datetime timestamptz No Replaces start_time/repeat_start_date
end_datetime timestamptz No Replaces end_time/repeat_end_date
group_id uuid Yes Links events that should update/delete together
location text Yes Room number or full address
organizer text Yes e.g. CSSS, SFU, Faculty of Applied Sciences, a club
status enum (scheduled, cancelled) No  
url text Yes Link to event resource (site, signup form, etc.)
image_id int (FK → image_asset.image_id) Yes Event poster

Migration (41152814ded4)

Added:

  • start_datetime (timestamptz, not null)
  • end_datetime (timestamptz, not null)
  • group_id (uuid, nullable)
  • location (text, nullable)
  • organizer (text, nullable)
  • status (enum: scheduled / cancelled, not null)
  • url (text, nullable)
  • image_id (int, nullable) + FK constraint to image_asset.image_id

Altered:

  • description: now NOT NULL
  • name: varchar(64)text

Removed:

  • repeat_end_date
  • start_time
  • end_time
  • frequency
  • repeat_start_date

Refactor

Broke down crud.py functions that previously did query + result handling + event formatting in a single line into separate, named steps (query → result → event format) for readability.

@arunPdl02
arunPdl02 requested a review from jbriones1 August 27, 2026 20:18
@arunPdl02 arunPdl02 linked an issue Aug 27, 2026 that may be closed by this pull request

@jbriones1 jbriones1 left a comment

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.

Thanks for the PR!

I think we'll need to a bit more work on the table to make it more ergonomic, but it's a good first pass. I'll make another issue with more endpoints we could use, but don't worry about it for now.

Comment thread src/event/constants.py Outdated
Comment thread src/event/crud.py Outdated
Comment thread src/event/crud.py Outdated
Comment thread src/event/crud.py Outdated
Comment thread src/event/crud.py Outdated
Comment thread src/event/tables.py Outdated
Comment thread src/event/urls.py Outdated
Comment thread src/event/urls.py Outdated
Comment thread src/event/urls.py Outdated
Comment thread src/event/urls.py Outdated
@jbriones1
jbriones1 self-requested a review August 29, 2026 08:47
@jbriones1
jbriones1 merged commit fd2279c into main Aug 29, 2026
5 checks passed
@jbriones1
jbriones1 deleted the event_info_table_update branch August 29, 2026 08:51
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.

Event database table update

2 participants