diff --git a/core-services/attendance/Attendace Service Postman Scripts.postman_collection.json b/core-services/attendance/Attendace Service Postman Scripts.postman_collection.json
deleted file mode 100644
index 4f63c0b7820..00000000000
--- a/core-services/attendance/Attendace Service Postman Scripts.postman_collection.json
+++ /dev/null
@@ -1,3633 +0,0 @@
-{
- "info": {
- "_postman_id": "25632b98-5918-4908-8a85-9500d8a81afa",
- "name": "Attendace Service Postman Scripts",
- "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
- },
- "item": [
- {
- "name": "Attendance Register",
- "item": [
- {
- "name": "Create Attendance Register - Success - Single Register",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Attendance Registers are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendanceRegister).to.not.be.undefined;",
- " pm.expect(req.attendanceRegister).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var register = req.attendanceRegister[0];",
- " pm.expect(register.tenantId).to.be.not.null;",
- " pm.expect(register.tenantId).to.be.not.undefined;",
- " pm.expect(register.tenantId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Register Name is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var register = req.attendanceRegister[0];",
- " pm.expect(register.name).to.be.not.null;",
- " pm.expect(register.name).to.be.not.undefined;",
- " pm.expect(register.name).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Register start date is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var register = req.attendanceRegister[0];",
- " pm.expect(register.startDate).to.be.not.null;",
- " pm.expect(register.startDate).to.be.not.undefined;",
- " pm.expect(register.startDate).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Start date should be less than end date\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var register = req.attendanceRegister[0];",
- " if (Number.isFinite(register.endDate) && (register.endDate != undefined || register.endDate != null )) {",
- " pm.expect(register.endDate).to.be.not.below(register.startDate);",
- " }",
- " }",
- ");",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Register Number is enriched\", function () {",
- " var res = pm.response.json();",
- " var registerNumber = res.attendanceRegister[0].registerNumber;",
- " pm.expect(registerNumber.substring(0,2)).to.eql(\"WR\");",
- " }",
- ");",
- "",
- "pm.test(\"Register status is set to Active if status not passed\", function () {",
- " var res = pm.response.json();",
- " var status = res.attendanceRegister[0].status;",
- " pm.expect(status).to.eql(\"ACTIVE\");",
- " }",
- ");",
- "",
- "pm.test(\"Staff is created for register\", function () {",
- " var res = pm.response.json();",
- " var staff = res.attendanceRegister[0].staff;",
- " pm.expect(staff).to.be.not.null;",
- " pm.expect(staff).to.be.not.undefined;",
- " pm.expect(staff.length).to.eql(1);",
- " }",
- ");",
- "",
- "pm.test(\"Staff created have same userId as UUID of user\", function () {",
- " var res = pm.response.json();",
- " var userInRequest = res.attendanceRegister[0].auditDetails.createdBy;",
- " var staff = res.attendanceRegister[0].staff;",
- " pm.expect(staff[0].userId).to.eql(userInRequest);",
- " }",
- ");",
- "",
- "let responseData = pm.response.json();",
- "pm.collectionVariables.set(\"tenantId\", responseData.attendanceRegister[0].tenantId);",
- "pm.collectionVariables.set(\"stateLevelTenant\", responseData.attendanceRegister[0].tenantId.split('.', 1)[0]);",
- "pm.collectionVariables.set(\"registerId\", responseData.attendanceRegister[0].id);",
- "pm.collectionVariables.set(\"registerNumber\", responseData.attendanceRegister[0].registerNumber);",
- "",
- "pm.collectionVariables.set(\"registerStartDate\", responseData.attendanceRegister[0].startDate);",
- "pm.collectionVariables.set(\"registerEndDate\", responseData.attendanceRegister[0].endDate);",
- "pm.collectionVariables.set(\"invalidRegisterEndDate\", responseData.attendanceRegister[0].endDate+24*60*60*1000);",
- ""
- ],
- "type": "text/javascript"
- }
- },
- {
- "listen": "prerequest",
- "script": {
- "exec": [
- "pm.collectionVariables.set(\"tenantId\", \"pg.citya\");",
- "// pm.collectionVariables.set(\"individualId\", \"2d12b93a-829b-4aef-9073-5418e2315355\");",
- "//dev",
- "pm.collectionVariables.set(\"individualId-1\", \"6731ed44-2407-457d-aa3e-70ffbd1d6d21\");",
- "pm.collectionVariables.set(\"individualId-2\", \"311b13c2-0029-4679-8723-fe6f57870a35\");",
- "",
- "",
- "//qa",
- "// pm.collectionVariables.set(\"individualId-1\", \"3ff2861e-8bbd-4431-a6b4-6f6a1c116356\");",
- "// pm.collectionVariables.set(\"individualId-2\", \"a7d7ec01-68e0-428d-8762-c81e2fd5c864\");",
- "",
- "",
- "pm.collectionVariables.set(\"referenceId\", \"test_contract_number_01\");",
- "pm.collectionVariables.set(\"serviceCode\", \"WORKS-CONTRACT\");",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"tenantId\": \"{{tenantId}}\",\n \"name\": \"TestRegister_01\",\n \"referenceId\": \"{{referenceId}}+{{$randomPhoneNumber}}\",\n \"serviceCode\": \"{{serviceCode}}\",\n \"startDate\": 1640995200000,\n \"endDate\": 1703980800000\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Create Attendance Register - Success - Multiple Registers",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Attendance Registers are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendanceRegister).to.not.be.undefined;",
- " pm.expect(req.attendanceRegister).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendanceRegister.forEach(register => {",
- " pm.expect(register.tenantId).to.be.not.null;",
- " pm.expect(register.tenantId).to.be.not.undefined;",
- " pm.expect(register.tenantId).not.to.eql(\"\");",
- " });",
- " }",
- ");",
- "",
- "pm.test(\"Register Name is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendanceRegister.forEach(register => {",
- " pm.expect(register.name).to.be.not.null;",
- " pm.expect(register.name).to.be.not.undefined;",
- " pm.expect(register.name).not.to.eql(\"\");",
- " });",
- " }",
- ");",
- "",
- "pm.test(\"Register start date is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendanceRegister.forEach(register => {",
- " pm.expect(register.startDate).to.be.not.null;",
- " pm.expect(register.startDate).to.be.not.undefined;",
- " pm.expect(register.startDate).not.to.eql(\"\");",
- " });",
- " }",
- ");",
- " ",
- "",
- "pm.test(\"Start date should be less than end date\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendanceRegister.forEach(register => {",
- " if (Number.isFinite(register.endDate) && (register.endDate != undefined || register.endDate != null )) {",
- " pm.expect(register.endDate).to.be.not.below(register.startDate);",
- " }",
- " });",
- " }",
- ");",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Register Number is enriched\", function () {",
- " var res = pm.response.json();",
- " res.attendanceRegister.forEach(register => {",
- " var registerNumber = register.registerNumber;",
- " pm.expect(registerNumber.substring(0,2)).to.eql(\"WR\");",
- " });",
- " }",
- ");",
- "",
- "pm.test(\"Staff is created for register\", function () {",
- " var res = pm.response.json();",
- " res.attendanceRegister.forEach(register => {",
- " var staff = register.staff;",
- " pm.expect(staff).to.be.not.null;",
- " pm.expect(staff).to.be.not.undefined;",
- " pm.expect(staff.length).to.eql(1);",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Staff created have same userId as UUID of user\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var res = pm.response.json();",
- " res.attendanceRegister.forEach(register => {",
- " var userInRequest = register.auditDetails.createdBy;",
- " var staff =register.staff;",
- " pm.expect(staff[0].userId).to.eql(userInRequest);",
- " }); ",
- " }",
- ");",
- "",
- "let responseData = pm.response.json();",
- "pm.collectionVariables.set(\"registerId2\", responseData.attendanceRegister[1].id);"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"tenantId\": \"{{tenantId}}\",\n \"name\": \"TestRegister_01\",\n \"referenceId\": \"{{referenceId}}+{{$randomPhoneNumber}}\",\n \"serviceCode\": \"{{serviceCode}}\",\n \"startDate\": 1640995200000,\n \"endDate\": 1703980800000\n },\n {\n \"tenantId\": \"{{tenantId}}\",\n \"name\": \"TestRegister_02\",\n \"referenceId\": \"{{referenceId}}+{{$randomPhoneNumber}}\",\n \"serviceCode\": \"{{serviceCode}}\",\n \"startDate\": 1640995200000,\n \"additionalDetails\": {}\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Create Attendance Register - Validation Error - Registers not provided",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Correct Error with message and code is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " var message = res.Errors[0].message;",
- " pm.expect(code).to.eql(\"ATTENDANCE_REGISTER\");",
- " pm.expect(message).to.eql(\"Attendance Register is mandatory\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": []\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Create Attendance Register - Validation Error - TenantId not provided",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Correct Error with message and code is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " var message = res.Errors[0].message;",
- " pm.expect(code).to.eql(\"TENANT_ID\");",
- " pm.expect(message).to.eql(\"Tenant is mandatory\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"name\": \"TestRegister_01\",\n \"startDate\": 1640995200000,\n \"endDate\": 1703980800000\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Create Attendance Register - Validation Error - Name not provided",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Correct Error with message and code is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " var message = res.Errors[0].message;",
- " pm.expect(code).to.eql(\"NAME\");",
- " pm.expect(message).to.eql(\"Name is mandatory\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"tenantId\": \"{{tenantId}}\",\n \"referenceId\": \"{{referenceId}}+{{$randomPhoneNumber}}\",\n \"serviceCode\": \"{{serviceCode}}\",\n \"startDate\": 1640995200000,\n \"endDate\": 1703980800000\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Create Attendance Register - Validation Error - Start Date not provided",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Correct Error with message and code is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " var message = res.Errors[0].message;",
- " pm.expect(code).to.eql(\"START_DATE\");",
- " pm.expect(message).to.eql(\"Start date is mandatory\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"tenantId\": \"{{tenantId}}\",\n \"name\": \"TestRegister_01\",\n \"endDate\": 1703980800000\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Create Attendance Register - Validation Error - Start Date greater than End Date",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Correct Error with message and code is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " var message = res.Errors[0].message;",
- " pm.expect(code).to.eql(\"DATE\");",
- " pm.expect(message).to.eql(\"Start date should be less than end date\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"tenantId\": \"{{tenantId}}\",\n \"name\": \"TestRegister_01\",\n \"startDate\": 1803980800000,\n \"endDate\": 1703980800000\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Create Attendance Register - Validation Error - Start Date Equal to 0",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Correct Error with message and code is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " var message = res.Errors[0].message;",
- " pm.expect(code).to.eql(\"START_DATE\");",
- " pm.expect(message).to.eql(\"Start date is mandatory\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"tenantId\": \"{{tenantId}}\",\n \"name\": \"TestRegister_01\",\n \"startDate\": 0,\n \"endDate\": 1703980800000\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Search Attendance Register - Success",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200)));",
- "",
- "pm.test(\"Register Search response is received\", function () {",
- " var res = pm.response.json();",
- " var id = res.attendanceRegister[0].id;",
- " pm.expect(id).to.eql(pm.collectionVariables.get(\"registerId\"));",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- },
- {
- "listen": "prerequest",
- "script": {
- "exec": [
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"action\": \"\",\n \"did\": 1,\n \"key\": \"\",\n \"msgId\": \"20170310130900|en_IN\",\n \"requesterId\": \"\",\n \"ts\": 1513579888683,\n \"ver\": \".01\",\n \"authToken\": \"{{token}}\"\n }\n}\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_search?tenantId={{tenantId}}&ids={{registerId}}",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_search"
- ],
- "query": [
- {
- "key": "tenantId",
- "value": "{{tenantId}}"
- },
- {
- "key": "ids",
- "value": "{{registerId}}"
- }
- ]
- }
- },
- "response": []
- },
- {
- "name": "Search Attendance Register - Success - Unassociated AttendeeId",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200)));",
- "",
- "pm.test(\"Register Search response is received\", function () {",
- " var res = pm.response.json();",
- " pm.expect(res.attendanceRegister.length).to.equal(0);",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"action\": \"\",\n \"did\": 1,\n \"key\": \"\",\n \"msgId\": \"20170310130900|en_IN\",\n \"requesterId\": \"\",\n \"ts\": 1513579888683,\n \"ver\": \".01\",\n \"authToken\": \"{{token}}\"\n }\n}\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_search?tenantId={{tenantId}}&ids={{registerId}}&attendeeId={{$guid}}",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_search"
- ],
- "query": [
- {
- "key": "tenantId",
- "value": "{{tenantId}}"
- },
- {
- "key": "ids",
- "value": "{{registerId}}"
- },
- {
- "key": "attendeeId",
- "value": "{{$guid}}"
- }
- ]
- }
- },
- "response": []
- },
- {
- "name": "Search Attendance Register - Success - Unassociated StaffId",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200)));",
- "",
- "pm.test(\"Register Search response is received\", function () {",
- " var res = pm.response.json();",
- " pm.expect(res.attendanceRegister.length).to.equal(0);",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"action\": \"\",\n \"did\": 1,\n \"key\": \"\",\n \"msgId\": \"20170310130900|en_IN\",\n \"requesterId\": \"\",\n \"ts\": 1513579888683,\n \"ver\": \".01\",\n \"authToken\": \"{{token}}\"\n }\n}\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_search?tenantId={{tenantId}}&ids={{registerId}}&staffId={{$guid}}",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_search"
- ],
- "query": [
- {
- "key": "tenantId",
- "value": "{{tenantId}}"
- },
- {
- "key": "ids",
- "value": "{{registerId}}"
- },
- {
- "key": "staffId",
- "value": "{{$guid}}"
- }
- ]
- }
- },
- "response": []
- },
- {
- "name": "Search Attendance Register - Success - SuperUser - Non existing RegisterID",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200)));",
- "",
- "pm.test(\"Register Search response is received\", function () {",
- " var res = pm.response.json();",
- " pm.expect(res.attendanceRegister.length).to.equal(0);",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"action\": \"\",\n \"did\": 1,\n \"key\": \"\",\n \"msgId\": \"20170310130900|en_IN\",\n \"requesterId\": \"\",\n \"ts\": 1513579888683,\n \"ver\": \".01\",\n \"authToken\": \"{{token}}\"\n }\n}\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_search?tenantId={{tenantId}}&ids={{$guid}}",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_search"
- ],
- "query": [
- {
- "key": "tenantId",
- "value": "{{tenantId}}"
- },
- {
- "key": "ids",
- "value": "{{$guid}}"
- }
- ]
- }
- },
- "response": []
- },
- {
- "name": "Search Attendance Register - Validation Error - Unassociated Register Id",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200)));",
- "",
- "pm.test(\"Register Search response is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.attendanceRegister.length;",
- " pm.expect(code).to.eql(0);",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"action\": \"\",\n \"did\": 1,\n \"key\": \"\",\n \"msgId\": \"20170310130900|en_IN\",\n \"requesterId\": \"\",\n \"ts\": 1513579888683,\n \"ver\": \".01\",\n \"authToken\": \"{{token}}\"\n }\n}\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_search?tenantId={{tenantId}}&ids=96d1055c-0251-498d-b98d-26d6c232925f",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_search"
- ],
- "query": [
- {
- "key": "tenantId",
- "value": "{{tenantId}}"
- },
- {
- "key": "ids",
- "value": "96d1055c-0251-498d-b98d-26d6c232925f"
- }
- ]
- }
- },
- "response": []
- },
- {
- "name": "Search Attendance Register - Validation Error - Tenant Id not provided",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Correct Error with message and code is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " var message = res.Errors[0].message;",
- " pm.expect(code).to.eql(\"TENANT_ID\");",
- " pm.expect(message).to.eql(\"Tenant is mandatory\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"action\": \"\",\n \"did\": 1,\n \"key\": \"\",\n \"msgId\": \"20170310130900|en_IN\",\n \"requesterId\": \"\",\n \"ts\": 1513579888683,\n \"ver\": \".01\",\n \"authToken\": \"{{token}}\"\n }\n}\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_search?ids={{registerId}}",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_search"
- ],
- "query": [
- {
- "key": "ids",
- "value": "{{registerId}}"
- }
- ]
- }
- },
- "response": []
- },
- {
- "name": "Update Attendance Register - Success - Single Register",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Attendance Registers are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendanceRegister).to.not.be.undefined;",
- " pm.expect(req.attendanceRegister).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var register = req.attendanceRegister[0];",
- " pm.expect(register.tenantId).to.be.not.null;",
- " pm.expect(register.tenantId).to.be.not.undefined;",
- " pm.expect(register.tenantId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Register Id is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var register = req.attendanceRegister[0];",
- " pm.expect(register.id).to.be.not.null;",
- " pm.expect(register.id).to.be.not.undefined;",
- " pm.expect(register.id).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Register Name is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var register = req.attendanceRegister[0];",
- " pm.expect(register.name).to.be.not.null;",
- " pm.expect(register.name).to.be.not.undefined;",
- " pm.expect(register.name).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Register start date is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var register = req.attendanceRegister[0];",
- " pm.expect(register.startDate).to.be.not.null;",
- " pm.expect(register.startDate).to.be.not.undefined;",
- " pm.expect(register.startDate).not.to.eql(\"\");",
- " }",
- ");",
- " ",
- "",
- "pm.test(\"Start date should be less than end date\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var register = req.attendanceRegister[0];",
- " if (Number.isFinite(register.endDate) && (register.endDate != undefined || register.endDate != null )) {",
- " pm.expect(register.endDate).to.be.not.below(register.startDate);",
- " }",
- " }",
- ");",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Staff is created for register\", function () {",
- " var res = pm.response.json();",
- " var staff = res.attendanceRegister[0].staff;",
- " pm.expect(staff).to.be.not.null;",
- " pm.expect(staff).to.be.not.undefined;",
- " pm.expect(staff.length).to.eql(1);",
- " }",
- ");",
- "",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"id\": \"{{registerId}}\",\n \"tenantId\": \"{{tenantId}}\",\n \"name\": \"TestRegister_010\",\n \"startDate\": 1640995200000,\n \"endDate\": 1703980800000,\n \"status\": \"ACTIVE\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_update",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_update"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Update Attendance Register - Success - Multiple Registers",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Attendance Registers are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendanceRegister).to.not.be.undefined;",
- " pm.expect(req.attendanceRegister).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendanceRegister.forEach(register => {",
- " pm.expect(register.tenantId).to.be.not.null;",
- " pm.expect(register.tenantId).to.be.not.undefined;",
- " pm.expect(register.tenantId).not.to.eql(\"\");",
- " });",
- " }",
- ");",
- "",
- "pm.test(\"Register Id is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendanceRegister.forEach(register => {",
- " pm.expect(register.id).to.be.not.null;",
- " pm.expect(register.id).to.be.not.undefined;",
- " pm.expect(register.id).not.to.eql(\"\");",
- " });",
- " }",
- ");",
- "",
- "pm.test(\"Register Name is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendanceRegister.forEach(register => {",
- " pm.expect(register.name).to.be.not.null;",
- " pm.expect(register.name).to.be.not.undefined;",
- " pm.expect(register.name).not.to.eql(\"\");",
- " });",
- " }",
- ");",
- "",
- "pm.test(\"Register start date is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendanceRegister.forEach(register => {",
- " pm.expect(register.startDate).to.be.not.null;",
- " pm.expect(register.startDate).to.be.not.undefined;",
- " pm.expect(register.startDate).not.to.eql(\"\");",
- " });",
- " }",
- ");",
- " ",
- "",
- "pm.test(\"Start date should be less than end date\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendanceRegister.forEach(register => {",
- " if (Number.isFinite(register.endDate) && (register.endDate != undefined || register.endDate != null )) {",
- " pm.expect(register.endDate).to.be.not.below(register.startDate);",
- " }",
- " });",
- " }",
- ");",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"id\": \"{{registerId}}\",\n \"tenantId\": \"{{tenantId}}\",\n \"name\": \"TestRegister_010\",\n \"startDate\": 1640995200000,\n \"endDate\": 1703980800000,\n \"status\": \"ACTIVE\"\n },\n {\n \"id\": \"{{registerId2}}\",\n \"tenantId\": \"{{tenantId}}\",\n \"name\": \"TestRegister_020\",\n \"startDate\": 1640995200000,\n \"endDate\": 1703980800000,\n \"status\": \"INACTIVE\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_update",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_update"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Update Attendance Register - Validation Error - Register Id not provided",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Correct Error with message and code is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " var message = res.Errors[0].message;",
- " pm.expect(code).to.eql(\"ATTENDANCE_REGISTER_ID\");",
- " pm.expect(message).to.eql(\"Attendance register id is mandatory\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"tenantId\": \"{{tenantId}}\",\n \"name\": \"TestRegister_010\",\n \"startDate\": 1640995200000,\n \"endDate\": 1703980800000,\n \"status\": \"ACTIVE\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_update",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_update"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Update Attendance Register - Validation Error - Tenant Id not provided",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Correct Error with message and code is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " var message = res.Errors[0].message;",
- " pm.expect(code).to.eql(\"TENANT_ID\");",
- " pm.expect(message).to.eql(\"Tenant is mandatory\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"id\": \"{{registerId}}\",\n \"name\": \"TestRegister_010\",\n \"startDate\": 1640995200000,\n \"endDate\": 1703980800000,\n \"status\": \"ACTIVE\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_update",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_update"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Update Attendance Register - Validation Error - Name not provided",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Correct Error with message and code is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " var message = res.Errors[0].message;",
- " pm.expect(code).to.eql(\"NAME\");",
- " pm.expect(message).to.eql(\"Name is mandatory\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"id\": \"{{registerId}}\",\n \"tenantId\": \"{{tenantId}}\",\n \"startDate\": 1640995200000,\n \"endDate\": 1703980800000,\n \"status\": \"ACTIVE\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_update",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_update"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Update Attendance Register - Validation Error - Start Date not provided",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Correct Error with message and code is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " var message = res.Errors[0].message;",
- " pm.expect(code).to.eql(\"START_DATE\");",
- " pm.expect(message).to.eql(\"Start date is mandatory\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"id\": \"{{registerId}}\",\n \"tenantId\": \"{{tenantId}}\",\n \"name\": \"TestRegister_010\",\n \"endDate\": 1703980800000,\n \"status\": \"ACTIVE\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_update",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_update"
- ]
- }
- },
- "response": []
- }
- ]
- },
- {
- "name": "Register Permission",
- "item": [
- {
- "name": "Staff - Enroll - Single Staff",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Staff are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.staff).to.not.be.undefined;",
- " pm.expect(req.staff).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.tenantId).to.be.not.null;",
- " pm.expect(staff.tenantId).to.be.not.undefined;",
- " pm.expect(staff.tenantId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Staff registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.registerId).to.be.not.null;",
- " pm.expect(staff.registerId).to.be.not.undefined;",
- " pm.expect(staff.registerId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Staff userId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.userId).to.be.not.null;",
- " pm.expect(staff.userId).to.be.not.undefined;",
- " pm.expect(staff.userId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Enrollment date is enriched\", function () {",
- " var res = pm.response.json();",
- " var enrollmentDate = res.staff[0].enrollmentDate;",
- " pm.expect(enrollmentDate).to.be.not.null;",
- " }",
- ");",
- "",
- "// let requestData = JSON.parse(pm.request.body.raw);",
- "// pm.collectionVariables.set(\"userId\", requestData.staff[0].userId);",
- "",
- "let responseData = pm.response.json();",
- "pm.collectionVariables.set(\"userId\", responseData.staff[0].userId);",
- "console.log(pm.collectionVariables.get(\"userId\"));",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"Enroll the user to register\",\n \"authToken\":\"{{token}}\"\n },\n \"staff\":[\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"{{$randomUUID}}\",\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/staff/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "staff",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Staff - Enroll - Validation Error - Staff already enrolled to the register",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Staff is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.staff).to.not.be.undefined;",
- " pm.expect(req.staff).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.tenantId).to.be.not.null;",
- " pm.expect(staff.tenantId).to.be.not.undefined;",
- " pm.expect(staff.tenantId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Staff registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.registerId).to.be.not.null;",
- " pm.expect(staff.registerId).to.be.not.undefined;",
- " pm.expect(staff.registerId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Staff userId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.userId).to.be.not.null;",
- " pm.expect(staff.userId).to.be.not.undefined;",
- " pm.expect(staff.userId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "",
- "pm.test(\"response is 400. Staff is already enrolled to the register\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- },
- {
- "listen": "prerequest",
- "script": {
- "exec": [
- "console.log(pm.collectionVariables.get(\"userId\"))"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"Enroll the user to register\",\n \"authToken\":\"{{token}}\"\n },\n \"staff\":[\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"{{userId}}\",\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/staff/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "staff",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Staff - Enroll - Validation Error - Duplicate staff objects not allowed in enrollment request",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Staff are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.staff).to.not.be.undefined;",
- " pm.expect(req.staff).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- "",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.tenantId).to.be.not.null;",
- " pm.expect(staff.tenantId).to.be.not.undefined;",
- " pm.expect(staff.tenantId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Staff registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.registerId).to.be.not.null;",
- " pm.expect(staff.registerId).to.be.not.undefined;",
- " pm.expect(staff.registerId).not.to.eql(\"\");",
- " }); ",
- "",
- " }",
- ");",
- "",
- "pm.test(\"Staff userId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.userId).to.be.not.null;",
- " pm.expect(staff.userId).to.be.not.undefined;",
- " pm.expect(staff.userId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is 400. Duplicate objects in request\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"Enroll the user to register\",\n \"authToken\":\"{{token}}\"\n },\n \"staff\":[\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"928ca23a-9bec-11ed-a8fc-0242ac120002\",\n \"tenantId\":\"{{tenantId}}\"\n },\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"928ca23a-9bec-11ed-a8fc-0242ac120002\",\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/staff/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "staff",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Staff - Enroll - Multiple staff",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Staff are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.staff).to.not.be.undefined;",
- " pm.expect(req.staff).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- "",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.tenantId).to.be.not.null;",
- " pm.expect(staff.tenantId).to.be.not.undefined;",
- " pm.expect(staff.tenantId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Staff registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.registerId).to.be.not.null;",
- " pm.expect(staff.registerId).to.be.not.undefined;",
- " pm.expect(staff.registerId).not.to.eql(\"\");",
- " }); ",
- "",
- " }",
- ");",
- "",
- "pm.test(\"Staff userId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.userId).to.be.not.null;",
- " pm.expect(staff.userId).to.be.not.undefined;",
- " pm.expect(staff.userId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Enrollment date is enriched\", function () {",
- " var res = pm.response.json();",
- " res.staff.forEach(staff => {",
- " pm.expect(staff.enrollmentDate).to.be.not.null;",
- " }); ",
- " }",
- ");",
- "",
- "let requestData = JSON.parse(pm.request.body.raw);",
- "pm.collectionVariables.set(\"userId-1\", requestData.staff[0].userId);",
- "pm.collectionVariables.set(\"userId-2\", requestData.staff[1].userId);",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"Enroll the user to register\",\n \"authToken\":\"{{token}}\"\n },\n \"staff\":[\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"{{$randomUUID}}\",\n \"tenantId\":\"{{tenantId}}\"\n },\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"{{$randomUUID}}\",\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/staff/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "staff",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Staff - Deenroll - Single staff",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Staff are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.staff).to.not.be.undefined;",
- " pm.expect(req.staff).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.tenantId).to.be.not.null;",
- " pm.expect(staff.tenantId).to.be.not.undefined;",
- " pm.expect(staff.tenantId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Staff registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.registerId).to.be.not.null;",
- " pm.expect(staff.registerId).to.be.not.undefined;",
- " pm.expect(staff.registerId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Staff userId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.userId).to.be.not.null;",
- " pm.expect(staff.userId).to.be.not.undefined;",
- " pm.expect(staff.userId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Deenrollment date is enriched\", function () {",
- " var res = pm.response.json();",
- " var deenrollmentDate = res.staff[0].deenrollmentDate;",
- " pm.expect(deenrollmentDate).to.be.not.null;",
- " }",
- ");",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"Deenroll staff from register\",\n \"authToken\":\"{{token}}\"\n },\n \"staff\":[\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"{{userId}}\",\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/staff/v1/_delete",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "staff",
- "v1",
- "_delete"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Staff - Deenroll - Validation Error - Staff already denrolled from the register",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Staff are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.staff).to.not.be.undefined;",
- " pm.expect(req.staff).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.tenantId).to.be.not.null;",
- " pm.expect(staff.tenantId).to.be.not.undefined;",
- " pm.expect(staff.tenantId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Staff registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.registerId).to.be.not.null;",
- " pm.expect(staff.registerId).to.be.not.undefined;",
- " pm.expect(staff.registerId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Staff userId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.userId).to.be.not.null;",
- " pm.expect(staff.userId).to.be.not.undefined;",
- " pm.expect(staff.userId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is 400. Staff already deenrolled from the register\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"Deenroll staff from register\",\n \"authToken\":\"{{token}}\"\n },\n \"staff\":[\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"{{userId}}\",\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/staff/v1/_delete",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "staff",
- "v1",
- "_delete"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Staff - Deenroll - Validation Error - Duplicate staff objects in deenrollment request",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Staff are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.staff).to.not.be.undefined;",
- " pm.expect(req.staff).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- "",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.tenantId).to.be.not.null;",
- " pm.expect(staff.tenantId).to.be.not.undefined;",
- " pm.expect(staff.tenantId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Staff registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.registerId).to.be.not.null;",
- " pm.expect(staff.registerId).to.be.not.undefined;",
- " pm.expect(staff.registerId).not.to.eql(\"\");",
- " }); ",
- "",
- " }",
- ");",
- "",
- "pm.test(\"Staff userId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.userId).to.be.not.null;",
- " pm.expect(staff.userId).to.be.not.undefined;",
- " pm.expect(staff.userId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Response is 400. Duplicate staff objects in de enrollment request\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"Deenroll staff from register\",\n \"authToken\":\"{{token}}\"\n },\n \"staff\":[\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"{{userId-1}}\",\n \"tenantId\":\"{{tenantId}}\"\n },\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"{{userId-1}}\",\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/staff/v1/_delete",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "staff",
- "v1",
- "_delete"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Staff - Deenroll - Multiple staff",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Staff are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.staff).to.not.be.undefined;",
- " pm.expect(req.staff).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- "",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.tenantId).to.be.not.null;",
- " pm.expect(staff.tenantId).to.be.not.undefined;",
- " pm.expect(staff.tenantId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Staff registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.registerId).to.be.not.null;",
- " pm.expect(staff.registerId).to.be.not.undefined;",
- " pm.expect(staff.registerId).not.to.eql(\"\");",
- " }); ",
- "",
- " }",
- ");",
- "",
- "pm.test(\"Staff userId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.userId).to.be.not.null;",
- " pm.expect(staff.userId).to.be.not.undefined;",
- " pm.expect(staff.userId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Deenrollment date is enriched\", function () {",
- " var res = pm.response.json();",
- " res.staff.forEach(staff => {",
- " pm.expect(staff.deenrollmentDate).to.be.not.null;",
- " }); ",
- " }",
- ");",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"Deenroll staff from register\",\n \"authToken\":\"{{token}}\"\n },\n \"staff\":[\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"{{userId-1}}\",\n \"tenantId\":\"{{tenantId}}\"\n },\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"{{userId-2}}\",\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/staff/v1/_delete",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "staff",
- "v1",
- "_delete"
- ]
- }
- },
- "response": []
- }
- ]
- },
- {
- "name": "Individual Enrollment",
- "item": [
- {
- "name": "Attendee - Enroll - Attendee",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Attendee are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendees).to.not.be.undefined;",
- " pm.expect(req.attendees).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.tenantId).to.be.not.null;",
- " pm.expect(attendee.tenantId).to.be.not.undefined;",
- " pm.expect(attendee.tenantId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Attendee registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.registerId).to.be.not.null;",
- " pm.expect(attendee.registerId).to.be.not.undefined;",
- " pm.expect(attendee.registerId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Attendee individualId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.individualId).to.be.not.null;",
- " pm.expect(attendee.individualId).to.be.not.undefined;",
- " pm.expect(attendee.individualId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Enrollment date is enriched\", function () {",
- " var res = pm.response.json();",
- " var enrollmentDate = res.attendees[0].enrollmentDate;",
- " pm.expect(enrollmentDate).to.be.not.null;",
- " }",
- ");",
- "",
- "// let requestData = JSON.parse(pm.request.body.raw);",
- "// pm.collectionVariables.set(\"individualId\", requestData.attendees[0].individualId);",
- "let responseData = pm.response.json();",
- "pm.collectionVariables.set(\"attendeeEnrollmentDate\", responseData.attendees[0].enrollmentDate);",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- },
- {
- "listen": "prerequest",
- "script": {
- "exec": [
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Enroll attendee to register\",\n \"authToken\":\"{{token}}\"\n },\n \"attendees\":[\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"{{individualId-1}}\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n } \n\n ]\n\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/attendee/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "attendee",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendee - Enroll - Validation Error - Attendee already enrolled",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Attendee are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendees).to.not.be.undefined;",
- " pm.expect(req.attendees).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.tenantId).to.be.not.null;",
- " pm.expect(attendee.tenantId).to.be.not.undefined;",
- " pm.expect(attendee.tenantId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Attendee registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.registerId).to.be.not.null;",
- " pm.expect(attendee.registerId).to.be.not.undefined;",
- " pm.expect(attendee.registerId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Attendee individualId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.individualId).to.be.not.null;",
- " pm.expect(attendee.individualId).to.be.not.undefined;",
- " pm.expect(attendee.individualId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is 400. Attendee already enrolled to the register\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- },
- {
- "listen": "prerequest",
- "script": {
- "exec": [
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Enroll attendee to register\",\n \"authToken\":\"{{token}}\"\n },\n \"attendees\":[\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"{{individualId-1}}\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n } \n\n ]\n\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/attendee/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "attendee",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendee - Enroll - Validation Error - Duplicate attendee objects not allowed in request",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Attendee are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendees).to.not.be.undefined;",
- " pm.expect(req.attendees).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.tenantId).to.be.not.null;",
- " pm.expect(attendee.tenantId).to.be.not.undefined;",
- " pm.expect(attendee.tenantId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Attendee registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.registerId).to.be.not.null;",
- " pm.expect(attendee.registerId).to.be.not.undefined;",
- " pm.expect(attendee.registerId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Attendee individualId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.individualId).to.be.not.null;",
- " pm.expect(attendee.individualId).to.be.not.undefined;",
- " pm.expect(attendee.individualId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is 400. Duplicate attendee objects in the request\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Enroll attendee to register\",\n \"authToken\":\"{{token}}\"\n },\n \"attendees\":[\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"{{individualId-1}}\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n },\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"{{individualId-1}}\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n } \n\n ]\n\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/attendee/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "attendee",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendee - Deenroll- Single Attendee",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Attendees are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendees).to.not.be.undefined;",
- " pm.expect(req.attendees).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.tenantId).to.be.not.null;",
- " pm.expect(attendee.tenantId).to.be.not.undefined;",
- " pm.expect(attendee.tenantId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Attendee registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.registerId).to.be.not.null;",
- " pm.expect(attendee.registerId).to.be.not.undefined;",
- " pm.expect(attendee.registerId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Attendee individualId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.individualId).to.be.not.null;",
- " pm.expect(attendee.individualId).to.be.not.undefined;",
- " pm.expect(attendee.individualId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Deenrollment date is enriched\", function () {",
- " var res = pm.response.json();",
- " var deenrollmentDate = res.attendees[0].deenrollmentDate;",
- " pm.expect(deenrollmentDate).to.be.not.null;",
- " }",
- ");",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"search with from and to values\",\n \"authToken\":\"{{token}}\"\n },\n \"attendees\":[\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"{{individualId-1}}\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/attendee/v1/_delete",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "attendee",
- "v1",
- "_delete"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendee - Deenroll- Validation Error - Attendee already deenrolled from the register",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Attendees are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendees).to.not.be.undefined;",
- " pm.expect(req.attendees).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.tenantId).to.be.not.null;",
- " pm.expect(attendee.tenantId).to.be.not.undefined;",
- " pm.expect(attendee.tenantId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Attendee registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.registerId).to.be.not.null;",
- " pm.expect(attendee.registerId).to.be.not.undefined;",
- " pm.expect(attendee.registerId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Attendee individualId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.individualId).to.be.not.null;",
- " pm.expect(attendee.individualId).to.be.not.undefined;",
- " pm.expect(attendee.individualId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is 400. Attendee already deenrolled from the register\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"search with from and to values\",\n \"authToken\":\"{{token}}\"\n },\n \"attendees\":[\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"{{individualId-1}}\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/attendee/v1/_delete",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "attendee",
- "v1",
- "_delete"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendee - Enroll - Multiple Attendees",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Attendee are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendees).to.not.be.undefined;",
- " pm.expect(req.attendees).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.tenantId).to.be.not.null;",
- " pm.expect(attendee.tenantId).to.be.not.undefined;",
- " pm.expect(attendee.tenantId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Attendee registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.registerId).to.be.not.null;",
- " pm.expect(attendee.registerId).to.be.not.undefined;",
- " pm.expect(attendee.registerId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Attendee individualId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.individualId).to.be.not.null;",
- " pm.expect(attendee.individualId).to.be.not.undefined;",
- " pm.expect(attendee.individualId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Enrollment date is enriched\", function () {",
- " var res = pm.response.json();",
- " res.attendees.forEach(attendee => {",
- " pm.expect(attendee.enrollmentDate).to.be.not.null;",
- " }); ",
- " }",
- ");",
- "",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Enroll attendee to register\",\n \"authToken\":\"{{token}}\"\n },\n \"attendees\":[\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"{{individualId-1}}\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n },\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"{{individualId-2}}\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n } \n\n ]\n\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/attendee/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "attendee",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendee - Deenroll- Validation Error - Duplicate attendee objects in deenrollment request",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Attendees are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendees).to.not.be.undefined;",
- " pm.expect(req.attendees).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.tenantId).to.be.not.null;",
- " pm.expect(attendee.tenantId).to.be.not.undefined;",
- " pm.expect(attendee.tenantId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Attendee registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.registerId).to.be.not.null;",
- " pm.expect(attendee.registerId).to.be.not.undefined;",
- " pm.expect(attendee.registerId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Attendee individualId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.individualId).to.be.not.null;",
- " pm.expect(attendee.individualId).to.be.not.undefined;",
- " pm.expect(attendee.individualId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is 400. Duplicate attendee objects in deenrollment request.\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"search with from and to values\",\n \"authToken\":\"{{token}}\"\n },\n \"attendees\":[\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"{{individualId-1}}\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n },\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"{{individualId-1}}\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/attendee/v1/_delete",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "attendee",
- "v1",
- "_delete"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendee - Deenroll- Multiple Attendees",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Attendees are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendees).to.not.be.undefined;",
- " pm.expect(req.attendees).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.tenantId).to.be.not.null;",
- " pm.expect(attendee.tenantId).to.be.not.undefined;",
- " pm.expect(attendee.tenantId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Attendee registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.registerId).to.be.not.null;",
- " pm.expect(attendee.registerId).to.be.not.undefined;",
- " pm.expect(attendee.registerId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Attendee individualId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.individualId).to.be.not.null;",
- " pm.expect(attendee.individualId).to.be.not.undefined;",
- " pm.expect(attendee.individualId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Deenrollment date is enriched\", function () {",
- " var res = pm.response.json();",
- " res.attendees.forEach(attendee => {",
- " pm.expect(attendee.denrollmentDate).to.be.not.null;",
- " }); ",
- " }",
- ");",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"search with from and to values\",\n \"authToken\":\"{{token}}\"\n },\n \"attendees\":[\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"{{individualId-1}}\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n },\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"{{individualId-2}}\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/attendee/v1/_delete",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "attendee",
- "v1",
- "_delete"
- ]
- }
- },
- "response": []
- }
- ]
- },
- {
- "name": "Attendance Log",
- "item": [
- {
- "name": "Attendance Log - Create - Success",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- " setTimeout( () => {",
- "",
- " pm.test(\"Attendance Log created successfully\", function () {",
- " var res = pm.response.json();",
- " var id = res.attendance[0].id;",
- " pm.expect(id).to.be.not.null;",
- " }",
- ");",
- " ",
- " }, 1000);",
- "",
- "",
- "",
- "let responseData = pm.response.json();",
- "pm.collectionVariables.set(\"attendanceLogId\", responseData.attendance[0].id);"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n },\r\n \"attendance\": [\r\n {\r\n \"registerId\": \"{{registerId}}\",\r\n \"individualId\": \"{{individualId-1}}\",\r\n \"time\": {{attendeeEnrollmentDate}},\r\n \"type\": \"ENTRY\",\r\n \"status\": \"ACTIVE\",\r\n \"tenantId\": \"{{tenantId}}\",\r\n \"documentIds\":[\r\n {\r\n \"documentType\": \"documentType\",\r\n \"fileStore\": \"fileStore\",\r\n \"documentUid\": \"documentUid\"\r\n }\r\n \r\n ]\r\n }\r\n ]\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendance Log - Update - Success",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Attendance Log updated successfully\", function () {",
- " var res = pm.response.json();",
- " var status = res.attendance[0].status;",
- " pm.expect(status).to.eql(\"INACTIVE\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n },\r\n \"attendance\": [\r\n {\r\n \"id\": \"{{attendanceLogId}}\",\r\n \"registerId\": \"{{registerId}}\",\r\n \"individualId\": \"{{individualId-1}}\",\r\n \"time\": {{attendeeEnrollmentDate}},\r\n \"type\": \"ENTRY\",\r\n \"status\": \"INACTIVE\",\r\n \"tenantId\": \"{{tenantId}}\",\r\n \"documentIds\":[\r\n {\r\n \"documentType\": \"documentType\",\r\n \"fileStore\": \"fileStore\",\r\n \"documentUid\": \"documentUid\"\r\n }\r\n \r\n ],\r\n \"auditDetails\": {\r\n \"createdBy\": \"47b5ea82-249c-4435-9646-16167fec06df\",\r\n \"lastModifiedBy\": \"47b5ea82-249c-4435-9646-16167fec06df\",\r\n \"createdTime\": 1671090269007,\r\n \"lastModifiedTime\": 1671090269007\r\n }\r\n \r\n }\r\n ]\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_update",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_update"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendance Log - Update - fail - attendanceId is not valid",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "pm.test(\"Attendance Log updated successfully\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " pm.expect(code).to.eql(\"ATTENDANCE_LOG\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n },\r\n \"attendance\": [\r\n {\r\n \"id\": \"{{$randomUUID}}\",\r\n \"registerId\": \"{{registerId}}\",\r\n \"individualId\": \"{{individualId}}\",\r\n \"time\": {{attendeeEnrollmentDate}},\r\n \"type\": \"ENTRY\",\r\n \"status\": \"INACTIVE\",\r\n \"tenantId\": \"{{tenantId}}\",\r\n \"documentIds\":[\r\n {\r\n \"documentType\": \"documentType\",\r\n \"fileStore\": \"fileStore\",\r\n \"documentUid\": \"documentUid\"\r\n }\r\n \r\n ],\r\n \"auditDetails\": {\r\n \"createdBy\": \"47b5ea82-249c-4435-9646-16167fec06df\",\r\n \"lastModifiedBy\": \"47b5ea82-249c-4435-9646-16167fec06df\",\r\n \"createdTime\": 1671090269007,\r\n \"lastModifiedTime\": 1671090269007\r\n }\r\n \r\n }\r\n ]\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_update",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_update"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendance Log - Create - Fail - All logs should belong to same tenantId",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "pm.test(\"Attendance Log created successfully\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " pm.expect(code).to.eql(\"MULTIPLE_TENANTIDS\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n },\r\n \"attendance\": [\r\n {\r\n \"registerId\": \"{{registerId}}\",\r\n \"individualId\": \"{{individualId}}\",\r\n \"time\": {{attendeeEnrollmentDate}},\r\n \"type\": \"ENTRY\",\r\n \"status\": \"ACTIVE\",\r\n \"tenantId\": \"{{tenantId}}\",\r\n \"documentIds\":[\r\n {\r\n \"documentType\": \"documentType\",\r\n \"fileStore\": \"fileStore\",\r\n \"documentUid\": \"documentUid\"\r\n }\r\n \r\n ]\r\n },\r\n {\r\n \"registerId\": \"{{registerId}}\",\r\n \"individualId\": \"{{individualId}}\",\r\n \"time\": {{attendeeEnrollmentDate}},\r\n \"type\": \"ENTRY\",\r\n \"status\": \"ACTIVE\",\r\n \"tenantId\": \"tenant.id\",\r\n \"documentIds\":[\r\n {\r\n \"documentType\": \"documentType\",\r\n \"fileStore\": \"fileStore\",\r\n \"documentUid\": \"documentUid\"\r\n }\r\n \r\n ]\r\n }\r\n ]\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendance Log - Create - Fail - Validate Attendance Log time",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "pm.test(\"Attendance Log created successfully\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " pm.expect(code).to.eql(\"INVALID_ATTENDANCE_TIME\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n },\r\n \"attendance\": [\r\n {\r\n \"registerId\": \"{{registerId}}\",\r\n \"individualId\": \"{{individualId}}\",\r\n \"time\": {{invalidRegisterEndDate}},\r\n \"type\": \"ENTRY\",\r\n \"status\": \"ACTIVE\",\r\n \"tenantId\": \"{{tenantId}}\",\r\n \"documentIds\":[\r\n {\r\n \"documentType\": \"documentType\",\r\n \"fileStore\": \"fileStore\",\r\n \"documentUid\": \"documentUid\"\r\n }\r\n \r\n ]\r\n }\r\n ]\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendance Log - Create - Fail - Register should belongs to tenenatId",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n },\r\n \"attendance\": [\r\n {\r\n \"registerId\": \"{{$randomUUID}}\",\r\n \"individualId\": \"{{individualId}}\",\r\n \"time\": {{attendeeEnrollmentDate}},\r\n \"type\": \"ENTRY\",\r\n \"status\": \"ACTIVE\",\r\n \"tenantId\": \"{{tenantId}}\",\r\n \"documentIds\":[\r\n {\r\n \"documentType\": \"documentType\",\r\n \"fileStore\": \"fileStore\",\r\n \"documentUid\": \"documentUid\"\r\n }\r\n \r\n ]\r\n }\r\n ]\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendance Log - Create - Fail - All logs should belong to same registerId",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "pm.test(\"Attendance Log created successfully\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " pm.expect(code).to.eql(\"MULTIPLE_REGISTERIDS\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n },\r\n \"attendance\": [\r\n {\r\n \"registerId\": \"{{registerId}}\",\r\n \"individualId\": \"{{individualId}}\",\r\n \"time\": {{attendeeEnrollmentDate}},\r\n \"type\": \"ENTRY\",\r\n \"status\": \"ACTIVE\",\r\n \"tenantId\": \"{{tenantId}}\",\r\n \"documentIds\":[\r\n {\r\n \"documentType\": \"documentType\",\r\n \"fileStore\": \"fileStore\",\r\n \"documentUid\": \"documentUid\"\r\n }\r\n \r\n ]\r\n },\r\n {\r\n \"registerId\": \"{{$randomUUID}}\",\r\n \"individualId\": \"{{individualId}}\",\r\n \"time\": {{attendeeEnrollmentDate}},\r\n \"type\": \"ENTRY\",\r\n \"status\": \"ACTIVE\",\r\n \"tenantId\": \"{{tenantId}}\",\r\n \"documentIds\":[\r\n {\r\n \"documentType\": \"documentType\",\r\n \"fileStore\": \"fileStore\",\r\n \"documentUid\": \"documentUid\"\r\n }\r\n \r\n ]\r\n }\r\n ]\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendance Log - Create - Fail - User is not authorised",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "pm.test(\"Attendance Log created successfully\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " pm.expect(code).to.eql(\"UNAUTHORISED_USER\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- },
- {
- "listen": "prerequest",
- "script": {
- "exec": [
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n },\r\n \"attendance\": [\r\n {\r\n \"registerId\": \"{{$randomUUID}}\",\r\n \"individualId\": \"{{individualId}}\",\r\n \"time\": {{attendeeEnrollmentDate}},\r\n \"type\": \"ENTRY\",\r\n \"status\": \"ACTIVE\",\r\n \"tenantId\": \"{{tenantId}}\",\r\n \"documentIds\":[\r\n {\r\n \"documentType\": \"documentType\",\r\n \"fileStore\": \"fileStore\",\r\n \"documentUid\": \"documentUid\"\r\n }\r\n \r\n ]\r\n }\r\n ]\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendance Log - Rearch - Fail - TenantId is required",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "pm.test(\"Attendance Log created successfully\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " pm.expect(code).to.eql(\"TENANT_ID\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n }\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_search",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_search"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendance Log - Rearch - Fail - RegisterId is required",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "pm.test(\"Attendance Log created successfully\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " pm.expect(code).to.eql(\"REGISTER_ID\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n }\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_search?tenantId={{tenantId}}",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_search"
- ],
- "query": [
- {
- "key": "tenantId",
- "value": "{{tenantId}}"
- }
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendance Log - Rearch - Success",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Attendance Log created successfully\", function () {",
- " var res = pm.response.json();",
- " pm.expect(res.attendance).to.be.not.null;",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n }\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_search?tenantId={{tenantId}}®isterId={{registerId}}",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_search"
- ],
- "query": [
- {
- "key": "tenantId",
- "value": "{{tenantId}}"
- },
- {
- "key": "registerId",
- "value": "{{registerId}}"
- }
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendance Log - Create - Fail - required fields are missing",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Register Search response is received\", function () {",
- " var res = pm.response.json();",
- " pm.expect(res.Errors.length).to.equal(5);",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n },\r\n \"attendance\": [\r\n {\r\n \"registerId\": null,\r\n \"individualId\": null,\r\n \"time\": null,\r\n \"type\": null,\r\n \"status\": \"ACTIVE\",\r\n \"tenantId\": null,\r\n \"documentIds\":[\r\n {\r\n \"documentType\": \"documentType\",\r\n \"fileStore\": \"fileStore\",\r\n \"documentUid\": \"documentUid\"\r\n }\r\n \r\n ]\r\n }\r\n ]\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- }
- ]
- }
- ],
- "event": [
- {
- "listen": "prerequest",
- "script": {
- "type": "text/javascript",
- "exec": [
- "if (pm.environment.get(\"base_url\").includes(\"localhost\")) {",
- "",
- " var tenantId = \"pb.amritsar\";",
- " var id = 1;",
- " var uuid = \"11b0e02b-0145-4de2-bc42-c97b96264807\";",
- "",
- " var roles = [{",
- " \"code\": \"SUPERUSER\",",
- " \"name\": \"SUPER USER\",",
- " \"tenantId\": tenantId",
- " }];",
- "",
- " var userInfo = {",
- " \"id\": id,",
- " \"uuid\": uuid,",
- " \"userName\": \"\",",
- " \"name\": \"\",",
- " \"mobileNumber\": \"\",",
- " \"emailId\": \"\",",
- " \"type\": \"\",",
- " \"roles\": roles,",
- " \"active\": true,",
- " \"tenantId\": \"pb.amritsar\"",
- " };",
- "",
- " pm.request.body.raw = pm.request.body.raw.replace('\"{{token}}\"', '\"\", \\n \"userInfo\": ' + JSON.stringify(userInfo));",
- "}"
- ]
- }
- },
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- ""
- ]
- }
- }
- ],
- "variable": [
- {
- "key": "tenantId",
- "value": ""
- },
- {
- "key": "stateLevelTenant",
- "value": ""
- },
- {
- "key": "registerId",
- "value": ""
- },
- {
- "key": "registerNumber",
- "value": ""
- },
- {
- "key": "registerId2",
- "value": ""
- },
- {
- "key": "registerStartDate",
- "value": ""
- },
- {
- "key": "registerEndDate",
- "value": ""
- },
- {
- "key": "invalidRegisterEndDate",
- "value": ""
- },
- {
- "key": "userId",
- "value": ""
- },
- {
- "key": "userId-1",
- "value": ""
- },
- {
- "key": "userId-2",
- "value": ""
- },
- {
- "key": "individualId",
- "value": ""
- },
- {
- "key": "attendeeEnrollmentDate",
- "value": ""
- },
- {
- "key": "individualId-1",
- "value": ""
- },
- {
- "key": "individualId-2",
- "value": ""
- },
- {
- "key": "attendanceLogId",
- "value": ""
- },
- {
- "key": "referenceId",
- "value": ""
- },
- {
- "key": "serviceCode",
- "value": ""
- }
- ]
-}
\ No newline at end of file
diff --git a/core-services/attendance/Attendance-Service-1.0.0.yaml b/core-services/attendance/Attendance-Service-1.0.0.yaml
deleted file mode 100644
index 7a3c97e43fb..00000000000
--- a/core-services/attendance/Attendance-Service-1.0.0.yaml
+++ /dev/null
@@ -1,666 +0,0 @@
-openapi: 3.0.0
-info:
- version: 1.0.0
- title: Attendance Service
- description: ''
-
-paths:
-
- /attendance/v1/_create:
- post:
- tags:
- - Attendance Register
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/AttendanceRegisterRequest'
- responses:
- '202':
- description: 'Request to create a register has been accepted.'
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/AttendanceRegisterResponse'
- '400':
- description: Invalid input.
- content:
- '*/*':
- schema:
- $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/master/core-services/docs/common-contract.yml#/components/schemas/ErrorRes'
-
- /attendance/v1/_update:
- post:
- tags:
- - Attendance Register
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/AttendanceRegisterRequest'
- responses:
- '202':
- description: 'Request to update the register has been accepted.'
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/AttendanceRegisterResponse'
- '400':
- description: Invalid input.
- content:
- '*/*':
- schema:
- $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/master/core-services/docs/common-contract.yml#/components/schemas/ErrorRes'
-
- /attendance/v1/_search:
- post:
- tags:
- - Attendance Register
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/RequestInfoWrapper'
- parameters:
- - $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/master/core-services/docs/common-contract.yml#/components/parameters/tenantId'
- - name: ids
- description: List of register ids
- in: query
- schema:
- type: array
- items:
- type: string
- - name: registerNumber
- description: Custom formatted Register id
- in: query
- schema:
- type: string
- - name: name
- description: Name of the register
- in: query
- schema:
- type: string
- - name: referenceId
- description: Reference Id
- in: query
- schema:
- type: string
- - name: serviceCode
- description: Service Code
- in: query
- schema:
- type: string
- - name: fromDate
- description: Return registers with any overlap in the given time period
- in: query
- schema:
- type: number
- - name: toDate
- description: Return registers with any overlap in the given time period
- in: query
- schema:
- type: number
- - name: status
- description: Status of the register. This can't be the only query param. It should be paired with some other search param.
- in: query
- schema:
- type: string
- - name: attendeeId
- description: Get all the registers where the given Individual was registered.
- in: query
- schema:
- type: string
- - name: staffId
- description: Get all the registers where the given staff was registered.
- in: query
- schema:
- type: string
- - name: sortBy
- in: query
- description: sort the search results by fields
- schema:
- type: string
- enum:
- - fromDate
- - toDate
- - lastModifiedTime
- - name: sortOrder
- in: query
- description: sorting order of the search resulsts
- schema:
- type: string
- enum:
- - asc
- - desc
- - name: limit
- in: query
- description: limit on the resulsts
- schema:
- type: number
- - name: offset
- in: query
- description: offset index of the overall search resulsts
- schema:
- type: number
- responses:
- '200':
- description: 'Search results'
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/AttendanceRegisterResponse'
- '400':
- description: Invalid input.
- content:
- '*/*':
- schema:
- $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/master/core-services/docs/common-contract.yml#/components/schemas/ErrorRes'
-
- /attendance/staff/v1/_create:
- post:
- description: Grant permission to a user to access and modify an attendance register. This user can enroll / denroll individuals. They will add attendance entries for the attendees.
- tags:
- - Register Permission
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/StaffPermissionRequest'
- responses:
- '202':
- description: 'Grant permission request accepted'
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/StaffPermissionResponse'
- '400':
- description: Invalid input.
- content:
- '*/*':
- schema:
- $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/master/core-services/docs/common-contract.yml#/components/schemas/ErrorRes'
-
- /attendance/staff/v1/_delete:
- post:
- description: Revoke permission to a user to access and modify an attendance register. This user can enroll / denroll individuals. They will add attendance entries for the attendees.
- tags:
- - Register Permission
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/StaffPermissionRequest'
- responses:
- '202':
- description: 'Revoke permission request accepted'
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/StaffPermissionResponse'
- '400':
- description: Invalid input.
- content:
- '*/*':
- schema:
- $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/master/core-services/docs/common-contract.yml#/components/schemas/ErrorRes'
-
- /attendance/attendee/v1/_create:
- post:
- description: Users with permission to access the register can enroll / denroll attendees.
- tags:
- - Individual Enrollment
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/AttendeeCreateRequest'
- responses:
- '202':
- description: 'Attendee Create request accepted'
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/AttendeeCreateResponse'
- '400':
- description: Invalid input.
- content:
- '*/*':
- schema:
- $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/master/core-services/docs/common-contract.yml#/components/schemas/ErrorRes'
-
- /attendance/attendee/v1/_delete:
- post:
- description: Users with permission to access the register can enroll / denroll attendees.
- tags:
- - Individual Enrollment
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/AttendeeDeleteRequest'
- responses:
- '202':
- description: 'Attendee Delete request accepted'
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/AttendeeDeleteResponse'
- '400':
- description: Invalid input.
- content:
- '*/*':
- schema:
- $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/master/core-services/docs/common-contract.yml#/components/schemas/ErrorRes'
-
- /attendance/log/v1/_create:
- post:
- tags:
- - Attendance Log
- description: It creates a new attendance record.
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/AttendanceLogRequest'
- responses:
- '202':
- description: 'Attendance Records Create Request accepted.'
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/AttendanceLogResponse'
- '400':
- description: Invalid input.
- content:
- '*/*':
- schema:
- $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/master/core-services/docs/common-contract.yml#/components/schemas/ErrorRes'
-
- /attendance/log/v1/_update:
- post:
- tags:
- - Attendance Log
- description: It updates an attendance record.
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/AttendanceLogRequest'
- responses:
- '202':
- description: 'Attendance Records Update Request accepted.'
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/AttendanceLogResponse'
- '400':
- description: Invalid input.
- content:
- '*/*':
- schema:
- $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/master/core-services/docs/common-contract.yml#/components/schemas/ErrorRes'
-
- /attendance/log/v1/_search:
- post:
- tags:
- - Attendance Log
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/RequestInfoWrapper'
- parameters:
- - $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/master/core-services/docs/common-contract.yml#/components/parameters/tenantId'
- - name: registerId
- in: query
- required: true
- description: Id of the register
- schema:
- type: string
- - name: fromTime
- in: query
- description: Starting time from which the attendance needs to be searched
- schema:
- type: number
- - name: toTime
- in: query
- description: End time till which the attendance needs to be searched
- schema:
- type: number
- - name: individualIds
- in: query
- description: List of individual ids
- schema:
- type: array
- items:
- type: string
- - name: ids
- in: query
- description: List of ids
- schema:
- type: array
- items:
- type: string
- - name: status
- in: query
- description: The status of the attendance log.
- schema:
- type: string
- enum:
- - ACTIVE
- - INACTIVE
- responses:
- '200':
- description: 'Complete table of attendance entries.'
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/AttendanceLogResponse'
-
-components:
- schemas:
- AttendanceRegister:
- type: object
- properties:
- id:
- type: string
- format: uuid
- example: 64e33343-7b4c-4353-9abf-4de8f5bcd732
- description: System generated unique identifier of the register
- readOnly: true
- tenantId:
- type: string
- example: pb.amritsar
- description: Tenant Id of the register
- registerNumber:
- type: string
- example: REG/2022-23/001
- description: System generated id with custom formatting
- readOnly: true
- name:
- type: string
- example: Class-10-E Physics
- description: Name of the register
- maxLength: 140
- referenceId:
- type: string
- example: 64e33343-7b4c-4353-9abf-4de8f5bcd732
- description: Id of the entity to which register is associated. Example ContractId
- maxLength: 256
- serviceCode:
- type: string
- example: WORKS-CONTRACT
- description: Service to which register is associated.
- maxLength: 64
- startDate:
- type: number
- format: timestamp
- example: 1665497225000
- description: Timestamp of the start date in milliseconds
- endDate:
- type: number
- format: timestamp
- example: 1665497271000
- description: Timestamp of the end date in milliseconds. After the end date no modifications will be allowed to the register.
- status:
- type: string
- enum:
- - ACTIVE
- - INACTIVE
- description: Stores if the register is active or not. Inactive registers can be archieved later.
- staff:
- readOnly: true
- type: array
- items:
- allOf:
- - $ref: '#/components/schemas/StaffPermission'
- - description: 'Entries of the staff members of the register.'
- attendees:
- readOnly: true
- type: array
- items:
- allOf:
- - $ref: '#/components/schemas/IndividualEntry'
- - description: 'Entries of the attendees of the register.'
- auditDetails:
- $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/master/core-services/docs/common-contract.yml#/components/schemas/AuditDetails'
- additionalDetails:
- type: object
- description: Any additional details of the register
- required:
- - tenantId
- - name
- - referenceId
- - serviceCode
-
- AttendanceRegisterRequest:
- type: object
- properties:
- requestInfo:
- $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/subhashini_devguide_changes/core-services/docs/common-contract.yml#/definitions/RequestInfo'
- attendanceRegister:
- type: array
- items:
- allOf:
- - $ref: '#/components/schemas/AttendanceRegister'
- - description: 'Entries of the attendance register to be created.'
-
- AttendanceRegisterResponse:
- type: object
- properties:
- responseInfo:
- $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/subhashini_devguide_changes/core-services/docs/common-contract.yml#/definitions/ResponseInfo'
- attendanceRegister:
- type: array
- items:
- $ref: '#/components/schemas/AttendanceRegister'
-
- IndividualEntry:
- type: object
- properties:
- id:
- type: string
- format: uuid
- example: 64e33343-7b4c-4353-9abf-4de8f5bcd732
- description: Primary identifier of the enrollment record
- readOnly: true
- registerId:
- type: string
- format: uuid
- example: 32e33343-7b4c-4353-9abf-4de8f5bcd764
- description: This field will not be shown when this object is part of the register object. It is present so that we can reuse this object for enroll and denroll requests.
- individualId:
- type: string
- format: uuid
- example: 2bafdd8d-5673-4690-b3d0-e13d7ac0cf24
- description: Reference from the Individual Registry
- enrollmentDate:
- type: number
- description: The timestamp of the date on which the individual is enrolled onto the register. Defaults to current time.
- denrollmentDate:
- type: number
- description: The timestamp of the date on which the individual is denrolled from the register. Defaults to current time.
- tenantId:
- type: string
- example: pb.amritsar
- description: Tenant Id
-
- AttendeeCreateRequest:
- type: object
- properties:
- requestInfo:
- $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/subhashini_devguide_changes/core-services/docs/common-contract.yml#/definitions/RequestInfo'
- attendees:
- type: array
- items:
- allOf:
- - $ref: '#/components/schemas/IndividualEntry'
- - required:
- - registerId
- - individualId
- - enrollmentDate
- - tenantId
-
- AttendeeCreateResponse:
- type: object
- properties:
- responseInfo:
- $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/subhashini_devguide_changes/core-services/docs/common-contract.yml#/definitions/ResponseInfo'
- attendees:
- type: array
- items:
- $ref: '#/components/schemas/IndividualEntry'
-
- AttendeeDeleteRequest:
- type: object
- properties:
- requestInfo:
- $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/subhashini_devguide_changes/core-services/docs/common-contract.yml#/definitions/RequestInfo'
- attendees:
- type: array
- items:
- allOf:
- - $ref: '#/components/schemas/IndividualEntry'
- - required:
- - registerId
- - individualId
- - denrollmentDate
- - tenantId
-
- AttendeeDeleteResponse:
- type: object
- properties:
- responseInfo:
- $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/subhashini_devguide_changes/core-services/docs/common-contract.yml#/definitions/ResponseInfo'
- attendees:
- type: array
- items:
- $ref: '#/components/schemas/IndividualEntry'
-
- StaffPermission:
- type: object
- properties:
- id:
- type: string
- format: uuid
- description: System generated unique identifier for the granted permission request
- readOnly: true
- registerId:
- type: string
- description: Identifier of the register. This field will not be shown when this object is part of the register object. It is present so that we can reuse this object for access permission requests.
- userId:
- type: string
- description: Identifier of the user of the system
- tenantId:
- type: string
- format: string
- example: pb.amritsar
- description: Tenant Id to which the staff belongs
- enrollmentDate:
- readOnly: true
- type: number
- description: The timestamp at which the permission is granted. It is set to the current time when the create api is called.
- denrollmentDate:
- readOnly: true
- type: number
- description: The timestamp at which the access permission is revoked. It is set to the current time when the delete api is called.
- required:
- - registerId
- - userId
-
- StaffPermissionRequest:
- type: object
- properties:
- requestInfo:
- $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/subhashini_devguide_changes/core-services/docs/common-contract.yml#/definitions/RequestInfo'
- staff:
- type: array
- items:
- allOf:
- - $ref: '#/components/schemas/StaffPermission'
- - required:
- - registerId
- - userId
- - tenantId
-
- StaffPermissionResponse:
- type: object
- properties:
- responseInfo:
- $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/subhashini_devguide_changes/core-services/docs/common-contract.yml#/definitions/ResponseInfo'
- staff:
- type: array
- items:
- $ref: '#/components/schemas/StaffPermission'
-
- AttendanceLog:
- type: object
- properties:
- id:
- type: string
- format: uuid
- description: System generated unique identifier for the entry
- readOnly: true
- registerId:
- type: string
- description: Unique identifier of the register
- individualId:
- type: string
- format: uuid
- description: The individual for which the attendance is being marked
- tenantId:
- type: string
- example: pb.amritsar
- description: Tenant Id of the register
- time:
- type: number
- format: timestamp
- description: The timestamp at which the event has been recorded.
- type:
- type: string
- description: Configurable in MDMS. [ENTRY/EXIT/...]
- status:
- type: string
- enum:
- - ACTIVE
- - INACTIVE
- description: The attendance log of the cancelled event can be marked as inactive.
- documentIds:
- description: Used to store file store ids. Need to verify validity of them using file store service.
- type: array
- items:
- $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/master/core-services/docs/common-contract.yml#/components/schemas/Document'
- additionalDetails:
- type: object
- required:
- - registerId
- - individualId
- - tenantId
- - time
- - type
-
- AttendanceLogRequest:
- type: object
- properties:
- requestInfo:
- $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/subhashini_devguide_changes/core-services/docs/common-contract.yml#/definitions/RequestInfo'
- attendance:
- type: array
- items:
- $ref: '#/components/schemas/AttendanceLog'
-
- AttendanceLogResponse:
- type: object
- properties:
- responseInfo:
- $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/subhashini_devguide_changes/core-services/docs/common-contract.yml#/definitions/ResponseInfo'
- attendance:
- type: array
- items:
- $ref: '#/components/schemas/AttendanceLog'
-
- RequestInfoWrapper:
- type: object
- properties:
- requestInfo:
- $ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-OSS/subhashini_devguide_changes/core-services/docs/common-contract.yml#/definitions/RequestInfo'
\ No newline at end of file
diff --git a/core-services/attendance/CHANGELOG.md b/core-services/attendance/CHANGELOG.md
deleted file mode 100644
index e5a50979d1d..00000000000
--- a/core-services/attendance/CHANGELOG.md
+++ /dev/null
@@ -1,6 +0,0 @@
-
-All notable changes to this module will be documented in this file.
-
-## 0.1.0 - 2023-04-17
-
-- Base version
\ No newline at end of file
diff --git a/core-services/attendance/LOCALSETUP.md b/core-services/attendance/LOCALSETUP.md
deleted file mode 100644
index dbbd2382297..00000000000
--- a/core-services/attendance/LOCALSETUP.md
+++ /dev/null
@@ -1,42 +0,0 @@
-# Local Setup
-
-To set up the muster roll service in your local system, clone the git repo(https://github.com/egovernments/DIGIT-Works).
-
-## Dependencies
-
-- MDMS
-- IDGen
-- Workflow service
-- Individual
-
-
-### Infra Dependency
-
-- [X] Postgres DB
-- [ ] Redis
-- [ ] Elasticsearch (needed if there is indexer
-- [X] Kafka
-
-## Running Locally
-
-To run the service locally, you need to port forward below services.
-
-```bash
-function kgpt(){kubectl get pods -n egov --selector=app=$1 --no-headers=true | head -n1 | awk '{print $1}'}
-
-kubectl port-forward -n egov $(kgpt egov-user) 8085:8080
-kubectl port-forward -n egov $(kgpt egov-idgen) 8086:8080
-kubectl port-forward -n egov $(kgpt egov-mdms-service) 8087:8080
-kubectl port-forward -n egov $(kgpt egov-workflow) 8088:8080
-kubectl port-forward -n works $(kgpt project-management-service) 8089:8080
-```
-
-Update below listed properties in `application.properties` before running the project:
-
-```ini
-egov.idgen.hostname = http://127.0.0.1:8086
-
-# can use non port forwarded environment host as well
-egov.mdms.host = http://127.0.0.1:8087
-egov.workflow.host = http://127.0.0.1:8088
-```
diff --git a/core-services/attendance/README.md b/core-services/attendance/README.md
deleted file mode 100644
index c8866f16367..00000000000
--- a/core-services/attendance/README.md
+++ /dev/null
@@ -1,29 +0,0 @@
-# Attendance Service
-
-The attendance service provides generic attendance logging functionality based on "in" and "out" timestamps.
-IN and OUT timestamps are recorded per individual. Aggregating and calculating attendance based on these timestamps
-is the function of the muster roll service.
-
-
-### Service Dependencies
-
-- DIGIT backbone services
-- Individual
-- MDMS
-- ID-GEN
-- Persister
-- Indexer
-
-## Service Details
-
-- Allows creation/updation/search of an attendance register
-- Allows mapping of staff and attendees to a register and enforces permissions.
-- Logs entry and exit timestamps in epoch time for a referenced entity
-
-### API Specs
-
-https://raw.githubusercontent.com/egovernments/DIGIT-Specs/master/Domain%20Services/Works/Attendance-Service-v1.0.0.yaml
-
-### Postman Collection
-
-https://raw.githubusercontent.com/egovernments/DIGIT-Works/master/backend/attendance/Attendace%20Service%20Postman%20Scripts.postman_collection.json
\ No newline at end of file
diff --git a/core-services/attendance/pom.xml b/core-services/attendance/pom.xml
deleted file mode 100644
index 54eda57fa8f..00000000000
--- a/core-services/attendance/pom.xml
+++ /dev/null
@@ -1,135 +0,0 @@
-
- 4.0.0
- org.egov
- attendance
- jar
- attendance
- 0.2.0
-
- 1.8
- ${java.version}
- ${java.version}
- 42.4.1
- 2.17.1
-
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.2.13.RELEASE
-
-
- src/main/java
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
- repackage
-
-
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
- org.springframework.boot
- spring-boot-starter-jdbc
-
-
- org.springframework.boot
- spring-boot-starter-actuator
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
- io.swagger
- swagger-core
- 1.5.18
-
-
-
- org.egov.services
- tracer
- 2.0.0-SNAPSHOT
-
-
- org.egov.services
- services-common
- 1.1.1-SNAPSHOT
-
-
- org.egov.services
- digit-models
- 1.0.0-SNAPSHOT
-
-
- org.egov.common
- health-services-models
- 1.0.6-SNAPSHOT
- compile
-
-
- org.egov
- mdms-client
- 0.0.4-SNAPSHOT
-
-
- org.postgresql
- postgresql
-
-
- org.jsoup
- jsoup
- 1.15.3
-
-
- org.flywaydb
- flyway-core
-
-
-
- org.projectlombok
- lombok
- true
-
-
-
- com.fasterxml.jackson.datatype
- jackson-datatype-jsr310
-
-
-
- javax.validation
- validation-api
-
-
-
-
- repo.digit.org
- eGov ERP Releases Repository
- https://nexus-repo.digit.org/nexus/content/repositories/releases/
-
-
- repo.digit.org.snapshots
- eGov ERP Releases Repository
- https://nexus-repo.digit.org/nexus/content/repositories/snapshots/
-
-
- repo.digit.org.public
- eGov Public Repository Group
- https://nexus-repo.digit.org/nexus/content/groups/public/
-
-
-
diff --git a/core-services/attendance/postman-test-suite-Attendace-service.json b/core-services/attendance/postman-test-suite-Attendace-service.json
deleted file mode 100644
index d64786c344c..00000000000
--- a/core-services/attendance/postman-test-suite-Attendace-service.json
+++ /dev/null
@@ -1,3796 +0,0 @@
-{
- "info": {
- "_postman_id": "25632b98-5918-4908-8a85-9500d8a81afa",
- "name": "Attendace Service Postman Scripts",
- "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
- },
- "item": [
- {
- "name": "Attendance Register",
- "item": [
- {
- "name": "Create Attendance Register - Success - Single Register",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Attendance Registers are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendanceRegister).to.not.be.undefined;",
- " pm.expect(req.attendanceRegister).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var register = req.attendanceRegister[0];",
- " pm.expect(register.tenantId).to.be.not.null;",
- " pm.expect(register.tenantId).to.be.not.undefined;",
- " pm.expect(register.tenantId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Register Name is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var register = req.attendanceRegister[0];",
- " pm.expect(register.name).to.be.not.null;",
- " pm.expect(register.name).to.be.not.undefined;",
- " pm.expect(register.name).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Register start date is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var register = req.attendanceRegister[0];",
- " pm.expect(register.startDate).to.be.not.null;",
- " pm.expect(register.startDate).to.be.not.undefined;",
- " pm.expect(register.startDate).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Start date should be less than end date\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var register = req.attendanceRegister[0];",
- " if (Number.isFinite(register.endDate) && (register.endDate != undefined || register.endDate != null )) {",
- " pm.expect(register.endDate).to.be.not.below(register.startDate);",
- " }",
- " }",
- ");",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Register Number is enriched\", function () {",
- " var res = pm.response.json();",
- " var registerNumber = res.attendanceRegister[0].registerNumber;",
- " pm.expect(registerNumber.substring(0,2)).to.eql(\"WR\");",
- " }",
- ");",
- "",
- "pm.test(\"Register status is set to Active if status not passed\", function () {",
- " var res = pm.response.json();",
- " var status = res.attendanceRegister[0].status;",
- " pm.expect(status).to.eql(\"ACTIVE\");",
- " }",
- ");",
- "",
- "pm.test(\"Staff is created for register\", function () {",
- " var res = pm.response.json();",
- " var staff = res.attendanceRegister[0].staff;",
- " pm.expect(staff).to.be.not.null;",
- " pm.expect(staff).to.be.not.undefined;",
- " pm.expect(staff.length).to.eql(1);",
- " }",
- ");",
- "",
- "pm.test(\"Staff created have same userId as UUID of user\", function () {",
- " var res = pm.response.json();",
- " var userInRequest = res.attendanceRegister[0].auditDetails.createdBy;",
- " var staff = res.attendanceRegister[0].staff;",
- " pm.expect(staff[0].userId).to.eql(userInRequest);",
- " }",
- ");",
- "",
- "let responseData = pm.response.json();",
- "pm.collectionVariables.set(\"tenantId\", responseData.attendanceRegister[0].tenantId);",
- "pm.collectionVariables.set(\"stateLevelTenant\", responseData.attendanceRegister[0].tenantId.split('.', 1)[0]);",
- "pm.collectionVariables.set(\"registerId\", responseData.attendanceRegister[0].id);",
- "pm.collectionVariables.set(\"registerNumber\", responseData.attendanceRegister[0].registerNumber);",
- "",
- "pm.collectionVariables.set(\"registerStartDate\", responseData.attendanceRegister[0].startDate);",
- "pm.collectionVariables.set(\"registerEndDate\", responseData.attendanceRegister[0].endDate);",
- "pm.collectionVariables.set(\"invalidRegisterEndDate\", responseData.attendanceRegister[0].endDate+24*60*60*1000);"
- ],
- "type": "text/javascript"
- }
- },
- {
- "listen": "prerequest",
- "script": {
- "exec": [
- "pm.collectionVariables.set(\"tenantId\", \"pb.amritsar\");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"tenantId\": \"{{tenantId}}\",\n \"name\": \"TestRegister_01\",\n \"startDate\": 1640995200000,\n \"endDate\": 1703980800000\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Create Attendance Register - Success - Multiple Registers",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"UserInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo.userInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo.userInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"UUID is required in UserInfo\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo.userInfo.uuid).to.not.be.null;",
- " pm.expect(req.RequestInfo.userInfo.uuid).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Attendance Registers are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendanceRegister).to.not.be.undefined;",
- " pm.expect(req.attendanceRegister).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendanceRegister.forEach(register => {",
- " pm.expect(register.tenantId).to.be.not.null;",
- " pm.expect(register.tenantId).to.be.not.undefined;",
- " pm.expect(register.tenantId).not.to.eql(\"\");",
- " });",
- " }",
- ");",
- "",
- "pm.test(\"Register Name is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendanceRegister.forEach(register => {",
- " pm.expect(register.name).to.be.not.null;",
- " pm.expect(register.name).to.be.not.undefined;",
- " pm.expect(register.name).not.to.eql(\"\");",
- " });",
- " }",
- ");",
- "",
- "pm.test(\"Register start date is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendanceRegister.forEach(register => {",
- " pm.expect(register.startDate).to.be.not.null;",
- " pm.expect(register.startDate).to.be.not.undefined;",
- " pm.expect(register.startDate).not.to.eql(\"\");",
- " });",
- " }",
- ");",
- " ",
- "",
- "pm.test(\"Start date should be less than end date\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendanceRegister.forEach(register => {",
- " if (Number.isFinite(register.endDate) && (register.endDate != undefined || register.endDate != null )) {",
- " pm.expect(register.endDate).to.be.not.below(register.startDate);",
- " }",
- " });",
- " }",
- ");",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Register Number is enriched\", function () {",
- " var res = pm.response.json();",
- " res.attendanceRegister.forEach(register => {",
- " var registerNumber = register.registerNumber;",
- " pm.expect(registerNumber.substring(0,2)).to.eql(\"WR\");",
- " });",
- " }",
- ");",
- "",
- "pm.test(\"Staff is created for register\", function () {",
- " var res = pm.response.json();",
- " res.attendanceRegister.forEach(register => {",
- " var staff = register.staff;",
- " pm.expect(staff).to.be.not.null;",
- " pm.expect(staff).to.be.not.undefined;",
- " pm.expect(staff.length).to.eql(1);",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Staff created have same userId as UUID of user\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var res = pm.response.json();",
- " res.attendanceRegister.forEach(register => {",
- " var userInRequest = register.auditDetails.createdBy;",
- " var staff =register.staff;",
- " pm.expect(staff[0].userId).to.eql(userInRequest);",
- " }); ",
- " }",
- ");",
- "",
- "let responseData = pm.response.json();",
- "pm.collectionVariables.set(\"registerId2\", responseData.attendanceRegister[1].id);"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"tenantId\": \"{{tenantId}}\",\n \"name\": \"TestRegister_01\",\n \"startDate\": 1640995200000,\n \"endDate\": 1703980800000\n },\n {\n \"tenantId\": \"{{tenantId}}\",\n \"name\": \"TestRegister_02\",\n \"startDate\": 1640995200000,\n \"additionalDetails\": {}\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Create Attendance Register - Validation Error - Registers not provided",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Correct Error with message and code is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " var message = res.Errors[0].message;",
- " pm.expect(code).to.eql(\"ATTENDANCE_REGISTER\");",
- " pm.expect(message).to.eql(\"Attendance Register is mandatory\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": []\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Create Attendance Register - Validation Error - TenantId not provided",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Correct Error with message and code is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " var message = res.Errors[0].message;",
- " pm.expect(code).to.eql(\"TENANT_ID\");",
- " pm.expect(message).to.eql(\"Tenant is mandatory\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"name\": \"TestRegister_01\",\n \"startDate\": 1640995200000,\n \"endDate\": 1703980800000\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Create Attendance Register - Validation Error - Name not provided",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Correct Error with message and code is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " var message = res.Errors[0].message;",
- " pm.expect(code).to.eql(\"NAME\");",
- " pm.expect(message).to.eql(\"Name is mandatory\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"tenantId\": \"{{tenantId}}\",\n \"startDate\": 1640995200000,\n \"endDate\": 1703980800000\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Create Attendance Register - Validation Error - Start Date not provided",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Correct Error with message and code is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " var message = res.Errors[0].message;",
- " pm.expect(code).to.eql(\"START_DATE\");",
- " pm.expect(message).to.eql(\"Start date is mandatory\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"tenantId\": \"{{tenantId}}\",\n \"name\": \"TestRegister_01\",\n \"endDate\": 1703980800000\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Create Attendance Register - Validation Error - Start Date greater than End Date",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Correct Error with message and code is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " var message = res.Errors[0].message;",
- " pm.expect(code).to.eql(\"DATE\");",
- " pm.expect(message).to.eql(\"Start date should be less than end date\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"tenantId\": \"{{tenantId}}\",\n \"name\": \"TestRegister_01\",\n \"startDate\": 1803980800000,\n \"endDate\": 1703980800000\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Create Attendance Register - Validation Error - Start Date Equal to 0",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Correct Error with message and code is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " var message = res.Errors[0].message;",
- " pm.expect(code).to.eql(\"START_DATE\");",
- " pm.expect(message).to.eql(\"Start date is mandatory\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"tenantId\": \"{{tenantId}}\",\n \"name\": \"TestRegister_01\",\n \"startDate\": 0,\n \"endDate\": 1703980800000\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Search Attendance Register - Success",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200)));",
- "",
- "pm.test(\"Register Search response is received\", function () {",
- " var res = pm.response.json();",
- " var id = res.attendanceRegister[0].id;",
- " pm.expect(id).to.eql(pm.collectionVariables.get(\"registerId\"));",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- },
- {
- "listen": "prerequest",
- "script": {
- "exec": [
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"action\": \"\",\n \"did\": 1,\n \"key\": \"\",\n \"msgId\": \"20170310130900|en_IN\",\n \"requesterId\": \"\",\n \"ts\": 1513579888683,\n \"ver\": \".01\",\n \"authToken\": \"{{token}}\"\n }\n}\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_search?tenantId={{tenantId}}&ids={{registerId}}",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_search"
- ],
- "query": [
- {
- "key": "tenantId",
- "value": "{{tenantId}}"
- },
- {
- "key": "ids",
- "value": "{{registerId}}"
- }
- ]
- }
- },
- "response": []
- },
- {
- "name": "Search Attendance Register - Success - State level tenant",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200)));",
- "",
- "pm.test(\"Register Search response is received\", function () {",
- " var res = pm.response.json();",
- " var id = res.attendanceRegister[0].id;",
- " pm.expect(id).to.eql(pm.collectionVariables.get(\"registerId\"));",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"action\": \"\",\n \"did\": 1,\n \"key\": \"\",\n \"msgId\": \"20170310130900|en_IN\",\n \"requesterId\": \"\",\n \"ts\": 1513579888683,\n \"ver\": \".01\",\n \"authToken\": \"{{token}}\"\n }\n}\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_search?tenantId={{stateLevelTenant}}&ids={{registerId}}",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_search"
- ],
- "query": [
- {
- "key": "tenantId",
- "value": "{{stateLevelTenant}}"
- },
- {
- "key": "ids",
- "value": "{{registerId}}"
- }
- ]
- }
- },
- "response": []
- },
- {
- "name": "Search Attendance Register - Success - Unassociated AttendeeId",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200)));",
- "",
- "pm.test(\"Register Search response is received\", function () {",
- " var res = pm.response.json();",
- " pm.expect(res.attendanceRegister.length).to.equal(0);",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"action\": \"\",\n \"did\": 1,\n \"key\": \"\",\n \"msgId\": \"20170310130900|en_IN\",\n \"requesterId\": \"\",\n \"ts\": 1513579888683,\n \"ver\": \".01\",\n \"authToken\": \"\",\n \"userInfo\": {\n \"id\": 1,\n \"uuid\": \"11b0e02b-0145-4de2-bc42-c97b96264807\",\n \"userName\": \"\",\n \"name\": \"\",\n \"mobileNumber\": \"\",\n \"emailId\": \"\",\n \"type\": \"\",\n \"roles\": [\n {\n \"code\": \"ORG_ADMIN\",\n \"name\": \"Organization admin\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"code\": \"ORG_STAFF\",\n \"name\": \"Organization staff\",\n \"tenantId\": \"pb.amritsar\"\n }\n ],\n \"active\": true,\n \"tenantId\": \"pb.amritsar\"\n }\n }\n}\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_search?tenantId={{tenantId}}&ids={{registerId}}&attendeeId={{$guid}}",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_search"
- ],
- "query": [
- {
- "key": "tenantId",
- "value": "{{tenantId}}"
- },
- {
- "key": "ids",
- "value": "{{registerId}}"
- },
- {
- "key": "attendeeId",
- "value": "{{$guid}}"
- }
- ]
- }
- },
- "response": []
- },
- {
- "name": "Search Attendance Register - Success - Unassociated StaffId",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200)));",
- "",
- "pm.test(\"Register Search response is received\", function () {",
- " var res = pm.response.json();",
- " pm.expect(res.attendanceRegister.length).to.equal(0);",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"action\": \"\",\n \"did\": 1,\n \"key\": \"\",\n \"msgId\": \"20170310130900|en_IN\",\n \"requesterId\": \"\",\n \"ts\": 1513579888683,\n \"ver\": \".01\",\n \"authToken\": \"\",\n \"userInfo\": {\n \"id\": 1,\n \"uuid\": \"11b0e02b-0145-4de2-bc42-c97b96264807\",\n \"userName\": \"\",\n \"name\": \"\",\n \"mobileNumber\": \"\",\n \"emailId\": \"\",\n \"type\": \"\",\n \"roles\": [\n {\n \"code\": \"ORG_ADMIN\",\n \"name\": \"Organization admin\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"code\": \"ORG_STAFF\",\n \"name\": \"Organization staff\",\n \"tenantId\": \"pb.amritsar\"\n }\n ],\n \"active\": true,\n \"tenantId\": \"pb.amritsar\"\n }\n }\n}\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_search?tenantId={{tenantId}}&ids={{registerId}}&staffId={{$guid}}",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_search"
- ],
- "query": [
- {
- "key": "tenantId",
- "value": "{{tenantId}}"
- },
- {
- "key": "ids",
- "value": "{{registerId}}"
- },
- {
- "key": "staffId",
- "value": "{{$guid}}"
- }
- ]
- }
- },
- "response": []
- },
- {
- "name": "Search Attendance Register - Success - User not associated with any register - empty response array",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200)));",
- "",
- "pm.test(\"User not associated with any register\", function () {",
- " var res = pm.response.json();",
- " pm.expect(res.attendanceRegister.length).to.equal(0);",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"action\": \"\",\n \"did\": 1,\n \"key\": \"\",\n \"msgId\": \"20170310130900|en_IN\",\n \"requesterId\": \"\",\n \"ts\": 1513579888683,\n \"ver\": \".01\",\n \"authToken\": \"\",\n \"userInfo\": {\n \"id\": 1,\n \"uuid\": \"{{$guid}}\",\n \"userName\": \"\",\n \"name\": \"\",\n \"mobileNumber\": \"\",\n \"emailId\": \"\",\n \"type\": \"\",\n \"roles\": [\n {\n \"code\": \"ORG_ADMIN\",\n \"name\": \"Organization admin\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"code\": \"ORG_STAFF\",\n \"name\": \"Organization staff\",\n \"tenantId\": \"pb.amritsar\"\n }\n ],\n \"active\": true,\n \"tenantId\": \"pb.amritsar\"\n }\n }\n}\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_search?tenantId={{tenantId}}",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_search"
- ],
- "query": [
- {
- "key": "tenantId",
- "value": "{{tenantId}}"
- }
- ]
- }
- },
- "response": []
- },
- {
- "name": "Search Attendance Register - Success - SuperUser - Non existing RegisterID",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200)));",
- "",
- "pm.test(\"Register Search response is received\", function () {",
- " var res = pm.response.json();",
- " pm.expect(res.attendanceRegister.length).to.equal(0);",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"action\": \"\",\n \"did\": 1,\n \"key\": \"\",\n \"msgId\": \"20170310130900|en_IN\",\n \"requesterId\": \"\",\n \"ts\": 1513579888683,\n \"ver\": \".01\",\n \"authToken\": \"\",\n \"userInfo\": {\n \"id\": 1,\n \"uuid\": \"11b0e02b-0145-4de2-bc42-c97b96264807\",\n \"userName\": \"\",\n \"name\": \"\",\n \"mobileNumber\": \"\",\n \"emailId\": \"\",\n \"type\": \"\",\n \"roles\": [\n {\n \"code\": \"SUPERUSER\",\n \"name\": \"Super User\",\n \"tenantId\": \"pb.amritsar\"\n }\n ],\n \"active\": true,\n \"tenantId\": \"pb.amritsar\"\n }\n }\n}\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_search?tenantId={{tenantId}}&ids={{$guid}}",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_search"
- ],
- "query": [
- {
- "key": "tenantId",
- "value": "{{tenantId}}"
- },
- {
- "key": "ids",
- "value": "{{$guid}}"
- }
- ]
- }
- },
- "response": []
- },
- {
- "name": "Search Attendance Register - Validation Error - Unassociated Register Id",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Register Search response is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " pm.expect(code).to.eql(\"INVALID_REGISTER_ID\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"action\": \"\",\n \"did\": 1,\n \"key\": \"\",\n \"msgId\": \"20170310130900|en_IN\",\n \"requesterId\": \"\",\n \"ts\": 1513579888683,\n \"ver\": \".01\",\n \"authToken\": \"\",\n \"userInfo\": {\n \"id\": 1,\n \"uuid\": \"11b0e02b-0145-4de2-bc42-c97b96264807\",\n \"userName\": \"\",\n \"name\": \"\",\n \"mobileNumber\": \"\",\n \"emailId\": \"\",\n \"type\": \"\",\n \"roles\": [\n {\n \"code\": \"ORG_ADMIN\",\n \"name\": \"Organization admin\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"code\": \"ORG_STAFF\",\n \"name\": \"Organization staff\",\n \"tenantId\": \"pb.amritsar\"\n }\n ],\n \"active\": true,\n \"tenantId\": \"pb.amritsar\"\n }\n }\n}\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_search?tenantId={{tenantId}}&ids={{$guid}}",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_search"
- ],
- "query": [
- {
- "key": "tenantId",
- "value": "{{tenantId}}"
- },
- {
- "key": "ids",
- "value": "{{$guid}}"
- }
- ]
- }
- },
- "response": []
- },
- {
- "name": "Search Attendance Register - Validation Error - Tenant Id not provided",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Correct Error with message and code is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " var message = res.Errors[0].message;",
- " pm.expect(code).to.eql(\"TENANT_ID\");",
- " pm.expect(message).to.eql(\"Tenant is mandatory\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"action\": \"\",\n \"did\": 1,\n \"key\": \"\",\n \"msgId\": \"20170310130900|en_IN\",\n \"requesterId\": \"\",\n \"ts\": 1513579888683,\n \"ver\": \".01\",\n \"authToken\": \"{{token}}\"\n }\n}\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_search?ids={{registerId}}",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_search"
- ],
- "query": [
- {
- "key": "ids",
- "value": "{{registerId}}"
- }
- ]
- }
- },
- "response": []
- },
- {
- "name": "Update Attendance Register - Success - Single Register",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"UserInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo.userInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo.userInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"UUID is required in UserInfo\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo.userInfo.uuid).to.not.be.null;",
- " pm.expect(req.RequestInfo.userInfo.uuid).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Attendance Registers are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendanceRegister).to.not.be.undefined;",
- " pm.expect(req.attendanceRegister).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var register = req.attendanceRegister[0];",
- " pm.expect(register.tenantId).to.be.not.null;",
- " pm.expect(register.tenantId).to.be.not.undefined;",
- " pm.expect(register.tenantId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Register Id is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var register = req.attendanceRegister[0];",
- " pm.expect(register.id).to.be.not.null;",
- " pm.expect(register.id).to.be.not.undefined;",
- " pm.expect(register.id).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Register Name is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var register = req.attendanceRegister[0];",
- " pm.expect(register.name).to.be.not.null;",
- " pm.expect(register.name).to.be.not.undefined;",
- " pm.expect(register.name).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Register start date is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var register = req.attendanceRegister[0];",
- " pm.expect(register.startDate).to.be.not.null;",
- " pm.expect(register.startDate).to.be.not.undefined;",
- " pm.expect(register.startDate).not.to.eql(\"\");",
- " }",
- ");",
- " ",
- "",
- "pm.test(\"Start date should be less than end date\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var register = req.attendanceRegister[0];",
- " if (Number.isFinite(register.endDate) && (register.endDate != undefined || register.endDate != null )) {",
- " pm.expect(register.endDate).to.be.not.below(register.startDate);",
- " }",
- " }",
- ");",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Staff is created for register\", function () {",
- " var res = pm.response.json();",
- " var staff = res.attendanceRegister[0].staff;",
- " pm.expect(staff).to.be.not.null;",
- " pm.expect(staff).to.be.not.undefined;",
- " pm.expect(staff.length).to.eql(1);",
- " }",
- ");",
- "",
- "pm.test(\"Staff created have same userId as UUID of user\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var userInRequest = req.RequestInfo.userInfo.uuid;",
- " var res = pm.response.json();",
- " var staff = res.attendanceRegister[0].staff;",
- " pm.expect(staff[0].userId).to.eql(userInRequest);",
- " }",
- ");",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"id\": \"{{registerId}}\",\n \"tenantId\": \"{{tenantId}}\",\n \"name\": \"TestRegister_010\",\n \"startDate\": 1640995200000,\n \"endDate\": 1703980800000,\n \"status\": \"ACTIVE\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_update",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_update"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Update Attendance Register - Success - Multiple Registers",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"UserInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo.userInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo.userInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"UUID is required in UserInfo\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo.userInfo.uuid).to.not.be.null;",
- " pm.expect(req.RequestInfo.userInfo.uuid).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Attendance Registers are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendanceRegister).to.not.be.undefined;",
- " pm.expect(req.attendanceRegister).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendanceRegister.forEach(register => {",
- " pm.expect(register.tenantId).to.be.not.null;",
- " pm.expect(register.tenantId).to.be.not.undefined;",
- " pm.expect(register.tenantId).not.to.eql(\"\");",
- " });",
- " }",
- ");",
- "",
- "pm.test(\"Register Id is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendanceRegister.forEach(register => {",
- " pm.expect(register.id).to.be.not.null;",
- " pm.expect(register.id).to.be.not.undefined;",
- " pm.expect(register.id).not.to.eql(\"\");",
- " });",
- " }",
- ");",
- "",
- "pm.test(\"Register Name is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendanceRegister.forEach(register => {",
- " pm.expect(register.name).to.be.not.null;",
- " pm.expect(register.name).to.be.not.undefined;",
- " pm.expect(register.name).not.to.eql(\"\");",
- " });",
- " }",
- ");",
- "",
- "pm.test(\"Register start date is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendanceRegister.forEach(register => {",
- " pm.expect(register.startDate).to.be.not.null;",
- " pm.expect(register.startDate).to.be.not.undefined;",
- " pm.expect(register.startDate).not.to.eql(\"\");",
- " });",
- " }",
- ");",
- " ",
- "",
- "pm.test(\"Start date should be less than end date\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendanceRegister.forEach(register => {",
- " if (Number.isFinite(register.endDate) && (register.endDate != undefined || register.endDate != null )) {",
- " pm.expect(register.endDate).to.be.not.below(register.startDate);",
- " }",
- " });",
- " }",
- ");",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Staff is created for register\", function () {",
- " var res = pm.response.json();",
- " res.attendanceRegister.forEach(register => {",
- " var staff = register.staff;",
- " pm.expect(staff).to.be.not.null;",
- " pm.expect(staff).to.be.not.undefined;",
- " pm.expect(staff.length).to.eql(1);",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Staff created have same userId as UUID of user\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var userInRequest = req.RequestInfo.userInfo.uuid;",
- " var res = pm.response.json();",
- " res.attendanceRegister.forEach(register => {",
- " var staff =register.staff;",
- " pm.expect(staff[0].userId).to.eql(userInRequest);",
- " }); ",
- " }",
- ");",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"id\": \"{{registerId}}\",\n \"tenantId\": \"{{tenantId}}\",\n \"name\": \"TestRegister_010\",\n \"startDate\": 1640995200000,\n \"endDate\": 1703980800000,\n \"status\": \"ACTIVE\"\n },\n {\n \"id\": \"{{registerId2}}\",\n \"tenantId\": \"{{tenantId}}\",\n \"name\": \"TestRegister_020\",\n \"startDate\": 1640995200000,\n \"endDate\": 1703980800000,\n \"status\": \"INACTIVE\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_update",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_update"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Update Attendance Register - Validation Error - Register Id not provided",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Correct Error with message and code is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " var message = res.Errors[0].message;",
- " pm.expect(code).to.eql(\"ATTENDANCE_REGISTER_ID\");",
- " pm.expect(message).to.eql(\"Attendance register id is mandatory\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"tenantId\": \"{{tenantId}}\",\n \"name\": \"TestRegister_010\",\n \"startDate\": 1640995200000,\n \"endDate\": 1703980800000,\n \"status\": \"ACTIVE\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_update",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_update"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Update Attendance Register - Validation Error - Tenant Id not provided",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Correct Error with message and code is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " var message = res.Errors[0].message;",
- " pm.expect(code).to.eql(\"TENANT_ID\");",
- " pm.expect(message).to.eql(\"Tenant is mandatory\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"id\": \"{{registerId}}\",\n \"name\": \"TestRegister_010\",\n \"startDate\": 1640995200000,\n \"endDate\": 1703980800000,\n \"status\": \"ACTIVE\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_update",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_update"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Update Attendance Register - Validation Error - Name not provided",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Correct Error with message and code is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " var message = res.Errors[0].message;",
- " pm.expect(code).to.eql(\"NAME\");",
- " pm.expect(message).to.eql(\"Name is mandatory\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"id\": \"{{registerId}}\",\n \"tenantId\": \"{{tenantId}}\",\n \"startDate\": 1640995200000,\n \"endDate\": 1703980800000,\n \"status\": \"ACTIVE\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_update",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_update"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Update Attendance Register - Validation Error - Start Date not provided",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Correct Error with message and code is received\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " var message = res.Errors[0].message;",
- " pm.expect(code).to.eql(\"START_DATE\");",
- " pm.expect(message).to.eql(\"Start date is mandatory\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Create Attendance Register\",\n \"authToken\": \"{{token}}\"\n },\n \"attendanceRegister\": [\n {\n \"id\": \"{{registerId}}\",\n \"tenantId\": \"{{tenantId}}\",\n \"name\": \"TestRegister_010\",\n \"endDate\": 1703980800000,\n \"status\": \"ACTIVE\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/v1/_update",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "v1",
- "_update"
- ]
- }
- },
- "response": []
- }
- ]
- },
- {
- "name": "Register Permission",
- "item": [
- {
- "name": "Staff - Enroll - Single Staff",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Staff are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.staff).to.not.be.undefined;",
- " pm.expect(req.staff).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.tenantId).to.be.not.null;",
- " pm.expect(staff.tenantId).to.be.not.undefined;",
- " pm.expect(staff.tenantId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Staff registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.registerId).to.be.not.null;",
- " pm.expect(staff.registerId).to.be.not.undefined;",
- " pm.expect(staff.registerId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Staff userId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.userId).to.be.not.null;",
- " pm.expect(staff.userId).to.be.not.undefined;",
- " pm.expect(staff.userId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Enrollment date is enriched\", function () {",
- " var res = pm.response.json();",
- " var enrollmentDate = res.staff[0].enrollmentDate;",
- " pm.expect(enrollmentDate).to.be.not.null;",
- " }",
- ");",
- "",
- "// let requestData = JSON.parse(pm.request.body.raw);",
- "// pm.collectionVariables.set(\"userId\", requestData.staff[0].userId);",
- "",
- "let responseData = pm.response.json();",
- "pm.collectionVariables.set(\"userId\", responseData.staff[0].userId);",
- "console.log(pm.collectionVariables.get(\"userId\"));",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"Enroll the user to register\",\n \"authToken\":\"{{token}}\"\n },\n \"staff\":[\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"{{$randomUUID}}\",\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/staff/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "staff",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Staff - Enroll - Validation Error - Staff already enrolled to the register",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Staff is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.staff).to.not.be.undefined;",
- " pm.expect(req.staff).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.tenantId).to.be.not.null;",
- " pm.expect(staff.tenantId).to.be.not.undefined;",
- " pm.expect(staff.tenantId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Staff registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.registerId).to.be.not.null;",
- " pm.expect(staff.registerId).to.be.not.undefined;",
- " pm.expect(staff.registerId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Staff userId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.userId).to.be.not.null;",
- " pm.expect(staff.userId).to.be.not.undefined;",
- " pm.expect(staff.userId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "",
- "pm.test(\"response is 400. Staff is already enrolled to the register\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- },
- {
- "listen": "prerequest",
- "script": {
- "exec": [
- "console.log(pm.collectionVariables.get(\"userId\"))"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"Enroll the user to register\",\n \"authToken\":\"{{token}}\"\n },\n \"staff\":[\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"{{userId}}\",\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/staff/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "staff",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Staff - Enroll - Validation Error - Duplicate staff objects not allowed in enrollment request",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Staff are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.staff).to.not.be.undefined;",
- " pm.expect(req.staff).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- "",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.tenantId).to.be.not.null;",
- " pm.expect(staff.tenantId).to.be.not.undefined;",
- " pm.expect(staff.tenantId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Staff registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.registerId).to.be.not.null;",
- " pm.expect(staff.registerId).to.be.not.undefined;",
- " pm.expect(staff.registerId).not.to.eql(\"\");",
- " }); ",
- "",
- " }",
- ");",
- "",
- "pm.test(\"Staff userId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.userId).to.be.not.null;",
- " pm.expect(staff.userId).to.be.not.undefined;",
- " pm.expect(staff.userId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is 400. Duplicate objects in request\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"Enroll the user to register\",\n \"authToken\":\"{{token}}\"\n },\n \"staff\":[\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"928ca23a-9bec-11ed-a8fc-0242ac120002\",\n \"tenantId\":\"{{tenantId}}\"\n },\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"928ca23a-9bec-11ed-a8fc-0242ac120002\",\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/staff/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "staff",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Staff - Enroll - Multiple staff",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Staff are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.staff).to.not.be.undefined;",
- " pm.expect(req.staff).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- "",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.tenantId).to.be.not.null;",
- " pm.expect(staff.tenantId).to.be.not.undefined;",
- " pm.expect(staff.tenantId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Staff registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.registerId).to.be.not.null;",
- " pm.expect(staff.registerId).to.be.not.undefined;",
- " pm.expect(staff.registerId).not.to.eql(\"\");",
- " }); ",
- "",
- " }",
- ");",
- "",
- "pm.test(\"Staff userId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.userId).to.be.not.null;",
- " pm.expect(staff.userId).to.be.not.undefined;",
- " pm.expect(staff.userId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Enrollment date is enriched\", function () {",
- " var res = pm.response.json();",
- " res.staff.forEach(staff => {",
- " pm.expect(staff.enrollmentDate).to.be.not.null;",
- " }); ",
- " }",
- ");",
- "",
- "let requestData = JSON.parse(pm.request.body.raw);",
- "pm.collectionVariables.set(\"userId-1\", requestData.staff[0].userId);",
- "pm.collectionVariables.set(\"userId-2\", requestData.staff[1].userId);",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"Enroll the user to register\",\n \"authToken\":\"{{token}}\"\n },\n \"staff\":[\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"{{$randomUUID}}\",\n \"tenantId\":\"{{tenantId}}\"\n },\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"{{$randomUUID}}\",\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/staff/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "staff",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Staff - Deenroll - Single staff",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Staff are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.staff).to.not.be.undefined;",
- " pm.expect(req.staff).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.tenantId).to.be.not.null;",
- " pm.expect(staff.tenantId).to.be.not.undefined;",
- " pm.expect(staff.tenantId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Staff registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.registerId).to.be.not.null;",
- " pm.expect(staff.registerId).to.be.not.undefined;",
- " pm.expect(staff.registerId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Staff userId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.userId).to.be.not.null;",
- " pm.expect(staff.userId).to.be.not.undefined;",
- " pm.expect(staff.userId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Deenrollment date is enriched\", function () {",
- " var res = pm.response.json();",
- " var deenrollmentDate = res.staff[0].deenrollmentDate;",
- " pm.expect(deenrollmentDate).to.be.not.null;",
- " }",
- ");",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"Deenroll staff from register\",\n \"authToken\":\"{{token}}\"\n },\n \"staff\":[\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"{{userId}}\",\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/staff/v1/_delete",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "staff",
- "v1",
- "_delete"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Staff - Deenroll - Validation Error - Staff already denrolled from the register",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Staff are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.staff).to.not.be.undefined;",
- " pm.expect(req.staff).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.tenantId).to.be.not.null;",
- " pm.expect(staff.tenantId).to.be.not.undefined;",
- " pm.expect(staff.tenantId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Staff registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.registerId).to.be.not.null;",
- " pm.expect(staff.registerId).to.be.not.undefined;",
- " pm.expect(staff.registerId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Staff userId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var staff = req.staff[0];",
- " pm.expect(staff.userId).to.be.not.null;",
- " pm.expect(staff.userId).to.be.not.undefined;",
- " pm.expect(staff.userId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is 400. Staff already deenrolled from the register\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"Deenroll staff from register\",\n \"authToken\":\"{{token}}\"\n },\n \"staff\":[\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"{{userId}}\",\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/staff/v1/_delete",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "staff",
- "v1",
- "_delete"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Staff - Deenroll - Validation Error - Duplicate staff objects in deenrollment request",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Staff are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.staff).to.not.be.undefined;",
- " pm.expect(req.staff).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- "",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.tenantId).to.be.not.null;",
- " pm.expect(staff.tenantId).to.be.not.undefined;",
- " pm.expect(staff.tenantId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Staff registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.registerId).to.be.not.null;",
- " pm.expect(staff.registerId).to.be.not.undefined;",
- " pm.expect(staff.registerId).not.to.eql(\"\");",
- " }); ",
- "",
- " }",
- ");",
- "",
- "pm.test(\"Staff userId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.userId).to.be.not.null;",
- " pm.expect(staff.userId).to.be.not.undefined;",
- " pm.expect(staff.userId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Response is 400. Duplicate staff objects in de enrollment request\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"Deenroll staff from register\",\n \"authToken\":\"{{token}}\"\n },\n \"staff\":[\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"{{userId-1}}\",\n \"tenantId\":\"{{tenantId}}\"\n },\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"{{userId-1}}\",\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/staff/v1/_delete",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "staff",
- "v1",
- "_delete"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Staff - Deenroll - Multiple staff",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Staff are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.staff).to.not.be.undefined;",
- " pm.expect(req.staff).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- "",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.tenantId).to.be.not.null;",
- " pm.expect(staff.tenantId).to.be.not.undefined;",
- " pm.expect(staff.tenantId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Staff registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.registerId).to.be.not.null;",
- " pm.expect(staff.registerId).to.be.not.undefined;",
- " pm.expect(staff.registerId).not.to.eql(\"\");",
- " }); ",
- "",
- " }",
- ");",
- "",
- "pm.test(\"Staff userId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.staff.forEach(staff => {",
- " pm.expect(staff.userId).to.be.not.null;",
- " pm.expect(staff.userId).to.be.not.undefined;",
- " pm.expect(staff.userId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Deenrollment date is enriched\", function () {",
- " var res = pm.response.json();",
- " res.staff.forEach(staff => {",
- " pm.expect(staff.deenrollmentDate).to.be.not.null;",
- " }); ",
- " }",
- ");",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"Deenroll staff from register\",\n \"authToken\":\"{{token}}\"\n },\n \"staff\":[\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"{{userId-1}}\",\n \"tenantId\":\"{{tenantId}}\"\n },\n {\n \"registerId\":\"{{registerId}}\",\n \"userId\":\"{{userId-2}}\",\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/staff/v1/_delete",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "staff",
- "v1",
- "_delete"
- ]
- }
- },
- "response": []
- }
- ]
- },
- {
- "name": "Individual Enrollment",
- "item": [
- {
- "name": "Attendee - Enroll - Attendee",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Attendee are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendees).to.not.be.undefined;",
- " pm.expect(req.attendees).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.tenantId).to.be.not.null;",
- " pm.expect(attendee.tenantId).to.be.not.undefined;",
- " pm.expect(attendee.tenantId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Attendee registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.registerId).to.be.not.null;",
- " pm.expect(attendee.registerId).to.be.not.undefined;",
- " pm.expect(attendee.registerId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Attendee individualId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.individualId).to.be.not.null;",
- " pm.expect(attendee.individualId).to.be.not.undefined;",
- " pm.expect(attendee.individualId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Enrollment date is enriched\", function () {",
- " var res = pm.response.json();",
- " var enrollmentDate = res.attendees[0].enrollmentDate;",
- " pm.expect(enrollmentDate).to.be.not.null;",
- " }",
- ");",
- "",
- "// let requestData = JSON.parse(pm.request.body.raw);",
- "// pm.collectionVariables.set(\"individualId\", requestData.attendees[0].individualId);",
- "let responseData = pm.response.json();",
- "pm.collectionVariables.set(\"individualId\", responseData.attendees[0].individualId);",
- "pm.collectionVariables.set(\"attendeeEnrollmentDate\", responseData.attendees[0].enrollmentDate);",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- },
- {
- "listen": "prerequest",
- "script": {
- "exec": [
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Enroll attendee to register\",\n \"authToken\":\"{{token}}\"\n },\n \"attendees\":[\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"{{$randomUUID}}\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n } \n\n ]\n\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/attendee/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "attendee",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendee - Enroll - Validation Error - Attendee already enrolled",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Attendee are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendees).to.not.be.undefined;",
- " pm.expect(req.attendees).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.tenantId).to.be.not.null;",
- " pm.expect(attendee.tenantId).to.be.not.undefined;",
- " pm.expect(attendee.tenantId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Attendee registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.registerId).to.be.not.null;",
- " pm.expect(attendee.registerId).to.be.not.undefined;",
- " pm.expect(attendee.registerId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Attendee individualId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.individualId).to.be.not.null;",
- " pm.expect(attendee.individualId).to.be.not.undefined;",
- " pm.expect(attendee.individualId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is 400. Attendee already enrolled to the register\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- },
- {
- "listen": "prerequest",
- "script": {
- "exec": [
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Enroll attendee to register\",\n \"authToken\":\"{{token}}\"\n },\n \"attendees\":[\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"{{individualId}}\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n } \n\n ]\n\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/attendee/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "attendee",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendee - Enroll - Validation Error - Duplicate attendee objects not allowed in request",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Attendee are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendees).to.not.be.undefined;",
- " pm.expect(req.attendees).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.tenantId).to.be.not.null;",
- " pm.expect(attendee.tenantId).to.be.not.undefined;",
- " pm.expect(attendee.tenantId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Attendee registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.registerId).to.be.not.null;",
- " pm.expect(attendee.registerId).to.be.not.undefined;",
- " pm.expect(attendee.registerId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Attendee individualId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.individualId).to.be.not.null;",
- " pm.expect(attendee.individualId).to.be.not.undefined;",
- " pm.expect(attendee.individualId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is 400. Duplicate attendee objects in the request\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Enroll attendee to register\",\n \"authToken\":\"{{token}}\"\n },\n \"attendees\":[\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"928ca23a-9bec-11ed-a8fc-0242ac120002\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n },\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"928ca23a-9bec-11ed-a8fc-0242ac120002\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n } \n\n ]\n\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/attendee/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "attendee",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendee - Enroll - Multiple Attendees",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Attendee are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendees).to.not.be.undefined;",
- " pm.expect(req.attendees).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.tenantId).to.be.not.null;",
- " pm.expect(attendee.tenantId).to.be.not.undefined;",
- " pm.expect(attendee.tenantId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Attendee registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.registerId).to.be.not.null;",
- " pm.expect(attendee.registerId).to.be.not.undefined;",
- " pm.expect(attendee.registerId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Attendee individualId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.individualId).to.be.not.null;",
- " pm.expect(attendee.individualId).to.be.not.undefined;",
- " pm.expect(attendee.individualId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Enrollment date is enriched\", function () {",
- " var res = pm.response.json();",
- " res.attendees.forEach(attendee => {",
- " pm.expect(attendee.enrollmentDate).to.be.not.null;",
- " }); ",
- " }",
- ");",
- "",
- "let requestData = JSON.parse(pm.request.body.raw);",
- "pm.collectionVariables.set(\"individualId-1\", requestData.attendees[0].individualId);",
- "pm.collectionVariables.set(\"individualId-2\", requestData.attendees[1].individualId);",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"mukta-services\",\n \"ver\": null,\n \"ts\": null,\n \"action\": null,\n \"did\": null,\n \"key\": null,\n \"msgId\": \"Enroll attendee to register\",\n \"authToken\":\"{{token}}\"\n },\n \"attendees\":[\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"{{$randomUUID}}\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n },\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"{{$randomUUID}}\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n } \n\n ]\n\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/attendee/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "attendee",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendee - Deenroll- Single Attendee",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Attendees are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendees).to.not.be.undefined;",
- " pm.expect(req.attendees).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.tenantId).to.be.not.null;",
- " pm.expect(attendee.tenantId).to.be.not.undefined;",
- " pm.expect(attendee.tenantId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Attendee registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.registerId).to.be.not.null;",
- " pm.expect(attendee.registerId).to.be.not.undefined;",
- " pm.expect(attendee.registerId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Attendee individualId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.individualId).to.be.not.null;",
- " pm.expect(attendee.individualId).to.be.not.undefined;",
- " pm.expect(attendee.individualId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Deenrollment date is enriched\", function () {",
- " var res = pm.response.json();",
- " var deenrollmentDate = res.attendees[0].deenrollmentDate;",
- " pm.expect(deenrollmentDate).to.be.not.null;",
- " }",
- ");",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"search with from and to values\",\n \"authToken\":\"{{token}}\"\n },\n \"attendees\":[\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"{{individualId}}\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/attendee/v1/_delete",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "attendee",
- "v1",
- "_delete"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendee - Deenroll- Validation Error - Attendee already deenrolled from the register",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Attendees are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendees).to.not.be.undefined;",
- " pm.expect(req.attendees).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.tenantId).to.be.not.null;",
- " pm.expect(attendee.tenantId).to.be.not.undefined;",
- " pm.expect(attendee.tenantId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Attendee registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.registerId).to.be.not.null;",
- " pm.expect(attendee.registerId).to.be.not.undefined;",
- " pm.expect(attendee.registerId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "pm.test(\"Attendee individualId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " var attendee = req.attendees[0];",
- " pm.expect(attendee.individualId).to.be.not.null;",
- " pm.expect(attendee.individualId).to.be.not.undefined;",
- " pm.expect(attendee.individualId).not.to.eql(\"\");",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is 400. Attendee already deenrolled from the register\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"search with from and to values\",\n \"authToken\":\"{{token}}\"\n },\n \"attendees\":[\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"{{individualId}}\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/attendee/v1/_delete",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "attendee",
- "v1",
- "_delete"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendee - Deenroll- Validation Error - Duplicate attendee objects in deenrollment request",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Attendees are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendees).to.not.be.undefined;",
- " pm.expect(req.attendees).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.tenantId).to.be.not.null;",
- " pm.expect(attendee.tenantId).to.be.not.undefined;",
- " pm.expect(attendee.tenantId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Attendee registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.registerId).to.be.not.null;",
- " pm.expect(attendee.registerId).to.be.not.undefined;",
- " pm.expect(attendee.registerId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Attendee individualId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.individualId).to.be.not.null;",
- " pm.expect(attendee.individualId).to.be.not.undefined;",
- " pm.expect(attendee.individualId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is 400. Duplicate attendee objects in deenrollment request.\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"search with from and to values\",\n \"authToken\":\"{{token}}\"\n },\n \"attendees\":[\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"{{individualId-1}}\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n },\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"{{individualId-1}}\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/attendee/v1/_delete",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "attendee",
- "v1",
- "_delete"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendee - Deenroll- Multiple Attendees",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"RequestInfo is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.RequestInfo).to.not.be.null;",
- " pm.expect(req.RequestInfo).to.not.be.undefined;",
- " }",
- ");",
- "",
- "pm.test(\"Attendees are required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " pm.expect(req.attendees).to.not.be.undefined;",
- " pm.expect(req.attendees).to.not.be.null;",
- " }",
- ");",
- "",
- "pm.test(\"TenantId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.tenantId).to.be.not.null;",
- " pm.expect(attendee.tenantId).to.be.not.undefined;",
- " pm.expect(attendee.tenantId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Attendee registerId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.registerId).to.be.not.null;",
- " pm.expect(attendee.registerId).to.be.not.undefined;",
- " pm.expect(attendee.registerId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "pm.test(\"Attendee individualId is required\", function () {",
- " var req = JSON.parse(pm.request.body.raw);",
- " req.attendees.forEach(attendee => {",
- " pm.expect(attendee.individualId).to.be.not.null;",
- " pm.expect(attendee.individualId).to.be.not.undefined;",
- " pm.expect(attendee.individualId).not.to.eql(\"\");",
- " }); ",
- " }",
- ");",
- "",
- "",
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Deenrollment date is enriched\", function () {",
- " var res = pm.response.json();",
- " res.attendees.forEach(attendee => {",
- " pm.expect(attendee.denrollmentDate).to.be.not.null;",
- " }); ",
- " }",
- ");",
- "",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"RequestInfo\":{\n \"apiId\":\"mukta-services\",\n \"ver\":null,\n \"ts\":null,\n \"action\":null,\n \"did\":null,\n \"key\":null,\n \"msgId\":\"search with from and to values\",\n \"authToken\":\"{{token}}\"\n },\n \"attendees\":[\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"{{individualId-1}}\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n },\n {\n \"registerId\": \"{{registerId}}\",\n \"individualId\": \"{{individualId-2}}\",\n \"enrollmentDate\":null,\n \"denrollmentDate\":null,\n \"tenantId\":\"{{tenantId}}\"\n }\n ]\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/attendee/v1/_delete",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "attendee",
- "v1",
- "_delete"
- ]
- }
- },
- "response": []
- }
- ]
- },
- {
- "name": "Attendance Log",
- "item": [
- {
- "name": "Attendance Log - Create - Success",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- " setTimeout( () => {",
- "",
- " pm.test(\"Attendance Log created successfully\", function () {",
- " var res = pm.response.json();",
- " var id = res.attendance[0].id;",
- " pm.expect(id).to.be.not.null;",
- " }",
- ");",
- " ",
- " }, 1000);",
- "",
- "",
- "",
- "let responseData = pm.response.json();",
- "pm.collectionVariables.set(\"attendanceLogId\", responseData.attendance[0].id);"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n },\r\n \"attendance\": [\r\n {\r\n \"registerId\": \"{{registerId}}\",\r\n \"individualId\": \"{{individualId}}\",\r\n \"time\": {{attendeeEnrollmentDate}},\r\n \"type\": \"ENTRY\",\r\n \"status\": \"ACTIVE\",\r\n \"tenantId\": \"{{tenantId}}\",\r\n \"documentIds\":[\r\n {\r\n \"documentType\": \"documentType\",\r\n \"fileStore\": \"fileStore\",\r\n \"documentUid\": \"documentUid\"\r\n }\r\n \r\n ]\r\n }\r\n ]\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendance Log - Update - Success",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Attendance Log updated successfully\", function () {",
- " var res = pm.response.json();",
- " var status = res.attendance[0].status;",
- " pm.expect(status).to.eql(\"INACTIVE\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n },\r\n \"attendance\": [\r\n {\r\n \"id\": \"{{attendanceLogId}}\",\r\n \"registerId\": \"{{registerId}}\",\r\n \"individualId\": \"{{individualId}}\",\r\n \"time\": {{attendeeEnrollmentDate}},\r\n \"type\": \"ENTRY\",\r\n \"status\": \"INACTIVE\",\r\n \"tenantId\": \"{{tenantId}}\",\r\n \"documentIds\":[\r\n {\r\n \"documentType\": \"documentType\",\r\n \"fileStore\": \"fileStore\",\r\n \"documentUid\": \"documentUid\"\r\n }\r\n \r\n ],\r\n \"auditDetails\": {\r\n \"createdBy\": \"47b5ea82-249c-4435-9646-16167fec06df\",\r\n \"lastModifiedBy\": \"47b5ea82-249c-4435-9646-16167fec06df\",\r\n \"createdTime\": 1671090269007,\r\n \"lastModifiedTime\": 1671090269007\r\n }\r\n \r\n }\r\n ]\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_update",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_update"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendance Log - Update - fail - attendanceId is not valid",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "pm.test(\"Attendance Log updated successfully\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " pm.expect(code).to.eql(\"ATTENDANCE_LOG\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n },\r\n \"attendance\": [\r\n {\r\n \"id\": \"{{$randomUUID}}\",\r\n \"registerId\": \"{{registerId}}\",\r\n \"individualId\": \"{{individualId}}\",\r\n \"time\": {{attendeeEnrollmentDate}},\r\n \"type\": \"ENTRY\",\r\n \"status\": \"INACTIVE\",\r\n \"tenantId\": \"{{tenantId}}\",\r\n \"documentIds\":[\r\n {\r\n \"documentType\": \"documentType\",\r\n \"fileStore\": \"fileStore\",\r\n \"documentUid\": \"documentUid\"\r\n }\r\n \r\n ],\r\n \"auditDetails\": {\r\n \"createdBy\": \"47b5ea82-249c-4435-9646-16167fec06df\",\r\n \"lastModifiedBy\": \"47b5ea82-249c-4435-9646-16167fec06df\",\r\n \"createdTime\": 1671090269007,\r\n \"lastModifiedTime\": 1671090269007\r\n }\r\n \r\n }\r\n ]\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_update",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_update"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendance Log - Create - Fail - All logs should belong to same tenantId",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "pm.test(\"Attendance Log created successfully\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " pm.expect(code).to.eql(\"MULTIPLE_TENANTIDS\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n },\r\n \"attendance\": [\r\n {\r\n \"registerId\": \"{{registerId}}\",\r\n \"individualId\": \"{{individualId}}\",\r\n \"time\": {{attendeeEnrollmentDate}},\r\n \"type\": \"ENTRY\",\r\n \"status\": \"ACTIVE\",\r\n \"tenantId\": \"{{tenantId}}\",\r\n \"documentIds\":[\r\n {\r\n \"documentType\": \"documentType\",\r\n \"fileStore\": \"fileStore\",\r\n \"documentUid\": \"documentUid\"\r\n }\r\n \r\n ]\r\n },\r\n {\r\n \"registerId\": \"{{registerId}}\",\r\n \"individualId\": \"{{individualId}}\",\r\n \"time\": {{attendeeEnrollmentDate}},\r\n \"type\": \"ENTRY\",\r\n \"status\": \"ACTIVE\",\r\n \"tenantId\": \"tenant.id\",\r\n \"documentIds\":[\r\n {\r\n \"documentType\": \"documentType\",\r\n \"fileStore\": \"fileStore\",\r\n \"documentUid\": \"documentUid\"\r\n }\r\n \r\n ]\r\n }\r\n ]\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendance Log - Create - Fail - Validate Attendance Log time",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "pm.test(\"Attendance Log created successfully\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " pm.expect(code).to.eql(\"INVALID_ATTENDANCE_TIME\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n },\r\n \"attendance\": [\r\n {\r\n \"registerId\": \"{{registerId}}\",\r\n \"individualId\": \"{{individualId}}\",\r\n \"time\": {{invalidRegisterEndDate}},\r\n \"type\": \"ENTRY\",\r\n \"status\": \"ACTIVE\",\r\n \"tenantId\": \"{{tenantId}}\",\r\n \"documentIds\":[\r\n {\r\n \"documentType\": \"documentType\",\r\n \"fileStore\": \"fileStore\",\r\n \"documentUid\": \"documentUid\"\r\n }\r\n \r\n ]\r\n }\r\n ]\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendance Log - Create - Fail - Register should belongs to tenenatId",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "pm.test(\"Attendance Log created successfully\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " pm.expect(code).to.eql(\"INVALID_TENANTID\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n },\r\n \"attendance\": [\r\n {\r\n \"registerId\": \"{{registerId}}\",\r\n \"individualId\": \"{{individualId}}\",\r\n \"time\": {{attendeeEnrollmentDate}},\r\n \"type\": \"ENTRY\",\r\n \"status\": \"ACTIVE\",\r\n \"tenantId\": \"tenant.Id\",\r\n \"documentIds\":[\r\n {\r\n \"documentType\": \"documentType\",\r\n \"fileStore\": \"fileStore\",\r\n \"documentUid\": \"documentUid\"\r\n }\r\n \r\n ]\r\n }\r\n ]\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendance Log - Create - Fail - All logs should belong to same registerId",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "pm.test(\"Attendance Log created successfully\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " pm.expect(code).to.eql(\"MULTIPLE_REGISTERIDS\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n },\r\n \"attendance\": [\r\n {\r\n \"registerId\": \"{{registerId}}\",\r\n \"individualId\": \"{{individualId}}\",\r\n \"time\": {{attendeeEnrollmentDate}},\r\n \"type\": \"ENTRY\",\r\n \"status\": \"ACTIVE\",\r\n \"tenantId\": \"{{tenantId}}\",\r\n \"documentIds\":[\r\n {\r\n \"documentType\": \"documentType\",\r\n \"fileStore\": \"fileStore\",\r\n \"documentUid\": \"documentUid\"\r\n }\r\n \r\n ]\r\n },\r\n {\r\n \"registerId\": \"{{$randomUUID}}\",\r\n \"individualId\": \"{{individualId}}\",\r\n \"time\": {{attendeeEnrollmentDate}},\r\n \"type\": \"ENTRY\",\r\n \"status\": \"ACTIVE\",\r\n \"tenantId\": \"{{tenantId}}\",\r\n \"documentIds\":[\r\n {\r\n \"documentType\": \"documentType\",\r\n \"fileStore\": \"fileStore\",\r\n \"documentUid\": \"documentUid\"\r\n }\r\n \r\n ]\r\n }\r\n ]\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendance Log - Create - Fail - User is not authorised",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "pm.test(\"Attendance Log created successfully\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " pm.expect(code).to.eql(\"UNAUTHORISED_USER\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- },
- {
- "listen": "prerequest",
- "script": {
- "exec": [
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n },\r\n \"attendance\": [\r\n {\r\n \"registerId\": \"{{$randomUUID}}\",\r\n \"individualId\": \"{{individualId}}\",\r\n \"time\": {{attendeeEnrollmentDate}},\r\n \"type\": \"ENTRY\",\r\n \"status\": \"ACTIVE\",\r\n \"tenantId\": \"{{tenantId}}\",\r\n \"documentIds\":[\r\n {\r\n \"documentType\": \"documentType\",\r\n \"fileStore\": \"fileStore\",\r\n \"documentUid\": \"documentUid\"\r\n }\r\n \r\n ]\r\n }\r\n ]\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendance Log - Rearch - Fail - TenantId is required",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "pm.test(\"Attendance Log created successfully\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " pm.expect(code).to.eql(\"TENANT_ID\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n }\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_search",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_search"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendance Log - Rearch - Fail - RegisterId is required",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400))",
- ");",
- "",
- "pm.test(\"Attendance Log created successfully\", function () {",
- " var res = pm.response.json();",
- " var code = res.Errors[0].code;",
- " pm.expect(code).to.eql(\"REGISTER_ID\");",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n }\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_search?tenantId={{tenantId}}",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_search"
- ],
- "query": [
- {
- "key": "tenantId",
- "value": "{{tenantId}}"
- }
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendance Log - Rearch - Success",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(200))",
- ");",
- "",
- "pm.test(\"Attendance Log created successfully\", function () {",
- " var res = pm.response.json();",
- " pm.expect(res.attendance).to.be.not.null;",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n }\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_search?tenantId={{tenantId}}®isterId={{registerId}}",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_search"
- ],
- "query": [
- {
- "key": "tenantId",
- "value": "{{tenantId}}"
- },
- {
- "key": "registerId",
- "value": "{{registerId}}"
- }
- ]
- }
- },
- "response": []
- },
- {
- "name": "Attendance Log - Create - Fail - required fields are missing",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "pm.test(\"Response is successful\", () => ",
- " pm.expect(pm.response.to.have.status(400)));",
- "",
- "pm.test(\"Register Search response is received\", function () {",
- " var res = pm.response.json();",
- " pm.expect(res.Errors.length).to.equal(5);",
- " }",
- ");"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"mukta-services\",\r\n \"action\": \"\",\r\n \"did\": 1,\r\n \"key\": \"\",\r\n \"msgId\": \"20170310130900|en_IN\",\r\n \"requesterId\": \"\",\r\n \"ts\": 1513579888683,\r\n \"ver\": \".01\",\r\n \"authToken\":\"{{token}}\"\r\n },\r\n \"attendance\": [\r\n {\r\n \"registerId\": null,\r\n \"individualId\": null,\r\n \"time\": null,\r\n \"type\": null,\r\n \"status\": \"ACTIVE\",\r\n \"tenantId\": null,\r\n \"documentIds\":[\r\n {\r\n \"documentType\": \"documentType\",\r\n \"fileStore\": \"fileStore\",\r\n \"documentUid\": \"documentUid\"\r\n }\r\n \r\n ]\r\n }\r\n ]\r\n}\r\n",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "{{base_url}}/attendance/log/v1/_create",
- "host": [
- "{{base_url}}"
- ],
- "path": [
- "attendance",
- "log",
- "v1",
- "_create"
- ]
- }
- },
- "response": []
- }
- ]
- }
- ],
- "event": [
- {
- "listen": "prerequest",
- "script": {
- "type": "text/javascript",
- "exec": [
- "if (pm.environment.get(\"base_url\").includes(\"localhost\")) {",
- "",
- " var tenantId = \"pb.amritsar\";",
- " var id = 1;",
- " var uuid = \"11b0e02b-0145-4de2-bc42-c97b96264807\";",
- "",
- " var roles = [{",
- " \"code\": \"SUPERUSER\",",
- " \"name\": \"SUPER USER\",",
- " \"tenantId\": tenantId",
- " }];",
- "",
- " var userInfo = {",
- " \"id\": id,",
- " \"uuid\": uuid,",
- " \"userName\": \"\",",
- " \"name\": \"\",",
- " \"mobileNumber\": \"\",",
- " \"emailId\": \"\",",
- " \"type\": \"\",",
- " \"roles\": roles,",
- " \"active\": true,",
- " \"tenantId\": \"pb.amritsar\"",
- " };",
- "",
- " pm.request.body.raw = pm.request.body.raw.replace('\"{{token}}\"', '\"\", \\n \"userInfo\": ' + JSON.stringify(userInfo));",
- "}"
- ]
- }
- },
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- ""
- ]
- }
- }
- ],
- "variable": [
- {
- "key": "tenantId",
- "value": ""
- },
- {
- "key": "stateLevelTenant",
- "value": ""
- },
- {
- "key": "registerId",
- "value": ""
- },
- {
- "key": "registerNumber",
- "value": ""
- },
- {
- "key": "registerId2",
- "value": ""
- },
- {
- "key": "registerStartDate",
- "value": ""
- },
- {
- "key": "registerEndDate",
- "value": ""
- },
- {
- "key": "invalidRegisterEndDate",
- "value": ""
- },
- {
- "key": "userId",
- "value": ""
- },
- {
- "key": "userId-1",
- "value": ""
- },
- {
- "key": "userId-2",
- "value": ""
- },
- {
- "key": "individualId",
- "value": ""
- },
- {
- "key": "attendeeEnrollmentDate",
- "value": ""
- },
- {
- "key": "individualId-1",
- "value": ""
- },
- {
- "key": "individualId-2",
- "value": ""
- },
- {
- "key": "attendanceLogId",
- "value": ""
- }
- ]
-}
\ No newline at end of file
diff --git a/core-services/attendance/src/main/java/org/egov/Main.java b/core-services/attendance/src/main/java/org/egov/Main.java
deleted file mode 100644
index efe5addd85e..00000000000
--- a/core-services/attendance/src/main/java/org/egov/Main.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.egov;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.ComponentScan;
-
-@SpringBootApplication
-@ComponentScan(basePackages = {"org.egov", "org.egov.web.controllers", "org.egov.config"})
-public class Main {
-
- public static void main(String[] args) throws Exception {
- SpringApplication.run(Main.class, args);
- }
-
-}
diff --git a/core-services/attendance/src/main/java/org/egov/config/AttendanceServiceConfiguration.java b/core-services/attendance/src/main/java/org/egov/config/AttendanceServiceConfiguration.java
deleted file mode 100644
index ede3010f452..00000000000
--- a/core-services/attendance/src/main/java/org/egov/config/AttendanceServiceConfiguration.java
+++ /dev/null
@@ -1,107 +0,0 @@
-package org.egov.config;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import org.egov.tracer.config.TracerConfiguration;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Import;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.PostConstruct;
-import java.util.TimeZone;
-
-@Component
-@Data
-@Import({TracerConfiguration.class})
-@NoArgsConstructor
-@AllArgsConstructor
-public class AttendanceServiceConfiguration {
-
- @Value("${app.timezone}")
- private String timeZone;
- //Idgen Config
- @Value("${egov.idgen.host}")
- private String idGenHost;
- @Value("${egov.idgen.path}")
- private String idGenPath;
- @Value("${egov.idgen.attendance.register.number.name}")
- private String idgenAttendanceRegisterNumberName;
- //MDMS
- @Value("${egov.mdms.host}")
- private String mdmsHost;
- @Value("${egov.mdms.search.endpoint}")
- private String mdmsEndPoint;
- //Topic
- @Value("${attendance.register.kafka.create.topic}")
- private String saveAttendanceRegisterTopic;
- @Value("${attendance.register.kafka.update.topic}")
- private String updateAttendanceRegisterTopic;
-
- //Topic
- @Value("${attendance.staff.kafka.create.topic}")
- private String saveStaffTopic;
- @Value("${attendance.staff.kafka.update.topic}")
- private String updateStaffTopic;
-
- //Topic
- @Value("${attendance.attendee.kafka.create.topic}")
- private String saveAttendeeTopic;
- @Value("${attendance.attendee.kafka.update.topic}")
- private String updateAttendeeTopic;
-
- @PostConstruct
- public void initialize() {
- TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
- }
-
- // kafka topics
- @Value("${attendance.log.kafka.create.topic}")
- private String createAttendanceLogTopic;
-
- @Value("${attendance.log.kafka.update.topic}")
- private String updateAttendanceLogTopic;
-
- // service integration config
- @Value("${attendance.individual.service.integration.required}")
- private String individualServiceIntegrationRequired;
-
- @Value("${attendance.staff.service.integration.required}")
- private String staffServiceIntegrationRequired;
-
- @Value("${attendance.document.id.verification.required}")
- private String documentIdVerificationRequired;
-
- //attendance service log search config
-
- //@Value("${attendance.service.log.default.offset}")
- //private Integer attendanceLogDefaultOffset;
-
- //@Value("${attendance.service.log.default.limit}")
- //private Integer attendanceLogDefaultLimit;
-
- //@Value("${attendance.service.log.search.max.limit}")
- //private Integer attendanceLogMaxLimit;
-
- //attendance service register search config
- @Value("${attendance.register.default.offset}")
- private Integer attendanceRegisterDefaultOffset;
-
- @Value("${attendance.register.default.limit}")
- private Integer attendanceRegisterDefaultLimit;
-
- @Value("${attendance.register.search.max.limit}")
- private Integer attendanceRegisterMaxLimit;
-
- @Value("${attendance.register.open.search.enabled.roles}")
- private String registerOpenSearchEnabledRoles;
-
- //Individual servcie
- @Value("${works.individual.host}")
- private String individualHost;
- @Value("${works.individual.search.endpoint}")
- private String individualSearchEndpoint;
-
-}
-
-
diff --git a/core-services/attendance/src/main/java/org/egov/config/MainConfiguration.java b/core-services/attendance/src/main/java/org/egov/config/MainConfiguration.java
deleted file mode 100644
index e4d1cb86e3e..00000000000
--- a/core-services/attendance/src/main/java/org/egov/config/MainConfiguration.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.egov.config;
-
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.egov.tracer.config.TracerConfiguration;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Import;
-import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
-
-import javax.annotation.PostConstruct;
-import java.util.TimeZone;
-
-
-@Import({TracerConfiguration.class})
-public class MainConfiguration {
-
- @Value("${app.timezone}")
- private String timeZone;
-
- @PostConstruct
- public void initialize() {
- TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
- }
-
- @Bean
- public ObjectMapper objectMapper() {
- return new ObjectMapper().disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES).setTimeZone(TimeZone.getTimeZone(timeZone));
- }
-
- @Bean
- @Autowired
- public MappingJackson2HttpMessageConverter jacksonConverter(ObjectMapper objectMapper) {
- MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
- converter.setObjectMapper(objectMapper);
- return converter;
- }
-}
\ No newline at end of file
diff --git a/core-services/attendance/src/main/java/org/egov/enrichment/AttendanceLogEnrichment.java b/core-services/attendance/src/main/java/org/egov/enrichment/AttendanceLogEnrichment.java
deleted file mode 100644
index 64f9e785ce4..00000000000
--- a/core-services/attendance/src/main/java/org/egov/enrichment/AttendanceLogEnrichment.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package org.egov.enrichment;
-
-import digit.models.coremodels.AuditDetails;
-import lombok.extern.slf4j.Slf4j;
-import org.egov.common.contract.request.RequestInfo;
-import org.egov.config.AttendanceServiceConfiguration;
-import org.egov.util.AttendanceServiceUtil;
-import org.egov.web.models.AttendanceLog;
-import org.egov.web.models.AttendanceLogRequest;
-import org.egov.web.models.AttendanceLogSearchCriteria;
-import org.egov.web.models.Document;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import java.util.List;
-import java.util.UUID;
-
-@Component
-@Slf4j
-public class AttendanceLogEnrichment {
- @Autowired
- private AttendanceServiceUtil attendanceServiceUtil;
- @Autowired
- private AttendanceServiceConfiguration config;
-
- public void enrichAttendanceLogCreateRequest(AttendanceLogRequest attendanceLogRequest) {
- String registerId = attendanceLogRequest.getAttendance().get(0).getRegisterId();
- log.info("Enriching attendance log create request for register ["+registerId+"]");
- List attendanceLogs = attendanceLogRequest.getAttendance();
- String byUser = attendanceLogRequest.getRequestInfo().getUserInfo().getUuid();
- AuditDetails auditDetails = attendanceServiceUtil.getAuditDetails(byUser, null, true);
- for (AttendanceLog attendanceLog : attendanceLogs) {
- attendanceLog.setAuditDetails(auditDetails);
- String attendanceLogId = String.valueOf(UUID.randomUUID());
- attendanceLog.setId(attendanceLogId);
- List documentIds = attendanceLog.getDocumentIds();
- for (Document documentId : documentIds) {
- documentId.setId(String.valueOf(UUID.randomUUID()));
- }
- }
- log.info("Enriched attendance log create request for register ["+registerId+"]");
- }
-
- public void enrichAttendanceLogUpdateRequest(AttendanceLogRequest attendanceLogRequest) {
- String registerId = attendanceLogRequest.getAttendance().get(0).getRegisterId();
- log.info("Enriching attendance log update request for register ["+registerId+"]");
- List attendanceLogs = attendanceLogRequest.getAttendance();
- String byUser = attendanceLogRequest.getRequestInfo().getUserInfo().getUuid();
- for (AttendanceLog attendanceLog : attendanceLogs) {
- AuditDetails auditDetails = attendanceServiceUtil.getAuditDetails(byUser, attendanceLog.getAuditDetails(), false);
- attendanceLog.setAuditDetails(auditDetails);
- // enrich the documentId if not present
- List documentIds = attendanceLog.getDocumentIds();
- for (Document documentId : documentIds) {
- if (documentId.getId() == null) {
- documentId.setId(String.valueOf(UUID.randomUUID()));
- }
- }
- }
-
- log.info("Enriched attendance log update request for register ["+registerId+"]");
- }
-
- public void enrichAttendanceLogSearchRequest(RequestInfo requestInfo, AttendanceLogSearchCriteria searchCriteria) {
-
-// if (searchCriteria.getLimit() == null)
-// searchCriteria.setLimit(config.getAttendanceLogDefaultLimit());
-//
-// if (searchCriteria.getOffset() == null)
-// searchCriteria.setOffset(config.getAttendanceLogDefaultOffset());
-//
-// if (searchCriteria.getLimit() != null && searchCriteria.getLimit() > config.getAttendanceLogMaxLimit())
-// searchCriteria.setLimit(config.getAttendanceLogMaxLimit());
-
- }
-}
diff --git a/core-services/attendance/src/main/java/org/egov/enrichment/AttendeeEnrichmentService.java b/core-services/attendance/src/main/java/org/egov/enrichment/AttendeeEnrichmentService.java
deleted file mode 100644
index 6a7547020ab..00000000000
--- a/core-services/attendance/src/main/java/org/egov/enrichment/AttendeeEnrichmentService.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package org.egov.enrichment;
-
-import digit.models.coremodels.AuditDetails;
-import org.egov.common.contract.request.RequestInfo;
-import org.egov.util.AttendanceServiceUtil;
-import org.egov.web.models.AttendeeCreateRequest;
-import org.egov.web.models.AttendeeDeleteRequest;
-import org.egov.web.models.IndividualEntry;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.math.BigDecimal;
-import java.util.List;
-import java.util.UUID;
-
-@Service
-public class AttendeeEnrichmentService {
-
- @Autowired
- private AttendanceServiceUtil attendanceServiceUtil;
-
- public void enrichAttendeeOnCreate(AttendeeCreateRequest attendeeCreateRequest) {
- RequestInfo requestInfo = attendeeCreateRequest.getRequestInfo();
- List attendeeListFromRequest = attendeeCreateRequest.getAttendees();
-
- for (IndividualEntry attendee : attendeeListFromRequest) {
- AuditDetails auditDetails = attendanceServiceUtil.getAuditDetails(requestInfo.getUserInfo().getUuid(), attendee.getAuditDetails(), true);
- attendee.setAuditDetails(auditDetails);
- attendee.setId(UUID.randomUUID().toString());
- attendee.setDenrollmentDate(null);
- if (attendee.getEnrollmentDate() == null) {
- BigDecimal enrollmentDate = new BigDecimal(System.currentTimeMillis());
- attendee.setEnrollmentDate(enrollmentDate);
- }
-
- }
- }
-
- public void enrichAttendeeOnDelete(AttendeeDeleteRequest attendeeDeleteRequest, List attendeesFromDB) {
- RequestInfo requestInfo = attendeeDeleteRequest.getRequestInfo();
- List attendeesListFromRequest = attendeeDeleteRequest.getAttendees();
-
- for (IndividualEntry attendee : attendeesListFromRequest) {
- for (IndividualEntry attendeeFromDB : attendeesFromDB) {
- if (attendeeFromDB.getIndividualId().equals(attendee.getIndividualId())
- && attendeeFromDB.getRegisterId().equals(attendee.getRegisterId())) {
-
- attendee.setId(attendeeFromDB.getId());
- attendee.setEnrollmentDate(attendeeFromDB.getEnrollmentDate());
-
- AuditDetails auditDetails = attendanceServiceUtil.getAuditDetails(requestInfo.getUserInfo().getUuid(), attendeeFromDB.getAuditDetails(), false);
- attendee.setAuditDetails(auditDetails);
-
-
- if (attendee.getDenrollmentDate() == null) {
- BigDecimal deEnrollmentDate = new BigDecimal(System.currentTimeMillis());
- attendee.setDenrollmentDate(deEnrollmentDate);
- }
- }
- }
- }
-
-
- }
-}
diff --git a/core-services/attendance/src/main/java/org/egov/enrichment/RegisterEnrichment.java b/core-services/attendance/src/main/java/org/egov/enrichment/RegisterEnrichment.java
deleted file mode 100644
index c34e694998c..00000000000
--- a/core-services/attendance/src/main/java/org/egov/enrichment/RegisterEnrichment.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package org.egov.enrichment;
-
-import digit.models.coremodels.AuditDetails;
-import digit.models.coremodels.IdResponse;
-import lombok.extern.slf4j.Slf4j;
-import org.egov.common.contract.request.RequestInfo;
-import org.egov.common.models.individual.Individual;
-import org.egov.common.utils.MultiStateInstanceUtil;
-import org.egov.config.AttendanceServiceConfiguration;
-import org.egov.repository.IdGenRepository;
-import org.egov.tracer.model.CustomException;
-import org.egov.util.AttendanceServiceUtil;
-import org.egov.util.IndividualServiceUtil;
-import org.egov.web.models.AttendanceRegister;
-import org.egov.web.models.AttendanceRegisterRequest;
-import org.egov.web.models.AttendanceRegisterSearchCriteria;
-import org.egov.web.models.StaffPermission;
-import org.egov.web.models.StaffPermissionRequest;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.util.CollectionUtils;
-
-import java.math.BigDecimal;
-import java.util.Collections;
-import java.util.List;
-import java.util.UUID;
-import java.util.stream.Collectors;
-
-@Service
-@Slf4j
-public class RegisterEnrichment {
-
- @Autowired
- private AttendanceServiceUtil attendanceServiceUtil;
- @Autowired
- private IdGenRepository idGenRepository;
- @Autowired
- private AttendanceServiceConfiguration config;
- @Autowired
- private IndividualServiceUtil individualServiceUtil;
- @Autowired
- private MultiStateInstanceUtil multiStateInstanceUtil;
-
- /* Enrich Attendance Register on Create Request */
- public void enrichRegisterOnCreate(AttendanceRegisterRequest attendanceRegisterRequest) {
- RequestInfo requestInfo = attendanceRegisterRequest.getRequestInfo();
- List attendanceRegisters = attendanceRegisterRequest.getAttendanceRegister();
-
- String rootTenantId = attendanceRegisters.get(0).getTenantId().split("\\.")[0];
-
- //Get Register Numbers from IdGen Service for number of registers present in AttendanceRegisters
- List registerNumbers = getIdList(requestInfo, rootTenantId
- , config.getIdgenAttendanceRegisterNumberName(), "", attendanceRegisters.size()); //idFormat will be fetched by idGen service
-
- for (int i = 0; i < attendanceRegisters.size(); i++) {
-
- if (registerNumbers != null && !registerNumbers.isEmpty()) {
- attendanceRegisters.get(i).setRegisterNumber(registerNumbers.get(i));
- log.info("Register number " + registerNumbers.get(i) + " assigned to register " + attendanceRegisters.get(i));
- } else {
- log.error("Error occurred while generating attendance register numbers from IdGen service");
- throw new CustomException("ATTENDANCE_REGISTER_NUMBER_NOT_GENERATED","Error occurred while generating attendance register numbers from IdGen service");
- }
-
- //Enrich attendance register id and audit details
- attendanceRegisters.get(i).setId(UUID.randomUUID().toString());
- log.info("Attendance register assigned with register Id " + attendanceRegisters.get(i).getId());
- AuditDetails auditDetails = attendanceServiceUtil.getAuditDetails(requestInfo.getUserInfo().getUuid(), null, true);
- attendanceRegisters.get(i).setAuditDetails(auditDetails);
- log.info("Enriched register " + attendanceRegisters.get(i).getId() + " with Audit details");
- // User who creates the register, by default gets enrolled as the first staff for that register.
- enrichRegisterFirstStaff(attendanceRegisters.get(i), requestInfo, auditDetails);
- }
- }
-
- /* Enrich first staff details while creating register*/
- private void enrichRegisterFirstStaff(AttendanceRegister attendanceRegister, RequestInfo requestInfo, AuditDetails auditDetails) {
- String tenantId = attendanceRegister.getTenantId();
- Long userid = requestInfo.getUserInfo().getId();
- List individualList = individualServiceUtil.getIndividualDetailsFromUserId(userid, requestInfo, multiStateInstanceUtil.getStateLevelTenant(tenantId));
- String individualId = individualList.get(0).getId();
-
- StaffPermission staffPermission = StaffPermission.builder()
- .id(UUID.randomUUID().toString())
- .tenantId(attendanceRegister.getTenantId())
- .registerId(attendanceRegister.getId())
- .userId(individualId)
- .enrollmentDate(new BigDecimal(System.currentTimeMillis()))
- .auditDetails(auditDetails)
- .build();
- attendanceRegister.setStaff(Collections.singletonList(staffPermission));
- log.info("First staff for attendance register is added in attendance register");
- log.info("The user " + requestInfo.getUserInfo().getUuid() + " is addedd as staff for the attendance register + " + staffPermission.getRegisterId());
- }
-
- /* Enrich Attendance Register on Update Request */
- public void enrichRegisterOnUpdate(AttendanceRegisterRequest attendanceRegisterRequest, List attendanceRegistersListFromDB) {
- RequestInfo requestInfo = attendanceRegisterRequest.getRequestInfo();
- List attendanceRegistersListInUpdateReq = attendanceRegisterRequest.getAttendanceRegister();
-
- for (AttendanceRegister attendanceRegisterInUpdateReq : attendanceRegistersListInUpdateReq) {
- log.info("Enriching register " + attendanceRegisterInUpdateReq.getId());
- String registerId = String.valueOf(attendanceRegisterInUpdateReq.getId());
- AttendanceRegister attendanceRegisterFromDB = attendanceRegistersListFromDB.stream().filter(ar -> registerId.equals(String.valueOf(ar.getId()))).findFirst().orElse(null);
-
- // Set read only values i.e register number, attendees, staff to the attendance register update request as in attendance register from DB
- attendanceRegisterInUpdateReq.setRegisterNumber(attendanceRegisterFromDB.getRegisterNumber());
- attendanceRegisterInUpdateReq.setAttendees(attendanceRegisterFromDB.getAttendees());
- attendanceRegisterInUpdateReq.setStaff(attendanceRegisterFromDB.getStaff());
- log.info("Update attendance register request for register " + attendanceRegisterInUpdateReq.getId() + " enriched with register number, attendees and staff");
-
- // Set audit details for register update request
- attendanceRegisterInUpdateReq.setAuditDetails(attendanceRegisterFromDB.getAuditDetails());
- AuditDetails auditDetails = attendanceServiceUtil.getAuditDetails(requestInfo.getUserInfo().getUuid(), attendanceRegisterFromDB.getAuditDetails(), false);
- attendanceRegisterInUpdateReq.setAuditDetails(auditDetails);
- log.info("Update attendance register request for register " + attendanceRegisterInUpdateReq.getId() + " enriched with audit details");
- }
- }
-
- /* Adds staff details to the associated attendance register */
- public void enrichStaffInRegister(List attendanceRegisters, StaffPermissionRequest staffPermissionResponse) {
- for (AttendanceRegister attendanceRegister : attendanceRegisters) {
- String registerId = String.valueOf(attendanceRegister.getId());
- List staff = staffPermissionResponse.getStaff().stream().filter(st -> registerId.equals(st.getRegisterId())).collect(Collectors.toList());
- attendanceRegister.setStaff(staff);
- log.info("Created staff details associated with attendance register " + attendanceRegister.getId() + " in create request");
- }
- }
-
- /* Get id list from IdGen service */
- private List getIdList(RequestInfo requestInfo, String tenantId, String idKey,
- String idformat, int count) {
- List idResponses = idGenRepository.getId(requestInfo, tenantId, idKey, idformat, count).getIdResponses();
-
- if (CollectionUtils.isEmpty(idResponses)) {
- log.error("No ids returned from idgen Service");
- throw new CustomException("IDGEN ERROR", "No ids returned from idgen Service");
- }
-
- return idResponses.stream()
- .map(IdResponse::getId).collect(Collectors.toList());
- }
-
-
- public void enrichSearchRegisterRequest(RequestInfo requestInfo, AttendanceRegisterSearchCriteria searchCriteria) {
-
- if (searchCriteria.getLimit() == null)
- searchCriteria.setLimit(config.getAttendanceRegisterDefaultLimit());
-
- if (searchCriteria.getOffset() == null)
- searchCriteria.setOffset(config.getAttendanceRegisterDefaultOffset());
-
- if (searchCriteria.getLimit() != null && searchCriteria.getLimit() > config.getAttendanceRegisterMaxLimit())
- searchCriteria.setLimit(config.getAttendanceRegisterMaxLimit());
-
- }
-}
diff --git a/core-services/attendance/src/main/java/org/egov/enrichment/StaffEnrichmentService.java b/core-services/attendance/src/main/java/org/egov/enrichment/StaffEnrichmentService.java
deleted file mode 100644
index abbb77fbf72..00000000000
--- a/core-services/attendance/src/main/java/org/egov/enrichment/StaffEnrichmentService.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.egov.enrichment;
-
-import digit.models.coremodels.AuditDetails;
-import org.egov.common.contract.request.RequestInfo;
-import org.egov.util.AttendanceServiceUtil;
-import org.egov.web.models.StaffPermission;
-import org.egov.web.models.StaffPermissionRequest;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.math.BigDecimal;
-import java.util.List;
-import java.util.UUID;
-
-@Service
-public class StaffEnrichmentService {
-
- @Autowired
- private AttendanceServiceUtil attendanceServiceUtil;
-
- public void enrichStaffPermissionOnCreate(StaffPermissionRequest request) {
- RequestInfo requestInfo = request.getRequestInfo();
- List staffPermissionListFromRequest = request.getStaff();
-
- for (StaffPermission staffPermissionFromRequest : staffPermissionListFromRequest) {
- AuditDetails auditDetails = attendanceServiceUtil.getAuditDetails(requestInfo.getUserInfo().getUuid(), staffPermissionFromRequest.getAuditDetails(), true);
- staffPermissionFromRequest.setAuditDetails(auditDetails);
- staffPermissionFromRequest.setId(UUID.randomUUID().toString());
- BigDecimal enrollmentDate = new BigDecimal(System.currentTimeMillis());
- staffPermissionFromRequest.setEnrollmentDate(enrollmentDate);
- }
- }
-
- public void enrichStaffPermissionOnDelete(StaffPermissionRequest request, List staffPermissionListFromDB) {
- RequestInfo requestInfo = request.getRequestInfo();
- List staffPermissionListFromRequest = request.getStaff();
-
- for (StaffPermission staffPermissionFromRequest : staffPermissionListFromRequest) {
- for (StaffPermission staffPermissionFromDB : staffPermissionListFromDB) {
- if (staffPermissionFromDB.getUserId().equals(staffPermissionFromRequest.getUserId())
- && staffPermissionFromDB.getRegisterId().equals(staffPermissionFromRequest.getRegisterId())
- && staffPermissionFromDB.getDenrollmentDate() == null) {
- staffPermissionFromRequest.setId(staffPermissionFromDB.getId());
- staffPermissionFromRequest.setEnrollmentDate(staffPermissionFromDB.getEnrollmentDate());
-
- AuditDetails auditDetails = attendanceServiceUtil.getAuditDetails(requestInfo.getUserInfo().getUuid(), staffPermissionFromDB.getAuditDetails(), false);
-
- staffPermissionFromRequest.setAuditDetails(auditDetails);
-
- BigDecimal deenrollmentDate = new BigDecimal(System.currentTimeMillis());
- staffPermissionFromRequest.setDenrollmentDate(deenrollmentDate);
- }
- }
- }
-
-
- }
-
-
-}
diff --git a/core-services/attendance/src/main/java/org/egov/kafka/Consumer.java b/core-services/attendance/src/main/java/org/egov/kafka/Consumer.java
deleted file mode 100644
index bd8693b4cdd..00000000000
--- a/core-services/attendance/src/main/java/org/egov/kafka/Consumer.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.egov.kafka;
-
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import lombok.extern.slf4j.Slf4j;
-import org.egov.common.contract.request.RequestInfo;
-import org.egov.service.AttendanceRegisterService;
-import org.egov.service.OrganisationContactDetailsStaffUpdateService;
-import org.egov.web.models.Organisation.OrgContactUpdateDiff;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.kafka.annotation.KafkaListener;
-import org.springframework.kafka.support.KafkaHeaders;
-import org.springframework.messaging.handler.annotation.Header;
-import org.springframework.stereotype.Component;
-
-import java.math.BigDecimal;
-
-@Component
-@Slf4j
-public class Consumer {
-
- @Autowired
- private ObjectMapper objectMapper;
- @Autowired
- private OrganisationContactDetailsStaffUpdateService organisationContactDetailsStaffUpdateService;
- @Autowired
- private AttendanceRegisterService attendanceRegisterService;
-
- @KafkaListener(topics = "${organisation.contact.details.update.topic}")
- public void updateAttendanceStaff(String consumerRecord,
- @Header(KafkaHeaders.RECEIVED_TOPIC) String topic){
- try {
- OrgContactUpdateDiff orgContactUpdateDiff = objectMapper.readValue(consumerRecord, OrgContactUpdateDiff.class);
- organisationContactDetailsStaffUpdateService.updateStaffPermissionsForContactDetails(orgContactUpdateDiff);
- } catch(Exception e){
- log.error("Error updating staff permissions for update in organisation contact details", e);
- }
- }
-
- /**
- * Update end date for approved time extension request
- * @param consumerRecord
- * @param topic
- */
- @KafkaListener(topics = "${contracts.revision.topic}")
- public void updateEndDate(String consumerRecord, @Header(KafkaHeaders.RECEIVED_TOPIC) String topic) {
- try {
- JsonNode attendanceContractRevisionRequest = objectMapper.readValue(consumerRecord, JsonNode.class);
- RequestInfo requestInfo = objectMapper.convertValue(attendanceContractRevisionRequest.get("RequestInfo"), RequestInfo.class);
- String tenantId = attendanceContractRevisionRequest.get("tenantId").asText();
- String referenceId = attendanceContractRevisionRequest.get("referenceId").asText();
- BigDecimal endDate = attendanceContractRevisionRequest.get("endDate").decimalValue();
- attendanceRegisterService.updateEndDateForRevisedContract(requestInfo, tenantId, referenceId, endDate);
- }catch (Exception e) {
- log.error("Error end date for contract");
- }
- }
-
-}
diff --git a/core-services/attendance/src/main/java/org/egov/kafka/Producer.java b/core-services/attendance/src/main/java/org/egov/kafka/Producer.java
deleted file mode 100644
index b226368be08..00000000000
--- a/core-services/attendance/src/main/java/org/egov/kafka/Producer.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.egov.kafka;
-
-import org.egov.tracer.kafka.CustomKafkaTemplate;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Component
-public class Producer {
-
- @Autowired
- private CustomKafkaTemplate kafkaTemplate;
-
- public void push(String topic, Object value) {
- kafkaTemplate.send(topic, value);
- }
-}
diff --git a/core-services/attendance/src/main/java/org/egov/repository/AttendanceLogRepository.java b/core-services/attendance/src/main/java/org/egov/repository/AttendanceLogRepository.java
deleted file mode 100644
index 13f19c885ea..00000000000
--- a/core-services/attendance/src/main/java/org/egov/repository/AttendanceLogRepository.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.egov.repository;
-
-import lombok.extern.slf4j.Slf4j;
-import org.egov.repository.querybuilder.AttendanceLogQueryBuilder;
-import org.egov.repository.rowmapper.AttendanceLogRowMapper;
-import org.egov.web.models.AttendanceLog;
-import org.egov.web.models.AttendanceLogSearchCriteria;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.stereotype.Repository;
-
-import java.util.ArrayList;
-import java.util.List;
-
-@Repository
-@Slf4j
-public class AttendanceLogRepository {
- @Autowired
- private AttendanceLogRowMapper rowMapper;
-
- @Autowired
- private AttendanceLogQueryBuilder queryBuilder;
-
- @Autowired
- private JdbcTemplate jdbcTemplate;
-
- public List getAttendanceLogs(AttendanceLogSearchCriteria searchCriteria) {
- List