diff --git a/README.md b/README.md index a15d010c..e86242b2 100644 --- a/README.md +++ b/README.md @@ -76,18 +76,29 @@ - after that, `taas-es-processor` would be started itself. Make sure it successfully connected to Kafka, you should see 9 lines with text `Subscribed to taas.`: ``` - tc-taas-es-processor | 2021-01-22T14:27:48.971Z DEBUG no-kafka-client Subscribed to taas.jobcandidate.create:0 offset 0 leader kafka:9093 - tc-taas-es-processor | 2021-01-22T14:27:48.972Z DEBUG no-kafka-client Subscribed to taas.job.create:0 offset 0 leader kafka:9093 - tc-taas-es-processor | 2021-01-22T14:27:48.972Z DEBUG no-kafka-client Subscribed to taas.resourcebooking.delete:0 offset 0 leader kafka:9093 - tc-taas-es-processor | 2021-01-22T14:27:48.973Z DEBUG no-kafka-client Subscribed to taas.jobcandidate.delete:0 offset 0 leader kafka:9093 - tc-taas-es-processor | 2021-01-22T14:27:48.974Z DEBUG no-kafka-client Subscribed to taas.jobcandidate.update:0 offset 0 leader kafka:9093 - tc-taas-es-processor | 2021-01-22T14:27:48.975Z DEBUG no-kafka-client Subscribed to taas.resourcebooking.create:0 offset 0 leader kafka:9093 - tc-taas-es-processor | 2021-01-22T14:27:48.976Z DEBUG no-kafka-client Subscribed to taas.job.delete:0 offset 0 leader kafka:9093 - tc-taas-es-processor | 2021-01-22T14:27:48.977Z DEBUG no-kafka-client Subscribed to taas.job.update:0 offset 0 leader kafka:9093 - tc-taas-es-processor | 2021-01-22T14:27:48.978Z DEBUG no-kafka-client Subscribed to taas.resourcebooking.update:0 offset 0 leader kafka:9093 - tc-taas-es-processor | 2021-01-22T14:27:48.979Z DEBUG no-kafka-client Subscribed to taas.workperiod.create:0 offset 0 leader kafka:9093 - tc-taas-es-processor | 2021-01-22T14:27:48.980Z DEBUG no-kafka-client Subscribed to taas.workperiod.update:0 offset 0 leader kafka:9093 - tc-taas-es-processor | 2021-01-22T14:27:48.981Z DEBUG no-kafka-client Subscribed to taas.workperiod.delete:0 offset 0 leader kafka:9093 + tc-taas-es-processor | [2021-04-09T21:20:19.035Z] app INFO : Starting kafka consumer + tc-taas-es-processor | 2021-04-09T21:20:21.292Z INFO no-kafka-client Joined group taas-es-processor generationId 1 as no-kafka-client-076538fc-60dd-4ca4-a2b9-520bdf73bc9e + tc-taas-es-processor | 2021-04-09T21:20:21.293Z INFO no-kafka-client Elected as group leader + tc-taas-es-processor | 2021-04-09T21:20:21.452Z DEBUG no-kafka-client Subscribed to taas.jobcandidate.create:0 offset 0 leader kafka:9093 + tc-taas-es-processor | 2021-04-09T21:20:21.455Z DEBUG no-kafka-client Subscribed to taas.job.create:0 offset 0 leader kafka:9093 + tc-taas-es-processor | 2021-04-09T21:20:21.456Z DEBUG no-kafka-client Subscribed to taas.resourcebooking.delete:0 offset 0 leader kafka:9093 + tc-taas-es-processor | 2021-04-09T21:20:21.457Z DEBUG no-kafka-client Subscribed to taas.jobcandidate.delete:0 offset 0 leader kafka:9093 + tc-taas-es-processor | 2021-04-09T21:20:21.458Z DEBUG no-kafka-client Subscribed to taas.jobcandidate.update:0 offset 0 leader kafka:9093 + tc-taas-es-processor | 2021-04-09T21:20:21.459Z DEBUG no-kafka-client Subscribed to taas.resourcebooking.create:0 offset 0 leader kafka:9093 + tc-taas-es-processor | 2021-04-09T21:20:21.461Z DEBUG no-kafka-client Subscribed to taas.job.delete:0 offset 0 leader kafka:9093 + tc-taas-es-processor | 2021-04-09T21:20:21.463Z DEBUG no-kafka-client Subscribed to taas.workperiod.update:0 offset 0 leader kafka:9093 + tc-taas-es-processor | 2021-04-09T21:20:21.466Z DEBUG no-kafka-client Subscribed to taas.workperiod.delete:0 offset 0 leader kafka:9093 + tc-taas-es-processor | 2021-04-09T21:20:21.468Z DEBUG no-kafka-client Subscribed to taas.workperiod.create:0 offset 0 leader kafka:9093 + tc-taas-es-processor | 2021-04-09T21:20:21.469Z DEBUG no-kafka-client Subscribed to taas.workperiodpayment.update:0 offset 0 leader kafka:9093 + tc-taas-es-processor | 2021-04-09T21:20:21.470Z DEBUG no-kafka-client Subscribed to taas.workperiodpayment.delete:0 offset 0 leader kafka:9093 + tc-taas-es-processor | 2021-04-09T21:20:21.471Z DEBUG no-kafka-client Subscribed to taas.workperiodpayment.create:0 offset 0 leader kafka:9093 + tc-taas-es-processor | 2021-04-09T21:20:21.473Z DEBUG no-kafka-client Subscribed to taas.job.update:0 offset 0 leader kafka:9093 + tc-taas-es-processor | 2021-04-09T21:20:21.474Z DEBUG no-kafka-client Subscribed to taas.resourcebooking.update:0 offset 0 leader kafka:9093 + tc-taas-es-processor | [2021-04-09T21:20:21.475Z] app INFO : Initialized....... + tc-taas-es-processor | [2021-04-09T21:20:21.479Z] app INFO : taas.job.create,taas.job.update,taas.job.delete,taas.jobcandidate.create,taas.jobcandidate.update,taas.jobcandidate.delete,taas.resourcebooking.create,taas.resourcebooking.update,taas.resourcebooking.delete,taas.workperiod.create,taas.workperiod.update,taas.workperiod.delete,taas.workperiodpayment.create,taas.workperiodpayment.update,taas.workperiodpayment.delete + tc-taas-es-processor | [2021-04-09T21:20:21.480Z] app INFO : Kick Start....... + tc-taas-es-processor | ********** Topcoder Health Check DropIn listening on port 3001 + tc-taas-es-processor | Topcoder Health Check DropIn started and ready to roll ``` diff --git a/app-constants.js b/app-constants.js index 54ed9b7f..770ec967 100644 --- a/app-constants.js +++ b/app-constants.js @@ -39,11 +39,23 @@ const Scopes = { CREATE_WORK_PERIOD: 'create:taas-workPeriods', UPDATE_WORK_PERIOD: 'update:taas-workPeriods', DELETE_WORK_PERIOD: 'delete:taas-workPeriods', - ALL_WORK_PERIOD: 'all:taas-workPeriods' + ALL_WORK_PERIOD: 'all:taas-workPeriods', + // work period payment + READ_WORK_PERIOD_PAYMENT: 'read:taas-workPeriodPayments', + CREATE_WORK_PERIOD_PAYMENT: 'create:taas-workPeriodPayments', + UPDATE_WORK_PERIOD_PAYMENT: 'update:taas-workPeriodPayments', + ALL_WORK_PERIOD_PAYMENT: 'all:taas-workPeriodPayments' +} + +const ChallengeStatus = { + DRAFT: 'Draft', + ACTIVE: 'Active', + COMPLETED: 'Completed' } module.exports = { UserRoles, FullManagePermissionRoles, - Scopes + Scopes, + ChallengeStatus } diff --git a/config/default.js b/config/default.js index a15e1c28..c2ba03fe 100644 --- a/config/default.js +++ b/config/default.js @@ -119,6 +119,13 @@ module.exports = { TAAS_WORK_PERIOD_UPDATE_TOPIC: process.env.TAAS_WORK_PERIOD_UPDATE_TOPIC || 'taas.workperiod.update', // the delete work period entity Kafka message topic TAAS_WORK_PERIOD_DELETE_TOPIC: process.env.TAAS_WORK_PERIOD_DELETE_TOPIC || 'taas.workperiod.delete', + // topics for work period payment service + // the create work period payment entity Kafka message topic + TAAS_WORK_PERIOD_PAYMENT_CREATE_TOPIC: process.env.TAAS_WORK_PERIOD_PAYMENT_CREATE_TOPIC || 'taas.workperiodpayment.create', + // the update work period payment entity Kafka message topic + TAAS_WORK_PERIOD_PAYMENT_UPDATE_TOPIC: process.env.TAAS_WORK_PERIOD_PAYMENT_UPDATE_TOPIC || 'taas.workperiodpayment.update', + // the delete work period payment entity Kafka message topic + TAAS_WORK_PERIOD_PAYMENT_DELETE_TOPIC: process.env.TAAS_WORK_PERIOD_PAYMENT_DELETE_TOPIC || 'taas.workperiodpayment.delete', // the Kafka message topic for sending email EMAIL_TOPIC: process.env.EMAIL_TOPIC || 'external.action.email', @@ -134,6 +141,12 @@ module.exports = { REQUEST_EXTENSION_SENDGRID_TEMPLATE_ID: process.env.REQUEST_EXTENSION_SENDGRID_TEMPLATE_ID, // the URL where TaaS App is hosted TAAS_APP_URL: process.env.TAAS_APP_URL || 'https://platform.topcoder-dev.com/taas/myteams', + // environment variables for Payment Service + 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 time zone for Work Periods WORK_PERIOD_TIME_ZONE: process.env.WORK_PERIOD_TIME_ZONE || 'America/New_York' } diff --git a/data/demo-data.json b/data/demo-data.json index f2a058a3..8b5c7211 100644 --- a/data/demo-data.json +++ b/data/demo-data.json @@ -1 +1,2301 @@ -{"Job":[{"id":"b9887564-3d3d-4c70-8a7b-552576ef2e8d","projectId":111,"externalId":"0","description":"taas-demo-job1","title":"Demo Title","startDate":"2020-09-27T04:17:23.131Z","duration":null,"numPositions":13,"resourceType":"Dummy Resource Type","rateType":"weekly","workload":"full-time","skills":["ee4c50c1-c8c3-475e-b6b6-edbd136a19d6","89139c80-d0a2-47c2-aa16-14589d5afd10","9f2d9127-6a2e-4506-ad76-c4ab63577b09","9515e7ee-83b6-49d1-ba5c-6c59c5a8ef1b","c854ab55-5922-4be1-8ecc-b3bc1f8629af","8456002e-fa2d-44f0-b0e7-86b1c02b6e4c","114b4ec8-805e-4c60-b351-14a955a991a9","213408aa-f16f-46c8-bc57-9e569cee3f11","b37a48db-f775-4e4e-b403-8ad1d234cdea","99b930b5-1b91-4df1-8b17-d9307107bb51","6388a632-c3ad-4525-9a73-66a527c03672","23839f38-6f19-4de9-9d28-f020056bca73","289e42a3-23e9-49be-88e1-6deb93cd8c31","b403f209-63b5-42bc-9b5f-1564416640d8"],"status":"sourcing","isApplicationPageActive":false,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":null,"createdAt":"2021-01-28T19:36:33.409Z","updatedAt":"2021-03-30T19:11:05.033Z"},{"id":"a5b3bf94-a8bf-4c7e-b685-70a29a4d7d6e","projectId":111,"externalId":"0","description":"taas-demo-job2","title":"Dummy title - at most 64 characters","startDate":"2020-09-27T04:17:23.131Z","duration":null,"numPositions":7,"resourceType":"Dummy Resource Type","rateType":"weekly","workload":"full-time","skills":["213408aa-f16f-46c8-bc57-9e569cee3f11","b37a48db-f775-4e4e-b403-8ad1d234cdea","99b930b5-1b91-4df1-8b17-d9307107bb51","6388a632-c3ad-4525-9a73-66a527c03672","23839f38-6f19-4de9-9d28-f020056bca73","289e42a3-23e9-49be-88e1-6deb93cd8c31","b403f209-63b5-42bc-9b5f-1564416640d8"],"status":"in-review","isApplicationPageActive":false,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","createdAt":"2021-01-28T19:36:44.975Z","updatedAt":"2021-01-28T19:38:17.463Z"},{"id":"2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0","projectId":111,"externalId":"0","description":"taas-demo-job3","title":"Dummy title - at most 64 characters","startDate":"2020-09-27T04:17:23.131Z","duration":null,"numPositions":7,"resourceType":"Dummy Resource Type","rateType":"weekly","workload":"full-time","skills":[],"status":"assigned","isApplicationPageActive":false,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","createdAt":"2021-01-28T19:38:23.739Z","updatedAt":"2021-01-28T19:41:10.607Z"},{"id":"84b73f90-0fef-4507-887a-074578e5ef38","projectId":111,"externalId":"0","description":"taas-demo-job4","title":"Dummy title - at most 64 characters","startDate":"2020-09-27T04:17:23.131Z","duration":null,"numPositions":7,"resourceType":"Dummy Resource Type","rateType":"weekly","workload":"full-time","skills":["8456002e-fa2d-44f0-b0e7-86b1c02b6e4c","114b4ec8-805e-4c60-b351-14a955a991a9","213408aa-f16f-46c8-bc57-9e569cee3f11","b37a48db-f775-4e4e-b403-8ad1d234cdea","99b930b5-1b91-4df1-8b17-d9307107bb51","6388a632-c3ad-4525-9a73-66a527c03672"],"status":"closed","isApplicationPageActive":false,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","createdAt":"2021-01-28T19:41:21.892Z","updatedAt":"2021-01-28T19:41:28.849Z"},{"id":"62399aa0-b088-41fe-9e9b-0c8071f1934f","projectId":111,"externalId":"0","description":"taas-demo-job5","title":"Dummy title - at most 64 characters","startDate":"2020-09-27T04:17:23.131Z","duration":null,"numPositions":7,"resourceType":"Dummy Resource Type","rateType":"weekly","workload":"full-time","skills":["b37a48db-f775-4e4e-b403-8ad1d234cdea","99b930b5-1b91-4df1-8b17-d9307107bb51","6388a632-c3ad-4525-9a73-66a527c03672"],"status":"cancelled","isApplicationPageActive":false,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","createdAt":"2021-01-28T19:41:35.098Z","updatedAt":"2021-01-28T19:41:42.124Z"}],"JobCandidate":[{"id":"debadcd8-64bf-4ab8-9cdb-297479eef6f5","jobId":"a5b3bf94-a8bf-4c7e-b685-70a29a4d7d6e","userId":"4dfc6090-4ba8-4387-b5c4-584fcef982ba","status":"open","externalId":null,"resume":null,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":null,"createdAt":"2021-01-28T19:37:05.723Z","updatedAt":"2021-03-30T19:11:05.043Z"},{"id":"7ff45b8f-2b71-4510-b760-8dfa62e79504","jobId":"a5b3bf94-a8bf-4c7e-b685-70a29a4d7d6e","userId":"243517dd-77d7-4f70-8951-0bc66da83076","status":"open","externalId":null,"resume":null,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":null,"createdAt":"2021-01-28T19:37:11.598Z","updatedAt":"2021-03-30T19:11:05.043Z"},{"id":"91d63d5f-01d5-419e-89df-6117ea92f535","jobId":"a5b3bf94-a8bf-4c7e-b685-70a29a4d7d6e","userId":"a2e28bf4-1147-41a6-a39f-e2509306f2a6","status":"open","externalId":null,"resume":null,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":null,"createdAt":"2021-01-28T19:37:18.066Z","updatedAt":"2021-03-30T19:11:05.043Z"},{"id":"257f98d9-45f7-4e13-a6c2-d7e7b6efc9fe","jobId":"a5b3bf94-a8bf-4c7e-b685-70a29a4d7d6e","userId":"b8649393-d32f-4b7f-a156-12e9776acb0e","status":"open","externalId":null,"resume":null,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":null,"createdAt":"2021-01-28T19:37:24.095Z","updatedAt":"2021-03-30T19:11:05.043Z"},{"id":"a01852d0-fa08-410c-b97b-67580ce62215","jobId":"a5b3bf94-a8bf-4c7e-b685-70a29a4d7d6e","userId":"a0a3a5ce-1de6-465d-91b2-518feb299851","status":"open","externalId":null,"resume":null,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":null,"createdAt":"2021-01-28T19:37:29.734Z","updatedAt":"2021-03-30T19:11:05.043Z"},{"id":"2fd7ca69-c8ec-4bf3-a7f3-655fbfe3e7df","jobId":"a5b3bf94-a8bf-4c7e-b685-70a29a4d7d6e","userId":"e6958d77-ffaf-4d24-9cdb-6391506695a4","status":"open","externalId":null,"resume":null,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":null,"createdAt":"2021-01-28T19:37:44.728Z","updatedAt":"2021-03-30T19:11:05.043Z"},{"id":"f0023058-2996-4bba-8c5f-d09a7023be38","jobId":"a5b3bf94-a8bf-4c7e-b685-70a29a4d7d6e","userId":"626bb327-e738-48e3-8f67-1fa2dc677d3c","status":"open","externalId":null,"resume":null,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":null,"createdAt":"2021-01-28T19:37:50.619Z","updatedAt":"2021-03-30T19:11:05.043Z"},{"id":"a189b34d-acde-4633-b18b-f7a34d7c5a74","jobId":"a5b3bf94-a8bf-4c7e-b685-70a29a4d7d6e","userId":"b49a0adb-1565-4de1-9189-a763c77f5ed4","status":"open","externalId":null,"resume":null,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":null,"createdAt":"2021-01-28T19:37:56.456Z","updatedAt":"2021-03-30T19:11:05.043Z"},{"id":"5191a860-4327-4c50-b76b-84beba04519b","jobId":"a5b3bf94-a8bf-4c7e-b685-70a29a4d7d6e","userId":"79ce2a3e-7679-48cf-8ac9-0a8ca4c4b463","status":"shortlist","externalId":null,"resume":null,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","createdAt":"2021-01-28T19:36:51.222Z","updatedAt":"2021-01-28T19:38:02.293Z"},{"id":"e6d9635c-b122-4f69-9285-09fb1ab30106","jobId":"a5b3bf94-a8bf-4c7e-b685-70a29a4d7d6e","userId":"98ec2c16-442e-4b61-8ad1-66123ee37d3c","status":"rejected","externalId":null,"resume":null,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","createdAt":"2021-01-28T19:36:58.774Z","updatedAt":"2021-01-28T19:38:13.553Z"},{"id":"f67b155e-0f09-4fdd-89a7-d79c5e46cac6","jobId":"2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0","userId":"05e988b7-7d54-4c10-ada1-1a04870a88a8","status":"open","externalId":null,"resume":null,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":null,"createdAt":"2021-01-28T19:38:38.332Z","updatedAt":"2021-03-30T19:11:05.043Z"},{"id":"8ffd33d3-4a43-4719-aee4-8e46be1d8f1c","jobId":"2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0","userId":"a2ffdeed-704d-4cf7-b70a-93fcf61de598","status":"open","externalId":null,"resume":null,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":null,"createdAt":"2021-01-28T19:38:43.967Z","updatedAt":"2021-03-30T19:11:05.043Z"},{"id":"2b8ba549-8878-43d6-ad5f-6a66e3b9d6c9","jobId":"2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0","userId":"4709473d-f060-4102-87f8-4d51ff0b34c1","status":"open","externalId":null,"resume":null,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":null,"createdAt":"2021-01-28T19:38:50.106Z","updatedAt":"2021-03-30T19:11:05.043Z"},{"id":"ae5a81ec-5d05-43c4-8253-847d91a54711","jobId":"2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0","userId":"39c7376e-2d5c-4601-bc47-6b60f505814d","status":"open","externalId":null,"resume":null,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":null,"createdAt":"2021-01-28T19:38:55.734Z","updatedAt":"2021-03-30T19:11:05.043Z"},{"id":"85d6649e-2682-4904-9480-a77b72fef27d","jobId":"2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0","userId":"213d2dd9-1fc3-4eda-ad97-2d56e2a84a1e","status":"selected","externalId":null,"resume":null,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":"00000000-0000-0000-0000-000000000000","createdAt":"2021-01-28T19:38:30.856Z","updatedAt":"2021-01-28T19:40:27.209Z"},{"id":"922dfce3-4e06-4387-9fdb-64f70675e86b","jobId":"2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0","userId":"dd5adacb-444d-4992-8b7b-0c349be598db","status":"selected","externalId":null,"resume":null,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":"00000000-0000-0000-0000-000000000000","createdAt":"2021-01-28T19:39:02.435Z","updatedAt":"2021-01-28T19:40:49.349Z"},{"id":"c26c38e2-a47d-405b-abc6-fe62a739561c","jobId":"2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0","userId":"6d0509c7-5f12-4d84-9a19-8e80ef7ddd66","status":"selected","externalId":null,"resume":null,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":"00000000-0000-0000-0000-000000000000","createdAt":"2021-01-28T19:39:08.233Z","updatedAt":"2021-01-28T19:40:53.659Z"},{"id":"7bef2b37-e1ee-4638-bfc1-c911787ac955","jobId":"2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0","userId":"f65e2104-2987-4136-839d-ee4632f0b2e5","status":"selected","externalId":null,"resume":null,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":"00000000-0000-0000-0000-000000000000","createdAt":"2021-01-28T19:39:13.469Z","updatedAt":"2021-01-28T19:40:57.999Z"},{"id":"e9716139-1f40-4bf1-9f8a-77ae4bcc621e","jobId":"2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0","userId":"e5e667ad-0950-43c2-8d1d-6e83ad7d1c7e","status":"selected","externalId":null,"resume":null,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":"00000000-0000-0000-0000-000000000000","createdAt":"2021-01-28T19:39:19.215Z","updatedAt":"2021-01-28T19:41:01.953Z"},{"id":"a1731d01-eac9-4eff-8e5a-8a3c99bc66e0","jobId":"2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0","userId":"bef43122-426b-4b2b-acdd-9b5b3bd1c0bf","status":"selected","externalId":null,"resume":null,"createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":"00000000-0000-0000-0000-000000000000","createdAt":"2021-01-28T19:39:24.625Z","updatedAt":"2021-01-28T19:41:06.370Z"}],"ResourceBooking":[{"id":"08f5e4b9-1088-496d-91a7-5b22a3583e3c","projectId":111,"userId":"213d2dd9-1fc3-4eda-ad97-2d56e2a84a1e","jobId":"2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0","status":"assigned","startDate":"2021-01-25T19:39:28.000Z","endDate":"2021-01-31T19:39:28.000Z","memberRate":1000,"customerRate":1200,"rateType":"weekly","createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","createdAt":"2021-01-28T19:39:30.052Z","updatedAt":"2021-01-28T19:40:25.260Z"},{"id":"7d967fed-9792-4768-98a7-0b644aa84f2e","projectId":111,"userId":"05e988b7-7d54-4c10-ada1-1a04870a88a8","jobId":"2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0","status":"in-review","startDate":"2021-03-25T19:39:34.000Z","endDate":"2021-05-31T19:39:34.000Z","memberRate":1000,"customerRate":1200,"rateType":"weekly","createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","createdAt":"2021-01-28T19:39:35.571Z","updatedAt":"2021-01-28T19:40:30.291Z"},{"id":"0a6799d7-f5d1-456b-8bf1-90619284b295","projectId":111,"userId":"6d0509c7-5f12-4d84-9a19-8e80ef7ddd66","jobId":"2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0","status":"assigned","startDate":"2021-02-27T08:40:03.000Z","endDate":"2021-03-15T09:40:03.000Z","memberRate":2000,"customerRate":2500,"rateType":"weekly","createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","createdAt":"2021-01-28T19:40:04.761Z","updatedAt":"2021-01-28T19:40:52.303Z"},{"id":"35e1abd8-1890-4664-bb52-aade382d7b66","projectId":111,"userId":"a2ffdeed-704d-4cf7-b70a-93fcf61de598","jobId":"2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0","status":"closed","startDate":"2021-02-25T13:39:39.000Z","endDate":"2021-04-01T05:39:39.000Z","memberRate":1000,"customerRate":1200,"rateType":"weekly","createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","createdAt":"2021-01-28T19:39:41.205Z","updatedAt":"2021-01-28T19:40:34.859Z"},{"id":"51b45f5d-5df2-46d5-9c3d-8a1323df38dd","projectId":111,"userId":"dd5adacb-444d-4992-8b7b-0c349be598db","jobId":"2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0","status":"assigned","startDate":"2021-03-18T04:39:58.000Z","endDate":"2021-05-28T09:39:58.000Z","memberRate":800,"customerRate":1000,"rateType":"weekly","createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","createdAt":"2021-01-28T19:39:59.432Z","updatedAt":"2021-01-28T19:40:47.743Z"},{"id":"61f5d474-e41f-490b-ab58-9f983e3d4916","projectId":111,"userId":"f65e2104-2987-4136-839d-ee4632f0b2e5","jobId":"2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0","status":"assigned","startDate":"2000-03-27T11:17:23.000Z","endDate":"2000-04-27T22:17:23.000Z","memberRate":3000,"customerRate":3500,"rateType":"weekly","createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","createdAt":"2021-01-28T19:40:09.879Z","updatedAt":"2021-01-28T19:40:56.381Z"},{"id":"8173579e-4b3c-418d-a9a1-c999caa38404","projectId":111,"userId":"bef43122-426b-4b2b-acdd-9b5b3bd1c0bf","jobId":"2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0","status":"assigned","startDate":"2020-04-27T14:17:23.000Z","endDate":"2020-05-27T04:17:23.000Z","memberRate":0,"customerRate":0,"rateType":"weekly","createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","createdAt":"2021-01-28T19:40:20.627Z","updatedAt":"2021-01-28T19:41:04.919Z"},{"id":"a098e8d8-ce5b-47d9-afee-38b050d16745","projectId":111,"userId":"4709473d-f060-4102-87f8-4d51ff0b34c1","jobId":"2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0","status":"cancelled","startDate":"2021-04-25T20:39:45.000Z","endDate":"2021-04-30T21:39:45.000Z","memberRate":1000,"customerRate":1200,"rateType":"weekly","createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","createdAt":"2021-01-28T19:39:46.515Z","updatedAt":"2021-01-28T19:40:38.820Z"},{"id":"d38a6223-3f91-4300-9ecb-6e5fee173625","projectId":111,"userId":"39c7376e-2d5c-4601-bc47-6b60f505814d","jobId":"2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0","status":"sourcing","startDate":"2021-05-25T16:39:50.000Z","endDate":"2021-07-31T17:39:50.000Z","memberRate":1000,"customerRate":1200,"rateType":"weekly","createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","createdAt":"2021-01-28T19:39:52.063Z","updatedAt":"2021-01-28T19:40:43.021Z"},{"id":"dc4477ec-07f8-4c8e-a8fe-ffe38dd290fa","projectId":111,"userId":"e5e667ad-0950-43c2-8d1d-6e83ad7d1c7e","jobId":"2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0","status":"assigned","startDate":"2021-07-27T08:17:23.131Z","endDate":"2021-09-27T02:17:23.000Z","memberRate":1700,"customerRate":1900,"rateType":"weekly","createdBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","updatedBy":"57646ff9-1cd3-4d3c-88ba-eb09a395366c","createdAt":"2021-01-28T19:40:15.326Z","updatedAt":"2021-01-28T19:41:00.503Z"}],"WorkPeriod":[{"id":"db3ac57b-8e78-4b68-a0f7-4e928f3059af","resourceBookingId":"08f5e4b9-1088-496d-91a7-5b22a3583e3c","userHandle":"ritesh_cs","projectId":111,"startDate":"2021-01-24","endDate":"2021-01-30","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.105Z","updatedAt":null},{"id":"a6c83e0d-de12-42f2-b689-85ad56470941","resourceBookingId":"08f5e4b9-1088-496d-91a7-5b22a3583e3c","userHandle":"ritesh_cs","projectId":111,"startDate":"2021-01-31","endDate":"2021-02-06","daysWorked":0,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.105Z","updatedAt":null},{"id":"5342924e-a1ed-4164-a885-7ebb87215aa5","resourceBookingId":"8173579e-4b3c-418d-a9a1-c999caa38404","userHandle":"testcat","projectId":111,"startDate":"2020-04-26","endDate":"2020-05-02","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.117Z","updatedAt":null},{"id":"b8390807-8ea7-4824-9f17-4500f46f893c","resourceBookingId":"8173579e-4b3c-418d-a9a1-c999caa38404","userHandle":"testcat","projectId":111,"startDate":"2020-05-03","endDate":"2020-05-09","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.117Z","updatedAt":null},{"id":"da056ecd-6660-4fd8-aba4-acc7ec089926","resourceBookingId":"8173579e-4b3c-418d-a9a1-c999caa38404","userHandle":"testcat","projectId":111,"startDate":"2020-05-10","endDate":"2020-05-16","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.117Z","updatedAt":null},{"id":"2cd7a726-9909-4764-9f24-8d9a8f3d011a","resourceBookingId":"8173579e-4b3c-418d-a9a1-c999caa38404","userHandle":"testcat","projectId":111,"startDate":"2020-05-24","endDate":"2020-05-30","daysWorked":3,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.117Z","updatedAt":null},{"id":"7f646975-f984-4967-8788-f10c8db86b25","resourceBookingId":"d38a6223-3f91-4300-9ecb-6e5fee173625","userHandle":"nithyaasworld","projectId":111,"startDate":"2021-05-23","endDate":"2021-05-29","daysWorked":4,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.120Z","updatedAt":null},{"id":"459e0127-7f1b-41f6-9d62-d354ed537779","resourceBookingId":"d38a6223-3f91-4300-9ecb-6e5fee173625","userHandle":"nithyaasworld","projectId":111,"startDate":"2021-05-30","endDate":"2021-06-05","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.120Z","updatedAt":null},{"id":"42f757a6-7bb3-48c2-a6cb-455d27a8821b","resourceBookingId":"d38a6223-3f91-4300-9ecb-6e5fee173625","userHandle":"nithyaasworld","projectId":111,"startDate":"2021-06-06","endDate":"2021-06-12","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.120Z","updatedAt":null},{"id":"c17d9081-c442-4d55-be58-65916662653e","resourceBookingId":"d38a6223-3f91-4300-9ecb-6e5fee173625","userHandle":"nithyaasworld","projectId":111,"startDate":"2021-06-20","endDate":"2021-06-26","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.120Z","updatedAt":null},{"id":"6768d502-5510-49d0-873f-346390ccf14d","resourceBookingId":"d38a6223-3f91-4300-9ecb-6e5fee173625","userHandle":"nithyaasworld","projectId":111,"startDate":"2021-06-27","endDate":"2021-07-03","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.120Z","updatedAt":null},{"id":"7808d9ac-3c93-4c3f-ad35-12a0a45d51c6","resourceBookingId":"d38a6223-3f91-4300-9ecb-6e5fee173625","userHandle":"nithyaasworld","projectId":111,"startDate":"2021-07-04","endDate":"2021-07-10","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.120Z","updatedAt":null},{"id":"724815e6-5a66-44c7-8dd6-7a5005ec4367","resourceBookingId":"d38a6223-3f91-4300-9ecb-6e5fee173625","userHandle":"nithyaasworld","projectId":111,"startDate":"2021-07-11","endDate":"2021-07-17","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.120Z","updatedAt":null},{"id":"57210895-2e2a-46f1-a0cc-05af4c30b188","resourceBookingId":"d38a6223-3f91-4300-9ecb-6e5fee173625","userHandle":"nithyaasworld","projectId":111,"startDate":"2021-07-25","endDate":"2021-07-31","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.120Z","updatedAt":null},{"id":"3534343e-5b06-4299-b657-11b3b5175dce","resourceBookingId":"7d967fed-9792-4768-98a7-0b644aa84f2e","userHandle":"sachin-wipro","projectId":111,"startDate":"2021-03-21","endDate":"2021-03-27","daysWorked":2,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.122Z","updatedAt":null},{"id":"50788ef6-73d9-455c-a5ea-44028d7b3bf2","resourceBookingId":"7d967fed-9792-4768-98a7-0b644aa84f2e","userHandle":"sachin-wipro","projectId":111,"startDate":"2021-03-28","endDate":"2021-04-03","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.122Z","updatedAt":null},{"id":"2b2df620-fd88-4233-a0b8-242e0bb6ecb7","resourceBookingId":"7d967fed-9792-4768-98a7-0b644aa84f2e","userHandle":"sachin-wipro","projectId":111,"startDate":"2021-04-04","endDate":"2021-04-10","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.122Z","updatedAt":null},{"id":"970a2bbc-c5b7-4be5-ae63-3d9009ccf83b","resourceBookingId":"7d967fed-9792-4768-98a7-0b644aa84f2e","userHandle":"sachin-wipro","projectId":111,"startDate":"2021-04-11","endDate":"2021-04-17","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.122Z","updatedAt":null},{"id":"c3b83d2b-f27b-4e4d-8f87-9f324f80a9bc","resourceBookingId":"7d967fed-9792-4768-98a7-0b644aa84f2e","userHandle":"sachin-wipro","projectId":111,"startDate":"2021-04-25","endDate":"2021-05-01","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.122Z","updatedAt":null},{"id":"8dd12749-ef1d-4295-b050-8c3ecee1f846","resourceBookingId":"7d967fed-9792-4768-98a7-0b644aa84f2e","userHandle":"sachin-wipro","projectId":111,"startDate":"2021-05-09","endDate":"2021-05-15","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.122Z","updatedAt":null},{"id":"db0d8eab-13b0-4fd6-98fd-d2a82cd566ad","resourceBookingId":"7d967fed-9792-4768-98a7-0b644aa84f2e","userHandle":"sachin-wipro","projectId":111,"startDate":"2021-05-02","endDate":"2021-05-08","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"completed","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.122Z","updatedAt":null},{"id":"278bc7a0-a242-41a4-9d00-086f5d48d5da","resourceBookingId":"7d967fed-9792-4768-98a7-0b644aa84f2e","userHandle":"sachin-wipro","projectId":111,"startDate":"2021-04-18","endDate":"2021-04-24","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"cancelled","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.122Z","updatedAt":null},{"id":"0679b699-520b-4f8b-8eb6-a6aa53ec473c","resourceBookingId":"8173579e-4b3c-418d-a9a1-c999caa38404","userHandle":"testcat","projectId":111,"startDate":"2020-05-17","endDate":"2020-05-23","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"completed","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.117Z","updatedAt":null},{"id":"c73aa1a0-cb32-4301-af96-5b33bdbda20f","resourceBookingId":"d38a6223-3f91-4300-9ecb-6e5fee173625","userHandle":"nithyaasworld","projectId":111,"startDate":"2021-06-13","endDate":"2021-06-19","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"partially-completed","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.120Z","updatedAt":null},{"id":"5b0eefe1-e45d-4150-b14e-a83ce19599eb","resourceBookingId":"d38a6223-3f91-4300-9ecb-6e5fee173625","userHandle":"nithyaasworld","projectId":111,"startDate":"2021-07-18","endDate":"2021-07-24","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"partially-completed","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.120Z","updatedAt":null},{"id":"651a97b2-8019-49b7-9a8e-4c384c0615b7","resourceBookingId":"7d967fed-9792-4768-98a7-0b644aa84f2e","userHandle":"sachin-wipro","projectId":111,"startDate":"2021-05-16","endDate":"2021-05-22","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.122Z","updatedAt":null},{"id":"fcdedc90-7c76-47ed-bb95-fb05ec3cd53a","resourceBookingId":"7d967fed-9792-4768-98a7-0b644aa84f2e","userHandle":"sachin-wipro","projectId":111,"startDate":"2021-05-23","endDate":"2021-05-29","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.122Z","updatedAt":null},{"id":"0b65d948-0232-4f32-a455-b480da63320d","resourceBookingId":"7d967fed-9792-4768-98a7-0b644aa84f2e","userHandle":"sachin-wipro","projectId":111,"startDate":"2021-05-30","endDate":"2021-06-05","daysWorked":1,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.122Z","updatedAt":null},{"id":"1f106c81-7a0d-4fb1-9bf4-851d450709d8","resourceBookingId":"61f5d474-e41f-490b-ab58-9f983e3d4916","userHandle":"sonu628","projectId":111,"startDate":"2000-03-26","endDate":"2000-04-01","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.324Z","updatedAt":null},{"id":"84a9d3e9-ee3f-495b-98de-f9fe0f6a9371","resourceBookingId":"61f5d474-e41f-490b-ab58-9f983e3d4916","userHandle":"sonu628","projectId":111,"startDate":"2000-04-09","endDate":"2000-04-15","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.324Z","updatedAt":null},{"id":"5f9dce2b-9426-4287-b3ab-7507ff3a2671","resourceBookingId":"61f5d474-e41f-490b-ab58-9f983e3d4916","userHandle":"sonu628","projectId":111,"startDate":"2000-04-16","endDate":"2000-04-22","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.324Z","updatedAt":null},{"id":"724b2338-c5bb-46ec-8e99-2417929eeab9","resourceBookingId":"61f5d474-e41f-490b-ab58-9f983e3d4916","userHandle":"sonu628","projectId":111,"startDate":"2000-04-23","endDate":"2000-04-29","daysWorked":4,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.324Z","updatedAt":null},{"id":"10de7920-5e12-4284-b95f-08adc0ff1c17","resourceBookingId":"a098e8d8-ce5b-47d9-afee-38b050d16745","userHandle":"TCConnCopilot","projectId":111,"startDate":"2021-04-25","endDate":"2021-05-01","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.325Z","updatedAt":null},{"id":"c0fb6f01-7b71-471a-b85b-ea470d4dbd85","resourceBookingId":"35e1abd8-1890-4664-bb52-aade382d7b66","userHandle":"lakshmiaconnmgr","projectId":111,"startDate":"2021-02-21","endDate":"2021-02-27","daysWorked":2,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.326Z","updatedAt":null},{"id":"0a3df77a-7841-4256-bb2c-d7e0fa17dc3f","resourceBookingId":"35e1abd8-1890-4664-bb52-aade382d7b66","userHandle":"lakshmiaconnmgr","projectId":111,"startDate":"2021-02-28","endDate":"2021-03-06","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.326Z","updatedAt":null},{"id":"9e0d10c3-f4c8-4ba6-8c11-333d9cdab634","resourceBookingId":"35e1abd8-1890-4664-bb52-aade382d7b66","userHandle":"lakshmiaconnmgr","projectId":111,"startDate":"2021-03-14","endDate":"2021-03-20","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.326Z","updatedAt":null},{"id":"66d47a95-a4f8-43a5-bfe2-af8f5a2b64ac","resourceBookingId":"35e1abd8-1890-4664-bb52-aade382d7b66","userHandle":"lakshmiaconnmgr","projectId":111,"startDate":"2021-03-21","endDate":"2021-03-27","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.326Z","updatedAt":null},{"id":"c10cca56-b0c4-4e87-a64f-9a14d7445436","resourceBookingId":"51b45f5d-5df2-46d5-9c3d-8a1323df38dd","userHandle":"amy_admin","projectId":111,"startDate":"2021-03-21","endDate":"2021-03-27","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.361Z","updatedAt":null},{"id":"c8d38387-b4a2-49f8-bbba-2f10f50c99db","resourceBookingId":"51b45f5d-5df2-46d5-9c3d-8a1323df38dd","userHandle":"amy_admin","projectId":111,"startDate":"2021-03-28","endDate":"2021-04-03","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.361Z","updatedAt":null},{"id":"07dd0d62-e5cc-49a8-8b4c-966a2348095f","resourceBookingId":"51b45f5d-5df2-46d5-9c3d-8a1323df38dd","userHandle":"amy_admin","projectId":111,"startDate":"2021-04-04","endDate":"2021-04-10","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.361Z","updatedAt":null},{"id":"c3c4593a-2a06-4ee8-8cbb-5a3ffad8ad7d","resourceBookingId":"51b45f5d-5df2-46d5-9c3d-8a1323df38dd","userHandle":"amy_admin","projectId":111,"startDate":"2021-04-11","endDate":"2021-04-17","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.361Z","updatedAt":null},{"id":"9f117273-bb2f-48ab-bf3a-c13652483ea3","resourceBookingId":"51b45f5d-5df2-46d5-9c3d-8a1323df38dd","userHandle":"amy_admin","projectId":111,"startDate":"2021-04-18","endDate":"2021-04-24","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.361Z","updatedAt":null},{"id":"3a909050-444a-4a82-9961-d390212e86f5","resourceBookingId":"51b45f5d-5df2-46d5-9c3d-8a1323df38dd","userHandle":"amy_admin","projectId":111,"startDate":"2021-04-25","endDate":"2021-05-01","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.361Z","updatedAt":null},{"id":"b9a8ac04-5b06-4093-ac50-ce556d25b421","resourceBookingId":"51b45f5d-5df2-46d5-9c3d-8a1323df38dd","userHandle":"amy_admin","projectId":111,"startDate":"2021-05-02","endDate":"2021-05-08","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.361Z","updatedAt":null},{"id":"a2b708d1-e234-4573-b5ca-7dc36a20c0d7","resourceBookingId":"51b45f5d-5df2-46d5-9c3d-8a1323df38dd","userHandle":"amy_admin","projectId":111,"startDate":"2021-05-16","endDate":"2021-05-22","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.361Z","updatedAt":null},{"id":"768051e3-9765-498f-9b58-17c3377eced8","resourceBookingId":"51b45f5d-5df2-46d5-9c3d-8a1323df38dd","userHandle":"amy_admin","projectId":111,"startDate":"2021-05-23","endDate":"2021-05-29","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.361Z","updatedAt":null},{"id":"d94e0c2f-15de-4d07-a098-200daaa05f54","resourceBookingId":"dc4477ec-07f8-4c8e-a8fe-ffe38dd290fa","userHandle":"nskumar278","projectId":111,"startDate":"2021-07-25","endDate":"2021-07-31","daysWorked":4,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.390Z","updatedAt":null},{"id":"93910ea8-28ac-40a3-91b0-35eab59405da","resourceBookingId":"dc4477ec-07f8-4c8e-a8fe-ffe38dd290fa","userHandle":"nskumar278","projectId":111,"startDate":"2021-08-01","endDate":"2021-08-07","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.390Z","updatedAt":null},{"id":"33561804-7a27-4cff-9e57-c09c914bbf12","resourceBookingId":"dc4477ec-07f8-4c8e-a8fe-ffe38dd290fa","userHandle":"nskumar278","projectId":111,"startDate":"2021-08-15","endDate":"2021-08-21","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.390Z","updatedAt":null},{"id":"2e874752-81e1-451d-b5c9-7455135daee9","resourceBookingId":"dc4477ec-07f8-4c8e-a8fe-ffe38dd290fa","userHandle":"nskumar278","projectId":111,"startDate":"2021-08-22","endDate":"2021-08-28","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.390Z","updatedAt":null},{"id":"3313e61b-8733-496e-9c79-9b1e3ff5e074","resourceBookingId":"dc4477ec-07f8-4c8e-a8fe-ffe38dd290fa","userHandle":"nskumar278","projectId":111,"startDate":"2021-09-12","endDate":"2021-09-18","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.390Z","updatedAt":null},{"id":"8019e0c4-201a-469f-901b-8e84f43f577b","resourceBookingId":"dc4477ec-07f8-4c8e-a8fe-ffe38dd290fa","userHandle":"nskumar278","projectId":111,"startDate":"2021-09-19","endDate":"2021-09-25","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.390Z","updatedAt":null},{"id":"2b660631-fbd0-47fb-9ab4-f4e809650e44","resourceBookingId":"dc4477ec-07f8-4c8e-a8fe-ffe38dd290fa","userHandle":"nskumar278","projectId":111,"startDate":"2021-09-26","endDate":"2021-10-02","daysWorked":0,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.390Z","updatedAt":null},{"id":"f93b73e0-25eb-4c67-a6f0-1b658186ae29","resourceBookingId":"0a6799d7-f5d1-456b-8bf1-90619284b295","userHandle":"aaaa","projectId":111,"startDate":"2021-02-21","endDate":"2021-02-27","daysWorked":0,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.523Z","updatedAt":null},{"id":"e2d7651c-b8b6-453a-b472-478fe679a22f","resourceBookingId":"0a6799d7-f5d1-456b-8bf1-90619284b295","userHandle":"aaaa","projectId":111,"startDate":"2021-02-28","endDate":"2021-03-06","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.523Z","updatedAt":null},{"id":"0ed89458-ab82-485e-9727-858e7c25d477","resourceBookingId":"0a6799d7-f5d1-456b-8bf1-90619284b295","userHandle":"aaaa","projectId":111,"startDate":"2021-03-14","endDate":"2021-03-20","daysWorked":1,"memberRate":null,"customerRate":null,"paymentStatus":"pending","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.523Z","updatedAt":null},{"id":"c1de1dd6-64b9-4dc6-b463-48c280a01465","resourceBookingId":"0a6799d7-f5d1-456b-8bf1-90619284b295","userHandle":"aaaa","projectId":111,"startDate":"2021-03-07","endDate":"2021-03-13","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"completed","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.523Z","updatedAt":null},{"id":"4b5ce032-7c8d-423a-bec3-f469cb869088","resourceBookingId":"35e1abd8-1890-4664-bb52-aade382d7b66","userHandle":"lakshmiaconnmgr","projectId":111,"startDate":"2021-03-28","endDate":"2021-04-03","daysWorked":4,"memberRate":null,"customerRate":null,"paymentStatus":"partially-completed","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.326Z","updatedAt":null},{"id":"1b5e7460-c197-4f38-8f53-80e651ee32fe","resourceBookingId":"35e1abd8-1890-4664-bb52-aade382d7b66","userHandle":"lakshmiaconnmgr","projectId":111,"startDate":"2021-03-07","endDate":"2021-03-13","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"cancelled","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.326Z","updatedAt":null},{"id":"6aae6de0-0f64-4af6-a4a4-a9920cf873fa","resourceBookingId":"51b45f5d-5df2-46d5-9c3d-8a1323df38dd","userHandle":"amy_admin","projectId":111,"startDate":"2021-03-14","endDate":"2021-03-20","daysWorked":2,"memberRate":null,"customerRate":null,"paymentStatus":"completed","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.361Z","updatedAt":null},{"id":"87f41144-95d3-427d-b5bf-161250a6b9e4","resourceBookingId":"51b45f5d-5df2-46d5-9c3d-8a1323df38dd","userHandle":"amy_admin","projectId":111,"startDate":"2021-05-09","endDate":"2021-05-15","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"completed","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.361Z","updatedAt":null},{"id":"06fda3ca-e583-4466-baeb-70dac8952151","resourceBookingId":"61f5d474-e41f-490b-ab58-9f983e3d4916","userHandle":"sonu628","projectId":111,"startDate":"2000-04-02","endDate":"2000-04-08","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"partially-completed","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.324Z","updatedAt":null},{"id":"2530239e-fcd7-43a1-81ca-1df38e8744fc","resourceBookingId":"dc4477ec-07f8-4c8e-a8fe-ffe38dd290fa","userHandle":"nskumar278","projectId":111,"startDate":"2021-08-29","endDate":"2021-09-04","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"completed","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.390Z","updatedAt":null},{"id":"7f58f304-800f-4304-9aa1-21c7c5aad882","resourceBookingId":"dc4477ec-07f8-4c8e-a8fe-ffe38dd290fa","userHandle":"nskumar278","projectId":111,"startDate":"2021-09-05","endDate":"2021-09-11","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"cancelled","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.390Z","updatedAt":null},{"id":"08b5fc47-0e40-48d5-be46-24ecfd9031b5","resourceBookingId":"dc4477ec-07f8-4c8e-a8fe-ffe38dd290fa","userHandle":"nskumar278","projectId":111,"startDate":"2021-08-08","endDate":"2021-08-14","daysWorked":5,"memberRate":null,"customerRate":null,"paymentStatus":"completed","createdBy":"00000000-0000-0000-0000-000000000000","updatedBy":null,"createdAt":"2021-04-14T22:01:45.390Z","updatedAt":null}]} \ No newline at end of file +{ + "Job": [ + { + "id": "b9887564-3d3d-4c70-8a7b-552576ef2e8d", + "projectId": 111, + "externalId": "0", + "description": "taas-demo-job1", + "title": "Demo Title", + "startDate": "2020-09-27T04:17:23.131Z", + "duration": null, + "numPositions": 13, + "resourceType": "Dummy Resource Type", + "rateType": "weekly", + "workload": "full-time", + "skills": [ + "ee4c50c1-c8c3-475e-b6b6-edbd136a19d6", + "89139c80-d0a2-47c2-aa16-14589d5afd10", + "9f2d9127-6a2e-4506-ad76-c4ab63577b09", + "9515e7ee-83b6-49d1-ba5c-6c59c5a8ef1b", + "c854ab55-5922-4be1-8ecc-b3bc1f8629af", + "8456002e-fa2d-44f0-b0e7-86b1c02b6e4c", + "114b4ec8-805e-4c60-b351-14a955a991a9", + "213408aa-f16f-46c8-bc57-9e569cee3f11", + "b37a48db-f775-4e4e-b403-8ad1d234cdea", + "99b930b5-1b91-4df1-8b17-d9307107bb51", + "6388a632-c3ad-4525-9a73-66a527c03672", + "23839f38-6f19-4de9-9d28-f020056bca73", + "289e42a3-23e9-49be-88e1-6deb93cd8c31", + "b403f209-63b5-42bc-9b5f-1564416640d8" + ], + "status": "sourcing", + "isApplicationPageActive": false, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-01-28T19:36:33.409Z", + "updatedAt": "2021-03-30T19:11:05.033Z" + }, + { + "id": "a5b3bf94-a8bf-4c7e-b685-70a29a4d7d6e", + "projectId": 111, + "externalId": "0", + "description": "taas-demo-job2", + "title": "Dummy title - at most 64 characters", + "startDate": "2020-09-27T04:17:23.131Z", + "duration": null, + "numPositions": 7, + "resourceType": "Dummy Resource Type", + "rateType": "weekly", + "workload": "full-time", + "skills": [ + "213408aa-f16f-46c8-bc57-9e569cee3f11", + "b37a48db-f775-4e4e-b403-8ad1d234cdea", + "99b930b5-1b91-4df1-8b17-d9307107bb51", + "6388a632-c3ad-4525-9a73-66a527c03672", + "23839f38-6f19-4de9-9d28-f020056bca73", + "289e42a3-23e9-49be-88e1-6deb93cd8c31", + "b403f209-63b5-42bc-9b5f-1564416640d8" + ], + "status": "in-review", + "isApplicationPageActive": false, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "createdAt": "2021-01-28T19:36:44.975Z", + "updatedAt": "2021-01-28T19:38:17.463Z" + }, + { + "id": "2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0", + "projectId": 111, + "externalId": "0", + "description": "taas-demo-job3", + "title": "Dummy title - at most 64 characters", + "startDate": "2020-09-27T04:17:23.131Z", + "duration": null, + "numPositions": 7, + "resourceType": "Dummy Resource Type", + "rateType": "weekly", + "workload": "full-time", + "skills": [], + "status": "assigned", + "isApplicationPageActive": false, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "createdAt": "2021-01-28T19:38:23.739Z", + "updatedAt": "2021-01-28T19:41:10.607Z" + }, + { + "id": "84b73f90-0fef-4507-887a-074578e5ef38", + "projectId": 111, + "externalId": "0", + "description": "taas-demo-job4", + "title": "Dummy title - at most 64 characters", + "startDate": "2020-09-27T04:17:23.131Z", + "duration": null, + "numPositions": 7, + "resourceType": "Dummy Resource Type", + "rateType": "weekly", + "workload": "full-time", + "skills": [ + "8456002e-fa2d-44f0-b0e7-86b1c02b6e4c", + "114b4ec8-805e-4c60-b351-14a955a991a9", + "213408aa-f16f-46c8-bc57-9e569cee3f11", + "b37a48db-f775-4e4e-b403-8ad1d234cdea", + "99b930b5-1b91-4df1-8b17-d9307107bb51", + "6388a632-c3ad-4525-9a73-66a527c03672" + ], + "status": "closed", + "isApplicationPageActive": false, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "createdAt": "2021-01-28T19:41:21.892Z", + "updatedAt": "2021-01-28T19:41:28.849Z" + }, + { + "id": "62399aa0-b088-41fe-9e9b-0c8071f1934f", + "projectId": 111, + "externalId": "0", + "description": "taas-demo-job5", + "title": "Dummy title - at most 64 characters", + "startDate": "2020-09-27T04:17:23.131Z", + "duration": null, + "numPositions": 7, + "resourceType": "Dummy Resource Type", + "rateType": "weekly", + "workload": "full-time", + "skills": [ + "b37a48db-f775-4e4e-b403-8ad1d234cdea", + "99b930b5-1b91-4df1-8b17-d9307107bb51", + "6388a632-c3ad-4525-9a73-66a527c03672" + ], + "status": "cancelled", + "isApplicationPageActive": false, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "createdAt": "2021-01-28T19:41:35.098Z", + "updatedAt": "2021-01-28T19:41:42.124Z" + } + ], + "JobCandidate": [ + { + "id": "debadcd8-64bf-4ab8-9cdb-297479eef6f5", + "jobId": "a5b3bf94-a8bf-4c7e-b685-70a29a4d7d6e", + "userId": "4dfc6090-4ba8-4387-b5c4-584fcef982ba", + "status": "open", + "externalId": null, + "resume": null, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-01-28T19:37:05.723Z", + "updatedAt": "2021-03-30T19:11:05.043Z" + }, + { + "id": "7ff45b8f-2b71-4510-b760-8dfa62e79504", + "jobId": "a5b3bf94-a8bf-4c7e-b685-70a29a4d7d6e", + "userId": "243517dd-77d7-4f70-8951-0bc66da83076", + "status": "open", + "externalId": null, + "resume": null, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-01-28T19:37:11.598Z", + "updatedAt": "2021-03-30T19:11:05.043Z" + }, + { + "id": "91d63d5f-01d5-419e-89df-6117ea92f535", + "jobId": "a5b3bf94-a8bf-4c7e-b685-70a29a4d7d6e", + "userId": "a2e28bf4-1147-41a6-a39f-e2509306f2a6", + "status": "open", + "externalId": null, + "resume": null, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-01-28T19:37:18.066Z", + "updatedAt": "2021-03-30T19:11:05.043Z" + }, + { + "id": "257f98d9-45f7-4e13-a6c2-d7e7b6efc9fe", + "jobId": "a5b3bf94-a8bf-4c7e-b685-70a29a4d7d6e", + "userId": "b8649393-d32f-4b7f-a156-12e9776acb0e", + "status": "open", + "externalId": null, + "resume": null, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-01-28T19:37:24.095Z", + "updatedAt": "2021-03-30T19:11:05.043Z" + }, + { + "id": "a01852d0-fa08-410c-b97b-67580ce62215", + "jobId": "a5b3bf94-a8bf-4c7e-b685-70a29a4d7d6e", + "userId": "a0a3a5ce-1de6-465d-91b2-518feb299851", + "status": "open", + "externalId": null, + "resume": null, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-01-28T19:37:29.734Z", + "updatedAt": "2021-03-30T19:11:05.043Z" + }, + { + "id": "2fd7ca69-c8ec-4bf3-a7f3-655fbfe3e7df", + "jobId": "a5b3bf94-a8bf-4c7e-b685-70a29a4d7d6e", + "userId": "e6958d77-ffaf-4d24-9cdb-6391506695a4", + "status": "open", + "externalId": null, + "resume": null, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-01-28T19:37:44.728Z", + "updatedAt": "2021-03-30T19:11:05.043Z" + }, + { + "id": "f0023058-2996-4bba-8c5f-d09a7023be38", + "jobId": "a5b3bf94-a8bf-4c7e-b685-70a29a4d7d6e", + "userId": "626bb327-e738-48e3-8f67-1fa2dc677d3c", + "status": "open", + "externalId": null, + "resume": null, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-01-28T19:37:50.619Z", + "updatedAt": "2021-03-30T19:11:05.043Z" + }, + { + "id": "a189b34d-acde-4633-b18b-f7a34d7c5a74", + "jobId": "a5b3bf94-a8bf-4c7e-b685-70a29a4d7d6e", + "userId": "b49a0adb-1565-4de1-9189-a763c77f5ed4", + "status": "open", + "externalId": null, + "resume": null, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-01-28T19:37:56.456Z", + "updatedAt": "2021-03-30T19:11:05.043Z" + }, + { + "id": "5191a860-4327-4c50-b76b-84beba04519b", + "jobId": "a5b3bf94-a8bf-4c7e-b685-70a29a4d7d6e", + "userId": "79ce2a3e-7679-48cf-8ac9-0a8ca4c4b463", + "status": "shortlist", + "externalId": null, + "resume": null, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "createdAt": "2021-01-28T19:36:51.222Z", + "updatedAt": "2021-01-28T19:38:02.293Z" + }, + { + "id": "e6d9635c-b122-4f69-9285-09fb1ab30106", + "jobId": "a5b3bf94-a8bf-4c7e-b685-70a29a4d7d6e", + "userId": "98ec2c16-442e-4b61-8ad1-66123ee37d3c", + "status": "rejected", + "externalId": null, + "resume": null, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "createdAt": "2021-01-28T19:36:58.774Z", + "updatedAt": "2021-01-28T19:38:13.553Z" + }, + { + "id": "f67b155e-0f09-4fdd-89a7-d79c5e46cac6", + "jobId": "2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0", + "userId": "05e988b7-7d54-4c10-ada1-1a04870a88a8", + "status": "open", + "externalId": null, + "resume": null, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-01-28T19:38:38.332Z", + "updatedAt": "2021-03-30T19:11:05.043Z" + }, + { + "id": "8ffd33d3-4a43-4719-aee4-8e46be1d8f1c", + "jobId": "2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0", + "userId": "a2ffdeed-704d-4cf7-b70a-93fcf61de598", + "status": "open", + "externalId": null, + "resume": null, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-01-28T19:38:43.967Z", + "updatedAt": "2021-03-30T19:11:05.043Z" + }, + { + "id": "2b8ba549-8878-43d6-ad5f-6a66e3b9d6c9", + "jobId": "2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0", + "userId": "4709473d-f060-4102-87f8-4d51ff0b34c1", + "status": "open", + "externalId": null, + "resume": null, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-01-28T19:38:50.106Z", + "updatedAt": "2021-03-30T19:11:05.043Z" + }, + { + "id": "ae5a81ec-5d05-43c4-8253-847d91a54711", + "jobId": "2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0", + "userId": "39c7376e-2d5c-4601-bc47-6b60f505814d", + "status": "open", + "externalId": null, + "resume": null, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-01-28T19:38:55.734Z", + "updatedAt": "2021-03-30T19:11:05.043Z" + }, + { + "id": "85d6649e-2682-4904-9480-a77b72fef27d", + "jobId": "2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0", + "userId": "213d2dd9-1fc3-4eda-ad97-2d56e2a84a1e", + "status": "selected", + "externalId": null, + "resume": null, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "00000000-0000-0000-0000-000000000000", + "createdAt": "2021-01-28T19:38:30.856Z", + "updatedAt": "2021-01-28T19:40:27.209Z" + }, + { + "id": "922dfce3-4e06-4387-9fdb-64f70675e86b", + "jobId": "2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0", + "userId": "dd5adacb-444d-4992-8b7b-0c349be598db", + "status": "selected", + "externalId": null, + "resume": null, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "00000000-0000-0000-0000-000000000000", + "createdAt": "2021-01-28T19:39:02.435Z", + "updatedAt": "2021-01-28T19:40:49.349Z" + }, + { + "id": "c26c38e2-a47d-405b-abc6-fe62a739561c", + "jobId": "2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0", + "userId": "6d0509c7-5f12-4d84-9a19-8e80ef7ddd66", + "status": "selected", + "externalId": null, + "resume": null, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "00000000-0000-0000-0000-000000000000", + "createdAt": "2021-01-28T19:39:08.233Z", + "updatedAt": "2021-01-28T19:40:53.659Z" + }, + { + "id": "7bef2b37-e1ee-4638-bfc1-c911787ac955", + "jobId": "2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0", + "userId": "f65e2104-2987-4136-839d-ee4632f0b2e5", + "status": "selected", + "externalId": null, + "resume": null, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "00000000-0000-0000-0000-000000000000", + "createdAt": "2021-01-28T19:39:13.469Z", + "updatedAt": "2021-01-28T19:40:57.999Z" + }, + { + "id": "e9716139-1f40-4bf1-9f8a-77ae4bcc621e", + "jobId": "2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0", + "userId": "e5e667ad-0950-43c2-8d1d-6e83ad7d1c7e", + "status": "selected", + "externalId": null, + "resume": null, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "00000000-0000-0000-0000-000000000000", + "createdAt": "2021-01-28T19:39:19.215Z", + "updatedAt": "2021-01-28T19:41:01.953Z" + }, + { + "id": "a1731d01-eac9-4eff-8e5a-8a3c99bc66e0", + "jobId": "2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0", + "userId": "bef43122-426b-4b2b-acdd-9b5b3bd1c0bf", + "status": "selected", + "externalId": null, + "resume": null, + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "00000000-0000-0000-0000-000000000000", + "createdAt": "2021-01-28T19:39:24.625Z", + "updatedAt": "2021-01-28T19:41:06.370Z" + } + ], + "ResourceBooking": [ + { + "id": "08f5e4b9-1088-496d-91a7-5b22a3583e3c", + "projectId": 111, + "userId": "213d2dd9-1fc3-4eda-ad97-2d56e2a84a1e", + "jobId": "2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0", + "status": "assigned", + "startDate": "2021-01-25T19:39:28.000Z", + "endDate": "2021-01-31T19:39:28.000Z", + "memberRate": 1000, + "customerRate": 1200, + "rateType": "weekly", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "createdAt": "2021-01-28T19:39:30.052Z", + "updatedAt": "2021-01-28T19:40:25.260Z" + }, + { + "id": "7d967fed-9792-4768-98a7-0b644aa84f2e", + "projectId": 111, + "userId": "05e988b7-7d54-4c10-ada1-1a04870a88a8", + "jobId": "2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0", + "status": "in-review", + "startDate": "2021-03-25T19:39:34.000Z", + "endDate": "2021-05-31T19:39:34.000Z", + "memberRate": 1000, + "customerRate": 1200, + "rateType": "weekly", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "createdAt": "2021-01-28T19:39:35.571Z", + "updatedAt": "2021-01-28T19:40:30.291Z" + }, + { + "id": "0a6799d7-f5d1-456b-8bf1-90619284b295", + "projectId": 111, + "userId": "6d0509c7-5f12-4d84-9a19-8e80ef7ddd66", + "jobId": "2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0", + "status": "assigned", + "startDate": "2021-02-27T08:40:03.000Z", + "endDate": "2021-03-15T09:40:03.000Z", + "memberRate": 2000, + "customerRate": 2500, + "rateType": "weekly", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "createdAt": "2021-01-28T19:40:04.761Z", + "updatedAt": "2021-01-28T19:40:52.303Z" + }, + { + "id": "35e1abd8-1890-4664-bb52-aade382d7b66", + "projectId": 111, + "userId": "a2ffdeed-704d-4cf7-b70a-93fcf61de598", + "jobId": "2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0", + "status": "closed", + "startDate": "2021-02-25T13:39:39.000Z", + "endDate": "2021-04-01T05:39:39.000Z", + "memberRate": 1000, + "customerRate": 1200, + "rateType": "weekly", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "createdAt": "2021-01-28T19:39:41.205Z", + "updatedAt": "2021-01-28T19:40:34.859Z" + }, + { + "id": "51b45f5d-5df2-46d5-9c3d-8a1323df38dd", + "projectId": 111, + "userId": "dd5adacb-444d-4992-8b7b-0c349be598db", + "jobId": "2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0", + "status": "assigned", + "startDate": "2021-03-18T04:39:58.000Z", + "endDate": "2021-05-28T09:39:58.000Z", + "memberRate": 800, + "customerRate": 1000, + "rateType": "weekly", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "createdAt": "2021-01-28T19:39:59.432Z", + "updatedAt": "2021-01-28T19:40:47.743Z" + }, + { + "id": "61f5d474-e41f-490b-ab58-9f983e3d4916", + "projectId": 111, + "userId": "f65e2104-2987-4136-839d-ee4632f0b2e5", + "jobId": "2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0", + "status": "assigned", + "startDate": "2000-03-27T11:17:23.000Z", + "endDate": "2000-04-27T22:17:23.000Z", + "memberRate": 3000, + "customerRate": 3500, + "rateType": "weekly", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "createdAt": "2021-01-28T19:40:09.879Z", + "updatedAt": "2021-01-28T19:40:56.381Z" + }, + { + "id": "8173579e-4b3c-418d-a9a1-c999caa38404", + "projectId": 111, + "userId": "bef43122-426b-4b2b-acdd-9b5b3bd1c0bf", + "jobId": "2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0", + "status": "assigned", + "startDate": "2020-04-27T14:17:23.000Z", + "endDate": "2020-05-27T04:17:23.000Z", + "memberRate": 0, + "customerRate": 0, + "rateType": "weekly", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "createdAt": "2021-01-28T19:40:20.627Z", + "updatedAt": "2021-01-28T19:41:04.919Z" + }, + { + "id": "a098e8d8-ce5b-47d9-afee-38b050d16745", + "projectId": 111, + "userId": "4709473d-f060-4102-87f8-4d51ff0b34c1", + "jobId": "2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0", + "status": "cancelled", + "startDate": "2021-04-25T20:39:45.000Z", + "endDate": "2021-04-30T21:39:45.000Z", + "memberRate": 1000, + "customerRate": 1200, + "rateType": "weekly", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "createdAt": "2021-01-28T19:39:46.515Z", + "updatedAt": "2021-01-28T19:40:38.820Z" + }, + { + "id": "d38a6223-3f91-4300-9ecb-6e5fee173625", + "projectId": 111, + "userId": "39c7376e-2d5c-4601-bc47-6b60f505814d", + "jobId": "2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0", + "status": "sourcing", + "startDate": "2021-05-25T16:39:50.000Z", + "endDate": "2021-07-31T17:39:50.000Z", + "memberRate": 1000, + "customerRate": 1200, + "rateType": "weekly", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "createdAt": "2021-01-28T19:39:52.063Z", + "updatedAt": "2021-01-28T19:40:43.021Z" + }, + { + "id": "dc4477ec-07f8-4c8e-a8fe-ffe38dd290fa", + "projectId": 111, + "userId": "e5e667ad-0950-43c2-8d1d-6e83ad7d1c7e", + "jobId": "2d5e2a52-e0dd-4cd9-8f4c-7cffa43951d0", + "status": "assigned", + "startDate": "2021-07-27T08:17:23.131Z", + "endDate": "2021-09-27T02:17:23.000Z", + "memberRate": 1700, + "customerRate": 1900, + "rateType": "weekly", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "createdAt": "2021-01-28T19:40:15.326Z", + "updatedAt": "2021-01-28T19:41:00.503Z" + } + ], + "WorkPeriod": [ + { + "id": "db3ac57b-8e78-4b68-a0f7-4e928f3059af", + "resourceBookingId": "08f5e4b9-1088-496d-91a7-5b22a3583e3c", + "userHandle": "ritesh_cs", + "projectId": 111, + "startDate": "2021-01-24", + "endDate": "2021-01-30", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.105Z", + "updatedAt": null + }, + { + "id": "a6c83e0d-de12-42f2-b689-85ad56470941", + "resourceBookingId": "08f5e4b9-1088-496d-91a7-5b22a3583e3c", + "userHandle": "ritesh_cs", + "projectId": 111, + "startDate": "2021-01-31", + "endDate": "2021-02-06", + "daysWorked": 0, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.105Z", + "updatedAt": null + }, + { + "id": "5342924e-a1ed-4164-a885-7ebb87215aa5", + "resourceBookingId": "8173579e-4b3c-418d-a9a1-c999caa38404", + "userHandle": "testcat", + "projectId": 111, + "startDate": "2020-04-26", + "endDate": "2020-05-02", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.117Z", + "updatedAt": null + }, + { + "id": "b8390807-8ea7-4824-9f17-4500f46f893c", + "resourceBookingId": "8173579e-4b3c-418d-a9a1-c999caa38404", + "userHandle": "testcat", + "projectId": 111, + "startDate": "2020-05-03", + "endDate": "2020-05-09", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.117Z", + "updatedAt": null + }, + { + "id": "da056ecd-6660-4fd8-aba4-acc7ec089926", + "resourceBookingId": "8173579e-4b3c-418d-a9a1-c999caa38404", + "userHandle": "testcat", + "projectId": 111, + "startDate": "2020-05-10", + "endDate": "2020-05-16", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.117Z", + "updatedAt": null + }, + { + "id": "2cd7a726-9909-4764-9f24-8d9a8f3d011a", + "resourceBookingId": "8173579e-4b3c-418d-a9a1-c999caa38404", + "userHandle": "testcat", + "projectId": 111, + "startDate": "2020-05-24", + "endDate": "2020-05-30", + "daysWorked": 3, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.117Z", + "updatedAt": null + }, + { + "id": "7f646975-f984-4967-8788-f10c8db86b25", + "resourceBookingId": "d38a6223-3f91-4300-9ecb-6e5fee173625", + "userHandle": "nithyaasworld", + "projectId": 111, + "startDate": "2021-05-23", + "endDate": "2021-05-29", + "daysWorked": 4, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.120Z", + "updatedAt": null + }, + { + "id": "459e0127-7f1b-41f6-9d62-d354ed537779", + "resourceBookingId": "d38a6223-3f91-4300-9ecb-6e5fee173625", + "userHandle": "nithyaasworld", + "projectId": 111, + "startDate": "2021-05-30", + "endDate": "2021-06-05", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.120Z", + "updatedAt": null + }, + { + "id": "42f757a6-7bb3-48c2-a6cb-455d27a8821b", + "resourceBookingId": "d38a6223-3f91-4300-9ecb-6e5fee173625", + "userHandle": "nithyaasworld", + "projectId": 111, + "startDate": "2021-06-06", + "endDate": "2021-06-12", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.120Z", + "updatedAt": null + }, + { + "id": "c17d9081-c442-4d55-be58-65916662653e", + "resourceBookingId": "d38a6223-3f91-4300-9ecb-6e5fee173625", + "userHandle": "nithyaasworld", + "projectId": 111, + "startDate": "2021-06-20", + "endDate": "2021-06-26", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.120Z", + "updatedAt": null + }, + { + "id": "6768d502-5510-49d0-873f-346390ccf14d", + "resourceBookingId": "d38a6223-3f91-4300-9ecb-6e5fee173625", + "userHandle": "nithyaasworld", + "projectId": 111, + "startDate": "2021-06-27", + "endDate": "2021-07-03", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.120Z", + "updatedAt": null + }, + { + "id": "7808d9ac-3c93-4c3f-ad35-12a0a45d51c6", + "resourceBookingId": "d38a6223-3f91-4300-9ecb-6e5fee173625", + "userHandle": "nithyaasworld", + "projectId": 111, + "startDate": "2021-07-04", + "endDate": "2021-07-10", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.120Z", + "updatedAt": null + }, + { + "id": "724815e6-5a66-44c7-8dd6-7a5005ec4367", + "resourceBookingId": "d38a6223-3f91-4300-9ecb-6e5fee173625", + "userHandle": "nithyaasworld", + "projectId": 111, + "startDate": "2021-07-11", + "endDate": "2021-07-17", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.120Z", + "updatedAt": null + }, + { + "id": "57210895-2e2a-46f1-a0cc-05af4c30b188", + "resourceBookingId": "d38a6223-3f91-4300-9ecb-6e5fee173625", + "userHandle": "nithyaasworld", + "projectId": 111, + "startDate": "2021-07-25", + "endDate": "2021-07-31", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.120Z", + "updatedAt": null + }, + { + "id": "3534343e-5b06-4299-b657-11b3b5175dce", + "resourceBookingId": "7d967fed-9792-4768-98a7-0b644aa84f2e", + "userHandle": "sachin-wipro", + "projectId": 111, + "startDate": "2021-03-21", + "endDate": "2021-03-27", + "daysWorked": 2, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.122Z", + "updatedAt": null + }, + { + "id": "50788ef6-73d9-455c-a5ea-44028d7b3bf2", + "resourceBookingId": "7d967fed-9792-4768-98a7-0b644aa84f2e", + "userHandle": "sachin-wipro", + "projectId": 111, + "startDate": "2021-03-28", + "endDate": "2021-04-03", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.122Z", + "updatedAt": null + }, + { + "id": "2b2df620-fd88-4233-a0b8-242e0bb6ecb7", + "resourceBookingId": "7d967fed-9792-4768-98a7-0b644aa84f2e", + "userHandle": "sachin-wipro", + "projectId": 111, + "startDate": "2021-04-04", + "endDate": "2021-04-10", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.122Z", + "updatedAt": null + }, + { + "id": "970a2bbc-c5b7-4be5-ae63-3d9009ccf83b", + "resourceBookingId": "7d967fed-9792-4768-98a7-0b644aa84f2e", + "userHandle": "sachin-wipro", + "projectId": 111, + "startDate": "2021-04-11", + "endDate": "2021-04-17", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.122Z", + "updatedAt": null + }, + { + "id": "c3b83d2b-f27b-4e4d-8f87-9f324f80a9bc", + "resourceBookingId": "7d967fed-9792-4768-98a7-0b644aa84f2e", + "userHandle": "sachin-wipro", + "projectId": 111, + "startDate": "2021-04-25", + "endDate": "2021-05-01", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.122Z", + "updatedAt": null + }, + { + "id": "8dd12749-ef1d-4295-b050-8c3ecee1f846", + "resourceBookingId": "7d967fed-9792-4768-98a7-0b644aa84f2e", + "userHandle": "sachin-wipro", + "projectId": 111, + "startDate": "2021-05-09", + "endDate": "2021-05-15", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.122Z", + "updatedAt": null + }, + { + "id": "db0d8eab-13b0-4fd6-98fd-d2a82cd566ad", + "resourceBookingId": "7d967fed-9792-4768-98a7-0b644aa84f2e", + "userHandle": "sachin-wipro", + "projectId": 111, + "startDate": "2021-05-02", + "endDate": "2021-05-08", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "completed", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.122Z", + "updatedAt": null + }, + { + "id": "278bc7a0-a242-41a4-9d00-086f5d48d5da", + "resourceBookingId": "7d967fed-9792-4768-98a7-0b644aa84f2e", + "userHandle": "sachin-wipro", + "projectId": 111, + "startDate": "2021-04-18", + "endDate": "2021-04-24", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "cancelled", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.122Z", + "updatedAt": null + }, + { + "id": "0679b699-520b-4f8b-8eb6-a6aa53ec473c", + "resourceBookingId": "8173579e-4b3c-418d-a9a1-c999caa38404", + "userHandle": "testcat", + "projectId": 111, + "startDate": "2020-05-17", + "endDate": "2020-05-23", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "completed", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.117Z", + "updatedAt": null + }, + { + "id": "c73aa1a0-cb32-4301-af96-5b33bdbda20f", + "resourceBookingId": "d38a6223-3f91-4300-9ecb-6e5fee173625", + "userHandle": "nithyaasworld", + "projectId": 111, + "startDate": "2021-06-13", + "endDate": "2021-06-19", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "partially-completed", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.120Z", + "updatedAt": null + }, + { + "id": "5b0eefe1-e45d-4150-b14e-a83ce19599eb", + "resourceBookingId": "d38a6223-3f91-4300-9ecb-6e5fee173625", + "userHandle": "nithyaasworld", + "projectId": 111, + "startDate": "2021-07-18", + "endDate": "2021-07-24", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "partially-completed", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.120Z", + "updatedAt": null + }, + { + "id": "651a97b2-8019-49b7-9a8e-4c384c0615b7", + "resourceBookingId": "7d967fed-9792-4768-98a7-0b644aa84f2e", + "userHandle": "sachin-wipro", + "projectId": 111, + "startDate": "2021-05-16", + "endDate": "2021-05-22", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.122Z", + "updatedAt": null + }, + { + "id": "fcdedc90-7c76-47ed-bb95-fb05ec3cd53a", + "resourceBookingId": "7d967fed-9792-4768-98a7-0b644aa84f2e", + "userHandle": "sachin-wipro", + "projectId": 111, + "startDate": "2021-05-23", + "endDate": "2021-05-29", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.122Z", + "updatedAt": null + }, + { + "id": "0b65d948-0232-4f32-a455-b480da63320d", + "resourceBookingId": "7d967fed-9792-4768-98a7-0b644aa84f2e", + "userHandle": "sachin-wipro", + "projectId": 111, + "startDate": "2021-05-30", + "endDate": "2021-06-05", + "daysWorked": 1, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.122Z", + "updatedAt": null + }, + { + "id": "1f106c81-7a0d-4fb1-9bf4-851d450709d8", + "resourceBookingId": "61f5d474-e41f-490b-ab58-9f983e3d4916", + "userHandle": "sonu628", + "projectId": 111, + "startDate": "2000-03-26", + "endDate": "2000-04-01", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.324Z", + "updatedAt": null + }, + { + "id": "84a9d3e9-ee3f-495b-98de-f9fe0f6a9371", + "resourceBookingId": "61f5d474-e41f-490b-ab58-9f983e3d4916", + "userHandle": "sonu628", + "projectId": 111, + "startDate": "2000-04-09", + "endDate": "2000-04-15", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.324Z", + "updatedAt": null + }, + { + "id": "5f9dce2b-9426-4287-b3ab-7507ff3a2671", + "resourceBookingId": "61f5d474-e41f-490b-ab58-9f983e3d4916", + "userHandle": "sonu628", + "projectId": 111, + "startDate": "2000-04-16", + "endDate": "2000-04-22", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.324Z", + "updatedAt": null + }, + { + "id": "724b2338-c5bb-46ec-8e99-2417929eeab9", + "resourceBookingId": "61f5d474-e41f-490b-ab58-9f983e3d4916", + "userHandle": "sonu628", + "projectId": 111, + "startDate": "2000-04-23", + "endDate": "2000-04-29", + "daysWorked": 4, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.324Z", + "updatedAt": null + }, + { + "id": "10de7920-5e12-4284-b95f-08adc0ff1c17", + "resourceBookingId": "a098e8d8-ce5b-47d9-afee-38b050d16745", + "userHandle": "TCConnCopilot", + "projectId": 111, + "startDate": "2021-04-25", + "endDate": "2021-05-01", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.325Z", + "updatedAt": null + }, + { + "id": "c0fb6f01-7b71-471a-b85b-ea470d4dbd85", + "resourceBookingId": "35e1abd8-1890-4664-bb52-aade382d7b66", + "userHandle": "lakshmiaconnmgr", + "projectId": 111, + "startDate": "2021-02-21", + "endDate": "2021-02-27", + "daysWorked": 2, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.326Z", + "updatedAt": null + }, + { + "id": "0a3df77a-7841-4256-bb2c-d7e0fa17dc3f", + "resourceBookingId": "35e1abd8-1890-4664-bb52-aade382d7b66", + "userHandle": "lakshmiaconnmgr", + "projectId": 111, + "startDate": "2021-02-28", + "endDate": "2021-03-06", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.326Z", + "updatedAt": null + }, + { + "id": "9e0d10c3-f4c8-4ba6-8c11-333d9cdab634", + "resourceBookingId": "35e1abd8-1890-4664-bb52-aade382d7b66", + "userHandle": "lakshmiaconnmgr", + "projectId": 111, + "startDate": "2021-03-14", + "endDate": "2021-03-20", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.326Z", + "updatedAt": null + }, + { + "id": "66d47a95-a4f8-43a5-bfe2-af8f5a2b64ac", + "resourceBookingId": "35e1abd8-1890-4664-bb52-aade382d7b66", + "userHandle": "lakshmiaconnmgr", + "projectId": 111, + "startDate": "2021-03-21", + "endDate": "2021-03-27", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.326Z", + "updatedAt": null + }, + { + "id": "c10cca56-b0c4-4e87-a64f-9a14d7445436", + "resourceBookingId": "51b45f5d-5df2-46d5-9c3d-8a1323df38dd", + "userHandle": "amy_admin", + "projectId": 111, + "startDate": "2021-03-21", + "endDate": "2021-03-27", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.361Z", + "updatedAt": null + }, + { + "id": "c8d38387-b4a2-49f8-bbba-2f10f50c99db", + "resourceBookingId": "51b45f5d-5df2-46d5-9c3d-8a1323df38dd", + "userHandle": "amy_admin", + "projectId": 111, + "startDate": "2021-03-28", + "endDate": "2021-04-03", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.361Z", + "updatedAt": null + }, + { + "id": "07dd0d62-e5cc-49a8-8b4c-966a2348095f", + "resourceBookingId": "51b45f5d-5df2-46d5-9c3d-8a1323df38dd", + "userHandle": "amy_admin", + "projectId": 111, + "startDate": "2021-04-04", + "endDate": "2021-04-10", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.361Z", + "updatedAt": null + }, + { + "id": "c3c4593a-2a06-4ee8-8cbb-5a3ffad8ad7d", + "resourceBookingId": "51b45f5d-5df2-46d5-9c3d-8a1323df38dd", + "userHandle": "amy_admin", + "projectId": 111, + "startDate": "2021-04-11", + "endDate": "2021-04-17", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.361Z", + "updatedAt": null + }, + { + "id": "9f117273-bb2f-48ab-bf3a-c13652483ea3", + "resourceBookingId": "51b45f5d-5df2-46d5-9c3d-8a1323df38dd", + "userHandle": "amy_admin", + "projectId": 111, + "startDate": "2021-04-18", + "endDate": "2021-04-24", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.361Z", + "updatedAt": null + }, + { + "id": "3a909050-444a-4a82-9961-d390212e86f5", + "resourceBookingId": "51b45f5d-5df2-46d5-9c3d-8a1323df38dd", + "userHandle": "amy_admin", + "projectId": 111, + "startDate": "2021-04-25", + "endDate": "2021-05-01", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.361Z", + "updatedAt": null + }, + { + "id": "b9a8ac04-5b06-4093-ac50-ce556d25b421", + "resourceBookingId": "51b45f5d-5df2-46d5-9c3d-8a1323df38dd", + "userHandle": "amy_admin", + "projectId": 111, + "startDate": "2021-05-02", + "endDate": "2021-05-08", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.361Z", + "updatedAt": null + }, + { + "id": "a2b708d1-e234-4573-b5ca-7dc36a20c0d7", + "resourceBookingId": "51b45f5d-5df2-46d5-9c3d-8a1323df38dd", + "userHandle": "amy_admin", + "projectId": 111, + "startDate": "2021-05-16", + "endDate": "2021-05-22", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.361Z", + "updatedAt": null + }, + { + "id": "768051e3-9765-498f-9b58-17c3377eced8", + "resourceBookingId": "51b45f5d-5df2-46d5-9c3d-8a1323df38dd", + "userHandle": "amy_admin", + "projectId": 111, + "startDate": "2021-05-23", + "endDate": "2021-05-29", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.361Z", + "updatedAt": null + }, + { + "id": "d94e0c2f-15de-4d07-a098-200daaa05f54", + "resourceBookingId": "dc4477ec-07f8-4c8e-a8fe-ffe38dd290fa", + "userHandle": "nskumar278", + "projectId": 111, + "startDate": "2021-07-25", + "endDate": "2021-07-31", + "daysWorked": 4, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.390Z", + "updatedAt": null + }, + { + "id": "93910ea8-28ac-40a3-91b0-35eab59405da", + "resourceBookingId": "dc4477ec-07f8-4c8e-a8fe-ffe38dd290fa", + "userHandle": "nskumar278", + "projectId": 111, + "startDate": "2021-08-01", + "endDate": "2021-08-07", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.390Z", + "updatedAt": null + }, + { + "id": "33561804-7a27-4cff-9e57-c09c914bbf12", + "resourceBookingId": "dc4477ec-07f8-4c8e-a8fe-ffe38dd290fa", + "userHandle": "nskumar278", + "projectId": 111, + "startDate": "2021-08-15", + "endDate": "2021-08-21", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.390Z", + "updatedAt": null + }, + { + "id": "2e874752-81e1-451d-b5c9-7455135daee9", + "resourceBookingId": "dc4477ec-07f8-4c8e-a8fe-ffe38dd290fa", + "userHandle": "nskumar278", + "projectId": 111, + "startDate": "2021-08-22", + "endDate": "2021-08-28", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.390Z", + "updatedAt": null + }, + { + "id": "3313e61b-8733-496e-9c79-9b1e3ff5e074", + "resourceBookingId": "dc4477ec-07f8-4c8e-a8fe-ffe38dd290fa", + "userHandle": "nskumar278", + "projectId": 111, + "startDate": "2021-09-12", + "endDate": "2021-09-18", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.390Z", + "updatedAt": null + }, + { + "id": "8019e0c4-201a-469f-901b-8e84f43f577b", + "resourceBookingId": "dc4477ec-07f8-4c8e-a8fe-ffe38dd290fa", + "userHandle": "nskumar278", + "projectId": 111, + "startDate": "2021-09-19", + "endDate": "2021-09-25", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.390Z", + "updatedAt": null + }, + { + "id": "2b660631-fbd0-47fb-9ab4-f4e809650e44", + "resourceBookingId": "dc4477ec-07f8-4c8e-a8fe-ffe38dd290fa", + "userHandle": "nskumar278", + "projectId": 111, + "startDate": "2021-09-26", + "endDate": "2021-10-02", + "daysWorked": 0, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.390Z", + "updatedAt": null + }, + { + "id": "f93b73e0-25eb-4c67-a6f0-1b658186ae29", + "resourceBookingId": "0a6799d7-f5d1-456b-8bf1-90619284b295", + "userHandle": "aaaa", + "projectId": 111, + "startDate": "2021-02-21", + "endDate": "2021-02-27", + "daysWorked": 0, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.523Z", + "updatedAt": null + }, + { + "id": "e2d7651c-b8b6-453a-b472-478fe679a22f", + "resourceBookingId": "0a6799d7-f5d1-456b-8bf1-90619284b295", + "userHandle": "aaaa", + "projectId": 111, + "startDate": "2021-02-28", + "endDate": "2021-03-06", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.523Z", + "updatedAt": null + }, + { + "id": "0ed89458-ab82-485e-9727-858e7c25d477", + "resourceBookingId": "0a6799d7-f5d1-456b-8bf1-90619284b295", + "userHandle": "aaaa", + "projectId": 111, + "startDate": "2021-03-14", + "endDate": "2021-03-20", + "daysWorked": 1, + "memberRate": null, + "customerRate": null, + "paymentStatus": "pending", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.523Z", + "updatedAt": null + }, + { + "id": "c1de1dd6-64b9-4dc6-b463-48c280a01465", + "resourceBookingId": "0a6799d7-f5d1-456b-8bf1-90619284b295", + "userHandle": "aaaa", + "projectId": 111, + "startDate": "2021-03-07", + "endDate": "2021-03-13", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "completed", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.523Z", + "updatedAt": null + }, + { + "id": "4b5ce032-7c8d-423a-bec3-f469cb869088", + "resourceBookingId": "35e1abd8-1890-4664-bb52-aade382d7b66", + "userHandle": "lakshmiaconnmgr", + "projectId": 111, + "startDate": "2021-03-28", + "endDate": "2021-04-03", + "daysWorked": 4, + "memberRate": null, + "customerRate": null, + "paymentStatus": "partially-completed", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.326Z", + "updatedAt": null + }, + { + "id": "1b5e7460-c197-4f38-8f53-80e651ee32fe", + "resourceBookingId": "35e1abd8-1890-4664-bb52-aade382d7b66", + "userHandle": "lakshmiaconnmgr", + "projectId": 111, + "startDate": "2021-03-07", + "endDate": "2021-03-13", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "cancelled", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.326Z", + "updatedAt": null + }, + { + "id": "6aae6de0-0f64-4af6-a4a4-a9920cf873fa", + "resourceBookingId": "51b45f5d-5df2-46d5-9c3d-8a1323df38dd", + "userHandle": "amy_admin", + "projectId": 111, + "startDate": "2021-03-14", + "endDate": "2021-03-20", + "daysWorked": 2, + "memberRate": null, + "customerRate": null, + "paymentStatus": "completed", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.361Z", + "updatedAt": null + }, + { + "id": "87f41144-95d3-427d-b5bf-161250a6b9e4", + "resourceBookingId": "51b45f5d-5df2-46d5-9c3d-8a1323df38dd", + "userHandle": "amy_admin", + "projectId": 111, + "startDate": "2021-05-09", + "endDate": "2021-05-15", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "completed", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.361Z", + "updatedAt": null + }, + { + "id": "06fda3ca-e583-4466-baeb-70dac8952151", + "resourceBookingId": "61f5d474-e41f-490b-ab58-9f983e3d4916", + "userHandle": "sonu628", + "projectId": 111, + "startDate": "2000-04-02", + "endDate": "2000-04-08", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "partially-completed", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.324Z", + "updatedAt": null + }, + { + "id": "2530239e-fcd7-43a1-81ca-1df38e8744fc", + "resourceBookingId": "dc4477ec-07f8-4c8e-a8fe-ffe38dd290fa", + "userHandle": "nskumar278", + "projectId": 111, + "startDate": "2021-08-29", + "endDate": "2021-09-04", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "completed", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.390Z", + "updatedAt": null + }, + { + "id": "7f58f304-800f-4304-9aa1-21c7c5aad882", + "resourceBookingId": "dc4477ec-07f8-4c8e-a8fe-ffe38dd290fa", + "userHandle": "nskumar278", + "projectId": 111, + "startDate": "2021-09-05", + "endDate": "2021-09-11", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "cancelled", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.390Z", + "updatedAt": null + }, + { + "id": "08b5fc47-0e40-48d5-be46-24ecfd9031b5", + "resourceBookingId": "dc4477ec-07f8-4c8e-a8fe-ffe38dd290fa", + "userHandle": "nskumar278", + "projectId": 111, + "startDate": "2021-08-08", + "endDate": "2021-08-14", + "daysWorked": 5, + "memberRate": null, + "customerRate": null, + "paymentStatus": "completed", + "createdBy": "00000000-0000-0000-0000-000000000000", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.390Z", + "updatedAt": null + } + ], + "WorkPeriodPayment": [ + { + "id": "2a122a93-e778-4eb9-868c-5f38b8b9bb4e", + "workPeriodId": "db3ac57b-8e78-4b68-a0f7-4e928f3059af", + "challengeId": "25a7c442-427b-4b6d-9c41-112dbd420c0d", + "amount": 800, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": null + }, + { + "id": "2417df2c-8e29-4868-aeb8-5ec0ff67713e", + "workPeriodId": "a6c83e0d-de12-42f2-b689-85ad56470941", + "challengeId": "f01ba8da-c891-472d-9ed6-74b91ed9b407", + "amount": 400, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": null + }, + { + "id": "8ca85158-a850-4cae-97f0-5873a9225ff8", + "workPeriodId": "5342924e-a1ed-4164-a885-7ebb87215aa5", + "challengeId": "b42b8f40-9a4d-45d1-814e-59da5c7a1fd9", + "amount": 1200, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": null + }, + { + "id": "5116d4ea-2c1a-4be6-b335-bd531b8d5734", + "workPeriodId": "b8390807-8ea7-4824-9f17-4500f46f893c", + "challengeId": "b42b8f40-9a4d-45d1-814e-59da5c7a1fd9", + "amount": 600, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": "2021-04-16T19:13:23.714Z" + }, + { + "id": "8fad32f7-cb40-416f-ab24-86cf1c7870ef", + "workPeriodId": "da056ecd-6660-4fd8-aba4-acc7ec089926", + "challengeId": "f7e40a0c-a302-4989-a3bd-7587fee3c367", + "amount": 600, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": null + }, + { + "id": "298ac627-e6d7-47b0-ad1d-83de291addf7", + "workPeriodId": "2cd7a726-9909-4764-9f24-8d9a8f3d011a", + "challengeId": "f7e40a0c-a302-4989-a3bd-7587fee3c367", + "amount": 300, + "status": "cancelled", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": "2021-04-16T19:13:23.714Z" + }, + { + "id": "e8aee371-1f26-4475-8459-9c134fa6f3c6", + "workPeriodId": "7f646975-f984-4967-8788-f10c8db86b25", + "challengeId": "ee9bcdd0-0d0d-4414-88cb-d14255f996a5", + "amount": 700, + "status": "cancelled", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": null + }, + { + "id": "4ce8cf4a-2585-4454-81d4-e5446c9a3f75", + "workPeriodId": "459e0127-7f1b-41f6-9d62-d354ed537779", + "challengeId": "ee9bcdd0-0d0d-4414-88cb-d14255f996a5", + "amount": 350, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": "2021-04-16T19:13:23.714Z" + }, + { + "id": "11c07a5c-a077-4719-83ba-c48db7e63c01", + "workPeriodId": "42f757a6-7bb3-48c2-a6cb-455d27a8821b", + "challengeId": "d7c21199-a435-41b8-a2ac-5e5bdd021c5e", + "amount": 1400, + "status": "cancelled", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": null + }, + { + "id": "b8d44e83-922c-4c2c-8567-5764794e03f3", + "workPeriodId": "c17d9081-c442-4d55-be58-65916662653e", + "challengeId": "d7c21199-a435-41b8-a2ac-5e5bdd021c5e", + "amount": 700, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": "2021-04-16T19:13:23.714Z" + }, + { + "id": "f950e52e-5a52-4ee8-af5f-e6c42e9b400b", + "workPeriodId": "6768d502-5510-49d0-873f-346390ccf14d", + "challengeId": "6c04d456-bb38-43c8-a538-f5cc6caaa540", + "amount": 800, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": null + }, + { + "id": "9fe78619-5c1c-4b22-8d6f-ebf9a9502432", + "workPeriodId": "7808d9ac-3c93-4c3f-ad35-12a0a45d51c6", + "challengeId": "6c04d456-bb38-43c8-a538-f5cc6caaa540", + "amount": 400, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": null + }, + { + "id": "09ea6f03-4489-496c-817c-e9279a58c0ad", + "workPeriodId": "724815e6-5a66-44c7-8dd6-7a5005ec4367", + "challengeId": "78154e5c-feed-4dbf-84ec-775395139211", + "amount": 400, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": null + }, + { + "id": "4a81c6a3-18d9-441b-ae64-3aa9def336ef", + "workPeriodId": "57210895-2e2a-46f1-a0cc-05af4c30b188", + "challengeId": "78154e5c-feed-4dbf-84ec-775395139211", + "amount": 200, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": "2021-04-16T19:13:23.714Z" + }, + { + "id": "cb94d710-fa3c-4333-b8a9-39ec053a665d", + "workPeriodId": "3534343e-5b06-4299-b657-11b3b5175dce", + "challengeId": "93f594e9-5396-416a-8212-87bee614a38f", + "amount": 1200, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": null + }, + { + "id": "5192e519-30f5-42d6-877f-5c2b786d91c7", + "workPeriodId": "50788ef6-73d9-455c-a5ea-44028d7b3bf2", + "challengeId": "93f594e9-5396-416a-8212-87bee614a38f", + "amount": 600, + "status": "cancelled", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": "2021-04-16T19:13:23.714Z" + }, + { + "id": "58c6431a-061a-41bd-a3bd-c8effba62e11", + "workPeriodId": "2b2df620-fd88-4233-a0b8-242e0bb6ecb7", + "challengeId": "0de972b8-6cc9-4625-9760-1c77561c29e9", + "amount": 900, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": null + }, + { + "id": "56cb3aef-531b-4a26-817e-4b9629212c9a", + "workPeriodId": "970a2bbc-c5b7-4be5-ae63-3d9009ccf83b", + "challengeId": "0de972b8-6cc9-4625-9760-1c77561c29e9", + "amount": 450, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": null + }, + { + "id": "fda2013c-da68-4601-8d13-d0f4cffd081c", + "workPeriodId": "c3b83d2b-f27b-4e4d-8f87-9f324f80a9bc", + "challengeId": "0de972b8-6cc9-4625-9760-1c77561c29e9", + "amount": 800, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": null + }, + { + "id": "8c9ed23c-12c7-4a8b-8e91-6fd3b3fc43a4", + "workPeriodId": "8dd12749-ef1d-4295-b050-8c3ecee1f846", + "challengeId": "0de972b8-6cc9-4625-9760-1c77561c29e9", + "amount": 450, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": null + }, + { + "id": "310384cb-6e85-4f7d-a6d2-8c03ca27871d", + "workPeriodId": "db0d8eab-13b0-4fd6-98fd-d2a82cd566ad", + "challengeId": "0de972b8-6cc9-4625-9760-1c77561c29e9", + "amount": 900, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": null + }, + { + "id": "cc13acfd-fc06-40e5-aefe-5050429ee4f2", + "workPeriodId": "278bc7a0-a242-41a4-9d00-086f5d48d5da", + "challengeId": "0de972b8-6cc9-4625-9760-1c77561c29e9", + "amount": 1200, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": null + }, + { + "id": "2c488b36-0868-4db6-8978-20b1ce174496", + "workPeriodId": "0679b699-520b-4f8b-8eb6-a6aa53ec473c", + "challengeId": "0de972b8-6cc9-4625-9760-1c77561c29e9", + "amount": 200, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": null + }, + { + "id": "efa8cd14-c93f-4e6c-be53-596f02db8c96", + "workPeriodId": "c73aa1a0-cb32-4301-af96-5b33bdbda20f", + "challengeId": "0de972b8-6cc9-4625-9760-1c77561c29e9", + "amount": 800, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": null + }, + { + "id": "a26b8cae-a1df-4843-a192-0735f235bf78", + "workPeriodId": "5b0eefe1-e45d-4150-b14e-a83ce19599eb", + "challengeId": "0de972b8-6cc9-4625-9760-1c77561c29e9", + "amount": 600, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": null + }, + { + "id": "eb63dfc7-14d7-4cae-a25e-3e33a04601cf", + "workPeriodId": "651a97b2-8019-49b7-9a8e-4c384c0615b7", + "challengeId": "0de972b8-6cc9-4625-9760-1c77561c29e9", + "amount": 300, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T19:13:23.714Z", + "updatedAt": null + }, + { + "id": "11ea987f-f218-4d2b-b656-0741208539f2", + "workPeriodId": "fcdedc90-7c76-47ed-bb95-fb05ec3cd53a", + "challengeId": "0de972b8-6cc9-4625-9760-1c77561c29e9", + "amount": 600, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-16T19:13:23.714Z", + "updatedAt": null + }, + { + "id": "b342d615-d36d-48b2-a3e8-1f498b58ab68", + "workPeriodId": "0b65d948-0232-4f32-a455-b480da63320d", + "challengeId": "0de972b8-6cc9-4625-9760-1c77561c29e9", + "amount": 400, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-16T19:13:23.714Z", + "updatedAt": null + }, + { + "id": "84c1c956-e03d-4e19-a5a8-a4086c9658eb", + "workPeriodId": "1f106c81-7a0d-4fb1-9bf4-851d450709d8", + "challengeId": "604910b2-7644-4b9d-a185-0054e61c83fc", + "amount": 1800, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.324Z", + "updatedAt": null + }, + { + "id": "c4e316ca-a46f-4fbc-96a6-6fe6665c3b49", + "workPeriodId": "84a9d3e9-ee3f-495b-98de-f9fe0f6a9371", + "challengeId": "d937a822-4a9b-40db-afe6-fe1285e3f7f9", + "amount": 900, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.324Z", + "updatedAt": null + }, + { + "id": "a94b6f43-de89-4fd2-9a1d-d8a2cce02702", + "workPeriodId": "5f9dce2b-9426-4287-b3ab-7507ff3a2671", + "challengeId": "d55fae30-3072-462e-b8bd-eb2eec664e65", + "amount": 1600, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.324Z", + "updatedAt": null + }, + { + "id": "7d782624-243e-497b-90ca-cc00ae29ebf2", + "workPeriodId": "724b2338-c5bb-46ec-8e99-2417929eeab9", + "challengeId": "afcbc3bc-9077-4978-bf9c-acddb48e6518", + "amount": 800, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.324Z", + "updatedAt": null + }, + { + "id": "8a0c0877-b88a-420b-a3f7-645c18793b4b", + "workPeriodId": "10de7920-5e12-4284-b95f-08adc0ff1c17", + "challengeId": "4332acc6-3a33-4b7b-af4c-bd2c1ffcfb8e", + "amount": 1400, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.325Z", + "updatedAt": null + }, + { + "id": "dd9c842a-f577-43c2-8f17-cc940f26f0d8", + "workPeriodId": "c0fb6f01-7b71-471a-b85b-ea470d4dbd85", + "challengeId": "b67cbbc5-3384-4ea6-8504-d3fe83a6e238", + "amount": 700, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.326Z", + "updatedAt": null + }, + { + "id": "58681a3e-2266-4153-afd5-7be218966da2", + "workPeriodId": "0a3df77a-7841-4256-bb2c-d7e0fa17dc3f", + "challengeId": "2bafdd9a-ab4a-4624-8a06-7b1adfb8dac2", + "amount": 1200, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.326Z", + "updatedAt": null + }, + { + "id": "a1ffc559-703a-4c35-8ba3-73a03c3454af", + "workPeriodId": "9e0d10c3-f4c8-4ba6-8c11-333d9cdab634", + "challengeId": "9fca67f9-3641-4982-8a82-e86b1850efc8", + "amount": 600, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.326Z", + "updatedAt": null + }, + { + "id": "d827ed01-5153-4774-8450-bace2521a6d1", + "workPeriodId": "66d47a95-a4f8-43a5-bfe2-af8f5a2b64ac", + "challengeId": "d40cb9c5-b3bd-45a1-802c-a50fefb020b9", + "amount": 1000, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.326Z", + "updatedAt": null + }, + { + "id": "7e41ca7f-d3c0-4d70-9daf-ee52c93695c7", + "workPeriodId": "c10cca56-b0c4-4e87-a64f-9a14d7445436", + "challengeId": "9d49655f-99f6-4e67-9819-a117ef746272", + "amount": 500, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.361Z", + "updatedAt": null + }, + { + "id": "eb9c9a83-fe94-4f51-b9f0-c2d9671e87f6", + "workPeriodId": "c8d38387-b4a2-49f8-bbba-2f10f50c99db", + "challengeId": "68e6a32e-6c31-4266-ba3b-9d2f63be4274", + "amount": 900, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.361Z", + "updatedAt": null + }, + { + "id": "d0f61c2d-271c-48b2-8416-50c1c32ad32b", + "workPeriodId": "07dd0d62-e5cc-49a8-8b4c-966a2348095f", + "challengeId": "aa8c1945-904c-42a7-9b00-1e4f9a49dcdb", + "amount": 450, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.361Z", + "updatedAt": null + }, + { + "id": "be07bfc8-032c-41f7-a247-a4724f65617c", + "workPeriodId": "c3c4593a-2a06-4ee8-8cbb-5a3ffad8ad7d", + "challengeId": "45e33cee-7c83-4288-8187-6858b0c759eb", + "amount": 800, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.361Z", + "updatedAt": null + }, + { + "id": "a5904ae3-7524-4709-b798-20c4a2193f10", + "workPeriodId": "9f117273-bb2f-48ab-bf3a-c13652483ea3", + "challengeId": "ed56a1c7-a965-4ab6-9cf0-0d7c14cd7db3", + "amount": 400, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.361Z", + "updatedAt": null + }, + { + "id": "155eaab2-ef74-484c-b1d7-6534dde58b66", + "workPeriodId": "3a909050-444a-4a82-9961-d390212e86f5", + "challengeId": "5ba2d9df-b3ba-4f5f-bee5-228eb46b2c37", + "amount": 600, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.361Z", + "updatedAt": null + }, + { + "id": "8fdfe90b-2155-4a71-a610-4689106ced34", + "workPeriodId": "b9a8ac04-5b06-4093-ac50-ce556d25b421", + "challengeId": "963784fd-4174-458c-a311-a5b8333d66ab", + "amount": 300, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.361Z", + "updatedAt": null + }, + { + "id": "821b38e8-657d-4f72-b27a-dd975c506ced", + "workPeriodId": "a2b708d1-e234-4573-b5ca-7dc36a20c0d7", + "challengeId": "61f5185b-4ee1-4df3-9c6f-52f5bf0cbfc5", + "amount": 500, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.361Z", + "updatedAt": null + }, + { + "id": "11918ff9-5f18-445d-ae90-762b3ebe44ca", + "workPeriodId": "768051e3-9765-498f-9b58-17c3377eced8", + "challengeId": "c89d357f-afd1-4757-824f-2cf94e2890c6", + "amount": 250, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.361Z", + "updatedAt": null + }, + { + "id": "c20796c8-76b0-40e8-9bee-db406c93daaf", + "workPeriodId": "d94e0c2f-15de-4d07-a098-200daaa05f54", + "challengeId": "513ab4c6-0aa4-482b-a184-87f8447b145b", + "amount": 1800, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.390Z", + "updatedAt": null + }, + { + "id": "621d793b-0ead-4d99-a119-e32af526ece7", + "workPeriodId": "93910ea8-28ac-40a3-91b0-35eab59405da", + "challengeId": "ad04dcee-9a3c-4345-b0b5-783ce98e94b2", + "amount": 900, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.390Z", + "updatedAt": null + }, + { + "id": "491f6e93-e80f-46eb-9637-ee84fe7ace9b", + "workPeriodId": "33561804-7a27-4cff-9e57-c09c914bbf12", + "challengeId": "c2b7a2cc-4633-4f3a-ab39-f7122a6890b6", + "amount": 1600, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.390Z", + "updatedAt": null + }, + { + "id": "bf80eca9-8323-4f96-9a3b-8553d6f1e0ce", + "workPeriodId": "2e874752-81e1-451d-b5c9-7455135daee9", + "challengeId": "03c69d02-9188-436e-b4c9-08f39e46f413", + "amount": 800, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.390Z", + "updatedAt": null + }, + { + "id": "338d2d7d-2c59-4513-b560-55e8982fd7c7", + "workPeriodId": "3313e61b-8733-496e-9c79-9b1e3ff5e074", + "challengeId": "2a0db660-def2-4117-90e8-01cd1271c726", + "amount": 1400, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.390Z", + "updatedAt": null + }, + { + "id": "dec8615b-c823-4fff-bc77-fa0614b8d09c", + "workPeriodId": "8019e0c4-201a-469f-901b-8e84f43f577b", + "challengeId": "fe3e4056-82e3-4df4-b699-a1f3d8ab5e53", + "amount": 700, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.390Z", + "updatedAt": null + }, + { + "id": "efe0e4b5-e6dd-4c1a-a0e5-1f5e0ff91df9", + "workPeriodId": "2b660631-fbd0-47fb-9ab4-f4e809650e44", + "challengeId": "01332fa9-0505-416d-9084-39b136dbd300", + "amount": 1200, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.390Z", + "updatedAt": null + }, + { + "id": "50f7a6fa-a04d-4873-8fd0-037be2f14425", + "workPeriodId": "f93b73e0-25eb-4c67-a6f0-1b658186ae29", + "challengeId": "419fbb3d-921d-4613-a87e-337f38d21885", + "amount": 600, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.523Z", + "updatedAt": null + }, + { + "id": "767897c3-bbc2-4b1a-9843-5a6bd82e29b0", + "workPeriodId": "e2d7651c-b8b6-453a-b472-478fe679a22f", + "challengeId": "61044188-965e-40df-94c4-9fa9a9499b25", + "amount": 1000, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.523Z", + "updatedAt": null + }, + { + "id": "63cec011-7714-4ab6-944f-e76b9fa2bd1a", + "workPeriodId": "0ed89458-ab82-485e-9727-858e7c25d477", + "challengeId": "1bdf092e-e117-4d42-bb5d-e49816171c0d", + "amount": 500, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.523Z", + "updatedAt": null + }, + { + "id": "c117de76-965f-4069-aefb-8dd97f95112c", + "workPeriodId": "c1de1dd6-64b9-4dc6-b463-48c280a01465", + "challengeId": "59d08064-e1b4-4e78-82d8-b2d7ffa6f0b1", + "amount": 900, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.523Z", + "updatedAt": null + }, + { + "id": "8ff6188f-b4e6-4f6e-b2d4-2a622ae50c4f", + "workPeriodId": "4b5ce032-7c8d-423a-bec3-f469cb869088", + "challengeId": "f151a5a1-6b28-4f59-bdde-6e73498faa84", + "amount": 450, + "status": "cancelled", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.326Z", + "updatedAt": null + }, + { + "id": "04ef47ac-8f4d-402f-b9fd-48b2b1d9003d", + "workPeriodId": "1b5e7460-c197-4f38-8f53-80e651ee32fe", + "challengeId": "fa909769-f5f7-41fb-94bb-80db62e21a5e", + "amount": 800, + "status": "cancelled", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.326Z", + "updatedAt": null + }, + { + "id": "283f9c3b-7f0a-4792-9661-ced7cbdb340d", + "workPeriodId": "6aae6de0-0f64-4af6-a4a4-a9920cf873fa", + "challengeId": "9a995b78-0542-41be-a926-f3df57c2f873", + "amount": 400, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.361Z", + "updatedAt": null + }, + { + "id": "12b0bcfc-59ae-478c-bb32-cb18d1d0244c", + "workPeriodId": "87f41144-95d3-427d-b5bf-161250a6b9e4", + "challengeId": "a07ea88f-c52b-4023-8730-c4364efd0dd2", + "amount": 600, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.361Z", + "updatedAt": null + }, + { + "id": "2519d7f9-81c8-448c-aec2-aa78d6d6a962", + "workPeriodId": "06fda3ca-e583-4466-baeb-70dac8952151", + "challengeId": "fd051497-6050-4edf-b8f7-780128f64dc5", + "amount": 300, + "status": "cancelled", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.324Z", + "updatedAt": null + }, + { + "id": "c051c3da-34bb-4deb-8921-04e5d2fa0bcc", + "workPeriodId": "2530239e-fcd7-43a1-81ca-1df38e8744fc", + "challengeId": "25fd805c-49cd-443f-ba0d-813c33a6d8ad", + "amount": 400, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.390Z", + "updatedAt": null + }, + { + "id": "7cf85ce0-ef8c-4152-8623-9a1325db6daa", + "workPeriodId": "7f58f304-800f-4304-9aa1-21c7c5aad882", + "challengeId": "fbf8efda-fe4b-4b72-99dd-573b79d27bd8", + "amount": 200, + "status": "cancelled", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.390Z", + "updatedAt": null + }, + { + "id": "90bb43bd-d9e7-4eab-a46b-ab03338be11a", + "workPeriodId": "08b5fc47-0e40-48d5-be46-24ecfd9031b5", + "challengeId": "8b6f4040-d7ae-4264-b60b-b1171c9365e4", + "amount": 400, + "status": "completed", + "createdBy": "57646ff9-1cd3-4d3c-88ba-eb09a395366c", + "updatedBy": null, + "createdAt": "2021-04-14T22:01:45.390Z", + "updatedAt": null + } + ] +} \ No newline at end of file diff --git a/docs/Topcoder-bookings-api.postman_collection.json b/docs/Topcoder-bookings-api.postman_collection.json index a80efc4e..f7bfc83f 100644 --- a/docs/Topcoder-bookings-api.postman_collection.json +++ b/docs/Topcoder-bookings-api.postman_collection.json @@ -1,6 +1,6 @@ { "info": { - "_postman_id": "8ad4971b-dab3-4581-996a-9480aa21c1f4", + "_postman_id": "5eb08b17-a20b-4223-9a24-49fb150f51b2", "name": "Topcoder-bookings-api", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, @@ -6067,7 +6067,7 @@ "response": [] }, { - "name": "get work period with m2m read", + "name": "get work period with m2m read 1", "event": [ { "listen": "test", @@ -6103,6 +6103,43 @@ }, "response": [] }, + { + "name": "get work period with m2m read 2", + "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_m2m_read_work_period_and_payment}}" + } + ], + "url": { + "raw": "{{URL}}/work-periods/{{workPeriodIdCreatedByM2M}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-periods", + "{{workPeriodIdCreatedByM2M}}" + ] + } + }, + "response": [] + }, { "name": "get work period with booking manager from db", "event": [ @@ -6314,7 +6351,7 @@ "response": [] }, { - "name": "search work periods with m2m all", + "name": "search work periods with m2m all 1", "event": [ { "listen": "test", @@ -6406,6 +6443,99 @@ }, "response": [] }, + { + "name": "search work periods with m2m all 2", + "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_m2m_all_work_period_and_payment}}" + } + ], + "url": { + "raw": "{{URL}}/work-periods", + "host": [ + "{{URL}}" + ], + "path": [ + "work-periods" + ], + "query": [ + { + "key": "page", + "value": "1", + "disabled": true + }, + { + "key": "perPage", + "value": "5", + "disabled": true + }, + { + "key": "sortBy", + "value": "id", + "disabled": true + }, + { + "key": "sortOrder", + "value": "desc", + "disabled": true + }, + { + "key": "resourceBookingId", + "value": "{{resourceBookingId}}", + "disabled": true + }, + { + "key": "resourceBookingIds", + "value": "{{resourceBookingId}},{{resourceBookingIdCreatedByM2M}}", + "disabled": true + }, + { + "key": "paymentStatus", + "value": "pending", + "disabled": true + }, + { + "key": "startDate", + "value": "2021-03-14", + "disabled": true + }, + { + "key": "endDate", + "value": "2021-03-20", + "disabled": true + }, + { + "key": "userHandle", + "value": "pshah_manager", + "disabled": true + }, + { + "key": "projectId", + "value": "16843", + "disabled": true + } + ] + } + }, + "response": [] + }, { "name": "search work periods with connect user", "event": [ @@ -8341,351 +8471,569 @@ ] }, { - "name": "Taas Teams", + "name": "Work Period Payments", "item": [ { - "name": "GET /taas-teams", - "request": { - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token_bookingManager}}", - "type": "text" - } - ], - "url": { - "raw": "{{URL}}/taas-teams?perPage=10&page=1&name=*taas*&sortBy=lastActivityAt&sortOrder=desc", - "host": [ - "{{URL}}" - ], - "path": [ - "taas-teams" - ], - "query": [ - { - "key": "perPage", - "value": "10" - }, - { - "key": "page", - "value": "1" - }, - { - "key": "name", - "value": "*taas*", - "description": "case-insensitive; support wildcard match" - }, - { - "key": "sortBy", - "value": "lastActivityAt", - "description": "allows: createdAt, updatedAt, lastActivityAt, id, status, name, type, best match" - }, + "name": "Before Test", + "item": [ + { + "name": "create job", + "event": [ { - "key": "sortOrder", - "value": "desc", - "description": "allows: asc, desc" + "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(\"jobId\", response.id);\r", + " }\r", + "});" + ], + "type": "text/javascript" + } } - ] - } - }, - "response": [] - }, - { - "name": "GET /taas-teams with booking manager", - "request": { - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token_bookingManager}}", - "type": "text" - } - ], - "url": { - "raw": "{{URL}}/taas-teams?perPage=10&page=1&name=*taas*&sortBy=lastActivityAt&sortOrder=desc", - "host": [ - "{{URL}}" - ], - "path": [ - "taas-teams" ], - "query": [ - { - "key": "perPage", - "value": "10" - }, - { - "key": "page", - "value": "1" - }, - { - "key": "name", - "value": "*taas*", - "description": "case-insensitive; support wildcard match" - }, - { - "key": "sortBy", - "value": "lastActivityAt", - "description": "allows: createdAt, updatedAt, lastActivityAt, id, status, name, type, best match" + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token_bookingManager}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"projectId\": {{projectId}},\n \"externalId\": \"1212\",\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"23e00d92-207a-4b5b-b3c9-4c5662644941\",\n \"7d076384-ccf6-4e43-a45d-1b24b1e624aa\",\n \"cbac57a3-7180-4316-8769-73af64893158\",\n \"a2b4bc11-c641-4a19-9eb7-33980378f82e\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "options": { + "raw": { + "language": "json" + } + } }, - { - "key": "sortOrder", - "value": "desc", - "description": "allows: asc, desc" + "url": { + "raw": "{{URL}}/jobs", + "host": [ + "{{URL}}" + ], + "path": [ + "jobs" + ] } - ] + }, + "response": [] + }, + { + "name": "create resource booking", + "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(\"resourceBookingId\", 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 \"projectId\": {{project_id_17234}},\r\n \"userId\": \"a55fe1bc-1754-45fa-9adc-cf3d6d7c377a\",\r\n \"jobId\": \"{{jobId}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-10-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/resourceBookings", + "host": [ + "{{URL}}" + ], + "path": [ + "resourceBookings" + ] + } + }, + "response": [] + }, + { + "name": "create work period", + "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(\"workPeriodId\", 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-07\",\r\n \"endDate\": \"2021-03-13\",\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": [] } - }, - "response": [] + ] }, { - "name": "GET /taas-teams with m2m read", + "name": "create work period payment with boooking manager", + "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(\"workPeriodPaymentId\", response.id);\r", + " }\r", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "Authorization", "type": "text", - "value": "Bearer {{token_m2m_read_taas_team}}" + "value": "Bearer {{token_bookingManager}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{URL}}/taas-teams", + "raw": "{{URL}}/work-period-payments", "host": [ "{{URL}}" ], "path": [ - "taas-teams" + "work-period-payments" ] } }, "response": [] }, { - "name": "GET /taas-teams/:id", + "name": "create work period payment with m2m create", + "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(\"workPeriodPaymentIdCreatedByM2M\", response.id);\r", + " }\r", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "Authorization", - "value": "Bearer {{token_bookingManager}}", - "type": "text" + "type": "text", + "value": "Bearer {{token_m2m_create_work_period_payment}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodIdCreatedByM2M}}\",\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{URL}}/taas-teams/{{projectId}}", + "raw": "{{URL}}/work-period-payments", "host": [ "{{URL}}" ], "path": [ - "taas-teams", - "{{projectId}}" + "work-period-payments" ] } }, "response": [] }, { - "name": "GET /taas-teams/:id with booking manager", + "name": "create work period payment with connect user", + "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": "GET", + "method": "POST", "header": [ { "key": "Authorization", - "value": "Bearer {{token_bookingManager}}", - "type": "text" + "type": "text", + "value": "Bearer {{token_connectUser}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{URL}}/taas-teams/:projectId", + "raw": "{{URL}}/work-period-payments", "host": [ "{{URL}}" ], "path": [ - "taas-teams", - ":projectId" - ], - "variable": [ - { - "key": "projectId", - "value": "16705" - } + "work-period-payments" ] } }, "response": [] }, { - "name": "GET /taas-teams/:id with m2m read", + "name": "create 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": "GET", + "method": "POST", "header": [ { "key": "Authorization", "type": "text", - "value": "Bearer {{token_m2m_read_taas_team}}" + "value": "Bearer {{token_member}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{URL}}/taas-teams/{{projectId}}", + "raw": "{{URL}}/work-period-payments", "host": [ "{{URL}}" ], "path": [ - "taas-teams", - "{{projectId}}" + "work-period-payments" ] } }, "response": [] }, { - "name": "GET /taas-teams/:id/jobs/:jobId", + "name": "create work period payment with user id not exist", + "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(\"Bad Request\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "Authorization", - "value": "Bearer {{token_bookingManager}}", - "type": "text" + "type": "text", + "value": "Bearer {{token_userId_not_exist}}" } ], - "url": { - "raw": "{{URL}}/taas-teams/{{projectId}}/jobs/{{jobId}}", - "host": [ + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments", + "host": [ "{{URL}}" ], "path": [ - "taas-teams", - "{{projectId}}", - "jobs", - "{{jobId}}" + "work-period-payments" ] } }, "response": [] }, { - "name": "GET /taas-teams/:id/jobs/:jobId with booking manager", + "name": "create work period payment with invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 401', function () {\r", + " pm.response.to.have.status(401);\r", + " const response = pm.response.json()\r", + " pm.expect(response.message).to.eq(\"Invalid Token.\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "Authorization", - "value": "Bearer {{token_bookingManager}}", - "type": "text" + "type": "text", + "value": "Bearer invalid_token" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{URL}}/taas-teams/:projectId/jobs/:jobId", + "raw": "{{URL}}/work-period-payments", "host": [ "{{URL}}" ], "path": [ - "taas-teams", - ":projectId", - "jobs", - ":jobId" - ], - "variable": [ - { - "key": "projectId", - "value": "16705" - }, - { - "key": "jobId", - "value": "948a25a6-086f-4a96-aad5-9ccd2d3e87b2" - } + "work-period-payments" ] } }, "response": [] }, { - "name": "GET /taas-teams/:id/jobs/:jobId with m2m read", + "name": "create work period payment with missing workPeriodId", + "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(\"\\\"workPeriodPayment.workPeriodId\\\" is required\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "Authorization", "type": "text", - "value": "Bearer {{token_m2m_read_taas_team}}" + "value": "Bearer {{token_bookingManager}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{URL}}/taas-teams/{{projectId}}/jobs/{{jobId}}", + "raw": "{{URL}}/work-period-payments", "host": [ "{{URL}}" ], "path": [ - "taas-teams", - "{{projectId}}", - "jobs", - "{{jobId}}" + "work-period-payments" ] } }, "response": [] }, { - "name": "GET /taas-teams/skills", + "name": "create work period payment with invalid workPeriodId 1", + "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(\"\\\"workPeriodPayment.workPeriodId\\\" must be a valid GUID\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "Authorization", - "value": "Bearer {{token_member}}", - "type": "text" + "type": "text", + "value": "Bearer {{token_bookingManager}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"aaa-bb-c\",\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{URL}}/taas-teams/skills?perPage=10&page=1&orderBy=name", + "raw": "{{URL}}/work-period-payments", "host": [ "{{URL}}" ], "path": [ - "taas-teams", - "skills" - ], - "query": [ - { - "key": "perPage", - "value": "10" - }, - { - "key": "page", - "value": "1" - }, - { - "key": "orderBy", - "value": "name", - "description": "possible values are defined by /v5/skills" - } + "work-period-payments" ] } }, "response": [] }, { - "name": "POST /taas-teams/email - team-issue-report", + "name": "create work period payment with invalid workPeriodId 2", + "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(\"\\\"workPeriodPayment.workPeriodId\\\" must be a string\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { "method": "POST", "header": [ { "key": "Authorization", - "value": "Bearer {{token_member}}", - "type": "text" - }, - { - "key": "Content-Type", - "value": "application/json", - "type": "text" + "type": "text", + "value": "Bearer {{token_bookingManager}}" } ], "body": { "mode": "raw", - "raw": "{\n \"template\": \"team-issue-report\",\n \"data\": {\n \"projectName\": \"TaaS Project Name\",\n \"projectId\": 12345,\n \"reportText\": \"I have issue with ...\"\n }\n}", + "raw": "{\r\n \"workPeriodId\": 123,\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", "options": { "raw": { "language": "json" @@ -8693,37 +9041,46 @@ } }, "url": { - "raw": "{{URL}}/taas-teams/email", + "raw": "{{URL}}/work-period-payments", "host": [ "{{URL}}" ], "path": [ - "taas-teams", - "email" + "work-period-payments" ] } }, "response": [] }, { - "name": "POST /taas-teams/email - member-issue-report", + "name": "create work period payment with invalid amount 1", + "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(\"\\\"workPeriodPayment.amount\\\" must be a number\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { "method": "POST", "header": [ { "key": "Authorization", "type": "text", - "value": "Bearer {{token_member}}" - }, - { - "key": "Content-Type", - "type": "text", - "value": "application/json" + "value": "Bearer {{token_bookingManager}}" } ], "body": { "mode": "raw", - "raw": "{\n \"template\": \"member-issue-report\",\n \"data\": {\n \"projectName\": \"TaaS Project Name\",\n \"projectId\": 12345,\n \"userHandle\": \"pshah_manager\",\n \"reportText\": \"I have issue with ...\"\n }\n}", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": \"abc\",\r\n \"status\": \"completed\"\r\n}", "options": { "raw": { "language": "json" @@ -8731,37 +9088,46 @@ } }, "url": { - "raw": "{{URL}}/taas-teams/email", + "raw": "{{URL}}/work-period-payments", "host": [ "{{URL}}" ], "path": [ - "taas-teams", - "email" + "work-period-payments" ] } }, "response": [] }, { - "name": "POST /taas-teams/email - extension-request", + "name": "create work period payment with invalid amount 2", + "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(\"\\\"workPeriodPayment.amount\\\" must be greater than 0\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { "method": "POST", "header": [ { "key": "Authorization", "type": "text", - "value": "Bearer {{token_member}}" - }, - { - "key": "Content-Type", - "type": "text", - "value": "application/json" + "value": "Bearer {{token_bookingManager}}" } ], "body": { "mode": "raw", - "raw": "{\n \"template\": \"extension-request\",\n \"data\": {\n \"projectName\": \"TaaS Project Name\",\n \"projectId\": 12345,\n \"userHandle\": \"pshah_manager\",\n \"reportText\": \"I would like to keep working with this member for 2 months...\"\n }\n}", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 0,\r\n \"status\": \"completed\"\r\n}", "options": { "raw": { "language": "json" @@ -8769,37 +9135,46 @@ } }, "url": { - "raw": "{{URL}}/taas-teams/email", + "raw": "{{URL}}/work-period-payments", "host": [ "{{URL}}" ], "path": [ - "taas-teams", - "email" + "work-period-payments" ] } }, "response": [] }, { - "name": "POST /taas-teams/:id/members", + "name": "create work period payment with invalid status 1", + "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(\"\\\"workPeriodPayment.status\\\" must be one of [completed, cancelled]\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { "method": "POST", "header": [ { "key": "Authorization", "type": "text", - "value": "Bearer {{token_administrator}}" - }, - { - "key": "Content-Type", - "type": "text", - "value": "application/json" + "value": "Bearer {{token_bookingManager}}" } ], "body": { "mode": "raw", - "raw": "{\n \"handles\": [\n \"tester1234\",\n \"non-existing\"\n ],\n \"emails\": [\n \"non-existing@domain.com\",\n \"email@domain.com\"\n ]\n}", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 1200,\r\n \"status\": 123\r\n}", "options": { "raw": { "language": "json" @@ -8807,73 +9182,79 @@ } }, "url": { - "raw": "{{URL}}/taas-teams/:id/members", + "raw": "{{URL}}/work-period-payments", "host": [ "{{URL}}" ], "path": [ - "taas-teams", - ":id", - "members" - ], - "variable": [ - { - "key": "id", - "value": "16705" - } + "work-period-payments" ] } }, "response": [] }, { - "name": "GET /taas-teams/:id/members", - "request": { - "method": "GET", - "header": [ - { + "name": "create work period payment with invalid status 2", + "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(\"\\\"workPeriodPayment.status\\\" must be one of [completed, cancelled]\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { "key": "Authorization", "type": "text", "value": "Bearer {{token_bookingManager}}" - }, - { - "key": "Content-Type", - "type": "text", - "value": "application/json" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 1200,\r\n \"status\": \"invalid-status\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{URL}}/taas-teams/:id/members?role=customer&fields=id,userId,role,createdAt,updatedAt,createdBy,updatedBy,handle,photoURL,workingHourStart,workingHourEnd,timeZone,email", + "raw": "{{URL}}/work-period-payments", "host": [ "{{URL}}" ], "path": [ - "taas-teams", - ":id", - "members" - ], - "query": [ - { - "key": "role", - "value": "customer" - }, - { - "key": "fields", - "value": "id,userId,role,createdAt,updatedAt,createdBy,updatedBy,handle,photoURL,workingHourStart,workingHourEnd,timeZone,email" - } - ], - "variable": [ - { - "key": "id", - "value": "16705" - } + "work-period-payments" ] } }, "response": [] }, { - "name": "GET /taas-teams/:id/invites", + "name": "get work period payment with booking 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": "GET", "header": [ @@ -8881,74 +9262,95 @@ "key": "Authorization", "type": "text", "value": "Bearer {{token_bookingManager}}" - }, + } + ], + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + }, + { + "name": "get work period payment with m2m read", + "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": "Content-Type", + "key": "Authorization", "type": "text", - "value": "application/json" + "value": "Bearer {{token_m2m_read_work_period_payment}}" } ], "url": { - "raw": "{{URL}}/taas-teams/:id/invites?fields=createdAt,deletedAt,role,updatedBy,createdBy,id,projectId,userId,email,deletedBy,updatedAt,status", + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentIdCreatedByM2M}}", "host": [ "{{URL}}" ], "path": [ - "taas-teams", - ":id", - "invites" - ], - "query": [ - { - "key": "fields", - "value": "createdAt,deletedAt,role,updatedBy,createdBy,id,projectId,userId,email,deletedBy,updatedAt,status" - } - ], - "variable": [ - { - "key": "id", - "value": "16705" - } + "work-period-payments", + "{{workPeriodPaymentIdCreatedByM2M}}" ] } }, "response": [] }, { - "name": "DELETE /taas-teams/:id/members/:projectMemberId", + "name": "get work period payment with booking manager from db", + "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": "DELETE", + "method": "GET", "header": [ { "key": "Authorization", "type": "text", "value": "Bearer {{token_bookingManager}}" - }, - { - "key": "Content-Type", - "type": "text", - "value": "application/json" } ], "url": { - "raw": "{{URL}}/taas-teams/:id/members/:projectMemberId", + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}?fromDb=true", "host": [ "{{URL}}" ], "path": [ - "taas-teams", - ":id", - "members", - ":projectMemberId" + "work-period-payments", + "{{workPeriodPaymentId}}" ], - "variable": [ - { - "key": "id", - "value": "16705" - }, + "query": [ { - "key": "projectMemberId", - "value": "14327" + "key": "fromDb", + "value": "true" } ] } @@ -8956,247 +9358,2914 @@ "response": [] }, { - "name": "GET /taas-teams/me", + "name": "get work period payment with connect user", + "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": "GET", "header": [ { "key": "Authorization", "type": "text", - "value": "Bearer {{token_member}}" + "value": "Bearer {{token_connectUser}}" } ], "url": { - "raw": "{{URL}}/taas-teams/me", + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", "host": [ "{{URL}}" ], "path": [ - "taas-teams", - "me" + "work-period-payments", + "{{workPeriodPaymentId}}" ] } }, "response": [] - } - ] - }, - { - "name": "health check", - "item": [ + }, { - "name": "health check", + "name": "get 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": "GET", - "header": [], + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_member}}" + } + ], "url": { - "raw": "{{URL}}/health", + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", "host": [ "{{URL}}" ], "path": [ - "health" + "work-period-payments", + "{{workPeriodPaymentId}}" ] } }, "response": [] - } - ] - }, - { - "name": "Create Demo Data For Team", - "item": [ + }, { - "name": "Get Users", - "item": [ + "name": "search work period payments with booking manager", + "event": [ { - "name": "Get Users", - "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}}/work-period-payments", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments" + ], + "query": [ { - "listen": "test", - "script": { - "exec": [ - "var data = JSON.parse(responseBody);", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "var demoUsers = 20;", - "", - "pm.test('We need to have at least ' + demoUsers + ' demo userIds. Define them in {{demoUserIdN}} variables.', function () {", - " for (var i = 0; i < demoUsers; i++) {", - " var variableName = \"demoUserId\" + (i + 1);", - " var existentValue = pm.variables.get(variableName);", - " var user = data[i];", - "", - " pm.expect(!!user || !!existentValue).to.be.true;", - "", - " postman.setEnvironmentVariable(variableName, user.id);", - " }", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token_bookingManager}}", - "type": "string" - } - ] + "key": "page", + "value": "1", + "disabled": true }, - "method": "GET", - "header": [], - "url": { - "raw": "https://api.topcoder-dev.com/v5/users?perPage=20", - "protocol": "https", - "host": [ - "api", - "topcoder-dev", - "com" - ], - "path": [ - "v5", - "users" - ], - "query": [ - { - "key": "perPage", - "value": "20" - } - ] + { + "key": "perPage", + "value": "50", + "disabled": true + }, + { + "key": "sortBy", + "value": "status", + "disabled": true + }, + { + "key": "sortOrder", + "value": "desc", + "disabled": true + }, + { + "key": "workPeriodId", + "value": "{{workPeriodId}}", + "disabled": true + }, + { + "key": "workPeriodIds", + "value": "{{workPeriodId}},{{workPeriodIdCreatedByM2M}}", + "disabled": true + }, + { + "key": "status", + "value": "completed", + "disabled": true } - }, - "response": [] + ] } - ] + }, + "response": [] }, { - "name": "Create job #1 \"sourcing\"", - "item": [ + "name": "search work period payments with m2m all", + "event": [ { - "name": "create job #1", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var data = JSON.parse(responseBody);\r", - "\r", - "pm.test(\"Successful POST request\", function () {\r", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", - "});\r", - "\r", - "postman.setEnvironmentVariable(\"demoJobId1\",data.id);" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{token_bookingManager}}" - } + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});" ], - "body": { - "mode": "raw", - "raw": "{\n \"projectId\": {{projectId}},\n \"externalId\": \"0\",\n \"description\": \"taas-demo-job1\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"weekly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"ee4c50c1-c8c3-475e-b6b6-edbd136a19d6\",\n \"89139c80-d0a2-47c2-aa16-14589d5afd10\",\n \"9f2d9127-6a2e-4506-ad76-c4ab63577b09\",\n \"9515e7ee-83b6-49d1-ba5c-6c59c5a8ef1b\",\n \"c854ab55-5922-4be1-8ecc-b3bc1f8629af\",\n \"8456002e-fa2d-44f0-b0e7-86b1c02b6e4c\",\n \"114b4ec8-805e-4c60-b351-14a955a991a9\",\n \"213408aa-f16f-46c8-bc57-9e569cee3f11\",\n \"b37a48db-f775-4e4e-b403-8ad1d234cdea\",\n \"99b930b5-1b91-4df1-8b17-d9307107bb51\",\n \"6388a632-c3ad-4525-9a73-66a527c03672\",\n \"23839f38-6f19-4de9-9d28-f020056bca73\",\n \"289e42a3-23e9-49be-88e1-6deb93cd8c31\",\n \"b403f209-63b5-42bc-9b5f-1564416640d8\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", - "options": { - "raw": { - "language": "json" - } - } + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_m2m_all_work_period_payment}}" + } + ], + "url": { + "raw": "{{URL}}/work-period-payments", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments" + ], + "query": [ + { + "key": "page", + "value": "1", + "disabled": true }, - "url": { - "raw": "{{URL}}/jobs", - "host": [ - "{{URL}}" - ], - "path": [ - "jobs" - ] + { + "key": "perPage", + "value": "50", + "disabled": true + }, + { + "key": "sortBy", + "value": "status", + "disabled": true + }, + { + "key": "sortOrder", + "value": "desc", + "disabled": true + }, + { + "key": "workPeriodId", + "value": "{{workPeriodId}}", + "disabled": true + }, + { + "key": "workPeriodIds", + "value": "{{workPeriodId}},{{workPeriodIdCreatedByM2M}}", + "disabled": true + }, + { + "key": "status", + "value": "completed", + "disabled": true } - }, - "response": [] + ] } - ] + }, + "response": [] }, { - "name": "Create job #2 \"in-review\"", - "item": [ + "name": "search work period payments with connect user", + "event": [ { - "name": "create job #2", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var data = JSON.parse(responseBody);\r", - "\r", - "pm.test(\"Successful POST request\", function () {\r", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", - "});\r", - "\r", - "postman.setEnvironmentVariable(\"demoJobId2\",data.id);" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{token_bookingManager}}" - } + "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", + "});" ], - "body": { - "mode": "raw", - "raw": "{\n \"projectId\": {{projectId}},\n \"externalId\": \"0\",\n \"description\": \"taas-demo-job2\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 7,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"weekly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"213408aa-f16f-46c8-bc57-9e569cee3f11\",\n \"b37a48db-f775-4e4e-b403-8ad1d234cdea\",\n \"99b930b5-1b91-4df1-8b17-d9307107bb51\",\n \"6388a632-c3ad-4525-9a73-66a527c03672\",\n \"23839f38-6f19-4de9-9d28-f020056bca73\",\n \"289e42a3-23e9-49be-88e1-6deb93cd8c31\",\n \"b403f209-63b5-42bc-9b5f-1564416640d8\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", - "options": { - "raw": { - "language": "json" - } - } + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_connectUser}}" + } + ], + "url": { + "raw": "{{URL}}/work-period-payments", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments" + ], + "query": [ + { + "key": "page", + "value": "1", + "disabled": true }, - "url": { - "raw": "{{URL}}/jobs", - "host": [ - "{{URL}}" - ], - "path": [ - "jobs" - ] - } - }, + { + "key": "perPage", + "value": "50", + "disabled": true + }, + { + "key": "sortBy", + "value": "status", + "disabled": true + }, + { + "key": "sortOrder", + "value": "desc", + "disabled": true + }, + { + "key": "workPeriodId", + "value": "{{workPeriodId}}", + "disabled": true + }, + { + "key": "workPeriodIds", + "value": "{{workPeriodId}},{{workPeriodIdCreatedByM2M}}", + "disabled": true + }, + { + "key": "status", + "value": "completed", + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "search work period payments 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": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_member}}" + } + ], + "url": { + "raw": "{{URL}}/work-period-payments", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments" + ], + "query": [ + { + "key": "page", + "value": "1", + "disabled": true + }, + { + "key": "perPage", + "value": "50", + "disabled": true + }, + { + "key": "sortBy", + "value": "status", + "disabled": true + }, + { + "key": "sortOrder", + "value": "desc", + "disabled": true + }, + { + "key": "workPeriodId", + "value": "{{workPeriodId}}", + "disabled": true + }, + { + "key": "workPeriodIds", + "value": "{{workPeriodId}},{{workPeriodIdCreatedByM2M}}", + "disabled": true + }, + { + "key": "status", + "value": "completed", + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "search work period payments with invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 401', function () {\r", + " pm.response.to.have.status(401);\r", + " const response = pm.response.json()\r", + " pm.expect(response.message).to.eq(\"Invalid Token.\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer invalid_token" + } + ], + "url": { + "raw": "{{URL}}/work-period-payments", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments" + ], + "query": [ + { + "key": "page", + "value": "1", + "disabled": true + }, + { + "key": "perPage", + "value": "50", + "disabled": true + }, + { + "key": "sortBy", + "value": "status", + "disabled": true + }, + { + "key": "sortOrder", + "value": "desc", + "disabled": true + }, + { + "key": "workPeriodId", + "value": "{{workPeriodId}}", + "disabled": true + }, + { + "key": "workPeriodIds", + "value": "{{workPeriodId}},{{workPeriodIdCreatedByM2M}}", + "disabled": true + }, + { + "key": "status", + "value": "completed", + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "put work period payment 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": "PUT", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 1600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + }, + { + "name": "put work period payment with m2m create", + "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": "PUT", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_m2m_update_work_period_payment}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodIdCreatedByM2M}}\",\r\n \"amount\": 1600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentIdCreatedByM2M}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentIdCreatedByM2M}}" + ] + } + }, + "response": [] + }, + { + "name": "put work period payment with connect user", + "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": "PUT", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_connectUser}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + }, + { + "name": "put 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": "PUT", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_member}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + }, + { + "name": "put work period payment with user id not exist", + "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(\"Bad Request\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_userId_not_exist}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + }, + { + "name": "put work period payment with invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 401', function () {\r", + " pm.response.to.have.status(401);\r", + " const response = pm.response.json()\r", + " pm.expect(response.message).to.eq(\"Invalid Token.\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer invalid_token" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + }, + { + "name": "put work period payment with missing workPeriodId", + "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(\"\\\"data.workPeriodId\\\" is required\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + }, + { + "name": "put work period payment with invalid workPeriodId 1", + "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(\"\\\"data.workPeriodId\\\" must be a valid GUID\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"aaa-bb-c\",\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + }, + { + "name": "put work period payment with invalid workPeriodId 2", + "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(\"\\\"data.workPeriodId\\\" must be a string\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": 123,\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + }, + { + "name": "put work period payment with invalid amount 1", + "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(\"\\\"data.amount\\\" must be a number\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": \"abc\",\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + }, + { + "name": "put work period payment with invalid amount 2", + "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(\"\\\"data.amount\\\" must be greater than 0\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 0,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + }, + { + "name": "put work period payment with invalid status 1", + "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(\"\\\"data.status\\\" must be one of [completed, cancelled]\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 1200,\r\n \"status\": 123\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + }, + { + "name": "put work period payment with invalid status 2", + "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(\"\\\"data.status\\\" must be one of [completed, cancelled]\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 1200,\r\n \"status\": \"invalid-status\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + }, + { + "name": "patch work period payment 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": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 450,\r\n \"status\": \"cancelled\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + }, + { + "name": "patch work period payment with m2m create", + "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": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_m2m_update_work_period_payment}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodIdCreatedByM2M}}\",\r\n \"amount\": 450,\r\n \"status\": \"cancelled\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentIdCreatedByM2M}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentIdCreatedByM2M}}" + ] + } + }, + "response": [] + }, + { + "name": "patch work period payment with connect user", + "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": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_connectUser}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + }, + { + "name": "patch 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": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_member}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + }, + { + "name": "patch work period payment with user id not exist", + "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(\"Bad Request\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_userId_not_exist}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + }, + { + "name": "patch work period payment with invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 401', function () {\r", + " pm.response.to.have.status(401);\r", + " const response = pm.response.json()\r", + " pm.expect(response.message).to.eq(\"Invalid Token.\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer invalid_token" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + }, + { + "name": "patch work period payment with invalid workPeriodId 1", + "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(\"\\\"data.workPeriodId\\\" must be a valid GUID\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"aaa-bb-c\",\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + }, + { + "name": "patch work period payment with invalid workPeriodId 2", + "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(\"\\\"data.workPeriodId\\\" must be a string\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": 123,\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + }, + { + "name": "patch work period payment with invalid amount 1", + "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(\"\\\"data.amount\\\" must be a number\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": \"abc\",\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + }, + { + "name": "patch work period payment with invalid amount 2", + "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(\"\\\"data.amount\\\" must be greater than 0\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 0,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + }, + { + "name": "patch work period payment with invalid status 1", + "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(\"\\\"data.status\\\" must be one of [completed, cancelled]\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 1200,\r\n \"status\": 123\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + }, + { + "name": "patch work period payment with invalid status 2", + "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(\"\\\"data.status\\\" must be one of [completed, cancelled]\")\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 1200,\r\n \"status\": \"invalid-status\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Taas Teams", + "item": [ + { + "name": "GET /taas-teams", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token_bookingManager}}", + "type": "text" + } + ], + "url": { + "raw": "{{URL}}/taas-teams?perPage=10&page=1&name=*taas*&sortBy=lastActivityAt&sortOrder=desc", + "host": [ + "{{URL}}" + ], + "path": [ + "taas-teams" + ], + "query": [ + { + "key": "perPage", + "value": "10" + }, + { + "key": "page", + "value": "1" + }, + { + "key": "name", + "value": "*taas*", + "description": "case-insensitive; support wildcard match" + }, + { + "key": "sortBy", + "value": "lastActivityAt", + "description": "allows: createdAt, updatedAt, lastActivityAt, id, status, name, type, best match" + }, + { + "key": "sortOrder", + "value": "desc", + "description": "allows: asc, desc" + } + ] + } + }, + "response": [] + }, + { + "name": "GET /taas-teams with booking manager", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token_bookingManager}}", + "type": "text" + } + ], + "url": { + "raw": "{{URL}}/taas-teams?perPage=10&page=1&name=*taas*&sortBy=lastActivityAt&sortOrder=desc", + "host": [ + "{{URL}}" + ], + "path": [ + "taas-teams" + ], + "query": [ + { + "key": "perPage", + "value": "10" + }, + { + "key": "page", + "value": "1" + }, + { + "key": "name", + "value": "*taas*", + "description": "case-insensitive; support wildcard match" + }, + { + "key": "sortBy", + "value": "lastActivityAt", + "description": "allows: createdAt, updatedAt, lastActivityAt, id, status, name, type, best match" + }, + { + "key": "sortOrder", + "value": "desc", + "description": "allows: asc, desc" + } + ] + } + }, + "response": [] + }, + { + "name": "GET /taas-teams with m2m read", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_m2m_read_taas_team}}" + } + ], + "url": { + "raw": "{{URL}}/taas-teams", + "host": [ + "{{URL}}" + ], + "path": [ + "taas-teams" + ] + } + }, + "response": [] + }, + { + "name": "GET /taas-teams/:id", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token_bookingManager}}", + "type": "text" + } + ], + "url": { + "raw": "{{URL}}/taas-teams/{{projectId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "taas-teams", + "{{projectId}}" + ] + } + }, + "response": [] + }, + { + "name": "GET /taas-teams/:id with booking manager", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token_bookingManager}}", + "type": "text" + } + ], + "url": { + "raw": "{{URL}}/taas-teams/:projectId", + "host": [ + "{{URL}}" + ], + "path": [ + "taas-teams", + ":projectId" + ], + "variable": [ + { + "key": "projectId", + "value": "16705" + } + ] + } + }, + "response": [] + }, + { + "name": "GET /taas-teams/:id with m2m read", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_m2m_read_taas_team}}" + } + ], + "url": { + "raw": "{{URL}}/taas-teams/{{projectId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "taas-teams", + "{{projectId}}" + ] + } + }, + "response": [] + }, + { + "name": "GET /taas-teams/:id/jobs/:jobId", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token_bookingManager}}", + "type": "text" + } + ], + "url": { + "raw": "{{URL}}/taas-teams/{{projectId}}/jobs/{{jobId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "taas-teams", + "{{projectId}}", + "jobs", + "{{jobId}}" + ] + } + }, + "response": [] + }, + { + "name": "GET /taas-teams/:id/jobs/:jobId with booking manager", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token_bookingManager}}", + "type": "text" + } + ], + "url": { + "raw": "{{URL}}/taas-teams/:projectId/jobs/:jobId", + "host": [ + "{{URL}}" + ], + "path": [ + "taas-teams", + ":projectId", + "jobs", + ":jobId" + ], + "variable": [ + { + "key": "projectId", + "value": "16705" + }, + { + "key": "jobId", + "value": "948a25a6-086f-4a96-aad5-9ccd2d3e87b2" + } + ] + } + }, + "response": [] + }, + { + "name": "GET /taas-teams/:id/jobs/:jobId with m2m read", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_m2m_read_taas_team}}" + } + ], + "url": { + "raw": "{{URL}}/taas-teams/{{projectId}}/jobs/{{jobId}}", + "host": [ + "{{URL}}" + ], + "path": [ + "taas-teams", + "{{projectId}}", + "jobs", + "{{jobId}}" + ] + } + }, + "response": [] + }, + { + "name": "GET /taas-teams/skills", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token_member}}", + "type": "text" + } + ], + "url": { + "raw": "{{URL}}/taas-teams/skills?perPage=10&page=1&orderBy=name", + "host": [ + "{{URL}}" + ], + "path": [ + "taas-teams", + "skills" + ], + "query": [ + { + "key": "perPage", + "value": "10" + }, + { + "key": "page", + "value": "1" + }, + { + "key": "orderBy", + "value": "name", + "description": "possible values are defined by /v5/skills" + } + ] + } + }, + "response": [] + }, + { + "name": "POST /taas-teams/email - team-issue-report", + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token_member}}", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"template\": \"team-issue-report\",\n \"data\": {\n \"projectName\": \"TaaS Project Name\",\n \"projectId\": 12345,\n \"reportText\": \"I have issue with ...\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/taas-teams/email", + "host": [ + "{{URL}}" + ], + "path": [ + "taas-teams", + "email" + ] + } + }, + "response": [] + }, + { + "name": "POST /taas-teams/email - member-issue-report", + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_member}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"template\": \"member-issue-report\",\n \"data\": {\n \"projectName\": \"TaaS Project Name\",\n \"projectId\": 12345,\n \"userHandle\": \"pshah_manager\",\n \"reportText\": \"I have issue with ...\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/taas-teams/email", + "host": [ + "{{URL}}" + ], + "path": [ + "taas-teams", + "email" + ] + } + }, + "response": [] + }, + { + "name": "POST /taas-teams/email - extension-request", + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_member}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"template\": \"extension-request\",\n \"data\": {\n \"projectName\": \"TaaS Project Name\",\n \"projectId\": 12345,\n \"userHandle\": \"pshah_manager\",\n \"reportText\": \"I would like to keep working with this member for 2 months...\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/taas-teams/email", + "host": [ + "{{URL}}" + ], + "path": [ + "taas-teams", + "email" + ] + } + }, + "response": [] + }, + { + "name": "POST /taas-teams/:id/members", + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_administrator}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"handles\": [\n \"tester1234\",\n \"non-existing\"\n ],\n \"emails\": [\n \"non-existing@domain.com\",\n \"email@domain.com\"\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/taas-teams/:id/members", + "host": [ + "{{URL}}" + ], + "path": [ + "taas-teams", + ":id", + "members" + ], + "variable": [ + { + "key": "id", + "value": "16705" + } + ] + } + }, + "response": [] + }, + { + "name": "GET /taas-teams/:id/members", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "url": { + "raw": "{{URL}}/taas-teams/:id/members?role=customer&fields=id,userId,role,createdAt,updatedAt,createdBy,updatedBy,handle,photoURL,workingHourStart,workingHourEnd,timeZone,email", + "host": [ + "{{URL}}" + ], + "path": [ + "taas-teams", + ":id", + "members" + ], + "query": [ + { + "key": "role", + "value": "customer" + }, + { + "key": "fields", + "value": "id,userId,role,createdAt,updatedAt,createdBy,updatedBy,handle,photoURL,workingHourStart,workingHourEnd,timeZone,email" + } + ], + "variable": [ + { + "key": "id", + "value": "16705" + } + ] + } + }, + "response": [] + }, + { + "name": "GET /taas-teams/:id/invites", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "url": { + "raw": "{{URL}}/taas-teams/:id/invites?fields=createdAt,deletedAt,role,updatedBy,createdBy,id,projectId,userId,email,deletedBy,updatedAt,status", + "host": [ + "{{URL}}" + ], + "path": [ + "taas-teams", + ":id", + "invites" + ], + "query": [ + { + "key": "fields", + "value": "createdAt,deletedAt,role,updatedBy,createdBy,id,projectId,userId,email,deletedBy,updatedAt,status" + } + ], + "variable": [ + { + "key": "id", + "value": "16705" + } + ] + } + }, + "response": [] + }, + { + "name": "DELETE /taas-teams/:id/members/:projectMemberId", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "url": { + "raw": "{{URL}}/taas-teams/:id/members/:projectMemberId", + "host": [ + "{{URL}}" + ], + "path": [ + "taas-teams", + ":id", + "members", + ":projectMemberId" + ], + "variable": [ + { + "key": "id", + "value": "16705" + }, + { + "key": "projectMemberId", + "value": "14327" + } + ] + } + }, + "response": [] + }, + { + "name": "GET /taas-teams/me", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_member}}" + } + ], + "url": { + "raw": "{{URL}}/taas-teams/me", + "host": [ + "{{URL}}" + ], + "path": [ + "taas-teams", + "me" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "health check", + "item": [ + { + "name": "health check", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{URL}}/health", + "host": [ + "{{URL}}" + ], + "path": [ + "health" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Create Demo Data For Team", + "item": [ + { + "name": "Get Users", + "item": [ + { + "name": "Get Users", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var data = JSON.parse(responseBody);", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "var demoUsers = 20;", + "", + "pm.test('We need to have at least ' + demoUsers + ' demo userIds. Define them in {{demoUserIdN}} variables.', function () {", + " for (var i = 0; i < demoUsers; i++) {", + " var variableName = \"demoUserId\" + (i + 1);", + " var existentValue = pm.variables.get(variableName);", + " var user = data[i];", + "", + " pm.expect(!!user || !!existentValue).to.be.true;", + "", + " postman.setEnvironmentVariable(variableName, user.id);", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token_bookingManager}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "https://api.topcoder-dev.com/v5/users?perPage=20", + "protocol": "https", + "host": [ + "api", + "topcoder-dev", + "com" + ], + "path": [ + "v5", + "users" + ], + "query": [ + { + "key": "perPage", + "value": "20" + } + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Create job #1 \"sourcing\"", + "item": [ + { + "name": "create job #1", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var data = JSON.parse(responseBody);\r", + "\r", + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", + "});\r", + "\r", + "postman.setEnvironmentVariable(\"demoJobId1\",data.id);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"projectId\": {{projectId}},\n \"externalId\": \"0\",\n \"description\": \"taas-demo-job1\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"weekly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"ee4c50c1-c8c3-475e-b6b6-edbd136a19d6\",\n \"89139c80-d0a2-47c2-aa16-14589d5afd10\",\n \"9f2d9127-6a2e-4506-ad76-c4ab63577b09\",\n \"9515e7ee-83b6-49d1-ba5c-6c59c5a8ef1b\",\n \"c854ab55-5922-4be1-8ecc-b3bc1f8629af\",\n \"8456002e-fa2d-44f0-b0e7-86b1c02b6e4c\",\n \"114b4ec8-805e-4c60-b351-14a955a991a9\",\n \"213408aa-f16f-46c8-bc57-9e569cee3f11\",\n \"b37a48db-f775-4e4e-b403-8ad1d234cdea\",\n \"99b930b5-1b91-4df1-8b17-d9307107bb51\",\n \"6388a632-c3ad-4525-9a73-66a527c03672\",\n \"23839f38-6f19-4de9-9d28-f020056bca73\",\n \"289e42a3-23e9-49be-88e1-6deb93cd8c31\",\n \"b403f209-63b5-42bc-9b5f-1564416640d8\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobs", + "host": [ + "{{URL}}" + ], + "path": [ + "jobs" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Create job #2 \"in-review\"", + "item": [ + { + "name": "create job #2", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var data = JSON.parse(responseBody);\r", + "\r", + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", + "});\r", + "\r", + "postman.setEnvironmentVariable(\"demoJobId2\",data.id);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"projectId\": {{projectId}},\n \"externalId\": \"0\",\n \"description\": \"taas-demo-job2\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 7,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"weekly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"213408aa-f16f-46c8-bc57-9e569cee3f11\",\n \"b37a48db-f775-4e4e-b403-8ad1d234cdea\",\n \"99b930b5-1b91-4df1-8b17-d9307107bb51\",\n \"6388a632-c3ad-4525-9a73-66a527c03672\",\n \"23839f38-6f19-4de9-9d28-f020056bca73\",\n \"289e42a3-23e9-49be-88e1-6deb93cd8c31\",\n \"b403f209-63b5-42bc-9b5f-1564416640d8\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobs", + "host": [ + "{{URL}}" + ], + "path": [ + "jobs" + ] + } + }, + "response": [] + }, + { + "name": "create job #2 candidate 1", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var data = JSON.parse(responseBody);\r", + "\r", + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", + "});\r", + "\r", + "postman.setEnvironmentVariable(\"demoJob1candidateId1\",data.id);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"jobId\": \"{{demoJobId2}}\",\r\n \"userId\": \"{{demoUserId1}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobCandidates", + "host": [ + "{{URL}}" + ], + "path": [ + "jobCandidates" + ] + } + }, + "response": [] + }, + { + "name": "create job #2 candidate 2", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var data = JSON.parse(responseBody);\r", + "\r", + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", + "});\r", + "\r", + "postman.setEnvironmentVariable(\"demoJob1candidateId2\",data.id);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"jobId\": \"{{demoJobId2}}\",\r\n \"userId\": \"{{demoUserId2}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobCandidates", + "host": [ + "{{URL}}" + ], + "path": [ + "jobCandidates" + ] + } + }, + "response": [] + }, + { + "name": "create job #2 candidate 3", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Successful POST request\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"jobId\": \"{{demoJobId2}}\",\r\n \"userId\": \"{{demoUserId3}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobCandidates", + "host": [ + "{{URL}}" + ], + "path": [ + "jobCandidates" + ] + } + }, + "response": [] + }, + { + "name": "create job #2 candidate 4", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Successful POST request\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"jobId\": \"{{demoJobId2}}\",\r\n \"userId\": \"{{demoUserId4}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobCandidates", + "host": [ + "{{URL}}" + ], + "path": [ + "jobCandidates" + ] + } + }, + "response": [] + }, + { + "name": "create job #2 candidate 5", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Successful POST request\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"jobId\": \"{{demoJobId2}}\",\r\n \"userId\": \"{{demoUserId5}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobCandidates", + "host": [ + "{{URL}}" + ], + "path": [ + "jobCandidates" + ] + } + }, + "response": [] + }, + { + "name": "create job #2 candidate 6", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Successful POST request\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"jobId\": \"{{demoJobId2}}\",\r\n \"userId\": \"{{demoUserId6}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobCandidates", + "host": [ + "{{URL}}" + ], + "path": [ + "jobCandidates" + ] + } + }, + "response": [] + }, + { + "name": "create job #2 candidate 7", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Successful POST request\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"jobId\": \"{{demoJobId2}}\",\r\n \"userId\": \"{{demoUserId7}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobCandidates", + "host": [ + "{{URL}}" + ], + "path": [ + "jobCandidates" + ] + } + }, + "response": [] + }, + { + "name": "create job #2 candidate 8", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Successful POST request\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"jobId\": \"{{demoJobId2}}\",\r\n \"userId\": \"{{demoUserId8}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobCandidates", + "host": [ + "{{URL}}" + ], + "path": [ + "jobCandidates" + ] + } + }, + "response": [] + }, + { + "name": "create job #2 candidate 9", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Successful POST request\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"jobId\": \"{{demoJobId2}}\",\r\n \"userId\": \"{{demoUserId9}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobCandidates", + "host": [ + "{{URL}}" + ], + "path": [ + "jobCandidates" + ] + } + }, "response": [] }, { - "name": "create job #2 candidate 1", + "name": "create job #2 candidate 10", "event": [ { "listen": "test", "script": { "exec": [ - "var data = JSON.parse(responseBody);\r", - "\r", - "pm.test(\"Successful POST request\", function () {\r", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", - "});\r", - "\r", - "postman.setEnvironmentVariable(\"demoJob1candidateId1\",data.id);" + "pm.test(\"Successful POST request\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", + "});" ], "type": "text/javascript" } @@ -9213,7 +12282,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{demoJobId2}}\",\r\n \"userId\": \"{{demoUserId1}}\"\r\n}", + "raw": "{\r\n \"jobId\": \"{{demoJobId2}}\",\r\n \"userId\": \"{{demoUserId10}}\"\r\n}", "options": { "raw": { "language": "json" @@ -9233,26 +12302,22 @@ "response": [] }, { - "name": "create job #2 candidate 2", + "name": "update job #2 candidate 1 to \"shortlist\"", "event": [ { "listen": "test", "script": { "exec": [ - "var data = JSON.parse(responseBody);\r", - "\r", - "pm.test(\"Successful POST request\", function () {\r", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", - "});\r", - "\r", - "postman.setEnvironmentVariable(\"demoJob1candidateId2\",data.id);" + "pm.test(\"Successful PATCH request\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "PATCH", "header": [ { "key": "Authorization", @@ -9262,7 +12327,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{demoJobId2}}\",\r\n \"userId\": \"{{demoUserId2}}\"\r\n}", + "raw": "{\r\n \"status\": \"shortlist\"\r\n}", "options": { "raw": { "language": "json" @@ -9270,25 +12335,26 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates", + "raw": "{{URL}}/jobCandidates/{{demoJob1candidateId1}}", "host": [ "{{URL}}" ], "path": [ - "jobCandidates" + "jobCandidates", + "{{demoJob1candidateId1}}" ] } }, "response": [] }, { - "name": "create job #2 candidate 3", + "name": "update job #2 candidate 2 to \"rejected\"", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Successful POST request\", function () {", + "pm.test(\"Successful PATCH request\", function () {", " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", "});" ], @@ -9297,7 +12363,7 @@ } ], "request": { - "method": "POST", + "method": "PATCH", "header": [ { "key": "Authorization", @@ -9307,7 +12373,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{demoJobId2}}\",\r\n \"userId\": \"{{demoUserId3}}\"\r\n}", + "raw": "{\r\n \"status\": \"rejected\"\r\n}", "options": { "raw": { "language": "json" @@ -9315,25 +12381,26 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates", + "raw": "{{URL}}/jobCandidates/{{demoJob1candidateId2}}", "host": [ "{{URL}}" ], "path": [ - "jobCandidates" + "jobCandidates", + "{{demoJob1candidateId2}}" ] } }, "response": [] }, { - "name": "create job #2 candidate 4", + "name": "update job #2 status to \"in-review\"", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Successful POST request\", function () {", + "pm.test(\"Successful PATCH request\", function () {", " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", "});" ], @@ -9342,7 +12409,7 @@ } ], "request": { - "method": "POST", + "method": "PATCH", "header": [ { "key": "Authorization", @@ -9352,7 +12419,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{demoJobId2}}\",\r\n \"userId\": \"{{demoUserId4}}\"\r\n}", + "raw": "{\r\n \"status\": \"in-review\"\r\n}", "options": { "raw": { "language": "json" @@ -9360,27 +12427,37 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates", + "raw": "{{URL}}/jobs/{{demoJobId2}}", "host": [ "{{URL}}" ], "path": [ - "jobCandidates" + "jobs", + "{{demoJobId2}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Create job #3 \"assigned\"", + "item": [ { - "name": "create job #2 candidate 5", + "name": "create job #3", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Successful POST request\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", - "});" + "var data = JSON.parse(responseBody);\r", + "\r", + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", + "});\r", + "\r", + "postman.setEnvironmentVariable(\"demoJobId3\",data.id);" ], "type": "text/javascript" } @@ -9397,7 +12474,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{demoJobId2}}\",\r\n \"userId\": \"{{demoUserId5}}\"\r\n}", + "raw": "{\n \"projectId\": {{projectId}},\n \"externalId\": \"0\",\n \"description\": \"taas-demo-job3\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 7,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"weekly\",\n \"workload\": \"full-time\",\n \"skills\": [],\n \"title\": \"Dummy title - at most 64 characters\"\n}", "options": { "raw": { "language": "json" @@ -9405,19 +12482,19 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates", + "raw": "{{URL}}/jobs", "host": [ "{{URL}}" ], "path": [ - "jobCandidates" + "jobs" ] } }, "response": [] }, { - "name": "create job #2 candidate 6", + "name": "create job #3 candidate 11", "event": [ { "listen": "test", @@ -9442,7 +12519,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{demoJobId2}}\",\r\n \"userId\": \"{{demoUserId6}}\"\r\n}", + "raw": "{\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"userId\": \"{{demoUserId11}}\"\r\n}", "options": { "raw": { "language": "json" @@ -9462,7 +12539,7 @@ "response": [] }, { - "name": "create job #2 candidate 7", + "name": "create job #3 candidate 12", "event": [ { "listen": "test", @@ -9487,7 +12564,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{demoJobId2}}\",\r\n \"userId\": \"{{demoUserId7}}\"\r\n}", + "raw": "{\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"userId\": \"{{demoUserId12}}\"\r\n}", "options": { "raw": { "language": "json" @@ -9507,7 +12584,7 @@ "response": [] }, { - "name": "create job #2 candidate 8", + "name": "create job #3 candidate 13", "event": [ { "listen": "test", @@ -9532,7 +12609,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{demoJobId2}}\",\r\n \"userId\": \"{{demoUserId8}}\"\r\n}", + "raw": "{\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"userId\": \"{{demoUserId13}}\"\r\n}", "options": { "raw": { "language": "json" @@ -9552,7 +12629,7 @@ "response": [] }, { - "name": "create job #2 candidate 9", + "name": "create job #3 candidate 14", "event": [ { "listen": "test", @@ -9577,7 +12654,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{demoJobId2}}\",\r\n \"userId\": \"{{demoUserId9}}\"\r\n}", + "raw": "{\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"userId\": \"{{demoUserId14}}\"\r\n}", "options": { "raw": { "language": "json" @@ -9597,7 +12674,7 @@ "response": [] }, { - "name": "create job #2 candidate 10", + "name": "create job #3 candidate 15", "event": [ { "listen": "test", @@ -9622,7 +12699,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{demoJobId2}}\",\r\n \"userId\": \"{{demoUserId10}}\"\r\n}", + "raw": "{\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"userId\": \"{{demoUserId15}}\"\r\n}", "options": { "raw": { "language": "json" @@ -9642,13 +12719,13 @@ "response": [] }, { - "name": "update job #2 candidate 1 to \"shortlist\"", + "name": "create job #3 candidate 16", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Successful PATCH request\", function () {", + "pm.test(\"Successful POST request\", function () {", " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", "});" ], @@ -9657,7 +12734,7 @@ } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Authorization", @@ -9667,7 +12744,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"status\": \"shortlist\"\r\n}", + "raw": "{\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"userId\": \"{{demoUserId16}}\"\r\n}", "options": { "raw": { "language": "json" @@ -9675,26 +12752,25 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates/{{demoJob1candidateId1}}", + "raw": "{{URL}}/jobCandidates", "host": [ "{{URL}}" ], "path": [ - "jobCandidates", - "{{demoJob1candidateId1}}" + "jobCandidates" ] } }, "response": [] }, { - "name": "update job #2 candidate 2 to \"rejected\"", + "name": "create job #3 candidate 17", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Successful PATCH request\", function () {", + "pm.test(\"Successful POST request\", function () {", " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", "});" ], @@ -9703,7 +12779,7 @@ } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Authorization", @@ -9713,7 +12789,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"status\": \"rejected\"\r\n}", + "raw": "{\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"userId\": \"{{demoUserId17}}\"\r\n}", "options": { "raw": { "language": "json" @@ -9721,26 +12797,25 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates/{{demoJob1candidateId2}}", + "raw": "{{URL}}/jobCandidates", "host": [ "{{URL}}" ], "path": [ - "jobCandidates", - "{{demoJob1candidateId2}}" + "jobCandidates" ] } }, "response": [] }, { - "name": "update job #2 status to \"in-review\"", + "name": "create job #3 candidate 18", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Successful PATCH request\", function () {", + "pm.test(\"Successful POST request\", function () {", " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", "});" ], @@ -9749,7 +12824,7 @@ } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Authorization", @@ -9759,7 +12834,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"status\": \"in-review\"\r\n}", + "raw": "{\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"userId\": \"{{demoUserId18}}\"\r\n}", "options": { "raw": { "language": "json" @@ -9767,37 +12842,27 @@ } }, "url": { - "raw": "{{URL}}/jobs/{{demoJobId2}}", + "raw": "{{URL}}/jobCandidates", "host": [ "{{URL}}" ], "path": [ - "jobs", - "{{demoJobId2}}" + "jobCandidates" ] } }, "response": [] - } - ] - }, - { - "name": "Create job #3 \"assigned\"", - "item": [ + }, { - "name": "create job #3", + "name": "create job #3 candidate 19", "event": [ { "listen": "test", "script": { "exec": [ - "var data = JSON.parse(responseBody);\r", - "\r", - "pm.test(\"Successful POST request\", function () {\r", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", - "});\r", - "\r", - "postman.setEnvironmentVariable(\"demoJobId3\",data.id);" + "pm.test(\"Successful POST request\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", + "});" ], "type": "text/javascript" } @@ -9814,7 +12879,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"projectId\": {{projectId}},\n \"externalId\": \"0\",\n \"description\": \"taas-demo-job3\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 7,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"weekly\",\n \"workload\": \"full-time\",\n \"skills\": [],\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "raw": "{\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"userId\": \"{{demoUserId19}}\"\r\n}", "options": { "raw": { "language": "json" @@ -9822,19 +12887,19 @@ } }, "url": { - "raw": "{{URL}}/jobs", + "raw": "{{URL}}/jobCandidates", "host": [ "{{URL}}" ], "path": [ - "jobs" + "jobCandidates" ] } }, "response": [] }, { - "name": "create job #3 candidate 11", + "name": "create job #3 candidate 20", "event": [ { "listen": "test", @@ -9859,7 +12924,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"userId\": \"{{demoUserId11}}\"\r\n}", + "raw": "{\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"userId\": \"{{demoUserId20}}\"\r\n}", "options": { "raw": { "language": "json" @@ -9879,15 +12944,35 @@ "response": [] }, { - "name": "create job #3 candidate 12", + "name": "create job 3 resource booking 11", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Successful POST request\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", - "});" + "var data = JSON.parse(responseBody);\r", + "\r", + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", + "});\r", + "\r", + "postman.setEnvironmentVariable(\"demoJob3resourceCandiateId11\",data.id);" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "const startDate = new Date()", + "startDate.setDate(startDate.getDate() - 3);", + "", + "const endDate = new Date()", + "endDate.setDate(endDate.getDate() + 3);", + "", + "postman.setEnvironmentVariable(\"resourceStartDate\", startDate.toUTCString());", + "postman.setEnvironmentVariable(\"resourceEndDate\", endDate.toUTCString());" ], "type": "text/javascript" } @@ -9904,7 +12989,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"userId\": \"{{demoUserId12}}\"\r\n}", + "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"{{demoUserId11}}\",\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"startDate\": \"{{resourceStartDate}}\",\r\n \"endDate\": \"{{resourceEndDate}}\",\r\n \"memberRate\": 1000,\r\n \"customerRate\": 1200,\r\n \"rateType\": \"weekly\"\r\n}", "options": { "raw": { "language": "json" @@ -9912,27 +12997,47 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates", + "raw": "{{URL}}/resourceBookings", "host": [ "{{URL}}" ], "path": [ - "jobCandidates" + "resourceBookings" ] } }, "response": [] }, { - "name": "create job #3 candidate 13", + "name": "create job 3 resource booking 12", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Successful POST request\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", - "});" + "var data = JSON.parse(responseBody);\r", + "\r", + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", + "});\r", + "\r", + "postman.setEnvironmentVariable(\"demoJob3resourceCandiateId12\",data.id);" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "const startDate = new Date()", + "startDate.setDate(startDate.getDate() - 3);", + "", + "const endDate = new Date()", + "endDate.setDate(endDate.getDate() + 3);", + "", + "postman.setEnvironmentVariable(\"resourceStartDate\", startDate.toUTCString());", + "postman.setEnvironmentVariable(\"resourceEndDate\", endDate.toUTCString());" ], "type": "text/javascript" } @@ -9949,7 +13054,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"userId\": \"{{demoUserId13}}\"\r\n}", + "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"{{demoUserId12}}\",\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"startDate\": \"{{resourceStartDate}}\",\r\n \"endDate\": \"{{resourceEndDate}}\",\r\n \"memberRate\": 1000,\r\n \"customerRate\": 1200,\r\n \"rateType\": \"weekly\"\r\n}", "options": { "raw": { "language": "json" @@ -9957,27 +13062,47 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates", + "raw": "{{URL}}/resourceBookings", "host": [ "{{URL}}" ], "path": [ - "jobCandidates" + "resourceBookings" ] } }, "response": [] }, { - "name": "create job #3 candidate 14", + "name": "create job 3 resource booking 13", "event": [ { - "listen": "test", + "listen": "test", + "script": { + "exec": [ + "var data = JSON.parse(responseBody);\r", + "\r", + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", + "});\r", + "\r", + "postman.setEnvironmentVariable(\"demoJob3resourceCandiateId13\",data.id);" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", "script": { "exec": [ - "pm.test(\"Successful POST request\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", - "});" + "const startDate = new Date()", + "startDate.setDate(startDate.getDate() - 3);", + "", + "const endDate = new Date()", + "endDate.setDate(endDate.getDate() + 3);", + "", + "postman.setEnvironmentVariable(\"resourceStartDate\", startDate.toUTCString());", + "postman.setEnvironmentVariable(\"resourceEndDate\", endDate.toUTCString());" ], "type": "text/javascript" } @@ -9994,7 +13119,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"userId\": \"{{demoUserId14}}\"\r\n}", + "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"{{demoUserId13}}\",\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"startDate\": \"{{resourceStartDate}}\",\r\n \"endDate\": \"{{resourceEndDate}}\",\r\n \"memberRate\": 1000,\r\n \"customerRate\": 1200,\r\n \"rateType\": \"weekly\"\r\n}", "options": { "raw": { "language": "json" @@ -10002,27 +13127,47 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates", + "raw": "{{URL}}/resourceBookings", "host": [ "{{URL}}" ], "path": [ - "jobCandidates" + "resourceBookings" ] } }, "response": [] }, { - "name": "create job #3 candidate 15", + "name": "create job 3 resource booking 14", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Successful POST request\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", - "});" + "var data = JSON.parse(responseBody);\r", + "\r", + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", + "});\r", + "\r", + "postman.setEnvironmentVariable(\"demoJob3resourceCandiateId14\",data.id);" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "const startDate = new Date()", + "startDate.setDate(startDate.getDate() - 3);", + "", + "const endDate = new Date()", + "endDate.setDate(endDate.getDate() + 3);", + "", + "postman.setEnvironmentVariable(\"resourceStartDate\", startDate.toUTCString());", + "postman.setEnvironmentVariable(\"resourceEndDate\", endDate.toUTCString());" ], "type": "text/javascript" } @@ -10039,7 +13184,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"userId\": \"{{demoUserId15}}\"\r\n}", + "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"{{demoUserId14}}\",\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"startDate\": \"{{resourceStartDate}}\",\r\n \"endDate\": \"{{resourceEndDate}}\",\r\n \"memberRate\": 1000,\r\n \"customerRate\": 1200,\r\n \"rateType\": \"weekly\"\r\n}", "options": { "raw": { "language": "json" @@ -10047,27 +13192,47 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates", + "raw": "{{URL}}/resourceBookings", "host": [ "{{URL}}" ], "path": [ - "jobCandidates" + "resourceBookings" ] } }, "response": [] }, { - "name": "create job #3 candidate 16", + "name": "create job 3 resource booking 15", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Successful POST request\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", - "});" + "var data = JSON.parse(responseBody);\r", + "\r", + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", + "});\r", + "\r", + "postman.setEnvironmentVariable(\"demoJob3resourceCandiateId15\",data.id);" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "const startDate = new Date()", + "startDate.setDate(startDate.getDate() - 3);", + "", + "const endDate = new Date()", + "endDate.setDate(endDate.getDate() + 3);", + "", + "postman.setEnvironmentVariable(\"resourceStartDate\", startDate.toUTCString());", + "postman.setEnvironmentVariable(\"resourceEndDate\", endDate.toUTCString());" ], "type": "text/javascript" } @@ -10084,7 +13249,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"userId\": \"{{demoUserId16}}\"\r\n}", + "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"{{demoUserId15}}\",\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"startDate\": \"{{resourceStartDate}}\",\r\n \"endDate\": \"{{resourceEndDate}}\",\r\n \"memberRate\": 1000,\r\n \"customerRate\": 1200,\r\n \"rateType\": \"weekly\"\r\n}", "options": { "raw": { "language": "json" @@ -10092,27 +13257,47 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates", + "raw": "{{URL}}/resourceBookings", "host": [ "{{URL}}" ], "path": [ - "jobCandidates" + "resourceBookings" ] } }, "response": [] }, { - "name": "create job #3 candidate 17", + "name": "create job 3 resource booking 16", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Successful POST request\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", - "});" + "var data = JSON.parse(responseBody);\r", + "\r", + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", + "});\r", + "\r", + "postman.setEnvironmentVariable(\"demoJob3resourceCandiateId16\",data.id);" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "const startDate = new Date()", + "startDate.setDate(startDate.getDate() - 3);", + "", + "const endDate = new Date()", + "endDate.setDate(endDate.getDate() + 3);", + "", + "postman.setEnvironmentVariable(\"resourceStartDate\", startDate.toUTCString());", + "postman.setEnvironmentVariable(\"resourceEndDate\", endDate.toUTCString());" ], "type": "text/javascript" } @@ -10129,7 +13314,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"userId\": \"{{demoUserId17}}\"\r\n}", + "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"{{demoUserId16}}\",\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"startDate\": \"{{resourceStartDate}}\",\r\n \"endDate\": \"{{resourceEndDate}}\",\r\n \"memberRate\": 800,\r\n \"customerRate\": 1000,\r\n \"rateType\": \"weekly\"\r\n}", "options": { "raw": { "language": "json" @@ -10137,27 +13322,47 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates", + "raw": "{{URL}}/resourceBookings", "host": [ "{{URL}}" ], "path": [ - "jobCandidates" + "resourceBookings" ] } }, "response": [] }, { - "name": "create job #3 candidate 18", + "name": "create job 3 resource booking 17", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Successful POST request\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", - "});" + "var data = JSON.parse(responseBody);\r", + "\r", + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", + "});\r", + "\r", + "postman.setEnvironmentVariable(\"demoJob3resourceCandiateId17\",data.id);" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "const startDate = new Date()", + "startDate.setDate(startDate.getDate() - 3);", + "", + "const endDate = new Date()", + "endDate.setDate(endDate.getDate() + 3);", + "", + "postman.setEnvironmentVariable(\"resourceStartDate\", startDate.toUTCString());", + "postman.setEnvironmentVariable(\"resourceEndDate\", endDate.toUTCString());" ], "type": "text/javascript" } @@ -10174,7 +13379,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"userId\": \"{{demoUserId18}}\"\r\n}", + "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"{{demoUserId17}}\",\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"startDate\": \"{{resourceStartDate}}\",\r\n \"endDate\": \"{{resourceEndDate}}\",\r\n \"memberRate\": 2000,\r\n \"customerRate\": 2500,\r\n \"rateType\": \"weekly\"\r\n}", "options": { "raw": { "language": "json" @@ -10182,27 +13387,40 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates", + "raw": "{{URL}}/resourceBookings", "host": [ "{{URL}}" ], "path": [ - "jobCandidates" + "resourceBookings" ] } }, "response": [] }, { - "name": "create job #3 candidate 19", + "name": "create job 3 resource booking 18", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Successful POST request\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", - "});" + "var data = JSON.parse(responseBody);\r", + "\r", + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", + "});\r", + "\r", + "postman.setEnvironmentVariable(\"demoJob3resourceCandiateId18\",data.id);" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } @@ -10219,7 +13437,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"userId\": \"{{demoUserId19}}\"\r\n}", + "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"{{demoUserId18}}\",\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"startDate\": \"2000-07-27T04:17:23.131Z\",\r\n \"endDate\": \"2000-09-27T04:17:23.131Z\",\r\n \"memberRate\": 3000,\r\n \"customerRate\": 3500,\r\n \"rateType\": \"weekly\"\r\n}", "options": { "raw": { "language": "json" @@ -10227,27 +13445,31 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates", + "raw": "{{URL}}/resourceBookings", "host": [ "{{URL}}" ], "path": [ - "jobCandidates" + "resourceBookings" ] } }, "response": [] }, { - "name": "create job #3 candidate 20", + "name": "create job 3 resource booking 19", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Successful POST request\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", - "});" + "var data = JSON.parse(responseBody);\r", + "\r", + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", + "});\r", + "\r", + "postman.setEnvironmentVariable(\"demoJob3resourceCandiateId19\",data.id);" ], "type": "text/javascript" } @@ -10264,7 +13486,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"userId\": \"{{demoUserId20}}\"\r\n}", + "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"{{demoUserId19}}\",\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"startDate\": \"2022-07-27T04:17:23.131Z\",\r\n \"endDate\": \"2022-09-27T04:17:23.131Z\",\r\n \"memberRate\": 1700,\r\n \"customerRate\": 1900,\r\n \"rateType\": \"weekly\"\r\n}", "options": { "raw": { "language": "json" @@ -10272,19 +13494,19 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates", + "raw": "{{URL}}/resourceBookings", "host": [ "{{URL}}" ], "path": [ - "jobCandidates" + "resourceBookings" ] } }, "response": [] }, { - "name": "create job 3 resource booking 11", + "name": "create job 3 resource booking 20", "event": [ { "listen": "test", @@ -10296,7 +13518,7 @@ " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", "});\r", "\r", - "postman.setEnvironmentVariable(\"demoJob3resourceCandiateId11\",data.id);" + "postman.setEnvironmentVariable(\"demoJob3resourceCandiateId20\",data.id);" ], "type": "text/javascript" } @@ -10329,7 +13551,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"{{demoUserId11}}\",\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"startDate\": \"{{resourceStartDate}}\",\r\n \"endDate\": \"{{resourceEndDate}}\",\r\n \"memberRate\": 1000,\r\n \"customerRate\": 1200,\r\n \"rateType\": \"weekly\"\r\n}", + "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"{{demoUserId20}}\",\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 0,\r\n \"customerRate\": 0,\r\n \"rateType\": \"weekly\"\r\n}", "options": { "raw": { "language": "json" @@ -10349,42 +13571,68 @@ "response": [] }, { - "name": "create job 3 resource booking 12", + "name": "update job 3 resource booking 11 status to \"assigned\"", "event": [ { "listen": "test", "script": { "exec": [ - "var data = JSON.parse(responseBody);\r", - "\r", - "pm.test(\"Successful POST request\", function () {\r", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", - "});\r", - "\r", - "postman.setEnvironmentVariable(\"demoJob3resourceCandiateId12\",data.id);" + "pm.test(\"Successful PATCH request\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", + "});" ], "type": "text/javascript" } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_bookingManager}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"status\": \"assigned\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } }, + "url": { + "raw": "{{URL}}/resourceBookings/{{demoJob3resourceCandiateId11}}", + "host": [ + "{{URL}}" + ], + "path": [ + "resourceBookings", + "{{demoJob3resourceCandiateId11}}" + ] + } + }, + "response": [] + }, + { + "name": "update job 3 resource booking 12 status to \"in-review\"", + "event": [ { - "listen": "prerequest", + "listen": "test", "script": { "exec": [ - "const startDate = new Date()", - "startDate.setDate(startDate.getDate() - 3);", - "", - "const endDate = new Date()", - "endDate.setDate(endDate.getDate() + 3);", - "", - "postman.setEnvironmentVariable(\"resourceStartDate\", startDate.toUTCString());", - "postman.setEnvironmentVariable(\"resourceEndDate\", endDate.toUTCString());" + "pm.test(\"Successful PATCH request\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "PATCH", "header": [ { "key": "Authorization", @@ -10394,7 +13642,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"{{demoUserId12}}\",\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"startDate\": \"{{resourceStartDate}}\",\r\n \"endDate\": \"{{resourceEndDate}}\",\r\n \"memberRate\": 1000,\r\n \"customerRate\": 1200,\r\n \"rateType\": \"weekly\"\r\n}", + "raw": "{\r\n \"status\": \"in-review\"\r\n}", "options": { "raw": { "language": "json" @@ -10402,54 +13650,35 @@ } }, "url": { - "raw": "{{URL}}/resourceBookings", + "raw": "{{URL}}/resourceBookings/{{demoJob3resourceCandiateId12}}", "host": [ "{{URL}}" ], "path": [ - "resourceBookings" + "resourceBookings", + "{{demoJob3resourceCandiateId12}}" ] } }, "response": [] }, { - "name": "create job 3 resource booking 13", + "name": "update job 3 resource booking 13 status to \"closed\"", "event": [ { "listen": "test", "script": { "exec": [ - "var data = JSON.parse(responseBody);\r", - "\r", - "pm.test(\"Successful POST request\", function () {\r", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", - "});\r", - "\r", - "postman.setEnvironmentVariable(\"demoJob3resourceCandiateId13\",data.id);" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "const startDate = new Date()", - "startDate.setDate(startDate.getDate() - 3);", - "", - "const endDate = new Date()", - "endDate.setDate(endDate.getDate() + 3);", - "", - "postman.setEnvironmentVariable(\"resourceStartDate\", startDate.toUTCString());", - "postman.setEnvironmentVariable(\"resourceEndDate\", endDate.toUTCString());" + "pm.test(\"Successful PATCH request\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "PATCH", "header": [ { "key": "Authorization", @@ -10459,7 +13688,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"{{demoUserId13}}\",\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"startDate\": \"{{resourceStartDate}}\",\r\n \"endDate\": \"{{resourceEndDate}}\",\r\n \"memberRate\": 1000,\r\n \"customerRate\": 1200,\r\n \"rateType\": \"weekly\"\r\n}", + "raw": "{\r\n \"status\": \"closed\"\r\n}", "options": { "raw": { "language": "json" @@ -10467,54 +13696,35 @@ } }, "url": { - "raw": "{{URL}}/resourceBookings", + "raw": "{{URL}}/resourceBookings/{{demoJob3resourceCandiateId13}}", "host": [ "{{URL}}" ], "path": [ - "resourceBookings" + "resourceBookings", + "{{demoJob3resourceCandiateId13}}" ] } }, "response": [] }, { - "name": "create job 3 resource booking 14", + "name": "update job 3 resource booking 14 status to \"cancelled\"", "event": [ { "listen": "test", "script": { "exec": [ - "var data = JSON.parse(responseBody);\r", - "\r", - "pm.test(\"Successful POST request\", function () {\r", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", - "});\r", - "\r", - "postman.setEnvironmentVariable(\"demoJob3resourceCandiateId14\",data.id);" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "const startDate = new Date()", - "startDate.setDate(startDate.getDate() - 3);", - "", - "const endDate = new Date()", - "endDate.setDate(endDate.getDate() + 3);", - "", - "postman.setEnvironmentVariable(\"resourceStartDate\", startDate.toUTCString());", - "postman.setEnvironmentVariable(\"resourceEndDate\", endDate.toUTCString());" + "pm.test(\"Successful PATCH request\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "PATCH", "header": [ { "key": "Authorization", @@ -10524,7 +13734,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"{{demoUserId14}}\",\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"startDate\": \"{{resourceStartDate}}\",\r\n \"endDate\": \"{{resourceEndDate}}\",\r\n \"memberRate\": 1000,\r\n \"customerRate\": 1200,\r\n \"rateType\": \"weekly\"\r\n}", + "raw": "{\r\n \"status\": \"cancelled\"\r\n}", "options": { "raw": { "language": "json" @@ -10532,54 +13742,35 @@ } }, "url": { - "raw": "{{URL}}/resourceBookings", + "raw": "{{URL}}/resourceBookings/{{demoJob3resourceCandiateId14}}", "host": [ "{{URL}}" ], "path": [ - "resourceBookings" + "resourceBookings", + "{{demoJob3resourceCandiateId14}}" ] } }, "response": [] }, { - "name": "create job 3 resource booking 15", + "name": "update job 3 resource booking 15 status to \"sourcing\"", "event": [ { "listen": "test", "script": { "exec": [ - "var data = JSON.parse(responseBody);\r", - "\r", - "pm.test(\"Successful POST request\", function () {\r", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", - "});\r", - "\r", - "postman.setEnvironmentVariable(\"demoJob3resourceCandiateId15\",data.id);" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "const startDate = new Date()", - "startDate.setDate(startDate.getDate() - 3);", - "", - "const endDate = new Date()", - "endDate.setDate(endDate.getDate() + 3);", - "", - "postman.setEnvironmentVariable(\"resourceStartDate\", startDate.toUTCString());", - "postman.setEnvironmentVariable(\"resourceEndDate\", endDate.toUTCString());" + "pm.test(\"Successful PATCH request\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "PATCH", "header": [ { "key": "Authorization", @@ -10589,7 +13780,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"{{demoUserId15}}\",\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"startDate\": \"{{resourceStartDate}}\",\r\n \"endDate\": \"{{resourceEndDate}}\",\r\n \"memberRate\": 1000,\r\n \"customerRate\": 1200,\r\n \"rateType\": \"weekly\"\r\n}", + "raw": "{\r\n \"status\": \"sourcing\"\r\n}", "options": { "raw": { "language": "json" @@ -10597,54 +13788,35 @@ } }, "url": { - "raw": "{{URL}}/resourceBookings", + "raw": "{{URL}}/resourceBookings/{{demoJob3resourceCandiateId15}}", "host": [ "{{URL}}" ], "path": [ - "resourceBookings" + "resourceBookings", + "{{demoJob3resourceCandiateId15}}" ] } }, "response": [] }, { - "name": "create job 3 resource booking 16", + "name": "update job 3 resource booking 16 status to \"assigned\"", "event": [ { "listen": "test", "script": { "exec": [ - "var data = JSON.parse(responseBody);\r", - "\r", - "pm.test(\"Successful POST request\", function () {\r", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", - "});\r", - "\r", - "postman.setEnvironmentVariable(\"demoJob3resourceCandiateId16\",data.id);" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "const startDate = new Date()", - "startDate.setDate(startDate.getDate() - 3);", - "", - "const endDate = new Date()", - "endDate.setDate(endDate.getDate() + 3);", - "", - "postman.setEnvironmentVariable(\"resourceStartDate\", startDate.toUTCString());", - "postman.setEnvironmentVariable(\"resourceEndDate\", endDate.toUTCString());" + "pm.test(\"Successful PATCH request\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "PATCH", "header": [ { "key": "Authorization", @@ -10654,7 +13826,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"{{demoUserId16}}\",\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"startDate\": \"{{resourceStartDate}}\",\r\n \"endDate\": \"{{resourceEndDate}}\",\r\n \"memberRate\": 800,\r\n \"customerRate\": 1000,\r\n \"rateType\": \"weekly\"\r\n}", + "raw": "{\r\n \"status\": \"assigned\"\r\n}", "options": { "raw": { "language": "json" @@ -10662,54 +13834,35 @@ } }, "url": { - "raw": "{{URL}}/resourceBookings", + "raw": "{{URL}}/resourceBookings/{{demoJob3resourceCandiateId16}}", "host": [ "{{URL}}" ], "path": [ - "resourceBookings" + "resourceBookings", + "{{demoJob3resourceCandiateId16}}" ] } }, "response": [] }, { - "name": "create job 3 resource booking 17", + "name": "update job 3 resource booking 17 status to \"assigned\"", "event": [ { "listen": "test", "script": { "exec": [ - "var data = JSON.parse(responseBody);\r", - "\r", - "pm.test(\"Successful POST request\", function () {\r", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", - "});\r", - "\r", - "postman.setEnvironmentVariable(\"demoJob3resourceCandiateId17\",data.id);" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "const startDate = new Date()", - "startDate.setDate(startDate.getDate() - 3);", - "", - "const endDate = new Date()", - "endDate.setDate(endDate.getDate() + 3);", - "", - "postman.setEnvironmentVariable(\"resourceStartDate\", startDate.toUTCString());", - "postman.setEnvironmentVariable(\"resourceEndDate\", endDate.toUTCString());" + "pm.test(\"Successful PATCH request\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "PATCH", "header": [ { "key": "Authorization", @@ -10719,7 +13872,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"{{demoUserId17}}\",\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"startDate\": \"{{resourceStartDate}}\",\r\n \"endDate\": \"{{resourceEndDate}}\",\r\n \"memberRate\": 2000,\r\n \"customerRate\": 2500,\r\n \"rateType\": \"weekly\"\r\n}", + "raw": "{\r\n \"status\": \"assigned\"\r\n}", "options": { "raw": { "language": "json" @@ -10727,47 +13880,35 @@ } }, "url": { - "raw": "{{URL}}/resourceBookings", + "raw": "{{URL}}/resourceBookings/{{demoJob3resourceCandiateId17}}", "host": [ "{{URL}}" ], "path": [ - "resourceBookings" + "resourceBookings", + "{{demoJob3resourceCandiateId17}}" ] } }, "response": [] }, { - "name": "create job 3 resource booking 18", + "name": "update job 3 resource booking 18 status to \"assigned\"", "event": [ { "listen": "test", "script": { "exec": [ - "var data = JSON.parse(responseBody);\r", - "\r", - "pm.test(\"Successful POST request\", function () {\r", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", - "});\r", - "\r", - "postman.setEnvironmentVariable(\"demoJob3resourceCandiateId18\",data.id);" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" + "pm.test(\"Successful PATCH request\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "PATCH", "header": [ { "key": "Authorization", @@ -10777,7 +13918,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"{{demoUserId18}}\",\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"startDate\": \"2000-07-27T04:17:23.131Z\",\r\n \"endDate\": \"2000-09-27T04:17:23.131Z\",\r\n \"memberRate\": 3000,\r\n \"customerRate\": 3500,\r\n \"rateType\": \"weekly\"\r\n}", + "raw": "{\r\n \"status\": \"assigned\"\r\n}", "options": { "raw": { "language": "json" @@ -10785,38 +13926,35 @@ } }, "url": { - "raw": "{{URL}}/resourceBookings", + "raw": "{{URL}}/resourceBookings/{{demoJob3resourceCandiateId18}}", "host": [ "{{URL}}" ], "path": [ - "resourceBookings" + "resourceBookings", + "{{demoJob3resourceCandiateId18}}" ] } }, "response": [] }, { - "name": "create job 3 resource booking 19", + "name": "update job 3 resource booking 19 status to \"assigned\"", "event": [ { "listen": "test", "script": { "exec": [ - "var data = JSON.parse(responseBody);\r", - "\r", - "pm.test(\"Successful POST request\", function () {\r", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", - "});\r", - "\r", - "postman.setEnvironmentVariable(\"demoJob3resourceCandiateId19\",data.id);" + "pm.test(\"Successful PATCH request\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "PATCH", "header": [ { "key": "Authorization", @@ -10826,7 +13964,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"{{demoUserId19}}\",\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"startDate\": \"2022-07-27T04:17:23.131Z\",\r\n \"endDate\": \"2022-09-27T04:17:23.131Z\",\r\n \"memberRate\": 1700,\r\n \"customerRate\": 1900,\r\n \"rateType\": \"weekly\"\r\n}", + "raw": "{\r\n \"status\": \"assigned\"\r\n}", "options": { "raw": { "language": "json" @@ -10834,54 +13972,35 @@ } }, "url": { - "raw": "{{URL}}/resourceBookings", + "raw": "{{URL}}/resourceBookings/{{demoJob3resourceCandiateId19}}", "host": [ "{{URL}}" ], "path": [ - "resourceBookings" + "resourceBookings", + "{{demoJob3resourceCandiateId19}}" ] } }, "response": [] }, { - "name": "create job 3 resource booking 20", + "name": "update job 3 resource booking 20 status to \"assigned\"", "event": [ { "listen": "test", "script": { "exec": [ - "var data = JSON.parse(responseBody);\r", - "\r", - "pm.test(\"Successful POST request\", function () {\r", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", - "});\r", - "\r", - "postman.setEnvironmentVariable(\"demoJob3resourceCandiateId20\",data.id);" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "const startDate = new Date()", - "startDate.setDate(startDate.getDate() - 3);", - "", - "const endDate = new Date()", - "endDate.setDate(endDate.getDate() + 3);", - "", - "postman.setEnvironmentVariable(\"resourceStartDate\", startDate.toUTCString());", - "postman.setEnvironmentVariable(\"resourceEndDate\", endDate.toUTCString());" + "pm.test(\"Successful PATCH request\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "PATCH", "header": [ { "key": "Authorization", @@ -10891,7 +14010,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"{{demoUserId20}}\",\r\n \"jobId\": \"{{demoJobId3}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 0,\r\n \"customerRate\": 0,\r\n \"rateType\": \"weekly\"\r\n}", + "raw": "{\r\n \"status\": \"assigned\"\r\n}", "options": { "raw": { "language": "json" @@ -10899,19 +14018,20 @@ } }, "url": { - "raw": "{{URL}}/resourceBookings", + "raw": "{{URL}}/resourceBookings/{{demoJob3resourceCandiateId20}}", "host": [ "{{URL}}" ], "path": [ - "resourceBookings" + "resourceBookings", + "{{demoJob3resourceCandiateId20}}" ] } }, "response": [] }, { - "name": "update job 3 resource booking 11 status to \"assigned\"", + "name": "update job #3 status to \"assigned\"", "event": [ { "listen": "test", @@ -10944,35 +14064,44 @@ } }, "url": { - "raw": "{{URL}}/resourceBookings/{{demoJob3resourceCandiateId11}}", + "raw": "{{URL}}/jobs/{{demoJobId3}}", "host": [ "{{URL}}" ], "path": [ - "resourceBookings", - "{{demoJob3resourceCandiateId11}}" + "jobs", + "{{demoJobId3}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Create job #4 \"closed\"", + "item": [ { - "name": "update job 3 resource booking 12 status to \"in-review\"", + "name": "create job #4", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Successful PATCH request\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", - "});" + "var data = JSON.parse(responseBody);\r", + "\r", + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", + "});\r", + "\r", + "postman.setEnvironmentVariable(\"demoJobId4\",data.id);" ], "type": "text/javascript" } } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Authorization", @@ -10982,7 +14111,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"status\": \"in-review\"\r\n}", + "raw": "{\n \"projectId\": {{projectId}},\n \"externalId\": \"0\",\n \"description\": \"taas-demo-job4\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 7,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"weekly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"8456002e-fa2d-44f0-b0e7-86b1c02b6e4c\",\n \"114b4ec8-805e-4c60-b351-14a955a991a9\",\n \"213408aa-f16f-46c8-bc57-9e569cee3f11\",\n \"b37a48db-f775-4e4e-b403-8ad1d234cdea\",\n \"99b930b5-1b91-4df1-8b17-d9307107bb51\",\n \"6388a632-c3ad-4525-9a73-66a527c03672\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", "options": { "raw": { "language": "json" @@ -10990,20 +14119,19 @@ } }, "url": { - "raw": "{{URL}}/resourceBookings/{{demoJob3resourceCandiateId12}}", + "raw": "{{URL}}/jobs", "host": [ "{{URL}}" ], "path": [ - "resourceBookings", - "{{demoJob3resourceCandiateId12}}" + "jobs" ] } }, "response": [] }, { - "name": "update job 3 resource booking 13 status to \"closed\"", + "name": "update job #4 status to \"closed\"", "event": [ { "listen": "test", @@ -11036,35 +14164,44 @@ } }, "url": { - "raw": "{{URL}}/resourceBookings/{{demoJob3resourceCandiateId13}}", + "raw": "{{URL}}/jobs/{{demoJobId4}}", "host": [ "{{URL}}" ], "path": [ - "resourceBookings", - "{{demoJob3resourceCandiateId13}}" + "jobs", + "{{demoJobId4}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Create job #5 \"cancelled\"", + "item": [ { - "name": "update job 3 resource booking 14 status to \"cancelled\"", + "name": "create job #5", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Successful PATCH request\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", - "});" + "var data = JSON.parse(responseBody);\r", + "\r", + "pm.test(\"Successful POST request\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", + "});\r", + "\r", + "postman.setEnvironmentVariable(\"demoJobId5\",data.id);" ], "type": "text/javascript" } } ], "request": { - "method": "PATCH", + "method": "POST", "header": [ { "key": "Authorization", @@ -11074,7 +14211,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"status\": \"cancelled\"\r\n}", + "raw": "{\n \"projectId\": {{projectId}},\n \"externalId\": \"0\",\n \"description\": \"taas-demo-job5\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 7,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"weekly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"b37a48db-f775-4e4e-b403-8ad1d234cdea\",\n \"99b930b5-1b91-4df1-8b17-d9307107bb51\",\n \"6388a632-c3ad-4525-9a73-66a527c03672\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", "options": { "raw": { "language": "json" @@ -11082,20 +14219,19 @@ } }, "url": { - "raw": "{{URL}}/resourceBookings/{{demoJob3resourceCandiateId14}}", + "raw": "{{URL}}/jobs", "host": [ "{{URL}}" ], "path": [ - "resourceBookings", - "{{demoJob3resourceCandiateId14}}" + "jobs" ] } }, "response": [] }, { - "name": "update job 3 resource booking 15 status to \"sourcing\"", + "name": "update job #5 status to \"cancelled\"", "event": [ { "listen": "test", @@ -11120,524 +14256,547 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"status\": \"sourcing\"\r\n}", + "raw": "{\r\n \"status\": \"cancelled\"\r\n}", "options": { "raw": { "language": "json" } - } + } + }, + "url": { + "raw": "{{URL}}/jobs/{{demoJobId5}}", + "host": [ + "{{URL}}" + ], + "path": [ + "jobs", + "{{demoJobId5}}" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Test Permission Rules", + "item": [ + { + "name": "Request with Administrator Role", + "item": [ + { + "name": "Jobs", + "item": [ + { + "name": "✔ create job with administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var data = JSON.parse(responseBody);\r", + "postman.setEnvironmentVariable(\"job_id_created_by_administrator\",data.id);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token_administrator}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"projectId\": {{projectId}},\n \"externalId\": \"1212\",\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"23e00d92-207a-4b5b-b3c9-4c5662644941\",\n \"7d076384-ccf6-4e43-a45d-1b24b1e624aa\",\n \"cbac57a3-7180-4316-8769-73af64893158\",\n \"a2b4bc11-c641-4a19-9eb7-33980378f82e\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobs", + "host": [ + "{{URL}}" + ], + "path": [ + "jobs" + ] + } + }, + "response": [] + }, + { + "name": "✔ get job with administrator", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_administrator}}" + } + ], + "url": { + "raw": "{{URL}}/jobs/{{job_id_created_by_administrator}}", + "host": [ + "{{URL}}" + ], + "path": [ + "jobs", + "{{job_id_created_by_administrator}}" + ] + } + }, + "response": [] + }, + { + "name": "✔ search jobs with administrator", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_administrator}}" + } + ], + "url": { + "raw": "{{URL}}/jobs", + "host": [ + "{{URL}}" + ], + "path": [ + "jobs" + ], + "query": [ + { + "key": "page", + "value": "0", + "disabled": true + }, + { + "key": "perPage", + "value": "3", + "disabled": true + }, + { + "key": "sortBy", + "value": "id", + "disabled": true + }, + { + "key": "sortOrder", + "value": "asc", + "disabled": true + }, + { + "key": "projectId", + "value": "21", + "disabled": true + }, + { + "key": "externalId", + "value": "1212", + "disabled": true + }, + { + "key": "description", + "value": "Dummy", + "disabled": true + }, + { + "key": "startDate", + "value": "2020-09-27T04:17:23.131Z", + "disabled": true + }, + { + "key": "resourceType", + "value": "Dummy Resource Type", + "disabled": true + }, + { + "key": "skill", + "value": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "disabled": true + }, + { + "key": "rateType", + "value": "hourly", + "disabled": true + }, + { + "key": "status", + "value": "sourcing", + "disabled": true + }, + { + "key": "workload", + "value": "full-time", + "disabled": true + }, + { + "key": "title", + "value": "dummy", + "disabled": true + } + ] + } + }, + "response": [] }, - "url": { - "raw": "{{URL}}/resourceBookings/{{demoJob3resourceCandiateId15}}", - "host": [ - "{{URL}}" - ], - "path": [ - "resourceBookings", - "{{demoJob3resourceCandiateId15}}" - ] - } - }, - "response": [] - }, - { - "name": "update job 3 resource booking 16 status to \"assigned\"", - "event": [ { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Successful PATCH request\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", - "});" + "name": "✔ put job with administrator", + "request": { + "method": "PUT", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_administrator}}" + } ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "PATCH", - "header": [ - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{token_bookingManager}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"status\": \"assigned\"\r\n}", - "options": { - "raw": { - "language": "json" + "body": { + "mode": "raw", + "raw": "{\n \"projectId\": {{projectId}},\n \"externalId\": \"1212\",\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"fractional\",\n \"skills\": [\n \"cbac57a3-7180-4316-8769-73af64893158\",\n \"a2b4bc11-c641-4a19-9eb7-33980378f82e\"\n ],\n \"status\": \"sourcing\",\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobs/{{job_id_created_by_administrator}}", + "host": [ + "{{URL}}" + ], + "path": [ + "jobs", + "{{job_id_created_by_administrator}}" + ] } - } + }, + "response": [] }, - "url": { - "raw": "{{URL}}/resourceBookings/{{demoJob3resourceCandiateId16}}", - "host": [ - "{{URL}}" - ], - "path": [ - "resourceBookings", - "{{demoJob3resourceCandiateId16}}" - ] - } - }, - "response": [] - }, - { - "name": "update job 3 resource booking 17 status to \"assigned\"", - "event": [ { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Successful PATCH request\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", - "});" + "name": "✔ patch job with administrator", + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_administrator}}" + } ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "PATCH", - "header": [ - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{token_bookingManager}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"status\": \"assigned\"\r\n}", - "options": { - "raw": { - "language": "json" + "body": { + "mode": "raw", + "raw": "{\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"fractional\",\n \"skills\": [\n \"cbac57a3-7180-4316-8769-73af64893158\"\n ],\n \"status\": \"sourcing\",\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobs/{{job_id_created_by_administrator}}", + "host": [ + "{{URL}}" + ], + "path": [ + "jobs", + "{{job_id_created_by_administrator}}" + ] } - } + }, + "response": [] }, - "url": { - "raw": "{{URL}}/resourceBookings/{{demoJob3resourceCandiateId17}}", - "host": [ - "{{URL}}" - ], - "path": [ - "resourceBookings", - "{{demoJob3resourceCandiateId17}}" - ] - } - }, - "response": [] - }, - { - "name": "update job 3 resource booking 18 status to \"assigned\"", - "event": [ { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Successful PATCH request\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", - "});" + "name": "✔ delete job with administrator", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_administrator}}" + } ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "PATCH", - "header": [ - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{token_bookingManager}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"status\": \"assigned\"\r\n}", - "options": { - "raw": { - "language": "json" + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobs/{{job_id_created_by_administrator}}", + "host": [ + "{{URL}}" + ], + "path": [ + "jobs", + "{{job_id_created_by_administrator}}" + ] } - } - }, - "url": { - "raw": "{{URL}}/resourceBookings/{{demoJob3resourceCandiateId18}}", - "host": [ - "{{URL}}" - ], - "path": [ - "resourceBookings", - "{{demoJob3resourceCandiateId18}}" - ] + }, + "response": [] } - }, - "response": [] + ] }, { - "name": "update job 3 resource booking 19 status to \"assigned\"", - "event": [ + "name": "Job Candidates", + "item": [ { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Successful PATCH request\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "PATCH", - "header": [ - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{token_bookingManager}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"status\": \"assigned\"\r\n}", - "options": { - "raw": { - "language": "json" + "name": "✔ create job candidate with administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var data = JSON.parse(responseBody);\r", + "postman.setEnvironmentVariable(\"job_candidate_id_created_by_administrator\",data.id);" + ], + "type": "text/javascript" + } } - } - }, - "url": { - "raw": "{{URL}}/resourceBookings/{{demoJob3resourceCandiateId19}}", - "host": [ - "{{URL}}" ], - "path": [ - "resourceBookings", - "{{demoJob3resourceCandiateId19}}" - ] - } - }, - "response": [] - }, - { - "name": "update job 3 resource booking 20 status to \"assigned\"", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Successful PATCH request\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", - "});" + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_administrator}}" + } ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "PATCH", - "header": [ - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{token_bookingManager}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"status\": \"assigned\"\r\n}", - "options": { - "raw": { - "language": "json" + "body": { + "mode": "raw", + "raw": "{\r\n \"jobId\": \"{{job_id_created_by_administrator}}\",\r\n \"userId\": \"a55fe1bc-1754-45fa-9adc-cf3d6d7c377a\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobCandidates", + "host": [ + "{{URL}}" + ], + "path": [ + "jobCandidates" + ] } - } + }, + "response": [] }, - "url": { - "raw": "{{URL}}/resourceBookings/{{demoJob3resourceCandiateId20}}", - "host": [ - "{{URL}}" - ], - "path": [ - "resourceBookings", - "{{demoJob3resourceCandiateId20}}" - ] - } - }, - "response": [] - }, - { - "name": "update job #3 status to \"assigned\"", - "event": [ { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Successful PATCH request\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", - "});" + "name": "✔ get job candidate with administrator", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_administrator}}" + } ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "PATCH", - "header": [ - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{token_bookingManager}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"status\": \"assigned\"\r\n}", - "options": { - "raw": { - "language": "json" + "url": { + "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_by_administrator}}", + "host": [ + "{{URL}}" + ], + "path": [ + "jobCandidates", + "{{job_candidate_id_created_by_administrator}}" + ] } - } + }, + "response": [] }, - "url": { - "raw": "{{URL}}/jobs/{{demoJobId3}}", - "host": [ - "{{URL}}" - ], - "path": [ - "jobs", - "{{demoJobId3}}" - ] - } - }, - "response": [] - } - ] - }, - { - "name": "Create job #4 \"closed\"", - "item": [ - { - "name": "create job #4", - "event": [ { - "listen": "test", - "script": { - "exec": [ - "var data = JSON.parse(responseBody);\r", - "\r", - "pm.test(\"Successful POST request\", function () {\r", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", - "});\r", - "\r", - "postman.setEnvironmentVariable(\"demoJobId4\",data.id);" + "name": "✔ search job candidates with administrator", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_administrator}}" + } ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{token_bookingManager}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"projectId\": {{projectId}},\n \"externalId\": \"0\",\n \"description\": \"taas-demo-job4\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 7,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"weekly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"8456002e-fa2d-44f0-b0e7-86b1c02b6e4c\",\n \"114b4ec8-805e-4c60-b351-14a955a991a9\",\n \"213408aa-f16f-46c8-bc57-9e569cee3f11\",\n \"b37a48db-f775-4e4e-b403-8ad1d234cdea\",\n \"99b930b5-1b91-4df1-8b17-d9307107bb51\",\n \"6388a632-c3ad-4525-9a73-66a527c03672\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", - "options": { - "raw": { - "language": "json" + "url": { + "raw": "{{URL}}/jobCandidates", + "host": [ + "{{URL}}" + ], + "path": [ + "jobCandidates" + ], + "query": [ + { + "key": "page", + "value": "1", + "disabled": true + }, + { + "key": "perPage", + "value": "1", + "disabled": true + }, + { + "key": "sortBy", + "value": "id", + "disabled": true + }, + { + "key": "sortOrder", + "value": "asc", + "disabled": true + }, + { + "key": "jobId", + "value": "46225f4c-c2a3-4603-a141-0277e96fabfa", + "disabled": true + }, + { + "key": "userId", + "value": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a", + "disabled": true + }, + { + "key": "status", + "value": "shortlist", + "disabled": true + } + ] } - } + }, + "response": [] }, - "url": { - "raw": "{{URL}}/jobs", - "host": [ - "{{URL}}" - ], - "path": [ - "jobs" - ] - } - }, - "response": [] - }, - { - "name": "update job #4 status to \"closed\"", - "event": [ { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Successful PATCH request\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", - "});" + "name": "✔ put job candidate with administrator", + "request": { + "method": "PUT", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_administrator}}" + } ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "PATCH", - "header": [ - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{token_bookingManager}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"status\": \"closed\"\r\n}", - "options": { - "raw": { - "language": "json" + "body": { + "mode": "raw", + "raw": "{\r\n \"jobId\": \"{{job_id_created_by_administrator}}\",\r\n \"userId\": \"a55fe1bc-1754-45fa-9adc-cf3d6d7c377a\",\r\n \"status\": \"selected\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_by_administrator}}", + "host": [ + "{{URL}}" + ], + "path": [ + "jobCandidates", + "{{job_candidate_id_created_by_administrator}}" + ] } - } + }, + "response": [] }, - "url": { - "raw": "{{URL}}/jobs/{{demoJobId4}}", - "host": [ - "{{URL}}" - ], - "path": [ - "jobs", - "{{demoJobId4}}" - ] - } - }, - "response": [] - } - ] - }, - { - "name": "Create job #5 \"cancelled\"", - "item": [ - { - "name": "create job #5", - "event": [ { - "listen": "test", - "script": { - "exec": [ - "var data = JSON.parse(responseBody);\r", - "\r", - "pm.test(\"Successful POST request\", function () {\r", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);\r", - "});\r", - "\r", - "postman.setEnvironmentVariable(\"demoJobId5\",data.id);" + "name": "✔ patch job candidate with administrator", + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_administrator}}" + } ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{token_bookingManager}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"projectId\": {{projectId}},\n \"externalId\": \"0\",\n \"description\": \"taas-demo-job5\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 7,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"weekly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"b37a48db-f775-4e4e-b403-8ad1d234cdea\",\n \"99b930b5-1b91-4df1-8b17-d9307107bb51\",\n \"6388a632-c3ad-4525-9a73-66a527c03672\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", - "options": { - "raw": { - "language": "json" + "body": { + "mode": "raw", + "raw": "{\r\n \"status\": \"shortlist\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_by_administrator}}", + "host": [ + "{{URL}}" + ], + "path": [ + "jobCandidates", + "{{job_candidate_id_created_by_administrator}}" + ] } - } + }, + "response": [] }, - "url": { - "raw": "{{URL}}/jobs", - "host": [ - "{{URL}}" - ], - "path": [ - "jobs" - ] - } - }, - "response": [] - }, - { - "name": "update job #5 status to \"cancelled\"", - "event": [ { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Successful PATCH request\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);", - "});" + "name": "✔ delete job candidate with administrator", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_administrator}}" + } ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "PATCH", - "header": [ - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{token_bookingManager}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"status\": \"cancelled\"\r\n}", - "options": { - "raw": { - "language": "json" + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_by_administrator}}", + "host": [ + "{{URL}}" + ], + "path": [ + "jobCandidates", + "{{job_candidate_id_created_by_administrator}}" + ] } - } - }, - "url": { - "raw": "{{URL}}/jobs/{{demoJobId5}}", - "host": [ - "{{URL}}" - ], - "path": [ - "jobs", - "{{demoJobId5}}" - ] + }, + "response": [] } - }, - "response": [] - } - ] - } - ] - }, - { - "name": "Test Permission Rules", - "item": [ - { - "name": "Request with Administrator Role", - "item": [ + ] + }, { - "name": "Jobs", + "name": "Resource Bookings", "item": [ { - "name": "✔ create job with administrator", + "name": "✔ create resource booking with administrator", "event": [ { "listen": "test", "script": { "exec": [ "var data = JSON.parse(responseBody);\r", - "postman.setEnvironmentVariable(\"job_id_created_by_administrator\",data.id);" + "postman.setEnvironmentVariable(\"resource_bookings_id_created_by_administrator\",data.id);" ], "type": "text/javascript" } @@ -11648,13 +14807,13 @@ "header": [ { "key": "Authorization", - "value": "Bearer {{token_administrator}}", - "type": "text" + "type": "text", + "value": "Bearer {{token_administrator}}" } ], "body": { "mode": "raw", - "raw": "{\n \"projectId\": {{projectId}},\n \"externalId\": \"1212\",\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"23e00d92-207a-4b5b-b3c9-4c5662644941\",\n \"7d076384-ccf6-4e43-a45d-1b24b1e624aa\",\n \"cbac57a3-7180-4316-8769-73af64893158\",\n \"a2b4bc11-c641-4a19-9eb7-33980378f82e\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"a55fe1bc-1754-45fa-9adc-cf3d6d7c377a\",\r\n \"jobId\": \"{{job_id_created_by_administrator}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\"\r\n}", "options": { "raw": { "language": "json" @@ -11662,19 +14821,19 @@ } }, "url": { - "raw": "{{URL}}/jobs", + "raw": "{{URL}}/resourceBookings", "host": [ "{{URL}}" ], "path": [ - "jobs" + "resourceBookings" ] } }, "response": [] }, { - "name": "✔ get job with administrator", + "name": "✔ get resource booking with administrator", "request": { "method": "GET", "header": [ @@ -11685,20 +14844,20 @@ } ], "url": { - "raw": "{{URL}}/jobs/{{job_id_created_by_administrator}}", + "raw": "{{URL}}/resourceBookings/{{resource_bookings_id_created_by_administrator}}", "host": [ "{{URL}}" ], "path": [ - "jobs", - "{{job_id_created_by_administrator}}" + "resourceBookings", + "{{resource_bookings_id_created_by_administrator}}" ] } }, "response": [] }, { - "name": "✔ search jobs with administrator", + "name": "✔ search resource bookings with administrator", "request": { "method": "GET", "header": [ @@ -11709,22 +14868,22 @@ } ], "url": { - "raw": "{{URL}}/jobs", + "raw": "{{URL}}/resourceBookings", "host": [ "{{URL}}" ], "path": [ - "jobs" + "resourceBookings" ], "query": [ { "key": "page", - "value": "0", + "value": "1", "disabled": true }, { "key": "perPage", - "value": "3", + "value": "5", "disabled": true }, { @@ -11734,22 +14893,7 @@ }, { "key": "sortOrder", - "value": "asc", - "disabled": true - }, - { - "key": "projectId", - "value": "21", - "disabled": true - }, - { - "key": "externalId", - "value": "1212", - "disabled": true - }, - { - "key": "description", - "value": "Dummy", + "value": "desc", "disabled": true }, { @@ -11758,13 +14902,8 @@ "disabled": true }, { - "key": "resourceType", - "value": "Dummy Resource Type", - "disabled": true - }, - { - "key": "skill", - "value": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "key": "endDate", + "value": "2020-09-27T04:17:23.131Z", "disabled": true }, { @@ -11778,13 +14917,8 @@ "disabled": true }, { - "key": "workload", - "value": "full-time", - "disabled": true - }, - { - "key": "title", - "value": "dummy", + "key": "projectIds", + "value": "111, 16705", "disabled": true } ] @@ -11793,7 +14927,7 @@ "response": [] }, { - "name": "✔ put job with administrator", + "name": "✔ put resource booking with administrator", "request": { "method": "PUT", "header": [ @@ -11805,7 +14939,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"projectId\": {{projectId}},\n \"externalId\": \"1212\",\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"fractional\",\n \"skills\": [\n \"cbac57a3-7180-4316-8769-73af64893158\",\n \"a2b4bc11-c641-4a19-9eb7-33980378f82e\"\n ],\n \"status\": \"sourcing\",\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"a55fe1bc-1754-45fa-9adc-cf3d6d7c377a\",\r\n \"jobId\": \"{{job_id_created_by_administrator}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\",\r\n \"status\": \"assigned\"\r\n}", "options": { "raw": { "language": "json" @@ -11813,20 +14947,20 @@ } }, "url": { - "raw": "{{URL}}/jobs/{{job_id_created_by_administrator}}", + "raw": "{{URL}}/resourceBookings/{{resource_bookings_id_created_by_administrator}}", "host": [ "{{URL}}" ], "path": [ - "jobs", - "{{job_id_created_by_administrator}}" + "resourceBookings", + "{{resource_bookings_id_created_by_administrator}}" ] } }, "response": [] }, { - "name": "✔ patch job with administrator", + "name": "✔ patch resource booking with administrator", "request": { "method": "PATCH", "header": [ @@ -11838,7 +14972,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"fractional\",\n \"skills\": [\n \"cbac57a3-7180-4316-8769-73af64893158\"\n ],\n \"status\": \"sourcing\",\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "raw": "{\r\n \"status\": \"assigned\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\"\r\n}", "options": { "raw": { "language": "json" @@ -11846,20 +14980,20 @@ } }, "url": { - "raw": "{{URL}}/jobs/{{job_id_created_by_administrator}}", + "raw": "{{URL}}/resourceBookings/{{resource_bookings_id_created_by_administrator}}", "host": [ "{{URL}}" ], "path": [ - "jobs", - "{{job_id_created_by_administrator}}" + "resourceBookings", + "{{resource_bookings_id_created_by_administrator}}" ] } }, "response": [] }, { - "name": "✔ delete job with administrator", + "name": "✔ delete resource booking with administrator", "request": { "method": "DELETE", "header": [ @@ -11879,13 +15013,13 @@ } }, "url": { - "raw": "{{URL}}/jobs/{{job_id_created_by_administrator}}", + "raw": "{{URL}}/resourceBookings/{{resource_bookings_id_created_by_administrator}}", "host": [ "{{URL}}" ], "path": [ - "jobs", - "{{job_id_created_by_administrator}}" + "resourceBookings", + "{{resource_bookings_id_created_by_administrator}}" ] } }, @@ -11894,17 +15028,125 @@ ] }, { - "name": "Job Candidates", + "name": "Work Periods", "item": [ { - "name": "✔ create job candidate with administrator", + "name": "Before Test", + "item": [ + { + "name": "✔ create job with administrator", + "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(\"job_id_created_by_administrator\", response.id);\r", + " }\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token_administrator}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"projectId\": {{projectId}},\n \"externalId\": \"1212\",\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"23e00d92-207a-4b5b-b3c9-4c5662644941\",\n \"7d076384-ccf6-4e43-a45d-1b24b1e624aa\",\n \"cbac57a3-7180-4316-8769-73af64893158\",\n \"a2b4bc11-c641-4a19-9eb7-33980378f82e\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobs", + "host": [ + "{{URL}}" + ], + "path": [ + "jobs" + ] + } + }, + "response": [] + }, + { + "name": "✔ create resource booking with administrator", + "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(\"resource_bookings_id_created_by_administrator\", response.id);\r", + " }\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_administrator}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"a55fe1bc-1754-45fa-9adc-cf3d6d7c377a\",\r\n \"jobId\": \"{{job_id_created_by_administrator}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/resourceBookings", + "host": [ + "{{URL}}" + ], + "path": [ + "resourceBookings" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "✔ create work period with administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var data = JSON.parse(responseBody);\r", - "postman.setEnvironmentVariable(\"job_candidate_id_created_by_administrator\",data.id);" + "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(\"workPeriodId_created_by_administrator\", response.id);\r", + " }\r", + "});" ], "type": "text/javascript" } @@ -11921,7 +15163,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{job_id_created_by_administrator}}\",\r\n \"userId\": \"a55fe1bc-1754-45fa-9adc-cf3d6d7c377a\"\r\n}", + "raw": "{\r\n \"resourceBookingId\": \"{{resource_bookings_id_created_by_administrator}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\r\n \"daysWorked\": 2,\r\n \"memberRate\": 13.13,\r\n \"customerRate\": 13.13,\r\n \"paymentStatus\": \"pending\"\r\n}", "options": { "raw": { "language": "json" @@ -11929,19 +15171,19 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates", + "raw": "{{URL}}/work-periods", "host": [ "{{URL}}" ], "path": [ - "jobCandidates" + "work-periods" ] } }, "response": [] }, { - "name": "✔ get job candidate with administrator", + "name": "✔ get work period with administrator", "request": { "method": "GET", "header": [ @@ -11952,20 +15194,20 @@ } ], "url": { - "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_by_administrator}}", + "raw": "{{URL}}/work-periods/{{workPeriodId_created_by_administrator}}", "host": [ "{{URL}}" ], "path": [ - "jobCandidates", - "{{job_candidate_id_created_by_administrator}}" + "work-periods", + "{{workPeriodId_created_by_administrator}}" ] } }, "response": [] }, { - "name": "✔ search job candidates with administrator", + "name": "✔ search work periods with administrator", "request": { "method": "GET", "header": [ @@ -11976,12 +15218,12 @@ } ], "url": { - "raw": "{{URL}}/jobCandidates", + "raw": "{{URL}}/work-periods", "host": [ "{{URL}}" ], "path": [ - "jobCandidates" + "work-periods" ], "query": [ { @@ -11991,7 +15233,7 @@ }, { "key": "perPage", - "value": "1", + "value": "5", "disabled": true }, { @@ -12001,22 +15243,42 @@ }, { "key": "sortOrder", - "value": "asc", + "value": "desc", "disabled": true }, { - "key": "jobId", - "value": "46225f4c-c2a3-4603-a141-0277e96fabfa", + "key": "resourceBookingId", + "value": "{{resource_bookings_id_created_by_administrator}}", "disabled": true }, { - "key": "userId", - "value": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a", + "key": "resourceBookingIds", + "value": "{{resource_bookings_id_created_by_administrator}},{{resource_bookings_id_created_by_administrator}}", "disabled": true }, { - "key": "status", - "value": "shortlist", + "key": "paymentStatus", + "value": "pending", + "disabled": true + }, + { + "key": "startDate", + "value": "2021-03-07", + "disabled": true + }, + { + "key": "endDate", + "value": "2021-03-13", + "disabled": true + }, + { + "key": "userHandle", + "value": "pshah_manager", + "disabled": true + }, + { + "key": "projectId", + "value": "111", "disabled": true } ] @@ -12025,7 +15287,20 @@ "response": [] }, { - "name": "✔ put job candidate with administrator", + "name": "✔ put work period 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": "PUT", "header": [ @@ -12037,7 +15312,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{job_id_created_by_administrator}}\",\r\n \"userId\": \"a55fe1bc-1754-45fa-9adc-cf3d6d7c377a\",\r\n \"status\": \"selected\"\r\n}", + "raw": "{\r\n \"resourceBookingId\": \"{{resource_bookings_id_created_by_administrator}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\r\n \"daysWorked\": 2,\r\n \"memberRate\": 13.13,\r\n \"customerRate\": 13.13,\r\n \"paymentStatus\": \"pending\"\r\n}", "options": { "raw": { "language": "json" @@ -12045,20 +15320,33 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_by_administrator}}", + "raw": "{{URL}}/work-periods/{{workPeriodId_created_by_administrator}}", "host": [ "{{URL}}" ], "path": [ - "jobCandidates", - "{{job_candidate_id_created_by_administrator}}" + "work-periods", + "{{workPeriodId_created_by_administrator}}" ] } }, "response": [] }, { - "name": "✔ patch job candidate with administrator", + "name": "✔ patch work period 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": "PATCH", "header": [ @@ -12070,7 +15358,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"status\": \"shortlist\"\r\n}", + "raw": "{\r\n \"resourceBookingId\": \"{{resource_bookings_id_created_by_administrator}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\r\n \"daysWorked\": 2,\r\n \"memberRate\": 13.13,\r\n \"customerRate\": 13.13,\r\n \"paymentStatus\": \"pending\"\r\n}", "options": { "raw": { "language": "json" @@ -12078,20 +15366,33 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_by_administrator}}", + "raw": "{{URL}}/work-periods/{{workPeriodId_created_by_administrator}}", "host": [ "{{URL}}" ], "path": [ - "jobCandidates", - "{{job_candidate_id_created_by_administrator}}" + "work-periods", + "{{workPeriodId_created_by_administrator}}" ] } }, "response": [] }, { - "name": "✔ delete job candidate with administrator", + "name": "✔ delete work period with administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 204', function () {\r", + " pm.response.to.have.status(204);\r", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { "method": "DELETE", "header": [ @@ -12111,32 +15412,189 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_by_administrator}}", + "raw": "{{URL}}/work-periods/{{workPeriodId_created_by_administrator}}", "host": [ "{{URL}}" ], "path": [ - "jobCandidates", - "{{job_candidate_id_created_by_administrator}}" + "work-periods", + "{{workPeriodId_created_by_administrator}}" ] } - }, - "response": [] - } - ] - }, - { - "name": "Resource Bookings", - "item": [ + }, + "response": [] + } + ] + }, + { + "name": "Work Period Payments", + "item": [ + { + "name": "Before Test", + "item": [ + { + "name": "✔ create job with administrator", + "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(\"job_id_created_by_administrator\", response.id);\r", + " }\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token_administrator}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"projectId\": {{project_id_17234}},\n \"externalId\": \"1212\",\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"23e00d92-207a-4b5b-b3c9-4c5662644941\",\n \"7d076384-ccf6-4e43-a45d-1b24b1e624aa\",\n \"cbac57a3-7180-4316-8769-73af64893158\",\n \"a2b4bc11-c641-4a19-9eb7-33980378f82e\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobs", + "host": [ + "{{URL}}" + ], + "path": [ + "jobs" + ] + } + }, + "response": [] + }, + { + "name": "✔ create resource booking with administrator", + "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(\"resource_bookings_id_created_by_administrator\", response.id);\r", + " }\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_administrator}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": {{project_id_17234}},\r\n \"userId\": \"a55fe1bc-1754-45fa-9adc-cf3d6d7c377a\",\r\n \"jobId\": \"{{job_id_created_by_administrator}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/resourceBookings", + "host": [ + "{{URL}}" + ], + "path": [ + "resourceBookings" + ] + } + }, + "response": [] + }, + { + "name": "✔ create work period with administrator", + "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(\"workPeriodId_created_by_administrator\", response.id);\r", + " }\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_administrator}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"resourceBookingId\": \"{{resource_bookings_id_created_by_administrator}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\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 resource booking with administrator", + "name": "✔ create work period payment with administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var data = JSON.parse(responseBody);\r", - "postman.setEnvironmentVariable(\"resource_bookings_id_created_by_administrator\",data.id);" + "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(\"workPeriodPaymentId_created_by_administrator\", response.id);\r", + " }\r", + "});" ], "type": "text/javascript" } @@ -12153,7 +15611,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"a55fe1bc-1754-45fa-9adc-cf3d6d7c377a\",\r\n \"jobId\": \"{{job_id_created_by_administrator}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\"\r\n}", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId_created_by_administrator}}\",\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", "options": { "raw": { "language": "json" @@ -12161,19 +15619,32 @@ } }, "url": { - "raw": "{{URL}}/resourceBookings", + "raw": "{{URL}}/work-period-payments", "host": [ "{{URL}}" ], "path": [ - "resourceBookings" + "work-period-payments" ] } }, "response": [] }, { - "name": "✔ get resource booking with administrator", + "name": "✔ get 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": "GET", "header": [ @@ -12184,20 +15655,33 @@ } ], "url": { - "raw": "{{URL}}/resourceBookings/{{resource_bookings_id_created_by_administrator}}", + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId_created_by_administrator}}", "host": [ "{{URL}}" ], "path": [ - "resourceBookings", - "{{resource_bookings_id_created_by_administrator}}" + "work-period-payments", + "{{workPeriodPaymentId_created_by_administrator}}" ] } }, "response": [] }, { - "name": "✔ search resource bookings with administrator", + "name": "✔ search work period payments 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": "GET", "header": [ @@ -12208,12 +15692,12 @@ } ], "url": { - "raw": "{{URL}}/resourceBookings", + "raw": "{{URL}}/work-period-payments", "host": [ "{{URL}}" ], "path": [ - "resourceBookings" + "work-period-payments" ], "query": [ { @@ -12228,7 +15712,7 @@ }, { "key": "sortBy", - "value": "id", + "value": "status", "disabled": true }, { @@ -12237,28 +15721,18 @@ "disabled": true }, { - "key": "startDate", - "value": "2020-09-27T04:17:23.131Z", - "disabled": true - }, - { - "key": "endDate", - "value": "2020-09-27T04:17:23.131Z", + "key": "workPeriodId", + "value": "{{workPeriodId_created_by_administrator}}", "disabled": true }, { - "key": "rateType", - "value": "hourly", + "key": "workPeriodIds", + "value": "{{workPeriodId_created_by_administrator}},{{workPeriodId_created_by_administrator}}", "disabled": true }, { "key": "status", - "value": "sourcing", - "disabled": true - }, - { - "key": "projectIds", - "value": "111, 16705", + "value": "completed", "disabled": true } ] @@ -12267,75 +15741,22 @@ "response": [] }, { - "name": "✔ put resource booking with administrator", - "request": { - "method": "PUT", - "header": [ - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{token_administrator}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"a55fe1bc-1754-45fa-9adc-cf3d6d7c377a\",\r\n \"jobId\": \"{{job_id_created_by_administrator}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\",\r\n \"status\": \"assigned\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{URL}}/resourceBookings/{{resource_bookings_id_created_by_administrator}}", - "host": [ - "{{URL}}" - ], - "path": [ - "resourceBookings", - "{{resource_bookings_id_created_by_administrator}}" - ] - } - }, - "response": [] - }, - { - "name": "✔ patch resource booking with administrator", - "request": { - "method": "PATCH", - "header": [ - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{token_administrator}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"status\": \"assigned\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\"\r\n}", - "options": { - "raw": { - "language": "json" - } + "name": "✔ put 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" } - }, - "url": { - "raw": "{{URL}}/resourceBookings/{{resource_bookings_id_created_by_administrator}}", - "host": [ - "{{URL}}" - ], - "path": [ - "resourceBookings", - "{{resource_bookings_id_created_by_administrator}}" - ] } - }, - "response": [] - }, - { - "name": "✔ delete resource booking with administrator", + ], "request": { - "method": "DELETE", + "method": "PUT", "header": [ { "key": "Authorization", @@ -12343,138 +15764,30 @@ "value": "Bearer {{token_administrator}}" } ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{URL}}/resourceBookings/{{resource_bookings_id_created_by_administrator}}", - "host": [ - "{{URL}}" - ], - "path": [ - "resourceBookings", - "{{resource_bookings_id_created_by_administrator}}" - ] - } - }, - "response": [] - } - ] - }, - { - "name": "Work Periods", - "item": [ - { - "name": "Before Test", - "item": [ - { - "name": "✔ create job with administrator", - "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(\"job_id_created_by_administrator\", response.id);\r", - " }\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token_administrator}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"projectId\": {{projectId}},\n \"externalId\": \"1212\",\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"23e00d92-207a-4b5b-b3c9-4c5662644941\",\n \"7d076384-ccf6-4e43-a45d-1b24b1e624aa\",\n \"cbac57a3-7180-4316-8769-73af64893158\",\n \"a2b4bc11-c641-4a19-9eb7-33980378f82e\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{URL}}/jobs", - "host": [ - "{{URL}}" - ], - "path": [ - "jobs" - ] - } - }, - "response": [] - }, - { - "name": "✔ create resource booking with administrator", - "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(\"resource_bookings_id_created_by_administrator\", response.id);\r", - " }\r", - "});" - ], - "type": "text/javascript" - } + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId_created_by_administrator}}\",\r\n \"amount\": 1600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId_created_by_administrator}}", + "host": [ + "{{URL}}" ], - "request": { - "method": "POST", - "header": [ - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{token_administrator}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"userId\": \"a55fe1bc-1754-45fa-9adc-cf3d6d7c377a\",\r\n \"jobId\": \"{{job_id_created_by_administrator}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{URL}}/resourceBookings", - "host": [ - "{{URL}}" - ], - "path": [ - "resourceBookings" - ] - } - }, - "response": [] + "path": [ + "work-period-payments", + "{{workPeriodPaymentId_created_by_administrator}}" + ] } - ] + }, + "response": [] }, { - "name": "✔ create work period with administrator", + "name": "✔ patch work period payment with administrator", "event": [ { "listen": "test", @@ -12482,10 +15795,6 @@ "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(\"workPeriodId_created_by_administrator\", response.id);\r", - " }\r", "});" ], "type": "text/javascript" @@ -12493,7 +15802,7 @@ } ], "request": { - "method": "POST", + "method": "PATCH", "header": [ { "key": "Authorization", @@ -12503,7 +15812,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"resourceBookingId\": \"{{resource_bookings_id_created_by_administrator}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\r\n \"daysWorked\": 2,\r\n \"memberRate\": 13.13,\r\n \"customerRate\": 13.13,\r\n \"paymentStatus\": \"pending\"\r\n}", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId_created_by_administrator}}\",\r\n \"amount\": 450,\r\n \"status\": \"cancelled\"\r\n}", "options": { "raw": { "language": "json" @@ -12511,69 +15820,140 @@ } }, "url": { - "raw": "{{URL}}/work-periods", + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId_created_by_administrator}}", "host": [ "{{URL}}" ], "path": [ - "work-periods" + "work-period-payments", + "{{workPeriodPaymentId_created_by_administrator}}" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Request with Topcoder User Role", + "item": [ + { + "name": "README", + "item": [ + { + "name": "[STUB] all operations cause 403 error if user is not member of project", + "request": { + "method": "LOCK", + "header": [], + "url": { + "raw": "" + } + }, + "response": [] + } + ] + }, + { + "name": "Jobs", + "item": [ + { + "name": "✔ create job with member", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var data = JSON.parse(responseBody);\r", + "postman.setEnvironmentVariable(\"job_id_created_by_member\",data.id);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token_member_tester1234}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"projectId\": {{project_id_16718}},\n \"externalId\": \"1212\",\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"23e00d92-207a-4b5b-b3c9-4c5662644941\",\n \"7d076384-ccf6-4e43-a45d-1b24b1e624aa\",\n \"cbac57a3-7180-4316-8769-73af64893158\",\n \"a2b4bc11-c641-4a19-9eb7-33980378f82e\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobs", + "host": [ + "{{URL}}" + ], + "path": [ + "jobs" ] } }, "response": [] }, { - "name": "✔ get work period with administrator", + "name": "✔ get job with member", "request": { "method": "GET", "header": [ { "key": "Authorization", "type": "text", - "value": "Bearer {{token_administrator}}" + "value": "Bearer {{token_member_tester1234}}" } ], "url": { - "raw": "{{URL}}/work-periods/{{workPeriodId_created_by_administrator}}", + "raw": "{{URL}}/jobs/{{job_id_created_by_member}}", "host": [ "{{URL}}" ], "path": [ - "work-periods", - "{{workPeriodId_created_by_administrator}}" + "jobs", + "{{job_id_created_by_member}}" ] } }, "response": [] }, { - "name": "✔ search work periods with administrator", + "name": "✔ search jobs with member filtering by \"projectId\"", "request": { "method": "GET", "header": [ { "key": "Authorization", "type": "text", - "value": "Bearer {{token_administrator}}" + "value": "Bearer {{token_member_tester1234}}" } ], "url": { - "raw": "{{URL}}/work-periods", + "raw": "{{URL}}/jobs?projectId={{project_id_16718}}", "host": [ "{{URL}}" ], "path": [ - "work-periods" + "jobs" ], "query": [ { "key": "page", - "value": "1", + "value": "0", "disabled": true }, { "key": "perPage", - "value": "5", + "value": "3", "disabled": true }, { @@ -12583,42 +15963,56 @@ }, { "key": "sortOrder", - "value": "desc", + "value": "asc", "disabled": true }, { - "key": "resourceBookingId", - "value": "{{resource_bookings_id_created_by_administrator}}", - "disabled": true + "key": "projectId", + "value": "{{project_id_16718}}" }, { - "key": "resourceBookingIds", - "value": "{{resource_bookings_id_created_by_administrator}},{{resource_bookings_id_created_by_administrator}}", + "key": "externalId", + "value": "1212", "disabled": true }, { - "key": "paymentStatus", - "value": "pending", + "key": "description", + "value": "Dummy", "disabled": true }, { "key": "startDate", - "value": "2021-03-07", + "value": "2020-09-27T04:17:23.131Z", "disabled": true }, { - "key": "endDate", - "value": "2021-03-13", + "key": "resourceType", + "value": "Dummy Resource Type", "disabled": true }, { - "key": "userHandle", - "value": "pshah_manager", + "key": "skill", + "value": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "disabled": true }, { - "key": "projectId", - "value": "111", + "key": "rateType", + "value": "hourly", + "disabled": true + }, + { + "key": "status", + "value": "sourcing", + "disabled": true + }, + { + "key": "workload", + "value": "full-time", + "disabled": true + }, + { + "key": "title", + "value": "dummy", "disabled": true } ] @@ -12627,32 +16021,19 @@ "response": [] }, { - "name": "✔ put work period 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" - } - } - ], + "name": "✔ put job with member", "request": { "method": "PUT", "header": [ { "key": "Authorization", "type": "text", - "value": "Bearer {{token_administrator}}" + "value": "Bearer {{token_member_tester1234}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"resourceBookingId\": \"{{resource_bookings_id_created_by_administrator}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\r\n \"daysWorked\": 2,\r\n \"memberRate\": 13.13,\r\n \"customerRate\": 13.13,\r\n \"paymentStatus\": \"pending\"\r\n}", + "raw": "{\n \"projectId\": {{project_id_16718}},\n \"externalId\": \"1212\",\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"fractional\",\n \"skills\": [\n \"cbac57a3-7180-4316-8769-73af64893158\",\n \"a2b4bc11-c641-4a19-9eb7-33980378f82e\"\n ],\n \"status\": \"sourcing\",\n \"title\": \"Dummy title - at most 64 characters\"\n}", "options": { "raw": { "language": "json" @@ -12660,45 +16041,32 @@ } }, "url": { - "raw": "{{URL}}/work-periods/{{workPeriodId_created_by_administrator}}", + "raw": "{{URL}}/jobs/{{job_id_created_by_member}}", "host": [ "{{URL}}" ], "path": [ - "work-periods", - "{{workPeriodId_created_by_administrator}}" + "jobs", + "{{job_id_created_by_member}}" ] } }, "response": [] }, { - "name": "✔ patch work period 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" - } - } - ], + "name": "✔ patch job with member", "request": { "method": "PATCH", "header": [ { "key": "Authorization", "type": "text", - "value": "Bearer {{token_administrator}}" + "value": "Bearer {{token_member_tester1234}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"resourceBookingId\": \"{{resource_bookings_id_created_by_administrator}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\r\n \"daysWorked\": 2,\r\n \"memberRate\": 13.13,\r\n \"customerRate\": 13.13,\r\n \"paymentStatus\": \"pending\"\r\n}", + "raw": "{\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"fractional\",\n \"skills\": [\n \"cbac57a3-7180-4316-8769-73af64893158\"\n ],\n \"status\": \"sourcing\",\n \"title\": \"Dummy title - at most 64 characters\"\n}", "options": { "raw": { "language": "json" @@ -12706,40 +16074,27 @@ } }, "url": { - "raw": "{{URL}}/work-periods/{{workPeriodId_created_by_administrator}}", + "raw": "{{URL}}/jobs/{{job_id_created_by_member}}", "host": [ "{{URL}}" ], "path": [ - "work-periods", - "{{workPeriodId_created_by_administrator}}" + "jobs", + "{{job_id_created_by_member}}" ] } }, "response": [] - }, - { - "name": "✔ delete work period with administrator", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test('Status code is 204', function () {\r", - " pm.response.to.have.status(204);\r", - "});" - ], - "type": "text/javascript" - } - } - ], + }, + { + "name": "✘ delete job with member", "request": { "method": "DELETE", "header": [ { "key": "Authorization", "type": "text", - "value": "Bearer {{token_administrator}}" + "value": "Bearer {{token_member_tester1234}}" } ], "body": { @@ -12752,53 +16107,81 @@ } }, "url": { - "raw": "{{URL}}/work-periods/{{workPeriodId_created_by_administrator}}", + "raw": "{{URL}}/jobs/{{job_id_created_by_member}}", "host": [ "{{URL}}" ], "path": [ - "work-periods", - "{{workPeriodId_created_by_administrator}}" + "jobs", + "{{job_id_created_by_member}}" ] } }, "response": [] } ] - } - ] - }, - { - "name": "Request with Topcoder User Role", - "item": [ + }, { - "name": "README", + "name": "Job Candidates", "item": [ { - "name": "[STUB] all operations cause 403 error if user is not member of project", - "request": { - "method": "LOCK", - "header": [], - "url": { - "raw": "" + "name": "Before Test", + "item": [ + { + "name": "create job candidate", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var data = JSON.parse(responseBody);\r", + "postman.setEnvironmentVariable(\"job_candidate_id_created_for_member\",data.id);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_administrator}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"jobId\": \"{{job_id_created_by_member}}\",\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobCandidates", + "host": [ + "{{URL}}" + ], + "path": [ + "jobCandidates" + ] + } + }, + "response": [] } - }, - "response": [] - } - ] - }, - { - "name": "Jobs", - "item": [ + ] + }, { - "name": "✔ create job with member", + "name": "✘ create job candidate with member", "event": [ { "listen": "test", "script": { "exec": [ "var data = JSON.parse(responseBody);\r", - "postman.setEnvironmentVariable(\"job_id_created_by_member\",data.id);" + "postman.setEnvironmentVariable(\"job_candidate_id_created_by_member\",data.id);" ], "type": "text/javascript" } @@ -12809,13 +16192,13 @@ "header": [ { "key": "Authorization", - "value": "Bearer {{token_member_tester1234}}", - "type": "text" + "type": "text", + "value": "Bearer {{token_member_tester1234}}" } ], "body": { "mode": "raw", - "raw": "{\n \"projectId\": {{project_id_16718}},\n \"externalId\": \"1212\",\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"23e00d92-207a-4b5b-b3c9-4c5662644941\",\n \"7d076384-ccf6-4e43-a45d-1b24b1e624aa\",\n \"cbac57a3-7180-4316-8769-73af64893158\",\n \"a2b4bc11-c641-4a19-9eb7-33980378f82e\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "raw": "{\r\n \"jobId\": \"{{job_id_created_by_member}}\",\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\"\r\n}", "options": { "raw": { "language": "json" @@ -12823,19 +16206,19 @@ } }, "url": { - "raw": "{{URL}}/jobs", + "raw": "{{URL}}/jobCandidates", "host": [ "{{URL}}" ], "path": [ - "jobs" + "jobCandidates" ] } }, "response": [] }, { - "name": "✔ get job with member", + "name": "✔ get job candidate with member", "request": { "method": "GET", "header": [ @@ -12846,20 +16229,20 @@ } ], "url": { - "raw": "{{URL}}/jobs/{{job_id_created_by_member}}", + "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_for_member}}", "host": [ "{{URL}}" ], "path": [ - "jobs", - "{{job_id_created_by_member}}" + "jobCandidates", + "{{job_candidate_id_created_for_member}}" ] } }, "response": [] }, { - "name": "✔ search jobs with member filtering by \"projectId\"", + "name": "✔ search job candidates with member filtering by \"jobId\"", "request": { "method": "GET", "header": [ @@ -12870,22 +16253,22 @@ } ], "url": { - "raw": "{{URL}}/jobs?projectId={{project_id_16718}}", + "raw": "{{URL}}/jobCandidates?jobId={{job_id_created_by_member}}", "host": [ "{{URL}}" ], "path": [ - "jobs" + "jobCandidates" ], "query": [ { "key": "page", - "value": "0", + "value": "1", "disabled": true }, { "key": "perPage", - "value": "3", + "value": "1", "disabled": true }, { @@ -12899,52 +16282,17 @@ "disabled": true }, { - "key": "projectId", - "value": "{{project_id_16718}}" - }, - { - "key": "externalId", - "value": "1212", - "disabled": true - }, - { - "key": "description", - "value": "Dummy", - "disabled": true - }, - { - "key": "startDate", - "value": "2020-09-27T04:17:23.131Z", - "disabled": true - }, - { - "key": "resourceType", - "value": "Dummy Resource Type", - "disabled": true - }, - { - "key": "skill", - "value": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "disabled": true + "key": "jobId", + "value": "{{job_id_created_by_member}}" }, { - "key": "rateType", - "value": "hourly", + "key": "userId", + "value": "fe38eed1-af73-41fd-85a2-ac4da1ff09a3", "disabled": true }, { "key": "status", - "value": "sourcing", - "disabled": true - }, - { - "key": "workload", - "value": "full-time", - "disabled": true - }, - { - "key": "title", - "value": "dummy", + "value": "shortlist", "disabled": true } ] @@ -12953,7 +16301,7 @@ "response": [] }, { - "name": "✔ put job with member", + "name": "✔ put job candidate with member", "request": { "method": "PUT", "header": [ @@ -12965,7 +16313,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"projectId\": {{project_id_16718}},\n \"externalId\": \"1212\",\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"fractional\",\n \"skills\": [\n \"cbac57a3-7180-4316-8769-73af64893158\",\n \"a2b4bc11-c641-4a19-9eb7-33980378f82e\"\n ],\n \"status\": \"sourcing\",\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "raw": "{\r\n \"jobId\": \"{{job_id_created_by_member}}\",\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\",\r\n \"status\": \"selected\"\r\n}", "options": { "raw": { "language": "json" @@ -12973,20 +16321,20 @@ } }, "url": { - "raw": "{{URL}}/jobs/{{job_id_created_by_member}}", + "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_for_member}}", "host": [ "{{URL}}" ], "path": [ - "jobs", - "{{job_id_created_by_member}}" + "jobCandidates", + "{{job_candidate_id_created_for_member}}" ] } }, "response": [] }, { - "name": "✔ patch job with member", + "name": "✔ patch job candidate with member", "request": { "method": "PATCH", "header": [ @@ -12998,7 +16346,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"fractional\",\n \"skills\": [\n \"cbac57a3-7180-4316-8769-73af64893158\"\n ],\n \"status\": \"sourcing\",\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "raw": "{\r\n \"status\": \"shortlist\"\r\n}", "options": { "raw": { "language": "json" @@ -13006,20 +16354,20 @@ } }, "url": { - "raw": "{{URL}}/jobs/{{job_id_created_by_member}}", + "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_for_member}}", "host": [ "{{URL}}" ], "path": [ - "jobs", - "{{job_id_created_by_member}}" + "jobCandidates", + "{{job_candidate_id_created_for_member}}" ] } }, "response": [] }, { - "name": "✘ delete job with member", + "name": "✘ delete job candidate with member", "request": { "method": "DELETE", "header": [ @@ -13039,13 +16387,13 @@ } }, "url": { - "raw": "{{URL}}/jobs/{{job_id_created_by_member}}", + "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_for_member}}", "host": [ "{{URL}}" ], "path": [ - "jobs", - "{{job_id_created_by_member}}" + "jobCandidates", + "{{job_candidate_id_created_for_member}}" ] } }, @@ -13054,20 +16402,20 @@ ] }, { - "name": "Job Candidates", + "name": "Resource Bookings", "item": [ { "name": "Before Test", "item": [ { - "name": "create job candidate", + "name": "create resource booking", "event": [ { "listen": "test", "script": { "exec": [ "var data = JSON.parse(responseBody);\r", - "postman.setEnvironmentVariable(\"job_candidate_id_created_for_member\",data.id);" + "postman.setEnvironmentVariable(\"resource_booking_id_created_for_member\",data.id);" ], "type": "text/javascript" } @@ -13084,7 +16432,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{job_id_created_by_member}}\",\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\"\r\n}", + "raw": "{\r\n \"projectId\": {{project_id_16718}},\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\",\r\n \"jobId\": \"{{job_id_created_by_member}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\"\r\n}", "options": { "raw": { "language": "json" @@ -13092,12 +16440,12 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates", + "raw": "{{URL}}/resourceBookings", "host": [ "{{URL}}" ], "path": [ - "jobCandidates" + "resourceBookings" ] } }, @@ -13106,14 +16454,14 @@ ] }, { - "name": "✘ create job candidate with member", + "name": "✘ create resource booking with member", "event": [ { "listen": "test", "script": { "exec": [ "var data = JSON.parse(responseBody);\r", - "postman.setEnvironmentVariable(\"job_candidate_id_created_by_member\",data.id);" + "postman.setEnvironmentVariable(\"resource_booking_id_created_by_member\",data.id);" ], "type": "text/javascript" } @@ -13130,7 +16478,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{job_id_created_by_member}}\",\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\"\r\n}", + "raw": "{\r\n \"projectId\": {{project_id_16718}},\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\",\r\n \"jobId\": \"{{job_id_created_by_member}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\"\r\n}", "options": { "raw": { "language": "json" @@ -13138,19 +16486,19 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates", + "raw": "{{URL}}/resourceBookings", "host": [ "{{URL}}" ], "path": [ - "jobCandidates" + "resourceBookings" ] } }, "response": [] }, { - "name": "✔ get job candidate with member", + "name": "✔ get resource booking with member", "request": { "method": "GET", "header": [ @@ -13161,20 +16509,20 @@ } ], "url": { - "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_for_member}}", + "raw": "{{URL}}/resourceBookings/{{resource_booking_id_created_for_member}}", "host": [ "{{URL}}" ], "path": [ - "jobCandidates", - "{{job_candidate_id_created_for_member}}" + "resourceBookings", + "{{resource_booking_id_created_for_member}}" ] } }, "response": [] }, { - "name": "✔ search job candidates with member filtering by \"jobId\"", + "name": "✔ search resource bookings with member filtering by \"projectId\"", "request": { "method": "GET", "header": [ @@ -13185,12 +16533,12 @@ } ], "url": { - "raw": "{{URL}}/jobCandidates?jobId={{job_id_created_by_member}}", + "raw": "{{URL}}/resourceBookings?projectId={{project_id_16718}}", "host": [ "{{URL}}" ], "path": [ - "jobCandidates" + "resourceBookings" ], "query": [ { @@ -13200,7 +16548,7 @@ }, { "key": "perPage", - "value": "1", + "value": "5", "disabled": true }, { @@ -13210,22 +16558,37 @@ }, { "key": "sortOrder", - "value": "asc", + "value": "desc", "disabled": true }, { - "key": "jobId", - "value": "{{job_id_created_by_member}}" + "key": "startDate", + "value": "2020-09-27T04:17:23.131Z", + "disabled": true }, { - "key": "userId", - "value": "fe38eed1-af73-41fd-85a2-ac4da1ff09a3", + "key": "endDate", + "value": "2020-09-27T04:17:23.131Z", + "disabled": true + }, + { + "key": "rateType", + "value": "hourly", "disabled": true }, { "key": "status", - "value": "shortlist", + "value": "sourcing", + "disabled": true + }, + { + "key": "projectIds", + "value": "111, 16705", "disabled": true + }, + { + "key": "projectId", + "value": "{{project_id_16718}}" } ] } @@ -13233,7 +16596,7 @@ "response": [] }, { - "name": "✔ put job candidate with member", + "name": "✘ put resource booking with member", "request": { "method": "PUT", "header": [ @@ -13245,7 +16608,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{job_id_created_by_member}}\",\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\",\r\n \"status\": \"selected\"\r\n}", + "raw": "{\r\n \"projectId\": {{project_id_16718}},\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\",\r\n \"jobId\": \"{{job_id_created_by_member}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\",\r\n \"status\": \"assigned\"\r\n}", "options": { "raw": { "language": "json" @@ -13253,20 +16616,20 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_for_member}}", + "raw": "{{URL}}/resourceBookings/{{resource_booking_id_created_for_member}}", "host": [ "{{URL}}" ], "path": [ - "jobCandidates", - "{{job_candidate_id_created_for_member}}" + "resourceBookings", + "{{resource_booking_id_created_for_member}}" ] } }, "response": [] }, { - "name": "✔ patch job candidate with member", + "name": "✘ patch resource booking with member", "request": { "method": "PATCH", "header": [ @@ -13278,7 +16641,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"status\": \"shortlist\"\r\n}", + "raw": "{\r\n \"status\": \"assigned\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\"\r\n}", "options": { "raw": { "language": "json" @@ -13286,20 +16649,20 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_for_member}}", + "raw": "{{URL}}/resourceBookings/{{resource_booking_id_created_for_member}}", "host": [ "{{URL}}" ], "path": [ - "jobCandidates", - "{{job_candidate_id_created_for_member}}" + "resourceBookings", + "{{resource_booking_id_created_for_member}}" ] } }, "response": [] }, { - "name": "✘ delete job candidate with member", + "name": "✘ delete resource booking with member", "request": { "method": "DELETE", "header": [ @@ -13319,13 +16682,13 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_for_member}}", + "raw": "{{URL}}/resourceBookings/{{resource_booking_id_created_for_member}}", "host": [ "{{URL}}" ], "path": [ - "jobCandidates", - "{{job_candidate_id_created_for_member}}" + "resourceBookings", + "{{resource_booking_id_created_for_member}}" ] } }, @@ -13334,11 +16697,60 @@ ] }, { - "name": "Resource Bookings", + "name": "Work Periods", "item": [ { "name": "Before Test", "item": [ + { + "name": "create job", + "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(\"job_id_created_by_member\", response.id);\r", + " }\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token_member_tester1234}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"projectId\": {{project_id_16718}},\n \"externalId\": \"1212\",\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"23e00d92-207a-4b5b-b3c9-4c5662644941\",\n \"7d076384-ccf6-4e43-a45d-1b24b1e624aa\",\n \"cbac57a3-7180-4316-8769-73af64893158\",\n \"a2b4bc11-c641-4a19-9eb7-33980378f82e\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobs", + "host": [ + "{{URL}}" + ], + "path": [ + "jobs" + ] + } + }, + "response": [] + }, { "name": "create resource booking", "event": [ @@ -13346,8 +16758,13 @@ "listen": "test", "script": { "exec": [ - "var data = JSON.parse(responseBody);\r", - "postman.setEnvironmentVariable(\"resource_booking_id_created_for_member\",data.id);" + "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(\"resource_booking_id_created_for_member\", response.id);\r", + " }\r", + "});" ], "type": "text/javascript" } @@ -13382,18 +16799,70 @@ } }, "response": [] + }, + { + "name": "create work period", + "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(\"workPeriodId_created_for_member\", response.id);\r", + " }\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_administrator}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"resourceBookingId\": \"{{resource_booking_id_created_for_member}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\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 resource booking with member", + "name": "✘ create work period with member", "event": [ { "listen": "test", "script": { "exec": [ - "var data = JSON.parse(responseBody);\r", - "postman.setEnvironmentVariable(\"resource_booking_id_created_by_member\",data.id);" + "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" } @@ -13410,7 +16879,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{project_id_16718}},\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\",\r\n \"jobId\": \"{{job_id_created_by_member}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\"\r\n}", + "raw": "{\r\n \"resourceBookingId\": \"{{resource_booking_id_created_for_member}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\r\n \"daysWorked\": 2,\r\n \"memberRate\": 13.13,\r\n \"customerRate\": 13.13,\r\n \"paymentStatus\": \"pending\"\r\n}", "options": { "raw": { "language": "json" @@ -13418,19 +16887,19 @@ } }, "url": { - "raw": "{{URL}}/resourceBookings", + "raw": "{{URL}}/work-periods", "host": [ "{{URL}}" ], "path": [ - "resourceBookings" + "work-periods" ] } }, "response": [] }, { - "name": "✔ get resource booking with member", + "name": "✔ get work period with member", "request": { "method": "GET", "header": [ @@ -13441,20 +16910,26 @@ } ], "url": { - "raw": "{{URL}}/resourceBookings/{{resource_booking_id_created_for_member}}", + "raw": "{{URL}}/work-periods/{{workPeriodId_created_for_member}}?projectId=16718", "host": [ "{{URL}}" ], "path": [ - "resourceBookings", - "{{resource_booking_id_created_for_member}}" + "work-periods", + "{{workPeriodId_created_for_member}}" + ], + "query": [ + { + "key": "projectId", + "value": "16718" + } ] } }, "response": [] }, { - "name": "✔ search resource bookings with member filtering by \"projectId\"", + "name": "✔ search work periods with member", "request": { "method": "GET", "header": [ @@ -13465,12 +16940,12 @@ } ], "url": { - "raw": "{{URL}}/resourceBookings?projectId={{project_id_16718}}", + "raw": "{{URL}}/work-periods?projectId=16718", "host": [ "{{URL}}" ], "path": [ - "resourceBookings" + "work-periods" ], "query": [ { @@ -13494,33 +16969,38 @@ "disabled": true }, { - "key": "startDate", - "value": "2020-09-27T04:17:23.131Z", + "key": "resourceBookingId", + "value": "{{resource_booking_id_created_for_member}}", "disabled": true }, { - "key": "endDate", - "value": "2020-09-27T04:17:23.131Z", + "key": "resourceBookingIds", + "value": "{{resource_booking_id_created_for_member}},{{resource_booking_id_created_for_member}}", "disabled": true }, { - "key": "rateType", - "value": "hourly", + "key": "paymentStatus", + "value": "pending", "disabled": true }, { - "key": "status", - "value": "sourcing", + "key": "startDate", + "value": "2021-03-07", "disabled": true }, { - "key": "projectIds", - "value": "111, 16705", + "key": "endDate", + "value": "2021-03-13", + "disabled": true + }, + { + "key": "userHandle", + "value": "pshah_manager", "disabled": true }, { "key": "projectId", - "value": "{{project_id_16718}}" + "value": "16718" } ] } @@ -13528,7 +17008,22 @@ "response": [] }, { - "name": "✘ put resource booking with member", + "name": "✘ put work period 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": "PUT", "header": [ @@ -13540,7 +17035,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{project_id_16718}},\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\",\r\n \"jobId\": \"{{job_id_created_by_member}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\",\r\n \"status\": \"assigned\"\r\n}", + "raw": "{\r\n \"resourceBookingId\": \"{{resource_booking_id_created_for_member}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\r\n \"daysWorked\": 2,\r\n \"memberRate\": 13.13,\r\n \"customerRate\": 13.13,\r\n \"paymentStatus\": \"pending\"\r\n}", "options": { "raw": { "language": "json" @@ -13548,20 +17043,35 @@ } }, "url": { - "raw": "{{URL}}/resourceBookings/{{resource_booking_id_created_for_member}}", + "raw": "{{URL}}/work-periods/{{workPeriodId_created_for_member}}", "host": [ "{{URL}}" ], "path": [ - "resourceBookings", - "{{resource_booking_id_created_for_member}}" + "work-periods", + "{{workPeriodId_created_for_member}}" ] } }, "response": [] }, { - "name": "✘ patch resource booking with member", + "name": "✘ patch work period 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": "PATCH", "header": [ @@ -13573,7 +17083,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"status\": \"assigned\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\"\r\n}", + "raw": "{\r\n \"resourceBookingId\": \"{{resource_booking_id_created_for_member}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\r\n \"daysWorked\": 2,\r\n \"memberRate\": 13.13,\r\n \"customerRate\": 13.13,\r\n \"paymentStatus\": \"pending\"\r\n}", "options": { "raw": { "language": "json" @@ -13581,20 +17091,35 @@ } }, "url": { - "raw": "{{URL}}/resourceBookings/{{resource_booking_id_created_for_member}}", + "raw": "{{URL}}/work-periods/{{workPeriodId_created_for_member}}", "host": [ "{{URL}}" ], "path": [ - "resourceBookings", - "{{resource_booking_id_created_for_member}}" + "work-periods", + "{{workPeriodId_created_for_member}}" ] } - }, - "response": [] - }, - { - "name": "✘ delete resource booking with member", + }, + "response": [] + }, + { + "name": "✘ delete work period 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": "DELETE", "header": [ @@ -13614,13 +17139,13 @@ } }, "url": { - "raw": "{{URL}}/resourceBookings/{{resource_booking_id_created_for_member}}", + "raw": "{{URL}}/work-periods/{{workPeriodId_created_for_member}}", "host": [ "{{URL}}" ], "path": [ - "resourceBookings", - "{{resource_booking_id_created_for_member}}" + "work-periods", + "{{workPeriodId_created_for_member}}" ] } }, @@ -13629,13 +17154,13 @@ ] }, { - "name": "Work Periods", + "name": "Work Period Payments", "item": [ { "name": "Before Test", "item": [ { - "name": "create job", + "name": "✔ create job", "event": [ { "listen": "test", @@ -13645,7 +17170,7 @@ " pm.response.to.have.status(200);\r", " if(pm.response.status === \"OK\"){\r", " const response = pm.response.json()\r", - " pm.environment.set(\"job_id_created_by_member\", response.id);\r", + " pm.environment.set(\"job_id_created_for_member\", response.id);\r", " }\r", "});" ], @@ -13658,13 +17183,13 @@ "header": [ { "key": "Authorization", - "value": "Bearer {{token_member_tester1234}}", + "value": "Bearer {{token_administrator}}", "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n \"projectId\": {{project_id_16718}},\n \"externalId\": \"1212\",\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"23e00d92-207a-4b5b-b3c9-4c5662644941\",\n \"7d076384-ccf6-4e43-a45d-1b24b1e624aa\",\n \"cbac57a3-7180-4316-8769-73af64893158\",\n \"a2b4bc11-c641-4a19-9eb7-33980378f82e\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "raw": "{\n \"projectId\": {{project_id_17234}},\n \"externalId\": \"1212\",\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"23e00d92-207a-4b5b-b3c9-4c5662644941\",\n \"7d076384-ccf6-4e43-a45d-1b24b1e624aa\",\n \"cbac57a3-7180-4316-8769-73af64893158\",\n \"a2b4bc11-c641-4a19-9eb7-33980378f82e\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", "options": { "raw": { "language": "json" @@ -13684,7 +17209,7 @@ "response": [] }, { - "name": "create resource booking", + "name": "✔ create resource booking", "event": [ { "listen": "test", @@ -13694,7 +17219,7 @@ " pm.response.to.have.status(200);\r", " if(pm.response.status === \"OK\"){\r", " const response = pm.response.json()\r", - " pm.environment.set(\"resource_booking_id_created_for_member\", response.id);\r", + " pm.environment.set(\"resource_bookings_id_created_for_member\", response.id);\r", " }\r", "});" ], @@ -13713,78 +17238,288 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{project_id_16718}},\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\",\r\n \"jobId\": \"{{job_id_created_by_member}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\"\r\n}", + "raw": "{\r\n \"projectId\": {{project_id_17234}},\r\n \"userId\": \"a55fe1bc-1754-45fa-9adc-cf3d6d7c377a\",\r\n \"jobId\": \"{{job_id_created_for_member}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/resourceBookings", + "host": [ + "{{URL}}" + ], + "path": [ + "resourceBookings" + ] + } + }, + "response": [] + }, + { + "name": "✔ create work period", + "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(\"workPeriodId_created_for_member\", response.id);\r", + " }\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_administrator}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"resourceBookingId\": \"{{resource_bookings_id_created_for_member}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\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 payment", + "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(\"workPeriodPaymentId_created_for_member\", response.id);\r", + " }\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_administrator}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId_created_for_member}}\",\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", "options": { "raw": { "language": "json" } } }, - "url": { - "raw": "{{URL}}/resourceBookings", - "host": [ - "{{URL}}" - ], - "path": [ - "resourceBookings" - ] - } - }, - "response": [] - }, - { - "name": "create work period", - "event": [ + "url": { + "raw": "{{URL}}/work-period-payments", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "✘ create 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": "{\r\n \"workPeriodId\": \"{{workPeriodId_created_for_member}}\",\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments" + ] + } + }, + "response": [] + }, + { + "name": "✘ get 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": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_member_tester1234}}" + } + ], + "url": { + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId_created_for_member}}", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments", + "{{workPeriodPaymentId_created_for_member}}" + ] + } + }, + "response": [] + }, + { + "name": "✘ search work period payments 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": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_member_tester1234}}" + } + ], + "url": { + "raw": "{{URL}}/work-period-payments", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments" + ], + "query": [ + { + "key": "page", + "value": "1", + "disabled": true + }, + { + "key": "perPage", + "value": "5", + "disabled": true + }, + { + "key": "sortBy", + "value": "status", + "disabled": true + }, { - "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(\"workPeriodId_created_for_member\", response.id);\r", - " }\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{token_administrator}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"resourceBookingId\": \"{{resource_booking_id_created_for_member}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\r\n \"daysWorked\": 2,\r\n \"memberRate\": 13.13,\r\n \"customerRate\": 13.13,\r\n \"paymentStatus\": \"pending\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } + "key": "sortOrder", + "value": "desc", + "disabled": true }, - "url": { - "raw": "{{URL}}/work-periods", - "host": [ - "{{URL}}" - ], - "path": [ - "work-periods" - ] + { + "key": "workPeriodId", + "value": "{{workPeriodPaymentId_created_for_member}}", + "disabled": true + }, + { + "key": "workPeriodIds", + "value": "{{workPeriodPaymentId_created_for_member}},{{workPeriodPaymentId_created_for_member}}", + "disabled": true + }, + { + "key": "status", + "value": "completed", + "disabled": true } - }, - "response": [] + ] } - ] + }, + "response": [] }, { - "name": "✘ create work period with member", + "name": "✘ put work period payment with member", "event": [ { "listen": "test", @@ -13801,7 +17536,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "Authorization", @@ -13811,7 +17546,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"resourceBookingId\": \"{{resource_booking_id_created_for_member}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\r\n \"daysWorked\": 2,\r\n \"memberRate\": 13.13,\r\n \"customerRate\": 13.13,\r\n \"paymentStatus\": \"pending\"\r\n}", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId_created_for_member}}\",\r\n \"amount\": 1600,\r\n \"status\": \"completed\"\r\n}", "options": { "raw": { "language": "json" @@ -13819,21 +17554,37 @@ } }, "url": { - "raw": "{{URL}}/work-periods", + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId_created_for_member}}", "host": [ "{{URL}}" ], "path": [ - "work-periods" + "work-period-payments", + "{{workPeriodPaymentId_created_for_member}}" ] } }, "response": [] }, { - "name": "✔ get work period with member", + "name": "✘ patch 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": "GET", + "method": "PATCH", "header": [ { "key": "Authorization", @@ -13841,53 +17592,150 @@ "value": "Bearer {{token_member_tester1234}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId_created_for_member}}\",\r\n \"amount\": 450,\r\n \"status\": \"cancelled\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{URL}}/work-periods/{{workPeriodId_created_for_member}}?projectId=16718", + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId_created_for_member}}", "host": [ "{{URL}}" ], "path": [ - "work-periods", - "{{workPeriodId_created_for_member}}" - ], - "query": [ - { - "key": "projectId", - "value": "16718" + "work-period-payments", + "{{workPeriodPaymentId_created_for_member}}" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Request with Connect Manager Role", + "item": [ + { + "name": "README", + "item": [ + { + "name": "[STUB] all operations except get/search cause 403 error if manager is not member of project", + "request": { + "method": "LOCK", + "header": [], + "url": { + "raw": "" + } + }, + "response": [] + } + ] + }, + { + "name": "Jobs", + "item": [ + { + "name": "✔ create job with connect manager", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var data = JSON.parse(responseBody);\r", + "postman.setEnvironmentVariable(\"job_id_created_by_connect_manager\",data.id);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token_connect_manager_pshahcopmanag2}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"projectId\": {{project_id_16843}},\n \"externalId\": \"1212\",\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"23e00d92-207a-4b5b-b3c9-4c5662644941\",\n \"7d076384-ccf6-4e43-a45d-1b24b1e624aa\",\n \"cbac57a3-7180-4316-8769-73af64893158\",\n \"a2b4bc11-c641-4a19-9eb7-33980378f82e\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "options": { + "raw": { + "language": "json" } + } + }, + "url": { + "raw": "{{URL}}/jobs", + "host": [ + "{{URL}}" + ], + "path": [ + "jobs" ] } }, "response": [] }, { - "name": "✔ search work periods with member", + "name": "✔ get job with connect manager", "request": { "method": "GET", "header": [ { "key": "Authorization", "type": "text", - "value": "Bearer {{token_member_tester1234}}" + "value": "Bearer {{token_connect_manager_pshahcopmanag2}}" } ], "url": { - "raw": "{{URL}}/work-periods?projectId=16718", + "raw": "{{URL}}/jobs/{{job_id_created_by_connect_manager}}", "host": [ "{{URL}}" ], "path": [ - "work-periods" + "jobs", + "{{job_id_created_by_connect_manager}}" + ] + } + }, + "response": [] + }, + { + "name": "✔ search jobs with connect manager", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_connect_manager_pshahcopmanag2}}" + } + ], + "url": { + "raw": "{{URL}}/jobs", + "host": [ + "{{URL}}" + ], + "path": [ + "jobs" ], "query": [ { "key": "page", - "value": "1", + "value": "0", "disabled": true }, { "key": "perPage", - "value": "5", + "value": "3", "disabled": true }, { @@ -13897,42 +17745,58 @@ }, { "key": "sortOrder", - "value": "desc", + "value": "asc", "disabled": true }, { - "key": "resourceBookingId", - "value": "{{resource_booking_id_created_for_member}}", + "key": "projectId", + "value": "21", "disabled": true }, { - "key": "resourceBookingIds", - "value": "{{resource_booking_id_created_for_member}},{{resource_booking_id_created_for_member}}", + "key": "externalId", + "value": "1212", "disabled": true }, { - "key": "paymentStatus", - "value": "pending", + "key": "description", + "value": "Dummy", "disabled": true }, { "key": "startDate", - "value": "2021-03-07", + "value": "2020-09-27T04:17:23.131Z", "disabled": true }, { - "key": "endDate", - "value": "2021-03-13", + "key": "resourceType", + "value": "Dummy Resource Type", "disabled": true }, { - "key": "userHandle", - "value": "pshah_manager", + "key": "skill", + "value": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "disabled": true + }, + { + "key": "rateType", + "value": "hourly", + "disabled": true + }, + { + "key": "status", + "value": "sourcing", + "disabled": true + }, + { + "key": "workload", + "value": "full-time", "disabled": true }, { - "key": "projectId", - "value": "16718" + "key": "title", + "value": "dummy", + "disabled": true } ] } @@ -13940,34 +17804,19 @@ "response": [] }, { - "name": "✘ put work period 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" - } - } - ], + "name": "✔ put job with connect manager", "request": { "method": "PUT", "header": [ { "key": "Authorization", "type": "text", - "value": "Bearer {{token_member_tester1234}}" + "value": "Bearer {{token_connect_manager_pshahcopmanag2}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"resourceBookingId\": \"{{resource_booking_id_created_for_member}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\r\n \"daysWorked\": 2,\r\n \"memberRate\": 13.13,\r\n \"customerRate\": 13.13,\r\n \"paymentStatus\": \"pending\"\r\n}", + "raw": "{\n \"projectId\": {{project_id_16843}},\n \"externalId\": \"1212\",\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"fractional\",\n \"skills\": [\n \"cbac57a3-7180-4316-8769-73af64893158\",\n \"a2b4bc11-c641-4a19-9eb7-33980378f82e\"\n ],\n \"status\": \"sourcing\",\n \"title\": \"Dummy title - at most 64 characters\"\n}", "options": { "raw": { "language": "json" @@ -13975,47 +17824,32 @@ } }, "url": { - "raw": "{{URL}}/work-periods/{{workPeriodId_created_for_member}}", + "raw": "{{URL}}/jobs/{{job_id_created_by_connect_manager}}", "host": [ "{{URL}}" ], "path": [ - "work-periods", - "{{workPeriodId_created_for_member}}" + "jobs", + "{{job_id_created_by_connect_manager}}" ] } }, "response": [] }, { - "name": "✘ patch work period 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" - } - } - ], + "name": "✔ patch job with connect manager", "request": { "method": "PATCH", "header": [ { "key": "Authorization", "type": "text", - "value": "Bearer {{token_member_tester1234}}" + "value": "Bearer {{token_connect_manager_pshahcopmanag2}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"resourceBookingId\": \"{{resource_booking_id_created_for_member}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\r\n \"daysWorked\": 2,\r\n \"memberRate\": 13.13,\r\n \"customerRate\": 13.13,\r\n \"paymentStatus\": \"pending\"\r\n}", + "raw": "{\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"fractional\",\n \"skills\": [\n \"cbac57a3-7180-4316-8769-73af64893158\"\n ],\n \"status\": \"sourcing\",\n \"title\": \"Dummy title - at most 64 characters\"\n}", "options": { "raw": { "language": "json" @@ -14023,42 +17857,27 @@ } }, "url": { - "raw": "{{URL}}/work-periods/{{workPeriodId_created_for_member}}", + "raw": "{{URL}}/jobs/{{job_id_created_by_connect_manager}}", "host": [ "{{URL}}" ], "path": [ - "work-periods", - "{{workPeriodId_created_for_member}}" + "jobs", + "{{job_id_created_by_connect_manager}}" ] } }, "response": [] }, { - "name": "✘ delete work period 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" - } - } - ], + "name": "✘ delete job with connect manager", "request": { "method": "DELETE", "header": [ { "key": "Authorization", "type": "text", - "value": "Bearer {{token_member_tester1234}}" + "value": "Bearer {{token_connect_manager_pshahcopmanag2}}" } ], "body": { @@ -14071,53 +17890,81 @@ } }, "url": { - "raw": "{{URL}}/work-periods/{{workPeriodId_created_for_member}}", + "raw": "{{URL}}/jobs/{{job_id_created_by_connect_manager}}", "host": [ "{{URL}}" ], "path": [ - "work-periods", - "{{workPeriodId_created_for_member}}" + "jobs", + "{{job_id_created_by_connect_manager}}" ] } }, "response": [] } ] - } - ] - }, - { - "name": "Request with Connect Manager Role", - "item": [ + }, { - "name": "README", + "name": "Job Candidates", "item": [ { - "name": "[STUB] all operations except get/search cause 403 error if manager is not member of project", - "request": { - "method": "LOCK", - "header": [], - "url": { - "raw": "" + "name": "Before Test", + "item": [ + { + "name": "create job candidate", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var data = JSON.parse(responseBody);\r", + "postman.setEnvironmentVariable(\"job_candidate_id_created_for_connect_manager\",data.id);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_administrator}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"jobId\": \"{{job_id_created_by_connect_manager}}\",\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobCandidates", + "host": [ + "{{URL}}" + ], + "path": [ + "jobCandidates" + ] + } + }, + "response": [] } - }, - "response": [] - } - ] - }, - { - "name": "Jobs", - "item": [ + ] + }, { - "name": "✔ create job with connect manager", + "name": "✘ create job candidate with connect manager", "event": [ { "listen": "test", "script": { "exec": [ "var data = JSON.parse(responseBody);\r", - "postman.setEnvironmentVariable(\"job_id_created_by_connect_manager\",data.id);" + "postman.setEnvironmentVariable(\"job_candidate_id_created_by_connect_manager\",data.id);" ], "type": "text/javascript" } @@ -14128,13 +17975,13 @@ "header": [ { "key": "Authorization", - "value": "Bearer {{token_connect_manager_pshahcopmanag2}}", - "type": "text" + "type": "text", + "value": "Bearer {{token_connect_manager_pshahcopmanag2}}" } ], "body": { "mode": "raw", - "raw": "{\n \"projectId\": {{project_id_16843}},\n \"externalId\": \"1212\",\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"23e00d92-207a-4b5b-b3c9-4c5662644941\",\n \"7d076384-ccf6-4e43-a45d-1b24b1e624aa\",\n \"cbac57a3-7180-4316-8769-73af64893158\",\n \"a2b4bc11-c641-4a19-9eb7-33980378f82e\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "raw": "{\r\n \"jobId\": \"{{job_id_created_by_connect_manager}}\",\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\"\r\n}", "options": { "raw": { "language": "json" @@ -14142,19 +17989,19 @@ } }, "url": { - "raw": "{{URL}}/jobs", + "raw": "{{URL}}/jobCandidates", "host": [ "{{URL}}" ], "path": [ - "jobs" + "jobCandidates" ] } }, "response": [] }, { - "name": "✔ get job with connect manager", + "name": "✔ get job candidate with connect manager", "request": { "method": "GET", "header": [ @@ -14165,20 +18012,20 @@ } ], "url": { - "raw": "{{URL}}/jobs/{{job_id_created_by_connect_manager}}", + "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_for_connect_manager}}", "host": [ "{{URL}}" ], "path": [ - "jobs", - "{{job_id_created_by_connect_manager}}" + "jobCandidates", + "{{job_candidate_id_created_for_connect_manager}}" ] } }, "response": [] }, { - "name": "✔ search jobs with connect manager", + "name": "✔ search job candidates with connect manager", "request": { "method": "GET", "header": [ @@ -14189,22 +18036,22 @@ } ], "url": { - "raw": "{{URL}}/jobs", + "raw": "{{URL}}/jobCandidates", "host": [ "{{URL}}" ], "path": [ - "jobs" + "jobCandidates" ], "query": [ { "key": "page", - "value": "0", + "value": "1", "disabled": true }, { "key": "perPage", - "value": "3", + "value": "1", "disabled": true }, { @@ -14218,53 +18065,18 @@ "disabled": true }, { - "key": "projectId", - "value": "21", - "disabled": true - }, - { - "key": "externalId", - "value": "1212", - "disabled": true - }, - { - "key": "description", - "value": "Dummy", - "disabled": true - }, - { - "key": "startDate", - "value": "2020-09-27T04:17:23.131Z", - "disabled": true - }, - { - "key": "resourceType", - "value": "Dummy Resource Type", - "disabled": true - }, - { - "key": "skill", - "value": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "key": "jobId", + "value": "46225f4c-c2a3-4603-a141-0277e96fabfa", "disabled": true }, { - "key": "rateType", - "value": "hourly", + "key": "userId", + "value": "fe38eed1-af73-41fd-85a2-ac4da1ff09a3", "disabled": true }, { "key": "status", - "value": "sourcing", - "disabled": true - }, - { - "key": "workload", - "value": "full-time", - "disabled": true - }, - { - "key": "title", - "value": "dummy", + "value": "shortlist", "disabled": true } ] @@ -14273,7 +18085,7 @@ "response": [] }, { - "name": "✔ put job with connect manager", + "name": "✔ put job candidate with connect manager", "request": { "method": "PUT", "header": [ @@ -14285,7 +18097,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"projectId\": {{project_id_16843}},\n \"externalId\": \"1212\",\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"fractional\",\n \"skills\": [\n \"cbac57a3-7180-4316-8769-73af64893158\",\n \"a2b4bc11-c641-4a19-9eb7-33980378f82e\"\n ],\n \"status\": \"sourcing\",\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "raw": "{\r\n \"jobId\": \"{{job_id_created_by_connect_manager}}\",\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\",\r\n \"status\": \"selected\"\r\n}", "options": { "raw": { "language": "json" @@ -14293,20 +18105,20 @@ } }, "url": { - "raw": "{{URL}}/jobs/{{job_id_created_by_connect_manager}}", + "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_for_connect_manager}}", "host": [ "{{URL}}" ], "path": [ - "jobs", - "{{job_id_created_by_connect_manager}}" + "jobCandidates", + "{{job_candidate_id_created_for_connect_manager}}" ] } }, "response": [] }, { - "name": "✔ patch job with connect manager", + "name": "✔ patch job candidate with connect manager", "request": { "method": "PATCH", "header": [ @@ -14318,7 +18130,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"fractional\",\n \"skills\": [\n \"cbac57a3-7180-4316-8769-73af64893158\"\n ],\n \"status\": \"sourcing\",\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "raw": "{\r\n \"status\": \"shortlist\"\r\n}", "options": { "raw": { "language": "json" @@ -14326,20 +18138,20 @@ } }, "url": { - "raw": "{{URL}}/jobs/{{job_id_created_by_connect_manager}}", + "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_for_connect_manager}}", "host": [ "{{URL}}" ], "path": [ - "jobs", - "{{job_id_created_by_connect_manager}}" + "jobCandidates", + "{{job_candidate_id_created_for_connect_manager}}" ] } }, "response": [] }, { - "name": "✘ delete job with connect manager", + "name": "✘ delete job candidate with connect manager", "request": { "method": "DELETE", "header": [ @@ -14359,13 +18171,13 @@ } }, "url": { - "raw": "{{URL}}/jobs/{{job_id_created_by_connect_manager}}", + "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_for_connect_manager}}", "host": [ "{{URL}}" ], "path": [ - "jobs", - "{{job_id_created_by_connect_manager}}" + "jobCandidates", + "{{job_candidate_id_created_for_connect_manager}}" ] } }, @@ -14374,20 +18186,20 @@ ] }, { - "name": "Job Candidates", + "name": "Resource Bookings", "item": [ { "name": "Before Test", "item": [ { - "name": "create job candidate", + "name": "create resource booking", "event": [ { "listen": "test", "script": { "exec": [ "var data = JSON.parse(responseBody);\r", - "postman.setEnvironmentVariable(\"job_candidate_id_created_for_connect_manager\",data.id);" + "postman.setEnvironmentVariable(\"resource_booking_id_created_for_connect_manager\",data.id);" ], "type": "text/javascript" } @@ -14404,7 +18216,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{job_id_created_by_connect_manager}}\",\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\"\r\n}", + "raw": "{\r\n \"projectId\": {{project_id_16843}},\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\",\r\n \"jobId\": \"{{job_id_created_by_connect_manager}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\"\r\n}", "options": { "raw": { "language": "json" @@ -14412,12 +18224,12 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates", + "raw": "{{URL}}/resourceBookings", "host": [ "{{URL}}" ], "path": [ - "jobCandidates" + "resourceBookings" ] } }, @@ -14426,14 +18238,14 @@ ] }, { - "name": "✘ create job candidate with connect manager", + "name": "✘ create resource booking with connect manager", "event": [ { "listen": "test", "script": { "exec": [ "var data = JSON.parse(responseBody);\r", - "postman.setEnvironmentVariable(\"job_candidate_id_created_by_connect_manager\",data.id);" + "postman.setEnvironmentVariable(\"resource_booking_id_created_by_connect_manager\",data.id);" ], "type": "text/javascript" } @@ -14450,7 +18262,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{job_id_created_by_connect_manager}}\",\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\"\r\n}", + "raw": "{\r\n \"projectId\": {{project_id_16843}},\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\",\r\n \"jobId\": \"{{job_id_created_by_connect_manager}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\"\r\n}", "options": { "raw": { "language": "json" @@ -14458,19 +18270,19 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates", + "raw": "{{URL}}/resourceBookings", "host": [ "{{URL}}" ], "path": [ - "jobCandidates" + "resourceBookings" ] } }, "response": [] }, { - "name": "✔ get job candidate with connect manager", + "name": "✔ get resource booking with connect manager", "request": { "method": "GET", "header": [ @@ -14481,20 +18293,20 @@ } ], "url": { - "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_for_connect_manager}}", + "raw": "{{URL}}/resourceBookings/{{resource_booking_id_created_for_connect_manager}}", "host": [ "{{URL}}" ], "path": [ - "jobCandidates", - "{{job_candidate_id_created_for_connect_manager}}" + "resourceBookings", + "{{resource_booking_id_created_for_connect_manager}}" ] } }, "response": [] }, { - "name": "✔ search job candidates with connect manager", + "name": "✔ search resource bookings with connect manager", "request": { "method": "GET", "header": [ @@ -14505,12 +18317,12 @@ } ], "url": { - "raw": "{{URL}}/jobCandidates", + "raw": "{{URL}}/resourceBookings", "host": [ "{{URL}}" ], "path": [ - "jobCandidates" + "resourceBookings" ], "query": [ { @@ -14520,7 +18332,7 @@ }, { "key": "perPage", - "value": "1", + "value": "5", "disabled": true }, { @@ -14530,22 +18342,32 @@ }, { "key": "sortOrder", - "value": "asc", + "value": "desc", "disabled": true }, { - "key": "jobId", - "value": "46225f4c-c2a3-4603-a141-0277e96fabfa", + "key": "startDate", + "value": "2020-09-27T04:17:23.131Z", "disabled": true }, { - "key": "userId", - "value": "fe38eed1-af73-41fd-85a2-ac4da1ff09a3", + "key": "endDate", + "value": "2020-09-27T04:17:23.131Z", + "disabled": true + }, + { + "key": "rateType", + "value": "hourly", "disabled": true }, { "key": "status", - "value": "shortlist", + "value": "sourcing", + "disabled": true + }, + { + "key": "projectIds", + "value": "111, 16705", "disabled": true } ] @@ -14554,7 +18376,7 @@ "response": [] }, { - "name": "✔ put job candidate with connect manager", + "name": "✘ put resource booking with connect manager", "request": { "method": "PUT", "header": [ @@ -14566,7 +18388,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"jobId\": \"{{job_id_created_by_connect_manager}}\",\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\",\r\n \"status\": \"selected\"\r\n}", + "raw": "{\r\n \"projectId\": {{project_id_16843}},\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\",\r\n \"jobId\": \"{{job_id_created_by_connect_manager}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\",\r\n \"status\": \"assigned\"\r\n}", "options": { "raw": { "language": "json" @@ -14574,20 +18396,20 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_for_connect_manager}}", + "raw": "{{URL}}/resourceBookings/{{resource_booking_id_created_for_connect_manager}}", "host": [ "{{URL}}" ], "path": [ - "jobCandidates", - "{{job_candidate_id_created_for_connect_manager}}" + "resourceBookings", + "{{resource_booking_id_created_for_connect_manager}}" ] } }, "response": [] }, { - "name": "✔ patch job candidate with connect manager", + "name": "✘ patch resource booking with connect manager", "request": { "method": "PATCH", "header": [ @@ -14599,7 +18421,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"status\": \"shortlist\"\r\n}", + "raw": "{\r\n \"status\": \"assigned\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\"\r\n}", "options": { "raw": { "language": "json" @@ -14607,20 +18429,20 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_for_connect_manager}}", + "raw": "{{URL}}/resourceBookings/{{resource_booking_id_created_for_connect_manager}}", "host": [ "{{URL}}" ], "path": [ - "jobCandidates", - "{{job_candidate_id_created_for_connect_manager}}" + "resourceBookings", + "{{resource_booking_id_created_for_connect_manager}}" ] } }, "response": [] }, { - "name": "✘ delete job candidate with connect manager", + "name": "✘ delete resource booking with connect manager", "request": { "method": "DELETE", "header": [ @@ -14640,13 +18462,13 @@ } }, "url": { - "raw": "{{URL}}/jobCandidates/{{job_candidate_id_created_for_connect_manager}}", + "raw": "{{URL}}/resourceBookings/{{resource_booking_id_created_for_connect_manager}}", "host": [ "{{URL}}" ], "path": [ - "jobCandidates", - "{{job_candidate_id_created_for_connect_manager}}" + "resourceBookings", + "{{resource_booking_id_created_for_connect_manager}}" ] } }, @@ -14655,11 +18477,60 @@ ] }, { - "name": "Resource Bookings", + "name": "Work Periods", "item": [ { "name": "Before Test", "item": [ + { + "name": "create job", + "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(\"job_id_created_by_connect_manager\", response.id);\r", + " }\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token_administrator}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"projectId\": {{project_id_16843}},\n \"externalId\": \"1212\",\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"23e00d92-207a-4b5b-b3c9-4c5662644941\",\n \"7d076384-ccf6-4e43-a45d-1b24b1e624aa\",\n \"cbac57a3-7180-4316-8769-73af64893158\",\n \"a2b4bc11-c641-4a19-9eb7-33980378f82e\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/jobs", + "host": [ + "{{URL}}" + ], + "path": [ + "jobs" + ] + } + }, + "response": [] + }, { "name": "create resource booking", "event": [ @@ -14667,8 +18538,13 @@ "listen": "test", "script": { "exec": [ - "var data = JSON.parse(responseBody);\r", - "postman.setEnvironmentVariable(\"resource_booking_id_created_for_connect_manager\",data.id);" + "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(\"resource_booking_id_created_for_connect_manager\", response.id);\r", + " }\r", + "});" ], "type": "text/javascript" } @@ -14703,18 +18579,70 @@ } }, "response": [] + }, + { + "name": "create work period", + "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(\"workPeriodId_created_for_connect_manager\", response.id);\r", + " }\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_administrator}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"resourceBookingId\": \"{{resource_booking_id_created_for_connect_manager}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\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 resource booking with connect manager", + "name": "✘ create work period with connect manager", "event": [ { "listen": "test", "script": { "exec": [ - "var data = JSON.parse(responseBody);\r", - "postman.setEnvironmentVariable(\"resource_booking_id_created_by_connect_manager\",data.id);" + "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" } @@ -14731,7 +18659,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{project_id_16843}},\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\",\r\n \"jobId\": \"{{job_id_created_by_connect_manager}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\"\r\n}", + "raw": "{\r\n \"resourceBookingId\": \"{{resource_booking_id_created_for_connect_manager}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\r\n \"daysWorked\": 2,\r\n \"memberRate\": 13.13,\r\n \"customerRate\": 13.13,\r\n \"paymentStatus\": \"pending\"\r\n}", "options": { "raw": { "language": "json" @@ -14739,19 +18667,19 @@ } }, "url": { - "raw": "{{URL}}/resourceBookings", + "raw": "{{URL}}/work-periods", "host": [ "{{URL}}" ], "path": [ - "resourceBookings" + "work-periods" ] } }, "response": [] }, { - "name": "✔ get resource booking with connect manager", + "name": "✔ get work period with connect manager", "request": { "method": "GET", "header": [ @@ -14762,20 +18690,20 @@ } ], "url": { - "raw": "{{URL}}/resourceBookings/{{resource_booking_id_created_for_connect_manager}}", + "raw": "{{URL}}/work-periods/{{workPeriodId_created_for_connect_manager}}", "host": [ "{{URL}}" ], "path": [ - "resourceBookings", - "{{resource_booking_id_created_for_connect_manager}}" + "work-periods", + "{{workPeriodId_created_for_connect_manager}}" ] } }, "response": [] }, { - "name": "✔ search resource bookings with connect manager", + "name": "✔ search work periods with connect manager", "request": { "method": "GET", "header": [ @@ -14786,12 +18714,12 @@ } ], "url": { - "raw": "{{URL}}/resourceBookings", + "raw": "{{URL}}/work-periods?projectId=16843", "host": [ "{{URL}}" ], "path": [ - "resourceBookings" + "work-periods" ], "query": [ { @@ -14815,29 +18743,38 @@ "disabled": true }, { - "key": "startDate", - "value": "2020-09-27T04:17:23.131Z", + "key": "resourceBookingId", + "value": "{{resource_booking_id_created_for_connect_manager}}", "disabled": true }, { - "key": "endDate", - "value": "2020-09-27T04:17:23.131Z", + "key": "resourceBookingIds", + "value": "{{resource_booking_id_created_for_connect_manager}},{{resource_booking_id_created_for_connect_manager}}", "disabled": true }, { - "key": "rateType", - "value": "hourly", + "key": "paymentStatus", + "value": "pending", "disabled": true }, { - "key": "status", - "value": "sourcing", + "key": "startDate", + "value": "2021-03-07", "disabled": true }, { - "key": "projectIds", - "value": "111, 16705", + "key": "endDate", + "value": "2021-03-13", + "disabled": true + }, + { + "key": "userHandle", + "value": "pshah_manager", "disabled": true + }, + { + "key": "projectId", + "value": "16843" } ] } @@ -14845,7 +18782,22 @@ "response": [] }, { - "name": "✘ put resource booking with connect manager", + "name": "✘ put work period 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": "PUT", "header": [ @@ -14857,7 +18809,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{project_id_16843}},\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\",\r\n \"jobId\": \"{{job_id_created_by_connect_manager}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\",\r\n \"status\": \"assigned\"\r\n}", + "raw": "{\r\n \"resourceBookingId\": \"{{resource_booking_id_created_for_connect_manager}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\r\n \"daysWorked\": 2,\r\n \"memberRate\": 13.13,\r\n \"customerRate\": 13.13,\r\n \"paymentStatus\": \"pending\"\r\n}", "options": { "raw": { "language": "json" @@ -14865,20 +18817,35 @@ } }, "url": { - "raw": "{{URL}}/resourceBookings/{{resource_booking_id_created_for_connect_manager}}", + "raw": "{{URL}}/work-periods/{{workPeriodId_created_for_connect_manager}}", "host": [ "{{URL}}" ], "path": [ - "resourceBookings", - "{{resource_booking_id_created_for_connect_manager}}" + "work-periods", + "{{workPeriodId_created_for_connect_manager}}" ] } }, "response": [] }, { - "name": "✘ patch resource booking with connect manager", + "name": "✘ patch work period 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": "PATCH", "header": [ @@ -14890,7 +18857,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"status\": \"assigned\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\"\r\n}", + "raw": "{\r\n \"resourceBookingId\": \"{{resource_booking_id_created_for_connect_manager}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\r\n \"daysWorked\": 2,\r\n \"memberRate\": 13.13,\r\n \"customerRate\": 13.13,\r\n \"paymentStatus\": \"pending\"\r\n}", "options": { "raw": { "language": "json" @@ -14898,20 +18865,35 @@ } }, "url": { - "raw": "{{URL}}/resourceBookings/{{resource_booking_id_created_for_connect_manager}}", + "raw": "{{URL}}/work-periods/{{workPeriodId_created_for_connect_manager}}", "host": [ "{{URL}}" ], "path": [ - "resourceBookings", - "{{resource_booking_id_created_for_connect_manager}}" + "work-periods", + "{{workPeriodId_created_for_connect_manager}}" ] } }, "response": [] }, { - "name": "✘ delete resource booking with connect manager", + "name": "✘ delete work period 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": "DELETE", "header": [ @@ -14931,13 +18913,13 @@ } }, "url": { - "raw": "{{URL}}/resourceBookings/{{resource_booking_id_created_for_connect_manager}}", + "raw": "{{URL}}/work-periods/{{workPeriodId_created_for_connect_manager}}", "host": [ "{{URL}}" ], "path": [ - "resourceBookings", - "{{resource_booking_id_created_for_connect_manager}}" + "work-periods", + "{{workPeriodId_created_for_connect_manager}}" ] } }, @@ -14946,13 +18928,13 @@ ] }, { - "name": "Work Periods", + "name": "Work Period Payments", "item": [ { "name": "Before Test", "item": [ { - "name": "create job", + "name": "✔ create job", "event": [ { "listen": "test", @@ -14962,7 +18944,7 @@ " pm.response.to.have.status(200);\r", " if(pm.response.status === \"OK\"){\r", " const response = pm.response.json()\r", - " pm.environment.set(\"job_id_created_by_connect_manager\", response.id);\r", + " pm.environment.set(\"job_id_created_for_connect_manager\", response.id);\r", " }\r", "});" ], @@ -14981,7 +18963,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"projectId\": {{project_id_16843}},\n \"externalId\": \"1212\",\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"23e00d92-207a-4b5b-b3c9-4c5662644941\",\n \"7d076384-ccf6-4e43-a45d-1b24b1e624aa\",\n \"cbac57a3-7180-4316-8769-73af64893158\",\n \"a2b4bc11-c641-4a19-9eb7-33980378f82e\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", + "raw": "{\n \"projectId\": {{project_id_17234}},\n \"externalId\": \"1212\",\n \"description\": \"Dummy Description\",\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\n \"duration\": 1,\n \"numPositions\": 13,\n \"resourceType\": \"Dummy Resource Type\",\n \"rateType\": \"hourly\",\n \"workload\": \"full-time\",\n \"skills\": [\n \"23e00d92-207a-4b5b-b3c9-4c5662644941\",\n \"7d076384-ccf6-4e43-a45d-1b24b1e624aa\",\n \"cbac57a3-7180-4316-8769-73af64893158\",\n \"a2b4bc11-c641-4a19-9eb7-33980378f82e\"\n ],\n \"title\": \"Dummy title - at most 64 characters\"\n}", "options": { "raw": { "language": "json" @@ -15001,7 +18983,7 @@ "response": [] }, { - "name": "create resource booking", + "name": "✔ create resource booking", "event": [ { "listen": "test", @@ -15011,7 +18993,7 @@ " pm.response.to.have.status(200);\r", " if(pm.response.status === \"OK\"){\r", " const response = pm.response.json()\r", - " pm.environment.set(\"resource_booking_id_created_for_connect_manager\", response.id);\r", + " pm.environment.set(\"resource_bookings_id_created_for_connect_manager\", response.id);\r", " }\r", "});" ], @@ -15030,7 +19012,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{project_id_16843}},\r\n \"userId\": \"fe38eed1-af73-41fd-85a2-ac4da1ff09a3\",\r\n \"jobId\": \"{{job_id_created_by_connect_manager}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\"\r\n}", + "raw": "{\r\n \"projectId\": {{project_id_17234}},\r\n \"userId\": \"a55fe1bc-1754-45fa-9adc-cf3d6d7c377a\",\r\n \"jobId\": \"{{job_id_created_for_connect_manager}}\",\r\n \"startDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"endDate\": \"2020-09-27T04:17:23.131Z\",\r\n \"memberRate\": 13.23,\r\n \"customerRate\": 13,\r\n \"rateType\": \"hourly\"\r\n}", "options": { "raw": { "language": "json" @@ -15050,7 +19032,7 @@ "response": [] }, { - "name": "create work period", + "name": "✔ create work period", "event": [ { "listen": "test", @@ -15079,7 +19061,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"resourceBookingId\": \"{{resource_booking_id_created_for_connect_manager}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\r\n \"daysWorked\": 2,\r\n \"memberRate\": 13.13,\r\n \"customerRate\": 13.13,\r\n \"paymentStatus\": \"pending\"\r\n}", + "raw": "{\r\n \"resourceBookingId\": \"{{resource_bookings_id_created_for_connect_manager}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\r\n \"daysWorked\": 2,\r\n \"memberRate\": 13.13,\r\n \"customerRate\": 13.13,\r\n \"paymentStatus\": \"pending\"\r\n}", "options": { "raw": { "language": "json" @@ -15097,11 +19079,60 @@ } }, "response": [] + }, + { + "name": "✔ create work period payment", + "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(\"workPeriodPaymentId_created_for_connect_manager\", response.id);\r", + " }\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{token_administrator}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId_created_for_connect_manager}}\",\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{URL}}/work-period-payments", + "host": [ + "{{URL}}" + ], + "path": [ + "work-period-payments" + ] + } + }, + "response": [] } ] }, { - "name": "✘ create work period with connect manager", + "name": "✘ create work period payment with connect manager", "event": [ { "listen": "test", @@ -15128,7 +19159,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"resourceBookingId\": \"{{resource_booking_id_created_for_connect_manager}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\r\n \"daysWorked\": 2,\r\n \"memberRate\": 13.13,\r\n \"customerRate\": 13.13,\r\n \"paymentStatus\": \"pending\"\r\n}", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId_created_for_connect_manager}}\",\r\n \"amount\": 600,\r\n \"status\": \"completed\"\r\n}", "options": { "raw": { "language": "json" @@ -15136,19 +19167,34 @@ } }, "url": { - "raw": "{{URL}}/work-periods", + "raw": "{{URL}}/work-period-payments", "host": [ "{{URL}}" ], "path": [ - "work-periods" + "work-period-payments" ] } }, "response": [] }, { - "name": "✔ get work period with connect manager", + "name": "✘ get 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": "GET", "header": [ @@ -15159,20 +19205,35 @@ } ], "url": { - "raw": "{{URL}}/work-periods/{{workPeriodId_created_for_connect_manager}}", + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId_created_for_connect_manager}}", "host": [ "{{URL}}" ], "path": [ - "work-periods", - "{{workPeriodId_created_for_connect_manager}}" + "work-period-payments", + "{{workPeriodPaymentId_created_for_connect_manager}}" ] } }, "response": [] }, { - "name": "✔ search work periods with connect manager", + "name": "✘ search work period payments 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": "GET", "header": [ @@ -15183,12 +19244,12 @@ } ], "url": { - "raw": "{{URL}}/work-periods?projectId=16843", + "raw": "{{URL}}/work-period-payments", "host": [ "{{URL}}" ], "path": [ - "work-periods" + "work-period-payments" ], "query": [ { @@ -15203,7 +19264,7 @@ }, { "key": "sortBy", - "value": "id", + "value": "status", "disabled": true }, { @@ -15212,38 +19273,19 @@ "disabled": true }, { - "key": "resourceBookingId", - "value": "{{resource_booking_id_created_for_connect_manager}}", - "disabled": true - }, - { - "key": "resourceBookingIds", - "value": "{{resource_booking_id_created_for_connect_manager}},{{resource_booking_id_created_for_connect_manager}}", - "disabled": true - }, - { - "key": "paymentStatus", - "value": "pending", - "disabled": true - }, - { - "key": "startDate", - "value": "2021-03-07", + "key": "workPeriodId", + "value": "{{workPeriodPaymentId_created_for_connect_manager}}", "disabled": true }, { - "key": "endDate", - "value": "2021-03-13", + "key": "workPeriodIds", + "value": "{{workPeriodPaymentId_created_for_connect_manager}},{{workPeriodPaymentId_created_for_connect_manager}}", "disabled": true }, { - "key": "userHandle", - "value": "pshah_manager", + "key": "status", + "value": "completed", "disabled": true - }, - { - "key": "projectId", - "value": "16843" } ] } @@ -15251,7 +19293,7 @@ "response": [] }, { - "name": "✘ put work period with connect manager", + "name": "✘ put work period payment with connect manager", "event": [ { "listen": "test", @@ -15278,7 +19320,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"resourceBookingId\": \"{{resource_booking_id_created_for_connect_manager}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\r\n \"daysWorked\": 2,\r\n \"memberRate\": 13.13,\r\n \"customerRate\": 13.13,\r\n \"paymentStatus\": \"pending\"\r\n}", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId_created_for_connect_manager}}\",\r\n \"amount\": 1600,\r\n \"status\": \"completed\"\r\n}", "options": { "raw": { "language": "json" @@ -15286,20 +19328,20 @@ } }, "url": { - "raw": "{{URL}}/work-periods/{{workPeriodId_created_for_connect_manager}}", + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId_created_for_connect_manager}}", "host": [ "{{URL}}" ], "path": [ - "work-periods", - "{{workPeriodId_created_for_connect_manager}}" + "work-period-payments", + "{{workPeriodPaymentId_created_for_connect_manager}}" ] } }, "response": [] }, { - "name": "✘ patch work period with connect manager", + "name": "✘ patch work period payment with connect manager", "event": [ { "listen": "test", @@ -15326,55 +19368,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"resourceBookingId\": \"{{resource_booking_id_created_for_connect_manager}}\",\r\n \"startDate\": \"2021-03-07\",\r\n \"endDate\": \"2021-03-13\",\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/{{workPeriodId_created_for_connect_manager}}", - "host": [ - "{{URL}}" - ], - "path": [ - "work-periods", - "{{workPeriodId_created_for_connect_manager}}" - ] - } - }, - "response": [] - }, - { - "name": "✘ delete work period 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": "DELETE", - "header": [ - { - "key": "Authorization", - "type": "text", - "value": "Bearer {{token_connect_manager_pshahcopmanag2}}" - } - ], - "body": { - "mode": "raw", - "raw": "", + "raw": "{\r\n \"workPeriodId\": \"{{workPeriodId_created_for_connect_manager}}\",\r\n \"amount\": 450,\r\n \"status\": \"cancelled\"\r\n}", "options": { "raw": { "language": "json" @@ -15382,13 +19376,13 @@ } }, "url": { - "raw": "{{URL}}/work-periods/{{workPeriodId_created_for_connect_manager}}", + "raw": "{{URL}}/work-period-payments/{{workPeriodPaymentId_created_for_connect_manager}}", "host": [ "{{URL}}" ], "path": [ - "work-periods", - "{{workPeriodId_created_for_connect_manager}}" + "work-period-payments", + "{{workPeriodPaymentId_created_for_connect_manager}}" ] } }, diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 3bb2ed67..af8c680a 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1787,6 +1787,370 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" + /work-period-payments: + post: + tags: + - WorkPeriodPayments + description: | + Create Work Period Payment. + + **Authorization** Topcoder token with write Work period payment scope is allowed + security: + - bearerAuth: [] + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/WorkPeriodPaymentRequestBody" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/WorkPeriodPayment" + "400": + description: Bad request + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "401": + description: Not authenticated + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "403": + description: Forbidden + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: Not Found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + get: + tags: + - WorkPeriodPayments + description: | + Search work period payment. + + **Authorization** Topcoder token with read work period payment scope is allowed + security: + - bearerAuth: [] + parameters: + - in: query + name: page + required: false + schema: + type: integer + default: 1 + description: The page number. + - in: query + name: perPage + required: false + schema: + type: integer + default: 20 + description: The number of items to list per page. + - in: query + name: sortBy + required: false + schema: + type: string + default: createdAt + enum: + [ + "status", + "amount", + "createdAt", + "updatedAt", + ] + description: The sort by column. + - in: query + name: sortOrder + required: false + schema: + type: string + default: desc + enum: ["desc", "asc"] + - in: query + name: workPeriodId + required: false + schema: + type: string + format: uuid + description: The work period id. + - in: query + name: workPeriodIds + required: false + schema: + oneOf: + - type: array + items: + type: string + format: uuid + - type: string + description: comma separated work period ids. + - in: query + name: status + required: false + schema: + type: string + enum: ["completed", "cancelled"] + description: The payment status. + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/WorkPeriodPayment" + headers: + X-Next-Page: + schema: + type: integer + description: The index of the next page + X-Page: + schema: + type: integer + description: The index of the current page (starting at 1) + X-Per-Page: + schema: + type: integer + description: The number of items to list per page + X-Prev-Page: + schema: + type: integer + description: The index of the previous page + X-Total: + schema: + type: integer + description: The total number of items + X-Total-Pages: + schema: + type: integer + description: The total number of pages + Link: + schema: + type: string + description: Pagination link header. + "400": + description: Bad request + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "401": + description: Not authenticated + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "403": + description: Forbidden + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /work-period-payments/{id}: + get: + tags: + - WorkPeriodPayments + description: | + Get work period payment by id. + + **Authorization** Topcoder token with read work period payment scope is allowed + security: + - bearerAuth: [] + parameters: + - in: path + name: id + description: The work period payment id. + required: true + schema: + type: string + format: uuid + - in: query + name: fromDb + description: get data from db or not. + required: false + schema: + type: boolean + default: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/WorkPeriodPayment" + "400": + description: Bad request + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "401": + description: Not authenticated + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "403": + description: Forbidden + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: Not Found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + put: + tags: + - WorkPeriodPayments + description: | + Update the work period payment. + + **Authorization** Topcoder token with update work period payment scope is allowed + security: + - bearerAuth: [] + parameters: + - in: path + name: id + description: The id of work period payment. + required: true + schema: + type: string + format: uuid + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/WorkPeriodPaymentRequestBody" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/WorkPeriodPayment" + "400": + description: Bad request + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "401": + description: Not authenticated + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "403": + description: Forbidden + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: Not Found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + patch: + tags: + - WorkPeriodPayments + description: | + Partial Update work period payment. + + **Authorization** Topcoder token with update work period payment scope is allowed + security: + - bearerAuth: [] + parameters: + - in: path + name: id + description: The id of work period payment. + required: true + schema: + type: string + format: uuid + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/WorkPeriodPaymentPatchRequestBody" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/WorkPeriodPayment" + "400": + description: Bad request + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "401": + description: Not authenticated + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "403": + description: Forbidden + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: Not Found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" /taas-teams: get: tags: @@ -2926,6 +3290,11 @@ components: type: string enum: ["pending", "partially-completed", "completed", "cancelled"] description: "The payment status." + payments: + type: array + description: "The payments related with work period" + items: + $ref: "#/components/schemas/WorkPeriodPayment" createdAt: type: string format: date-time @@ -3015,6 +3384,82 @@ components: type: string enum: ["pending", "partially-completed", "completed", "cancelled"] description: "The payment status." + WorkPeriodPayment: + required: + - id + - workPeriodId + - challengeId + - amount + - status + - createdAt + - createdBy + properties: + id: + type: string + format: uuid + description: "The work period payment id." + workPeriodId: + type: string + format: uuid + description: "The work period id." + challengeId: + type: string + format: uuid + description: "The challenge id." + amount: + type: integer + example: 2 + description: "The amount to be paid." + status: + type: string + enum: ["completed", "cancelled"] + description: "The payment status." + createdAt: + type: string + format: date-time + description: "The work period payment created date." + createdBy: + type: string + format: uuid + description: "The user Id who created the work period payment.(Will get the user info from the token)" + updatedAt: + type: string + format: date-time + description: "The work period payment last updated at." + updatedBy: + type: string + format: uuid + description: "The user Id who updated the work period payment last time.(Will get the user info from the token)" + WorkPeriodPaymentRequestBody: + required: + - workPeriodId + properties: + workPeriodId: + type: string + format: uuid + description: "The work period id." + amount: + type: integer + example: 2 + description: "The amount to be paid." + status: + type: string + enum: ["completed", "cancelled"] + description: "The payment status." + WorkPeriodPaymentPatchRequestBody: + properties: + workPeriodId: + type: string + format: uuid + description: "The work period id." + amount: + type: integer + example: 2 + description: "The amount to be paid." + status: + type: string + enum: ["completed", "cancelled"] + description: "The payment status." CheckRun: type: object properties: diff --git a/docs/topcoder-bookings.postman_environment.json b/docs/topcoder-bookings.postman_environment.json index f68993a4..fc326e86 100644 --- a/docs/topcoder-bookings.postman_environment.json +++ b/docs/topcoder-bookings.postman_environment.json @@ -1,5 +1,5 @@ { - "id": "9f3d832e-2330-4b01-ad24-acdca64aa2d6", + "id": "8df2004f-35bd-439c-93b2-0d999d88ec99", "name": "topcoder-bookings", "values": [ { @@ -137,6 +137,11 @@ "value": "16843", "enabled": true }, + { + "key": "project_id_17234", + "value": "17234", + "enabled": true + }, { "key": "jobId", "value": "", @@ -192,6 +197,11 @@ "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjIxNDc0ODM2NDgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJyZWFkOnRhYXMtd29ya1BlcmlvZHMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.y0-mysWkSf6YnUw9jKhxzg65ngPWNhfXzGQGCVWhXrk", "enabled": true }, + { + "key": "token_m2m_read_work_period_and_payment", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjIxNDc0ODM2NDgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJyZWFkOnRhYXMtd29ya1BlcmlvZHMgcmVhZDp0YWFzLXdvcmtQZXJpb2RQYXltZW50cyIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.9BEieQDP5totqvwriBozy8cgFQRiLXQ6xA6IJT9SD8s", + "enabled": true + }, { "key": "token_m2m_update_work_period", "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjIxNDc0ODM2NDgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJ1cGRhdGU6dGFhcy13b3JrUGVyaW9kcyIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.TU4vUcrQylzIyB6hDMqqC5NucpDSRMHWd-PZ6uW_lEc", @@ -207,6 +217,31 @@ "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjIxNDc0ODM2NDgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJhbGw6dGFhcy13b3JrUGVyaW9kcyIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.0gEgjGsG4ftTOlfN1bTZQXw3YIvxBiCGJEBzD0bmyUE", "enabled": true }, + { + "key": "token_m2m_all_work_period_and_payment", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjIxNDc0ODM2NDgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJhbGw6dGFhcy13b3JrUGVyaW9kcyBhbGw6dGFhcy13b3JrUGVyaW9kUGF5bWVudHMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.3y9Rij_PH5V9DgX5SxMKN6_RaxtbpDGPz-rTbzdVM4Q", + "enabled": true + }, + { + "key": "token_m2m_create_work_period_payment", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjIxNDc0ODM2NDgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJjcmVhdGU6dGFhcy13b3JrUGVyaW9kUGF5bWVudHMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.9XELn_QXS6zk8XEvusiIe42xddUO29oW0QbqljOlj18", + "enabled": true + }, + { + "key": "token_m2m_read_work_period_payment", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjIxNDc0ODM2NDgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJyZWFkOnRhYXMtd29ya1BlcmlvZFBheW1lbnRzIiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIn0.5mFoV4Lg49AuEpteoVLffgyT8Gwgp_YaOvBjfUKjK_4", + "enabled": true + }, + { + "key": "token_m2m_update_work_period_payment", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjIxNDc0ODM2NDgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJ1cGRhdGU6dGFhcy13b3JrUGVyaW9kUGF5bWVudHMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.-J0_bWiOoUOWY7rHrx5ETjvXZLzXp77PR8ErehA_y50", + "enabled": true + }, + { + "key": "token_m2m_all_work_period_payment", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZW5qdzE4MTBlRHozWFR3U08yUm4yWTljUVRyc3BuM0JAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTUwOTA2Mzg4LCJleHAiOjIxNDc0ODM2NDgsImF6cCI6ImVuancxODEwZUR6M1hUd1NPMlJuMlk5Y1FUcnNwbjNCIiwic2NvcGUiOiJhbGw6dGFhcy13b3JrUGVyaW9kUGF5bWVudHMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.ut5vdW-124nBshaeGBvg4mCue4XlRljWlV7OneJk4i4", + "enabled": true + }, { "key": "job_id_created_by_administrator", "value": "", @@ -261,9 +296,54 @@ "key": "job_candidate_id_created_by_administrator", "value": "", "enabled": true + }, + { + "key": "workPeriodPaymentId", + "value": "", + "enabled": true + }, + { + "key": "workPeriodPaymentIdCreatedByM2M", + "value": "", + "enabled": true + }, + { + "key": "workPeriodPaymentId_created_by_administrator", + "value": "", + "enabled": true + }, + { + "key": "job_id_created_for_member", + "value": "", + "enabled": true + }, + { + "key": "resource_bookings_id_created_for_member", + "value": "", + "enabled": true + }, + { + "key": "workPeriodPaymentId_created_for_member", + "value": "", + "enabled": true + }, + { + "key": "job_id_created_for_connect_manager", + "value": "", + "enabled": true + }, + { + "key": "resource_bookings_id_created_for_connect_manager", + "value": "", + "enabled": true + }, + { + "key": "workPeriodPaymentId_created_for_connect_manager", + "value": "", + "enabled": true } ], "_postman_variable_scope": "environment", - "_postman_exported_at": "2021-03-30T00:44:02.221Z", - "_postman_exported_using": "Postman/8.0.9" + "_postman_exported_at": "2021-04-09T20:23:10.418Z", + "_postman_exported_using": "Postman/8.2.1" } \ No newline at end of file diff --git a/local/kafka-client/topics.txt b/local/kafka-client/topics.txt index 49e4d614..dc37db59 100644 --- a/local/kafka-client/topics.txt +++ b/local/kafka-client/topics.txt @@ -2,12 +2,15 @@ taas.job.create taas.jobcandidate.create taas.resourcebooking.create taas.workperiod.create +taas.workperiodpayment.create taas.job.update taas.jobcandidate.update taas.resourcebooking.update taas.workperiod.update +taas.workperiodpayment.update taas.job.delete taas.jobcandidate.delete taas.resourcebooking.delete taas.workperiod.delete +taas.workperiodpayment.delete external.action.email diff --git a/migrations/2021-04-10-work-period-payment-table-create.js b/migrations/2021-04-10-work-period-payment-table-create.js new file mode 100644 index 00000000..03f9752a --- /dev/null +++ b/migrations/2021-04-10-work-period-payment-table-create.js @@ -0,0 +1,78 @@ +/** + * Create work_period_payments table and reference to the "work_periods" table + */ + +const config = require('config') + +module.exports = { + up: async (queryInterface, Sequelize) => { + await queryInterface.createTable('work_period_payment', { + id: { + type: Sequelize.UUID, + primaryKey: true, + allowNull: false, + defaultValue: Sequelize.UUIDV4 + }, + workPeriodId: { + field: 'work_period_id', + type: Sequelize.UUID, + allowNull: false, + references: { + model: { + tableName: 'work_periods', + schema: config.DB_SCHEMA_NAME + }, + key: 'id' + }, + onUpdate: 'CASCADE', + onDelete: 'CASCADE' + }, + challengeId: { + field: 'challenge_id', + type: Sequelize.UUID, + allowNull: false + }, + amount: { + type: Sequelize.DOUBLE + }, + status: { + type: Sequelize.ENUM( + 'completed', + 'cancelled' + ), + allowNull: false + }, + createdBy: { + field: 'created_by', + type: Sequelize.UUID, + allowNull: false + }, + updatedBy: { + field: 'updated_by', + type: Sequelize.UUID + }, + createdAt: { + field: 'created_at', + type: Sequelize.DATE + }, + updatedAt: { + field: 'updated_at', + type: Sequelize.DATE + }, + deletedAt: { + field: 'deleted_at', + type: Sequelize.DATE + } + }, { + schema: config.DB_SCHEMA_NAME, + transaction + }) + }, + down: async (queryInterface) => { + await queryInterface.dropTable({ + tableName: 'work_period_payments', + schema: config.DB_SCHEMA_NAME + }) + } +} + \ No newline at end of file diff --git a/package.json b/package.json index 0fa27c3a..3625c1bf 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,8 @@ "services:logs": "docker-compose -f ./local/docker-compose.yml logs", "local:init": "npm run local:reset && npm run data:import -- --force", "local:reset": "npm run delete-index -- --force || true && npm run create-index -- --force && npm run init-db force", - "cov": "nyc --reporter=html --reporter=text mocha test/unit/*.test.js --timeout 30000 --exit" + "cov": "nyc --reporter=html --reporter=text mocha test/unit/*.test.js --timeout 30000 --exit", + "demo-payment": "node scripts/demo-payment" }, "keywords": [], "author": "", @@ -86,4 +87,4 @@ "test/unit/**" ] } -} +} \ No newline at end of file diff --git a/scripts/data/exportData.js b/scripts/data/exportData.js index 858988d7..30529aa7 100644 --- a/scripts/data/exportData.js +++ b/scripts/data/exportData.js @@ -7,7 +7,7 @@ const helper = require('../../src/common/helper') const filePath = helper.getParamFromCliArgs() || config.DEFAULT_DATA_FILE_PATH const userPrompt = `WARNING: are you sure you want to export all data in the database to a json file with the path ${filePath}? This will overwrite the file.` -const dataModels = ['Job', 'JobCandidate', 'ResourceBooking', 'WorkPeriod'] +const dataModels = ['Job', 'JobCandidate', 'ResourceBooking', 'WorkPeriod', 'WorkPeriodPayment'] async function exportData () { await helper.promptUser(userPrompt, async () => { diff --git a/scripts/data/importData.js b/scripts/data/importData.js index f1770196..e4daa58d 100644 --- a/scripts/data/importData.js +++ b/scripts/data/importData.js @@ -7,7 +7,7 @@ const helper = require('../../src/common/helper') const filePath = helper.getParamFromCliArgs() || config.DEFAULT_DATA_FILE_PATH const userPrompt = `WARNING: this would remove existing data. Are you sure you want to import data from a json file with the path ${filePath}?` -const dataModels = ['Job', 'JobCandidate', 'ResourceBooking', 'WorkPeriod'] +const dataModels = ['Job', 'JobCandidate', 'ResourceBooking', 'WorkPeriod', 'WorkPeriodPayment'] async function importData () { await helper.promptUser(userPrompt, async () => { diff --git a/scripts/demo-payment/README.md b/scripts/demo-payment/README.md new file mode 100644 index 00000000..d39e432b --- /dev/null +++ b/scripts/demo-payment/README.md @@ -0,0 +1,22 @@ +### DEMO PAYMENT SCRIPT + +This demo script tests the functionality of PaymentService. + +Parameters for creating payments are hardcoded in the script. There are severel groups of parameters, each of them tests a certain functionality of the demo service. You can always insert new group of parameters to run in the script. + +Before start set the following environment variables: +AUTH0_URL= +AUTH0_AUDIENCE= +AUTH0_AUDIENCE_UBAHN= +AUTH0_CLIENT_ID= +AUTH0_CLIENT_SECRET= + +To run the script use the following commands: + +``` +npm install +npm run lint +npm run demo-payment +``` + +Read the logger to see results. \ No newline at end of file diff --git a/scripts/demo-payment/index.js b/scripts/demo-payment/index.js new file mode 100644 index 00000000..f84880b9 --- /dev/null +++ b/scripts/demo-payment/index.js @@ -0,0 +1,114 @@ +require('../../src/bootstrap') +const logger = require('../../src/common/logger') +const paymentService = require('../../src/services/PaymentService') + +const options = [ + { + name: 'Test joi validation for projectId-1', + content: { + userHandle: 'pshah_manager', + amount: 3, + billingAccountId: 80000069, + name: 'test payment for pshah_manager', + description: '## test payment' + } + }, + { + name: 'Test joi validation for projectId-2', + content: { + projectId: 'project', + userHandle: 'pshah_manager', + amount: 3, + billingAccountId: 80000069, + name: 'test payment for pshah_manager', + description: '## test payment' + } + }, + { + name: 'Test joi validation for userHandle', + content: { + projectId: 17234, + amount: 3, + billingAccountId: 80000069, + name: 'test payment for pshah_manager', + description: '## test payment' + } + }, + { + name: 'Test joi validation for amount-1', + content: { + projectId: 17234, + userHandle: 'pshah_manager', + billingAccountId: 80000069, + name: 'test payment for pshah_manager', + description: '## test payment' + } + }, + { + name: 'Test joi validation for amount-2', + content: { + projectId: 17234, + userHandle: 'pshah_manager', + amount: -10, + billingAccountId: 80000069, + name: 'test payment for pshah_manager', + description: '## test payment' + } + }, + { + name: 'Successful payment creation', + content: { + projectId: 17234, + userHandle: 'pshah_manager', + amount: 3, + billingAccountId: 80000069, + name: 'test payment for pshah_manager', + description: '## test payment' + } + }, + { + name: 'Successful payment creation without name and description', + content: { + projectId: 17234, + userHandle: 'pshah_customer', + amount: 2, + billingAccountId: 80000069 + } + }, + { + name: 'Failing payment creation with no active billing account', + content: { + projectId: 16839, + userHandle: 'pshah_customer', + amount: 2, + billingAccountId: 80000069, + name: 'test payment for pshah_customer', + description: '## test payment' + } + }, + { + name: 'Failing payment creation with non existing user', + content: { + projectId: 17234, + userHandle: 'eisbilir', + amount: 2, + billingAccountId: 80000069 + } + } +] + +const test = async () => { + for (const option of options) { + logger.info({ component: 'demo-payment', context: 'test', message: `Starting to create payment for: ${option.name}` }) + await paymentService.createPayment(option.content) + .then(data => { + logger.info({ component: 'demo-payment', context: 'test', message: `Payment successfuly created for: ${option.name}` }) + }) + // eslint-disable-next-line handle-callback-err + .catch(err => { + logger.error({ component: 'demo-payment', context: 'test', message: `Payment can't be created for: ${option.name}` }) + }) + } +} +// wait for bootstrap to complete it's job. +setTimeout(test, 2000) diff --git a/src/bootstrap.js b/src/bootstrap.js index fbec70b3..337ace6b 100644 --- a/src/bootstrap.js +++ b/src/bootstrap.js @@ -12,6 +12,7 @@ Joi.workload = () => Joi.string().valid('full-time', 'fractional') Joi.jobCandidateStatus = () => Joi.string().valid('open', 'selected', 'shortlist', 'rejected', 'cancelled', 'interview', 'topcoder-rejected') Joi.title = () => Joi.string().max(128) Joi.paymentStatus = () => Joi.string().valid('pending', 'partially-completed', 'completed', 'cancelled') +Joi.workPeriodPaymentStatus = () => Joi.string().valid('completed', 'cancelled') // Empty string is not allowed by Joi by default and must be enabled with allow(''). // See https://joi.dev/api/?v=17.3.0#string fro details why it's like this. // In many cases we would like to allow empty string to make it easier to create UI for editing data. diff --git a/src/common/helper.js b/src/common/helper.js index 20fdac9f..00353bed 100644 --- a/src/common/helper.js +++ b/src/common/helper.js @@ -114,6 +114,20 @@ esIndexPropertyMapping[config.get('esConfig.ES_INDEX_WORK_PERIOD')] = { memberRate: { type: 'float' }, customerRate: { type: 'float' }, paymentStatus: { type: 'keyword' }, + payments: { + type: 'nested', + properties: { + id: { type: 'keyword' }, + workPeriodId: { type: 'keyword' }, + challengeId: { type: 'keyword' }, + amount: { type: 'float' }, + status: { type: 'keyword' }, + createdAt: { type: 'date' }, + createdBy: { type: 'keyword' }, + updatedAt: { type: 'date' }, + updatedBy: { type: 'keyword' } + } + }, createdAt: { type: 'date' }, createdBy: { type: 'keyword' }, updatedAt: { type: 'date' }, @@ -251,9 +265,18 @@ async function indexBulkDataToES (modelName, indexName, logger) { // get data from db logger.info({ component: 'indexBulkDataToES', message: 'Getting data from database' }) const model = models[modelName] - const data = await model.findAll({ + const criteria = { raw: true - }) + } + if (modelName === 'WorkPeriod') { + criteria.raw = false + criteria.include = [{ + model: models.WorkPeriodPayment, + as: 'payments', + required: false + }] + } + const data = await model.findAll(criteria) if (_.isEmpty(data)) { logger.info({ component: 'indexBulkDataToES', message: `No data in database for ${modelName}` }) return @@ -294,7 +317,7 @@ async function indexDataToEsById (id, modelName, indexName, logger) { logger.info({ component: 'indexDataToEsById', message: 'Getting data from database' }) const model = models[modelName] - const data = await model.findById(id) + const data = await model.findById(id, modelName === 'WorkPeriod') logger.info({ component: 'indexDataToEsById', message: 'Indexing data into Elasticsearch' }) await esClient.index({ index: indexName, @@ -937,13 +960,22 @@ async function ensureJobById (jobId) { /** * Ensure resource booking with specific id exists. * - * @param {String} resourceBookingId the job id - * @returns {Object} the job data + * @param {String} resourceBookingId the resourceBooking id + * @returns {Object} the resourceBooking data */ async function ensureResourceBookingById (resourceBookingId) { return models.ResourceBooking.findById(resourceBookingId) } +/** + * Ensure work period with specific id exists. + * @param {String} workPeriodId the workPeriod id + * @returns the workPeriod data + */ +async function ensureWorkPeriodById (workPeriodId) { + return models.WorkPeriod.findById(workPeriodId) +} + /** * Ensure user with specific id exists. * @@ -1146,6 +1178,82 @@ async function deleteProjectMember (currentUser, projectId, projectMemberId) { } } +/** + * Create a new challenge + * + * @param {Object} data challenge data + * @param {String} token m2m token + * @returns {Object} the challenge created + */ +async function createChallenge (data, token) { + if (!token) { + token = await getM2MToken() + } + const url = `${config.TC_API}/challenges` + localLogger.debug({ context: 'createChallenge', message: `EndPoint: POST ${url}` }) + localLogger.debug({ context: 'createChallenge', message: `Request Body: ${JSON.stringify(data)}` }) + const { body: challenge, status: httpStatus } = await request + .post(url) + .set('Authorization', `Bearer ${token}`) + .set('Content-Type', 'application/json') + .set('Accept', 'application/json') + .send(data) + localLogger.debug({ context: 'createChallenge', message: `Status Code: ${httpStatus}` }) + localLogger.debug({ context: 'createChallenge', message: `Response Body: ${JSON.stringify(challenge)}` }) + return challenge +} + +/** + * Update a challenge + * + * @param {String} challengeId id of the challenge + * @param {Object} data challenge data + * @param {String} token m2m token + * @returns {Object} the challenge updated + */ +async function updateChallenge (challengeId, data, token) { + if (!token) { + token = await getM2MToken() + } + const url = `${config.TC_API}/challenges/${challengeId}` + localLogger.debug({ context: 'updateChallenge', message: `EndPoint: PATCH ${url}` }) + localLogger.debug({ context: 'updateChallenge', message: `Request Body: ${JSON.stringify(data)}` }) + const { body: challenge, status: httpStatus } = await request + .patch(url) + .set('Authorization', `Bearer ${token}`) + .set('Content-Type', 'application/json') + .set('Accept', 'application/json') + .send(data) + localLogger.debug({ context: 'updateChallenge', message: `Status Code: ${httpStatus}` }) + localLogger.debug({ context: 'updateChallenge', message: `Response Body: ${JSON.stringify(challenge)}` }) + return challenge +} + +/** + * Create a challenge resource + * + * @param {Object} data resource + * @param {String} token m2m token + * @returns {Object} the resource created + */ +async function createChallengeResource (data, token) { + if (!token) { + token = await getM2MToken() + } + const url = `${config.TC_API}/resources` + localLogger.debug({ context: 'createChallengeResource', message: `EndPoint: POST ${url}` }) + localLogger.debug({ context: 'createChallengeResource', message: `Request Body: ${JSON.stringify(data)}` }) + const { body: resource, status: httpStatus } = await request + .post(url) + .set('Authorization', `Bearer ${token}`) + .set('Content-Type', 'application/json') + .set('Accept', 'application/json') + .send(data) + localLogger.debug({ context: 'createChallengeResource', message: `Status Code: ${httpStatus}` }) + localLogger.debug({ context: 'createChallengeResource', message: `Response Body: ${JSON.stringify(resource)}` }) + return resource +} + /** * Populates workPeriods from start and end date of resource booking * @param {Date} start start date of the resource booking @@ -1225,6 +1333,7 @@ module.exports = { ensureJobById, ensureResourceBookingById, ensureUserById, + ensureWorkPeriodById, getAuditM2Muser, checkIsMemberOfProject, getMemberDetailsByHandles, @@ -1233,5 +1342,8 @@ module.exports = { listProjectMembers, listProjectMemberInvites, deleteProjectMember, + createChallenge, + updateChallenge, + createChallengeResource, extractWorkPeriods } diff --git a/src/controllers/WorkPeriodPaymentController.js b/src/controllers/WorkPeriodPaymentController.js new file mode 100644 index 00000000..e20075fd --- /dev/null +++ b/src/controllers/WorkPeriodPaymentController.js @@ -0,0 +1,60 @@ +/** + * Controller for WorkPeriodPayment endpoints + */ +const service = require('../services/WorkPeriodPaymentService') +const helper = require('../common/helper') + +/** + * Get workPeriodPayment by id + * @param req the request + * @param res the response + */ +async function getWorkPeriodPayment (req, res) { + res.send(await service.getWorkPeriodPayment(req.authUser, req.params.id, req.query.fromDb)) +} + +/** + * Create workPeriodPayment + * @param req the request + * @param res the response + */ +async function createWorkPeriodPayment (req, res) { + res.send(await service.createWorkPeriodPayment(req.authUser, req.body)) +} + +/** + * Partially update workPeriodPayment by id + * @param req the request + * @param res the response + */ +async function partiallyUpdateWorkPeriodPayment (req, res) { + res.send(await service.partiallyUpdateWorkPeriodPayment(req.authUser, req.params.id, req.body)) +} + +/** + * Fully update workPeriodPayment by id + * @param req the request + * @param res the response + */ +async function fullyUpdateWorkPeriodPayment (req, res) { + res.send(await service.fullyUpdateWorkPeriodPayment(req.authUser, req.params.id, req.body)) +} + +/** + * Search workPeriodPayments + * @param req the request + * @param res the response + */ +async function searchWorkPeriodPayments (req, res) { + const result = await service.searchWorkPeriodPayments(req.authUser, req.query) + helper.setResHeaders(req, res, result) + res.send(result.result) +} + +module.exports = { + getWorkPeriodPayment, + createWorkPeriodPayment, + partiallyUpdateWorkPeriodPayment, + fullyUpdateWorkPeriodPayment, + searchWorkPeriodPayments +} diff --git a/src/models/WorkPeriod.js b/src/models/WorkPeriod.js index b5117532..455818b5 100644 --- a/src/models/WorkPeriod.js +++ b/src/models/WorkPeriod.js @@ -9,20 +9,31 @@ module.exports = (sequelize) => { * @param {Object} models the database models */ static associate (models) { + WorkPeriod._models = models WorkPeriod.belongsTo(models.ResourceBooking, { foreignKey: 'resourceBookingId' }) + WorkPeriod.hasMany(models.WorkPeriodPayment, { as: 'payments', foreignKey: 'workPeriodId' }) } /** * Get work period by id * @param {String} id the work period id + * @param {Object} options { withPayments: true/false } whether contains payments * @returns {WorkPeriod} the work period instance */ - static async findById (id) { - const workPeriod = await WorkPeriod.findOne({ + static async findById (id, options = { withPayments: false }) { + const criteria = { where: { id } - }) + } + if (options.withPayments) { + criteria.include = [{ + model: WorkPeriod._models.WorkPeriodPayment, + as: 'payments', + required: false + }] + } + const workPeriod = await WorkPeriod.findOne(criteria) if (!workPeriod) { throw new errors.NotFoundError(`id: ${id} "WorkPeriod" doesn't exists.`) } diff --git a/src/models/WorkPeriodPayment.js b/src/models/WorkPeriodPayment.js new file mode 100644 index 00000000..6b9e37fa --- /dev/null +++ b/src/models/WorkPeriodPayment.js @@ -0,0 +1,105 @@ +const { Sequelize, Model } = require('sequelize') +const config = require('config') +const errors = require('../common/errors') + +module.exports = (sequelize) => { + class WorkPeriodPayment extends Model { + /** + * Create association between models + * @param {Object} models the database models + */ + static associate (models) { + WorkPeriodPayment.belongsTo(models.WorkPeriod, { foreignKey: 'workPeriodId' }) + } + + /** + * Get work period by id + * @param {String} id the work period id + * @returns {WorkPeriodPayment} the work period payment instance + */ + static async findById (id) { + const workPeriodPayment = await WorkPeriodPayment.findOne({ + where: { + id + } + }) + if (!workPeriodPayment) { + throw new errors.NotFoundError(`id: ${id} "WorkPeriodPayment" doesn't exists`) + } + return workPeriodPayment + } + } + WorkPeriodPayment.init( + { + id: { + type: Sequelize.UUID, + primaryKey: true, + allowNull: false, + defaultValue: Sequelize.UUIDV4 + }, + workPeriodId: { + field: 'work_period_id', + type: Sequelize.UUID, + allowNull: false + }, + challengeId: { + field: 'challenge_id', + type: Sequelize.UUID, + allowNull: false + }, + amount: { + type: Sequelize.DOUBLE + }, + status: { + type: Sequelize.ENUM( + 'completed', + 'cancelled' + ), + allowNull: false + }, + createdBy: { + field: 'created_by', + type: Sequelize.UUID, + allowNull: false + }, + updatedBy: { + field: 'updated_by', + type: Sequelize.UUID + }, + createdAt: { + field: 'created_at', + type: Sequelize.DATE + }, + updatedAt: { + field: 'updated_at', + type: Sequelize.DATE + }, + deletedAt: { + field: 'deleted_at', + type: Sequelize.DATE + } + }, + { + schema: config.DB_SCHEMA_NAME, + sequelize, + tableName: 'work_period_payments', + paranoid: true, + deletedAt: 'deletedAt', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + timestamps: true, + defaultScope: { + attributes: { + exclude: ['deletedAt'] + } + }, + hooks: { + afterCreate: (workPeriodPayment) => { + delete workPeriodPayment.dataValues.deletedAt + } + } + } + ) + + return WorkPeriodPayment +} diff --git a/src/routes/WorkPeriodPaymentRoutes.js b/src/routes/WorkPeriodPaymentRoutes.js new file mode 100644 index 00000000..dcc284eb --- /dev/null +++ b/src/routes/WorkPeriodPaymentRoutes.js @@ -0,0 +1,41 @@ +/** + * Contains workPeriodPayment routes + */ +const constants = require('../../app-constants') + +module.exports = { + '/work-period-payments': { + post: { + controller: 'WorkPeriodPaymentController', + method: 'createWorkPeriodPayment', + auth: 'jwt', + scopes: [constants.Scopes.CREATE_WORK_PERIOD_PAYMENT, constants.Scopes.ALL_WORK_PERIOD_PAYMENT] + }, + get: { + controller: 'WorkPeriodPaymentController', + method: 'searchWorkPeriodPayments', + auth: 'jwt', + scopes: [constants.Scopes.READ_WORK_PERIOD_PAYMENT, constants.Scopes.ALL_WORK_PERIOD_PAYMENT] + } + }, + '/work-period-payments/:id': { + get: { + controller: 'WorkPeriodPaymentController', + method: 'getWorkPeriodPayment', + auth: 'jwt', + scopes: [constants.Scopes.READ_WORK_PERIOD_PAYMENT, constants.Scopes.ALL_WORK_PERIOD_PAYMENT] + }, + put: { + controller: 'WorkPeriodPaymentController', + method: 'fullyUpdateWorkPeriodPayment', + auth: 'jwt', + scopes: [constants.Scopes.UPDATE_WORK_PERIOD_PAYMENT, constants.Scopes.ALL_WORK_PERIOD_PAYMENT] + }, + patch: { + controller: 'WorkPeriodPaymentController', + method: 'partiallyUpdateWorkPeriodPayment', + auth: 'jwt', + scopes: [constants.Scopes.UPDATE_WORK_PERIOD_PAYMENT, constants.Scopes.ALL_WORK_PERIOD_PAYMENT] + } + } +} diff --git a/src/services/PaymentService.js b/src/services/PaymentService.js new file mode 100644 index 00000000..e7a7d534 --- /dev/null +++ b/src/services/PaymentService.js @@ -0,0 +1,164 @@ +/** + * This service provides operations of PaymentService. + */ + +const _ = require('lodash') +const Joi = require('joi') +const config = require('config') +const helper = require('../common/helper') +const logger = require('../common/logger') +const constants = require('../../app-constants') + +const localLogger = { + debug: (message) => logger.debug({ component: 'PaymentService', context: message.context, message: message.message }), + error: (message) => logger.error({ component: 'PaymentService', context: message.context, message: message.message }), + info: (message) => logger.info({ component: 'PaymentService', context: message.context, message: message.message }) +} + +/** + * Create payment + * @param {Object} options the user who perform this operation + * @param {Object} options.projectId the user who perform this operation + * @param {Object} options.userHandle the user who perform this operation + * @param {Object} options.amount the user who perform this operation + * @param {Object} options.billingAccountId the user who perform this operation + * @param {Object} options.name the user who perform this operation + * @param {Object} options.description the user who perform this operation + * @returns {Object} the completed challenge + */ +async function createPayment (options) { + if (_.isUndefined(options.name)) { + options.name = `TaaS payment for user ${options.userHandle} in project ${options.projectId}` + } + if (_.isUndefined(options.description)) { + options.description = `TaaS payment for user ${options.userHandle} in project ${options.projectId}` + } + localLogger.info({ context: 'createPayment', message: 'generating M2MToken' }) + const token = await helper.getM2MToken() + localLogger.info({ context: 'createPayment', message: 'M2MToken is generated' }) + const challengeId = await createChallenge(options, token) + await addResourceToChallenge(challengeId, options.userHandle, token) + await activateChallenge(challengeId, token) + const completedChallenge = await closeChallenge(challengeId, token) + return completedChallenge +} + +createPayment.schema = Joi.object().keys({ + options: Joi.object().keys({ + projectId: Joi.number().integer().required(), + userHandle: Joi.string().required(), + amount: Joi.number().positive().required(), + billingAccountId: Joi.number().allow(null), + name: Joi.string(), + description: Joi.string() + }).required() +}).required() + +/** + * Create a new challenge. + * @param {Object} challenge the challenge to create + * @param {String} token m2m token + * @returns {Number} the created challenge id + */ +async function createChallenge (challenge, token) { + localLogger.info({ context: 'createChallenge', message: 'creating new challenge' }) + const body = { + status: constants.ChallengeStatus.DRAFT, + projectId: challenge.projectId, + name: challenge.name, + description: challenge.description, + descriptionFormat: 'markdown', + typeId: config.TYPE_ID_TASK, + trackId: config.DEFAULT_TRACK_ID, + timelineTemplateId: config.DEFAULT_TIMELINE_TEMPLATE_ID, + prizeSets: [{ + type: 'placement', + prizes: [{ type: 'USD', value: challenge.amount }] + }], + legacy: { + pureV5Task: true + }, + tags: ['Other'], + startDate: new Date(), + billing: { billingAccountId: challenge.billingAccountId } + } + try { + const response = await helper.createChallenge(body, token) + const challengeId = _.get(response, 'id') + localLogger.info({ context: 'createChallenge', message: `Challenge with id ${challengeId} is created` }) + return challengeId + } catch (err) { + localLogger.error({ context: 'createChallenge', message: `Status Code: ${err.status}` }) + localLogger.error({ context: 'createChallenge', message: err.response.text }) + throw err + } +} + +/** + * adds the resource to the topcoder challenge + * @param {String} id the challenge id + * @param {String} handle the user handle to add + * @param {String} token m2m token + */ +async function addResourceToChallenge (id, handle, token) { + localLogger.info({ context: 'addResourceToChallenge', message: `adding resource to challenge ${id}` }) + try { + const body = { + challengeId: id, + memberHandle: handle, + roleId: config.ROLE_ID_SUBMITTER + } + await helper.createChallengeResource(body, token) + localLogger.info({ context: 'addResourceToChallenge', message: `${handle} added to challenge ${id}` }) + } catch (err) { + localLogger.error({ context: 'addResourceToChallenge', message: `Status Code: ${err.status}` }) + localLogger.error({ context: 'addResourceToChallenge', message: err.response.text }) + throw err + } +} + +/** + * activates the topcoder challenge + * @param {String} id the challenge id + * @param {String} token m2m token + */ +async function activateChallenge (id, token) { + localLogger.info({ context: 'activateChallenge', message: `Activating challenge ${id}` }) + try { + const body = { + status: constants.ChallengeStatus.ACTIVE + } + await helper.updateChallenge(id, body, token) + localLogger.info({ context: 'activateChallenge', message: `Challenge ${id} is activated successfully.` }) + } catch (err) { + localLogger.error({ context: 'activateChallenge', message: `Status Code: ${err.status}` }) + localLogger.error({ context: 'activateChallenge', message: err.response.text }) + throw err + } +} + +/** + * closes the topcoder challenge + * @param {String} id the challenge id + * @param {String} token m2m token + * @returns {Object} the closed challenge + */ +async function closeChallenge (id, token) { + localLogger.info({ context: 'closeChallenge', message: `Closing challenge ${id}` }) + try { + const body = { + status: constants.ChallengeStatus.COMPLETED + } + const response = await helper.updateChallenge(id, body, token) + localLogger.info({ context: 'closeChallenge', message: `Challenge ${id} is closed successfully.` }) + return response + } catch (err) { + localLogger.error({ context: 'closeChallenge', message: `Status Code: ${err.status}` }) + localLogger.error({ context: 'closeChallenge', message: err.response.text }) + throw err + } +} + +module.exports = { + createPayment +} diff --git a/src/services/WorkPeriodPaymentService.js b/src/services/WorkPeriodPaymentService.js new file mode 100644 index 00000000..7336767a --- /dev/null +++ b/src/services/WorkPeriodPaymentService.js @@ -0,0 +1,339 @@ +/** + * This service provides operations of WorkPeriod. + */ + +const _ = require('lodash') +const Joi = require('joi') +const config = require('config') +const HttpStatus = require('http-status-codes') +const { Op } = require('sequelize') +const uuid = require('uuid') +const moment = require('moment') +const helper = require('../common/helper') +const logger = require('../common/logger') +const errors = require('../common/errors') +const models = require('../models') +const { createPayment } = require('./PaymentService') + +const WorkPeriodPayment = models.WorkPeriodPayment +const esClient = helper.getESClient() + +/** + * Check user permission for creating, updating or getting + * work period payment. + * Only Booking Manager, Admin, and M2M has access to create, view or update payments + * @param {Object} currentUser the user who perform this operation. + * @returns {undefined} + */ +async function _checkUserPermissionForCRUWorkPeriodPayment (currentUser) { + if (!currentUser.hasManagePermission && !currentUser.isMachine) { + throw new errors.ForbiddenError('You are not allowed to perform this action!') + } +} + +/** + * Get workPeriodPayment by id + * @param {Object} currentUser the user who perform this operation. + * @param {String} id the workPeriodPayment id + * @param {Boolean} fromDb flag if query db for data or not + * @returns {Object} the workPeriodPayment + */ +async function getWorkPeriodPayment (currentUser, id, fromDb = false) { + // check user permission + await _checkUserPermissionForCRUWorkPeriodPayment(currentUser) + if (!fromDb) { + try { + const workPeriod = await esClient.search({ + index: config.esConfig.ES_INDEX_WORK_PERIOD, + _source: 'payments', + body: { + query: { + nested: { + path: 'payments', + query: { + match: { 'payments.id': id } + } + } + } + } + }) + + if (!workPeriod.body.hits.total.value) { + throw new errors.NotFoundError() + } + const workPeriodPaymentRecord = _.find(workPeriod.body.hits.hits[0]._source.payments, { id }) + return workPeriodPaymentRecord + } catch (err) { + if (err.httpStatus === HttpStatus.NOT_FOUND) { + throw new errors.NotFoundError(`id: ${id} "WorkPeriodPayment" not found`) + } + if (err.httpStatus === HttpStatus.FORBIDDEN) { + throw err + } + logger.logFullError(err, { component: 'WorkPeriodPaymentService', context: 'getWorkPeriodPayment' }) + } + } + logger.info({ component: 'WorkPeriodPaymentService', context: 'getWorkPeriodPayment', message: 'try to query db for data' }) + const workPeriodPayment = await WorkPeriodPayment.findById(id) + + return workPeriodPayment +} + +getWorkPeriodPayment.schema = Joi.object().keys({ + currentUser: Joi.object().required(), + id: Joi.string().guid().required(), + fromDb: Joi.boolean() +}).required() + +/** + * Create workPeriodPayment + * @param {Object} currentUser the user who perform this operation + * @param {Object} workPeriodPayment the workPeriodPayment to be created + * @returns {Object} the created workPeriodPayment + */ +async function createWorkPeriodPayment (currentUser, workPeriodPayment) { + // check permission + await _checkUserPermissionForCRUWorkPeriodPayment(currentUser) + + const { projectId, userHandle, endDate } = await helper.ensureWorkPeriodById(workPeriodPayment.workPeriodId) // ensure work period exists + const paymentChallenge = await createPayment({ + projectId, + userHandle, + amount: workPeriodPayment.amount, + name: `TaaS Payment - ${userHandle} - Week Ending ${moment(endDate).format('D/M/YYYY')}`, + description: `TaaS Payment - ${userHandle} - Week Ending ${moment(endDate).format('D/M/YYYY')}` + }) + workPeriodPayment.id = uuid.v4() + workPeriodPayment.challengeId = paymentChallenge.id + workPeriodPayment.createdBy = await helper.getUserId(currentUser.userId) + + let created = null + try { + created = await WorkPeriodPayment.create(workPeriodPayment) + } catch (err) { + if (!_.isUndefined(err.original)) { + throw new errors.BadRequestError(err.original.detail) + } else { + throw err + } + } + + await helper.postEvent(config.TAAS_WORK_PERIOD_PAYMENT_CREATE_TOPIC, created.toJSON()) + return created.dataValues +} + +createWorkPeriodPayment.schema = Joi.object().keys({ + currentUser: Joi.object().required(), + workPeriodPayment: Joi.object().keys({ + workPeriodId: Joi.string().uuid().required(), + amount: Joi.number().greater(0).allow(null), + status: Joi.workPeriodPaymentStatus().default('completed') + }).required() +}).required() + +/** + * Update workPeriodPayment + * @param {Object} currentUser the user who perform this operation + * @param {String} id the workPeriod id + * @param {Object} data the data to be updated + * @returns {Object} the updated workPeriodPayment + */ +async function updateWorkPeriodPayment (currentUser, id, data) { + // check permission + await _checkUserPermissionForCRUWorkPeriodPayment(currentUser) + + if (data.workPeriodId) { + // ensure work period exists + await helper.ensureWorkPeriodById(data.workPeriodId) + } + const workPeriodPayment = await WorkPeriodPayment.findById(id) + const oldValue = workPeriodPayment.toJSON() + + data.updatedBy = await helper.getUserId(currentUser.userId) + let updated = null + try { + updated = await workPeriodPayment.update(data) + } catch (err) { + if (!_.isUndefined(err.original)) { + throw new errors.BadRequestError(err.original.detail) + } else { + throw err + } + } + + await helper.postEvent(config.TAAS_WORK_PERIOD_PAYMENT_UPDATE_TOPIC, updated.toJSON(), { oldValue: oldValue }) + return updated.dataValues +} + +/** + * Partially update workPeriodPayment by id + * @param {Object} currentUser the user who perform this operation + * @param {String} id the workPeriodPayment id + * @param {Object} data the data to be updated + * @returns {Object} the updated workPeriodPayment + */ +async function partiallyUpdateWorkPeriodPayment (currentUser, id, data) { + return updateWorkPeriodPayment(currentUser, id, data) +} + +partiallyUpdateWorkPeriodPayment.schema = Joi.object().keys({ + currentUser: Joi.object().required(), + id: Joi.string().uuid().required(), + data: Joi.object().keys({ + workPeriodId: Joi.string().uuid(), + amount: Joi.number().greater(0).allow(null), + status: Joi.workPeriodPaymentStatus() + }).required() +}).required() + +/** + * Fully update workPeriodPayment by id + * @param {Object} currentUser the user who perform this operation + * @param {String} id the workPeriodPayment id + * @param {Object} data the data to be updated + * @returns {Object} the updated workPeriodPayment + */ +async function fullyUpdateWorkPeriodPayment (currentUser, id, data) { + return updateWorkPeriodPayment(currentUser, id, data) +} + +fullyUpdateWorkPeriodPayment.schema = Joi.object().keys({ + currentUser: Joi.object().required(), + id: Joi.string().uuid().required(), + data: Joi.object().keys({ + workPeriodId: Joi.string().uuid().required(), + amount: Joi.number().greater(0).allow(null), + status: Joi.workPeriodPaymentStatus() + }).required() +}).required() + +/** + * List workPeriodPayments + * @param {Object} currentUser the user who perform this operation. + * @param {Object} criteria the search criteria + * @param {Object} options the extra options to control the function + * @returns {Object} the search result, contain total/page/perPage and result array + */ +async function searchWorkPeriodPayments (currentUser, criteria, options = { returnAll: false }) { + // check user permission + await _checkUserPermissionForCRUWorkPeriodPayment(currentUser) + + if ((typeof criteria.workPeriodIds) === 'string') { + criteria.workPeriodIds = criteria.workPeriodIds.trim().split(',').map(workPeriodIdRaw => { + const workPeriodId = workPeriodIdRaw.trim() + if (!uuid.validate(workPeriodId)) { + throw new errors.BadRequestError(`workPeriodId ${workPeriodId} is not a valid uuid`) + } + return workPeriodId + }) + } + const page = criteria.page + const perPage = criteria.perPage + try { + const esQuery = { + index: config.get('esConfig.ES_INDEX_WORK_PERIOD'), + _source: 'payments', + body: { + query: { + nested: { + path: 'payments', + query: { bool: { must: [] } } + } + }, + size: 10000 + // We use a very large number for size, because we can't paginate nested documents + // and in practice there could hardly be so many records to be returned.(also consider we are using filters in the meantime) + // the number is limited by `index.max_result_window`, its default value is 10000, see + // https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-max-result-window + } + } + _.each(_.pick(criteria, ['status', 'workPeriodId']), (value, key) => { + esQuery.body.query.nested.query.bool.must.push({ + term: { + [`payments.${key}`]: { + value + } + } + }) + }) + if (criteria.workPeriodIds) { + esQuery.body.query.nested.query.bool.filter = [{ + terms: { + 'payments.workPeriodId': criteria.workPeriodIds + } + }] + } + logger.debug({ component: 'WorkPeriodPaymentService', context: 'searchWorkPeriodPayment', message: `Query: ${JSON.stringify(esQuery)}` }) + + const { body } = await esClient.search(esQuery) + let payments = _.reduce(body.hits.hits, (acc, workPeriod) => _.concat(acc, workPeriod._source.payments), []) + if (criteria.status) { + payments = _.filter(payments, { status: criteria.status }) + } + payments = _.sortBy(payments, [criteria.sortBy]) + if (criteria.sortOrder === 'desc') { + payments = _.reverse(payments) + } + const total = payments.length + if (!options.returnAll) { + payments = _.slice(payments, (page - 1) * perPage, page * perPage) + } + + return { + total, + page, + perPage, + result: payments + } + } catch (err) { + logger.logFullError(err, { component: 'WorkPeriodPaymentService', context: 'searchWorkPeriodPaymentService' }) + } + logger.info({ component: 'WorkPeriodPaymentService', context: 'searchWorkPeriodPayments', message: 'fallback to DB query' }) + const filter = { [Op.and]: [] } + _.each(_.pick(criteria, ['status', 'workPeriodId']), (value, key) => { + filter[Op.and].push({ [key]: value }) + }) + if (criteria.workPeriodIds) { + filter[Op.and].push({ workPeriodId: criteria.workPeriodIds }) + } + const workPeriodPayments = await WorkPeriodPayment.findAll({ + where: filter, + offset: ((page - 1) * perPage), + limit: perPage, + order: [[criteria.sortBy, criteria.sortOrder]] + }) + return { + fromDb: true, + total: workPeriodPayments.length, + page, + perPage, + result: _.map(workPeriodPayments, workPeriodPayment => { + return workPeriodPayment.dataValues + }) + } +} + +searchWorkPeriodPayments.schema = Joi.object().keys({ + currentUser: Joi.object().required(), + criteria: Joi.object().keys({ + page: Joi.number().integer().min(1).default(1), + perPage: Joi.number().integer().min(1).max(10000).default(20), + sortBy: Joi.string().valid('status', 'amount', 'createdAt', 'updatedAt').default('createdAt'), + sortOrder: Joi.string().valid('desc', 'asc').default('desc'), + status: Joi.workPeriodPaymentStatus(), + workPeriodId: Joi.string().uuid(), + workPeriodIds: Joi.alternatives( + Joi.string(), + Joi.array().items(Joi.string().uuid()) + ) + }).required(), + options: Joi.object() +}).required() + +module.exports = { + getWorkPeriodPayment, + createWorkPeriodPayment, + partiallyUpdateWorkPeriodPayment, + fullyUpdateWorkPeriodPayment, + searchWorkPeriodPayments +} diff --git a/src/services/WorkPeriodService.js b/src/services/WorkPeriodService.js index 55903c3c..92e1deb0 100644 --- a/src/services/WorkPeriodService.js +++ b/src/services/WorkPeriodService.js @@ -12,6 +12,7 @@ const helper = require('../common/helper') const logger = require('../common/logger') const errors = require('../common/errors') const models = require('../models') +const constants = require('../../app-constants') const moment = require('moment') const WorkPeriod = models.WorkPeriod @@ -71,6 +72,16 @@ Joi.workPeriodEndDateOptional = () => Joi.date() }) }) +/** + * Check user scopes for getting payments + * @param {Object} currentUser the user who perform this operation. + * @returns {Boolean} true if user is machine and has read/all payment scopes + */ +function _checkUserScopesForGetPayments (currentUser) { + const getPaymentsScopes = [constants.Scopes.READ_WORK_PERIOD_PAYMENT, constants.Scopes.ALL_WORK_PERIOD_PAYMENT] + return currentUser.isMachine && helper.checkIfExists(getPaymentsScopes, currentUser.scopes) +} + /** * filter fields of work period by user role. * @param {Object} currentUser the user who perform this operation. @@ -78,10 +89,10 @@ Joi.workPeriodEndDateOptional = () => Joi.date() * @returns {Object} the workPeriod */ async function _getWorkPeriodFilteringFields (currentUser, workPeriod) { - if (currentUser.hasManagePermission || currentUser.isMachine) { + if (currentUser.hasManagePermission || _checkUserScopesForGetPayments(currentUser)) { return workPeriod } - return _.omit(workPeriod, 'memberRate') + return _.omit(workPeriod, ['memberRate', 'payments']) } /** @@ -155,7 +166,7 @@ async function getWorkPeriod (currentUser, id, fromDb = false) { } } logger.info({ component: 'WorkPeriodService', context: 'getWorkPeriod', message: 'try to query db for data' }) - const workPeriod = await WorkPeriod.findById(id) + const workPeriod = await WorkPeriod.findById(id, { withPayments: true }) await _checkUserPermissionForGetWorkPeriod(currentUser, workPeriod.projectId) // check user permission // We should only return "memberRate" to Booking Manager, Administrator or M2M @@ -319,10 +330,16 @@ async function deleteWorkPeriod (currentUser, id) { throw new errors.ForbiddenError('You are not allowed to perform this action!') } - const workPeriod = await WorkPeriod.findById(id) + const workPeriod = await WorkPeriod.findById(id, { withPayments: true }) if (_.includes(['completed', 'partially-completed'], workPeriod.paymentStatus)) { throw new errors.BadRequestError("Can't delete WorkPeriod with paymentStatus completed or partially-completed") } + await models.WorkPeriodPayment.destroy({ + where: { + workPeriodId: id + } + }) + await Promise.all(workPeriod.payments.map(({ id }) => helper.postEvent(config.TAAS_WORK_PERIOD_PAYMENT_DELETE_TOPIC, { id }))) await workPeriod.destroy() await helper.postEvent(config.TAAS_WORK_PERIOD_DELETE_TOPIC, { id }) } @@ -429,8 +446,9 @@ async function searchWorkPeriods (currentUser, criteria, options = { returnAll: const obj = _.cloneDeep(hit._source) obj.id = hit._id // We should only return "memberRate" to Booking Manager, Administrator or M2M - if (!currentUser.hasManagePermission && !currentUser.isMachine) { + if (!currentUser.hasManagePermission && !_checkUserScopesForGetPayments(currentUser)) { delete obj.memberRate + delete obj.payments } return obj }) @@ -448,6 +466,11 @@ async function searchWorkPeriods (currentUser, criteria, options = { returnAll: } const workPeriods = await WorkPeriod.findAll({ where: filter, + include: [{ + model: models.WorkPeriodPayment, + as: 'payments', + required: false + }], offset: ((page - 1) * perPage), limit: perPage, order: [[criteria.sortBy, criteria.sortOrder]] @@ -459,8 +482,9 @@ async function searchWorkPeriods (currentUser, criteria, options = { returnAll: perPage, result: _.map(workPeriods, workPeriod => { // We should only return "memberRate" to Booking Manager, Administrator or M2M - if (!currentUser.hasManagePermission && !currentUser.isMachine) { + if (!currentUser.hasManagePermission && !_checkUserScopesForGetPayments(currentUser)) { delete workPeriod.dataValues.memberRate + delete workPeriod.dataValues.payments } return workPeriod.dataValues })