Skip to content

Commit

Permalink
Merge branch 'feature/CON-3/days-off' into CON-307-Create-dayOffType-…
Browse files Browse the repository at this point in the history
…API-doc
  • Loading branch information
StephenBeirlaen committed Jun 20, 2024
2 parents 55c0596 + 18e48e3 commit cb4d518
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 6 deletions.
57 changes: 54 additions & 3 deletions apiary.apib
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ We list all backwards-compatible additions here. These are currently available i

#### June 2024
- We added `tax` to the `products.info` endpoint.
- We added the `dayOffTypes.create` endpoint.
- We added the `daysOff.import`, `daysOff.bulkDelete`, `dayOffTypes.create`, `dayOffTypes.delete` and `closingDays.add` endpoints.

#### May 2024
- We added `purchase_order_number` to `projects-v2/projects.info`, `projects-v2/projects.create` and `projects-v2/projects.update`.
Expand Down Expand Up @@ -1785,9 +1785,23 @@ Create a new email tracking.

## Closing Days [/closingDays]

### closingDays.add [POST /closingDays.add]

Adds a closing day for the account.

+ Request (application/json)
+ Attributes (object)
+ `day`: `2024-02-01` (string, required)

+ Response 201 (application/json)
+ Attributes (object)
+ data (object)
+ type: `closingDay` (string)
+ id: `eb264fd0-0e5c-0dbf-ae1e-49e7d6a8e6b8` (string, required)

### closingDays.list [POST /closingDays.list]

Returns information about closing days the account
Returns information about closing days of the account

+ Request (application/json)
+ Attributes (object)
Expand Down Expand Up @@ -1836,12 +1850,49 @@ Create a new day off type.


+ Response 201 (application/json)

+ Attributes (object)
+ data (object)
+ type: `dayOffType` (string)
+ id: `cf307a90-d778-003c-b820-ab8415d1a524` (string)

### dayOffTypes.delete [POST /dayOffTypes.delete]

Delete a day off type.

+ Request (application/json)
+ Attributes (object)
+ `id`: `1b7cece0-288c-0bbe-b916-5a315fbe9fe2` (string, required)

+ Response 204

## Days Off [/daysOff]

### daysOff.import [POST /daysOff.import]

Imports a list of days off for the given user.

+ Request (application/json)
+ Attributes (object)
+ `user_id`: `f29abf48-337d-44b4-aad4-585f5277a456` (string, required) - The id of the user that the days off belong to.
+ `leave_type_id`: `0f517e20-2e76-4684-8d6c-3334f6d7148c` (string, required) - The id of the leave type that is associated with the given days off.
+ `days` (array, required) - At least one day must be present
+ (object)
+ `starts_at`: `2024-02-01T08:00:00+00:00` (string, required)
+ `ends_at`: `2024-02-01T18:00:00+00:00` (string, required)

+ Response 201 (application/json)


### daysOff.bulkDelete [POST /daysOff.bulkDelete]

Deletes a list of days off for the given user.

+ Request (application/json)
+ Attributes (object)
+ `user_id`: `f29abf48-337d-44b4-aad4-585f5277a456` (string, required) - The id of the user that the days off belong to.
+ `ids`: `0a481ce9-0d2a-0913-9439-0fd8b469b566`, `5050789e-4385-02f6-bd3c-d051cc12f5cf` (array[string]) - At least one day off id must be present.

+ Response 204 (application/json)

# Group CRM

Expand Down
16 changes: 15 additions & 1 deletion src/01-general/closing-days.apib
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
## Closing Days [/closingDays]

### closingDays.add [POST /closingDays.add]

Adds a closing day for the account.

+ Request (application/json)
+ Attributes (object)
+ `day`: `2024-02-01` (string, required)

+ Response 201 (application/json)
+ Attributes (object)
+ data (object)
+ type: `closingDay` (string)
+ id: `eb264fd0-0e5c-0dbf-ae1e-49e7d6a8e6b8` (string, required)

### closingDays.list [POST /closingDays.list]

Returns information about closing days the account
Returns information about closing days of the account

+ Request (application/json)
+ Attributes (object)
Expand Down
10 changes: 9 additions & 1 deletion src/01-general/day-off-types.apib
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,17 @@ Create a new day off type.


+ Response 201 (application/json)

+ Attributes (object)
+ data (object)
+ type: `dayOffType` (string)
+ id: `cf307a90-d778-003c-b820-ab8415d1a524` (string)

### dayOffTypes.delete [POST /dayOffTypes.delete]

Delete a day off type.

+ Request (application/json)
+ Attributes (object)
+ `id`: `1b7cece0-288c-0bbe-b916-5a315fbe9fe2` (string, required)

+ Response 204
28 changes: 28 additions & 0 deletions src/01-general/days-off.apib
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## Days Off [/daysOff]

### daysOff.import [POST /daysOff.import]

Imports a list of days off for the given user.

+ Request (application/json)
+ Attributes (object)
+ `user_id`: `f29abf48-337d-44b4-aad4-585f5277a456` (string, required) - The id of the user that the days off belong to.
+ `leave_type_id`: `0f517e20-2e76-4684-8d6c-3334f6d7148c` (string, required) - The id of the leave type that is associated with the given days off.
+ `days` (array, required) - At least one day must be present
+ (object)
+ `starts_at`: `2024-02-01T08:00:00+00:00` (string, required)
+ `ends_at`: `2024-02-01T18:00:00+00:00` (string, required)

+ Response 201 (application/json)


### daysOff.bulkDelete [POST /daysOff.bulkDelete]

Deletes a list of days off for the given user.

+ Request (application/json)
+ Attributes (object)
+ `user_id`: `f29abf48-337d-44b4-aad4-585f5277a456` (string, required) - The id of the user that the days off belong to.
+ `ids`: `0a481ce9-0d2a-0913-9439-0fd8b469b566`, `5050789e-4385-02f6-bd3c-d051cc12f5cf` (array[string]) - At least one day off id must be present.

+ Response 204 (application/json)
2 changes: 2 additions & 0 deletions src/apiary.apib
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ HOST: https://api.focus.teamleader.eu

:[Day Off Types](./01-general/day-off-types.apib)

:[Days Off](./01-general/days-off.apib)

# Group CRM

:[Contacts](./02-crm/contacts.apib)
Expand Down
2 changes: 1 addition & 1 deletion src/changes-backwards-compatible.apib
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ We list all backwards-compatible additions here. These are currently available i

#### June 2024
- We added `tax` to the `products.info` endpoint.
- We added the `dayOffTypes.create` endpoint.
- We added the `daysOff.import`, `daysOff.bulkDelete`, `dayOffTypes.create`, `dayOffTypes.delete` and `closingDays.add` endpoints.

#### May 2024
- We added `purchase_order_number` to `projects-v2/projects.info`, `projects-v2/projects.create` and `projects-v2/projects.update`.
Expand Down

0 comments on commit cb4d518

Please sign in to comment.