Skip to content

Feature/batch payments #295

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 6 commits into from
Jun 3, 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
9 changes: 5 additions & 4 deletions app-constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ const ChallengeStatus = {
COMPLETED: 'Completed'
}

const PaymentProcessingSwitch = {
ON: 'ON',
OFF: 'OFF'
const WorkPeriodPaymentStatus = {
COMPLETED: 'completed',
CANCELLED: 'cancelled',
SCHEDULED: 'scheduled'
}

module.exports = {
Expand All @@ -93,5 +94,5 @@ module.exports = {
Scopes,
Interviews,
ChallengeStatus,
PaymentProcessingSwitch
WorkPeriodPaymentStatus
}
3 changes: 1 addition & 2 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ module.exports = {
ROLE_ID_SUBMITTER: process.env.ROLE_ID_SUBMITTER || '732339e7-8e30-49d7-9198-cccf9451e221',
TYPE_ID_TASK: process.env.TYPE_ID_TASK || 'ecd58c69-238f-43a4-a4bb-d172719b9f31',
DEFAULT_TIMELINE_TEMPLATE_ID: process.env.DEFAULT_TIMELINE_TEMPLATE_ID || '53a307ce-b4b3-4d6f-b9a1-3741a58f77e6',
DEFAULT_TRACK_ID: process.env.DEFAULT_TRACK_ID || '9b6fc876-f4d9-4ccb-9dfd-419247628825',
DEFAULT_TRACK_ID: process.env.DEFAULT_TRACK_ID || '9b6fc876-f4d9-4ccb-9dfd-419247628825'

PAYMENT_PROCESSING_SWITCH: process.env.PAYMENT_PROCESSING_SWITCH || 'OFF'
}
282 changes: 282 additions & 0 deletions docs/Topcoder-bookings-api.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -16907,6 +16907,55 @@
},
"response": []
},
{
"name": "create work period2",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test('Status code is 200', function () {\r",
" pm.response.to.have.status(200);\r",
" if(pm.response.status === \"OK\"){\r",
" const response = pm.response.json()\r",
" pm.environment.set(\"workPeriodId2\", response.id);\r",
" }\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"type": "text",
"value": "Bearer {{token_bookingManager}}"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"resourceBookingId\": \"{{resourceBookingId}}\",\r\n \"startDate\": \"2021-03-14\",\r\n \"endDate\": \"2021-03-20\",\r\n \"daysWorked\": 2,\r\n \"memberRate\": 13.13,\r\n \"customerRate\": 13.13,\r\n \"paymentStatus\": \"pending\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/work-periods",
"host": [
"{{URL}}"
],
"path": [
"work-periods"
]
}
},
"response": []
},
{
"name": "create work period with m2m",
"event": [
Expand Down Expand Up @@ -17007,6 +17056,97 @@
},
"response": []
},
{
"name": "create multiple work period payments with boooking manager",
"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": "POST",
"header": [
{
"key": "Authorization",
"type": "text",
"value": "Bearer {{token_bookingManager}}"
}
],
"body": {
"mode": "raw",
"raw": "[{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 600\r\n},{\r\n \"workPeriodId\": \"{{workPeriodId2}}\",\r\n \"amount\": 900\r\n}]",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/work-period-payments",
"host": [
"{{URL}}"
],
"path": [
"work-period-payments"
]
}
},
"response": []
},
{
"name": "create query work period payments with boooking manager",
"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": "POST",
"header": [
{
"key": "Authorization",
"type": "text",
"value": "Bearer {{token_bookingManager}}"
}
],
"body": {
"mode": "raw",
"raw": "{\"query\": { \"workPeriods.paymentStatus\": \"pending\" } }",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/work-period-payments/query",
"host": [
"{{URL}}"
],
"path": [
"work-period-payments",
"query"
]
}
},
"response": []
},
{
"name": "create work period payment with m2m create",
"event": [
Expand Down Expand Up @@ -27377,6 +27517,52 @@
},
"response": []
},
{
"name": "✔ create multiple work period payment with administrator",
"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": "POST",
"header": [
{
"key": "Authorization",
"type": "text",
"value": "Bearer {{token_administrator}}"
}
],
"body": {
"mode": "raw",
"raw": "{\"query\": { \"workPeriods.paymentStatus\": \"pending\" } }",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/work-period-payments/query",
"host": [
"{{URL}}"
],
"path": [
"work-period-payments",
"query"
]
}
},
"response": []
},
{
"name": "✔ get work period payment with administrator",
"event": [
Expand Down Expand Up @@ -29829,6 +30015,54 @@
},
"response": []
},
{
"name": "✘ create query work period payment with member",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test('Status code is 403', function () {\r",
" pm.response.to.have.status(403);\r",
" const response = pm.response.json()\r",
" pm.expect(response.message).to.eq(\"You are not allowed to perform this action!\")\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"type": "text",
"value": "Bearer {{token_member_tester1234}}"
}
],
"body": {
"mode": "raw",
"raw": "{\"query\": { \"workPeriods.paymentStatus\": \"pending\" } }",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/work-period-payments/query",
"host": [
"{{URL}}"
],
"path": [
"work-period-payments",
"query"
]
}
},
"response": []
},
{
"name": "✘ get work period payment with member",
"event": [
Expand Down Expand Up @@ -32343,6 +32577,54 @@
},
"response": []
},
{
"name": "✘ create query work period payment with connect manager",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test('Status code is 403', function () {\r",
" pm.response.to.have.status(403);\r",
" const response = pm.response.json()\r",
" pm.expect(response.message).to.eq(\"You are not allowed to perform this action!\")\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"type": "text",
"value": "Bearer {{token_connect_manager_pshahcopmanag2}}"
}
],
"body": {
"mode": "raw",
"raw": "{\"query\": { \"workPeriods.paymentStatus\": \"pending\" } }",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/work-period-payments/query",
"host": [
"{{URL}}"
],
"path": [
"work-period-payments",
"query"
]
}
},
"response": []
},
{
"name": "✘ get work period payment with connect manager",
"event": [
Expand Down
Loading