|
| 1 | +Recruit CRM Data Import |
| 2 | +=== |
| 3 | + |
| 4 | +# Configuration |
| 5 | +Configuration file is at `./scripts/recruit-crm-job-import/config.js`. |
| 6 | + |
| 7 | + |
| 8 | +# Usage |
| 9 | +``` bash |
| 10 | +node scripts/recruit-crm-job-import <pathname-to-a-csv-file> |
| 11 | +``` |
| 12 | + |
| 13 | +By default the script creates jobs and resource bookings via `TC_API`. |
| 14 | +# Example |
| 15 | + |
| 16 | +Follow the README for Taas API to deploy Taas API locally and then point the script to the local API by running: |
| 17 | + |
| 18 | +``` bash |
| 19 | +export RCRM_IMPORT_TAAS_API_URL=http://localhost:3000/api/v5 |
| 20 | +node scripts/recruit-crm-job-import scripts/recruit-crm-job-import/example_data.csv | tee /tmp/report.txt |
| 21 | +``` |
| 22 | + |
| 23 | +The example output is: |
| 24 | + |
| 25 | +``` bash |
| 26 | +DEBUG: processing line #1 - {"directProjectId":"24568","projectId":"(dynamic load)","externalId":"","title":"taas-demo-job5","startDate":"10/26/2020","endDate":"01/29/2021","numPositions":"2","userHandle":"nkumartest","jobid":"(dynamic load)","customerRate":"20","memberRate":"10","_lnum":1} |
| 27 | +WARN: #1 - externalId is missing |
| 28 | +DEBUG: processed line #1 |
| 29 | +DEBUG: processing line #2 - {"directProjectId":"24568","projectId":"(dynamic load)","externalId":"0","title":"taas-demo-job5","startDate":"10/26/2020","endDate":"01/29/2021","numPositions":"2","userHandle":"not_found_handle","jobid":"(dynamic load)","customerRate":"20","memberRate":"10","_lnum":2} |
| 30 | +ERROR: #2 - handle: not_found_handle user not found |
| 31 | +DEBUG: processed line #2 |
| 32 | +DEBUG: processing line #3 - {"directProjectId":"24568","projectId":"(dynamic load)","externalId":"0","title":"taas-demo-job5","startDate":"10/26/2020","endDate":"01/29/2021","numPositions":"2","userHandle":"nkumartest","jobid":"(dynamic load)","customerRate":"20","memberRate":"10","_lnum":3} |
| 33 | +DEBUG: userHandle: nkumartest userId: 57646ff9-1cd3-4d3c-88ba-eb09a395366c |
| 34 | +DEBUG: resourceBookingId: dc8b23d4-9987-4a7d-a587-2056283223de status: assigned |
| 35 | +INFO: #3 - id: 7c8ed989-35bf-4899-9c93-708630a7c63b job already exists; id: dc8b23d4-9987-4a7d-a587-2056283223de resource booking created; id: dc8b23d4-9987-4a7d-a587-2056283223de status: assigned resource booking updated |
| 36 | +DEBUG: processed line #3 |
| 37 | +DEBUG: processing line #4 - {"directProjectId":"24567","projectId":"(dynamic load)","externalId":"1212","title":"Dummy Description","startDate":"10/20/2020","endDate":"01/29/2021","numPositions":"2","userHandle":"pshah_manager","jobid":"(dynamic load)","customerRate":"150","memberRate":"100","_lnum":4} |
| 38 | +DEBUG: userHandle: pshah_manager userId: a55fe1bc-1754-45fa-9adc-cf3d6d7c377a |
| 39 | +DEBUG: resourceBookingId: 708469fb-ead0-4fc3-bef7-1ef4dd041428 status: assigned |
| 40 | +INFO: #4 - id: f61da880-5295-40c2-b6db-21e6cdef93f9 job created; id: 708469fb-ead0-4fc3-bef7-1ef4dd041428 resource booking created; id: 708469fb-ead0-4fc3-bef7-1ef4dd041428 status: assigned resource booking updated |
| 41 | +DEBUG: processed line #4 |
| 42 | +DEBUG: processing line #5 - {"directProjectId":"24566","projectId":"(dynamic load)","externalId":"23850272","title":"33fromzaps330","startDate":"02/21/2021","endDate":"03/15/2021","numPositions":"7","userHandle":"nkumar2","jobid":"(dynamic load)","customerRate":"50","memberRate":"30","_lnum":5} |
| 43 | +DEBUG: userHandle: nkumar2 userId: 4b00d029-c87b-47b2-bfe2-0ab80d8b5774 |
| 44 | +DEBUG: resourceBookingId: 7870c30b-e511-48f2-8687-499ab116174f status: assigned |
| 45 | +INFO: #5 - id: 72dc0399-5e4b-4783-9a27-ea07a4ce99a7 job created; id: 7870c30b-e511-48f2-8687-499ab116174f resource booking created; id: 7870c30b-e511-48f2-8687-499ab116174f status: assigned resource booking updated |
| 46 | +DEBUG: processed line #5 |
| 47 | +DEBUG: processing line #6 - {"directProjectId":"24565","projectId":"(dynamic load)","externalId":"23843365","title":"Designer","startDate":"02/24/2021","endDate":"03/30/2021","numPositions":"1","userHandle":"GunaK-TopCoder","jobid":"(dynamic load)","customerRate":"70","memberRate":"70","_lnum":6} |
| 48 | +DEBUG: userHandle: GunaK-TopCoder userId: 2bba34d5-20e4-46d6-bfc1-05736b17afbb |
| 49 | +DEBUG: resourceBookingId: b2e705d3-6864-4697-96bb-dc2a288755bc status: assigned |
| 50 | +INFO: #6 - id: 7ff0737e-958c-494e-8a5a-592ac1c5d4ff job created; id: b2e705d3-6864-4697-96bb-dc2a288755bc resource booking created; id: b2e705d3-6864-4697-96bb-dc2a288755bc status: assigned resource booking updated |
| 51 | +DEBUG: processed line #6 |
| 52 | +DEBUG: processing line #7 - {"directProjectId":"24564","projectId":"(dynamic load)","externalId":"23836459","title":"demo-dev-19janV4","startDate":"01/20/2021","endDate":"01/30/2021","numPositions":"1","userHandle":"nkumar1","jobid":"(dynamic load)","customerRate":"400","memberRate":"200","_lnum":7} |
| 53 | +DEBUG: userHandle: nkumar1 userId: ab19a53b-0607-4a99-8bdd-f3b0cb552293 |
| 54 | +DEBUG: resourceBookingId: 04299b4c-3f6e-4b3e-ae57-bf8232408cf9 status: assigned |
| 55 | +INFO: #7 - id: 73301ade-40ff-4103-bd50-37b8d2a98183 job created; id: 04299b4c-3f6e-4b3e-ae57-bf8232408cf9 resource booking created; id: 04299b4c-3f6e-4b3e-ae57-bf8232408cf9 status: assigned resource booking updated |
| 56 | +DEBUG: processed line #7 |
| 57 | +INFO: === summary === |
| 58 | +INFO: total: 7 |
| 59 | +INFO: success: 5 |
| 60 | +INFO: failure: 1 |
| 61 | +INFO: skips: 1 |
| 62 | +INFO: === summary === |
| 63 | +INFO: done! |
| 64 | +``` |
| 65 | + |
| 66 | +To list all skipped lines: |
| 67 | + |
| 68 | +``` bash |
| 69 | +cat /tmp/report.txt | grep 'WARN' |
| 70 | +``` |
| 71 | + |
| 72 | +To find out whether there are some users not found by user handles, run the following command: |
| 73 | + |
| 74 | +``` bash |
| 75 | +cat /tmp/report.txt | grep 'ERROR' | grep 'user not found' |
| 76 | +``` |
0 commit comments