Add event visibility fields and validation (backend)#45
Conversation
|
similar to Emily's PR, this PR adds a change to the Event struct which will break existing logic i think (ex. create event doesnt' expect this field) i could be completely wrong but could you double check to confirm this? if it does break stuff then maybe we should make a preliminary PR before this PR that adds the new field to the Event struct (ensuring that anything that uses the Event struct properly uses the new field). and then we can merge this PR after |
There was a problem hiding this comment.
this lgtm, is there anything that this is blocked by? if not then feel free to merge + make the corresponding frontend changes in Clark (after rebasing ofc)
Khoa's PR adds the edit event page, once this is merged you'll have to edit the page to allow editing visibility as well
dcee0a9 to
b21ac20
Compare
b21ac20 to
db48cbb
Compare
|
I was able to verify the visibility validation logic on the backend with the following observations:
However, I was not able to fully test the PATCH/update flows end to end due to a separate issue I encountered in
Because of this, I couldn’t reliably test updating visibility (e.g., switching between public/private or validating This issue appears to be independent of the visibility validation changes in this PR and likely needs to be addressed separately (e.g., ensuring |
This PR adds backend support for event visibility as part of #36.
Changes
Event:visibility(public|private)minimum_visible_role(member|officer|admin, for private events)status(draft|published|closed) separate from visibilitydraft,public) on event creationstatus,visibility, andminimum_visible_roleminimum_visible_rolepublicclearsminimum_visible_roleDesign Decisions
status(draft/published) fromvisibility(public/private) to support overlapping states such asdraft + privateminimum_visible_roleinstead of hardcoding role logic to keep the backend flexible and aligned with Clark rolesdraft+publicfor a safer creation flowVerification
Tested locally end-to-end after applying the empty
_idfix (#53):{"id":"69ddf2365aeab4a1f0851d93","name":"Visibility Test Event","date":"2026-04-20","time":"18:00","location":"Student Union","description":"Testing defaults","admins":["user123"],"registration_form":[],"max_attendees":50,"created_at":"","status":"draft","visibility":"public"}{"error":"minimum_visible_role is required when visibility is private"}{"message":"event updated successfully"}{"id":"69ddf2365aeab4a1f0851d93","name":"Visibility Test Event","date":"2026-04-20","time":"18:00","location":"Student Union","description":"Testing defaults","admins":["user123"],"registration_form":[],"max_attendees":50,"created_at":"","status":"draft","visibility":"private","minimum_visible_role":"member"}{"message":"event updated successfully"}{"id":"69ddf2365aeab4a1f0851d93","name":"Visibility Test Event","date":"2026-04-20","time":"18:00","location":"Student Union","description":"Testing defaults","admins":["user123"],"registration_form":[],"max_attendees":50,"created_at":"","status":"draft","visibility":"public"}Notes