Skip to content

new filter for RB #411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
294 changes: 293 additions & 1 deletion docs/Topcoder-bookings-api.postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info": {
"_postman_id": "87477d86-2d08-40b6-93c6-99a394193e28",
"_postman_id": "0bd597ba-4bc2-4ea1-be33-45776b80c1ce",
"name": "Topcoder-bookings-api",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
Expand Down Expand Up @@ -11647,6 +11647,11 @@
"key": "projectIds",
"value": "111, 16705",
"disabled": true
},
{
"key": "billingAccountId",
"value": "0",
"disabled": true
}
]
}
Expand Down Expand Up @@ -11725,6 +11730,11 @@
"key": "status",
"value": "assigned",
"disabled": true
},
{
"key": "billingAccountId",
"value": "0",
"disabled": true
}
]
}
Expand Down Expand Up @@ -11797,6 +11807,11 @@
{
"key": "sortOrder",
"value": "desc"
},
{
"key": "billingAccountId",
"value": "0",
"disabled": true
}
]
}
Expand Down Expand Up @@ -11867,6 +11882,11 @@
{
"key": "sortOrder",
"value": "desc"
},
{
"key": "billingAccountId",
"value": "0",
"disabled": true
}
]
}
Expand Down Expand Up @@ -12537,6 +12557,278 @@
},
"response": []
},
{
"name": "search resource bookings with parameters 13",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test('Status code is 200', function () {\r",
" pm.response.to.have.status(200);\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"type": "text",
"value": "Bearer {{token_bookingManager}}"
}
],
"url": {
"raw": "{{URL}}/resourceBookings?fields=id,startDate,endDate,billingAccountId,workPeriods&billingAccountId=80000071&workPeriods.startDate=2021-01-03&workPeriods.isFirstWeek=true",
"host": [
"{{URL}}"
],
"path": [
"resourceBookings"
],
"query": [
{
"key": "fields",
"value": "id,startDate,endDate,billingAccountId,workPeriods"
},
{
"key": "billingAccountId",
"value": "80000071"
},
{
"key": "workPeriods.startDate",
"value": "2021-01-03"
},
{
"key": "workPeriods.isFirstWeek",
"value": "true"
}
]
}
},
"response": []
},
{
"name": "search resource bookings with parameters 14",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test('Status code is 200', function () {\r",
" pm.response.to.have.status(200);\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"type": "text",
"value": "Bearer {{token_bookingManager}}"
}
],
"url": {
"raw": "{{URL}}/resourceBookings?fields=id,startDate,endDate,billingAccountId,workPeriods&billingAccountId=80000071&workPeriods.startDate=2021-02-07&workPeriods.isLastWeek=true",
"host": [
"{{URL}}"
],
"path": [
"resourceBookings"
],
"query": [
{
"key": "fields",
"value": "id,startDate,endDate,billingAccountId,workPeriods"
},
{
"key": "billingAccountId",
"value": "80000071"
},
{
"key": "workPeriods.startDate",
"value": "2021-02-07"
},
{
"key": "workPeriods.isLastWeek",
"value": "true"
}
]
}
},
"response": []
},
{
"name": "search resource bookings with parameters 15",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test('Status code is 400', function () {\r",
" pm.response.to.have.status(400);\r",
" const response = pm.response.json()\r",
" pm.expect(response.message).to.eq(\"Cannot filter by \\\"isLastWeek\\\" without \\\"startDate\\\"\")\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"type": "text",
"value": "Bearer {{token_bookingManager}}"
}
],
"url": {
"raw": "{{URL}}/resourceBookings?fields=id,startDate,endDate,billingAccountId,workPeriods&billingAccountId=80000071&workPeriods.isLastWeek=true",
"host": [
"{{URL}}"
],
"path": [
"resourceBookings"
],
"query": [
{
"key": "fields",
"value": "id,startDate,endDate,billingAccountId,workPeriods"
},
{
"key": "billingAccountId",
"value": "80000071"
},
{
"key": "workPeriods.isLastWeek",
"value": "true"
}
]
}
},
"response": []
},
{
"name": "search resource bookings with parameters 16",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test('Status code is 400', function () {\r",
" pm.response.to.have.status(400);\r",
" const response = pm.response.json()\r",
" pm.expect(response.message).to.eq(\"Cannot filter by \\\"isFirstWeek\\\" without \\\"startDate\\\"\")\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"type": "text",
"value": "Bearer {{token_bookingManager}}"
}
],
"url": {
"raw": "{{URL}}/resourceBookings?fields=id,startDate,endDate,billingAccountId,workPeriods&billingAccountId=80000071&workPeriods.isFirstWeek=true",
"host": [
"{{URL}}"
],
"path": [
"resourceBookings"
],
"query": [
{
"key": "fields",
"value": "id,startDate,endDate,billingAccountId,workPeriods"
},
{
"key": "billingAccountId",
"value": "80000071"
},
{
"key": "workPeriods.isFirstWeek",
"value": "true"
}
]
}
},
"response": []
},
{
"name": "search resource bookings with parameters 17",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test('Status code is 400', function () {\r",
" pm.response.to.have.status(400);\r",
" const response = pm.response.json()\r",
" pm.expect(response.message).to.eq(\"Cannot filter by both \\\"isFirstWeek\\\" and \\\"isLastWeek\\\" set to \\\"true\\\"\")\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"type": "text",
"value": "Bearer {{token_bookingManager}}"
}
],
"url": {
"raw": "{{URL}}/resourceBookings?fields=id,startDate,endDate,billingAccountId,workPeriods&billingAccountId=80000071&workPeriods.startDate=2021-02-07&workPeriods.isLastWeek=true&workPeriods.isFirstWeek=true",
"host": [
"{{URL}}"
],
"path": [
"resourceBookings"
],
"query": [
{
"key": "fields",
"value": "id,startDate,endDate,billingAccountId,workPeriods"
},
{
"key": "billingAccountId",
"value": "80000071"
},
{
"key": "workPeriods.startDate",
"value": "2021-02-07"
},
{
"key": "workPeriods.isLastWeek",
"value": "true"
},
{
"key": "workPeriods.isFirstWeek",
"value": "true"
}
]
}
},
"response": []
},
{
"name": "put resource booking with booking manager",
"event": [
Expand Down
30 changes: 28 additions & 2 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1506,6 +1506,12 @@ paths:
schema:
type: string
description: comma separated project ids.
- in: query
name: billingAccountId
required: false
schema:
type: integer
description: billing account id. 0 represents null value.
- in: query
name: workPeriods.paymentStatus
required: false
Expand All @@ -1527,21 +1533,41 @@ paths:
type: string
format: date
pattern: '^\d{4}-\d{2}-\d{2}$'
description: The work period start date.
description: The work period start date. Should be Sunday.
- in: query
name: workPeriods.endDate
required: false
schema:
type: string
format: date
pattern: '^\d{4}-\d{2}-\d{2}$'
description: The work period end date.
description: The work period end date. Should be Saturday.
- in: query
name: workPeriods.userHandle
required: false
schema:
type: string
description: The user handle.
- in: query
name: workPeriods.isFirstWeek
required: false
schema:
type: boolean
default: false
description: |
the week which matches workPeriods.startDate is the first one in the RB.
workPeriods.startDate is required.
only one of workPeriods.isFirstWeek and workPeriods.isLastWeek is allowed.
- in: query
name: workPeriods.isLastWeek
required: false
schema:
type: boolean
default: false
description: |
the week which matches workPeriods.startDate is the last one in the RB.
workPeriods.startDate is required.
only one of workPeriods.isFirstWeek and workPeriods.isLastWeek is allowed.
- in: query
name: workPeriods.payments.status
required: false
Expand Down
Loading