diff --git a/core-services/egov-hrms/src/main/java/org/egov/hrms/config/PropertiesManager.java b/core-services/egov-hrms/src/main/java/org/egov/hrms/config/PropertiesManager.java
index dd0fb1ee4c6..a5db11ba8d9 100644
--- a/core-services/egov-hrms/src/main/java/org/egov/hrms/config/PropertiesManager.java
+++ b/core-services/egov-hrms/src/main/java/org/egov/hrms/config/PropertiesManager.java
@@ -134,4 +134,8 @@ public class PropertiesManager {
@Value("${egov.hrms.auto.generate.password}")
private boolean autoGeneratePassword;
+
+ @Value("${egov.mdmsLegacy.search.endpoint}")
+ public String mdmsLegacySearchEndpoint;
+
}
\ No newline at end of file
diff --git a/core-services/egov-hrms/src/main/java/org/egov/hrms/service/IndividualService.java b/core-services/egov-hrms/src/main/java/org/egov/hrms/service/IndividualService.java
index 07b315bf1bc..36f5a1eb42a 100644
--- a/core-services/egov-hrms/src/main/java/org/egov/hrms/service/IndividualService.java
+++ b/core-services/egov-hrms/src/main/java/org/egov/hrms/service/IndividualService.java
@@ -1,5 +1,6 @@
package org.egov.hrms.service;
+
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Collections;
@@ -15,18 +16,9 @@
import lombok.extern.slf4j.Slf4j;
import org.egov.common.contract.request.RequestInfo;
import org.egov.common.models.core.Role;
-import org.egov.common.models.individual.Address;
-import org.egov.common.models.individual.AddressType;
-import org.egov.common.models.individual.Gender;
-import org.egov.common.models.individual.Identifier;
-import org.egov.common.models.individual.Individual;
-import org.egov.common.models.individual.IndividualBulkResponse;
-import org.egov.common.models.individual.IndividualRequest;
-import org.egov.common.models.individual.IndividualResponse;
-import org.egov.common.models.individual.IndividualSearch;
-import org.egov.common.models.individual.IndividualSearchRequest;
-import org.egov.common.models.individual.Name;
-import org.egov.common.models.individual.UserDetails;
+
+import org.egov.common.models.individual.*;
+
import org.egov.hrms.config.PropertiesManager;
import org.egov.hrms.repository.RestCallRepository;
import org.egov.hrms.utils.HRMSConstants;
@@ -35,6 +27,12 @@
import org.egov.hrms.web.contract.UserResponse;
import org.springframework.beans.factory.annotation.Autowired;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
+
+
import static org.egov.hrms.utils.HRMSConstants.SYSTEM_GENERATED;
@Slf4j
@@ -161,19 +159,15 @@ private static IndividualRequest mapToIndividualRequest(UserRequest userRequest)
/*
* FIXME (HCM specific change) clientReferenceId is the primary key in the individual table of the FrontEnd Worker Application's local database.
*/
- // Generating a unique client reference ID using UUID
.clientReferenceId(String.valueOf(UUID.randomUUID()))
// Creating a list of identifiers
.identifiers(Collections.singletonList(
- // Building a unique identifier
Identifier.builder()
- // Generating a unique client reference ID using UUID for the identifier
.clientReferenceId(String.valueOf(UUID.randomUUID()))
- // Generating a unique identifier ID using UUID
.identifierId(String.valueOf(UUID.randomUUID()))
- // Specifying the type of identifier as SYSTEM_GENERATED
.identifierType(SYSTEM_GENERATED)
.build()))
+
.userDetails(UserDetails.builder()
.username(userRequest.getUser().getUserName())
.password(userRequest.getUser().getPassword())
diff --git a/core-services/egov-hrms/src/main/java/org/egov/hrms/service/MDMSService.java b/core-services/egov-hrms/src/main/java/org/egov/hrms/service/MDMSService.java
index 9b2d8df55c3..dd3cbe0e3e7 100644
--- a/core-services/egov-hrms/src/main/java/org/egov/hrms/service/MDMSService.java
+++ b/core-services/egov-hrms/src/main/java/org/egov/hrms/service/MDMSService.java
@@ -27,12 +27,18 @@ public class MDMSService {
@Autowired
private RestTemplate restTemplate;
-
+
+ @Value("${egov.mdmslegacy.host}")
+ private String mdmsLegacyHost;
+
@Value("${egov.mdms.host}")
private String mdmsHost;
@Value("${egov.mdms.search.endpoint}")
private String mdmsEndpoint;
+
+ @Value("${egov.mdmslegacy.search.endpoint}")
+ private String mdmsLegacyEndpoint;
/**
@@ -180,7 +186,8 @@ public MdmsCriteriaReq prepareMDMSRequestLoc(StringBuilder uri, RequestInfo requ
moduleDetail.setMasterDetails(masterDetails);
moduleDetails.add(moduleDetail);
}
- uri.append(mdmsHost).append(mdmsEndpoint);
+
+ uri.append(mdmsLegacyHost).append(mdmsLegacyEndpoint);
MdmsCriteria mdmsCriteria = MdmsCriteria.builder().tenantId(tenantId).moduleDetails(moduleDetails).build();
return MdmsCriteriaReq.builder().requestInfo(requestInfo).mdmsCriteria(mdmsCriteria).build();
diff --git a/health-services/attendance/Attendace Service Postman Scripts.postman_collection.json b/health-services/attendance/Attendace Service Postman Scripts.postman_collection.json
new file mode 100644
index 00000000000..4f63c0b7820
--- /dev/null
+++ b/health-services/attendance/Attendace Service Postman Scripts.postman_collection.json
@@ -0,0 +1,3633 @@
+{
+ "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/health-services/attendance/Attendance-Service-1.0.0.yaml b/health-services/attendance/Attendance-Service-1.0.0.yaml
new file mode 100644
index 00000000000..7a3c97e43fb
--- /dev/null
+++ b/health-services/attendance/Attendance-Service-1.0.0.yaml
@@ -0,0 +1,666 @@
+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/health-services/attendance/CHANGELOG.md b/health-services/attendance/CHANGELOG.md
new file mode 100644
index 00000000000..e5a50979d1d
--- /dev/null
+++ b/health-services/attendance/CHANGELOG.md
@@ -0,0 +1,6 @@
+
+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/health-services/attendance/LOCALSETUP.md b/health-services/attendance/LOCALSETUP.md
new file mode 100644
index 00000000000..dbbd2382297
--- /dev/null
+++ b/health-services/attendance/LOCALSETUP.md
@@ -0,0 +1,42 @@
+# 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/health-services/attendance/README.md b/health-services/attendance/README.md
new file mode 100644
index 00000000000..c8866f16367
--- /dev/null
+++ b/health-services/attendance/README.md
@@ -0,0 +1,29 @@
+# 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/health-services/attendance/pom.xml b/health-services/attendance/pom.xml
new file mode 100644
index 00000000000..7f37268b040
--- /dev/null
+++ b/health-services/attendance/pom.xml
@@ -0,0 +1,141 @@
+
+ 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
+
+
+ org.egov.common
+ health-services-common
+ 1.0.15-SNAPSHOT
+ compile
+
+
+
+
+ repo.digit.org.snapshots
+ eGov ERP SNAPSHOT Repository
+ https://nexus-repo.digit.org/nexus/content/repositories/snapshots/
+
+
+ repo.digit.org
+ eGov ERP Releases Repository
+ https://nexus-repo.digit.org/nexus/content/repositories/releases/
+
+
+ repo.digit.org.public
+ eGov Public Repository Group
+ https://nexus-repo.digit.org/nexus/content/groups/public/
+
+
+
diff --git a/health-services/attendance/postman-test-suite-Attendace-service.json b/health-services/attendance/postman-test-suite-Attendace-service.json
new file mode 100644
index 00000000000..d64786c344c
--- /dev/null
+++ b/health-services/attendance/postman-test-suite-Attendace-service.json
@@ -0,0 +1,3796 @@
+{
+ "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/health-services/attendance/src/main/java/org/egov/Main.java b/health-services/attendance/src/main/java/org/egov/Main.java
new file mode 100644
index 00000000000..efe5addd85e
--- /dev/null
+++ b/health-services/attendance/src/main/java/org/egov/Main.java
@@ -0,0 +1,15 @@
+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/health-services/attendance/src/main/java/org/egov/config/AttendanceLogConfiguration.java b/health-services/attendance/src/main/java/org/egov/config/AttendanceLogConfiguration.java
new file mode 100644
index 00000000000..5c392dec8fe
--- /dev/null
+++ b/health-services/attendance/src/main/java/org/egov/config/AttendanceLogConfiguration.java
@@ -0,0 +1,28 @@
+package org.egov.config;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+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({TracerConfiguration.class})
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+@Component
+public class AttendanceLogConfiguration {
+
+ @Value("${attendance.log.kafka.consumer.bulk.create.topic}")
+ private String createAttendanceLogBulkTopic;
+
+ @Value("${attendance.log.kafka.consumer.bulk.update.topic}")
+ private String updateAttendanceLogBulkTopic;
+
+}
diff --git a/health-services/attendance/src/main/java/org/egov/config/AttendanceServiceConfiguration.java b/health-services/attendance/src/main/java/org/egov/config/AttendanceServiceConfiguration.java
new file mode 100644
index 00000000000..ede3010f452
--- /dev/null
+++ b/health-services/attendance/src/main/java/org/egov/config/AttendanceServiceConfiguration.java
@@ -0,0 +1,107 @@
+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/health-services/attendance/src/main/java/org/egov/config/MainConfiguration.java b/health-services/attendance/src/main/java/org/egov/config/MainConfiguration.java
new file mode 100644
index 00000000000..9e1c5cb6380
--- /dev/null
+++ b/health-services/attendance/src/main/java/org/egov/config/MainConfiguration.java
@@ -0,0 +1,93 @@
+package org.egov.config;
+
+import java.util.TimeZone;
+import javax.annotation.PostConstruct;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator;
+import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
+import org.egov.tracer.config.TracerConfiguration;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Import;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
+import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
+
+
+@Import({TracerConfiguration.class})
+@Configuration
+@ComponentScan(basePackages = {"org.egov"})
+public class MainConfiguration {
+
+ @Value("${app.timezone}")
+ private String timeZone;
+
+ @PostConstruct
+ public void initialize() {
+ TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
+ }
+
+ @Value("${spring.redis.host}")
+ private String redisHost;
+ @Bean(name = "objectMapper")
+ public ObjectMapper objectMapper(){
+ ObjectMapper objectMapper = new ObjectMapper();
+ objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES).setTimeZone(TimeZone.getTimeZone(timeZone));
+ objectMapper.registerModule(new JavaTimeModule());
+ return objectMapper;
+ }
+
+ @Bean
+ @Autowired
+ public MappingJackson2HttpMessageConverter jacksonConverter(ObjectMapper objectMapper) {
+ MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
+ converter.setObjectMapper(objectMapper);
+ return converter;
+ }
+ @Bean
+ @Qualifier("redisObjectMapper")
+ public ObjectMapper redisObjectMapper() {
+ ObjectMapper objectMapper = new ObjectMapper();
+ objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
+ objectMapper.activateDefaultTyping(LaissezFaireSubTypeValidator.instance,
+ ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.WRAPPER_ARRAY);
+ objectMapper.registerModule(new JavaTimeModule());
+ return objectMapper;
+ }
+
+ @Bean
+ public RedisConnectionFactory redisConnectionFactory() {
+ RedisStandaloneConfiguration redisStandaloneConfiguration = new RedisStandaloneConfiguration();
+ redisStandaloneConfiguration.setHostName(redisHost);
+ return new JedisConnectionFactory(redisStandaloneConfiguration);
+ }
+
+
+ @Bean
+ public RedisTemplate redisTemplate(@Qualifier("redisObjectMapper") ObjectMapper redisObjectMapper,
+ RedisConnectionFactory redisConnectionFactory) {
+ Jackson2JsonRedisSerializer