Replace participant serial pk with composite

This commit is contained in:
rui hildt 2020-05-04 19:14:14 +02:00
parent 0202b3af88
commit f6921c0e75

View File

@ -32,8 +32,8 @@ A json object for the account to register with **`username`**, **`email`**, **`p
"email": "jean@example.com", "email": "jean@example.com",
"password": "really-strong-password", "password": "really-strong-password",
"timezone": "Europe/Brussels", "timezone": "Europe/Brussels",
"earliest_time":"09:30 AM", "earliest_time":"09:30",
"latest_time":"10:00 PM" "latest_time":"22:00"
} }
``` ```
@ -47,8 +47,8 @@ A json object for the registered account with `id`, `username`, `email`, `timezo
"username": "jean", "username": "jean",
"email": "jean@example.com", "email": "jean@example.com",
"timezone": "Europe/Brussels", "timezone": "Europe/Brussels",
"earliest_time":"09:30 AM", "earliest_time":"09:30",
"latest_time":"10:00 PM" "latest_time":"22:00"
} }
``` ```
@ -77,8 +77,8 @@ A json object for the registered account with `id`, `username`, `email`, `timezo
"username": "jean", "username": "jean",
"email": "jean@example.com", "email": "jean@example.com",
"timezone": "Europe/Brussels", "timezone": "Europe/Brussels",
"earliest_time":"09:30 AM", "earliest_time":"09:30",
"latest_time":"10:00 PM"l "latest_time":"22:00"l
} }
``` ```
@ -107,8 +107,8 @@ A json object for the registered account with `id`, `username`, `email`, `timezo
"username": "jean", "username": "jean",
"email": "jean@example.com", "email": "jean@example.com",
"timezone": "Europe/Brussels", "timezone": "Europe/Brussels",
"earliest_time": "09:30 AM", "earliest_time": "09:30",
"latest_time": "10:00 PM" "latest_time": "22:00"
} }
``` ```
@ -306,8 +306,8 @@ A json object for the specified meeting with an array of `participant`.
"id": 23, "id": 23,
"account_id": 5, "account_id": 5,
"meeting_id": "f86983db-955e-43b8-be3e-bc92bbeb9b43", "meeting_id": "f86983db-955e-43b8-be3e-bc92bbeb9b43",
"earliest_time": "09:30 AM", "earliest_time": "09:30",
"latest_time": "05:00 PM", "latest_time": "17:00",
"quorum": 1, "quorum": 1,
"mandatory": 1, "mandatory": 1,
"host": 1, "host": 1,
@ -318,8 +318,8 @@ A json object for the specified meeting with an array of `participant`.
"id": 28, "id": 28,
"account_id": 11, "account_id": 11,
"meeting_id": "f86983db-955e-43b8-be3e-bc92bbeb9b43", "meeting_id": "f86983db-955e-43b8-be3e-bc92bbeb9b43",
"earliest_time": "10:00 AM", "earliest_time": "10:00",
"latest_time": "09:00 PM", "latest_time": "21:00",
"quorum": 0, "quorum": 0,
"mandatory": 1, "mandatory": 1,
"host": 0, "host": 0,
@ -385,20 +385,19 @@ A json object for the specified meeting with an array of `participant`.
### **Participants** | `participant` ### **Participants** | `participant`
| field | data type | metadata | | field | data type | metadata |
| :------------ | :-------- | :-------------------------- | | :------------ | :-------- | :------------------------------ |
| id | int | primary key, auto-increment | | account_id | varchar | required, composite primary key |
| account_id | varchar | required | | meeting_id | varchar | required, composite primary key |
| meeting_id | varchar | required | | 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
@ -428,7 +427,6 @@ A json object for the participant with `id`, `account_id`, `meeting_id`, `earlie
``` ```
{ {
"id": 23,
"account_id": 5, "account_id": 5,
"meeting_id": "f86983db-955e-43b8-be3e-bc92bbeb9b43", "meeting_id": "f86983db-955e-43b8-be3e-bc92bbeb9b43",
"earliest_time": "08:30", "earliest_time": "08:30",
@ -443,17 +441,16 @@ A json object for the participant with `id`, `account_id`, `meeting_id`, `earlie
#### Update a participant #### Update a participant
**`PUT /api/participants/:id`** **`PUT /api/participants/:account_id-:meeting_id`**
##### Request ##### Request
A json object for the participant to invite with `id` and any of `id`, `earliest_time`, `latest_time`, `quorum`, `mandatory`, `host`, `answered` and `timezone`. A json object for the participant to invite with any of `earliest_time`, `latest_time`, `quorum`, `mandatory`, `host`, `answered` and `timezone`.
``` ```
{ {
"account_id": 5, "earliest_time": "09:30",
"earliest_time": "09:30 AM", "latest_time": "17:00",
"latest_time": "05:00 PM",
"quorum": 1, "quorum": 1,
"host": 1, "host": 1,
"answered": 1, "answered": 1,
@ -462,36 +459,34 @@ A json object for the participant to invite with `id` and any of `id`, `earliest
##### Response `200` ##### Response `200`
A json object for the participant with `id`, `account_id`, `meeting_id`, `earliest_time`, `latest_time`, `quorum`, `mandatory`, `host`, `answered` and `timezone`. A json object for the participant with `account_id`, `meeting_id`, `earliest_time`, `latest_time`, `quorum`, `mandatory`, `host`, `answered` and `timezone`.
``` ```
{ {
"data": { "id": 23,
"id": 23, "account_id": 5,
"account_id": 5, "meeting_id": "f86983db-955e-43b8-be3e-bc92bbeb9b43",
"meeting_id": "f86983db-955e-43b8-be3e-bc92bbeb9b43", "earliest_time": "09:30",
"earliest_time": "09:30 AM", "latest_time": "17:00",
"latest_time": "05:00 PM", "quorum": 1,
"quorum": 1, "mandatory": 1,
"mandatory": 1, "host": 1,
"host": 1, "answered": 1,
"answered": 1, "timezone": "Europe/Brussels"
"timezone": "Europe/Brussels"
}
} }
``` ```
#### Delete a participant #### Delete a participant
**`DELETE /api/participants/:id`** **`DELETE /api/participants/:account_id-:meeting_id`**
##### Request ##### Request
A json object for the participant to delete with `id`. A json object for the participant to delete with `token`.
``` ```
{ {
"id": 23 "token": "lknlkj-kjbkbj-kbjkbj-jkjh"
} }
``` ```
@ -501,11 +496,9 @@ A json object for the deleted participant with `participant_username`, `particip
``` ```
{ {
"data": { "participant_username": "Sylvia",
"participant_username": "Sylvia", "participant_email": "sylvia@email.com",
"participant_email": "sylvia@email.com", "meeting_title": "Worldwide strategy meeting for growth"
"meeting_title": "Worldwide strategy meeting for growth"
}
} }
``` ```