Occasions
Users can associate one or more occasions, (also known as events) that the item is appropriate or well-suited for. Each occasion is internally associated with times of day such as ‘evening’ or ‘morning’ that can help when searching or filtering.
Occasions Model
Section titled “Occasions Model”type Occasion = {id: string;name: string;displayName: string;times: Array<string>;userSubmitted: boolean;enabled: boolean;createdAt: string;updatedAt: string;}Intrinsic values:
- id : a unique id in CUID format (generated by paralleldrive)
- name : unique internal name, lower-case-hyphenated, no whitespace i.e. ‘black-tie’
- displayName : Title-cased name for UI / Display, i.e. ‘Black Tie’
- times : An array of time-of-day labels i.e. [‘night’, evening’]
- userSubmitted
: was the value submitted by a user? defaults to
false - enabled
: only items with
enabled: trueare included in API responses - createdAt : item creation timestamp, ISO-8601 string format
- updatedAt : item updated timestamp, ISO-8601 string format
Endpoints
Section titled “Endpoints”$ curl /resources/occasions | jq .[ { "id": "re9oy6naj6o0c1kxo6yn6ps6", "name": "beachwear", "displayName": "Beachwear", "times": [ "day" ], "enabled": true, "userSubmitted": false, "createdAt": "2024-06-18 23:00:34.048804+00", "updatedAt": "2024-06-18 23:00:34.048804+00" }, { "id": "b5eeuejgh5wbe1atiiavbce8", "name": "black-tie", "displayName": "Black Tie", "times": [ "night", "evening" ], "enabled": true, "userSubmitted": false, "createdAt": "2024-06-18 23:00:34.049637+00", "updatedAt": "2024-06-18 23:00:34.049637+00" }, ...]