From 6ae2f6db17a4ca201438a83c22f4c46e3c359e05 Mon Sep 17 00:00:00 2001 From: rui hildt Date: Tue, 5 May 2020 11:57:09 +0200 Subject: [PATCH] Add foreign key constraints to Participants --- api-documentation.md | 69 +++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/api-documentation.md b/api-documentation.md index 1f95d98..87c5d2a 100644 --- a/api-documentation.md +++ b/api-documentation.md @@ -368,7 +368,7 @@ A json object for the specified meeting with an array of `possible_date`. ] ``` -#### Get a list of complete availibility for a meeting +#### Get a list of all availibility for a meeting **`GET /api/meetings/:id/availibility`** @@ -422,19 +422,19 @@ A json object for the specified meeting with `meeting_id` and an array of `avail ### **Participants** | `participant` -| field | data type | metadata | -| :------------ | :-------- | :------------------------------ | -| account_id | varchar | required, composite primary key | -| meeting_id | varchar | required, composite primary key | -| earliest_time | datetime | | -| latest_time | datetime | | -| quorum | boolean | `0` (no) or `1` (yes) | -| mandatory | boolean | `0` (no) or `1` (yes) | -| host | boolean | `0` (no) or `1` (yes) | -| answered | boolean | `0` (no) or `1` (yes) | -| timezone | varchar | required | -| created_at | datetime | generated by database | -| updated_at | datetime | generated by database | +| field | data type | metadata | +| :------------ | :-------- | :------------------------------------------- | +| account_id | varchar | required, foreign key, composite primary key | +| meeting_id | varchar | required, foreign key, composite primary key | +| earliest_time | datetime | | +| latest_time | datetime | | +| quorum | boolean | `0` (no) or `1` (yes) | +| mandatory | boolean | `0` (no) or `1` (yes) | +| host | boolean | `0` (no) or `1` (yes) | +| answered | boolean | `0` (no) or `1` (yes) | +| timezone | varchar | required | +| created_at | datetime | generated by database | +| updated_at | datetime | generated by database | #### Invite a participant @@ -616,8 +616,6 @@ A json object for the deleted possible date with `id`, `meeting_id` and `possibl | created_at | datetime | generated by database | | updated_at | datetime | generated by database | -GET / DELETE / UPDATE - #### Add an availibility for a possible date **`POST /api/availibility`** @@ -649,29 +647,28 @@ A json object with the availibility to add with **`participant_id`**, **`possibl ##### Response `201` -A json object with the availibility to add with **`participant_id`**, **`possible_date_id`** and an array of intervals with **`id`**, **`preference`**, **`start_time`**, **`end_time`** and **`timezone`**. +A json object with the availibility added with **`id`**, **`participant_id`**, **`possible_date_id`** and an array of intervals with **`id`**, **`preference`**, **`start_time`**, **`end_time`** and **`timezone`**. ``` { - "data": { - "participant_id": 5, - "possible_date_id": 21, - "intervals": [{ - "id": 45, - "preference": 0, - "start_time": "2021-06-25 09:00:00", - "end_time": "2021-06-25 20:00:00", - "timezone": "Europe/Brussels" - }, - { - "id": 46, - "preference": 1, - "start_time": "2021-06-25 09:00:00", - "end_time": "2021-06-25 20:00:00", - "timezone": "Europe/Brussels" - } - ] - } + "id": 1 + "participant_id": 5, + "possible_date_id": 21, + "intervals": [{ + "id": 45, + "preference": 0, + "start_time": "2021-06-25 09:00:00", + "end_time": "2021-06-25 20:00:00", + "timezone": "Europe/Brussels" + }, + { + "id": 46, + "preference": 1, + "start_time": "2021-06-25 09:00:00", + "end_time": "2021-06-25 20:00:00", + "timezone": "Europe/Brussels" + } + ] } ```