Collections
Overview
Section titled “Overview”Users save events to named collections (bookmarks). Each collection has a configurable visibility: PRIVATE (default) or PUBLIC. Public collections are accessible by other users via a direct link. Users can create multiple collections and add any event (including external events) to them.
Behaviors
Section titled “Behaviors”Collection CRUD
Section titled “Collection CRUD”- Create: Any authenticated user can create a collection with a name and optional visibility setting.
- Read: Owner always has access. Other users can access PUBLIC collections. Accessing a PRIVATE collection owned by someone else returns 404.
- Update: Owner can rename the collection or change its visibility.
- Delete: Owner can delete a collection. Deleting a collection removes all its CollectionItems.
Adding / Removing Events
Section titled “Adding / Removing Events”- Users add events to their own collections. Adding an event that is already in the collection returns 409 Conflict.
- Users remove events from their own collections.
- Adding an event to a collection creates an Interaction with action
SAVE.
Listing
Section titled “Listing”GET /collectionsreturns the authenticated user’s collections.GET /collections/:idreturns a single collection with its items (events).GET /collections/:id/itemsreturns the events in a collection, paginated.
Scenarios
Section titled “Scenarios”S-COL-1: Create a collection
Section titled “S-COL-1: Create a collection”GIVEN user A is authenticatedWHEN user A sends POST /collections with { name: "Music Events" }THEN a Collection is created with visibility PRIVATE, userId = user AS-COL-2: Create a public collection
Section titled “S-COL-2: Create a public collection”GIVEN user A is authenticatedWHEN user A sends POST /collections with { name: "Must See", visibility: "PUBLIC" }THEN a Collection is created with visibility PUBLICS-COL-3: Add event to collection
Section titled “S-COL-3: Add event to collection”GIVEN user A owns collection CAND event E existsWHEN user A sends POST /collections/C/items with { eventId: E }THEN a CollectionItem is created linking collection C to event EAND an Interaction with action SAVE is created for user A on event ES-COL-4: Cannot add duplicate event
Section titled “S-COL-4: Cannot add duplicate event”GIVEN collection C already contains event EWHEN user A sends POST /collections/C/items with { eventId: E }THEN the API responds with 409 ConflictS-COL-5: Remove event from collection
Section titled “S-COL-5: Remove event from collection”GIVEN collection C contains event EWHEN user A sends DELETE /collections/C/items/ETHEN the CollectionItem is removedAND event E is not deleted from the systemS-COL-6: List own collections
Section titled “S-COL-6: List own collections”GIVEN user A has 3 collectionsWHEN user A sends GET /collectionsTHEN the response contains user A's 3 collections ordered by updatedAt descendingS-COL-7: View public collection as another user
Section titled “S-COL-7: View public collection as another user”GIVEN user A has collection C with visibility PUBLICWHEN user B sends GET /collections/CTHEN the response contains collection C and its itemsS-COL-8: Cannot view private collection of another user
Section titled “S-COL-8: Cannot view private collection of another user”GIVEN user A has collection C with visibility PRIVATEWHEN user B sends GET /collections/CTHEN the API responds with 404 Not FoundS-COL-9: Change collection visibility
Section titled “S-COL-9: Change collection visibility”GIVEN user A has collection C with visibility PRIVATEWHEN user A sends PATCH /collections/C with { visibility: "PUBLIC" }THEN collection C's visibility is PUBLICS-COL-10: Delete collection
Section titled “S-COL-10: Delete collection”GIVEN user A has collection C with 5 itemsWHEN user A sends DELETE /collections/CTHEN collection C is deletedAND all 5 CollectionItems are deletedAND the referenced events are not affected