Split documentation to its own repo
This commit is contained in:
parent
dccde7fdc2
commit
b6edfff2ba
28
README.md
28
README.md
@ -1,21 +1,11 @@
|
|||||||
# Meeting Planner
|
## Meeting Planner Backend
|
||||||
Find the best time to schedule a meeting across several timezones.
|
Meeting Planner helps you find the best time to schedule a meeting across several timezones.
|
||||||
Based on the availibity of all participants on specific days.
|
It's based on the availibity of all participants for specific days.
|
||||||
|
|
||||||
### How does it work?
|
- [Documentation](https://git.armada.digital/meeting-planner/documentation)
|
||||||
|
- Frontend (coming soon)
|
||||||
|
|
||||||
#### For the meeting manager
|
# Backend architecture
|
||||||
1. Choose a title and description
|
- [API endpoints](https://git.armada.digital/meeting-planner/documentation/src/branch/master/api-documentation.md)
|
||||||
2. Select the possible days on the calendar
|
- [Database design](https://dbdiagram.io/d/5e769ab14495b02c3b88936f)
|
||||||
3. Enter a deadline for responses
|
- [Flowchart](https://app.diagrams.net/#Uhttps://git.armada.digital/meeting-planner/documentation/raw/branch/master/meetingscheduler.drawio)
|
||||||
4. Send invitations to potential participants
|
|
||||||
5. Wait either for all participants to respond or for the deadline (whichever happens first)
|
|
||||||
6. Set the meeting from the best meeting dates
|
|
||||||
|
|
||||||
Optional:
|
|
||||||
- Choose the minimum of people for the meeting to take place (quorum)
|
|
||||||
- Choose who needs to be there for the meeting to happen
|
|
||||||
|
|
||||||
#### For the participants
|
|
||||||
1. Enter your availibility on the calendar: you can choose between (Yes / No / Ideal)
|
|
||||||
2. Wait for the meeting manager to confirm the meeting date
|
|
||||||
|
@ -1,637 +0,0 @@
|
|||||||
## API Documentation
|
|
||||||
___
|
|
||||||
> Values required in **`bold`**.
|
|
||||||
|
|
||||||
### **Accounts** | `account`
|
|
||||||
| field | data type | metadata |
|
|
||||||
| :-------------| :---------------- | :-------------------------- |
|
|
||||||
| id | unsigned integer | primary key, auto-increment |
|
|
||||||
| username | varchar | required |
|
|
||||||
| email | varchar | required |
|
|
||||||
| password | varchar | required |
|
|
||||||
| timezone | varchar | |
|
|
||||||
| earliest_time | varchar | |
|
|
||||||
| latest_time | varchar | |
|
|
||||||
| created_at | datetime | generated by database |
|
|
||||||
|
|
||||||
#### Add an account
|
|
||||||
**`POST /api/accounts`**
|
|
||||||
|
|
||||||
##### Request
|
|
||||||
A json object for the account to register with **`username`**, **`email`**, **`password`**, `timezone`, `earliest_time` and `latest_time`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"username": "jean",
|
|
||||||
"email": "jean@example.com",
|
|
||||||
"password": "really-strong-password",
|
|
||||||
"timezone": "Europe/Brussels",
|
|
||||||
"earliest_time":"09:30 AM",
|
|
||||||
"latest_time":"10:00 PM"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Response
|
|
||||||
A json object for the registered account with `id`, `username`, `email`, `timezone`, `earliest_time` and `latest_time`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"status": 201,
|
|
||||||
"data": {
|
|
||||||
"id": 1,
|
|
||||||
"username": "jean",
|
|
||||||
"email": "jean@example.com",
|
|
||||||
"timezone": "Europe/Brussels",
|
|
||||||
"earliest_time":"09:30 AM",
|
|
||||||
"latest_time":"10:00 PM"l
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Log in an account
|
|
||||||
**`POST /api/accounts/login`**
|
|
||||||
|
|
||||||
##### Request
|
|
||||||
A json object for the account to login with either **`email`** or **`username`**, and **`password`** .
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"username": "jean",
|
|
||||||
"password": "super-strong-password"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Response
|
|
||||||
A json object for the registered account with `id`, `username`, `email`, `timezone`, `earliest_time` and `latest_time`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"status": 201,
|
|
||||||
"data": {
|
|
||||||
"id": 1,
|
|
||||||
"username": "jean",
|
|
||||||
"email": "jean@example.com",
|
|
||||||
"timezone": "Europe/Brussels",
|
|
||||||
"earliest_time":"09:30 AM",
|
|
||||||
"latest_time":"10:00 PM"l
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Update an account
|
|
||||||
**`PUT /api/accounts/:id`**
|
|
||||||
|
|
||||||
##### Request
|
|
||||||
A json object for the account to register with `id` and any of `username`, `email`, `password`, `timezone`, `earliest_time`, `latest_time`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"id": 15,
|
|
||||||
"earliest_time": "08:30 AM",
|
|
||||||
"latest_time": "08:00 PM"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Response
|
|
||||||
A json object for the registered account with `id`, `username`, `email`, `timezone`, `earliest_time` and `latest_time`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"status": 200,
|
|
||||||
"data": {
|
|
||||||
"id": 1,
|
|
||||||
"username": "jean",
|
|
||||||
"email": "jean@example.com",
|
|
||||||
"timezone": "Europe/Brussels",
|
|
||||||
"earliest_time": "09:30 AM",
|
|
||||||
"latest_time": "10:00 PM"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Delete an account
|
|
||||||
**`DELETE /api/accounts/:id`**
|
|
||||||
|
|
||||||
##### Request
|
|
||||||
A json object for the account to delete with `id`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"id": 15
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Response
|
|
||||||
A json object for the deleted account with status code, message, `id`, `username` and `email`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"status": 200,
|
|
||||||
"message": " '`username`' account with email '`email`' has been successfully deleted."
|
|
||||||
"data": {
|
|
||||||
"id": 15,
|
|
||||||
"username": "jean",
|
|
||||||
"email": "jean@example.com"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Get a list of meetings for an account
|
|
||||||
**`GET /api/accounts/:account_id/meetings`**
|
|
||||||
|
|
||||||
##### Request
|
|
||||||
A json object with an `account_id`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"id": 5
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Response
|
|
||||||
A json object for the specified account with an array of `meeting`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"status": 200,
|
|
||||||
"data": [{
|
|
||||||
"id": "worldwide-strategy-meeting-for-11059",
|
|
||||||
"title": "Worldwide strategy meeting for growth",
|
|
||||||
"description": "Let's find the best ethical growth hacking technics together. Yeah, fun.",
|
|
||||||
"start_time": "2022-02-16 20:00:00",
|
|
||||||
"timezone": "Europe/Brussels",
|
|
||||||
"duration": 60,
|
|
||||||
"status": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "follow-up-with-tech-team-21850",
|
|
||||||
"title": "Follow up with tech team",
|
|
||||||
"duration": 120,
|
|
||||||
"status": 0
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### **Meetings** | `meeting`
|
|
||||||
| field | data type | metadata |
|
|
||||||
| :---------- | :-------- | :-------------------------------------------------------------------------------- |
|
|
||||||
| id | varchar | primary key, first 30 chars of `title` with words separated by `-` + 5 random int |
|
|
||||||
| title | varchar | required |
|
|
||||||
| description | varchar | |
|
|
||||||
| start_time | datetime | |
|
|
||||||
| timezone | varchar | |
|
|
||||||
| duration | int | required |
|
|
||||||
| status | boolean | required: `0` (proposed) or `1` (confirmed) |
|
|
||||||
| password | varchar | |
|
|
||||||
| created_at | datetime | generated by database |
|
|
||||||
|
|
||||||
#### Add a meeting
|
|
||||||
**`POST /api/meetings`**
|
|
||||||
|
|
||||||
##### Request
|
|
||||||
A json object for the meeting to add with **`id`**, **`title`**, `description`, `start_time`, **`duration`** and `password`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"id": "worldwide-strategy-meeting-for-11059",
|
|
||||||
"title": "Worldwide strategy meeting for growth",
|
|
||||||
"description": "Let's find the best ethical growth hacking technics together. Yeah, fun.",
|
|
||||||
"duration": 90,
|
|
||||||
"password": "generic-password"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Response
|
|
||||||
A json object for the added meeting with `id`, `title`, `description`, `start_time`, `duration`, `status` and `password`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"status": 201,
|
|
||||||
"data": {
|
|
||||||
"id": "worldwide-strategy-meeting-for-11059",
|
|
||||||
"title": "Worldwide strategy meeting for growth",
|
|
||||||
"description": "Let's find the best ethical growth hacking technics together. Yeah, fun.",
|
|
||||||
"duration": 90,
|
|
||||||
"status": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Update a meeting
|
|
||||||
**`PUT /api/meetings/:id`**
|
|
||||||
|
|
||||||
##### Request
|
|
||||||
A json object for the meeting to update with `id`, `acount_id` and any of `title`, `description`, `start_time`, `timezone`, `duration`, `status` and `password`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"id": "worldwide-strategy-meeting-for-11059",
|
|
||||||
"account_id": 5,
|
|
||||||
"start_time": "2022-02-16 20:00:00",
|
|
||||||
"timezone": "Europe/Brussels",
|
|
||||||
"status": 1
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Response
|
|
||||||
A json object for the updated meeting with `id`, `title`, `description`, `start_time`, `timezone`, `duration` and `status`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"status": 200,
|
|
||||||
"data": {
|
|
||||||
"id": "worldwide-strategy-meeting-for-11059",
|
|
||||||
"title": "Worldwide strategy meeting for growth",
|
|
||||||
"description": "Let's find the best ethical growth hacking technics together. Yeah, fun.",
|
|
||||||
"start_time": "2022-02-16 20:00:00",
|
|
||||||
"timezone": "Europe/Brussels",
|
|
||||||
"duration: 90,
|
|
||||||
"status": 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Delete a meeting
|
|
||||||
**`DELETE /api/meetings/:id`**
|
|
||||||
|
|
||||||
##### Request
|
|
||||||
A json object for the meeting to delete with `id` and `account_id`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"id": "worldwide-strategy-meeting-for-11059",
|
|
||||||
"account_id": 5
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Response
|
|
||||||
A json object for the deleted meeting with status code and message.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"status": 200,
|
|
||||||
"message": "Meeting '`meeting_title`' has been successfully deleted."
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Get a list of all participants for a meeting
|
|
||||||
**`GET /api/meetings/:id/participants`**
|
|
||||||
|
|
||||||
##### Request
|
|
||||||
A json object with an `account_id`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"id": "worldwide-strategy-meeting-for-11059",
|
|
||||||
"account_id": 5
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Response
|
|
||||||
A json object for the specified meeting with an array of `participant`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"status": 200,
|
|
||||||
"data": [{
|
|
||||||
"id": 23,
|
|
||||||
"account_id": 5,
|
|
||||||
"meeting_id": "worldwide-strategy-meeting-for-11059",
|
|
||||||
"earliest_time": "09:30 AM",
|
|
||||||
"latest_time": "05:00 PM",
|
|
||||||
"quorum": 1,
|
|
||||||
"mandatory": 1,
|
|
||||||
"host": 1,
|
|
||||||
"answered": 1,
|
|
||||||
"timezone": "Europe/Brussels"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 28,
|
|
||||||
"account_id": 11,
|
|
||||||
"meeting_id": "worldwide-strategy-meeting-for-11059",
|
|
||||||
"earliest_time": "10:00 AM",
|
|
||||||
"latest_time": "09:00 PM",
|
|
||||||
"quorum": 0,
|
|
||||||
"mandatory": 1,
|
|
||||||
"host": 0,
|
|
||||||
"answered": 1,
|
|
||||||
"timezone": "Europe/Brussels"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Get a list of complete availibility for a meeting
|
|
||||||
**`GET /api/meetings/:id/availibility`**
|
|
||||||
|
|
||||||
##### Request
|
|
||||||
A json object with a `meeting_id`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"id": "worldwide-strategy-meeting-for-11059"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Response
|
|
||||||
A json object for the specified meeting with an array of `participant`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"status": 200,
|
|
||||||
"data": {
|
|
||||||
"meeting_id": "worldwide-strategy-meeting-for-11059",
|
|
||||||
"availibility": [{
|
|
||||||
"participant_id": 5,
|
|
||||||
"possible_date_id": 21,
|
|
||||||
"intervals": [{
|
|
||||||
"preference": 0,
|
|
||||||
"start_time": "2021-06-25 09:00:00",
|
|
||||||
"end_time": "2021-06-25 13:00:00",
|
|
||||||
"timezone": "Europe/Brussels"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"preference": 1,
|
|
||||||
"start_time": "2021-06-25 15:00:00",
|
|
||||||
"end_time": "2021-06-25 20:00:00",
|
|
||||||
"timezone": "Europe/Brussels"
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"participant_id": 56,
|
|
||||||
"possible_date_id": 21,
|
|
||||||
"intervals": [{
|
|
||||||
"preference": 0,
|
|
||||||
"start_time": "2021-06-25 08:00:00",
|
|
||||||
"end_time": "2021-06-25 10:30:00",
|
|
||||||
"timezone": "Europe/Brussels"
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### **Possible Dates** | `possible_date`
|
|
||||||
| field | data type | metadata |
|
|
||||||
| :------------ | :-------- | :-------------------------- |
|
|
||||||
| id | int | primary key, auto-increment |
|
|
||||||
| meeting_id | varchar | foreign key, required |
|
|
||||||
| possible_date | date | foreign key, required |
|
|
||||||
|
|
||||||
#### Add a possible date
|
|
||||||
**`POST /api/possible-dates`**
|
|
||||||
|
|
||||||
##### Request
|
|
||||||
A json object for the meeting to add with **`meeting_id`** and **`possible_date`**.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"meeting_id": "worldwide-strategy-meeting-for-11059",
|
|
||||||
"possible_date": "2020-02-18"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Response
|
|
||||||
A json object for the added meeting with `id`, `meeting_id` and `possible_date`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"status": 201,
|
|
||||||
"data": {
|
|
||||||
"id": 5,
|
|
||||||
"meeting_id": "worldwide-strategy-meeting-for-11059",
|
|
||||||
"possible_date": "2020-02-18"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
#### Delete a possible date
|
|
||||||
**`DELETE /api/possible-dates/:id`**
|
|
||||||
|
|
||||||
##### Request
|
|
||||||
A json object for the possible date to delete with `id` and `account_id`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"id": 12,
|
|
||||||
"account_id": 5
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Response
|
|
||||||
A json object for the deleted possible date with status code and message.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"status": 200,
|
|
||||||
"message": "Date '`possible_date`' has been successfully removed for the '`meeting_title`'."
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### **Participants** | `participant`
|
|
||||||
| field | data type | metadata |
|
|
||||||
| :------------ | :-------- | :-------------------------- |
|
|
||||||
| account_id | int | primary key, auto-increment |
|
|
||||||
| meeting_id | varchar | required |
|
|
||||||
| 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 |
|
|
||||||
|
|
||||||
#### Invite a participant
|
|
||||||
**`POST /api/participants`**
|
|
||||||
|
|
||||||
##### Request
|
|
||||||
A json object for the participant to add with **`account_id`**, **`meeting_id`**, **`earliest_time`**, **`latest_time`**, **`quorum`**, **`mandatory`**, **`host`**, **`answered`** and **`timezone`**.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"account_id": 5,
|
|
||||||
"meeting_id": "worldwide-strategy-meeting-for-11059",
|
|
||||||
"earliest_time": "08:30 AM",
|
|
||||||
"latest_time": "08:00 PM",
|
|
||||||
"quorum": 0,
|
|
||||||
"mandatory": 1,
|
|
||||||
"host": 0,
|
|
||||||
"answered": 0,
|
|
||||||
"timezone": "Europe/Brussels"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Response
|
|
||||||
A json object for the participant with `id`, `account_id`, `meeting_id`, `earliest_time`, `latest_time`, `quorum`, `mandatory`, `host`, `answered` and `timezone`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"status": 201,
|
|
||||||
"data": {
|
|
||||||
"id": 23,
|
|
||||||
"account_id": 5,
|
|
||||||
"meeting_id": "worldwide-strategy-meeting-for-11059",
|
|
||||||
"earliest_time": "08:30 AM",
|
|
||||||
"latest_time": "08:00 PM",
|
|
||||||
"quorum": 0,
|
|
||||||
"mandatory": 1,
|
|
||||||
"host": 0,
|
|
||||||
"answered": 0,
|
|
||||||
"timezone": "Europe/Brussels"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Update a participant
|
|
||||||
**`PUT /api/participants/:id`**
|
|
||||||
|
|
||||||
##### 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`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"account_id": 5,
|
|
||||||
"earliest_time": "09:30 AM",
|
|
||||||
"latest_time": "05:00 PM",
|
|
||||||
"quorum": 1,
|
|
||||||
"host": 1,
|
|
||||||
"answered": 1,
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Response
|
|
||||||
A json object for the participant with `id`, `account_id`, `meeting_id`, `earliest_time`, `latest_time`, `quorum`, `mandatory`, `host`, `answered` and `timezone`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"status": 200,
|
|
||||||
"data": {
|
|
||||||
"id": 23,
|
|
||||||
"account_id": 5,
|
|
||||||
"meeting_id": "worldwide-strategy-meeting-for-11059",
|
|
||||||
"earliest_time": "09:30 AM",
|
|
||||||
"latest_time": "05:00 PM",
|
|
||||||
"quorum": 1,
|
|
||||||
"mandatory": 1,
|
|
||||||
"host": 1,
|
|
||||||
"answered": 1,
|
|
||||||
"timezone": "Europe/Brussels"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Delete a participant
|
|
||||||
**`DELETE /api/participants/:id`**
|
|
||||||
|
|
||||||
##### Request
|
|
||||||
A json object for the participant to delete with `id`.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"id": 23
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Response
|
|
||||||
A json object for the deleted participant with status code and message.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"status": 200,
|
|
||||||
"message": "The '`participant_username`' has been successfully removed from the meeting '`meeting_title`'."
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### **Availibility** | `availibility`
|
|
||||||
| field | data type | metadata |
|
|
||||||
| :--------------- | :-------- | :--------------------------------- |
|
|
||||||
| id | int | primary key, auto-increment |
|
|
||||||
| participant_id | int | foreign key, required |
|
|
||||||
| possible_date_id | int | foreign key, required |
|
|
||||||
| preference | boolean | `0` (ideal) or `1` (yes), required |
|
|
||||||
| start_time | timestamp | required |
|
|
||||||
| end_time | timestamp | required |
|
|
||||||
| timezone | varchar | required |
|
|
||||||
| created_at | datetime | generated by database |
|
|
||||||
|
|
||||||
GET / DELETE / UPDATE
|
|
||||||
|
|
||||||
#### Add an availibility for a possible date
|
|
||||||
**`POST /api/availibility`**
|
|
||||||
|
|
||||||
##### Request
|
|
||||||
A json object with the availibility to add with **`participant_id`**, **`possible_date_id`** and an array of intervals with **`preference`**, **`start_time`**, **`end_time`** and **`timezone`**.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"participant_id": 5,
|
|
||||||
"possible_date_id": 21,
|
|
||||||
"intervals": [{
|
|
||||||
"preference": 0,
|
|
||||||
"start_time": "2021-06-25 09:00:00",
|
|
||||||
"end_time": "2021-06-25 13:00:00",
|
|
||||||
"timezone": "Europe/Brussels"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"preference": 1,
|
|
||||||
"start_time": "2021-06-25 15:00:00",
|
|
||||||
"end_time": "2021-06-25 20:00:00",
|
|
||||||
"timezone": "Europe/Brussels"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Response
|
|
||||||
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`**.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"status": 201,
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Delete availibility for a possible date
|
|
||||||
**`DELETE /api/availibility/:id`**
|
|
||||||
|
|
||||||
##### Request
|
|
||||||
A json object for the availibility to delete with **`participant_id`** and **`possible_date_id`**.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"participant_id": 5,
|
|
||||||
"possible_date_id": 21
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Response
|
|
||||||
A json object for the deleted availibility with status code and message.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"status": 200,
|
|
||||||
"message": "Availibility successfully deleted for `participant_username` on `possible_date`"
|
|
||||||
}
|
|
||||||
```
|
|
@ -1 +0,0 @@
|
|||||||
<mxfile host="Electron" modified="2020-03-25T18:31:26.977Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/12.6.5 Chrome/80.0.3987.141 Electron/8.1.1 Safari/537.36" etag="QzSuGUuUtPoOGiynkDqc" version="12.6.5" type="device"><diagram id="C5RBs43oDa-KdzZeNtuy" name="App flow">7V1Zd6O4Ev41eUwOEvtjNvdy052eSU8vTznYKDYTjNyAs8yvvwJLNpKwkQmbk+ScPm0EyLiWr0pVpeJIP58/fYi9xewL9lF4BDX/6Ui/OILQNHWL/JeNPK9GdMOhI9M48FdjYDNwE/yH6KBGR5eBjxLuwhTjMA0W/OAERxGapNyYF8f4kb/sDof8ty68KZIGbiZeKI/+DPx0thp1oL0Z/4iC6Yx9M7Dc1ZmxN7mfxngZ0e87gvoo/1udnntsLvpDk5nn48fCkH55pJ/HGKerT/OncxRmxGV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t+pWqtjCC/1cTZipoUS/1NFSp6UKTeWFtrcUKGtl23LLMclPV5XR7dFXccux4XRXhV1KW3lrVCPA0kCdboMosUuqFHtY9QcStnViA82yHQAcyxQzs5ao6Xt0sNo5sWm2BCGmzmMVe3FtqxAiN4ygENLNjurmkUSo7Opy30wpgWt5n5X98urUI+7r1LSMPS9rTuD266EIyWrbqAk2kC/JdfSWsAWYfB8+myZvtoKgdAPd5tgqGDXbNr5O7XjzvSXb0xVXWVdgn7piOM6uLe9Q2PKuqjmGy6uODttRHVPj48zQ4TRnX0UghzHGafFyYjRnX7CfZfsv/w8=</diagram></mxfile>
|
|
@ -1,32 +0,0 @@
|
|||||||
## Proposed Tech stack
|
|
||||||
- NodeJS
|
|
||||||
- Express
|
|
||||||
- Postgresql
|
|
||||||
- Luxon
|
|
||||||
|
|
||||||
## Database architecture
|
|
||||||
See: https://dbdiagram.io/d/5e769ab14495b02c3b88936f
|
|
||||||
|
|
||||||
## Flowchart
|
|
||||||
[Open flowchart with diagrams.net](https://app.diagrams.net/#Uhttps://git.armada.digital/rui/meeting-scheduler-backend/raw/commit/53c94900cbedcbfccee4050c232956aebe16b083/research/meetingscheduler.drawio)
|
|
||||||
|
|
||||||
## API endpoints
|
|
||||||
[See all API endpoints](https://git.armada.digital/rui/meeting-scheduler-backend/src/branch/master/research/API%20Documentation.md)
|
|
||||||
|
|
||||||
## How to deal with date and time in PostgreSQL?
|
|
||||||
- use `datetime` datatype without timezone (datetime with timezone is using offset, which doesn't work well with DST)
|
|
||||||
- store datetime in UTC
|
|
||||||
- add timezone information separately, use `Full time zone name` (human friendly)
|
|
||||||
- use `ISO 8601` format, which is human friendly to read and supported by every library
|
|
||||||
|
|
||||||
|
|
||||||
See:
|
|
||||||
- https://www.moesif.com/blog/technical/timestamp/manage-datetime-timestamp-timezones-in-api/
|
|
||||||
- https://www.postgresql.org/docs/current/datatype-datetime.html
|
|
||||||
|
|
||||||
|
|
||||||
## Inspiration
|
|
||||||
- Framadate:https://framadate.org/
|
|
||||||
- Omnipointment: https://omnipointment.com
|
|
||||||
- When is Good: http://whenisgood.net/
|
|
||||||
- MRDA 2019 Secretary spreadsheets ;)
|
|
Loading…
Reference in New Issue
Block a user