Create Sanitation Worker

From the FSM Registry screen, an admin can create the sanitation worker page using the add option.

Creating Sanitation Workers

  • Admins can fill the "Add Sanitation Worker" form to create sanitation workers in the system.

  • Admins can fill details such as Mobile Number, Name, Date of Birth, Photograph, Address, Skills, etc.

  • The mobile number has to be unique, otherwise a validation error will be shown and the user will not be able to submit the form.

  • There is a role details section at the bottom which is non-mandatory.

  • Using this role details section, an admin can specify the functional roles that this worker has, such as driver, helper, etc.

  • By default, all workers will have a generic SANITATION_WORKER role.

  • The functional roles have been mapped to the system roles using this master.

  • Currently, driver and helper functional roles are present in the system. Both are created as citizens.

  • Sanitation workers can have multiple functional roles, that is, they can be a driver as well as a helper.

  • Employer has two options: ULB and private vendor. This specifies the current employer of this worker. This can be changed in Edit Sanitation Worker.

  • Sanitation workers can also be tagged to vendors on this page based on whether the employer type is a ULB or a private vendor. This implies that the vendor select dropdown is populated based on the employer type.

  • Vendors can be a ULB or a private vendor. This is specified in this master.

  • After submitting the necessary details, an admin can click on submit and a response page is shown.

API Details

Individual Create

  • We will hit the "/individual/v1/_create" endpoint to create sanitation workers

  • The curl is given below:

curl 'https://unified-dev.digit.org/individual/v1/_create?tenantId=pg.citya' \
  -H 'authority: unified-dev.digit.org' \
  -H 'accept: application/json, text/plain, */*' \
  -H 'accept-language: en-US,en;q=0.9' \
  -H 'content-type: application/json;charset=UTF-8' \
  -H 'origin: https://unified-dev.digit.org' \
  -H 'referer: https://unified-dev.digit.org/sanitation-ui/employee/fsm/registry/new-worker' \
  -H 'sec-ch-ua: "Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Windows"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-origin' \
  -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36' \
  --data-raw '{"Individual":{"tenantId":"pg.citya","name":{"givenName":"Yin Yang"},"dateOfBirth":897955200000,"gender":"MALE","mobileNumber":"7733773377","address":[{"tenantId":"pg.citya","city":"pg.citya","locality":{"code":"SUN01"},"type":"PERMANENT"}],"identifiers":[{"identifierType":"DRIVING_LICENSE_NUMBER","identifierId":"RJ 12 40412"}],"skills":[{"type":"DRIVING","level":"UNSKILLED"},{"type":"OPERATOR","level":"UNSKILLED"}],"photo":null,"additionalFields":{"fields":[{"key":"FUNCTIONAL_ROLE_1","value":"DRIVER"},{"key":"EMPLOYMENT_TYPE_1","value":"FIXED"},{"key":"FUNCTIONAL_ROLE_COUNT","value":"01"},{"key":"EMPLOYER","value":"ULB"}]},"isSystemUser":true,"userDetails":{"username":"7733773377","tenantId":"pg.citya","roles":[{"code":"FSM_DRIVER","tenantId":"pg.citya"},{"code":"SANITATION_WORKER","tenantId":"pg.citya"},{"code":"CITIZEN","tenantId":"pg.citya"}],"type":"CITIZEN"}},"RequestInfo":{"apiId":"Rainmaker","authToken":"06170439-7751-41d9-8043-04ede25e9499","userInfo":{"id":927,"uuid":"49341961-f413-4ae1-b7f8-92a8d9136f38","userName":"ADMIN","name":"Plant operator","mobileNumber":"8282828121","emailId":null,"locale":null,"type":"EMPLOYEE","roles":[{"name":"FSM Administrator","code":"FSM_ADMIN","tenantId":"pg.citya"},{"name":"FSM Employee Application Viewer","code":"FSM_VIEW_EMP","tenantId":"pg.citya"}],"active":true,"tenantId":"pg.citya","permanentCity":null},"msgId":"1702468403390|en_IN","plainAccessRequest":{}}}' \
  --compressed

Vendor Update

  • If a vendor is selected while creating a sanitation worker, we are calling this endpoint "/vendor/v1/_update" to tag this worker to a vendor after the individual create has responded with success.

  • The curl is given below:

curl 'https://unified-dev.digit.org/vendor/v1/_update?tenantId=pg.citya' \
  -H 'authority: unified-dev.digit.org' \
  -H 'accept: application/json, text/plain, */*' \
  -H 'accept-language: en-US,en;q=0.9' \
  -H 'content-type: application/json;charset=UTF-8' \
  -H 'origin: https://unified-dev.digit.org' \
  -H 'referer: https://unified-dev.digit.org/sanitation-ui/employee/fsm/registry/new-worker' \
  -H 'sec-ch-ua: "Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Windows"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-origin' \
  -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36' \
  --data-raw '{"vendor":{"id":"e427ddf2-7c49-47f1-ba0f-4418bb10f0b7","tenantId":"pg.citya","name":"testing","address":{"tenantId":"pg.citya","doorNo":"","plotNo":"","id":"525c701b-9d76-431a-85be-5957885c75c5","landmark":"","city":"CityA","district":"CityA","region":"CityA","state":null,"country":"in","pincode":"","additionalDetails":"{\"description\": \"\"}","buildingName":"","street":"","locality":{"code":"SUN01","name":"Ajit Nagar - Area1","label":"Locality","latitude":"31.63089","longitude":"74.871552","children":[],"materializedPath":null},"geoLocation":null,"auditDetails":null},"owner":{"id":780,"uuid":"602dcd18-a9a0-4eb1-bf3d-d2d25402fc0c","userName":"9876543211","password":null,"salutation":null,"name":"testing","gender":"MALE","mobileNumber":"9876543211","emailId":"abc@egov.com","altContactNumber":null,"pan":null,"aadhaarNumber":null,"permanentAddress":null,"permanentCity":null,"permanentPinCode":null,"correspondenceCity":null,"correspondencePinCode":null,"correspondenceAddress":null,"active":true,"dob":1361318400000,"pwdExpiryDate":1708017613000,"locale":null,"type":"CITIZEN","signature":null,"accountLocked":false,"roles":[{"id":null,"name":"FSM Desluding Operator","code":"FSM_DSO","tenantId":"pg"},{"id":null,"name":"Citizen","code":"CITIZEN","tenantId":"pg"}],"fatherOrHusbandName":"testing","relationship":"OTHER","bloodGroup":null,"identificationMark":null,"photo":null,"createdBy":"715","createdDate":1698519013000,"lastModifiedBy":"927","lastModifiedDate":1702470891000,"otpReference":null,"tenantId":"pg"},"vehicles":[{"owner":{"id":781,"uuid":"86cf4d58-1c57-4878-8a73-3cbef096bf97","userName":"07e76b6d-32c5-41ea-a661-74cc3251e785","password":null,"salutation":null,"name":"Rajesh","gender":"MALE","mobileNumber":"9876543212","emailId":"abc@egov.com","altContactNumber":null,"pan":null,"aadhaarNumber":null,"permanentAddress":null,"permanentCity":null,"permanentPinCode":null,"correspondenceCity":null,"correspondencePinCode":null,"correspondenceAddress":"","active":true,"dob":0,"pwdExpiryDate":1708077096000,"locale":null,"type":"CITIZEN","signature":null,"accountLocked":false,"roles":[{"id":null,"name":"FSM Driver","code":"FSM_DRIVER","tenantId":"pg"}],"fatherOrHusbandName":"Rajesh","relationship":"OTHER","bloodGroup":null,"identificationMark":null,"photo":null,"createdBy":"715","createdDate":1698519096000,"lastModifiedBy":"927","lastModifiedDate":1702470891000,"otpReference":null,"tenantId":"pg"},"id":"5214b5fd-f760-4cc7-8982-39da770cafbc","tenantId":"pg.citya","registrationNumber":"AB 12 AS 1234","model":"TATA","type":"TATA.407","tankCapacity":1000,"suctionType":"SEWER_SUCTION_MACHINE","pollutionCertiValidTill":0,"InsuranceCertValidTill":0,"fitnessValidTill":0,"roadTaxPaidTill":0,"gpsEnabled":true,"additionalDetails":{"description":""},"source":"Municipal records","vendorVehicleStatus":"ACTIVE","status":"ACTIVE","auditDetails":{"createdBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","lastModifiedBy":"49341961-f413-4ae1-b7f8-92a8d9136f38","createdTime":1698499296513,"lastModifiedTime":1702451091704}},{"owner":{"id":862,"uuid":"19aaa423-8a4c-49a4-89af-f19620302352","userName":"33192d06-27b4-41c2-b077-aa2d97d96e71","password":null,"salutation":null,"name":"raju","gender":"MALE","mobileNumber":"6543210987","emailId":"abc@egov.com","altContactNumber":null,"pan":null,"aadhaarNumber":null,"permanentAddress":null,"permanentCity":null,"permanentPinCode":null,"correspondenceCity":null,"correspondencePinCode":null,"correspondenceAddress":"","active":true,"dob":0,"pwdExpiryDate":1709309830000,"locale":null,"type":"CITIZEN","signature":null,"accountLocked":false,"roles":[{"id":null,"name":"FSM Driver","code":"FSM_DRIVER","tenantId":"pg"}],"fatherOrHusbandName":"raju","relationship":"OTHER","bloodGroup":null,"identificationMark":null,"photo":null,"createdBy":"715","createdDate":1700821030000,"lastModifiedBy":"927","lastModifiedDate":1702470891000,"otpReference":null,"tenantId":"pg"},"id":"e6425160-7fa6-42ee-bdd3-7530dd41dc17","tenantId":"pg.citya","registrationNumber":"PO 23 GH 9876","model":"TATA","type":"TATA.407","tankCapacity":1000,"suctionType":"SEWER_SUCTION_MACHINE","pollutionCertiValidTill":0,"InsuranceCertValidTill":0,"fitnessValidTill":0,"roadTaxPaidTill":0,"gpsEnabled":true,"additionalDetails":{"description":""},"source":"Municipal records","vendorVehicleStatus":"ACTIVE","status":"ACTIVE","auditDetails":{"createdBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","lastModifiedBy":"49341961-f413-4ae1-b7f8-92a8d9136f38","createdTime":1700801230911,"lastModifiedTime":1702451091527}}],"drivers":[{"id":"3f1b3a51-9ab9-43a2-8afb-f3c544cdcda1","tenantId":"pg.citya","name":"rajesh","owner":{"id":931,"uuid":"8a9fd87d-23dd-42af-aa24-b518bbc7a713","userName":"1111111147","password":null,"salutation":null,"name":"rajesh","gender":"MALE","mobileNumber":"1111111147","emailId":"abc@egov.com","altContactNumber":null,"pan":null,"aadhaarNumber":null,"permanentAddress":null,"permanentCity":null,"permanentPinCode":null,"correspondenceCity":null,"correspondencePinCode":null,"correspondenceAddress":null,"active":true,"dob":1262390400000,"pwdExpiryDate":1706798530000,"locale":null,"type":"CITIZEN","signature":null,"accountLocked":false,"roles":[{"id":null,"name":"FSM Driver","code":"FSM_DRIVER","tenantId":"pg.citya"},{"id":null,"name":"FSM Driver","code":"FSM_DRIVER","tenantId":"pg"}],"fatherOrHusbandName":"rajesh","relationship":"OTHER","bloodGroup":null,"identificationMark":null,"photo":null,"createdBy":"927","createdDate":1702389651000,"lastModifiedBy":"927","lastModifiedDate":1702389651000,"otpReference":null,"tenantId":"pg"},"ownerId":"8a9fd87d-23dd-42af-aa24-b518bbc7a713","additionalDetails":null,"description":null,"licenseNumber":"456789032166783","status":"ACTIVE","auditDetails":{"createdBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","lastModifiedBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","createdTime":1698864130067,"lastModifiedTime":1700715369667},"vendorDriverStatus":"ACTIVE"},{"id":"3d916d24-5756-4d01-b547-b4f2feac4366","tenantId":"pg.citya","name":"Krishana","owner":{"id":932,"uuid":"2499b3ef-c501-4780-9241-bfdd7c12b289","userName":"1111111141","password":null,"salutation":null,"name":"Krishana","gender":"MALE","mobileNumber":"1111111141","emailId":"abc@egov.com","altContactNumber":null,"pan":null,"aadhaarNumber":null,"permanentAddress":null,"permanentCity":null,"permanentPinCode":null,"correspondenceCity":null,"correspondencePinCode":null,"correspondenceAddress":null,"active":true,"dob":1169683200000,"pwdExpiryDate":1706439751000,"locale":null,"type":"CITIZEN","signature":null,"accountLocked":false,"roles":[{"id":null,"name":"FSM Driver","code":"FSM_DRIVER","tenantId":"pg.citya"},{"id":null,"name":"FSM Driver","code":"FSM_DRIVER","tenantId":"pg"}],"fatherOrHusbandName":"Krishana","relationship":"OTHER","bloodGroup":null,"identificationMark":null,"photo":null,"createdBy":"927","createdDate":1702389651000,"lastModifiedBy":"927","lastModifiedDate":1702389651000,"otpReference":null,"tenantId":"pg"},"ownerId":"2499b3ef-c501-4780-9241-bfdd7c12b289","additionalDetails":null,"description":null,"licenseNumber":"987654321067890","status":"ACTIVE","auditDetails":{"createdBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","lastModifiedBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","createdTime":1698564751818,"lastModifiedTime":1698995381495},"vendorDriverStatus":"ACTIVE"}],"workers":[{"id":"28db807d-b1f7-4ec0-8198-3a24849564ef","tenantId":"pg.citya","vendorId":"e427ddf2-7c49-47f1-ba0f-4418bb10f0b7","individualId":"eb446b2b-c79b-4b36-ac86-cc1a12d4b7e4","additionalDetails":null,"auditDetails":{"createdBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","lastModifiedBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","createdTime":1698499213598,"lastModifiedTime":1701253383254},"vendorWorkerStatus":"ACTIVE"},{"id":"64c3e042-7c08-4339-8d8b-c91517993025","tenantId":"pg.citya","vendorId":"e427ddf2-7c49-47f1-ba0f-4418bb10f0b7","individualId":"9a43e3d9-2499-4272-b316-3f10a1458d29","additionalDetails":null,"auditDetails":{"createdBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","lastModifiedBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","createdTime":1698499213598,"lastModifiedTime":1700733128794},"vendorWorkerStatus":"ACTIVE"},{"id":"681cff35-5ed1-4819-b682-f68d8d88c48c","tenantId":"pg.citya","vendorId":"e427ddf2-7c49-47f1-ba0f-4418bb10f0b7","individualId":"b39b9bea-7df5-40d4-9e96-ea3036adeb88","additionalDetails":null,"auditDetails":{"createdBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","lastModifiedBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","createdTime":1698499213598,"lastModifiedTime":1700710831040},"vendorWorkerStatus":"ACTIVE"},{"id":"d1adde76-49ce-40ab-891a-17d01499a6f5","tenantId":"pg.citya","vendorId":"e427ddf2-7c49-47f1-ba0f-4418bb10f0b7","individualId":"b00a79bc-4574-4749-a371-e706a404588f","additionalDetails":null,"auditDetails":{"createdBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","lastModifiedBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","createdTime":1698499213598,"lastModifiedTime":1700730405052},"vendorWorkerStatus":"ACTIVE"},{"id":"31a41afd-dc9f-4ea0-a331-d8be9c655059","tenantId":"pg.citya","vendorId":"e427ddf2-7c49-47f1-ba0f-4418bb10f0b7","individualId":"IND-2023-11-29-010926","additionalDetails":null,"auditDetails":{"createdBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","lastModifiedBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","createdTime":1698499213598,"lastModifiedTime":1701252195270},"vendorWorkerStatus":"ACTIVE"},{"id":"d6741795-4171-4307-bd65-4d2b29c46364","tenantId":"pg.citya","vendorId":"e427ddf2-7c49-47f1-ba0f-4418bb10f0b7","individualId":"e496c773-251b-42eb-9812-450f453e6cbb","additionalDetails":null,"auditDetails":{"createdBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","lastModifiedBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","createdTime":1698499213598,"lastModifiedTime":1701695433280},"vendorWorkerStatus":"ACTIVE"},{"id":"dacc15d6-fda6-4f29-8635-cec877ee2649","tenantId":"pg.citya","vendorId":"e427ddf2-7c49-47f1-ba0f-4418bb10f0b7","individualId":"16f9ba98-cb15-4d10-883a-b6d04184b14b","additionalDetails":null,"auditDetails":{"createdBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","lastModifiedBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","createdTime":1698499213598,"lastModifiedTime":1701943427056},"vendorWorkerStatus":"ACTIVE"},{"id":"c5cc4c36-7791-488a-becb-13a2b5ce9b59","tenantId":"pg.citya","vendorId":"e427ddf2-7c49-47f1-ba0f-4418bb10f0b7","individualId":"19ec0f63-9cc9-4c84-9414-00bdfb1110cc","additionalDetails":null,"auditDetails":{"createdBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","lastModifiedBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","createdTime":1698499213598,"lastModifiedTime":1702272847021},"vendorWorkerStatus":"ACTIVE"},{"id":"9ec0387b-1a0a-406a-b511-ac4526f6ee50","tenantId":"pg.citya","vendorId":"e427ddf2-7c49-47f1-ba0f-4418bb10f0b7","individualId":"7ac94e46-8278-4aff-9693-908f58902fca","additionalDetails":null,"auditDetails":{"createdBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","lastModifiedBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","createdTime":1698499213598,"lastModifiedTime":1702024388227},"vendorWorkerStatus":"ACTIVE"},{"id":"31d6a8d2-568c-4956-a87f-81d9caf27adc","tenantId":"pg.citya","vendorId":"e427ddf2-7c49-47f1-ba0f-4418bb10f0b7","individualId":"92c84f7a-ff92-4530-a678-a817540f2c28","additionalDetails":null,"auditDetails":{"createdBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","lastModifiedBy":"49341961-f413-4ae1-b7f8-92a8d9136f38","createdTime":1698499213598,"lastModifiedTime":1702448704333},"vendorWorkerStatus":"ACTIVE"},{"id":"6563352a-648b-475b-b2f3-08745155840b","tenantId":"pg.citya","vendorId":"e427ddf2-7c49-47f1-ba0f-4418bb10f0b7","individualId":"19a1da54-5269-4170-b6af-1654cd69e677","additionalDetails":null,"auditDetails":{"createdBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","lastModifiedBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","createdTime":1698499213598,"lastModifiedTime":1702272832743},"vendorWorkerStatus":"ACTIVE"},{"id":"376dac06-52a4-4a65-b759-435d3a2cc330","tenantId":"pg.citya","vendorId":"e427ddf2-7c49-47f1-ba0f-4418bb10f0b7","individualId":"a32a1429-cc4f-4038-878c-610ea4d36d3a","additionalDetails":null,"auditDetails":{"createdBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","lastModifiedBy":"49341961-f413-4ae1-b7f8-92a8d9136f38","createdTime":1698499213598,"lastModifiedTime":1702448935221},"vendorWorkerStatus":"ACTIVE"},{"id":"704af1f6-e2b4-48fa-86bd-60e701163e9d","tenantId":"pg.citya","vendorId":"e427ddf2-7c49-47f1-ba0f-4418bb10f0b7","individualId":"1c1cde73-15c0-44f9-991f-78df04eb4e0d","additionalDetails":null,"auditDetails":{"createdBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","lastModifiedBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","createdTime":1698499213598,"lastModifiedTime":1702272841574},"vendorWorkerStatus":"ACTIVE"},{"id":"4c64320b-e5c6-485d-9578-144f482ac3f2","tenantId":"pg.citya","vendorId":"e427ddf2-7c49-47f1-ba0f-4418bb10f0b7","individualId":"37dcceb0-40f5-42fd-a801-078e95bad933","additionalDetails":null,"auditDetails":{"createdBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","lastModifiedBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","createdTime":1698499213598,"lastModifiedTime":1702036374284},"vendorWorkerStatus":"ACTIVE"},{"individualId":"0ca71210-80bb-4b5a-a33b-68865e4728eb","vendorWorkerStatus":"ACTIVE"}],"additionalDetails":{"description":""},"source":"WhatsApp","description":null,"ownerId":"602dcd18-a9a0-4eb1-bf3d-d2d25402fc0c","agencyType":"ULB","paymentPreference":"post-service","status":"ACTIVE","auditDetails":{"createdBy":"4a747fc5-6a8c-4645-8748-fec35f1b9e17","lastModifiedBy":"49341961-f413-4ae1-b7f8-92a8d9136f38","createdTime":1698499213598,"lastModifiedTime":1702451091813}},"RequestInfo":{"apiId":"Rainmaker","authToken":"06170439-7751-41d9-8043-04ede25e9499","userInfo":{"id":927,"uuid":"49341961-f413-4ae1-b7f8-92a8d9136f38","userName":"ADMIN","name":"Plant operator","mobileNumber":"8282828121","emailId":null,"locale":null,"type":"EMPLOYEE","roles":[{"name":"FSM Administrator","code":"FSM_ADMIN","tenantId":"pg.citya"},{"name":"FSM Employee Application Viewer","code":"FSM_VIEW_EMP","tenantId":"pg.citya"}],"active":true,"tenantId":"pg.citya","permanentCity":null},"msgId":"1702468403810|en_IN","plainAccessRequest":{}}}' \
  --compressed

Role-Action Mapping

  • Role-action mapping is done for the above two API endpoints for the following role:

FSM_ADMIN

Last updated

All content on this page by eGov Foundation is licensed under a Creative Commons Attribution 4.0 International License.