diff --git a/tutorials/Assignment-2/README.md b/tutorials/Assignment-2/README.md
new file mode 100644
index 00000000000..448396db107
--- /dev/null
+++ b/tutorials/Assignment-2/README.md
@@ -0,0 +1,2 @@
+Run the services and all the necessary dependencies and figure out why desired response is not returned.
+Clear out any previously added configuration files(such as indexer.yml, persister.yml etc) and add the files present in this assignment.
\ No newline at end of file
diff --git a/tutorials/Assignment-2/btr-calculator/README.md b/tutorials/Assignment-2/btr-calculator/README.md
new file mode 100644
index 00000000000..815750ea6cc
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/README.md
@@ -0,0 +1,25 @@
+# BTR Calculator
+
+This module calculates the birth registration application
+charges and creates bill for the application.
+
+### Service Dependencies
+- egov-mdms
+- billing service
+
+## Service Details
+
+The service generates demand based on input amount from
+mdms.
+
+### API Details
+
+`BasePath` /birth-calculator/v1/[API endpoint]
+
+#### Method
+
+a) `_calculate`
+- Calculates the amount due and generates the demand.
+
+b) `_getbill`
+- Fetches the bill for given application number.
diff --git a/tutorials/Assignment-2/btr-calculator/birth-registration-calculator-stage-4-postman-collection.json b/tutorials/Assignment-2/btr-calculator/birth-registration-calculator-stage-4-postman-collection.json
new file mode 100644
index 00000000000..c62248095c9
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/birth-registration-calculator-stage-4-postman-collection.json
@@ -0,0 +1,111 @@
+{
+ "info": {
+ "_postman_id": "52113373-99fa-4f7c-a3ff-e9f0feb39183",
+ "name": "DIGIT Developer Birth Registration Calculator Stage 4",
+ "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
+ "_exporter_id": "21170203"
+ },
+ "item": [
+ {
+ "name": "Calculate",
+ "request": {
+ "method": "POST",
+ "header": [],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"asset-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\": \"{{authToken}}\",\n \"userInfo\": {\n \"id\": 24226,\n \"uuid\": \"11b0e02b-0145-4de2-bc42-c97b96264807\",\n \"userName\": \"amr001\",\n \"name\": \"leela\",\n \"mobileNumber\": \"9814424443\",\n \"emailId\": \"leela@llgmail.com\",\n \"type\": \"EMPLOYEE\",\n \"roles\": [\n {\n \"name\": \"CSC Collection Operator\",\n \"code\": \"CSC_COLL_OPERATOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Employee\",\n \"code\": \"EMPLOYEE\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Grievance Routing Officer\",\n \"code\": \"GRO\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC counter employee\",\n \"code\": \"NOC_CEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Counter Employee\",\n \"code\": \"TL_CEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Counter Employee\",\n \"code\": \"TL_CEMP\",\n \"tenantId\": \"pb.jalandhar\"\n },\n {\n \"name\": \"TL Field Inspector\",\n \"code\": \"TL_FIELD_INSPECTOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Creator\",\n \"code\": \"TL_CREATOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Customer Support Representative\",\n \"code\": \"CSR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC counter Approver\",\n \"code\": \"NOC_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Approver\",\n \"code\": \"TL_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Super User\",\n \"code\": \"SUPERUSER\",\n \"tenantId\": \"pb\"\n },\n {\n \"name\": \"BPA Services Approver\",\n \"code\": \"BPA_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Field Employee\",\n \"code\": \"FEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Counter Employee\",\n \"code\": \"CEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC Field Inpector\",\n \"code\": \"NOC_FIELD_INSPECTOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NOC Department Approver\",\n \"code\": \"NOC_DEPT_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Super User\",\n \"code\": \"SUPERUSER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Grievance Officer\",\n \"code\": \"GO\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Anonymous User\",\n \"code\": \"ANONYMOUS\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Collection Operator\",\n \"code\": \"COLL_OPERATOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC Doc Verifier\",\n \"code\": \"NOC_DOC_VERIFIER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL doc verifier\",\n \"code\": \"TL_DOC_VERIFIER\",\n \"tenantId\": \"pb.amritsar\"\n }\n ],\n \"active\": true,\n \"tenantId\": \"pb.amritsar\"\n }\n },\n \"CalculationCriteria\": [\n {\n \"tenantId\": \"{{tenantId}}\",\n \"applicationNumber\": \"PB-BTR-2022-12-27-000661\"\n }\n ]\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "http://localhost:2345/birth-calculator/v1/_calculate",
+ "protocol": "http",
+ "host": [
+ "localhost"
+ ],
+ "port": "2345",
+ "path": [
+ "birth-calculator",
+ "v1",
+ "_calculate"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "MDMS search",
+ "request": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"asset-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\": \"{{authToken}}\",\n \"userInfo\": {\n \"id\": 24226,\n \"uuid\": \"11b0e02b-0145-4de2-bc42-c97b96264807\",\n \"userName\": \"amr001\",\n \"name\": \"leela\",\n \"mobileNumber\": \"9814424443\",\n \"emailId\": \"leela@llgmail.com\",\n \"type\": \"EMPLOYEE\",\n \"roles\": [\n {\n \"name\": \"CSC Collection Operator\",\n \"code\": \"CSC_COLL_OPERATOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Employee\",\n \"code\": \"EMPLOYEE\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Grievance Routing Officer\",\n \"code\": \"GRO\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC counter employee\",\n \"code\": \"NOC_CEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Counter Employee\",\n \"code\": \"TL_CEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Counter Employee\",\n \"code\": \"TL_CEMP\",\n \"tenantId\": \"pb.jalandhar\"\n },\n {\n \"name\": \"TL Field Inspector\",\n \"code\": \"TL_FIELD_INSPECTOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Creator\",\n \"code\": \"TL_CREATOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Customer Support Representative\",\n \"code\": \"CSR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC counter Approver\",\n \"code\": \"NOC_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Approver\",\n \"code\": \"TL_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Super User\",\n \"code\": \"SUPERUSER\",\n \"tenantId\": \"pb\"\n },\n {\n \"name\": \"BPA Services Approver\",\n \"code\": \"BPA_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Field Employee\",\n \"code\": \"FEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Counter Employee\",\n \"code\": \"CEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC Field Inpector\",\n \"code\": \"NOC_FIELD_INSPECTOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NOC Department Approver\",\n \"code\": \"NOC_DEPT_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Super User\",\n \"code\": \"SUPERUSER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Grievance Officer\",\n \"code\": \"GO\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Anonymous User\",\n \"code\": \"ANONYMOUS\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Collection Operator\",\n \"code\": \"COLL_OPERATOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC Doc Verifier\",\n \"code\": \"NOC_DOC_VERIFIER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL doc verifier\",\n \"code\": \"TL_DOC_VERIFIER\",\n \"tenantId\": \"pb.amritsar\"\n }\n ],\n \"active\": true,\n \"tenantId\": \"pb.amritsar\"\n }\n },\n \"MdmsCriteria\": {\n \"tenantId\": \"pb\",\n \"moduleDetails\": [\n {\n \"moduleName\": \"BTR\",\n \"masterDetails\": [\n {\n \"name\": \"RegistrationCharges\"\n }\n ]\n }\n ]\n }\n}"
+ },
+ "url": {
+ "raw": "https://dev.digit.org/egov-mdms-service/v1/_search",
+ "protocol": "https",
+ "host": [
+ "dev",
+ "digit",
+ "org"
+ ],
+ "path": [
+ "egov-mdms-service",
+ "v1",
+ "_search"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Get Bill",
+ "request": {
+ "method": "POST",
+ "header": [],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"asset-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\": \"{{authToken}}\",\n \"userInfo\": {\n \"id\": 24226,\n \"uuid\": \"11b0e02b-0145-4de2-bc42-c97b96264807\",\n \"userName\": \"amr001\",\n \"name\": \"leela\",\n \"mobileNumber\": \"9814424443\",\n \"emailId\": \"leela@llgmail.com\",\n \"type\": \"EMPLOYEE\",\n \"roles\": [\n {\n \"name\": \"CSC Collection Operator\",\n \"code\": \"CSC_COLL_OPERATOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Employee\",\n \"code\": \"EMPLOYEE\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Grievance Routing Officer\",\n \"code\": \"GRO\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC counter employee\",\n \"code\": \"NOC_CEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Counter Employee\",\n \"code\": \"TL_CEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Counter Employee\",\n \"code\": \"TL_CEMP\",\n \"tenantId\": \"pb.jalandhar\"\n },\n {\n \"name\": \"TL Field Inspector\",\n \"code\": \"TL_FIELD_INSPECTOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Creator\",\n \"code\": \"TL_CREATOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Customer Support Representative\",\n \"code\": \"CSR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC counter Approver\",\n \"code\": \"NOC_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Approver\",\n \"code\": \"TL_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Super User\",\n \"code\": \"SUPERUSER\",\n \"tenantId\": \"pb\"\n },\n {\n \"name\": \"BPA Services Approver\",\n \"code\": \"BPA_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Field Employee\",\n \"code\": \"FEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Counter Employee\",\n \"code\": \"CEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC Field Inpector\",\n \"code\": \"NOC_FIELD_INSPECTOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NOC Department Approver\",\n \"code\": \"NOC_DEPT_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Super User\",\n \"code\": \"SUPERUSER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Grievance Officer\",\n \"code\": \"GO\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Anonymous User\",\n \"code\": \"ANONYMOUS\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Collection Operator\",\n \"code\": \"COLL_OPERATOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC Doc Verifier\",\n \"code\": \"NOC_DOC_VERIFIER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL doc verifier\",\n \"code\": \"TL_DOC_VERIFIER\",\n \"tenantId\": \"pb.amritsar\"\n }\n ],\n \"active\": true,\n \"tenantId\": \"pb.amritsar\"\n }\n }\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "http://localhost:2345/birth-calculator/v1/_getbill?tenantId={{tenantId}}&applicationNumber=PB-BTR-2022-12-27-000661",
+ "protocol": "http",
+ "host": [
+ "localhost"
+ ],
+ "port": "2345",
+ "path": [
+ "birth-calculator",
+ "v1",
+ "_getbill"
+ ],
+ "query": [
+ {
+ "key": "tenantId",
+ "value": "{{tenantId}}"
+ },
+ {
+ "key": "applicationNumber",
+ "value": "PB-BTR-2022-12-27-000661"
+ }
+ ]
+ }
+ },
+ "response": []
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tutorials/Assignment-2/btr-calculator/pom.xml b/tutorials/Assignment-2/btr-calculator/pom.xml
new file mode 100644
index 00000000000..03fee5be347
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/pom.xml
@@ -0,0 +1,111 @@
+
+ 4.0.0
+ org.egov
+ birth-calculator
+ jar
+ birth-calculator
+ 1.0.0
+
+ 1.8
+ ${java.version}
+ ${java.version}
+
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.2.6.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-test
+ test
+
+
+
+ io.swagger
+ swagger-core
+ 1.5.18
+
+
+
+ org.egov.services
+ tracer
+ 2.0.0-SNAPSHOT
+
+
+ org.egov.services
+ services-common
+ 1.0.1-SNAPSHOT
+
+
+ org.egov.services
+ digit-models
+ 1.0.0-SNAPSHOT
+
+
+ org.egov
+ mdms-client
+ 0.0.2-SNAPSHOT
+ compile
+
+
+ org.projectlombok
+ lombok
+ true
+
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+
+
+
+ javax.validation
+ validation-api
+
+
+
+
+ repo.egovernments.org
+ eGov ERP Releases Repository
+ https://nexus-repo.egovernments.org/nexus/content/repositories/releases/
+
+
+ repo.egovernments.org.snapshots
+ eGov ERP Releases Repository
+ https://nexus-repo.egovernments.org/nexus/content/repositories/snapshots/
+
+
+ repo.egovernments.org.public
+ eGov Public Repository Group
+ https://nexus-repo.egovernments.org/nexus/content/groups/public/
+
+
+ repo.digit.org
+ eGov DIGIT Releases Repository
+ https://nexus-repo.digit.org/nexus/content/repositories/snapshots/
+
+
+
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/Main.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/Main.java
new file mode 100644
index 00000000000..4081c839a36
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/Main.java
@@ -0,0 +1,20 @@
+package digit;
+
+
+import org.egov.tracer.config.TracerConfiguration;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Import;
+
+@Import({TracerConfiguration.class})
+@SpringBootApplication
+@ComponentScan(basePackages = {"digit", "digit.web.controllers", "digit.config"})
+public class Main {
+
+
+ public static void main(String[] args) throws Exception {
+ SpringApplication.run(Main.class, args);
+ }
+
+}
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/config/BTRCalculatorConfigs.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/config/BTRCalculatorConfigs.java
new file mode 100644
index 00000000000..7112c361005
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/config/BTRCalculatorConfigs.java
@@ -0,0 +1,26 @@
+package digit.config;
+
+import lombok.Getter;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+@Getter
+public class BTRCalculatorConfigs {
+
+ @Value("${egov.billingservice.host}")
+ private String billingServiceHost;
+
+ @Value("${egov.demand.create.endpoint}")
+ private String demandCreateEndpoint;
+
+ @Value("${egov.billingservice.fetch.bill}")
+ private String fetchBillEndpoint;
+
+ @Value("${btr.taxhead.master.code}")
+ private String taxHeadMasterCode;
+
+ @Value("${btr.module.code}")
+ private String moduleCode;
+
+}
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/config/MainConfiguration.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/config/MainConfiguration.java
new file mode 100644
index 00000000000..0a59c792c3b
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/config/MainConfiguration.java
@@ -0,0 +1,39 @@
+package digit.config;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.egov.tracer.config.TracerConfiguration;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Import;
+import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
+
+import javax.annotation.PostConstruct;
+import java.util.TimeZone;
+
+
+@Import({TracerConfiguration.class})
+public class MainConfiguration {
+
+ @Value("${app.timezone}")
+ private String timeZone;
+
+ @PostConstruct
+ public void initialize() {
+ TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
+ }
+
+ @Bean
+ public ObjectMapper objectMapper() {
+ return new ObjectMapper().disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES).setTimeZone(TimeZone.getTimeZone(timeZone));
+ }
+
+ @Bean
+ @Autowired
+ public MappingJackson2HttpMessageConverter jacksonConverter(ObjectMapper objectMapper) {
+ MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
+ converter.setObjectMapper(objectMapper);
+ return converter;
+ }
+}
\ No newline at end of file
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/repository/ServiceRequestRepository.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/repository/ServiceRequestRepository.java
new file mode 100644
index 00000000000..08643ca8995
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/repository/ServiceRequestRepository.java
@@ -0,0 +1,45 @@
+package digit.repository;
+
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import lombok.extern.slf4j.Slf4j;
+import org.egov.tracer.model.ServiceCallException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Repository;
+import org.springframework.web.client.HttpClientErrorException;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.Map;
+
+@Repository
+@Slf4j
+public class ServiceRequestRepository {
+
+ private final ObjectMapper mapper;
+
+ private final RestTemplate restTemplate;
+
+
+ @Autowired
+ public ServiceRequestRepository(ObjectMapper mapper, RestTemplate restTemplate) {
+ this.mapper = mapper;
+ this.restTemplate = restTemplate;
+ }
+
+
+ public Object fetchResult(StringBuilder uri, Object request) {
+ mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
+ Object response = null;
+ try {
+ response = restTemplate.postForObject(uri.toString(), request, Map.class);
+ } catch (HttpClientErrorException e) {
+ log.error("External Service threw an Exception: ", e);
+ throw new ServiceCallException(e.getResponseBodyAsString());
+ } catch (Exception e) {
+ log.error("Exception while fetching from searcher: ", e);
+ }
+
+ return response;
+ }
+}
\ No newline at end of file
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/service/CalculationService.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/service/CalculationService.java
new file mode 100644
index 00000000000..9a831570049
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/service/CalculationService.java
@@ -0,0 +1,51 @@
+package digit.service;
+
+import digit.util.MdmsUtil;
+import digit.util.ResponseInfoFactory;
+import digit.web.models.Calculation;
+import digit.web.models.CalculationCriteria;
+import digit.web.models.CalculationReq;
+import digit.web.models.CalculationRes;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.LinkedList;
+import java.util.List;
+
+@Service
+public class CalculationService {
+
+ @Autowired
+ private MdmsUtil mdmsUtil;
+
+ @Autowired
+ private ResponseInfoFactory responseInfoFactory;
+
+ @Autowired
+ private DemandService demandService;
+
+ public List calculate(CalculationReq calculationReq){
+ List calculations = getCalculations(calculationReq);
+ CalculationRes calculationRes = CalculationRes.builder().responseInfo(responseInfoFactory.createResponseInfoFromRequestInfo(calculationReq.getRequestInfo(),true)).calculation(calculations).build();
+
+ demandService.generateDemands(calculationReq.getRequestInfo(),calculations);
+ return calculations;
+ }
+
+ public List getCalculations(CalculationReq calculationReq){
+ List calculations = new LinkedList<>();
+ for(CalculationCriteria calculationCriteria : calculationReq.getCalculationCriteria()) {
+ Calculation calculation = new Calculation();
+ calculation.setApplicationNumber(calculationCriteria.getApplicationNumber());
+ calculation.setTenantId(calculationCriteria.getTenantId());
+ calculation.setTotalAmount(Double.valueOf(getAmount(calculationReq)));
+ calculations.add(calculation);
+ }
+ return calculations;
+ }
+
+ private Integer getAmount(CalculationReq calculationReq) {
+ return mdmsUtil.fetchRegistrationChargesFromMdms(calculationReq.getRequestInfo(), calculationReq.getCalculationCriteria().get(0).getTenantId());
+ }
+
+}
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/service/DemandService.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/service/DemandService.java
new file mode 100644
index 00000000000..0b0b310eb4d
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/service/DemandService.java
@@ -0,0 +1,89 @@
+package digit.service;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import digit.config.BTRCalculatorConfigs;
+import digit.repository.ServiceRequestRepository;
+import digit.web.models.*;
+import lombok.extern.slf4j.Slf4j;
+import org.egov.common.contract.request.RequestInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+@Slf4j
+@Service
+public class DemandService {
+
+ @Autowired
+ private BTRCalculatorConfigs btrCalculatorConfigs;
+
+ @Autowired
+ private ObjectMapper mapper = new ObjectMapper();
+
+ @Autowired
+ private ServiceRequestRepository repository;
+
+ public List generateDemands(RequestInfo requestInfo, List calculations){
+ List demands = new ArrayList<>();
+
+ for(Calculation calculation : calculations){
+ DemandDetail demandDetail = DemandDetail.builder()
+ .tenantId(calculation.getTenantId())
+ .taxAmount(BigDecimal.valueOf(calculation.getTotalAmount()))
+ .taxHeadMasterCode(btrCalculatorConfigs.getTaxHeadMasterCode()).build();
+
+ Demand demand = Demand.builder()
+ .tenantId(calculation.getTenantId()).consumerCode(calculation.getApplicationNumber())
+ .consumerType("PAYMENT_BND_CONSUMER_CODE")
+ .businessService(btrCalculatorConfigs.getModuleCode())
+ .taxPeriodFrom(System.currentTimeMillis()).taxPeriodTo(System.currentTimeMillis())
+ .demandDetails(Collections.singletonList(demandDetail))
+ .build();
+
+ demands.add(demand);
+ }
+
+ StringBuilder url = new StringBuilder().append(btrCalculatorConfigs.getBillingServiceHost())
+ .append(btrCalculatorConfigs.getDemandCreateEndpoint());
+
+ DemandRequest demandRequest = DemandRequest.builder().requestInfo(requestInfo).demands(demands).build();
+
+ Object response = repository.fetchResult(url,demandRequest);
+
+ DemandResponse demandResponse = mapper.convertValue(response,DemandResponse.class);
+ return demandResponse.getDemands();
+ }
+
+ public BillResponse getBill(RequestInfoWrapper requestInfoWrapper, String tenantId, String applicationNumber) {
+ String uri = getFetchBillURI();
+ uri = uri.replace("{1}", tenantId);
+ uri = uri.replace("{2}", applicationNumber);
+ uri = uri.replace("{3}", btrCalculatorConfigs.getModuleCode());
+
+ Object response = repository.fetchResult(new StringBuilder(uri), requestInfoWrapper);
+ BillResponse billResponse = mapper.convertValue(response, BillResponse.class);
+
+ return billResponse;
+ }
+
+ public String getFetchBillURI(){
+ StringBuilder url = new StringBuilder(btrCalculatorConfigs.getBillingServiceHost());
+ url.append(btrCalculatorConfigs.getFetchBillEndpoint());
+ url.append("?");
+ url.append("tenantId=");
+ url.append("{1}");
+ url.append("&");
+ url.append("consumerCode=");
+ url.append("{2}");
+ url.append("&");
+ url.append("businessService=");
+ url.append("{3}");
+
+ return url.toString();
+ }
+}
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/util/MdmsUtil.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/util/MdmsUtil.java
new file mode 100644
index 00000000000..63442472db6
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/util/MdmsUtil.java
@@ -0,0 +1,78 @@
+package digit.util;
+
+import com.jayway.jsonpath.JsonPath;
+import lombok.extern.slf4j.Slf4j;
+import org.egov.common.contract.request.RequestInfo;
+import org.egov.mdms.model.MasterDetail;
+import org.egov.mdms.model.MdmsCriteria;
+import org.egov.mdms.model.MdmsCriteriaReq;
+import org.egov.mdms.model.ModuleDetail;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Slf4j
+@Component
+public class MdmsUtil {
+
+ @Autowired
+ private RestTemplate restTemplate;
+
+ @Value("${egov.mdms.host}")
+ private String mdmsHost;
+
+ @Value("${egov.mdms.search.endpoint}")
+ private String mdmsUrl;
+
+ @Value("${egov.mdms.master.name}")
+ private String masterName;
+
+ @Value("${egov.mdms.module.name}")
+ private String moduleName;
+
+
+ public Integer fetchRegistrationChargesFromMdms(RequestInfo requestInfo, String tenantId) {
+ StringBuilder uri = new StringBuilder();
+ uri.append(mdmsHost).append(mdmsUrl);
+ MdmsCriteriaReq mdmsCriteriaReq = getMdmsRequestForCategoryList(requestInfo, tenantId);
+ Object response = new HashMap<>();
+ Integer rate = 0;
+ try {
+ response = restTemplate.postForObject(uri.toString(), mdmsCriteriaReq, Map.class);
+ rate = JsonPath.read(response, "$.MdmsRes.BTR.RegistrationCharges.[0].amount");
+ } catch (Exception e) {
+ log.error("Exception occurred while fetching category lists from mdms: ", e);
+ }
+ //log.info(ulbToCategoryListMap.toString());
+ return rate;
+ }
+
+ private MdmsCriteriaReq getMdmsRequestForCategoryList(RequestInfo requestInfo, String tenantId) {
+ MasterDetail masterDetail = new MasterDetail();
+ masterDetail.setName(masterName);
+ List masterDetailList = new ArrayList<>();
+ masterDetailList.add(masterDetail);
+
+ ModuleDetail moduleDetail = new ModuleDetail();
+ moduleDetail.setMasterDetails(masterDetailList);
+ moduleDetail.setModuleName(moduleName);
+ List moduleDetailList = new ArrayList<>();
+ moduleDetailList.add(moduleDetail);
+
+ MdmsCriteria mdmsCriteria = new MdmsCriteria();
+ mdmsCriteria.setTenantId(tenantId.split("\\.")[0]);
+ mdmsCriteria.setModuleDetails(moduleDetailList);
+
+ MdmsCriteriaReq mdmsCriteriaReq = new MdmsCriteriaReq();
+ mdmsCriteriaReq.setMdmsCriteria(mdmsCriteria);
+ mdmsCriteriaReq.setRequestInfo(requestInfo);
+
+ return mdmsCriteriaReq;
+ }
+}
\ No newline at end of file
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/util/ResponseInfoFactory.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/util/ResponseInfoFactory.java
new file mode 100644
index 00000000000..5246bd6a9b5
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/util/ResponseInfoFactory.java
@@ -0,0 +1,25 @@
+package digit.util;
+
+import org.egov.common.contract.request.RequestInfo;
+import org.egov.common.contract.response.ResponseInfo;
+import org.springframework.stereotype.Component;
+
+@Component
+public class ResponseInfoFactory {
+
+ public ResponseInfo createResponseInfoFromRequestInfo(final RequestInfo requestInfo, final Boolean success) {
+
+ final String apiId = requestInfo != null ? requestInfo.getApiId() : "";
+ final String ver = requestInfo != null ? requestInfo.getVer() : "";
+ Long ts = null;
+ if (requestInfo != null)
+ ts = requestInfo.getTs();
+ final String resMsgId = "uief87324"; // FIXME : Hard-coded
+ final String msgId = requestInfo != null ? requestInfo.getMsgId() : "";
+ final String responseStatus = success ? "successful" : "failed";
+
+ return ResponseInfo.builder().apiId(apiId).ver(ver).ts(ts).resMsgId(resMsgId).msgId(msgId).resMsgId(resMsgId)
+ .status(responseStatus).build();
+ }
+
+}
\ No newline at end of file
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/controllers/V1ApiController.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/controllers/V1ApiController.java
new file mode 100644
index 00000000000..81ae7f4e311
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/controllers/V1ApiController.java
@@ -0,0 +1,64 @@
+package digit.web.controllers;
+
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import digit.service.CalculationService;
+import digit.service.DemandService;
+import digit.util.ResponseInfoFactory;
+import digit.web.models.*;
+import io.swagger.annotations.ApiParam;
+import org.egov.common.contract.request.RequestInfo;
+import org.egov.common.contract.response.ResponseInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-04T14:15:45.774+05:30")
+
+@Controller
+@RequestMapping("/v1")
+public class V1ApiController {
+
+ private final ObjectMapper objectMapper;
+
+ private final HttpServletRequest request;
+
+ @Autowired
+ private CalculationService calculationService;
+ @Autowired
+ private DemandService demandService;
+
+ @Autowired
+ private ResponseInfoFactory responseInfoFactory;
+
+ @Autowired
+ public V1ApiController(ObjectMapper objectMapper, HttpServletRequest request) {
+ this.objectMapper = objectMapper;
+ this.request = request;
+ }
+
+ @RequestMapping(value = "/_calculate", method = RequestMethod.POST)
+ public ResponseEntity v1CalculatePost(@ApiParam(value = "required parameters have to be populated", required = true) @Valid @RequestBody CalculationReq calculationReq) {
+ List calculations = calculationService.calculate(calculationReq);
+ ResponseInfo responseInfo = responseInfoFactory.createResponseInfoFromRequestInfo(calculationReq.getRequestInfo(),true);
+ CalculationRes calculationRes = CalculationRes.builder().responseInfo(responseInfo).calculation(calculations).build();
+ return new ResponseEntity(calculationRes, HttpStatus.OK);
+ }
+
+ @RequestMapping(value = "/_getbill", method = RequestMethod.POST)
+ public ResponseEntity v1GetbillPost(@NotNull @ApiParam(value = "Unique id for a tenant.", required = true) @Valid @RequestParam(value = "tenantId", required = true) String tenantId, @NotNull @ApiParam(value = "Unique birth registration application number.", required = true) @Valid @RequestParam(value = "applicationNumber", required = true) String applicationNumber, @ApiParam(value = "Parameter to carry Request metadata in the request body") @Valid @RequestBody RequestInfoWrapper requestInfoWrapper) {
+ BillResponse billResponse = demandService.getBill(requestInfoWrapper, tenantId, applicationNumber);
+ return new ResponseEntity(billResponse, HttpStatus.OK);
+ }
+
+}
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Address.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Address.java
new file mode 100644
index 00000000000..48939a7025f
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Address.java
@@ -0,0 +1,71 @@
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import lombok.*;
+import org.springframework.validation.annotation.Validated;
+
+/**
+ * Representation of a address. Indiavidual APIs may choose to extend from this using allOf if more details needed to be added in their case.
+ */
+@ApiModel(description = "Representation of a address. Indiavidual APIs may choose to extend from this using allOf if more details needed to be added in their case. ")
+@Validated
+@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-04T14:15:45.774+05:30")
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class Address {
+ @JsonProperty("tenantId")
+ private String tenantId = null;
+
+ @JsonProperty("doorNo")
+ private String doorNo = null;
+
+ @JsonProperty("latitude")
+ private Double latitude = null;
+
+ @JsonProperty("longitude")
+ private Double longitude = null;
+
+ @JsonProperty("addressId")
+ private String addressId = null;
+
+ @JsonProperty("addressNumber")
+ private String addressNumber = null;
+
+ @JsonProperty("type")
+ private String type = null;
+
+ @JsonProperty("addressLine1")
+ private String addressLine1 = null;
+
+ @JsonProperty("addressLine2")
+ private String addressLine2 = null;
+
+ @JsonProperty("landmark")
+ private String landmark = null;
+
+ @JsonProperty("city")
+ private String city = null;
+
+ @JsonProperty("pincode")
+ private String pincode = null;
+
+ @JsonProperty("detail")
+ private String detail = null;
+
+ @JsonProperty("buildingName")
+ private String buildingName = null;
+
+ @JsonProperty("street")
+ private String street = null;
+
+ @JsonProperty("locality")
+ private Boundary locality = null;
+
+
+}
+
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Applicant.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Applicant.java
new file mode 100644
index 00000000000..b5faef81826
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Applicant.java
@@ -0,0 +1,142 @@
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import lombok.*;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import java.time.LocalDate;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Details of the user applying for birth registration
+ */
+@ApiModel(description = "Details of the user applying for birth registration")
+@Validated
+@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-04T14:15:45.774+05:30")
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class Applicant {
+ @JsonProperty("id")
+ private Long id = null;
+
+ @JsonProperty("userName")
+ private String userName = null;
+
+ @JsonProperty("password")
+ private String password = null;
+
+ @JsonProperty("salutation")
+ private String salutation = null;
+
+ @JsonProperty("name")
+ private String name = null;
+
+ @JsonProperty("gender")
+ private String gender = null;
+
+ @JsonProperty("mobileNumber")
+ private String mobileNumber = null;
+
+ @JsonProperty("emailId")
+ private String emailId = null;
+
+ @JsonProperty("altContactNumber")
+ private String altContactNumber = null;
+
+ @JsonProperty("pan")
+ private String pan = null;
+
+ @JsonProperty("aadhaarNumber")
+ private String aadhaarNumber = null;
+
+ @JsonProperty("permanentAddress")
+ private String permanentAddress = null;
+
+ @JsonProperty("permanentCity")
+ private String permanentCity = null;
+
+ @JsonProperty("permanentPincode")
+ private String permanentPincode = null;
+
+ @JsonProperty("correspondenceCity")
+ private String correspondenceCity = null;
+
+ @JsonProperty("correspondencePincode")
+ private String correspondencePincode = null;
+
+ @JsonProperty("correspondenceAddress")
+ private String correspondenceAddress = null;
+
+ @JsonProperty("active")
+ private Boolean active = null;
+
+ @JsonProperty("dob")
+ private LocalDate dob = null;
+
+ @JsonProperty("pwdExpiryDate")
+ private LocalDate pwdExpiryDate = null;
+
+ @JsonProperty("locale")
+ private String locale = null;
+
+ @JsonProperty("type")
+ private String type = null;
+
+ @JsonProperty("signature")
+ private String signature = null;
+
+ @JsonProperty("accountLocked")
+ private Boolean accountLocked = null;
+
+ @JsonProperty("roles")
+ @Valid
+ private List roles = null;
+
+ @JsonProperty("fatherOrHusbandName")
+ private String fatherOrHusbandName = null;
+
+ @JsonProperty("bloodGroup")
+ private String bloodGroup = null;
+
+ @JsonProperty("identificationMark")
+ private String identificationMark = null;
+
+ @JsonProperty("photo")
+ private String photo = null;
+
+ @JsonProperty("createdBy")
+ private Long createdBy = null;
+
+ @JsonProperty("createdDate")
+ private LocalDate createdDate = null;
+
+ @JsonProperty("lastModifiedBy")
+ private Long lastModifiedBy = null;
+
+ @JsonProperty("lastModifiedDate")
+ private LocalDate lastModifiedDate = null;
+
+ @JsonProperty("otpReference")
+ private String otpReference = null;
+
+ @JsonProperty("tenantId")
+ private String tenantId = null;
+
+
+ public Applicant addRolesItem(Role rolesItem) {
+ if (this.roles == null) {
+ this.roles = new ArrayList<>();
+ }
+ this.roles.add(rolesItem);
+ return this;
+ }
+
+}
+
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/AuditDetails.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/AuditDetails.java
new file mode 100644
index 00000000000..6cf772169a1
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/AuditDetails.java
@@ -0,0 +1,35 @@
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import lombok.*;
+import org.springframework.validation.annotation.Validated;
+
+/**
+ * Collection of audit related fields used by most models
+ */
+@ApiModel(description = "Collection of audit related fields used by most models")
+@Validated
+@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-04T14:15:45.774+05:30")
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class AuditDetails {
+ @JsonProperty("createdBy")
+ private String createdBy = null;
+
+ @JsonProperty("lastModifiedBy")
+ private String lastModifiedBy = null;
+
+ @JsonProperty("createdTime")
+ private Long createdTime = null;
+
+ @JsonProperty("lastModifiedTime")
+ private Long lastModifiedTime = null;
+
+
+}
+
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/AuditDetails2.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/AuditDetails2.java
new file mode 100644
index 00000000000..9d8a4d997fd
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/AuditDetails2.java
@@ -0,0 +1,35 @@
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import lombok.*;
+import org.springframework.validation.annotation.Validated;
+
+/**
+ * Collection of audit related fields used by most models
+ */
+@ApiModel(description = "Collection of audit related fields used by most models")
+@Validated
+@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-04T14:15:45.774+05:30")
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class AuditDetails2 {
+ @JsonProperty("createdBy")
+ private String createdBy = null;
+
+ @JsonProperty("lastModifiedBy")
+ private String lastModifiedBy = null;
+
+ @JsonProperty("createdTime")
+ private Long createdTime = null;
+
+ @JsonProperty("lastModifiedTime")
+ private Long lastModifiedTime = null;
+
+
+}
+
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Bill.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Bill.java
new file mode 100644
index 00000000000..d58fa3e9a18
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Bill.java
@@ -0,0 +1,79 @@
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.*;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Bill
+ */
+@Validated
+@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-04T14:15:45.774+05:30")
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class Bill {
+ @JsonProperty("id")
+ private String id = null;
+
+ @JsonProperty("mobileNumber")
+ private String mobileNumber = null;
+
+ @JsonProperty("payerName")
+ private String payerName = null;
+
+ @JsonProperty("payerAddress")
+ private String payerAddress = null;
+
+ @JsonProperty("payerEmail")
+ private String payerEmail = null;
+
+ @JsonProperty("isActive")
+ private Boolean isActive = null;
+
+ @JsonProperty("isCancelled")
+ private Boolean isCancelled = null;
+
+ @JsonProperty("additionalDetails")
+ private Object additionalDetails = null;
+
+ @JsonProperty("taxAndPayments")
+ @Valid
+ private List taxAndPayments = null;
+
+ @JsonProperty("billDetails")
+ @Valid
+ private List billDetails = null;
+
+ @JsonProperty("tenantId")
+ private String tenantId = null;
+
+ @JsonProperty("auditDetails")
+ private AuditDetails auditDetails = null;
+
+
+ public Bill addTaxAndPaymentsItem(TaxAndPayment taxAndPaymentsItem) {
+ if (this.taxAndPayments == null) {
+ this.taxAndPayments = new ArrayList<>();
+ }
+ this.taxAndPayments.add(taxAndPaymentsItem);
+ return this;
+ }
+
+ public Bill addBillDetailsItem(BillDetail billDetailsItem) {
+ if (this.billDetails == null) {
+ this.billDetails = new ArrayList<>();
+ }
+ this.billDetails.add(billDetailsItem);
+ return this;
+ }
+
+}
+
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/BillAccountDetail.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/BillAccountDetail.java
new file mode 100644
index 00000000000..1e9fa4636f3
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/BillAccountDetail.java
@@ -0,0 +1,93 @@
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonValue;
+import lombok.*;
+import org.springframework.validation.annotation.Validated;
+
+import java.math.BigDecimal;
+
+/**
+ * BillAccountDetail
+ */
+@Validated
+@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-04T14:15:45.774+05:30")
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class BillAccountDetail {
+ @JsonProperty("id")
+ private String id = null;
+
+ @JsonProperty("tenantId")
+ private String tenantId = null;
+
+ @JsonProperty("billDetail")
+ private String billDetail = null;
+
+ @JsonProperty("demandDetailId")
+ private String demandDetailId = null;
+
+ @JsonProperty("order")
+ private Integer order = null;
+
+ @JsonProperty("amount")
+ private BigDecimal amount = null;
+
+ @JsonProperty("adjustedAmount")
+ private BigDecimal adjustedAmount = null;
+
+ @JsonProperty("isActualDemand")
+ private Boolean isActualDemand = null;
+
+ @JsonProperty("glcode")
+ private String glcode = null;
+
+ @JsonProperty("taxHeadCode")
+ private String taxHeadCode = null;
+
+ @JsonProperty("additionalDetails")
+ private Object additionalDetails = null;
+ @JsonProperty("purpose")
+ private PurposeEnum purpose = null;
+
+ /**
+ * Purpose of Account head.
+ */
+ public enum PurposeEnum {
+ ARREAR("ARREAR"),
+
+ CURRENT("CURRENT"),
+
+ ADVANCE("ADVANCE");
+
+ private String value;
+
+ PurposeEnum(String value) {
+ this.value = value;
+ }
+
+ @JsonCreator
+ public static PurposeEnum fromValue(String text) {
+ for (PurposeEnum b : PurposeEnum.values()) {
+ if (String.valueOf(b.value).equals(text)) {
+ return b;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ @JsonValue
+ public String toString() {
+ return String.valueOf(value);
+ }
+ }
+
+
+}
+
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/BillDetail.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/BillDetail.java
new file mode 100644
index 00000000000..d6bb5f98134
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/BillDetail.java
@@ -0,0 +1,134 @@
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonValue;
+import lombok.*;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * BillDetail
+ */
+@Validated
+@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-04T14:15:45.774+05:30")
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class BillDetail {
+ @JsonProperty("id")
+ private String id = null;
+
+ @JsonProperty("tenantId")
+ private String tenantId = null;
+
+ @JsonProperty("demandId")
+ private String demandId = null;
+
+ @JsonProperty("bill")
+ private String bill = null;
+
+ @JsonProperty("businessService")
+ private String businessService = null;
+
+ @JsonProperty("billNumber")
+ private String billNumber = null;
+
+ @JsonProperty("billDate")
+ private BigDecimal billDate = null;
+
+ @JsonProperty("consumerCode")
+ private String consumerCode = null;
+
+ @JsonProperty("consumerType")
+ private String consumerType = null;
+
+ @JsonProperty("minimumAmount")
+ private BigDecimal minimumAmount = null;
+
+ @JsonProperty("totalAmount")
+ private BigDecimal totalAmount = null;
+
+ @JsonProperty("fromPeriod")
+ private BigDecimal fromPeriod = null;
+
+ @JsonProperty("toPeriod")
+ private BigDecimal toPeriod = null;
+
+ @JsonProperty("collectedAmount")
+ private BigDecimal collectedAmount = null;
+
+ @JsonProperty("collectionModesNotAllowed")
+ @Valid
+ private List collectionModesNotAllowed = null;
+
+ @JsonProperty("partPaymentAllowed")
+ private Boolean partPaymentAllowed = null;
+
+ @JsonProperty("additionalDetails")
+ private Object additionalDetails = null;
+
+ @JsonProperty("billAccountDetails")
+ @Valid
+ private List billAccountDetails = null;
+ @JsonProperty("status")
+ private StatusEnum status = null;
+
+ public BillDetail addCollectionModesNotAllowedItem(String collectionModesNotAllowedItem) {
+ if (this.collectionModesNotAllowed == null) {
+ this.collectionModesNotAllowed = new ArrayList<>();
+ }
+ this.collectionModesNotAllowed.add(collectionModesNotAllowedItem);
+ return this;
+ }
+
+ public BillDetail addBillAccountDetailsItem(BillAccountDetail billAccountDetailsItem) {
+ if (this.billAccountDetails == null) {
+ this.billAccountDetails = new ArrayList<>();
+ }
+ this.billAccountDetails.add(billAccountDetailsItem);
+ return this;
+ }
+
+ /**
+ * status if the bill detail
+ */
+ public enum StatusEnum {
+ CREATED("CREATED"),
+
+ CANCELLED("CANCELLED"),
+
+ INSTRUMENT_BOUNCED("INSTRUMENT_BOUNCED");
+
+ private String value;
+
+ StatusEnum(String value) {
+ this.value = value;
+ }
+
+ @JsonCreator
+ public static StatusEnum fromValue(String text) {
+ for (StatusEnum b : StatusEnum.values()) {
+ if (String.valueOf(b.value).equals(text)) {
+ return b;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ @JsonValue
+ public String toString() {
+ return String.valueOf(value);
+ }
+ }
+
+}
+
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/BillResponse.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/BillResponse.java
new file mode 100644
index 00000000000..3a2b7e94b5e
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/BillResponse.java
@@ -0,0 +1,29 @@
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.egov.common.contract.response.ResponseInfo;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * BillResponse
+ */
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class BillResponse {
+
+ @JsonProperty("ResposneInfo")
+ private ResponseInfo resposneInfo = null;
+
+ @JsonProperty("Bill")
+ private List bill = new ArrayList<>();
+
+}
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/BirthRegistrationApplication.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/BirthRegistrationApplication.java
new file mode 100644
index 00000000000..667ab64d0ce
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/BirthRegistrationApplication.java
@@ -0,0 +1,65 @@
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import lombok.*;
+import org.springframework.validation.annotation.Validated;
+
+/**
+ * A Object holds the basic data for a Birth Registration Application
+ */
+@ApiModel(description = "A Object holds the basic data for a Birth Registration Application")
+@Validated
+@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-04T14:15:45.774+05:30")
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class BirthRegistrationApplication {
+ @JsonProperty("id")
+ private String id = null;
+
+ @JsonProperty("tenantId")
+ private String tenantId = null;
+
+ @JsonProperty("applicationNumber")
+ private String applicationNumber = null;
+
+ @JsonProperty("babyFirstName")
+ private String babyFirstName = null;
+
+ @JsonProperty("babyLastName")
+ private String babyLastName = null;
+
+ @JsonProperty("fathertName")
+ private String fathertName = null;
+
+ @JsonProperty("motherName")
+ private String motherName = null;
+
+ @JsonProperty("doctorAttendingBirth")
+ private String doctorAttendingBirth = null;
+
+ @JsonProperty("hospitalName")
+ private String hospitalName = null;
+
+ @JsonProperty("placeOfBirth")
+ private String placeOfBirth = null;
+
+ @JsonProperty("dateOfBirth")
+ private Integer dateOfBirth = null;
+
+ @JsonProperty("address")
+ private Address address = null;
+
+ @JsonProperty("applicant")
+ private Applicant applicant = null;
+
+ @JsonProperty("auditDetails")
+ private AuditDetails2 auditDetails = null;
+
+
+}
+
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Boundary.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Boundary.java
new file mode 100644
index 00000000000..975d89407c2
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Boundary.java
@@ -0,0 +1,55 @@
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.*;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Boundary
+ */
+@Validated
+@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-04T14:15:45.774+05:30")
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class Boundary {
+ @JsonProperty("code")
+ private String code = null;
+
+ @JsonProperty("name")
+ private String name = null;
+
+ @JsonProperty("label")
+ private String label = null;
+
+ @JsonProperty("latitude")
+ private String latitude = null;
+
+ @JsonProperty("longitude")
+ private String longitude = null;
+
+ @JsonProperty("children")
+ @Valid
+ private List children = null;
+
+ @JsonProperty("materializedPath")
+ private String materializedPath = null;
+
+
+ public Boundary addChildrenItem(Boundary childrenItem) {
+ if (this.children == null) {
+ this.children = new ArrayList<>();
+ }
+ this.children.add(childrenItem);
+ return this;
+ }
+
+}
+
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Calculation.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Calculation.java
new file mode 100644
index 00000000000..78fc5103e69
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Calculation.java
@@ -0,0 +1,30 @@
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.*;
+import org.springframework.validation.annotation.Validated;
+
+/**
+ * Calculation
+ */
+@Validated
+@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-04T14:15:45.774+05:30")
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class Calculation {
+ @JsonProperty("applicationNumber")
+ private String applicationNumber = null;
+
+ @JsonProperty("totalAmount")
+ private Double totalAmount = null;
+
+ @JsonProperty("tenantId")
+ private String tenantId = null;
+
+
+}
+
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/CalculationCriteria.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/CalculationCriteria.java
new file mode 100644
index 00000000000..6795983fcc7
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/CalculationCriteria.java
@@ -0,0 +1,32 @@
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import lombok.*;
+import org.springframework.validation.annotation.Validated;
+
+/**
+ * Criteria to calculate charges for birth registration.
+ */
+@ApiModel(description = "Criteria to calculate charges for birth registration.")
+@Validated
+@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-04T14:15:45.774+05:30")
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class CalculationCriteria {
+ @JsonProperty("birthregistrationapplication")
+ private BirthRegistrationApplication birthregistrationapplication = null;
+
+ @JsonProperty("applicationNumber")
+ private String applicationNumber = null;
+
+ @JsonProperty("tenantId")
+ private String tenantId = null;
+
+
+}
+
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/CalculationReq.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/CalculationReq.java
new file mode 100644
index 00000000000..8f521ac8020
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/CalculationReq.java
@@ -0,0 +1,38 @@
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.*;
+import org.egov.common.contract.request.RequestInfo;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * CalculationReq
+ */
+@Validated
+@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-04T14:15:45.774+05:30")
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class CalculationReq {
+ @JsonProperty("RequestInfo")
+ private RequestInfo requestInfo = null;
+
+ @JsonProperty("CalculationCriteria")
+ @Valid
+ private List calculationCriteria = new ArrayList<>();
+
+
+ public CalculationReq addCalculationCriteriaItem(CalculationCriteria calculationCriteriaItem) {
+ this.calculationCriteria.add(calculationCriteriaItem);
+ return this;
+ }
+
+}
+
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/CalculationRes.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/CalculationRes.java
new file mode 100644
index 00000000000..bba37735840
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/CalculationRes.java
@@ -0,0 +1,41 @@
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.*;
+import org.egov.common.contract.response.ResponseInfo;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * CalculationRes
+ */
+@Validated
+@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-04T14:15:45.774+05:30")
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class CalculationRes {
+ @JsonProperty("ResponseInfo")
+ private ResponseInfo responseInfo = null;
+
+ @JsonProperty("Calculation")
+ @Valid
+ private List calculation = null;
+
+
+ public CalculationRes addCalculationItem(Calculation calculationItem) {
+ if (this.calculation == null) {
+ this.calculation = new ArrayList<>();
+ }
+ this.calculation.add(calculationItem);
+ return this;
+ }
+
+}
+
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Demand.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Demand.java
new file mode 100644
index 00000000000..085b3fda522
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Demand.java
@@ -0,0 +1,145 @@
+/*
+ * eGov suite of products aim to improve the internal efficiency,transparency,
+ * accountability and the service delivery of the government organizations.
+ *
+ * Copyright (C) <2015> eGovernments Foundation
+ *
+ * The updated version of eGov suite of products as by eGovernments Foundation
+ * is available at http://www.egovernments.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/ or
+ * http://www.gnu.org/licenses/gpl.html .
+ *
+ * In addition to the terms of the GPL license to be adhered to in using this
+ * program, the following additional terms are to be complied with:
+ *
+ * 1) All versions of this program, verbatim or modified must carry this
+ * Legal Notice.
+ *
+ * 2) Any misrepresentation of the origin of the material is prohibited. It
+ * is required that all modified versions of this material be marked in
+ * reasonable ways as different from the original version.
+ *
+ * 3) This license does not grant any rights to any user of the program
+ * with regards to rights under trademark law for use of the trade names
+ * or trademarks of eGovernments Foundation.
+ *
+ * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org.
+ */
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonValue;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.egov.common.contract.request.User;
+
+import javax.validation.Valid;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class Demand {
+
+ @JsonProperty("id")
+ private String id;
+
+ @JsonProperty("tenantId")
+ private String tenantId;
+
+ @JsonProperty("consumerCode")
+ private String consumerCode;
+
+ @JsonProperty("consumerType")
+ private String consumerType;
+
+ @JsonProperty("businessService")
+ private String businessService;
+
+ @Valid
+ @JsonProperty("payer")
+ private User payer;
+
+ @JsonProperty("taxPeriodFrom")
+ private Long taxPeriodFrom;
+
+ @JsonProperty("taxPeriodTo")
+ private Long taxPeriodTo;
+
+ @Builder.Default
+ @JsonProperty("demandDetails")
+ @Valid
+ private List demandDetails = new ArrayList<>();
+
+ @JsonProperty("auditDetails")
+ private AuditDetails auditDetails;
+
+ @JsonProperty("additionalDetails")
+ private Object additionalDetails;
+
+ @Builder.Default
+ @JsonProperty("minimumAmountPayable")
+ private BigDecimal minimumAmountPayable = BigDecimal.ZERO;
+
+ /**
+ * Gets or Sets status
+ */
+ public enum DemandStatusEnum {
+
+ ACTIVE("ACTIVE"),
+
+ CANCELLED("CANCELLED"),
+
+ ADJUSTED("ADJUSTED");
+
+ private String value;
+
+ DemandStatusEnum(String value) {
+ this.value = value;
+ }
+
+ @Override
+ @JsonValue
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ @JsonCreator
+ public static DemandStatusEnum fromValue(String text) {
+ for (DemandStatusEnum b : DemandStatusEnum.values()) {
+ if (String.valueOf(b.value).equalsIgnoreCase(text)) {
+ return b;
+ }
+ }
+ return null;
+ }
+ }
+
+ @JsonProperty("status")
+ private DemandStatusEnum status;
+
+
+ public Demand addDemandDetailsItem(DemandDetail demandDetailsItem) {
+ this.demandDetails.add(demandDetailsItem);
+ return this;
+ }
+
+}
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/DemandDetail.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/DemandDetail.java
new file mode 100644
index 00000000000..646870dc44d
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/DemandDetail.java
@@ -0,0 +1,73 @@
+/*
+ * eGov suite of products aim to improve the internal efficiency,transparency,
+ * accountability and the service delivery of the government organizations.
+ *
+ * Copyright (C) <2015> eGovernments Foundation
+ *
+ * The updated version of eGov suite of products as by eGovernments Foundation
+ * is available at http://www.egovernments.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/ or
+ * http://www.gnu.org/licenses/gpl.html .
+ *
+ * In addition to the terms of the GPL license to be adhered to in using this
+ * program, the following additional terms are to be complied with:
+ *
+ * 1) All versions of this program, verbatim or modified must carry this
+ * Legal Notice.
+ *
+ * 2) Any misrepresentation of the origin of the material is prohibited. It
+ * is required that all modified versions of this material be marked in
+ * reasonable ways as different from the original version.
+ *
+ * 3) This license does not grant any rights to any user of the program
+ * with regards to rights under trademark law for use of the trade names
+ * or trademarks of eGovernments Foundation.
+ *
+ * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org.
+ */
+package digit.web.models;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.validation.constraints.NotNull;
+import java.math.BigDecimal;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class DemandDetail {
+
+ private String id;
+
+ private String demandId;
+
+ @NotNull
+ private String taxHeadMasterCode;
+
+ @NotNull
+ private BigDecimal taxAmount;
+
+ @NotNull
+ @Builder.Default
+ private BigDecimal collectionAmount = BigDecimal.valueOf(0d);
+
+ private AuditDetails auditDetails;
+
+ private String tenantId;
+}
\ No newline at end of file
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/DemandRequest.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/DemandRequest.java
new file mode 100644
index 00000000000..fd41366cdb3
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/DemandRequest.java
@@ -0,0 +1,68 @@
+/*
+ * eGov suite of products aim to improve the internal efficiency,transparency,
+ * accountability and the service delivery of the government organizations.
+ *
+ * Copyright (C) <2015> eGovernments Foundation
+ *
+ * The updated version of eGov suite of products as by eGovernments Foundation
+ * is available at http://www.egovernments.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/ or
+ * http://www.gnu.org/licenses/gpl.html .
+ *
+ * In addition to the terms of the GPL license to be adhered to in using this
+ * program, the following additional terms are to be complied with:
+ *
+ * 1) All versions of this program, verbatim or modified must carry this
+ * Legal Notice.
+ *
+ * 2) Any misrepresentation of the origin of the material is prohibited. It
+ * is required that all modified versions of this material be marked in
+ * reasonable ways as different from the original version.
+ *
+ * 3) This license does not grant any rights to any user of the program
+ * with regards to rights under trademark law for use of the trade names
+ * or trademarks of eGovernments Foundation.
+ *
+ * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org.
+ */
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.egov.common.contract.request.RequestInfo;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class DemandRequest {
+
+ @NotNull
+ @JsonProperty("RequestInfo")
+ private RequestInfo requestInfo;
+
+ @Valid
+ @NotNull
+ @JsonProperty("Demands")
+ private List demands = new ArrayList<>();
+}
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/DemandResponse.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/DemandResponse.java
new file mode 100644
index 00000000000..a6e8f4a3e84
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/DemandResponse.java
@@ -0,0 +1,64 @@
+/*
+ * eGov suite of products aim to improve the internal efficiency,transparency,
+ * accountability and the service delivery of the government organizations.
+ *
+ * Copyright (C) <2015> eGovernments Foundation
+ *
+ * The updated version of eGov suite of products as by eGovernments Foundation
+ * is available at http://www.egovernments.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/ or
+ * http://www.gnu.org/licenses/gpl.html .
+ *
+ * In addition to the terms of the GPL license to be adhered to in using this
+ * program, the following additional terms are to be complied with:
+ *
+ * 1) All versions of this program, verbatim or modified must carry this
+ * Legal Notice.
+ *
+ * 2) Any misrepresentation of the origin of the material is prohibited. It
+ * is required that all modified versions of this material be marked in
+ * reasonable ways as different from the original version.
+ *
+ * 3) This license does not grant any rights to any user of the program
+ * with regards to rights under trademark law for use of the trade names
+ * or trademarks of eGovernments Foundation.
+ *
+ * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org.
+ */
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.egov.common.contract.response.ResponseInfo;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class DemandResponse {
+
+ @JsonProperty("ResponseInfo")
+ private ResponseInfo responseInfo;
+
+ @JsonProperty("Demands")
+ private List demands = new ArrayList<>();
+
+}
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Error.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Error.java
new file mode 100644
index 00000000000..a0ec8f68b18
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Error.java
@@ -0,0 +1,48 @@
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import lombok.*;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Error object will be returned as a part of reponse body in conjunction with ResponseInfo as part of ErrorResponse whenever the request processing status in the ResponseInfo is FAILED. HTTP return in this scenario will usually be HTTP 400.
+ */
+@ApiModel(description = "Error object will be returned as a part of reponse body in conjunction with ResponseInfo as part of ErrorResponse whenever the request processing status in the ResponseInfo is FAILED. HTTP return in this scenario will usually be HTTP 400.")
+@Validated
+@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-04T14:15:45.774+05:30")
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class Error {
+ @JsonProperty("code")
+ private String code = null;
+
+ @JsonProperty("message")
+ private String message = null;
+
+ @JsonProperty("description")
+ private String description = null;
+
+ @JsonProperty("params")
+ @Valid
+ private List params = null;
+
+
+ public Error addParamsItem(String paramsItem) {
+ if (this.params == null) {
+ this.params = new ArrayList<>();
+ }
+ this.params.add(paramsItem);
+ return this;
+ }
+
+}
+
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/ErrorRes.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/ErrorRes.java
new file mode 100644
index 00000000000..900e4b7864e
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/ErrorRes.java
@@ -0,0 +1,43 @@
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import lombok.*;
+import org.egov.common.contract.response.ResponseInfo;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * All APIs will return ErrorRes in case of failure which will carry ResponseInfo as metadata and Error object as actual representation of error. In case of bulk apis, some apis may chose to return the array of Error objects to indicate individual failure.
+ */
+@ApiModel(description = "All APIs will return ErrorRes in case of failure which will carry ResponseInfo as metadata and Error object as actual representation of error. In case of bulk apis, some apis may chose to return the array of Error objects to indicate individual failure.")
+@Validated
+@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-04T14:15:45.774+05:30")
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class ErrorRes {
+ @JsonProperty("ResponseInfo")
+ private ResponseInfo responseInfo = null;
+
+ @JsonProperty("Errors")
+ @Valid
+ private List errors = null;
+
+
+ public ErrorRes addErrorsItem(Error errorsItem) {
+ if (this.errors == null) {
+ this.errors = new ArrayList<>();
+ }
+ this.errors.add(errorsItem);
+ return this;
+ }
+
+}
+
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/RequestInfoWrapper.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/RequestInfoWrapper.java
new file mode 100644
index 00000000000..159afaa299f
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/RequestInfoWrapper.java
@@ -0,0 +1,22 @@
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.egov.common.contract.request.RequestInfo;
+
+import javax.validation.constraints.NotNull;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class RequestInfoWrapper {
+
+ @NotNull
+ @JsonProperty("RequestInfo")
+ private RequestInfo requestInfo;
+
+}
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Role.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Role.java
new file mode 100644
index 00000000000..80bf1ebfd30
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Role.java
@@ -0,0 +1,50 @@
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.*;
+import org.springframework.validation.annotation.Validated;
+
+import java.time.LocalDate;
+
+/**
+ * Role
+ */
+@Validated
+@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-04T14:15:45.774+05:30")
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class Role {
+ @JsonProperty("id")
+ private Long id = null;
+
+ @JsonProperty("name")
+ private String name = null;
+
+ @JsonProperty("code")
+ private String code = null;
+
+ @JsonProperty("description")
+ private String description = null;
+
+ @JsonProperty("createdBy")
+ private Long createdBy = null;
+
+ @JsonProperty("createdDate")
+ private LocalDate createdDate = null;
+
+ @JsonProperty("lastModifiedBy")
+ private Long lastModifiedBy = null;
+
+ @JsonProperty("lastModifiedDate")
+ private LocalDate lastModifiedDate = null;
+
+ @JsonProperty("tenantId")
+ private String tenantId = null;
+
+
+}
+
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Role2.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Role2.java
new file mode 100644
index 00000000000..c2fc5f8e641
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/Role2.java
@@ -0,0 +1,32 @@
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import lombok.*;
+import org.springframework.validation.annotation.Validated;
+
+/**
+ * minimal representation of the Roles in the system to be carried along in UserInfo with RequestInfo meta data. Actual authorization service to extend this to have more role related attributes
+ */
+@ApiModel(description = "minimal representation of the Roles in the system to be carried along in UserInfo with RequestInfo meta data. Actual authorization service to extend this to have more role related attributes ")
+@Validated
+@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-04T14:15:45.774+05:30")
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class Role2 {
+ @JsonProperty("name")
+ private String name = null;
+
+ @JsonProperty("code")
+ private String code = null;
+
+ @JsonProperty("description")
+ private String description = null;
+
+
+}
+
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/TaxAndPayment.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/TaxAndPayment.java
new file mode 100644
index 00000000000..6ca8f0591d6
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/TaxAndPayment.java
@@ -0,0 +1,30 @@
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.*;
+import org.springframework.validation.annotation.Validated;
+
+/**
+ * TaxAndPayment
+ */
+@Validated
+@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-04T14:15:45.774+05:30")
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class TaxAndPayment {
+ @JsonProperty("businessService")
+ private String businessService = null;
+
+ @JsonProperty("taxAmount")
+ private String taxAmount = null;
+
+ @JsonProperty("amountPaid")
+ private String amountPaid = null;
+
+
+}
+
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/TenantRole.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/TenantRole.java
new file mode 100644
index 00000000000..ca143571325
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/TenantRole.java
@@ -0,0 +1,39 @@
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import lombok.*;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * User role carries the tenant related role information for the user. A user can have multiple roles per tenant based on the need of the tenant. A user may also have multiple roles for multiple tenants.
+ */
+@ApiModel(description = "User role carries the tenant related role information for the user. A user can have multiple roles per tenant based on the need of the tenant. A user may also have multiple roles for multiple tenants.")
+@Validated
+@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-04T14:15:45.774+05:30")
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class TenantRole {
+ @JsonProperty("tenantId")
+ private String tenantId = null;
+
+ @JsonProperty("roles")
+ @Valid
+ private List roles = new ArrayList<>();
+
+
+ public TenantRole addRolesItem(Role rolesItem) {
+ this.roles.add(rolesItem);
+ return this;
+ }
+
+}
+
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/User.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/User.java
new file mode 100644
index 00000000000..d09708f429a
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/User.java
@@ -0,0 +1,140 @@
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.*;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import java.time.LocalDate;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * User
+ */
+@Validated
+@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-04T14:15:45.774+05:30")
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class User {
+ @JsonProperty("id")
+ private Long id = null;
+
+ @JsonProperty("userName")
+ private String userName = null;
+
+ @JsonProperty("password")
+ private String password = null;
+
+ @JsonProperty("salutation")
+ private String salutation = null;
+
+ @JsonProperty("name")
+ private String name = null;
+
+ @JsonProperty("gender")
+ private String gender = null;
+
+ @JsonProperty("mobileNumber")
+ private String mobileNumber = null;
+
+ @JsonProperty("emailId")
+ private String emailId = null;
+
+ @JsonProperty("altContactNumber")
+ private String altContactNumber = null;
+
+ @JsonProperty("pan")
+ private String pan = null;
+
+ @JsonProperty("aadhaarNumber")
+ private String aadhaarNumber = null;
+
+ @JsonProperty("permanentAddress")
+ private String permanentAddress = null;
+
+ @JsonProperty("permanentCity")
+ private String permanentCity = null;
+
+ @JsonProperty("permanentPincode")
+ private String permanentPincode = null;
+
+ @JsonProperty("correspondenceCity")
+ private String correspondenceCity = null;
+
+ @JsonProperty("correspondencePincode")
+ private String correspondencePincode = null;
+
+ @JsonProperty("correspondenceAddress")
+ private String correspondenceAddress = null;
+
+ @JsonProperty("active")
+ private Boolean active = null;
+
+ @JsonProperty("dob")
+ private LocalDate dob = null;
+
+ @JsonProperty("pwdExpiryDate")
+ private LocalDate pwdExpiryDate = null;
+
+ @JsonProperty("locale")
+ private String locale = null;
+
+ @JsonProperty("type")
+ private String type = null;
+
+ @JsonProperty("signature")
+ private String signature = null;
+
+ @JsonProperty("accountLocked")
+ private Boolean accountLocked = null;
+
+ @JsonProperty("roles")
+ @Valid
+ private List roles = null;
+
+ @JsonProperty("fatherOrHusbandName")
+ private String fatherOrHusbandName = null;
+
+ @JsonProperty("bloodGroup")
+ private String bloodGroup = null;
+
+ @JsonProperty("identificationMark")
+ private String identificationMark = null;
+
+ @JsonProperty("photo")
+ private String photo = null;
+
+ @JsonProperty("createdBy")
+ private Long createdBy = null;
+
+ @JsonProperty("createdDate")
+ private LocalDate createdDate = null;
+
+ @JsonProperty("lastModifiedBy")
+ private Long lastModifiedBy = null;
+
+ @JsonProperty("lastModifiedDate")
+ private LocalDate lastModifiedDate = null;
+
+ @JsonProperty("otpReference")
+ private String otpReference = null;
+
+ @JsonProperty("tenantId")
+ private String tenantId = null;
+
+
+ public User addRolesItem(Role rolesItem) {
+ if (this.roles == null) {
+ this.roles = new ArrayList<>();
+ }
+ this.roles.add(rolesItem);
+ return this;
+ }
+
+}
+
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/UserInfo.java b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/UserInfo.java
new file mode 100644
index 00000000000..61c4dc45cfb
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/java/digit/web/models/UserInfo.java
@@ -0,0 +1,69 @@
+package digit.web.models;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import lombok.*;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * This is acting ID token of the authenticated user on the server. Any value provided by the clients will be ignored and actual user based on authtoken will be used on the server.
+ */
+@ApiModel(description = "This is acting ID token of the authenticated user on the server. Any value provided by the clients will be ignored and actual user based on authtoken will be used on the server.")
+@Validated
+@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-04T14:15:45.774+05:30")
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class UserInfo {
+ @JsonProperty("tenantId")
+ private String tenantId = null;
+
+ @JsonProperty("uuid")
+ private String uuid = null;
+
+ @JsonProperty("userName")
+ private String userName = null;
+
+ @JsonProperty("password")
+ private String password = null;
+
+ @JsonProperty("idToken")
+ private String idToken = null;
+
+ @JsonProperty("mobile")
+ private String mobile = null;
+
+ @JsonProperty("email")
+ private String email = null;
+
+ @JsonProperty("primaryrole")
+ @Valid
+ private List primaryrole = new ArrayList<>();
+
+ @JsonProperty("additionalroles")
+ @Valid
+ private List additionalroles = null;
+
+
+ public UserInfo addPrimaryroleItem(Role primaryroleItem) {
+ this.primaryrole.add(primaryroleItem);
+ return this;
+ }
+
+ public UserInfo addAdditionalrolesItem(TenantRole additionalrolesItem) {
+ if (this.additionalroles == null) {
+ this.additionalroles = new ArrayList<>();
+ }
+ this.additionalroles.add(additionalrolesItem);
+ return this;
+ }
+
+}
+
diff --git a/tutorials/Assignment-2/btr-calculator/src/main/resources/application.properties b/tutorials/Assignment-2/btr-calculator/src/main/resources/application.properties
new file mode 100644
index 00000000000..76fe1effc1c
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/main/resources/application.properties
@@ -0,0 +1,17 @@
+server.servlet.contextPath=/birth-calculator
+server.port=2345
+app.timezone=UTC
+
+#mdms urls
+egov.mdms.host=https://unified-dev.digit.org
+egov.mdms.search.endpoint=/egov-mdms-service/v1/_search
+egov.mdms.master.name=RegistrationCharges
+egov.mdms.module.name=BTR
+
+# Billing Service
+egov.billingservice.host=http://localhost:8031
+egov.demand.create.endpoint=/billing-service/demand/_create
+egov.billingservice.fetch.bill=/billing-service/bill/v2/_fetchbill
+
+btr.taxhead.master.code=BIRTH_CERT_FEE
+btr.module.code=BIRTH_CERT
diff --git a/tutorials/Assignment-2/btr-calculator/src/test/java/digit/TestConfiguration.java b/tutorials/Assignment-2/btr-calculator/src/test/java/digit/TestConfiguration.java
new file mode 100644
index 00000000000..570236cfc94
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/test/java/digit/TestConfiguration.java
@@ -0,0 +1,16 @@
+package digit;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.kafka.core.KafkaTemplate;
+
+import static org.mockito.Mockito.mock;
+
+@Configuration
+public class TestConfiguration {
+ @Bean
+ @SuppressWarnings("unchecked")
+ public KafkaTemplate kafkaTemplate() {
+ return mock(KafkaTemplate.class);
+ }
+}
\ No newline at end of file
diff --git a/tutorials/Assignment-2/btr-calculator/src/test/java/digit/web/controllers/V1ApiControllerTest.java b/tutorials/Assignment-2/btr-calculator/src/test/java/digit/web/controllers/V1ApiControllerTest.java
new file mode 100644
index 00000000000..1effa89f8c4
--- /dev/null
+++ b/tutorials/Assignment-2/btr-calculator/src/test/java/digit/web/controllers/V1ApiControllerTest.java
@@ -0,0 +1,58 @@
+package digit.web.controllers;
+
+import org.junit.Test;
+import org.junit.Ignore;
+import org.junit.runner.RunWith;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.web.servlet.MockMvc;
+import org.springframework.context.annotation.Import;
+import org.springframework.http.MediaType;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
+import digit.TestConfiguration;
+
+import static org.mockito.Matchers.any;
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
+
+/**
+* API tests for V1ApiController
+*/
+@Ignore
+@RunWith(SpringRunner.class)
+@WebMvcTest(V1ApiController.class)
+@Import(TestConfiguration.class)
+public class V1ApiControllerTest {
+
+ @Autowired
+ private MockMvc mockMvc;
+
+ @Test
+ public void v1CalculatePostSuccess() throws Exception {
+ mockMvc.perform(post("/btr-calculator//v1/_calculate").contentType(MediaType
+ .APPLICATION_JSON_UTF8))
+ .andExpect(status().isOk());
+ }
+
+ @Test
+ public void v1CalculatePostFailure() throws Exception {
+ mockMvc.perform(post("/btr-calculator//v1/_calculate").contentType(MediaType
+ .APPLICATION_JSON_UTF8))
+ .andExpect(status().isBadRequest());
+ }
+
+ @Test
+ public void v1GetbillPostSuccess() throws Exception {
+ mockMvc.perform(post("/btr-calculator//v1/_getbill").contentType(MediaType
+ .APPLICATION_JSON_UTF8))
+ .andExpect(status().isOk());
+ }
+
+ @Test
+ public void v1GetbillPostFailure() throws Exception {
+ mockMvc.perform(post("/btr-calculator//v1/_getbill").contentType(MediaType
+ .APPLICATION_JSON_UTF8))
+ .andExpect(status().isBadRequest());
+ }
+
+}
diff --git a/tutorials/Assignment-2/btr-services/README.md b/tutorials/Assignment-2/btr-services/README.md
new file mode 100644
index 00000000000..76cdd375214
--- /dev/null
+++ b/tutorials/Assignment-2/btr-services/README.md
@@ -0,0 +1,49 @@
+# Birth Registration Service
+
+This service is used to issue birth certificate.
+
+### Service Dependencies
+
+- egov-idgen
+- egov-user
+- egov-workflow
+- btr-calculator
+
+### Swagger API Contract
+
+[API Contract](./birth-registration-api-spec.yaml)
+
+## Service Details
+
+The service is integrated with User service, IdGen service and
+Workflow service to create, update and search a birth registration application.
+It is also integrated with btr-calculator to calculate the amount to be
+paid.
+
+### API Details
+
+`BasePath` /birth-registration/birth-services/v1/registration/[API endpoint]
+
+#### Method
+
+a) `_create`
+- Creates birth registration application and return the application number
+
+b) `_update`
+- Updates birth registration application based on application number
+
+c) `_search`
+- Searches birth registration application based on application number
+
+### Kafka Consumers
+
+- Following are the Consumer topics.
+ - **kafka.topics.receipt.create**
+ - **btr.kafka.create.topic**
+
+### Kafka Producers
+
+- Following are the Producer topics.
+ - **save-bt-application**
+ - **update-bt-application**
+
diff --git a/tutorials/Assignment-2/btr-services/birth-certificate-pdf.json b/tutorials/Assignment-2/btr-services/birth-certificate-pdf.json
new file mode 100644
index 00000000000..823fe8ce302
--- /dev/null
+++ b/tutorials/Assignment-2/btr-services/birth-certificate-pdf.json
@@ -0,0 +1,527 @@
+{
+ "key": "birth-certificate",
+ "DataConfigs": {
+ "serviceName": "rainmaker-common",
+ "version": "1.0.0",
+ "baseKeyPath": "$.BirthCertificate.*",
+ "entityIdPath":"$.id",
+ "isCommonTableBorderRequired": true,
+ "mappings": [
+ {
+ "topic": "common-pdf-generation-3",
+ "mappings": [
+ {
+ "direct": [
+ {
+ "variable": "logoImage",
+ "url":"https://raw.githubusercontent.com/egovernments/egov-web-app/master/web/rainmaker/dev-packages/egov-ui-kit-dev/src/assets/images/pblogo.png",
+ "type":"image"
+ },
+ {
+ "variable": "name",
+ "value": {
+ "path": "$.fullName"
+ },
+ "type":"setEmpty"
+ },
+ {
+ "variable": "embeddedUrl",
+ "value": {
+ "path": "$.embeddedUrl"
+ }
+ },
+ {
+ "variable": "dob",
+ "value": {
+ "path": "$.dateofbirth"
+ },
+ "type": "date"
+ },
+ {
+ "variable": "gender",
+ "value": {
+ "path": "$.genderStr"
+ },
+ "type":"setEmpty"
+ },
+ {
+ "variable": "registrationNo",
+ "value": {
+ "path": "$.registrationno"
+ },
+ "type":"setEmpty"
+ },
+ {
+ "variable": "registration_date",
+ "value": {
+ "path": "$.dateofreport"
+ },
+ "type": "date"
+ },
+ {
+ "variable": "updatedOn",
+ "value": {
+ "path": "$.dateofissue"
+ },
+ "type": "date"
+ },
+ {
+ "variable": "year",
+ "value": {
+ "path": "$.year"
+ },
+ "type": "setEmpty"
+ },
+ {
+ "variable": "fatherName",
+ "value": {
+ "path": "$.birthFatherInfo.fullName"
+ },
+ "type":"setEmpty"
+ },
+ {
+ "variable": "motherName",
+ "value": {
+ "path": "$.birthMotherInfo.fullName"
+ },
+ "type":"setEmpty"
+ },
+ {
+ "variable": "childAddress",
+ "value": {
+ "path": "$.birthPresentaddr.fullAddress"
+ },
+ "type":"setEmpty"
+ },
+ {
+ "variable": "parentsAddress",
+ "value": {
+ "path": "$.birthPermaddr.fullAddress"
+ },
+ "type":"setEmpty"
+ },
+ {
+ "variable": "parentsCity",
+ "value": {
+ "path": "$.birthPermaddr.city"
+ },
+ "type":"setEmpty"
+ },
+ {
+ "variable": "parentsStreet",
+ "value": {
+ "path": "$.birthPermaddr.street"
+ },
+ "type":"setEmpty"
+ },
+ {
+ "variable": "parentsTehsil",
+ "value": {
+ "path": "$.birthPermaddr.tehsil"
+ },
+ "type":"setEmpty"
+ },
+ {
+ "variable": "parentsDistrict",
+ "value": {
+ "path": "$.birthPermaddr.district"
+ },
+ "type":"setEmpty"
+ },
+ {
+ "variable": "fatherUid",
+ "value": {
+ "path": "$.birthFatherInfo.aadharno"
+ },
+ "type":"setEmpty"
+ },
+ {
+ "variable": "motherUid",
+ "value": {
+ "path": "$.birthMotherInfo.aadharno"
+ },
+ "type":"setEmpty"
+ },
+ {
+ "variable": "remarks",
+ "value": {
+ "path": "$.remarks"
+ },
+ "type":"setEmpty"
+ },
+ {
+ "variable": "placeOfBirth",
+ "value": {
+ "path": "$.placeofbirth"
+ },
+ "type":"setEmpty"
+ },
+ {
+ "variable": "issueDate",
+ "value": {
+ "path": "$.dateofissue"
+ },
+ "type": "date"
+ },
+
+ {
+ "variable": "certificateType",
+ "value": {
+ "path": "$.certificateType"
+ },
+ "type":"setEmpty"
+ },
+ {
+ "variable": "cantonment-board",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_TLCERTIFICATE_MUNICIPAL_CORPORATION"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+ {
+ "variable": "govt_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_BIRTHCERIFICATE_GOVT_UP"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+
+ {
+ "variable": "dept_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_BIRTHCERIFICATE_DEPT"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+
+
+
+ {
+ "variable": "certificate_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_BIRTHCERIFICATE_CERTIFICATE_BIRTH"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+
+ {
+ "variable": "certificate_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_BD_EN_CERTIFICATE"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+ {
+ "variable": "rule1_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_BIRTHCERIFICATE_RULE_1"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+
+ {
+ "variable": "rule2_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_BIRTHCERIFICATE_RULE_2"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+
+ {
+ "variable": "name_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_BIRTHCERIFICATE_NAME"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+
+ {
+ "variable": "gender_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_BIRTHCERIFICATE_GENDER"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+
+ {
+ "variable": "dob_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_BIRTHCERIFICATE_DOB"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+
+ {
+ "variable": "pob_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_BIRTHCERIFICATE_POB"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+
+ {
+ "variable": "mother_name_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_BIRTHCERIFICATE_MOTHER_NAME"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+
+ {
+ "variable": "father_name_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_BIRTHCERIFICATE_FATHER_NAME"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+
+ {
+ "variable": "mother_uid_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_BIRTHCERIFICATE_MOTHER_UID"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+
+ {
+ "variable": "father_uid_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_BIRTHCERIFICATE_FATHER_UID"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+
+ {
+ "variable": "child_address_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_BIRTHCERIFICATE_ADDRESS_OF_CHILD_BIRTH"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+
+ {
+ "variable": "parent_address_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_BIRTHCERIFICATE_PERMENENT_ADDRESS_OF_PARENT"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+
+ {
+ "variable": "registration_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_BIRTHCERIFICATE_REGISTRATION_NUMBER"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+
+ {
+ "variable": "registration_date_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_BIRTHCERIFICATE_REGISTRATION_DATE"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+
+ {
+ "variable": "remarks_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_BIRTHCERIFICATE_REMARKS"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+
+ {
+ "variable": "issue_date_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_BIRTHCERIFICATE_ISSUE_DATE"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+
+ {
+ "variable": "issuing_authority_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_BIRTHCERIFICATE_ISSUING_AUTHORITY_NAME"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+
+ {
+ "variable": "instruction1_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_BIRTHCERIFICATE_INSTRUCTION_1"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+
+ {
+ "variable": "instruction2_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_BIRTHCERIFICATE_INSTRUCTION_2"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+
+ {
+ "variable": "issuing_authority",
+ "value": {
+ "path": "PDF_STATIC_LABEL_CONSOLIDATED_BIRTHCERIFICATE_ISSUING_AUTHORITY"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ },
+
+
+ {
+ "variable": "cb_letter_label",
+ "value": {
+ "path": "PDF_STATIC_LABEL_BD_EN_CB"
+ },
+ "type": "label",
+ "localisation":{
+ "required":true,
+ "prefix": null,
+ "module":"rainmaker-pdf"
+ }
+ }
+
+ ]
+ },
+ {
+ "qrcodeConfig": [
+ {
+ "variable": "qr_code_image",
+ "value":"{{embeddedUrl}}"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/tutorials/Assignment-2/btr-services/birth-registration-api-spec.yaml b/tutorials/Assignment-2/btr-services/birth-registration-api-spec.yaml
new file mode 100644
index 00000000000..ab4c57a07fd
--- /dev/null
+++ b/tutorials/Assignment-2/btr-services/birth-registration-api-spec.yaml
@@ -0,0 +1,237 @@
+swagger: '2.0'
+info:
+ version: 1.0.0
+ title: Birth Registration Service.
+ description: |
+ This service provides APIs to register new births in the system.
+ contact:
+ name: eGovernments Foundation
+ email: contacts@egovernments.org
+schemes:
+ - https
+basePath: /birth-services
+x-api-id: org.egov.birth.services
+x-common-path: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml
+paths:
+ /v1/registration/_search:
+ post:
+ summary: Get the list of Birth registration applications
+ description: 1. Search and get birth registration applications(s) based on defined search criteria. 2. In case multiple parameters are passed voter registration applications will be searched as an AND combination of all the parameters.
+ parameters:
+ - $ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/parameters/requestInfo
+ - $ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/parameters/tenantId
+ - name: status
+ in: query
+ description: Search based on status.
+ type: string
+ allowEmptyValue: true
+ - name: ids
+ type: array
+ items:
+ type: integer
+ format: int64
+ in: query
+ maxItems: 50
+ description: unique identifier of birth registration
+ - name: applicationNumber
+ in: query
+ description: Unique application number for the Birth Registration Application
+ type: string
+ minLength: 2
+ maxLength: 64
+ responses:
+ '200':
+ description: Birth registration applications(s) Retrived Successfully
+ schema:
+ $ref: '#/definitions/BirthRegistrationRequest'
+ '400':
+ description: Invalid input
+ schema:
+ $ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/ErrorRes
+ tags:
+ - Birth Registration Application
+ /v1/registration/_create:
+ post:
+ summary: Create new Birth Registration Application
+ description: |
+ To create new birth registration applications in the system. API supports bulk creation with max limit as defined in the Birth Registration Request. Please note that either whole batch succeeds or fails, there's no partial batch success.
+
+ parameters:
+ - name: BirthRegistrationRequest
+ in: body
+ description: Details for the new Birth Registration Application(s) + RequestInfo meta data.
+ required: true
+ schema:
+ $ref: '#/definitions/BirthRegistrationRequest'
+ responses:
+ '201':
+ description: ReponseInfo with Birth Registration Application(s) created successfully
+ schema:
+ $ref: '#/definitions/BirthRegistrationResponse'
+ '400':
+ description: Birth Registration Application(s) creation failed
+ schema:
+ $ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/ErrorRes
+ tags:
+ - Birth Registration Application
+ /v1/registration/_update:
+ post:
+ summary: update existing Birth Registration Applications.
+ description: |
+ To update existing birth registration applications in the system. API supports bulk updation with max limit as defined in the birth registration Request. Please note that either whole batch succeeds or fails, there's no partial batch success.
+ parameters:
+ - name: BirthRegistrationRequest
+ in: body
+ description: Details for the new (s) + RequestInfo meta data.
+ required: true
+ schema:
+ $ref: '#/definitions/BirthRegistrationRequest'
+ responses:
+ '201':
+ description: ReponseInfo with Birth Registration Application(s) updated sudcessfully
+ schema:
+ $ref: '#/definitions/BirthRegistrationResponse'
+ '400':
+ description: (s) updation failed
+ schema:
+ $ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/ErrorRes
+ tags:
+ - Birth Registration Application
+definitions:
+ Applicant:
+ description: Details of the user applying for birth registration
+ allOf:
+ - $ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/egov-user/contracts/v1-0-0.yml#/definitions/User
+ BirthRegistrationApplication:
+ type: object
+ description: A Object holds the basic data for a Birth Registration Application
+ properties:
+ id:
+ type: string
+ minLength: 2
+ maxLength: 64
+ description: Unique Identifier of the Birth Registration Application (UUID)
+ readOnly: true
+ tenantId:
+ type: string
+ description: Unique Identifier of ULB
+ maxLength: 128
+ minLength: 2
+ applicationNumber:
+ type: string
+ description: Unique application number
+ maxLength: 128
+ minLength: 2
+ readOnly: true
+ babyFirstName:
+ type: string
+ description: Baby’s first name
+ maxLength: 128
+ minLength: 2
+ babyLastName:
+ type: string
+ description: Baby’s last name
+ maxLength: 128
+ minLength: 2
+ fatherOfApplicant:
+ type: string
+ description: Name of father
+ maxLength: 128
+ minLength: 2
+ motherOfApplicant:
+ type: string
+ description: Name of mother
+ maxLength: 128
+ minLength: 2
+ fatherMobileNumber:
+ type: string
+ description: Number of father
+ maxLength: 128
+ minLength: 2
+ motherMobileNumber:
+ type: string
+ description: Number of mother
+ maxLength: 128
+ minLength: 2
+ doctorName:
+ type: string
+ description: Name of doctor
+ maxLength: 128
+ minLength: 2
+ hospitalName:
+ type: string
+ description: Name of hospital
+ maxLength: 128
+ minLength: 2
+ placeOfBirth:
+ type: string
+ description: Place of birth
+ maxLength: 128
+ minLength: 2
+ timeOfBirth:
+ type: integer
+ description: Date of birth epoch
+ address:
+ $ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/Address
+ applicant:
+ $ref: '#/definitions/Applicant'
+ auditDetails:
+ $ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/AuditDetails
+ required:
+ - tenantId
+ - applicant
+ - babyFirstName
+ - babyLastName
+ - fatherOfApplicant
+ - motherOfApplicant
+ - fatherMobileNumber
+ - motherMobileNumber
+ - doctorName
+ - hospitalName
+ - placeOfBirth
+ - timeOfBirth
+ Workflow:
+ type: object
+ description: Fields related to workflow service
+ properties:
+ action:
+ type: string
+ description: Action on the application in certain
+ minLength: 1
+ maxLength: 64
+ status:
+ type: string
+ description: status of the application
+ comments:
+ type: string
+ description: Unique Identifier scrutinized number
+ minLength: 1
+ maxLength: 64
+ documents:
+ description: Attach the workflow verification documents.
+ type: array
+ items:
+ $ref: https://raw.githubusercontent.com/egovernments/municipal-services/common-contract/docs/common-contract-v2-0-0.yml#/components/schemas/Document
+ BirthRegistrationRequest:
+ description: Contract class to receive request. Array of items are used in case of create, whereas single item is used for update
+ properties:
+ RequestInfo:
+ $ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/RequestInfo
+ BirthRegistrationApplications:
+ description: Used for search result and create only
+ type: array
+ minimum: 1
+ maximum: 100
+ items:
+ $ref: '#/definitions/BirthRegistrationApplication'
+ BirthRegistrationResponse:
+ description: Contract class to send response. Array of items are used in case of search results or response for create, whereas single item is used for update
+ properties:
+ ResponseInfo:
+ $ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/ResponseInfo
+ BirthRegistrationApplications:
+ description: Used for search result and create only
+ type: array
+ maximum: 500
+ items:
+ $ref: '#/definitions/BirthRegistrationApplication'
diff --git a/tutorials/Assignment-2/btr-services/birth-registration-service-stage-4-postman-collection.json b/tutorials/Assignment-2/btr-services/birth-registration-service-stage-4-postman-collection.json
new file mode 100644
index 00000000000..b9aa23eb0b8
--- /dev/null
+++ b/tutorials/Assignment-2/btr-services/birth-registration-service-stage-4-postman-collection.json
@@ -0,0 +1,256 @@
+{
+ "info": {
+ "_postman_id": "92f31cce-d65b-4a82-b582-0011832075f9",
+ "name": "DIGIT Developer Birth Registration Service Stage 4",
+ "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
+ "_exporter_id": "21170203"
+ },
+ "item": [
+ {
+ "name": "Create Birth Application",
+ "request": {
+ "method": "POST",
+ "header": [],
+ "body": {
+ "mode": "raw",
+ "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"asset-services\",\r\n \"ver\": null,\r\n \"ts\": null,\r\n \"action\": null,\r\n \"did\": null,\r\n \"key\": null,\r\n \"msgId\": \"search with from and to values\",\r\n \"authToken\": \"{{authToken}}\",\r\n \"userInfo\": {\r\n \"id\": 24226,\r\n \"uuid\": \"11b0e02b-0145-4de2-bc42-c97b96264807\",\r\n \"userName\": \"amr001\",\r\n \"name\": \"leela\",\r\n \"mobileNumber\": \"9814424443\",\r\n \"emailId\": \"leela@llgmail.com\",\r\n \"type\": \"EMPLOYEE\",\r\n \"roles\": [\r\n {\r\n \"name\": \"CSC Collection Operator\",\r\n \"code\": \"CSC_COLL_OPERATOR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Employee\",\r\n \"code\": \"EMPLOYEE\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Grievance Routing Officer\",\r\n \"code\": \"GRO\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"NoC counter employee\",\r\n \"code\": \"NOC_CEMP\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"TL Counter Employee\",\r\n \"code\": \"TL_CEMP\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"TL Counter Employee\",\r\n \"code\": \"TL_CEMP\",\r\n \"tenantId\": \"pb.jalandhar\"\r\n },\r\n {\r\n \"name\": \"TL Field Inspector\",\r\n \"code\": \"TL_FIELD_INSPECTOR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"TL Creator\",\r\n \"code\": \"TL_CREATOR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Customer Support Representative\",\r\n \"code\": \"CSR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"NoC counter Approver\",\r\n \"code\": \"NOC_APPROVER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"TL Approver\",\r\n \"code\": \"TL_APPROVER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Super User\",\r\n \"code\": \"SUPERUSER\",\r\n \"tenantId\": \"pb\"\r\n },\r\n {\r\n \"name\": \"BPA Services Approver\",\r\n \"code\": \"BPA_APPROVER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Field Employee\",\r\n \"code\": \"FEMP\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Counter Employee\",\r\n \"code\": \"CEMP\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"NoC Field Inpector\",\r\n \"code\": \"NOC_FIELD_INSPECTOR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"NOC Department Approver\",\r\n \"code\": \"NOC_DEPT_APPROVER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Super User\",\r\n \"code\": \"SUPERUSER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Grievance Officer\",\r\n \"code\": \"GO\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Anonymous User\",\r\n \"code\": \"ANONYMOUS\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Collection Operator\",\r\n \"code\": \"COLL_OPERATOR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"NoC Doc Verifier\",\r\n \"code\": \"NOC_DOC_VERIFIER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"TL doc verifier\",\r\n \"code\": \"TL_DOC_VERIFIER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n }\r\n ],\r\n \"active\": true,\r\n \"tenantId\": \"pb.amritsar\"\r\n }\r\n },\r\n \"BirthRegistrationApplications\": [\r\n { \r\n \"tenantId\": \"{{tenantId}}\",\r\n \"timeOfBirth\": 12072001,\r\n \"babyFirstName\": \"Rahul\",\r\n \"babyLastName\": \"Singh\",\r\n \"doctorName\": \"Dr. Ram\",\r\n \"hospitalName\": \"Fortis\",\r\n \"placeOfBirth\": \"Palampur\",\r\n \"address\": {\r\n \"tenantId\": \"{{tenantId}}\",\r\n \"doorNo\": \"1010\",\r\n \"latitude\": null,\r\n \"longitude\": null,\r\n \"addressNumber\": \"34 GA\",\r\n \"type\": \"RESIDENTIAL\",\r\n \"addressLine1\": \"KP Layout\",\r\n \"addressLine2\": \"\",\r\n \"landmark\": \"Petrol pump\",\r\n \"city\": \"Amritsar\",\r\n \"pincode\": 143501,\r\n \"detail\": \"\",\r\n \"buildingName\": \"Avigna Residence\",\r\n \"street\": \"12th Main\",\r\n \"locality\": {\r\n \"code\": \"AMR001\",\r\n \"name\": \"New Amritsar Locality\"\r\n }\r\n },\r\n \"fatherOfApplicant\": {\r\n \"name\": \"Abhay\",\r\n \"userName\": \"91300114\",\r\n \"mobileNumber\": \"9230011254\",\r\n \"emailId\": \"xyz@egovernments.org\",\r\n \"altContactNumber\": \"\",\r\n \"tenantId\": \"{{tenantId}}\",\r\n \"type\" : \"CITIZEN\",\r\n \"roles\": [\r\n {\r\n \"code\": \"CITIZEN\"\r\n }\r\n ]\r\n },\r\n \"motherOfApplicant\": {\r\n \"name\": \"Amita\",\r\n \"userName\": \"92300114\",\r\n \"mobileNumber\": \"9230051254\",\r\n \"emailId\": \"xyz@egovernments.org\",\r\n \"altContactNumber\": \"\",\r\n \"tenantId\": \"{{tenantId}}\",\r\n \"type\": \"CITIZEN\",\r\n \"roles\": [\r\n {\r\n \"code\": \"CITIZEN\"\r\n }\r\n ]\r\n },\r\n \"workflow\": {\r\n \"action\": \"APPLY\",\r\n \"assignes\": [],\r\n \"comments\": \"Applying for birth registration\",\r\n \"verificationDocuments\": [\r\n {\r\n \"documentType\": \"PDF\",\r\n \"fileStoreId\": \"b0c5a846-c75a-11ea-87d0-0242ac130003\",\r\n \"documentUid\": \"\",\r\n \"additionalDetails\": {}\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "http://localhost:8280/birth-registration/birth-services/v1/registration/_create",
+ "protocol": "http",
+ "host": [
+ "localhost"
+ ],
+ "port": "8280",
+ "path": [
+ "birth-registration",
+ "birth-services",
+ "v1",
+ "registration",
+ "_create"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Update Birth Application",
+ "request": {
+ "method": "POST",
+ "header": [],
+ "body": {
+ "mode": "raw",
+ "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"asset-services\",\r\n \"ver\": null,\r\n \"ts\": null,\r\n \"action\": null,\r\n \"did\": null,\r\n \"key\": null,\r\n \"msgId\": \"search with from and to values\",\r\n \"authToken\": \"{{authToken}}\",\r\n \"userInfo\": {\r\n \"id\": 24226,\r\n \"uuid\": \"{{userUuid}}\",\r\n \"userName\": \"{{username}}\",\r\n \"name\": \"{{name}}\",\r\n \"mobileNumber\": \"{{mobileNumber}}\",\r\n \"emailId\": \"{{emailId}}\",\r\n \"type\": \"EMPLOYEE\",\r\n \"roles\": [\r\n {\r\n \"name\": \"CSC Collection Operator\",\r\n \"code\": \"CSC_COLL_OPERATOR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Employee\",\r\n \"code\": \"EMPLOYEE\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Grievance Routing Officer\",\r\n \"code\": \"GRO\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"NoC counter employee\",\r\n \"code\": \"NOC_CEMP\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"TL Counter Employee\",\r\n \"code\": \"TL_CEMP\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"TL Counter Employee\",\r\n \"code\": \"TL_CEMP\",\r\n \"tenantId\": \"pb.jalandhar\"\r\n },\r\n {\r\n \"name\": \"TL Field Inspector\",\r\n \"code\": \"TL_FIELD_INSPECTOR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"TL Creator\",\r\n \"code\": \"TL_CREATOR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Customer Support Representative\",\r\n \"code\": \"CSR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"NoC counter Approver\",\r\n \"code\": \"NOC_APPROVER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"TL Approver\",\r\n \"code\": \"TL_APPROVER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Super User\",\r\n \"code\": \"SUPERUSER\",\r\n \"tenantId\": \"pb\"\r\n },\r\n {\r\n \"name\": \"BPA Services Approver\",\r\n \"code\": \"BPA_APPROVER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Field Employee\",\r\n \"code\": \"FEMP\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Counter Employee\",\r\n \"code\": \"CEMP\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"NoC Field Inpector\",\r\n \"code\": \"NOC_FIELD_INSPECTOR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"NOC Department Approver\",\r\n \"code\": \"NOC_DEPT_APPROVER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Super User\",\r\n \"code\": \"SUPERUSER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Grievance Officer\",\r\n \"code\": \"GO\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Anonymous User\",\r\n \"code\": \"ANONYMOUS\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Collection Operator\",\r\n \"code\": \"COLL_OPERATOR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"NoC Doc Verifier\",\r\n \"code\": \"NOC_DOC_VERIFIER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"TL doc verifier\",\r\n \"code\": \"TL_DOC_VERIFIER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n }\r\n ],\r\n \"active\": true,\r\n \"tenantId\": \"{{tenantId}}\"\r\n }\r\n },\r\n \"BirthRegistrationApplications\": [\r\n {\r\n \"id\": \"d258d06c-355c-4612-9cc1-40df6666463a\",\r\n \"tenantId\": \"{{tenantId}}\",\r\n \"applicationNumber\": \"1321af1a-5a09-4c54-93e3-67301721e483\",\r\n \"babyFirstName\": \"Ravi\",\r\n \"babyLastName\": \"Singh\",\r\n \"fatherMobileNumber\": null,\r\n \"motherMobileNumber\": null,\r\n \"doctorName\": \"Dr. Ram\",\r\n \"hospitalName\": \"Fortis\",\r\n \"placeOfBirth\": \"Palampur\",\r\n \"timeOfBirth\": 12072001,\r\n \"address\": {\r\n \"id\": \"cbb884b2-f5cd-4579-a56c-842bbd75c320\",\r\n \"tenantId\": \"{{tenantId}}\",\r\n \"doorNo\": \"1010\",\r\n \"latitude\": 0.0,\r\n \"longitude\": 0.0,\r\n \"addressId\": null,\r\n \"addressNumber\": \"34 GA\",\r\n \"type\": \"RESIDENTIAL\",\r\n \"addressLine1\": \"KP Layout\",\r\n \"addressLine2\": \"\",\r\n \"landmark\": \"Petrol pump\",\r\n \"city\": \"Amritsar\",\r\n \"pincode\": \"143501\",\r\n \"detail\": \"adetail\",\r\n \"buildingName\": \"Avigna Residence\",\r\n \"street\": \"12th Main\",\r\n \"locality\": null,\r\n \"registrationId\": \"aregistrationid\"\r\n },\r\n \"fatherOfApplicant\": {\r\n \"id\": null,\r\n \"userName\": null,\r\n \"password\": null,\r\n \"salutation\": null,\r\n \"name\": null,\r\n \"gender\": null,\r\n \"mobileNumber\": null,\r\n \"emailId\": null,\r\n \"altContactNumber\": null,\r\n \"pan\": null,\r\n \"aadhaarNumber\": null,\r\n \"permanentAddress\": null,\r\n \"permanentCity\": null,\r\n \"permanentPincode\": null,\r\n \"correspondenceCity\": null,\r\n \"correspondencePincode\": null,\r\n \"correspondenceAddress\": null,\r\n \"active\": null,\r\n \"dob\": null,\r\n \"pwdExpiryDate\": null,\r\n \"locale\": null,\r\n \"type\": null,\r\n \"signature\": null,\r\n \"accountLocked\": null,\r\n \"roles\": null,\r\n \"fatherOrHusbandName\": null,\r\n \"bloodGroup\": null,\r\n \"identificationMark\": null,\r\n \"photo\": null,\r\n \"createdBy\": null,\r\n \"createdDate\": null,\r\n \"lastModifiedBy\": null,\r\n \"lastModifiedDate\": null,\r\n \"otpReference\": null,\r\n \"tenantId\": {{tenantId}}\r\n },\r\n \"motherOfApplicant\": {\r\n \"id\": null,\r\n \"userName\": null,\r\n \"password\": null,\r\n \"salutation\": null,\r\n \"name\": null,\r\n \"gender\": null,\r\n \"mobileNumber\": null,\r\n \"emailId\": null,\r\n \"altContactNumber\": null,\r\n \"pan\": null,\r\n \"aadhaarNumber\": null,\r\n \"permanentAddress\": null,\r\n \"permanentCity\": null,\r\n \"permanentPincode\": null,\r\n \"correspondenceCity\": null,\r\n \"correspondencePincode\": null,\r\n \"correspondenceAddress\": null,\r\n \"active\": null,\r\n \"dob\": null,\r\n \"pwdExpiryDate\": null,\r\n \"locale\": null,\r\n \"type\": null,\r\n \"signature\": null,\r\n \"accountLocked\": null,\r\n \"roles\": null,\r\n \"fatherOrHusbandName\": null,\r\n \"bloodGroup\": null,\r\n \"identificationMark\": null,\r\n \"photo\": null,\r\n \"createdBy\": null,\r\n \"createdDate\": null,\r\n \"lastModifiedBy\": null,\r\n \"lastModifiedDate\": null,\r\n \"otpReference\": null,\r\n \"tenantId\": {{tenantId}}\r\n },\r\n \"auditDetails\": {\r\n \"createdBy\": \"11b0e02b-0145-4de2-bc42-c97b96264807\",\r\n \"lastModifiedBy\": \"11b0e02b-0145-4de2-bc42-c97b96264807\",\r\n \"createdTime\": 1666727840790,\r\n \"lastModifiedTime\": 1666727840790\r\n },\r\n \"workflow\": null\r\n }\r\n ]\r\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "http://localhost:8280/birth-registration/birth-services/v1/registration/_update",
+ "protocol": "http",
+ "host": [
+ "localhost"
+ ],
+ "port": "8280",
+ "path": [
+ "birth-registration",
+ "birth-services",
+ "v1",
+ "registration",
+ "_update"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Search Birth Application",
+ "request": {
+ "method": "POST",
+ "header": [],
+ "body": {
+ "mode": "raw",
+ "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"asset-services\",\r\n \"ver\": null,\r\n \"ts\": null,\r\n \"action\": null,\r\n \"did\": null,\r\n \"key\": null,\r\n \"msgId\": \"search with from and to values\",\r\n \"authToken\": \"{{authToken}}\",\r\n \"userInfo\": {\r\n \"id\": 24226,\r\n \"uuid\": \"{{userUuid}}\",\r\n \"userName\": \"{{username}}\",\r\n \"name\": \"{{name}}\",\r\n \"mobileNumber\": \"{{mobileNumber}}\",\r\n \"emailId\": \"{{emailId}}\",\r\n \"type\": \"EMPLOYEE\",\r\n \"roles\": [\r\n {\r\n \"name\": \"CSC Collection Operator\",\r\n \"code\": \"CSC_COLL_OPERATOR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Employee\",\r\n \"code\": \"EMPLOYEE\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Grievance Routing Officer\",\r\n \"code\": \"GRO\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"NoC counter employee\",\r\n \"code\": \"NOC_CEMP\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"TL Counter Employee\",\r\n \"code\": \"TL_CEMP\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"TL Counter Employee\",\r\n \"code\": \"TL_CEMP\",\r\n \"tenantId\": \"pb.jalandhar\"\r\n },\r\n {\r\n \"name\": \"TL Field Inspector\",\r\n \"code\": \"TL_FIELD_INSPECTOR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"TL Creator\",\r\n \"code\": \"TL_CREATOR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Customer Support Representative\",\r\n \"code\": \"CSR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"NoC counter Approver\",\r\n \"code\": \"NOC_APPROVER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"TL Approver\",\r\n \"code\": \"TL_APPROVER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Super User\",\r\n \"code\": \"SUPERUSER\",\r\n \"tenantId\": \"pb\"\r\n },\r\n {\r\n \"name\": \"BPA Services Approver\",\r\n \"code\": \"BPA_APPROVER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Field Employee\",\r\n \"code\": \"FEMP\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Counter Employee\",\r\n \"code\": \"CEMP\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"NoC Field Inpector\",\r\n \"code\": \"NOC_FIELD_INSPECTOR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"NOC Department Approver\",\r\n \"code\": \"NOC_DEPT_APPROVER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Super User\",\r\n \"code\": \"SUPERUSER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Grievance Officer\",\r\n \"code\": \"GO\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Anonymous User\",\r\n \"code\": \"ANONYMOUS\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Collection Operator\",\r\n \"code\": \"COLL_OPERATOR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"NoC Doc Verifier\",\r\n \"code\": \"NOC_DOC_VERIFIER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"TL doc verifier\",\r\n \"code\": \"TL_DOC_VERIFIER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n }\r\n ],\r\n \"active\": true,\r\n \"tenantId\": \"{{tenantId}}\"\r\n }\r\n }\r\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "http://localhost:8280/birth-registration/birth-services/v1/registration/_search?tenantid=pb.amritsar&ids=0732da6f-ba21-4ddf-b47e-e74b7a9806d4&ids=qwe",
+ "protocol": "http",
+ "host": [
+ "localhost"
+ ],
+ "port": "8280",
+ "path": [
+ "birth-registration",
+ "birth-services",
+ "v1",
+ "registration",
+ "_search"
+ ],
+ "query": [
+ {
+ "key": "tenantid",
+ "value": "pb.amritsar"
+ },
+ {
+ "key": "applicationnumber",
+ "value": "PB-BTR-2022-08-30-000307",
+ "disabled": true
+ },
+ {
+ "key": "ids",
+ "value": "0732da6f-ba21-4ddf-b47e-e74b7a9806d4"
+ },
+ {
+ "key": "ids",
+ "value": "qwe"
+ }
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "IdGen",
+ "request": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"asset-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\": \"{{authToken}}\",\n \"userInfo\": {\n \"id\": 24226,\n \"uuid\": \"{{userUuid}}\",\n \"userName\": \"{{username}}\",\n \"name\": \"{{name}}\",\n \"mobileNumber\": \"{{mobileNumber}}\",\n \"emailId\": \"{{emailId}}\",\n \"type\": \"EMPLOYEE\",\n \"roles\": [\n {\n \"name\": \"CSC Collection Operator\",\n \"code\": \"CSC_COLL_OPERATOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Employee\",\n \"code\": \"EMPLOYEE\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Grievance Routing Officer\",\n \"code\": \"GRO\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC counter employee\",\n \"code\": \"NOC_CEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Counter Employee\",\n \"code\": \"TL_CEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Counter Employee\",\n \"code\": \"TL_CEMP\",\n \"tenantId\": \"pb.jalandhar\"\n },\n {\n \"name\": \"TL Field Inspector\",\n \"code\": \"TL_FIELD_INSPECTOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Creator\",\n \"code\": \"TL_CREATOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Customer Support Representative\",\n \"code\": \"CSR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC counter Approver\",\n \"code\": \"NOC_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Approver\",\n \"code\": \"TL_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Super User\",\n \"code\": \"SUPERUSER\",\n \"tenantId\": \"pb\"\n },\n {\n \"name\": \"BPA Services Approver\",\n \"code\": \"BPA_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Field Employee\",\n \"code\": \"FEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Counter Employee\",\n \"code\": \"CEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC Field Inpector\",\n \"code\": \"NOC_FIELD_INSPECTOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NOC Department Approver\",\n \"code\": \"NOC_DEPT_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Super User\",\n \"code\": \"SUPERUSER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Grievance Officer\",\n \"code\": \"GO\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Anonymous User\",\n \"code\": \"ANONYMOUS\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Collection Operator\",\n \"code\": \"COLL_OPERATOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC Doc Verifier\",\n \"code\": \"NOC_DOC_VERIFIER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL doc verifier\",\n \"code\": \"TL_DOC_VERIFIER\",\n \"tenantId\": \"pb.amritsar\"\n }\n ],\n \"active\": true,\n \"tenantId\": \"{{tenantId}}\"\n }\n },\n \"idRequests\": [\n {\n \"tenantId\": \"pb.amritsar\",\n \"idName\": \"btr.registrationid\"\n }\n ]\n}"
+ },
+ "url": {
+ "raw": "http://localhost:8285/egov-idgen/id/_generate",
+ "protocol": "http",
+ "host": [
+ "localhost"
+ ],
+ "port": "8285",
+ "path": [
+ "egov-idgen",
+ "id",
+ "_generate"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Worklow business service create",
+ "request": {
+ "method": "POST",
+ "header": [],
+ "body": {
+ "mode": "raw",
+ "raw": "{\r\n \"RequestInfo\": {\r\n \"apiId\": \"asset-services\",\r\n \"ver\": null,\r\n \"ts\": null,\r\n \"action\": null,\r\n \"did\": null,\r\n \"key\": null,\r\n \"msgId\": \"search with from and to values\",\r\n \"authToken\": \"{{authToken}}\",\r\n \"userInfo\": {\r\n \"id\": 24226,\r\n \"uuid\": \"{{userUuid}}\",\r\n \"userName\": \"{{username}}\",\r\n \"name\": \"{{name}}\",\r\n \"mobileNumber\": \"{{mobileNumber}}\",\r\n \"emailId\": \"{{emailId}}\",\r\n \"type\": \"EMPLOYEE\",\r\n \"roles\": [\r\n {\r\n \"name\": \"CSC Collection Operator\",\r\n \"code\": \"CSC_COLL_OPERATOR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Employee\",\r\n \"code\": \"EMPLOYEE\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Grievance Routing Officer\",\r\n \"code\": \"GRO\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"NoC counter employee\",\r\n \"code\": \"NOC_CEMP\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"TL Counter Employee\",\r\n \"code\": \"TL_CEMP\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"TL Counter Employee\",\r\n \"code\": \"TL_CEMP\",\r\n \"tenantId\": \"pb.jalandhar\"\r\n },\r\n {\r\n \"name\": \"TL Field Inspector\",\r\n \"code\": \"TL_FIELD_INSPECTOR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"TL Creator\",\r\n \"code\": \"TL_CREATOR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Customer Support Representative\",\r\n \"code\": \"CSR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"NoC counter Approver\",\r\n \"code\": \"NOC_APPROVER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"TL Approver\",\r\n \"code\": \"TL_APPROVER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Super User\",\r\n \"code\": \"SUPERUSER\",\r\n \"tenantId\": \"pb\"\r\n },\r\n {\r\n \"name\": \"BPA Services Approver\",\r\n \"code\": \"BPA_APPROVER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Field Employee\",\r\n \"code\": \"FEMP\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Counter Employee\",\r\n \"code\": \"CEMP\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"NoC Field Inpector\",\r\n \"code\": \"NOC_FIELD_INSPECTOR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"NOC Department Approver\",\r\n \"code\": \"NOC_DEPT_APPROVER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Super User\",\r\n \"code\": \"SUPERUSER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Grievance Officer\",\r\n \"code\": \"GO\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Anonymous User\",\r\n \"code\": \"ANONYMOUS\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"Collection Operator\",\r\n \"code\": \"COLL_OPERATOR\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"NoC Doc Verifier\",\r\n \"code\": \"NOC_DOC_VERIFIER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n },\r\n {\r\n \"name\": \"TL doc verifier\",\r\n \"code\": \"TL_DOC_VERIFIER\",\r\n \"tenantId\": \"pb.amritsar\"\r\n }\r\n ],\r\n \"active\": true,\r\n \"tenantId\": \"{{tenantId}}\"\r\n }\r\n },\r\n \"BusinessServices\": [\r\n {\r\n \"tenantId\": \"pb\",\r\n \"businessService\": \"BTR\",\r\n \"business\": \"birth-services\",\r\n \"businessServiceSla\": 432000000,\r\n \"states\": [\r\n {\r\n \"sla\": null,\r\n \"state\": null,\r\n \"applicationStatus\": null,\r\n \"docUploadRequired\": true,\r\n \"isStartState\": true,\r\n \"isTerminateState\": false,\r\n \"isStateUpdatable\": true,\r\n \"actions\": [\r\n {\r\n \"action\": \"APPLY\",\r\n \"nextState\": \"APPLIED\",\r\n \"roles\": [\r\n \"CITIZEN\",\r\n \"EMPLOYEE\"\r\n ]\r\n }\r\n ]\r\n },\r\n {\r\n \"sla\": null,\r\n \"state\": \"APPLIED\",\r\n \"applicationStatus\": \"APPLIED\",\r\n \"docUploadRequired\": false,\r\n \"isStartState\": false,\r\n \"isTerminateState\": true,\r\n \"isStateUpdatable\": false,\r\n \"actions\": [\r\n {\r\n \"action\": \"APPROVE\",\r\n \"nextState\": \"APPROVED\",\r\n \"roles\": [\r\n \"EMPLOYEE\"\r\n ]\r\n },\r\n {\r\n \"action\": \"REJECT\",\r\n \"nextState\": \"REJECTED\",\r\n \"roles\": [\r\n \"EMPLOYEE\"\r\n ]\r\n }\r\n ]\r\n },\r\n {\r\n \"sla\": null,\r\n \"state\": \"APPROVED\",\r\n \"applicationStatus\": \"APPROVED\",\r\n \"docUploadRequired\": false,\r\n \"isStartState\": false,\r\n \"isTerminateState\": false,\r\n \"isStateUpdatable\": false,\r\n \"actions\": [\r\n {\r\n \"action\": \"PAY\",\r\n \"nextState\": \"REGISTRATIONCOMPLETED\",\r\n \"roles\": [\r\n \"SYSTEM_PAYMENT\",\r\n \"CITIZEN\",\r\n \"EMPLOYEE\"\r\n ]\r\n }\r\n ]\r\n },\r\n {\r\n \"sla\": null,\r\n \"state\": \"REJECTED\",\r\n \"applicationStatus\": \"REJECTED\",\r\n \"docUploadRequired\": false,\r\n \"isStartState\": false,\r\n \"isTerminateState\": true,\r\n \"isStateUpdatable\": false,\r\n \"actions\": null\r\n },\r\n {\r\n \"sla\": null,\r\n \"state\": \"REGISTRATIONCOMPLETED\",\r\n \"applicationStatus\": \"REGISTRATIONCOMPLETED\",\r\n \"docUploadRequired\": false,\r\n \"isStartState\": false,\r\n \"isTerminateState\": true,\r\n \"isStateUpdatable\": false,\r\n \"actions\": null\r\n }\r\n ]\r\n }\r\n ]\r\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "http://localhost:8013/egov-workflow-v2/egov-wf/businessservice/_create",
+ "protocol": "http",
+ "host": [
+ "localhost"
+ ],
+ "port": "8013",
+ "path": [
+ "egov-workflow-v2",
+ "egov-wf",
+ "businessservice",
+ "_create"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Workflow business service search",
+ "request": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"asset-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\": \"{{authToken}}\",\n \"userInfo\": {\n \"id\": 24226,\n \"uuid\": \"{{userUuid}}\",\n \"userName\": \"{{username}}\",\n \"name\": \"{{name}}\",\n \"mobileNumber\": \"{{mobileNumber}}\",\n \"emailId\": \"{{emailId}}\",\n \"type\": \"EMPLOYEE\",\n \"roles\": [\n {\n \"name\": \"CSC Collection Operator\",\n \"code\": \"CSC_COLL_OPERATOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Employee\",\n \"code\": \"EMPLOYEE\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Grievance Routing Officer\",\n \"code\": \"GRO\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC counter employee\",\n \"code\": \"NOC_CEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Counter Employee\",\n \"code\": \"TL_CEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Counter Employee\",\n \"code\": \"TL_CEMP\",\n \"tenantId\": \"pb.jalandhar\"\n },\n {\n \"name\": \"TL Field Inspector\",\n \"code\": \"TL_FIELD_INSPECTOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Creator\",\n \"code\": \"TL_CREATOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Customer Support Representative\",\n \"code\": \"CSR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC counter Approver\",\n \"code\": \"NOC_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Approver\",\n \"code\": \"TL_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Super User\",\n \"code\": \"SUPERUSER\",\n \"tenantId\": \"pb\"\n },\n {\n \"name\": \"BPA Services Approver\",\n \"code\": \"BPA_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Field Employee\",\n \"code\": \"FEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Counter Employee\",\n \"code\": \"CEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC Field Inpector\",\n \"code\": \"NOC_FIELD_INSPECTOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NOC Department Approver\",\n \"code\": \"NOC_DEPT_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Super User\",\n \"code\": \"SUPERUSER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Grievance Officer\",\n \"code\": \"GO\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Anonymous User\",\n \"code\": \"ANONYMOUS\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Collection Operator\",\n \"code\": \"COLL_OPERATOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC Doc Verifier\",\n \"code\": \"NOC_DOC_VERIFIER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL doc verifier\",\n \"code\": \"TL_DOC_VERIFIER\",\n \"tenantId\": \"pb.amritsar\"\n }\n ],\n \"active\": true,\n \"tenantId\": \"{{tenantId}}\"\n }\n }\n}"
+ },
+ "url": {
+ "raw": "http://localhost:8282/egov-workflow-v2/egov-wf/businessservice/_search?tenantId=pb.amritsar&businessServices=BTR",
+ "protocol": "http",
+ "host": [
+ "localhost"
+ ],
+ "port": "8282",
+ "path": [
+ "egov-workflow-v2",
+ "egov-wf",
+ "businessservice",
+ "_search"
+ ],
+ "query": [
+ {
+ "key": "tenantId",
+ "value": "pb.amritsar"
+ },
+ {
+ "key": "businessServices",
+ "value": "BTR"
+ }
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Payment Create",
+ "request": {
+ "method": "POST",
+ "header": [],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"RequestInfo\": {\n \"apiId\": \"asset-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\": \"{{authToken}}\",\n \"userInfo\": {\n \"id\": 24226,\n \"uuid\": \"11b0e02b-0145-4de2-bc42-c97b96264807\",\n \"userName\": \"amr001\",\n \"name\": \"leela\",\n \"mobileNumber\": \"9814424443\",\n \"emailId\": \"leela@llgmail.com\",\n \"type\": \"EMPLOYEE\",\n \"roles\": [\n {\n \"name\": \"CSC Collection Operator\",\n \"code\": \"CSC_COLL_OPERATOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Employee\",\n \"code\": \"EMPLOYEE\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Grievance Routing Officer\",\n \"code\": \"GRO\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC counter employee\",\n \"code\": \"NOC_CEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Counter Employee\",\n \"code\": \"TL_CEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Counter Employee\",\n \"code\": \"TL_CEMP\",\n \"tenantId\": \"pb.jalandhar\"\n },\n {\n \"name\": \"TL Field Inspector\",\n \"code\": \"TL_FIELD_INSPECTOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Creator\",\n \"code\": \"TL_CREATOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Customer Support Representative\",\n \"code\": \"CSR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC counter Approver\",\n \"code\": \"NOC_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL Approver\",\n \"code\": \"TL_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Super User\",\n \"code\": \"SUPERUSER\",\n \"tenantId\": \"pb\"\n },\n {\n \"name\": \"BPA Services Approver\",\n \"code\": \"BPA_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Field Employee\",\n \"code\": \"FEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Counter Employee\",\n \"code\": \"CEMP\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC Field Inpector\",\n \"code\": \"NOC_FIELD_INSPECTOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NOC Department Approver\",\n \"code\": \"NOC_DEPT_APPROVER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Super User\",\n \"code\": \"SUPERUSER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Grievance Officer\",\n \"code\": \"GO\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Anonymous User\",\n \"code\": \"ANONYMOUS\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"Collection Operator\",\n \"code\": \"COLL_OPERATOR\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"NoC Doc Verifier\",\n \"code\": \"NOC_DOC_VERIFIER\",\n \"tenantId\": \"pb.amritsar\"\n },\n {\n \"name\": \"TL doc verifier\",\n \"code\": \"TL_DOC_VERIFIER\",\n \"tenantId\": \"pb.amritsar\"\n }\n ],\n \"active\": true,\n \"tenantId\": \"pb.amritsar\"\n }\n },\n \"Payment\": {\n \"tenantId\": \"{{tenantId}}\",\n \"totalAmountPaid\": \"100\",\n \"paymentMode\": \"CASH\",\n \"paidBy\": \"11b0e02b-0145-4de2-bc42-c97b96264807\",\n \"paymentDetails\": [\n {\n \"billId\": \"bbf3ea52-f0b0-4a6f-8b2a-f4b2389339cb\",\n \"totalAmountPaid\": \"1000\"\n }\n ]\n }\n\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "localhost:8015/collection-services/payments/_create",
+ "host": [
+ "localhost"
+ ],
+ "port": "8015",
+ "path": [
+ "collection-services",
+ "payments",
+ "_create"
+ ]
+ }
+ },
+ "response": []
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tutorials/Assignment-2/btr-services/btr-indexer.yml b/tutorials/Assignment-2/btr-services/btr-indexer.yml
new file mode 100644
index 00000000000..b0549b8cdb5
--- /dev/null
+++ b/tutorials/Assignment-2/btr-services/btr-indexer.yml
@@ -0,0 +1,47 @@
+ServiceMaps:
+ serviceName: Birth Registration Service
+ version: 1.0.0
+ mappings:
+ - topic: save-bt-application
+ configKey: INDEX
+ indexes:
+ - name: btindex-v1
+ type: general
+ id: $.id
+ isBulk: true
+ timeStampField: $.auditDetails.createdTime
+ jsonPath: $.BirthRegistrationApplications
+ customJsonMapping:
+ indexMapping: {"Data":{"birthapplication":{},"history":{}}}
+ fieldMapping:
+ - inJsonPath: $
+ outJsonPath: $.Data.birthapplication
+ externalUriMapping:
+ - path: http://localhost:8282/egov-workflow-v2/egov-wf/process/_search
+ queryParam: businessIds=$.applicationNumber,history=true,tenantId=$.tenantId
+ apiRequest: {"RequestInfo":{"apiId":"org.egov.pt","ver":"1.0","ts":1502890899493,"action":"asd","did":"4354648646","key":"xyz","msgId":"654654","requesterId":"61","authToken":"d9994555-7656-4a67-ab3a-a952a0d4dfc8","userInfo":{"id":1,"uuid":"1fec8102-0e02-4d0a-b283-cd80d5dab067","type":"EMPLOYEE","tenantId":"pb.amritsar","roles":[{"name":"Employee","code":"EMPLOYEE","tenantId":"pb.amritsar"}]}}}
+ uriResponseMapping:
+ - inJsonPath: $.ProcessInstances
+ outJsonPath: $.Data.history
+
+ - topic: update-bt-application
+ configKey: INDEX
+ indexes:
+ - name: btindex-v1
+ type: general
+ id: $.id
+ isBulk: true
+ timeStampField: $.auditDetails.createdTime
+ jsonPath: $.BirthRegistrationApplications
+ customJsonMapping:
+ indexMapping: {"Data":{"birthapplication":{},"history":{}}}
+ fieldMapping:
+ - inJsonPath: $
+ outJsonPath: $.Data.birthapplication
+ externalUriMapping:
+ - path: http://egov-workflow-v2.egov:8080/egov-workflow-v2/egov-wf/process/_search
+ queryParam: businessIds=$.applicationNumber,history=true,tenantId=$.tenantId
+ apiRequest: {"RequestInfo":{"apiId":"org.egov.pt","ver":"1.0","ts":1502890899493,"action":"asd","did":"4354648646","key":"xyz","msgId":"654654","requesterId":"61","authToken":"d9994555-7656-4a67-ab3a-a952a0d4dfc8","userInfo":{"id":1,"uuid":"1fec8102-0e02-4d0a-b283-cd80d5dab067","type":"EMPLOYEE","tenantId":"pb.amritsar","roles":[{"name":"Employee","code":"EMPLOYEE","tenantId":"pb.amritsar"}]}}}
+ uriResponseMapping:
+ - inJsonPath: $.ProcessInstances
+ outJsonPath: $.Data.history
\ No newline at end of file
diff --git a/tutorials/Assignment-2/btr-services/btr-persister.yml b/tutorials/Assignment-2/btr-services/btr-persister.yml
new file mode 100644
index 00000000000..056d7c8bf92
--- /dev/null
+++ b/tutorials/Assignment-2/btr-services/btr-persister.yml
@@ -0,0 +1,104 @@
+serviceMaps:
+ serviceName: btr-services
+ mappings:
+ - version: 1.0
+ description: Persists birth details in tables
+ fromTopic: save-bt-application
+ isTransaction: true
+ queryMaps:
+
+ - query: INSERT INTO eg_bt_registration(id,tenantid,applicationnumber,babyfirstname,babylastname,fatherid,motherid,doctorname,hospitalname,placeofbirth,timeofbirth,createdby,lastmodifiedby,createdtime, lastmodifiedtime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?,?);
+ basePath: BirthRegistrationApplications
+ jsonMaps:
+ - jsonPath: $.BirthRegistrationApplications.*.id
+
+ - jsonPath: $.BirthRegistrationApplications.*.tenantId
+
+ - jsonPath: $.BirthRegistrationApplications.*.applicationNumber
+
+ - jsonPath: $.BirthRegistrationApplications.*.babyFirstName
+
+ - jsonPath: $.BirthRegistrationApplications.*.babyLastName
+
+ - jsonPath: $.BirthRegistrationApplications.*.fatherOfApplicant.id
+
+ - jsonPath: $.BirthRegistrationApplications.*.motherOfApplicant.id
+
+ - jsonPath: $.BirthRegistrationApplications.*.doctorName
+
+ - jsonPath: $.BirthRegistrationApplications.*.hospitalName
+
+ - jsonPath: $.BirthRegistrationApplications.*.placeOfBirth
+
+ - jsonPath: $.BirthRegistrationApplications.*.timeOfBirth
+
+ - jsonPath: $.BirthRegistrationApplications.*.auditDetails.createdBy
+
+ - jsonPath: $.BirthRegistrationApplications.*.auditDetails.lastModifiedBy
+
+ - jsonPath: $.BirthRegistrationApplications.*.auditDetails.createdTime
+
+ - jsonPath: $.BirthRegistrationApplications.*.auditDetails.lastModifiedTime
+
+ - query: INSERT INTO eg_bt_address(id, tenantid, doorno, latitude, longitude, buildingname, addressid, addressnumber, type, addressline1, addressline2, landmark, street, city, locality, pincode, detail, registrationid, createdby, lastmodifiedby, createdtime, lastmodifiedtime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
+ basePath: BirthRegistrationApplications
+ jsonMaps:
+ - jsonPath: $.BirthRegistrationApplications.*.address.id
+
+ - jsonPath: $.BirthRegistrationApplications.*.address.tenantId
+
+ - jsonPath: $.BirthRegistrationApplications.*.address.doorNo
+
+ - jsonPath: $.BirthRegistrationApplications.*.address.latitude
+
+ - jsonPath: $.BirthRegistrationApplications.*.address.longitude
+
+ - jsonPath: $.BirthRegistrationApplications.*.address.buildingName
+
+ - jsonPath: $.BirthRegistrationApplications.*.address.addressId
+
+ - jsonPath: $.BirthRegistrationApplications.*.address.addressNumber
+
+ - jsonPath: $.BirthRegistrationApplications.*.address.type
+
+ - jsonPath: $.BirthRegistrationApplications.*.address.addressLine1
+
+ - jsonPath: $.BirthRegistrationApplications.*.address.addressLine2
+
+ - jsonPath: $.BirthRegistrationApplications.*.address.landmark
+
+ - jsonPath: $.BirthRegistrationApplications.*.address.street
+
+ - jsonPath: $.BirthRegistrationApplications.*.address.city
+
+ - jsonPath: $.BirthRegistrationApplications.*.address.locality.name
+
+ - jsonPath: $.BirthRegistrationApplications.*.address.pincode
+
+ - jsonPath: $.BirthRegistrationApplications.*.address.detail
+
+ - jsonPath: $.BirthRegistrationApplications.*.id
+
+ - jsonPath: $.BirthRegistrationApplications.*.address.createdBy
+
+ - jsonPath: $.BirthRegistrationApplications.*.address.lastModifiedBy
+
+ - jsonPath: $.BirthRegistrationApplications.*.address.createdTime
+
+ - jsonPath: $.BirthRegistrationApplications.*.address.lastModifiedTime
+
+ - version: 1.0
+ description: Update birth registration applications in table
+ fromTopic: update-bt-application
+ isTransaction: true
+ queryMaps:
+ - query: UPDATE eg_bt_registration SET tenantid = ?,babyFirstName = ?, timeOfBirth = ? WHERE id=?;
+ basePath: BirthRegistrationApplications
+ jsonMaps:
+ - jsonPath: $.BirthRegistrationApplications.*.tenantId
+
+ - jsonPath: $.BirthRegistrationApplications.*.babyFirstName
+
+ - jsonPath: $.BirthRegistrationApplications.*.timeOfBirth
+
+ - jsonPath: $.BirthRegistrationApplications.*.id
\ No newline at end of file
diff --git a/tutorials/Assignment-2/btr-services/pom.xml b/tutorials/Assignment-2/btr-services/pom.xml
new file mode 100644
index 00000000000..9aac623e7d1
--- /dev/null
+++ b/tutorials/Assignment-2/btr-services/pom.xml
@@ -0,0 +1,113 @@
+
+ 4.0.0
+ org.egov
+ birth-registration
+ jar
+ birth-registration
+ 1.0.0
+
+ 1.8
+ ${java.version}
+ ${java.version}
+
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 1.5.9.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.flywaydb
+ flyway-core
+
+
+ org.postgresql
+ postgresql
+ 42.2.2.jre7
+
+
+ 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.0.1-SNAPSHOT
+
+
+ org.egov
+ mdms-client
+ 0.0.2-SNAPSHOT
+ compile
+
+
+ org.projectlombok
+ lombok
+ true
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+
+
+
+ javax.validation
+ validation-api
+
+
+
+
+
+ repo.egovernments.org
+ eGov ERP Releases Repository
+ https://nexus-repo.egovernments.org/nexus/content/repositories/releases/
+
+
+ repo.egovernments.org.snapshots
+ eGov ERP Releases Repository
+ https://nexus-repo.egovernments.org/nexus/content/repositories/snapshots/
+
+
+ repo.egovernments.org.public
+ eGov Public Repository Group
+ https://nexus-repo.egovernments.org/nexus/content/groups/public/
+
+
+
diff --git a/tutorials/Assignment-2/btr-services/src/main/java/digit/Main.java b/tutorials/Assignment-2/btr-services/src/main/java/digit/Main.java
new file mode 100644
index 00000000000..48f4e7a1bd5
--- /dev/null
+++ b/tutorials/Assignment-2/btr-services/src/main/java/digit/Main.java
@@ -0,0 +1,19 @@
+package digit;
+
+
+import org.egov.tracer.config.TracerConfiguration;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Import;
+
+@Import({TracerConfiguration.class})
+@SpringBootApplication
+@ComponentScan(basePackages = {"digit", "digit.web.controllers", "digit.config"})
+public class Main {
+
+ public static void main(String[] args) throws Exception {
+ SpringApplication.run(Main.class, args);
+ }
+
+}
diff --git a/tutorials/Assignment-2/btr-services/src/main/java/digit/config/BTRConfiguration.java b/tutorials/Assignment-2/btr-services/src/main/java/digit/config/BTRConfiguration.java
new file mode 100644
index 00000000000..e18d1d4b6f8
--- /dev/null
+++ b/tutorials/Assignment-2/btr-services/src/main/java/digit/config/BTRConfiguration.java
@@ -0,0 +1,112 @@
+package digit.config;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import lombok.*;
+import org.egov.tracer.config.TracerConfiguration;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Import;
+import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PostConstruct;
+import java.util.TimeZone;
+
+@Component
+@Data
+@Import({TracerConfiguration.class})
+@NoArgsConstructor
+@AllArgsConstructor
+@Setter
+@Getter
+public class BTRConfiguration {
+
+ @Value("${app.timezone}")
+ private String timeZone;
+
+ // BTR Variables
+
+ @Value("${btr.kafka.create.topic}")
+ private String createTopic;
+
+ @Value("${btr.kafka.update.topic}")
+ private String updateTopic;
+
+ @Value("${btr.default.offset}")
+ private Integer defaultOffset;
+
+ @Value("${btr.default.limit}")
+ private Integer defaultLimit;
+
+ @Value("${btr.search.max.limit}")
+ private Integer maxLimit;
+
+ // User Config
+ @Value("${egov.user.host}")
+ private String userHost;
+
+ @Value("${egov.user.context.path}")
+ private String userContextPath;
+
+ @Value("${egov.user.create.path}")
+ private String userCreateEndpoint;
+
+ @Value("${egov.user.search.path}")
+ private String userSearchEndpoint;
+
+ @Value("${egov.user.update.path}")
+ private String userUpdateEndpoint;
+
+ //Idgen Config
+ @Value("${egov.idgen.host}")
+ private String idGenHost;
+
+ @Value("${egov.idgen.path}")
+ private String idGenPath;
+
+ //Workflow Config
+ @Value("${egov.workflow.host}")
+ private String wfHost;
+
+ @Value("${egov.workflow.transition.path}")
+ private String wfTransitionPath;
+
+ @Value("${egov.workflow.businessservice.search.path}")
+ private String wfBusinessServiceSearchPath;
+
+ @Value("${egov.workflow.processinstance.search.path}")
+ private String wfProcessInstanceSearchPath;
+
+ @Value("${is.workflow.enabled}")
+ private Boolean isWorkflowEnabled;
+
+ //MDMS
+ @Value("${egov.mdms.host}")
+ private String mdmsHost;
+
+ @Value("${egov.mdms.search.endpoint}")
+ private String mdmsEndPoint;
+
+// //HRMS
+// @Value("${egov.hrms.host}")
+// private String hrmsHost;
+//
+// @Value("${egov.hrms.search.endpoint}")
+// private String hrmsEndPoint;
+
+ @Value("${egov.url.shortner.host}")
+ private String urlShortnerHost;
+
+ @Value("${egov.url.shortner.endpoint}")
+ private String urlShortnerEndpoint;
+
+ @Value("${egov.btrcalculator.host}")
+ private String btrCalculatorHost;
+
+ @Value("${egov.btrcalculator.endpoint}")
+ private String btrCalculatorCalculateEndpoint;
+
+ @Value("${egov.sms.notification.topic}")
+ private String smsNotificationTopic;
+}
diff --git a/tutorials/Assignment-2/btr-services/src/main/java/digit/config/MainConfiguration.java b/tutorials/Assignment-2/btr-services/src/main/java/digit/config/MainConfiguration.java
new file mode 100644
index 00000000000..0a59c792c3b
--- /dev/null
+++ b/tutorials/Assignment-2/btr-services/src/main/java/digit/config/MainConfiguration.java
@@ -0,0 +1,39 @@
+package digit.config;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.egov.tracer.config.TracerConfiguration;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Import;
+import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
+
+import javax.annotation.PostConstruct;
+import java.util.TimeZone;
+
+
+@Import({TracerConfiguration.class})
+public class MainConfiguration {
+
+ @Value("${app.timezone}")
+ private String timeZone;
+
+ @PostConstruct
+ public void initialize() {
+ TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
+ }
+
+ @Bean
+ public ObjectMapper objectMapper() {
+ return new ObjectMapper().disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES).setTimeZone(TimeZone.getTimeZone(timeZone));
+ }
+
+ @Bean
+ @Autowired
+ public MappingJackson2HttpMessageConverter jacksonConverter(ObjectMapper objectMapper) {
+ MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
+ converter.setObjectMapper(objectMapper);
+ return converter;
+ }
+}
\ No newline at end of file
diff --git a/tutorials/Assignment-2/btr-services/src/main/java/digit/consumer/NotificationConsumer.java b/tutorials/Assignment-2/btr-services/src/main/java/digit/consumer/NotificationConsumer.java
new file mode 100644
index 00000000000..cd93d21c87d
--- /dev/null
+++ b/tutorials/Assignment-2/btr-services/src/main/java/digit/consumer/NotificationConsumer.java
@@ -0,0 +1,40 @@
+package digit.consumer;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import digit.service.NotificationService;
+import digit.web.models.BirthRegistrationRequest;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.kafka.annotation.KafkaListener;
+import org.springframework.kafka.support.KafkaHeaders;
+import org.springframework.messaging.handler.annotation.Header;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+
+@Component
+@Slf4j
+public class NotificationConsumer {
+
+ @Autowired
+ private ObjectMapper mapper;
+
+ @Autowired
+ private NotificationService notificationService;
+
+ @KafkaListener(topics = {"${btr.kafka.create.topic}"})
+ public void listen(final HashMap record, @Header(KafkaHeaders.RECEIVED_TOPIC) String topic) {
+
+ try {
+
+ BirthRegistrationRequest request = mapper.convertValue(record, BirthRegistrationRequest.class);
+ //log.info(request.toString());
+ notificationService.prepareEventAndSend(request);
+
+ } catch (final Exception e) {
+
+ log.error("Error while listening to value: " + record + " on topic: " + topic + ": ", e);
+ }
+ }
+
+}
diff --git a/tutorials/Assignment-2/btr-services/src/main/java/digit/consumer/PaymentBackUpdateConsumer.java b/tutorials/Assignment-2/btr-services/src/main/java/digit/consumer/PaymentBackUpdateConsumer.java
new file mode 100644
index 00000000000..8d08d6711b7
--- /dev/null
+++ b/tutorials/Assignment-2/btr-services/src/main/java/digit/consumer/PaymentBackUpdateConsumer.java
@@ -0,0 +1,22 @@
+package digit.consumer;
+
+import digit.service.PaymentUpdateService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.kafka.annotation.KafkaListener;
+import org.springframework.kafka.support.KafkaHeaders;
+import org.springframework.messaging.handler.annotation.Header;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+
+@Component
+public class PaymentBackUpdateConsumer {
+
+ @Autowired
+ private PaymentUpdateService paymentUpdateService;
+
+ @KafkaListener(topics = {"${kafka.topics.receipt.create}"})
+ public void listenPayments(final HashMap record, @Header(KafkaHeaders.RECEIVED_TOPIC) String topic) {
+ paymentUpdateService.process(record);
+ }
+}
diff --git a/tutorials/Assignment-2/btr-services/src/main/java/digit/enrichment/BirthApplicationEnrichment.java b/tutorials/Assignment-2/btr-services/src/main/java/digit/enrichment/BirthApplicationEnrichment.java
new file mode 100644
index 00000000000..f00c25159e2
--- /dev/null
+++ b/tutorials/Assignment-2/btr-services/src/main/java/digit/enrichment/BirthApplicationEnrichment.java
@@ -0,0 +1,95 @@
+package digit.enrichment;
+
+import digit.service.UserService;
+import digit.util.IdgenUtil;
+import digit.util.UserUtil;
+import digit.web.models.*;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.UUID;
+
+@Slf4j
+@Component
+public class BirthApplicationEnrichment {
+
+ @Autowired
+ private IdgenUtil idgenUtil;
+ @Autowired
+ private UserService userService;
+ @Autowired
+ private UserUtil userUtils;
+
+ public void enrichBirthApplication(BirthRegistrationRequest birthRegistrationRequest) {
+ List birthRegistrationIdList = idgenUtil.getIdList(birthRegistrationRequest.getRequestInfo(), birthRegistrationRequest.getBirthRegistrationApplications().get(0).getTenantId(), "btr.registrationid", "", birthRegistrationRequest.getBirthRegistrationApplications().size());
+ Integer index = 0;
+ for(BirthRegistrationApplication application : birthRegistrationRequest.getBirthRegistrationApplications()) {
+ // Enrich audit details
+ AuditDetails auditDetails = AuditDetails.builder().createdBy(birthRegistrationRequest.getRequestInfo().getUserInfo().getUuid()).createdTime(System.currentTimeMillis()).lastModifiedBy(birthRegistrationRequest.getRequestInfo().getUserInfo().getUuid()).lastModifiedTime(System.currentTimeMillis()).build();
+ application.setAuditDetails(auditDetails);
+
+ // Enrich UUID
+ application.setId(UUID.randomUUID().toString());
+
+ // Set application number from IdGen
+ application.setApplicationNumber(birthRegistrationIdList.get(index++));
+
+ // Enrich registration Id
+ application.getAddress().setRegistrationId(application.getId());
+
+ // Enrich address UUID
+ application.getAddress().setId(UUID.randomUUID().toString());
+ }
+ }
+
+ public void enrichBirthApplicationUponUpdate(BirthRegistrationRequest birthRegistrationRequest) {
+ // Enrich lastModifiedTime and lastModifiedBy in case of update
+ for(BirthRegistrationApplication application : birthRegistrationRequest.getBirthRegistrationApplications()) {
+ application.getAuditDetails().setLastModifiedTime(System.currentTimeMillis());
+ application.getAuditDetails().setLastModifiedBy(birthRegistrationRequest.getRequestInfo().getUserInfo().getUuid());
+ }
+ }
+
+ public void enrichFatherApplicantOnSearch(BirthRegistrationApplication application) {
+ UserDetailResponse fatherUserResponse = userService.searchUser(userUtils.getStateLevelTenant(application.getTenantId()),application.getFather().getId(),null);
+ User fatherUser = fatherUserResponse.getUser().get(0);
+ log.info(fatherUser.toString());
+ FatherApplicant fatherApplicant = FatherApplicant.builder().aadhaarNumber(fatherUser.getAadhaarNumber())
+ .accountLocked(fatherUser.getAccountLocked())
+ .active(fatherUser.getActive())
+ .altContactNumber(fatherUser.getAltContactNumber())
+ .bloodGroup(fatherUser.getBloodGroup())
+ .correspondenceAddress(fatherUser.getCorrespondenceAddress())
+ .correspondenceCity(fatherUser.getCorrespondenceCity())
+ .correspondencePincode(fatherUser.getCorrespondencePincode())
+ .gender(fatherUser.getGender())
+ .id(fatherUser.getUuid())
+ .name(fatherUser.getName())
+ .type(fatherUser.getType())
+ .roles(fatherUser.getRoles()).build();
+ application.setFather(fatherApplicant);
+ }
+
+ public void enrichMotherApplicantOnSearch(BirthRegistrationApplication application) {
+ UserDetailResponse motherUserResponse = userService.searchUser(userUtils.getStateLevelTenant(application.getTenantId()),application.getMother().getId(),null);
+ User motherUser = motherUserResponse.getUser().get(0);
+ log.info(motherUser.toString());
+ MotherApplicant motherApplicant = MotherApplicant.builder().aadhaarNumber(motherUser.getAadhaarNumber())
+ .accountLocked(motherUser.getAccountLocked())
+ .active(motherUser.getActive())
+ .altContactNumber(motherUser.getAltContactNumber())
+ .bloodGroup(motherUser.getBloodGroup())
+ .correspondenceAddress(motherUser.getCorrespondenceAddress())
+ .correspondenceCity(motherUser.getCorrespondenceCity())
+ .correspondencePincode(motherUser.getCorrespondencePincode())
+ .gender(motherUser.getGender())
+ .id(motherUser.getUuid())
+ .name(motherUser.getName())
+ .type(motherUser.getType())
+ .roles(motherUser.getRoles()).build();
+ application.setMother(motherApplicant);
+ }
+
+}
diff --git a/tutorials/Assignment-2/btr-services/src/main/java/digit/producer/Producer.java b/tutorials/Assignment-2/btr-services/src/main/java/digit/producer/Producer.java
new file mode 100644
index 00000000000..e0ae8f7232a
--- /dev/null
+++ b/tutorials/Assignment-2/btr-services/src/main/java/digit/producer/Producer.java
@@ -0,0 +1,18 @@
+package digit.producer;
+
+import lombok.extern.slf4j.Slf4j;
+import org.egov.tracer.kafka.CustomKafkaTemplate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+@Slf4j
+public class Producer {
+
+ @Autowired
+ private CustomKafkaTemplate kafkaTemplate;
+
+ public void push(String topic, Object value) {
+ kafkaTemplate.send(topic, value);
+ }
+}
diff --git a/tutorials/Assignment-2/btr-services/src/main/java/digit/repository/BirthRegistrationRepository.java b/tutorials/Assignment-2/btr-services/src/main/java/digit/repository/BirthRegistrationRepository.java
new file mode 100644
index 00000000000..d9bc21cc2b3
--- /dev/null
+++ b/tutorials/Assignment-2/btr-services/src/main/java/digit/repository/BirthRegistrationRepository.java
@@ -0,0 +1,35 @@
+package digit.repository;
+
+import digit.repository.querybuilder.BirthApplicationQueryBuilder;
+import digit.repository.rowmapper.BirthApplicationRowMapper;
+import digit.web.models.BirthApplicationSearchCriteria;
+import digit.web.models.BirthRegistrationApplication;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.stereotype.Repository;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+@Slf4j
+@Repository
+public class BirthRegistrationRepository {
+
+ @Autowired
+ private BirthApplicationQueryBuilder queryBuilder;
+
+ @Autowired
+ private JdbcTemplate jdbcTemplate;
+
+ @Autowired
+ private BirthApplicationRowMapper rowMapper;
+
+ public ListgetApplications(BirthApplicationSearchCriteria searchCriteria){
+ List