Skip to content

Commit

Permalink
Merge pull request #815 from teamleadercrm/feature/CON-3/days-off
Browse files Browse the repository at this point in the history
[CON-3] Introduce /daysOff - /daysOffTypes - /closingDays endpoints
  • Loading branch information
StephenBeirlaen authored Jun 28, 2024
2 parents ebe3339 + c2fd6b8 commit c5c9e65
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 2 deletions.
84 changes: 83 additions & 1 deletion apiary.apib
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,9 @@ 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 `daysOff.import` and `daysOff.bulkDelete` endpoints.
- We added the `dayOffTypes.create` and `dayOffTypes.delete` endpoints.
- We added the `closingDays.add` and `closingDays.delete` 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 @@ -1786,7 +1789,7 @@ Create a new email tracking.

### 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 All @@ -1805,6 +1808,29 @@ Returns information about closing days the account
+ page (Pagination)
+ matches: `12` (number)

### 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.delete [POST /closingDays.delete]

Removes a closing day for the account.

+ Request (application/json)
+ Attributes (object)
+ id: `eb264fd0-0e5c-0dbf-ae1e-49e7d6a8e6b8` (string, required)

+ Response 204

## Day Off Types [/dayOffTypes]

Expand All @@ -1821,6 +1847,62 @@ Returns a list of day off types for the account
+ `id`: `39263c14-9c16-022d-8513-60cf722ab088` (string)
+ `name`: `Sick leave` (string)

### dayOffTypes.create [POST /dayOffTypes.create]

Create a new day off type.

+ Request (application/json)
+ Attributes (object)
+ name: `day off type` (string, required)
+ color: `#00B2B2` (string, nullable, optional)
+ date_validity (object, nullable, optional)
+ from: `2024-04-04` (string, required)
+ unit: `2025-05-05` (string, required)


+ 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
25 changes: 24 additions & 1 deletion src/01-general/closing-days.apib
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### 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 All @@ -21,3 +21,26 @@ Returns information about closing days the account
+ page (Pagination)
+ matches: `12` (number)

### 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.delete [POST /closingDays.delete]

Removes a closing day for the account.

+ Request (application/json)
+ Attributes (object)
+ id: `eb264fd0-0e5c-0dbf-ae1e-49e7d6a8e6b8` (string, required)

+ Response 204
28 changes: 28 additions & 0 deletions src/01-general/day-off-types.apib
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,31 @@ Returns a list of day off types for the account
+ `id`: `39263c14-9c16-022d-8513-60cf722ab088` (string)
+ `name`: `Sick leave` (string)

### dayOffTypes.create [POST /dayOffTypes.create]

Create a new day off type.

+ Request (application/json)
+ Attributes (object)
+ name: `day off type` (string, required)
+ color: `#00B2B2` (string, nullable, optional)
+ date_validity (object, nullable, optional)
+ from: `2024-04-04` (string, required)
+ unit: `2025-05-05` (string, required)


+ 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
27 changes: 27 additions & 0 deletions src/01-general/days-off.apib
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## 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
3 changes: 3 additions & 0 deletions src/changes-backwards-compatible.apib
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ 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 `daysOff.import` and `daysOff.bulkDelete` endpoints.
- We added the `dayOffTypes.create` and `dayOffTypes.delete` endpoints.
- We added the `closingDays.add` and `closingDays.delete` 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 c5c9e65

Please sign in to comment.