Add foreign key constraints to Participants

This commit is contained in:
rui hildt 2020-05-05 11:57:09 +02:00
parent 0c29a59fe3
commit 6ae2f6db17

View File

@ -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`** **`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` ### **Participants** | `participant`
| field | data type | metadata | | field | data type | metadata |
| :------------ | :-------- | :------------------------------ | | :------------ | :-------- | :------------------------------------------- |
| account_id | varchar | required, composite primary key | | account_id | varchar | required, foreign key, composite primary key |
| meeting_id | varchar | required, composite primary key | | meeting_id | varchar | required, foreign key, composite primary key |
| earliest_time | datetime | | | earliest_time | datetime | |
| latest_time | datetime | | | latest_time | datetime | |
| quorum | boolean | `0` (no) or `1` (yes) | | quorum | boolean | `0` (no) or `1` (yes) |
| mandatory | boolean | `0` (no) or `1` (yes) | | mandatory | boolean | `0` (no) or `1` (yes) |
| host | boolean | `0` (no) or `1` (yes) | | host | boolean | `0` (no) or `1` (yes) |
| answered | boolean | `0` (no) or `1` (yes) | | answered | boolean | `0` (no) or `1` (yes) |
| timezone | varchar | required | | timezone | varchar | required |
| created_at | datetime | generated by database | | created_at | datetime | generated by database |
| updated_at | datetime | generated by database | | updated_at | datetime | generated by database |
#### Invite a participant #### 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 | | created_at | datetime | generated by database |
| updated_at | datetime | generated by database | | updated_at | datetime | generated by database |
GET / DELETE / UPDATE
#### Add an availibility for a possible date #### Add an availibility for a possible date
**`POST /api/availibility`** **`POST /api/availibility`**
@ -649,29 +647,28 @@ A json object with the availibility to add with **`participant_id`**, **`possibl
##### Response `201` ##### 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": { "id": 1
"participant_id": 5, "participant_id": 5,
"possible_date_id": 21, "possible_date_id": 21,
"intervals": [{ "intervals": [{
"id": 45, "id": 45,
"preference": 0, "preference": 0,
"start_time": "2021-06-25 09:00:00", "start_time": "2021-06-25 09:00:00",
"end_time": "2021-06-25 20:00:00", "end_time": "2021-06-25 20:00:00",
"timezone": "Europe/Brussels" "timezone": "Europe/Brussels"
}, },
{ {
"id": 46, "id": 46,
"preference": 1, "preference": 1,
"start_time": "2021-06-25 09:00:00", "start_time": "2021-06-25 09:00:00",
"end_time": "2021-06-25 20:00:00", "end_time": "2021-06-25 20:00:00",
"timezone": "Europe/Brussels" "timezone": "Europe/Brussels"
} }
] ]
}
} }
``` ```