From 035b374aa46810efde2e90e7b7b3a8d59dd95f67 Mon Sep 17 00:00:00 2001 From: manastanmay-eGov Date: Mon, 18 Nov 2024 20:25:14 +0530 Subject: [PATCH 1/6] Rebased the code with digit works --- reference-adapters/ifms-adapter/pom.xml | 68 ++--- .../main/java/org/egov/IFMSAdapterMain.java | 5 + .../org/egov/config/IfmsAdapterConfig.java | 40 +++ .../org/egov/config/MainConfiguration.java | 32 +-- .../PaymentInstructionEnrichment.java | 27 +- .../VirtualAllotmentEnrichment.java | 2 +- .../org/egov/repository/PIRepository.java | 7 +- .../rowmapper/ExecutedVALogsRowMapper.java | 2 +- .../repository/rowmapper/PIRowMapper.java | 2 +- .../rowmapper/PIStatusLogsRowMapper.java | 2 +- .../rowmapper/SanctionDetailRowMapper.java | 2 +- .../org/egov/service/DisbursementService.java | 221 +++++++++++---- .../org/egov/service/EncryptionService.java | 2 + .../egov/service/FailureDetailsService.java | 30 +- .../java/org/egov/service/IfmsService.java | 14 + .../org/egov/service/MockTestService.java | 258 ++++++++++++++++++ .../java/org/egov/service/PAGService.java | 2 +- .../main/java/org/egov/service/PDService.java | 6 +- .../java/org/egov/service/PISService.java | 7 +- .../service/PaymentInstructionService.java | 45 ++- .../java/org/egov/service/PaymentService.java | 8 +- .../egov/service/VirtualAllotmentService.java | 2 +- .../java/org/egov/utils/AuditLogUtils.java | 4 +- .../org/egov/utils/AuthenticationUtils.java | 2 +- .../java/org/egov/utils/BankAccountUtils.java | 12 +- .../main/java/org/egov/utils/BillUtils.java | 7 +- .../main/java/org/egov/utils/ESLogUtils.java | 8 +- .../main/java/org/egov/utils/IdgenUtil.java | 10 +- .../java/org/egov/utils/IndividualUtils.java | 4 +- .../main/java/org/egov/utils/MdmsUtils.java | 27 +- .../org/egov/utils/OrganisationUtils.java | 21 +- .../src/main/java/org/egov/utils/PIUtils.java | 3 +- .../validators/DisbursementValidator.java | 5 - .../PaymentInstructionValidator.java | 6 +- .../org/egov/web/controller/Scheduler.java | 2 + .../egov/web/controller/TestController.java | 92 ------- .../org/egov/web/models/Disbursement.java | 2 +- .../java/org/egov/web/models/ErrorRes.java | 1 - .../java/org/egov/web/models/Pagination.java | 1 - .../web/models/bankaccount/BankAccount.java | 69 ----- .../bankaccount/BankAccountDetails.java | 84 ------ .../bankaccount/BankAccountResponse.java | 48 ---- .../BankAccountSearchCriteria.java | 88 ------ .../bankaccount/BankAccountSearchRequest.java | 37 --- .../bankaccount/BankBranchIdentifier.java | 42 --- .../java/org/egov/web/models/bill/Bill.java | 118 -------- .../egov/web/models/bill/BillCriteria.java | 69 ----- .../org/egov/web/models/bill/BillDetail.java | 113 -------- .../egov/web/models/bill/BillResponse.java | 47 ---- .../web/models/bill/BillSearchRequest.java | 42 --- .../org/egov/web/models/bill/LineItem.java | 77 ------ .../web/models/bill/PISearchCriteria.java | 4 - .../java/org/egov/web/models/bill/Party.java | 66 ----- .../org/egov/web/models/bill/Payment.java | 70 ----- .../org/egov/web/models/bill/PaymentBill.java | 63 ----- .../web/models/bill/PaymentBillDetail.java | 65 ----- .../egov/web/models/bill/PaymentLineItem.java | 43 --- .../egov/web/models/bill/PaymentRequest.java | 1 + .../egov/web/models/bill/PaymentResponse.java | 46 ---- .../egov/web/models/enums/LineItemType.java | 37 --- .../egov/web/models/enums/PaymentStatus.java | 44 --- .../web/models/enums/ReferenceStatus.java | 52 ---- .../org/egov/web/models/enums/Status.java | 42 --- .../models/individual/IndividualSearch.java | 100 ------- .../individual/IndividualSearchRequest.java | 37 --- .../org/egov/web/models/jit/Allotment.java | 51 ++-- .../org/egov/web/models/jit/Beneficiary.java | 46 ++-- .../egov/web/models/jit/BenfLineItems.java | 5 +- .../web/models/jit/CORBeneficiaryDetails.java | 17 +- .../org/egov/web/models/jit/CORRequest.java | 15 +- .../egov/web/models/jit/ExecutedVALog.java | 2 +- .../org/egov/web/models/jit/FundsSummary.java | 2 +- .../org/egov/web/models/jit/PADetails.java | 5 +- .../egov/web/models/jit/PISearchCriteria.java | 1 - .../org/egov/web/models/jit/PIStatusLog.java | 5 +- .../web/models/jit/PaymentInstruction.java | 69 +++-- .../egov/web/models/jit/SanctionDetail.java | 3 +- .../web/models/jit/TransactionDetails.java | 2 +- .../web/models/mdmsV2/MdmsResponseV2.java | 25 ++ .../org/egov/web/models/mdmsV2/MdmsV2.java | 50 ++++ .../org/egov/web/models/mock/MockRequest.java | 18 ++ .../egov/web/models/organisation/Address.java | 82 ------ .../organisation/ApplicationStatus.java | 35 --- .../models/organisation/ContactDetails.java | 80 ------ .../web/models/organisation/Document.java | 46 ---- .../web/models/organisation/Function.java | 85 ------ .../web/models/organisation/GeoLocation.java | 32 --- .../web/models/organisation/Identifier.java | 48 ---- .../web/models/organisation/Jurisdiction.java | 31 --- .../web/models/organisation/OrgResponse.java | 46 ---- .../organisation/OrgSearchCriteria.java | 79 ------ .../models/organisation/OrgSearchRequest.java | 32 --- .../web/models/organisation/Organisation.java | 145 ---------- .../org/egov/web/models/program/Program.java | 2 +- .../src/main/resources/application.properties | 15 +- .../src/main/resources/db/Dockerfile | 4 +- .../src/main/resources/db/migrate.sh | 2 +- 97 files changed, 879 insertions(+), 2696 deletions(-) create mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/service/MockTestService.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/controller/TestController.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankAccount.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankAccountDetails.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankAccountResponse.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankAccountSearchCriteria.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankAccountSearchRequest.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankBranchIdentifier.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/Bill.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/BillCriteria.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/BillDetail.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/BillResponse.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/BillSearchRequest.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/LineItem.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PISearchCriteria.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/Party.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/Payment.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PaymentBill.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PaymentBillDetail.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PaymentLineItem.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PaymentResponse.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/enums/LineItemType.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/enums/PaymentStatus.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/enums/ReferenceStatus.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/enums/Status.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/individual/IndividualSearch.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/individual/IndividualSearchRequest.java create mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/mdmsV2/MdmsResponseV2.java create mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/mdmsV2/MdmsV2.java create mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/mock/MockRequest.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Address.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/ApplicationStatus.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/ContactDetails.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Document.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Function.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/GeoLocation.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Identifier.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Jurisdiction.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/OrgResponse.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/OrgSearchCriteria.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/OrgSearchRequest.java delete mode 100644 reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Organisation.java diff --git a/reference-adapters/ifms-adapter/pom.xml b/reference-adapters/ifms-adapter/pom.xml index 4631f506da..6c206c4cf6 100644 --- a/reference-adapters/ifms-adapter/pom.xml +++ b/reference-adapters/ifms-adapter/pom.xml @@ -3,20 +3,20 @@ org.egov ifms-adapter - 0.1.0 + 0.1.1 - 1.8 + 17 ${java.version} ${java.version} 2.17.1 - 42.3.3 + 1.18.22 org.springframework.boot spring-boot-starter-parent - 2.2.13.RELEASE + 3.2.2 @@ -60,38 +60,29 @@ org.egov.services tracer - 2.0.0-SNAPSHOT - - - org.egov.services - services-common - 1.1.1-SNAPSHOT - - - org.egov.services - digit-models - 1.0.0-SNAPSHOT + 2.9.0-SNAPSHOT org.egov mdms-client - 0.0.2-SNAPSHOT - - - org.egov.common - health-services-common - 1.0.11-SNAPSHOT + 2.9.0-SNAPSHOT org.egov.common health-services-models - 1.0.6-SNAPSHOT + 1.0.22-SNAPSHOT compile org.postgresql postgresql + 42.7.1 + + org.springframework.boot + spring-boot-starter-validation + 3.2.3 + org.jsoup jsoup @@ -100,12 +91,14 @@ org.flywaydb flyway-core + 9.22.3 org.projectlombok lombok true + 1.18.30 @@ -113,39 +106,24 @@ jackson-datatype-jsr310 - - javax.validation - validation-api - org.egov enc-client - 2.0.5-SNAPSHOT - - - org.egov.services - tracer - - + 2.9.0 + + + org.egov.works + works-services-common + 1.0.0-SNAPSHOT repo.digit.org - eGov ERP Releases Repository - https://nexus-repo.digit.org/nexus/content/repositories/releases/ - - - repo.digit.org.snapshots - eGov ERP Releases Repository + eGov DIGIT Releases Repository https://nexus-repo.digit.org/nexus/content/repositories/snapshots/ - - repo.digit.org.public - eGov Public Repository Group - https://nexus-repo.digit.org/nexus/content/groups/public/ - @@ -165,4 +143,4 @@ - \ No newline at end of file + diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/IFMSAdapterMain.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/IFMSAdapterMain.java index 60d8fb3dbb..88450b222e 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/IFMSAdapterMain.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/IFMSAdapterMain.java @@ -1,9 +1,14 @@ package org.egov; +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 = {"org.egov.config", "org.egov.kafka", "org.egov", "org.egov.web"}) public class IFMSAdapterMain { public static void main(String args[]) { diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/config/IfmsAdapterConfig.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/config/IfmsAdapterConfig.java index 2bb6021584..a88052047a 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/config/IfmsAdapterConfig.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/config/IfmsAdapterConfig.java @@ -1,10 +1,13 @@ package org.egov.config; +import jakarta.annotation.PostConstruct; import lombok.*; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; import org.springframework.stereotype.Component; + @Configuration @Component @Data @@ -48,6 +51,16 @@ public class IfmsAdapterConfig { @Value("${egov.mdms.search.endpoint}") private String mdmsEndPoint; + // MDMS-v2 + @Value("${egov.mdms.v2.host}") + private String mdmsV2Host; + + @Value("${egov.mdms.v2.v2.search.endpoint}") + private String mdmsV2V2EndPoint; + + @Value("${egov.mdms.v2.v1.search.endpoint}") + private String mdmsV2V1EndPoint; + // bill @Value("${egov.bill.host}") private String billHost; @@ -166,4 +179,31 @@ public class IfmsAdapterConfig { @Value("${ifix.adapter.es.error.queue.topic}") private String ifixAdapterESErrorQueueTopic; + + @Value("${ifms.jit.mock.enabled}") + private Boolean ifmsJitMockEnabled; + + @Value("${ifms.jit.mock.mdms.master.name}") + private String ifmsJitMockMdmsMasterName; + + @Value("${ifms.jit.mock.enabled.tenants}") + private String ifmsJitMockEnabledTenants; + + private String[] ifmsMockEnabledTenantsIds; + + @Value("${original.pi.expire.days}") + private Integer originalExpireDays; + + @Value("${original.pi.expire.financial.year.date}") + private Integer originalExpireFinancialYearDate; + + @Value("${original.pi.expire.financial.year.month}") + private Integer originalExpireFinancialYearMonth; + + @PostConstruct + public void init() { + if (ifmsJitMockEnabled && !StringUtils.isEmpty(ifmsJitMockEnabledTenants)) { + ifmsMockEnabledTenantsIds = ifmsJitMockEnabledTenants.split(","); + } + } } diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/config/MainConfiguration.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/config/MainConfiguration.java index 35afd8f7af..948e7e27e5 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/config/MainConfiguration.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/config/MainConfiguration.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; +import jakarta.annotation.PostConstruct; import lombok.extern.slf4j.Slf4j; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.conn.ssl.TrustStrategy; @@ -22,16 +23,9 @@ import org.springframework.util.CollectionUtils; import org.springframework.web.client.RestTemplate; -import javax.annotation.PostConstruct; import javax.net.ssl.*; -import java.net.HttpURLConnection; -import java.security.KeyManagementException; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.cert.X509Certificate; -import java.util.ArrayList; + import java.util.Collections; -import java.util.List; import java.util.TimeZone; @Slf4j @@ -54,15 +48,15 @@ public ObjectMapper ifmsObjectMapper() { return objectMapper; } -// @Bean -// @Primary -// public RestTemplate restTemplate(TracerProperties tracerProperties) { -// SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory(); -// requestFactory.setOutputStreaming(false); -// RestTemplate restTemplate = new RestTemplate(new BufferingClientHttpRequestFactory(requestFactory)); -// restTemplate.setInterceptors(Collections.singletonList(new RestTemplateLoggingInterceptor(tracerProperties))); -// return restTemplate; -// } + @Bean + @Primary + public RestTemplate restTemplate(TracerProperties tracerProperties) { + SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory(); + requestFactory.setOutputStreaming(false); + RestTemplate restTemplate = new RestTemplate(new BufferingClientHttpRequestFactory(requestFactory)); + restTemplate.setInterceptors(Collections.singletonList(new RestTemplateLoggingInterceptor(tracerProperties))); + return restTemplate; + } /** * It will disable ssl certification check @@ -70,6 +64,7 @@ public ObjectMapper ifmsObjectMapper() { * @return * @throws Exception */ + /* @Bean public RestTemplate restTemplate() throws Exception { TrustManager[] trustAllCertificates = new TrustManager[]{ @@ -112,4 +107,5 @@ public MappingJackson2HttpMessageConverter jacksonConverter(ObjectMapper objectM converter.setObjectMapper(objectMapper); return converter; } -} \ No newline at end of file + */ +} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/enrichment/PaymentInstructionEnrichment.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/enrichment/PaymentInstructionEnrichment.java index a031ee4443..f0f1477af2 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/enrichment/PaymentInstructionEnrichment.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/enrichment/PaymentInstructionEnrichment.java @@ -3,9 +3,9 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; -import digit.models.coremodels.AuditDetails; import lombok.extern.slf4j.Slf4j; import net.minidev.json.JSONArray; +import org.egov.common.contract.models.AuditDetails; import org.egov.common.contract.request.RequestInfo; import org.egov.common.contract.request.User; import org.egov.common.models.individual.Individual; @@ -17,11 +17,15 @@ import org.egov.utils.*; import org.egov.web.models.Disbursement; import org.egov.web.models.DisbursementRequest; -import org.egov.web.models.bankaccount.BankAccount; -import org.egov.web.models.bill.*; +import org.egov.web.models.bill.PaymentRequest; import org.egov.web.models.enums.*; import org.egov.web.models.jit.*; -import org.egov.web.models.organisation.Organisation; +import org.egov.works.services.common.models.bankaccounts.BankAccount; +import org.egov.works.services.common.models.expense.Bill; +import org.egov.works.services.common.models.expense.BillDetail; +import org.egov.works.services.common.models.expense.LineItem; +import org.egov.works.services.common.models.expense.Party; +import org.egov.works.services.common.models.organization.Organisation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -331,21 +335,6 @@ private JSONArray sortHoaList(JSONArray hoaList) { return hoaList; } - private List getBeneficiaryListFromBill(Bill bill) { - List piBeneficiaryList = new ArrayList<>(); - for (BillDetail billDetail: bill.getBillDetails()) { - for (LineItem lineItem: billDetail.getPayableLineItems()) { - if (lineItem.getStatus().equals(Status.ACTIVE)) { - Beneficiary piBeneficiary = Beneficiary.builder() - .benefId(billDetail.getPayee().getIdentifier()) - .benfAmount(lineItem.getAmount().toString()) - .build(); - piBeneficiaryList.add(piBeneficiary); - } - } - } - return piBeneficiaryList; - } public void enrichBankaccountOnBeneficiary(List beneficiaryList, List bankAccounts, List individuals, List organisations) { log.info("Started executing enrichBankaccountOnBeneficiary"); diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/enrichment/VirtualAllotmentEnrichment.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/enrichment/VirtualAllotmentEnrichment.java index 9036d990cc..c57c480866 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/enrichment/VirtualAllotmentEnrichment.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/enrichment/VirtualAllotmentEnrichment.java @@ -2,8 +2,8 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import digit.models.coremodels.AuditDetails; import lombok.extern.slf4j.Slf4j; +import org.egov.common.contract.models.AuditDetails; import org.egov.common.contract.request.RequestInfo; import org.egov.utils.HelperUtil; import org.egov.web.models.Allocation; diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/repository/PIRepository.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/repository/PIRepository.java index 066247675e..648e998b48 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/repository/PIRepository.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/repository/PIRepository.java @@ -4,10 +4,8 @@ import org.egov.repository.querybuilder.PIQueryBuilder; import org.egov.repository.rowmapper.PIRowMapper; import org.egov.utils.HelperUtil; -import org.egov.web.models.Pagination; -import org.egov.web.models.enums.PIStatus; -import org.egov.web.models.enums.PaymentStatus; import org.egov.web.models.jit.*; +import org.egov.works.services.common.models.expense.enums.PaymentStatus; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; @@ -15,14 +13,11 @@ import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; -import java.sql.Timestamp; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.UUID; -import static org.egov.repository.querybuilder.PIQueryBuilder.*; - @Repository @Slf4j public class PIRepository { diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/repository/rowmapper/ExecutedVALogsRowMapper.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/repository/rowmapper/ExecutedVALogsRowMapper.java index 76a605a6f2..fe30ed16ca 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/repository/rowmapper/ExecutedVALogsRowMapper.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/repository/rowmapper/ExecutedVALogsRowMapper.java @@ -2,8 +2,8 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import digit.models.coremodels.AuditDetails; import lombok.extern.slf4j.Slf4j; +import org.egov.common.contract.models.AuditDetails; import org.egov.tracer.model.CustomException; import org.egov.web.models.jit.ExecutedVALog; import org.postgresql.util.PGobject; diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/repository/rowmapper/PIRowMapper.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/repository/rowmapper/PIRowMapper.java index e338cd0221..4c41520fbc 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/repository/rowmapper/PIRowMapper.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/repository/rowmapper/PIRowMapper.java @@ -2,9 +2,9 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import digit.models.coremodels.AuditDetails; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; +import org.egov.common.contract.models.AuditDetails; import org.egov.tracer.model.CustomException; import org.egov.web.models.enums.BeneficiaryPaymentStatus; import org.egov.web.models.enums.BeneficiaryType; diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/repository/rowmapper/PIStatusLogsRowMapper.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/repository/rowmapper/PIStatusLogsRowMapper.java index 8a5881b006..bf38c6bf27 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/repository/rowmapper/PIStatusLogsRowMapper.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/repository/rowmapper/PIStatusLogsRowMapper.java @@ -2,8 +2,8 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import digit.models.coremodels.AuditDetails; import lombok.extern.slf4j.Slf4j; +import org.egov.common.contract.models.AuditDetails; import org.egov.tracer.model.CustomException; import org.egov.web.models.enums.JITServiceId; import org.egov.web.models.enums.JitRespStatusForPI; diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/repository/rowmapper/SanctionDetailRowMapper.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/repository/rowmapper/SanctionDetailRowMapper.java index b63b234f3d..374e58e0df 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/repository/rowmapper/SanctionDetailRowMapper.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/repository/rowmapper/SanctionDetailRowMapper.java @@ -2,9 +2,9 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import digit.models.coremodels.AuditDetails; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.egov.common.contract.models.AuditDetails; import org.egov.tracer.model.CustomException; import org.egov.web.models.jit.Allotment; import org.egov.web.models.jit.FundsSummary; diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/service/DisbursementService.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/service/DisbursementService.java index 64c9b27487..ac86020e9b 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/service/DisbursementService.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/service/DisbursementService.java @@ -5,7 +5,6 @@ import lombok.extern.slf4j.Slf4j; import net.minidev.json.JSONArray; import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.request.User; import org.egov.config.IfmsAdapterConfig; import org.egov.enrichment.PaymentInstructionEnrichment; import org.egov.kafka.IfmsAdapterProducer; @@ -16,13 +15,20 @@ import org.egov.utils.MdmsUtils; import org.egov.utils.PIUtils; import org.egov.validators.DisbursementValidator; -import org.egov.web.models.*; +import org.egov.web.models.Disbursement; +import org.egov.web.models.DisbursementRequest; +import org.egov.web.models.DisbursementResponse; +import org.egov.web.models.ErrorRes; import org.egov.web.models.enums.*; import org.egov.web.models.jit.*; +import org.egov.works.services.common.models.expense.enums.PaymentStatus; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.web.client.HttpServerErrorException; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -62,17 +68,18 @@ public DisbursementService(DisbursementValidator disbursementValidator, PIReposi /** * Process the disbursement request and create a payment instruction. + * * @param disbursementRequest * @return */ public DisbursementResponse processDisbursementRequest(DisbursementRequest disbursementRequest) { PaymentStatus paymentStatus; PaymentInstruction lastPI = null; - PaymentInstruction originalPI = null; + PaymentInstruction lastOriginalPI = null; PaymentInstruction paymentInstructionFromDisbursement = null; RequestInfo requestInfo = RequestInfo.builder().build(); - Map> mdmsData = mdmsUtils.fetchHoaAndSSUDetails(requestInfo,disbursementRequest.getMessage().getLocationCode()); - disbursementValidator.validateDisbursementRequest(disbursementRequest,mdmsData); + Map> mdmsData = mdmsUtils.fetchHoaAndSSUDetails(requestInfo, disbursementRequest.getMessage().getLocationCode()); + disbursementValidator.validateDisbursementRequest(disbursementRequest, mdmsData); PISearchCriteria piSearchCriteria = PISearchCriteria.builder() .muktaReferenceId(disbursementRequest.getMessage().getTargetId()) .tenantId(disbursementRequest.getMessage().getLocationCode()) @@ -86,58 +93,69 @@ public DisbursementResponse processDisbursementRequest(DisbursementRequest disbu .tenantId(disbursementRequest.getMessage().getLocationCode()) .build(); List sanctionDetails = sanctionDetailsRepository.getSanctionDetails(sanctionDetailsSearchCriteria); - if(sanctionDetails.isEmpty()){ - throw new CustomException("INVALID_SANCTION_ID","Sanction Id is invalid for the disbursement Request."); + if (sanctionDetails.isEmpty()) { + throw new CustomException("INVALID_SANCTION_ID", "Sanction Id is invalid for the disbursement Request."); } - if(!paymentInstructions.isEmpty()){ - for(PaymentInstruction paymentInstruction:paymentInstructions){ - if(!paymentInstruction.getPiStatus().equals(PIStatus.FAILED) && lastPI == null){ - lastPI = paymentInstruction; - originalPI = paymentInstruction; - }else if(!paymentInstruction.getPiStatus().equals(PIStatus.FAILED)){ - originalPI = paymentInstruction; + if (!paymentInstructions.isEmpty()) { + for (PaymentInstruction paymentInstruction : paymentInstructions) { + if (!paymentInstruction.getPiStatus().equals(PIStatus.FAILED)) { + if (lastOriginalPI == null && paymentInstruction.getParentPiNumber() == null) { + lastOriginalPI = paymentInstruction; + } + + if (lastPI == null) { + lastPI = paymentInstruction; + } } } } + + boolean isValidForCORPIRequest = false; + if (lastOriginalPI != null) { + isValidForCORPIRequest = isValidForCORPIRequest(disbursementRequest.getMessage(), lastOriginalPI); + } // Check if last PI is in PARTIAL status, if yes then process it for revised PI creation - if(lastPI != null && lastPI.getPiStatus().equals(PIStatus.PARTIAL)){ + if (lastPI != null && lastPI.getPiStatus().equals(PIStatus.PARTIAL) && isValidForCORPIRequest) { log.info("Payment Instruction is in PARTIAL status, processing it for revised PI."); lastPI = encryptionDecryptionUtil.decryptObject(lastPI, ifmsAdapterConfig.getPaymentInstructionEncryptionKey(), PaymentInstruction.class, requestInfo); - originalPI = encryptionDecryptionUtil.decryptObject(originalPI, ifmsAdapterConfig.getPaymentInstructionEncryptionKey(), PaymentInstruction.class, requestInfo); - paymentInstructionFromDisbursement = paymentInstructionEnrichment.enrichPaymentIntsructionsFromDisbursementRequest(disbursementRequest,mdmsData,sanctionDetails.get(0),true,lastPI); - paymentStatus = processDisbursementForRevisedPICreation(paymentInstructionFromDisbursement, requestInfo,lastPI,originalPI,sanctionDetails.get(0)); - }else{ + lastOriginalPI = encryptionDecryptionUtil.decryptObject(lastOriginalPI, ifmsAdapterConfig.getPaymentInstructionEncryptionKey(), PaymentInstruction.class, requestInfo); + paymentInstructionFromDisbursement = paymentInstructionEnrichment.enrichPaymentIntsructionsFromDisbursementRequest(disbursementRequest, mdmsData, sanctionDetails.get(0), true, lastPI); + paymentStatus = processDisbursementForRevisedPICreation(paymentInstructionFromDisbursement, requestInfo, lastPI, lastOriginalPI, sanctionDetails.get(0)); + } else { log.info("Payment Instruction is not in PARTIAL status, processing it for PI creation."); disbursementValidator.validatePI(paymentInstructions); - paymentInstructionFromDisbursement = paymentInstructionEnrichment.enrichPaymentIntsructionsFromDisbursementRequest(disbursementRequest,mdmsData,sanctionDetails.get(0),false,lastPI); + paymentInstructionFromDisbursement = paymentInstructionEnrichment.enrichPaymentIntsructionsFromDisbursementRequest(disbursementRequest, mdmsData, sanctionDetails.get(0), false, lastPI); paymentStatus = processDisbursementForPICreation(disbursementRequest, paymentInstructionFromDisbursement, requestInfo, sanctionDetails); + if (lastPI != null) { + updatePIDateForRevisedPI(paymentInstructionFromDisbursement, lastPI, lastOriginalPI, paymentStatus, requestInfo); + } } try { - if(paymentStatus.equals(PaymentStatus.FAILED)){ - for(Beneficiary beneficiary: paymentInstructionFromDisbursement.getBeneficiaryDetails()){ + if (paymentStatus.equals(PaymentStatus.FAILED)) { + for (Beneficiary beneficiary : paymentInstructionFromDisbursement.getBeneficiaryDetails()) { beneficiary.setPaymentStatus(BeneficiaryPaymentStatus.FAILED); } - if(paymentInstructionFromDisbursement.getParentPiNumber() == null){ + if (paymentInstructionFromDisbursement.getParentPiNumber() == null) { sanctionDetails.get(0).getFundsSummary().setAvailableAmount(sanctionDetails.get(0).getFundsSummary().getAvailableAmount().add(paymentInstructionFromDisbursement.getGrossAmount())); } } - piRepository.update(Collections.singletonList(paymentInstructionFromDisbursement),sanctionDetails.get(0).getFundsSummary()); + piRepository.update(Collections.singletonList(paymentInstructionFromDisbursement), sanctionDetails.get(0).getFundsSummary()); } catch (Exception e) { log.info("Exception while saving PI data " + e); List errorObjects = new ArrayList<>(); errorObjects.add(disbursementRequest); - if(paymentInstructionFromDisbursement != null) + if (paymentInstructionFromDisbursement != null) errorObjects.add(paymentInstructionFromDisbursement); ErrorRes errorRes = ErrorRes.builder().message(e.getMessage()).objects(errorObjects).build(); - ifmsAdapterProducer.push(ifmsAdapterConfig.getIfixAdapterErrorQueueTopic(),errorRes); + ifmsAdapterProducer.push(ifmsAdapterConfig.getIfixAdapterErrorQueueTopic(), errorRes); } piUtils.updatePIIndex(requestInfo, paymentInstructionFromDisbursement); - return enrichDisbursementResponse(disbursementRequest,paymentInstructionFromDisbursement); + return enrichDisbursementResponse(disbursementRequest, paymentInstructionFromDisbursement); } - private void savePiInDatabase(PaymentInstruction paymentInstructionFromDisbursement, SanctionDetail sanctionDetail,PaymentStatus paymentStatus,RequestInfo requestInfo){ + private void savePiInDatabase(PaymentInstruction paymentInstructionFromDisbursement, SanctionDetail sanctionDetail, PaymentStatus paymentStatus, RequestInfo requestInfo) { log.info("Saving PI data."); // Subtract amount from available amount in Sanction Details if PI is in INITIATED status and parent PI number is null if (paymentStatus.equals(PaymentStatus.INITIATED) && paymentInstructionFromDisbursement.getParentPiNumber() == null) { @@ -147,33 +165,34 @@ private void savePiInDatabase(PaymentInstruction paymentInstructionFromDisbursem } // Encrypt PI and save it to DB try { - paymentInstructionFromDisbursement = encryptionDecryptionUtil.encryptObject(paymentInstructionFromDisbursement, ifmsAdapterConfig.getStateLevelTenantId(),ifmsAdapterConfig.getPaymentInstructionEncryptionKey(), PaymentInstruction.class); - piRepository.save(Collections.singletonList(paymentInstructionFromDisbursement), paymentStatus.equals(PaymentStatus.FAILED) ? null:sanctionDetail.getFundsSummary(), paymentStatus); + paymentInstructionFromDisbursement = encryptionDecryptionUtil.encryptObject(paymentInstructionFromDisbursement, ifmsAdapterConfig.getStateLevelTenantId(), ifmsAdapterConfig.getPaymentInstructionEncryptionKey(), PaymentInstruction.class); + piRepository.save(Collections.singletonList(paymentInstructionFromDisbursement), paymentStatus.equals(PaymentStatus.FAILED) ? null : sanctionDetail.getFundsSummary(), paymentStatus); piUtils.updatePIIndex(requestInfo, paymentInstructionFromDisbursement); - }catch (Exception e){ + } catch (Exception e) { log.info("Exception while encrypting PI data " + e); - throw new CustomException("ENC_ERROR","Exception while saving PI data " + e); + throw new CustomException("ENC_ERROR", "Exception while saving PI data " + e); } } /** * Process the revised PI creation for the disbursement request. - * @param disbursementRequest + * + * @param paymentInstructionFromDisbursement * @return */ private PaymentStatus processDisbursementForRevisedPICreation(PaymentInstruction paymentInstructionFromDisbursement, RequestInfo requestInfo, PaymentInstruction lastPI, PaymentInstruction originalPI, SanctionDetail sanctionDetail) { PaymentStatus paymentStatus = null; try { - CORRequest corRequest = paymentInstructionEnrichment.getCorPaymentInstructionRequestForIFMS(paymentInstructionFromDisbursement,lastPI,originalPI); + CORRequest corRequest = paymentInstructionEnrichment.getCorPaymentInstructionRequestForIFMS(paymentInstructionFromDisbursement, lastPI, originalPI); JITRequest jitRequest = JITRequest.builder() .serviceId(JITServiceId.COR) .params(corRequest) .build(); - savePiInDatabase(paymentInstructionFromDisbursement, sanctionDetail, PaymentStatus.INITIATED,requestInfo); + savePiInDatabase(paymentInstructionFromDisbursement, sanctionDetail, PaymentStatus.INITIATED, requestInfo); try { - JITResponse jitResponse = ifmsService.sendRequestToIFMS(jitRequest); + JITResponse jitResponse = ifmsService.sendRequest(originalPI.getTenantId(),jitRequest); if(jitResponse.getErrorMsg() == null && !jitResponse.getData().isEmpty()){ paymentStatus = PaymentStatus.INITIATED; try { @@ -183,10 +202,10 @@ private PaymentStatus processDisbursementForRevisedPICreation(PaymentInstruction String piSucessDescrp = node.get("sucessDescrp").asText(); paymentInstructionFromDisbursement.setPiSuccessCode(piSuccessCode); paymentInstructionFromDisbursement.setPiSuccessDesc(piSucessDescrp); - }catch (Exception e){ + } catch (Exception e) { log.info("Exception while parsing COR success response " + e); } - }else{ + } else { paymentStatus = PaymentStatus.PARTIAL; try { String piErrorDescrp = null; @@ -197,11 +216,11 @@ private PaymentStatus processDisbursementForRevisedPICreation(PaymentInstruction piErrorDescrp = jitResponse.getErrorMsgs().toString(); } paymentInstructionFromDisbursement.setPiErrorResp(piErrorDescrp); - }catch (Exception e) { + } catch (Exception e) { log.info("Exception while parsing COR Error response " + e); } } - }catch (Exception e){ + } catch (Exception e) { paymentStatus = PaymentStatus.PARTIAL; String errorMessage; Throwable cause = e.getCause(); @@ -213,24 +232,26 @@ private PaymentStatus processDisbursementForRevisedPICreation(PaymentInstruction log.error("Exception while calling request." + e); paymentInstructionFromDisbursement.setPiErrorResp(errorMessage); } - updatePIDateForRevisedPI(paymentInstructionFromDisbursement,lastPI,originalPI,paymentStatus,requestInfo); - }catch (Exception e){ + updatePIDateForRevisedPI(paymentInstructionFromDisbursement, lastPI, originalPI, paymentStatus, requestInfo); + } catch (Exception e) { log.info("Exception " + e); - throw new CustomException("ERROR_REVISED_PI","Exception while generating revised PI" + e); + throw new CustomException("ERROR_REVISED_PI", "Exception while generating revised PI" + e); } return paymentStatus; } + /** * Update PI data for revised PI. + * * @param paymentInstructionFromDisbursement * @param lastPI * @param originalPI * @param paymentStatus * @param requestInfo */ - private void updatePIDateForRevisedPI(PaymentInstruction paymentInstructionFromDisbursement, PaymentInstruction lastPI, PaymentInstruction originalPI, PaymentStatus paymentStatus,RequestInfo requestInfo) { + private void updatePIDateForRevisedPI(PaymentInstruction paymentInstructionFromDisbursement, PaymentInstruction lastPI, PaymentInstruction originalPI, PaymentStatus paymentStatus, RequestInfo requestInfo) { log.info("Updating PI data for revised PI."); - if(paymentStatus.equals(PaymentStatus.PARTIAL)){ + if (paymentStatus.equals(PaymentStatus.PARTIAL)) { paymentInstructionFromDisbursement.setPiStatus(PIStatus.FAILED); paymentInstructionFromDisbursement.setIsActive(false); @@ -241,7 +262,7 @@ private void updatePIDateForRevisedPI(PaymentInstruction paymentInstructionFromD .collect(Collectors.toMap(Beneficiary::getBeneficiaryNumber, Function.identity())); } - for(Beneficiary beneficiary: paymentInstructionFromDisbursement.getBeneficiaryDetails()) { + for (Beneficiary beneficiary : paymentInstructionFromDisbursement.getBeneficiaryDetails()) { beneficiary.setPaymentStatus(BeneficiaryPaymentStatus.FAILED); if (beneficiaryMap.containsKey(beneficiary.getBeneficiaryNumber())) { beneficiary.setPaymentStatusMessage(beneficiaryMap.get(beneficiary.getBeneficiaryNumber()).getPaymentStatusMessage()); @@ -249,7 +270,7 @@ private void updatePIDateForRevisedPI(PaymentInstruction paymentInstructionFromD } } - if(paymentStatus.equals(PaymentStatus.INITIATED)){ + if (paymentStatus.equals(PaymentStatus.INITIATED)) { paymentInstructionFromDisbursement.setIsActive(true); PaymentInstruction lastPiForUpdate = lastPI == null ? originalPI : lastPI; // Update last revised PI status to COMPLETED @@ -261,23 +282,25 @@ private void updatePIDateForRevisedPI(PaymentInstruction paymentInstructionFromD paymentInstructionService.processPIForOnDisburse(lastPiForUpdate, requestInfo, true); } } + /** * Process the disbursement request for PI creation. + * * @param disbursementRequest * @return */ - private PaymentStatus processDisbursementForPICreation(DisbursementRequest disbursementRequest, PaymentInstruction paymentInstructionFromDisbursement, RequestInfo requestInfo,List sanctionDetails) { + private PaymentStatus processDisbursementForPICreation(DisbursementRequest disbursementRequest, PaymentInstruction paymentInstructionFromDisbursement, RequestInfo requestInfo, List sanctionDetails) { PaymentStatus paymentStatus = null; - if(sanctionDetails.get(0).getFundsSummary().getAvailableAmount().compareTo(disbursementRequest.getMessage().getGrossAmount()) < 0){ + if (sanctionDetails.get(0).getFundsSummary().getAvailableAmount().compareTo(disbursementRequest.getMessage().getGrossAmount()) < 0) { log.info("Fund not available processing payment instruction for FAILED."); // Get enriched PI request to store on DB - throw new CustomException("FUND_NOT_AVAILABLE","Fund not available for the disbursement Request."); + throw new CustomException("FUND_NOT_AVAILABLE", "Fund not available for the disbursement Request."); } JITRequest jitRequest = paymentInstructionEnrichment.getJitPaymentInstructionRequestForIFMS(paymentInstructionFromDisbursement); - savePiInDatabase(paymentInstructionFromDisbursement, sanctionDetails.get(0), PaymentStatus.INITIATED,requestInfo); + savePiInDatabase(paymentInstructionFromDisbursement, sanctionDetails.get(0), PaymentStatus.INITIATED, requestInfo); try { log.info("Calling IFMS for JIT"); - JITResponse jitResponse = ifmsService.sendRequestToIFMS(jitRequest); + JITResponse jitResponse = ifmsService.sendRequest(disbursementRequest.getMessage().getLocationCode(), jitRequest); log.info("IFMS response for JIT : " + jitResponse); if (jitResponse.getErrorMsg() == null && !jitResponse.getData().isEmpty()) { paymentStatus = PaymentStatus.INITIATED; @@ -295,7 +318,7 @@ private PaymentStatus processDisbursementForPICreation(DisbursementRequest disbu else paymentInstructionFromDisbursement.setPiErrorResp(jitResponse.getErrorMsg()); } - }catch (Exception e){ + } catch (Exception e) { log.info("Exception while creating a pi, setting payment status to FAILED."); paymentStatus = PaymentStatus.FAILED; String errorMessage; @@ -312,8 +335,10 @@ private PaymentStatus processDisbursementForPICreation(DisbursementRequest disbu return paymentStatus; } + /** * Enrich the disbursement response with the status and transaction id. + * * @param disbursementRequest * @param paymentInstructionFromDisbursement * @return @@ -327,10 +352,10 @@ private DisbursementResponse enrichDisbursementResponse(DisbursementRequest disb .message(disbursementRequest.getMessage()) .build(); - if(paymentInstructionFromDisbursement.getPiStatus().equals(PIStatus.INITIATED)){ + if (paymentInstructionFromDisbursement.getPiStatus().equals(PIStatus.INITIATED)) { statusMessage = paymentInstructionFromDisbursement.getPiSuccessDesc(); } - if(paymentInstructionFromDisbursement.getPiStatus().equals(PIStatus.FAILED)){ + if (paymentInstructionFromDisbursement.getPiStatus().equals(PIStatus.FAILED)) { statusCode = StatusCode.FAILED; statusMessage = paymentInstructionFromDisbursement.getPiErrorResp(); } @@ -339,12 +364,12 @@ private DisbursementResponse enrichDisbursementResponse(DisbursementRequest disb disbursementResponse.getMessage().getStatus().setStatusMessage(statusMessage); disbursementResponse.getMessage().setTransactionId(paymentInstructionFromDisbursement.getJitBillNo()); HashMap muktaRefIdToBenefPayementStatusMap = new HashMap<>(); - for(Beneficiary beneficiary:paymentInstructionFromDisbursement.getBeneficiaryDetails()){ - for(BenfLineItems benfLineItems: beneficiary.getBenfLineItems()){ - muktaRefIdToBenefPayementStatusMap.put(benfLineItems.getLineItemId(),beneficiary); + for (Beneficiary beneficiary : paymentInstructionFromDisbursement.getBeneficiaryDetails()) { + for (BenfLineItems benfLineItems : beneficiary.getBenfLineItems()) { + muktaRefIdToBenefPayementStatusMap.put(benfLineItems.getLineItemId(), beneficiary); } } - for(Disbursement disbursement: disbursementResponse.getMessage().getDisbursements()){ + for (Disbursement disbursement : disbursementResponse.getMessage().getDisbursements()) { Beneficiary beneficiary = muktaRefIdToBenefPayementStatusMap.get(disbursement.getTargetId()); disbursement.setTransactionId(beneficiary.getBeneficiaryNumber()); disbursement.getStatus().setStatusCode(statusCode); @@ -353,4 +378,82 @@ private DisbursementResponse enrichDisbursementResponse(DisbursementRequest disb return disbursementResponse; } + + /** + * Method to convert epochDateTimeFormat to LocalDateTime + * + * @param epochTime The epoch time in milliseconds + * @return The corresponding LocalDateTime object + */ + private LocalDateTime convertEpochToLocalDateTime(long epochTime) { + Instant instant = Instant.ofEpochMilli(epochTime); + return LocalDateTime.ofInstant(instant, ZoneId.systemDefault()); + } + + /** + * Method to get the financial year of the given date + * + * @param date The date for which the financial year is needed + * @return The financial year in the format "YYYY-YYYY" + */ + private String getFinancialYear(LocalDateTime date) { + + int year = date.getYear(); + int month = date.getMonthValue(); + + // Check if the date falls in the current or next financial year + int startYear, endYear; + if (month < 4) { // Before April, so belongs to the previous financial year + startYear = year - 1; + endYear = year; + } else { + startYear = year; + endYear = year + 1; + } + + return startYear + "-" + endYear; + } + + /** + * This method validates the 90Days scenario and return true is COR PI request is valid else return false to create new PI + * + * @param disbursement The payment instruction received from the disbursement + * @param originalPI The last payment instruction + * @return The status of the payment + */ + private boolean isValidForCORPIRequest(Disbursement disbursement, PaymentInstruction originalPI) { + + LocalDateTime originalPICreatedDate = convertEpochToLocalDateTime(originalPI.getAuditDetails().getCreatedTime()); + LocalDateTime corPICreatedDate = convertEpochToLocalDateTime(disbursement.getAuditDetails().getCreatedTime()); + LocalDateTime failureDatePlus90 = originalPICreatedDate.plusDays(ifmsAdapterConfig.getOriginalExpireDays()); + + // Check if financial year of COR PI Request createdDate and OriginalPI createdDate is same + if (getFinancialYear(originalPICreatedDate).equals(getFinancialYear(corPICreatedDate))) { + + // Check if corPICreatedDate <= (originalPIFailedDate + 90 days) + if (!corPICreatedDate.isAfter(failureDatePlus90)) { + // Normal Flow + log.info("Payment Instruction is valid for Correction PI Request for same financial year."); + return true; + } else { + // Create New PI + log.info("New Payment Instruction is created due to 90 days scenario."); + return false; + } + + } else { // If financial year is not same + + // Check if (corPICreatedDate <= (originalPIFailedDate + 90 days)) and corPICreatedDate <= 30th April 23:59:59 + LocalDateTime endOfApril = LocalDateTime.of(corPICreatedDate.getYear(), ifmsAdapterConfig.getOriginalExpireFinancialYearMonth(), ifmsAdapterConfig.getOriginalExpireFinancialYearDate(), 23, 59, 59); + if (!corPICreatedDate.isAfter(endOfApril)) { + // Normal flow + log.info("Payment Instruction is valid for Correction PI Request."); + return true; + } else { + // Create new PI + log.info("New Payment Instruction is created due to 90 days or 30th April scenario"); + return false; + } + } + } } diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/service/EncryptionService.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/service/EncryptionService.java index d45a8e7dd7..86c7005973 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/service/EncryptionService.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/service/EncryptionService.java @@ -5,6 +5,8 @@ import org.egov.common.contract.request.RequestInfo; import org.egov.utils.EncryptionDecryptionUtil; import org.egov.web.models.bankaccount.*; +import org.egov.works.services.common.models.bankaccounts.BankAccount; +import org.egov.works.services.common.models.bankaccounts.BankAccountDetails; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/service/FailureDetailsService.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/service/FailureDetailsService.java index 86e31a705b..0d900b2fd5 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/service/FailureDetailsService.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/service/FailureDetailsService.java @@ -5,6 +5,7 @@ import lombok.extern.slf4j.Slf4j; import org.egov.common.contract.request.RequestInfo; import org.egov.config.Constants; +import org.egov.config.IfmsAdapterConfig; import org.egov.repository.PIRepository; import org.egov.repository.SanctionDetailsRepository; import org.egov.utils.BillUtils; @@ -41,7 +42,32 @@ public class FailureDetailsService { private PIRepository piRepository; @Autowired private PIUtils piUtils; + @Autowired + private IfmsAdapterConfig ifmsAdapterConfig; + public void updateMockFailureDetails(RequestInfo requestInfo) { + try { + if (ifmsAdapterConfig.getIfmsJitMockEnabled() && ifmsAdapterConfig.getIfmsMockEnabledTenantsIds().length != 0) { + log.info("FailureDetailsService::updateMockFailureDetails"); + JITRequest jitFDRequest = getFailedPayload(); + for (int idx = 0; idx < ifmsAdapterConfig.getIfmsMockEnabledTenantsIds().length; idx++) { + JITResponse fdResponse = ifmsService.sendRequest(ifmsAdapterConfig.getIfmsMockEnabledTenantsIds()[idx], jitFDRequest); + if (fdResponse != null && fdResponse.getErrorMsg() == null) { + for (Object failedPI: fdResponse.getData()) { + JsonNode node = objectMapper.valueToTree(failedPI); + JsonNode benef = node.get("benfDtls"); + if (benef != null && benef.isArray() && !benef.isEmpty()) { + processPiForFailedTransaction(node, requestInfo, null, JITServiceId.FD); + } + } + } + } + } + } catch (Exception e) { + log.info("Exception in FailureDetailsService:updateMockFailureDetails : " + e.getMessage()); + } + + } public void updateFailureDetails(RequestInfo requestInfo) { try { JITRequest jitFDRequest = getFailedPayload(); @@ -220,7 +246,7 @@ public void updateFTPSStatus(RequestInfo requestInfo) { JITResponse jitResponse = null; try { - jitResponse = ifmsService.sendRequestToIFMS(JITRequest.builder().serviceId(JITServiceId.FTPS).params(ftpsRequest).build()); + jitResponse = ifmsService.sendRequest(pi.getTenantId(), JITRequest.builder().serviceId(JITServiceId.FTPS).params(ftpsRequest).build()); } catch (Exception e) { log.info("Exception occurred while fetching FTPS from ifms." + e); jitRespStatusForPI = JitRespStatusForPI.STATUS_LOG_FTPS_ERROR; @@ -333,7 +359,7 @@ public void updateFTFPSStatus(RequestInfo requestInfo) { .build(); JITResponse jitResponse = null; try { - jitResponse = ifmsService.sendRequestToIFMS(JITRequest.builder() + jitResponse = ifmsService.sendRequest(pi.getTenantId(), JITRequest.builder() .serviceId(JITServiceId.FTFPS).params(ftfpsRequest).build()); } catch (Exception e) { log.info("Exception occurred while fetching FTFPS from ifms." + e); diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/service/IfmsService.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/service/IfmsService.java index 7ebfc89383..36e86181ab 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/service/IfmsService.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/service/IfmsService.java @@ -22,6 +22,8 @@ import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.client.HttpServerErrorException; @@ -66,6 +68,9 @@ public class IfmsService { @Autowired private ESLogUtils esLogUtils; + @Autowired + private MockTestService mockTestService; + public Map getKeys() throws NoSuchAlgorithmException { Map keyMap = new HashMap<>(); String encryptedAppKey = authenticationUtils.genEncryptedAppKey(); @@ -78,6 +83,15 @@ public Map getKeys() throws NoSuchAlgorithmException { return keyMap; } + public JITResponse sendRequest(String tenantId, JITRequest jitRequest) { + if (config.getIfmsJitMockEnabled() && config.getIfmsMockEnabledTenantsIds().length != 0 + && !StringUtils.isEmpty(tenantId) && Arrays.asList(config.getIfmsMockEnabledTenantsIds()).contains(tenantId)) { + return mockTestService.getMockResponse(tenantId, jitRequest); + } else { + return sendRequestToIFMS(jitRequest); + } + } + public JITResponse sendRequestToIFMS(JITRequest jitRequest) { // Check if the auth token is null or the session has expired if (jitAuthValues.getAuthToken() == null || (System.currentTimeMillis() - jitAuthValues.getLastLogin()) >= config.getIfmsSessionTimeout()){ diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/service/MockTestService.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/service/MockTestService.java new file mode 100644 index 0000000000..9c58006f3a --- /dev/null +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/service/MockTestService.java @@ -0,0 +1,258 @@ +package org.egov.service; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ObjectNode; +import lombok.extern.slf4j.Slf4j; +import org.egov.config.IfmsAdapterConfig; +import org.egov.tracer.model.CustomException; +import org.egov.utils.MdmsUtils; +import org.egov.web.models.enums.JITServiceId; +import org.egov.web.models.jit.JITRequest; +import org.egov.web.models.jit.JITResponse; +import org.egov.web.models.mdmsV2.MdmsResponseV2; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.lang.reflect.Field; +import java.util.*; + +@Service +@Slf4j +public class MockTestService { + + @Autowired + ObjectMapper objectMapper; + @Autowired + private IfmsAdapterConfig config; + @Autowired + private MdmsUtils mdmsUtils; + + + public JITResponse getMockResponse(String tenantId, JITRequest jitRequest) { + try { + JITResponse jitResponse = null; + jitResponse = processRequestForMDMSV2(tenantId, jitRequest); + return jitResponse; + } catch(Exception e){ + log.error("Error while generating JIT Response", e); + throw new RuntimeException(e); + } + } + + private JITResponse processRequestForMDMSV2(String tenantId, JITRequest jitRequest) { + if (jitRequest != null && jitRequest.getParams() != null) { + ObjectNode mdmsV2SearchRequest = objectMapper.createObjectNode(); + mdmsV2SearchRequest.put("MdmsCriteria", prepareMDMSV2SearchRequest(tenantId, jitRequest)); + MdmsResponseV2 mdmsResponseV2 = mdmsUtils.fetchFromMDMSV2V2(mdmsV2SearchRequest); + JITResponse jitResponse = new JITResponse(); + jitResponse = processMDMSToJITResponse(mdmsResponseV2, jitRequest); + return jitResponse; + } else { + throw new RuntimeException("Invalid Request"); + } + } + + private JITResponse processMDMSToJITResponse(MdmsResponseV2 mdmsResponseV2, JITRequest jitRequest) { + if (mdmsResponseV2 != null && mdmsResponseV2.getMdms() != null && mdmsResponseV2.getMdms().size() > 0) { + JITResponse jitResponse = new JITResponse(); + if (jitRequest.getServiceId().equals(JITServiceId.FD)) { + List fdDetails = new ArrayList<>(); + for (int i = 0; i < mdmsResponseV2.getMdms().size(); i++) { + JITResponse jitFDResponse = new JITResponse(); + JsonNode mdmsMockData = mdmsResponseV2.getMdms().get(i).getData(); + jitFDResponse = objectMapper.convertValue(mdmsMockData, JITResponse.class); + fdDetails.addAll(jitFDResponse.getData()); + } + jitResponse = JITResponse.builder().serviceId(jitRequest.getServiceId()).data(fdDetails).build(); + } else { + JsonNode mdmsMockData = mdmsResponseV2.getMdms().get(0).getData(); + jitResponse = objectMapper.convertValue(mdmsMockData, JITResponse.class); + } + return jitResponse; + } + return JITResponse.builder().serviceId(jitRequest.getServiceId()).data(new ArrayList<>()).build(); + } + + private ObjectNode prepareMDMSV2SearchRequest(String tenantId, JITRequest jitRequest) { + + // Create root node + ObjectNode mdmsCriteriaNode = objectMapper.createObjectNode(); + mdmsCriteriaNode.put("tenantId", tenantId); + mdmsCriteriaNode.put("schemaCode", config.getIfmsJitMockMdmsMasterName()); + mdmsCriteriaNode.put("limit", 10000); + mdmsCriteriaNode.put("offset", 0); + + Map jitRequestMap = new HashMap<>(); + if (jitRequest.getParams() instanceof Map) { + jitRequestMap = (Map) jitRequest.getParams(); + } else if (jitRequest.getParams() instanceof Object) { + jitRequestMap = convertObjectToMap(jitRequest.getParams()); + } else { + throw new RuntimeException("Invalid Request"); + } + // Switch case is used to direct request to the respective services. + switch (jitRequest.getServiceId()) { + case VA: + applyVAFilter(jitRequestMap, mdmsCriteriaNode); + break; + case PI: + applyPIFilter(jitRequestMap, mdmsCriteriaNode); + break; + case PIS: + applyPISFilter(jitRequestMap, mdmsCriteriaNode); + break; + case PAG: + applyPAGFilter(jitRequestMap, mdmsCriteriaNode); + break; + case PD: + applyPDFilter(jitRequestMap, mdmsCriteriaNode); + break; + case FD: + applyFDFilter(jitRequestMap, mdmsCriteriaNode); + break; + case COR: + applyCORFilter(jitRequestMap, mdmsCriteriaNode); + break; + case FTPS: + applyFTPSFilter(jitRequestMap, mdmsCriteriaNode); + break; + case FTFPS: + applyFTFPSFilter(jitRequestMap, mdmsCriteriaNode); + break; + default: + throw new CustomException("INVALID_SERVICE_ID", "Invalid Service Id."); + } + + return mdmsCriteriaNode; + } + + public static Map convertObjectToMap(Object obj) { + Map map = new HashMap<>(); + + // Get all fields of the class, including private ones + Field[] fields = obj.getClass().getDeclaredFields(); + + for (Field field : fields) { + field.setAccessible(true); // to access private fields + try { + // Put field name and value in the map + map.put(field.getName(), field.get(obj)); + } catch (IllegalAccessException e) { + throw new RuntimeException("Failed to access field: " + field.getName(), e); + } + } + + return map; + } + + private void applyVAFilter(Map jitRequestMap, ObjectNode mdmsCriteriaNode) { + if (jitRequestMap != null && jitRequestMap instanceof Map) { + String hoaCode = null; + String ddoCode = null; + if (jitRequestMap.containsKey("hoa") && jitRequestMap.get("hoa") instanceof String) { + hoaCode = jitRequestMap.get("hoa").toString().trim(); + } else { + throw new CustomException("INVALID_HOA_CODE", "Invalid HOA Code."); + } + if (jitRequestMap.containsKey("ddoCode") && jitRequestMap.get("ddoCode") instanceof String) { + ddoCode = jitRequestMap.get("ddoCode").toString().trim(); + } else { + throw new CustomException("INVALID_DDO_CODE", "Invalid DDO Code."); + } + mdmsCriteriaNode.set("uniqueIdentifiers", objectMapper.valueToTree(Collections.singletonList(String.join(".", JITServiceId.VA.toString(), hoaCode, ddoCode)))); + } else { + log.info("The object is not a Map."); + } + } + + + private void applyPIFilter(Map jitRequestMap, ObjectNode mdmsCriteriaNode) { + mdmsCriteriaNode.put("uniqueIdentifiers", objectMapper.valueToTree(Collections.singletonList(String.join(".", JITServiceId.PI.toString(), JITServiceId.PI.toString())))); + } + + private void applyPISFilter(Map jitRequestMap, ObjectNode mdmsCriteriaNode) { + if (jitRequestMap != null && jitRequestMap instanceof Map) { + String jitBillNo = null; + if (jitRequestMap.containsKey("jitBillNo") && jitRequestMap.get("jitBillNo") instanceof String) { + jitBillNo = jitRequestMap.get("jitBillNo").toString().trim(); + } else { + throw new CustomException("INVALID_JIT_BILL_NO", "Invalid JIT Bill No."); + } + mdmsCriteriaNode.put("uniqueIdentifiers", objectMapper.valueToTree(Collections.singletonList(String.join(".", JITServiceId.PIS.toString(), jitBillNo)))); + } else { + log.info("The object is not a Map."); + } + + } + private void applyPAGFilter(Map jitRequestMap, ObjectNode mdmsCriteriaNode) { + if (jitRequestMap != null && jitRequestMap instanceof Map) { + String jitBillNo = null; + if (jitRequestMap.containsKey("billNo") && jitRequestMap.get("billNo") instanceof String) { + jitBillNo = jitRequestMap.get("billNo").toString().trim(); + } else { + throw new CustomException("INVALID_JIT_BILL_NO", "Invalid Bill No."); + } + mdmsCriteriaNode.put("uniqueIdentifiers", objectMapper.valueToTree(Collections.singletonList(String.join(".", JITServiceId.PAG.toString(), jitBillNo)))); + } else { + log.info("The object is not a Map."); + } + } + private void applyPDFilter(Map jitRequestMap, ObjectNode mdmsCriteriaNode) { + if (jitRequestMap != null && jitRequestMap instanceof Map) { + String billRefNo = null; + if (jitRequestMap.containsKey("billRefNo") && jitRequestMap.get("billRefNo") instanceof String) { + billRefNo = jitRequestMap.get("billRefNo").toString().trim(); + } else { + throw new CustomException("INVALID_JIT_BILL_NO", "Invalid Bill Ref No."); + } + mdmsCriteriaNode.put("uniqueIdentifiers", objectMapper.valueToTree(Collections.singletonList(String.join(".", JITServiceId.PD.toString(), billRefNo)))); + } else { + log.info("The object is not a Map."); + } + + } + private void applyFDFilter(Map jitRequestMap, ObjectNode mdmsCriteriaNode) { + ObjectNode filter = objectMapper.createObjectNode(); + if (jitRequestMap != null && jitRequestMap instanceof Map) { + filter.put("serviceId", JITServiceId.FD.toString()); + mdmsCriteriaNode.put("filters", filter); + } else { + log.info("The object is not a Map."); + } + + } + private void applyCORFilter(Map jitRequestMap, ObjectNode mdmsCriteriaNode) { + mdmsCriteriaNode.put("uniqueIdentifiers", objectMapper.valueToTree(Collections.singletonList(String.join(".", JITServiceId.COR.toString(), JITServiceId.COR.toString())))); + + } + private void applyFTPSFilter(Map jitRequestMap, ObjectNode mdmsCriteriaNode) { + ObjectNode filter = objectMapper.createObjectNode();; + if (jitRequestMap != null && jitRequestMap instanceof Map) { + String jitCorBillNo = null; + if (jitRequestMap.containsKey("jitCorBillNo") && jitRequestMap.get("jitCorBillNo") instanceof String) { + jitCorBillNo = jitRequestMap.get("jitCorBillNo").toString().trim(); + } else { + throw new CustomException("INVALID_JIT_BILL_NO", "Invalid Bill Ref No."); + } + mdmsCriteriaNode.put("uniqueIdentifiers", objectMapper.valueToTree(Collections.singletonList(String.join(".", JITServiceId.FTPS.toString(), jitCorBillNo)))); + } else { + log.info("The object is not a Map."); + } + } + private void applyFTFPSFilter(Map jitRequestMap, ObjectNode mdmsCriteriaNode) { + ObjectNode filter = objectMapper.createObjectNode();; + if (jitRequestMap != null && jitRequestMap instanceof Map) { + String jitCorBillNo = null; + if (jitRequestMap.containsKey("jitCorBillNo") && jitRequestMap.get("jitCorBillNo") instanceof String) { + jitCorBillNo = jitRequestMap.get("jitCorBillNo").toString().trim(); + } else { + throw new CustomException("INVALID_JIT_BILL_NO", "Invalid Bill Ref No."); + } + mdmsCriteriaNode.put("uniqueIdentifiers", objectMapper.valueToTree(Collections.singletonList(String.join(".", JITServiceId.FTFPS.toString(), jitCorBillNo)))); + } else { + log.info("The object is not a Map."); + } + } + +} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/service/PAGService.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/service/PAGService.java index 43ab354408..99d6ce7f02 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/service/PAGService.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/service/PAGService.java @@ -76,7 +76,7 @@ public void updatePAG( RequestInfo requestInfo ){ log.info("Calling ifms service."); JITResponse jitResponse = null; try { - jitResponse = ifmsService.sendRequestToIFMS(jitRequest); + jitResponse = ifmsService.sendRequest(paymentInstruction.getTenantId(), jitRequest); }catch (Exception e){ log.info("Exception occurred while fetching PAG from ifms." + e); jitRespStatusForPI = JitRespStatusForPI.STATUS_LOG_PAG_ERROR; diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/service/PDService.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/service/PDService.java index 0fe3d9a4c9..c8bd86726d 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/service/PDService.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/service/PDService.java @@ -9,8 +9,6 @@ import org.egov.repository.PIRepository; import org.egov.utils.BillUtils; import org.egov.utils.PIUtils; -import org.egov.web.models.bill.Payment; -import org.egov.web.models.bill.PaymentRequest; import org.egov.web.models.enums.*; import org.egov.web.models.jit.*; import org.springframework.beans.factory.annotation.Autowired; @@ -67,7 +65,7 @@ public void updatePDStatus(RequestInfo requestInfo) { JITResponse jitResponse = null; log.info("Calling ifms service."); try { - jitResponse = ifmsService.sendRequestToIFMS(JITRequest.builder() + jitResponse = ifmsService.sendRequest(paymentInstruction.getTenantId(), JITRequest.builder() .serviceId(JITServiceId.PD).params(pdRequest).build()); }catch (Exception e){ log.info("Exception occurred while fetching PD from ifms." + e); @@ -155,4 +153,4 @@ public void updatePDStatus(RequestInfo requestInfo) { } -} \ No newline at end of file +} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/service/PISService.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/service/PISService.java index 98702be408..f86b6f3a77 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/service/PISService.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/service/PISService.java @@ -1,17 +1,14 @@ package org.egov.service; import com.fasterxml.jackson.databind.ObjectMapper; -import digit.models.coremodels.AuditDetails; import lombok.extern.slf4j.Slf4j; import net.minidev.json.JSONArray; +import org.egov.common.contract.models.AuditDetails; import org.egov.common.contract.request.RequestInfo; import org.egov.repository.PIRepository; import org.egov.repository.SanctionDetailsRepository; -import org.egov.utils.BillUtils; import org.egov.utils.HelperUtil; import org.egov.utils.PIUtils; -import org.egov.web.models.bill.Payment; -import org.egov.web.models.bill.PaymentRequest; import org.egov.web.models.enums.*; import org.egov.web.models.jit.*; import org.springframework.beans.factory.annotation.Autowired; @@ -70,7 +67,7 @@ public void updatePIStatus(RequestInfo requestInfo){ JITResponse pisResponse = null; log.info("Calling ifms service."); try { - pisResponse = ifmsService.sendRequestToIFMS(jitRequest); + pisResponse = ifmsService.sendRequest(paymentInstruction.getTenantId(), jitRequest); }catch (Exception e){ log.info("Exception occurred while fetching PIS from ifms." + e); jitRespStatusForPI = JitRespStatusForPI.STATUS_LOG_PIS_ERROR; diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/service/PaymentInstructionService.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/service/PaymentInstructionService.java index 78a722bf9d..9bf37c51c6 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/service/PaymentInstructionService.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/service/PaymentInstructionService.java @@ -2,8 +2,8 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import digit.models.coremodels.AuditDetails; import lombok.extern.slf4j.Slf4j; +import org.egov.common.contract.models.AuditDetails; import org.egov.common.contract.request.RequestInfo; import org.egov.common.models.individual.Individual; import org.egov.config.Constants; @@ -13,26 +13,29 @@ import org.egov.repository.PIStatusLogsRepository; import org.egov.tracer.model.CustomException; import org.egov.utils.*; -import org.egov.web.models.*; -import org.egov.web.models.bankaccount.BankAccount; -import org.egov.web.models.bill.*; +import org.egov.web.models.Disbursement; +import org.egov.web.models.DisbursementRequest; +import org.egov.web.models.MsgCallbackHeader; +import org.egov.web.models.PaginationForDisburse; +import org.egov.web.models.bill.PaymentRequest; import org.egov.web.models.disburse.DisburseSearch; import org.egov.web.models.disburse.DisburseSearchRequest; import org.egov.web.models.disburse.DisburseSearchResponse; import org.egov.web.models.enums.*; -import org.egov.web.models.enums.Status; import org.egov.web.models.jit.*; import org.egov.web.models.jit.PISearchCriteria; -import org.egov.web.models.organisation.Organisation; +import org.egov.works.services.common.models.bankaccounts.BankAccount; +import org.egov.works.services.common.models.expense.*; +import org.egov.works.services.common.models.expense.enums.PaymentStatus; +import org.egov.works.services.common.models.expense.enums.ReferenceStatus; +import org.egov.works.services.common.models.expense.enums.Status; +import org.egov.works.services.common.models.organization.Organisation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; import org.springframework.web.client.HttpServerErrorException; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; import java.math.BigDecimal; import java.util.*; import java.util.function.Function; @@ -156,7 +159,7 @@ public PaymentInstruction processPaymentRequestForNewPI(PaymentRequest paymentRe JITRequest jitPiRequest = piEnrichment.getJitPaymentInstructionRequestForIFMS(piRequest); try { log.info("Payment instruction data is populated, creating jit request based on PI."); - JITResponse jitResponse = ifmsService.sendRequestToIFMS(jitPiRequest); + JITResponse jitResponse = ifmsService.sendRequest(paymentRequest.getTenantId(), jitPiRequest); log.info("Jit response for create PI : " + jitResponse); if (jitResponse.getErrorMsg() == null && !jitResponse.getData().isEmpty()) { paymentStatus = PaymentStatus.INITIATED; @@ -274,7 +277,7 @@ public PaymentInstruction processPaymentRequestForRevisedPI(PaymentRequest payme // GET failure pi JIT request data from PI JITRequest jitPiRequest = piEnrichment.getCorRequest(paymentRequest, paymentInstruction, originalPi, lastRevisedPi); try { - JITResponse jitResponse = ifmsService.sendRequestToIFMS(jitPiRequest); + JITResponse jitResponse = ifmsService.sendRequest(paymentRequest.getTenantId(), jitPiRequest); if (jitResponse.getErrorMsg() == null && !jitResponse.getData().isEmpty()) { paymentStatus = PaymentStatus.INITIATED; jitApiRespStatus = JitRespStatusForPI.STATUS_LOG_COR_SUCCESS; @@ -647,7 +650,25 @@ public void processPIForOnDisburse(PaymentInstruction paymentInstruction, Reques .build(); DisburseSearchResponse disbursementResponse = programServiceUtil.searchDisbursements(disburseSearchRequest); List disbursements = disbursementResponse.getDisbursements(); + if(disbursements == null || disbursements.isEmpty()){ + throw new CustomException("DISBURSEMENT_NOT_FOUND","Disbursement not found for PI"); + } Disbursement disbursement = disbursements.get(0); +// if(isRevised){ +// for(Disbursement disbursement1: disbursements){ +// if(disbursement1.getStatus().getStatusCode().equals(StatusCode.PARTIAL)){ +// disbursement = disbursement1; +// break; +// } +// } +// if(disbursement == null){ +// throw new CustomException("DISBURSEMENT_NOT_FOUND","Disbursement not found for revised PI"); +// } +// }else{ +// if (disbursements != null && !disbursements.isEmpty()) { +// disbursement = disbursements.get(0); +// } +// } piEnrichment.setStatusOfDisbursementForPI(paymentInstruction, disbursement); piEnrichment.setAddtionaInfoForDisbursement(paymentInstruction, disbursement); msgCallbackHeader.setAction(Action.UPDATE); @@ -663,4 +684,4 @@ public void processPIForOnDisburse(PaymentInstruction paymentInstruction, Reques } log.info("Processing PI For Creating Disbursement Request Completed"); } -} \ No newline at end of file +} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/service/PaymentService.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/service/PaymentService.java index d5aafdb6b1..e106f7ddae 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/service/PaymentService.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/service/PaymentService.java @@ -6,16 +6,16 @@ import org.egov.common.contract.request.RequestInfo; import org.egov.config.IfmsAdapterConfig; import org.egov.utils.BillUtils; -import org.egov.web.models.Pagination; import org.egov.web.models.bill.*; -import org.egov.web.models.enums.Status; +import org.egov.web.models.bill.PaymentRequest; +import org.egov.works.services.common.models.expense.*; +import org.egov.works.services.common.models.expense.enums.Status; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.client.RestTemplate; import javax.validation.Valid; -import java.math.BigDecimal; import java.util.*; import static org.egov.config.Constants.APPROVED_STATUS; @@ -86,7 +86,7 @@ private List fetchBills(RequestInfo requestInfo) { BillSearchRequest billSearchRequest = BillSearchRequest.builder() .requestInfo(requestInfo) .billCriteria(billCriteria) - .pagination(Pagination.builder().limit(limit).offSet(offset).build()) + .pagination(Pagination.builder().offSet(offset).limit(limit).build()) .build(); log.info(billSearchRequest.toString()); currentBills = billUtils.fetchBillsData(billSearchRequest); diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/service/VirtualAllotmentService.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/service/VirtualAllotmentService.java index 90bd1f07c5..ea26f31f40 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/service/VirtualAllotmentService.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/service/VirtualAllotmentService.java @@ -126,7 +126,7 @@ private void processVAForHOA(String tenantId, JsonNode hoaNode, JsonNode ssuNode log.info("Calling ifms service."); JITRequest vaRequest = vaEnrichment.constructVARequest(hoaNode, ssuNode, lastExecuted); - JITResponse vaResponse = ifmsService.sendRequestToIFMS(vaRequest); + JITResponse vaResponse = ifmsService.sendRequest(tenantId, vaRequest); if (vaResponse.getErrorMsg() == null) { List vaResponseList = vaResponse.getData(); diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/AuditLogUtils.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/AuditLogUtils.java index 6bffb9ccbc..f99d08eced 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/AuditLogUtils.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/AuditLogUtils.java @@ -21,9 +21,9 @@ import org.egov.repository.ServiceRequestRepository; import org.egov.service.EncryptionService; import org.egov.web.models.bankaccount.AuditLogsResponse; -import org.egov.web.models.bankaccount.BankAccount; -import org.egov.web.models.bankaccount.BankAccountDetails; import org.egov.web.models.bill.PaymentRequest; +import org.egov.works.services.common.models.bankaccounts.BankAccount; +import org.egov.works.services.common.models.bankaccounts.BankAccountDetails; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/AuthenticationUtils.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/AuthenticationUtils.java index a7cc172189..acd358a733 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/AuthenticationUtils.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/AuthenticationUtils.java @@ -9,10 +9,10 @@ import java.security.spec.X509EncodedKeySpec; import java.util.Base64; -import javax.annotation.PostConstruct; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; +import jakarta.annotation.PostConstruct; import org.egov.config.IfmsAdapterConfig; import org.egov.enc.AsymmetricEncryptionService; import org.egov.enc.SymmetricEncryptionService; diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/BankAccountUtils.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/BankAccountUtils.java index 457b90ddcc..f0611c0c9b 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/BankAccountUtils.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/BankAccountUtils.java @@ -5,11 +5,7 @@ import org.egov.common.contract.request.RequestInfo; import org.egov.config.IfmsAdapterConfig; import org.egov.repository.ServiceRequestRepository; -import org.egov.web.models.*; -import org.egov.web.models.bankaccount.BankAccount; -import org.egov.web.models.bankaccount.BankAccountResponse; -import org.egov.web.models.bankaccount.BankAccountSearchCriteria; -import org.egov.web.models.bankaccount.BankAccountSearchRequest; +import org.egov.works.services.common.models.bankaccounts.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; @@ -47,9 +43,9 @@ public class BankAccountUtils { } Pagination pagination = Pagination.builder() - .limit(bankAccountSearchCriteria.getReferenceId().size()) - .offSet(0) - .order(Pagination.OrderEnum.ASC) + .limit((double) bankAccountSearchCriteria.getReferenceId().size()) + .offSet((double) 0) + .order(Order.ASC) .build(); BankAccountSearchRequest bankAccountSearchRequest = BankAccountSearchRequest.builder() diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/BillUtils.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/BillUtils.java index f54da3ab7f..1a0b9feb73 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/BillUtils.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/BillUtils.java @@ -7,9 +7,10 @@ import org.egov.config.IfmsAdapterConfig; import org.egov.repository.ServiceRequestRepository; import org.egov.web.models.Pagination; -import org.egov.web.models.bill.*; -import org.egov.web.models.enums.PaymentStatus; -import org.egov.web.models.enums.ReferenceStatus; +import org.egov.web.models.bill.PaymentRequest; +import org.egov.works.services.common.models.expense.*; +import org.egov.works.services.common.models.expense.enums.PaymentStatus; +import org.egov.works.services.common.models.expense.enums.ReferenceStatus; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/ESLogUtils.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/ESLogUtils.java index dfd4fb1c77..6f65e9c57a 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/ESLogUtils.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/ESLogUtils.java @@ -9,18 +9,14 @@ import org.egov.enc.SymmetricEncryptionService; import org.egov.kafka.IfmsAdapterProducer; import org.egov.web.models.ErrorRes; -import org.egov.web.models.bankaccount.BankAccountResponse; -import org.egov.web.models.enums.JITServiceId; import org.egov.web.models.jit.JITErrorRequestLog; import org.egov.web.models.jit.JITRequest; import org.egov.web.models.jit.JITRequestLog; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import org.springframework.web.client.HttpClientErrorException; -import org.springframework.web.client.HttpServerErrorException; -import org.springframework.web.client.RestTemplate; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; +import org.springframework.stereotype.Component; +import org.springframework.web.client.RestTemplate; import javax.validation.Valid; import java.util.Collections; diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/IdgenUtil.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/IdgenUtil.java index c9205a65fa..d44abe9a49 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/IdgenUtil.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/IdgenUtil.java @@ -1,10 +1,10 @@ package org.egov.utils; import com.fasterxml.jackson.databind.ObjectMapper; -import digit.models.coremodels.IdGenerationRequest; -import digit.models.coremodels.IdGenerationResponse; -import digit.models.coremodels.IdRequest; -import digit.models.coremodels.IdResponse; +import org.egov.common.contract.idgen.IdGenerationRequest; +import org.egov.common.contract.idgen.IdGenerationResponse; +import org.egov.common.contract.idgen.IdRequest; +import org.egov.common.contract.idgen.IdResponse; import org.egov.common.contract.request.RequestInfo; import org.egov.config.IfmsAdapterConfig; import org.egov.repository.ServiceRequestRepository; @@ -46,4 +46,4 @@ public List getIdList(RequestInfo requestInfo, String tenantId, String i return idResponses.stream().map(IdResponse::getId).collect(Collectors.toList()); } -} \ No newline at end of file +} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/IndividualUtils.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/IndividualUtils.java index be26a7fb1c..9344f51d26 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/IndividualUtils.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/IndividualUtils.java @@ -5,10 +5,10 @@ import org.egov.common.contract.request.RequestInfo; import org.egov.common.models.individual.Individual; import org.egov.common.models.individual.IndividualBulkResponse; +import org.egov.common.models.individual.IndividualSearch; +import org.egov.common.models.individual.IndividualSearchRequest; import org.egov.config.IfmsAdapterConfig; import org.egov.repository.ServiceRequestRepository; -import org.egov.web.models.individual.IndividualSearch; -import org.egov.web.models.individual.IndividualSearchRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/MdmsUtils.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/MdmsUtils.java index b6a8880068..98090365d1 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/MdmsUtils.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/MdmsUtils.java @@ -7,6 +7,7 @@ import org.egov.config.IfmsAdapterConfig; import org.egov.mdms.model.*; import org.egov.repository.ServiceRequestRepository; +import org.egov.web.models.mdmsV2.MdmsResponseV2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; @@ -32,7 +33,7 @@ public class MdmsUtils { public Map> fetchExchangeServers(RequestInfo requestInfo, String tenantId) { StringBuilder uri = new StringBuilder(); - uri.append(config.getMdmsHost()).append(config.getMdmsEndPoint()); + uri.append(config.getMdmsV2Host()).append(config.getMdmsV2V1EndPoint()); MdmsCriteriaReq mdmsCriteriaReq = prepareMdMsRequest(requestInfo, tenantId, MDMS_EXCHANGE_MODULE_NAME, Arrays.asList(MDMS_EXCHANGE_SERVER_MASTER)); Object response = new HashMap<>(); MdmsResponse mdmsResponse = new MdmsResponse(); @@ -48,7 +49,7 @@ public Map> fetchExchangeServers(RequestInfo reques } public Map> fetchHoaAndSSUDetails(RequestInfo requestInfo, String tenantId) { StringBuilder uri = new StringBuilder(); - uri.append(config.getMdmsHost()).append(config.getMdmsEndPoint()); + uri.append(config.getMdmsV2Host()).append(config.getMdmsV2V1EndPoint()); MdmsCriteriaReq mdmsCriteriaReq = prepareMdMsRequest(requestInfo, tenantId, MDMS_IFMS_MODULE_NAME, Arrays.asList(MDMS_HEAD_OF_ACCOUNT_MASTER, MDMS_SSU_DETAILS_MASTER)); Object response = new HashMap<>(); MdmsResponse mdmsResponse = new MdmsResponse(); @@ -66,7 +67,7 @@ public Map> fetchHoaAndSSUDetails(RequestInfo requ public Map> fetchMdmsData(RequestInfo requestInfo, String tenantId, String moduleName, List masterNameList) { StringBuilder uri = new StringBuilder(); - uri.append(config.getMdmsHost()).append(config.getMdmsEndPoint()); + uri.append(config.getMdmsV2Host()).append(config.getMdmsV2V1EndPoint()); MdmsCriteriaReq mdmsCriteriaReq = prepareMdMsRequest(requestInfo, tenantId, moduleName, masterNameList); Object response = new HashMap<>(); MdmsResponse mdmsResponse = new MdmsResponse(); @@ -127,7 +128,7 @@ public MdmsCriteriaReq prepareMdMsRequest(RequestInfo requestInfo, String tenant public Map> fetchMdmsDataWithActiveFilter(RequestInfo requestInfo, String tenantId, String moduleName, List masterNameList) { StringBuilder uri = new StringBuilder(); - uri.append(config.getMdmsHost()).append(config.getMdmsEndPoint()); + uri.append(config.getMdmsV2Host()).append(config.getMdmsV2V1EndPoint()); MdmsCriteriaReq mdmsCriteriaReq = prepareMdMsRequestWithActiveFilter(requestInfo, tenantId, moduleName, masterNameList); Object response = new HashMap<>(); MdmsResponse mdmsResponse = new MdmsResponse(); @@ -169,4 +170,22 @@ public MdmsCriteriaReq prepareMdMsRequestWithActiveFilter(RequestInfo requestInf .build(); } + /** + * Fetch data from mdms-v2 + * @param searchRequest + * @return + */ + public MdmsResponseV2 fetchFromMDMSV2V2(Object searchRequest) { + StringBuilder uri = new StringBuilder(); + uri.append(config.getMdmsV2Host()).append(config.getMdmsV2V2EndPoint()); + Object response = new HashMap<>(); + MdmsResponseV2 mdmsResponse = new MdmsResponseV2(); + try { + response = restTemplate.postForObject(uri.toString(), searchRequest, Map.class); + mdmsResponse = mapper.convertValue(response, MdmsResponseV2.class); + } catch (Exception e) { + log.error("Exception occurred while fetching category lists from mdms: ", e); + } + return mdmsResponse; + } } diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/OrganisationUtils.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/OrganisationUtils.java index 27b11ea7f0..86f9b66f6e 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/OrganisationUtils.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/OrganisationUtils.java @@ -5,15 +5,8 @@ import org.egov.common.contract.request.RequestInfo; import org.egov.config.IfmsAdapterConfig; import org.egov.repository.ServiceRequestRepository; -import org.egov.web.models.*; -import org.egov.web.models.bankaccount.BankAccount; -import org.egov.web.models.bankaccount.BankAccountResponse; -import org.egov.web.models.bankaccount.BankAccountSearchCriteria; -import org.egov.web.models.bankaccount.BankAccountSearchRequest; -import org.egov.web.models.organisation.OrgResponse; -import org.egov.web.models.organisation.OrgSearchCriteria; -import org.egov.web.models.organisation.OrgSearchRequest; -import org.egov.web.models.organisation.Organisation; +import org.egov.web.models.enums.Order; +import org.egov.works.services.common.models.organization.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; @@ -51,9 +44,9 @@ public class OrganisationUtils { } Pagination pagination = Pagination.builder() - .limit(orgSearchCriteria.getId().size()) - .offSet(0) - .order(Pagination.OrderEnum.ASC) + .limit((double) orgSearchCriteria.getId().size()) + .offset((double) 0) + .order(Order.ASC) .build(); OrgSearchRequest orgSearchRequest = OrgSearchRequest.builder() @@ -69,10 +62,10 @@ public class OrganisationUtils { StringBuilder uri = new StringBuilder(); uri.append(config.getOrganisationHost()).append(config.getOrganisationSearchEndPoint()); Object response = new HashMap<>(); - OrgResponse orgResponse = new OrgResponse(); + OrgServiceResponse orgResponse = new OrgServiceResponse(); try { response = restTemplate.postForObject(uri.toString(), bankAccountRequest, Map.class); - orgResponse = mapper.convertValue(response, OrgResponse.class); + orgResponse = mapper.convertValue(response, OrgServiceResponse.class); log.info("Organisation details fetched."); } catch (Exception e) { log.error("Exception occurred while fetching organisation getOrganisationsById:getOrganisations: ", e); diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/PIUtils.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/PIUtils.java index edec544fe1..613fa5f800 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/PIUtils.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/utils/PIUtils.java @@ -5,7 +5,6 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import lombok.extern.slf4j.Slf4j; import org.egov.common.contract.request.RequestInfo; -import org.egov.common.producer.Producer; import org.egov.config.IfmsAdapterConfig; import org.egov.kafka.IfmsAdapterProducer; import org.egov.web.models.ErrorRes; @@ -24,7 +23,7 @@ @Slf4j public class PIUtils { @Autowired - Producer producer; + IfmsAdapterProducer producer; @Autowired IfmsAdapterConfig adapterConfig; @Autowired diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/validators/DisbursementValidator.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/validators/DisbursementValidator.java index 801ad964de..82e043bb0b 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/validators/DisbursementValidator.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/validators/DisbursementValidator.java @@ -2,19 +2,14 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.gson.JsonObject; import lombok.extern.slf4j.Slf4j; import net.minidev.json.JSONArray; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.request.User; -import org.egov.service.IfmsService; import org.egov.tracer.model.CustomException; import org.egov.web.models.Disbursement; import org.egov.web.models.DisbursementRequest; import org.egov.web.models.Individual; import org.egov.web.models.MsgCallbackHeader; import org.egov.web.models.enums.PIStatus; -import org.egov.web.models.enums.PaymentStatus; import org.egov.web.models.jit.PaymentInstruction; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/validators/PaymentInstructionValidator.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/validators/PaymentInstructionValidator.java index 5930422cca..ccfba66521 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/validators/PaymentInstructionValidator.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/validators/PaymentInstructionValidator.java @@ -8,11 +8,11 @@ import org.egov.service.PaymentInstructionService; import org.egov.tracer.model.CustomException; import org.egov.utils.BillUtils; -import org.egov.web.models.bill.Bill; import org.egov.web.models.bill.PaymentRequest; -import org.egov.web.models.enums.PaymentStatus; -import org.egov.web.models.enums.ReferenceStatus; import org.egov.web.models.jit.Beneficiary; +import org.egov.works.services.common.models.expense.Bill; +import org.egov.works.services.common.models.expense.enums.PaymentStatus; +import org.egov.works.services.common.models.expense.enums.ReferenceStatus; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/controller/Scheduler.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/controller/Scheduler.java index b2567254c2..5884291f27 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/controller/Scheduler.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/controller/Scheduler.java @@ -60,6 +60,8 @@ public ResponseInfo scheduler(@RequestBody @Valid SchedulerRequest schedulerRequ pdService.updatePDStatus(schedulerRequest.getRequestInfo()); break; case FD: + // Call mock FD service data sync API first + failureDetailsService.updateMockFailureDetails(schedulerRequest.getRequestInfo()); failureDetailsService.updateFailureDetails(schedulerRequest.getRequestInfo()); break; case FTPS: diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/controller/TestController.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/controller/TestController.java deleted file mode 100644 index 42ab3be04f..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/controller/TestController.java +++ /dev/null @@ -1,92 +0,0 @@ -package org.egov.web.controller; - -import com.fasterxml.jackson.databind.ObjectMapper; -import org.egov.service.PaymentInstructionService; -import org.egov.service.VirtualAllotmentService; -import org.egov.web.models.jit.PaymentInstruction; -import org.egov.web.models.jit.SchedulerRequest; -import org.egov.web.models.bill.PaymentRequest; -import org.egov.service.IfmsService; -import org.egov.utils.AuthenticationUtils; -import org.egov.utils.JitRequestUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.io.ResourceLoader; -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 java.security.NoSuchAlgorithmException; -import java.util.Map; - -@Controller -@RequestMapping("/test") -public class TestController { - - @Autowired - IfmsService ifmsService; - - @Autowired - AuthenticationUtils authenticationUtils; - - @Autowired - JitRequestUtils jitRequestUtils; - - @Autowired - PaymentInstructionService paymentInstruction; - - @Autowired - VirtualAllotmentService virtualAllotmentService; - - @Autowired - private ResourceLoader resourceLoader; - - @RequestMapping(path = "/authenticate", method = RequestMethod.POST) - public ResponseEntity login(@RequestBody Object object) { - - try { - Map appKeys = ifmsService.getKeys(); - Map authResponse = (Map) ifmsService.authenticate(appKeys.get("encodedAppKey")); - appKeys.put("authToken", authResponse.get("authToken")); - appKeys.put("sek", authResponse.get("sek")); - String decryptedSek = authenticationUtils.getDecryptedSek(appKeys.get("appKey"), authResponse.get("sek")); - appKeys.put("decryptedSek", decryptedSek); - // Convert the map to a ResponseEntity - ResponseEntity responseEntity = new ResponseEntity<>(appKeys, HttpStatus.OK); - return responseEntity; - } catch (NoSuchAlgorithmException e) { - throw new RuntimeException(e); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - @RequestMapping(path = "/request", method = RequestMethod.POST) - public ResponseEntity request(@RequestBody Object object) { - try { - ObjectMapper objectMapper = new ObjectMapper(); - Map jsonObject = objectMapper.convertValue(object, Map.class); - Map payload = (Map) jitRequestUtils.getEncryptedRequestBody(String.valueOf(jsonObject.get("decryptedSek")), jsonObject.get("jitRequest")); - String response = ifmsService.ifmsJITRequest(String.valueOf(jsonObject.get("authToken")), payload.get("encryptedPayload"), payload.get("encryptionRek")); - Object decryptedResponse = jitRequestUtils.decryptResponse(payload.get("decryptionRek"), response); - ResponseEntity responseEntity = new ResponseEntity<>(decryptedResponse, HttpStatus.OK); - return responseEntity; - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - @RequestMapping(path = "/create-sanction-allotments", method = RequestMethod.POST) - public ResponseEntity createSanctionAllotments(@RequestBody SchedulerRequest schedulerRequest) { - try { - virtualAllotmentService.generateVirtualAllotment(schedulerRequest.getRequestInfo()); - ResponseEntity responseEntity = new ResponseEntity<>("Generated", HttpStatus.OK); - return responseEntity; - } catch (Exception e) { - throw new RuntimeException(e); - } - } - -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/Disbursement.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/Disbursement.java index d3949145b2..46732ee69d 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/Disbursement.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/Disbursement.java @@ -1,11 +1,11 @@ package org.egov.web.models; import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; +import org.egov.common.contract.models.AuditDetails; import javax.validation.constraints.NotNull; import java.math.BigDecimal; diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/ErrorRes.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/ErrorRes.java index 47abb70338..637b0f62a0 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/ErrorRes.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/ErrorRes.java @@ -15,7 +15,6 @@ */ @Schema(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 = "2023-12-21T10:35:43.292+05:30[Asia/Kolkata]") @Data @AllArgsConstructor @NoArgsConstructor diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/Pagination.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/Pagination.java index deab307411..5c94e05805 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/Pagination.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/Pagination.java @@ -18,7 +18,6 @@ */ @Schema(description = "Pagination details") @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-02T17:49:59.877+05:30[Asia/Kolkata]") @Data @AllArgsConstructor @NoArgsConstructor diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankAccount.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankAccount.java deleted file mode 100644 index 738edc8a41..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankAccount.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.egov.web.models.bankaccount; - -import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.util.ArrayList; -import java.util.List; - -/** - * Banking details - */ -@Schema(description = "Banking details") -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-03-14T17:30:53.139+05:30[Asia/Kolkata]") -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class BankAccount { - - @JsonProperty("id") - @Valid - private String id = null; - - @JsonProperty("tenantId") - @NotNull - @Size(min = 2, max = 64) - private String tenantId = null; - - @JsonProperty("serviceCode") - @NotNull - @Size(min = 2, max = 64) - private String serviceCode = null; - - @JsonProperty("referenceId") - @NotNull - @Size(min = 2, max = 64) - private String referenceId = null; - - @JsonProperty("bankAccountDetails") - @Valid - private List bankAccountDetails = null; - - @JsonProperty("additionalFields") - private Object additionalFields = null; - - @JsonProperty("auditDetails") - @Valid - private AuditDetails auditDetails = null; - - - public BankAccount addBankAccountDetailsItem(BankAccountDetails bankAccountDetailsItem) { - if (this.bankAccountDetails == null) { - this.bankAccountDetails = new ArrayList<>(); - } - this.bankAccountDetails.add(bankAccountDetailsItem); - return this; - } - -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankAccountDetails.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankAccountDetails.java deleted file mode 100644 index d258cfe174..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankAccountDetails.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.egov.web.models.bankaccount; - -import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; -import digit.models.coremodels.Document; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.util.ArrayList; -import java.util.List; - -/** - * Account details - */ -@Schema(description = "Account details") -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-03-14T17:30:53.139+05:30[Asia/Kolkata]") -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class BankAccountDetails { - - @JsonProperty("id") - @Valid - private String id = null; - - @JsonProperty("tenantId") - @NotNull - @Size(min = 2, max = 64) - private String tenantId = null; - - @JsonProperty("accountHolderName") - @Size(min = 2, max = 64) - private String accountHolderName = null; - - @JsonProperty("accountNumber") - @NotNull - @Size(min = 2, max = 64) - private String accountNumber = null; - - @JsonProperty("accountType") - @Size(min = 2, max = 64) - private String accountType = null; - - @JsonProperty("isPrimary") - private Boolean isPrimary = true; - - @JsonProperty("bankBranchIdentifier") - @NotNull - @Valid - private BankBranchIdentifier bankBranchIdentifier = null; - - @JsonProperty("isActive") - private Boolean isActive = null; - - @JsonProperty("documents") - @Valid - private List documents = null; - - @JsonProperty("additionalFields") - private Object additionalFields = null; - - @JsonProperty("auditDetails") - @Valid - private AuditDetails auditDetails = null; - - - public BankAccountDetails addDocumentsItem(Document documentsItem) { - if (this.documents == null) { - this.documents = new ArrayList<>(); - } - this.documents.add(documentsItem); - return this; - } - -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankAccountResponse.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankAccountResponse.java deleted file mode 100644 index 2d5c16cd34..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankAccountResponse.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.egov.web.models.bankaccount; - -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 org.egov.web.models.Pagination; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; -import java.util.ArrayList; -import java.util.List; - -/** - * BankAccountResponse - */ -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-03-14T17:30:53.139+05:30[Asia/Kolkata]") -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class BankAccountResponse { - - @JsonProperty("ResponseInfo") - @Valid - private ResponseInfo responseInfo = null; - - @JsonProperty("bankAccounts") - @Valid - private List bankAccounts = null; - - @JsonProperty("pagination") - @Valid - private Pagination pagination = null; - - - public BankAccountResponse addBankAccountsItem(BankAccount bankAccountsItem) { - if (this.bankAccounts == null) { - this.bankAccounts = new ArrayList<>(); - } - this.bankAccounts.add(bankAccountsItem); - return this; - } - -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankAccountSearchCriteria.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankAccountSearchCriteria.java deleted file mode 100644 index 9e765397aa..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankAccountSearchCriteria.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.egov.web.models.bankaccount; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.util.ArrayList; -import java.util.List; - -/** - * BankAccountSearchCriteria - */ -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-03-14T17:30:53.139+05:30[Asia/Kolkata]") -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class BankAccountSearchCriteria { - - @JsonProperty("tenantId") - @NotNull - @Size(min = 2, max = 64) - private String tenantId = null; - - @JsonProperty("ids") - private List ids = null; - - @JsonProperty("serviceCode") - @Size(min = 2, max = 64) - private String serviceCode = null; - - @JsonProperty("referenceId") - private List referenceId = null; - - @JsonProperty("accountHolderName") - @Size(min = 2, max = 64) - private String accountHolderName = null; - - @JsonProperty("accountNumber") - private List accountNumber = null; - - @JsonProperty("isActive") - private Boolean isActive = null; - - @JsonProperty("isPrimary") - private Boolean isPrimary = null; - - @JsonProperty("bankBranchIdentifierCode") - @Valid - private BankBranchIdentifier bankBranchIdentifierCode = null; - - @JsonIgnore - private Boolean isCountNeeded = false; - - - public BankAccountSearchCriteria addIdsItem(String idsItem) { - if (this.ids == null) { - this.ids = new ArrayList<>(); - } - this.ids.add(idsItem); - return this; - } - - public BankAccountSearchCriteria addReferenceIdItem(String referenceIdItem) { - if (this.referenceId == null) { - this.referenceId = new ArrayList<>(); - } - this.referenceId.add(referenceIdItem); - return this; - } - - public BankAccountSearchCriteria addAccountNumberItem(String accountNumberItem) { - if (this.accountNumber == null) { - this.accountNumber = new ArrayList<>(); - } - this.accountNumber.add(accountNumberItem); - return this; - } - -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankAccountSearchRequest.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankAccountSearchRequest.java deleted file mode 100644 index 4659e7d54b..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankAccountSearchRequest.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.egov.web.models.bankaccount; - -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 org.egov.web.models.Pagination; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; - -/** - * BankAccountSearchRequest - */ -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-03-14T17:30:53.139+05:30[Asia/Kolkata]") -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class BankAccountSearchRequest { - - @JsonProperty("RequestInfo") - private RequestInfo requestInfo = null; - - @JsonProperty("bankAccountDetails") - @Valid - private BankAccountSearchCriteria bankAccountDetails = null; - - @JsonProperty("pagination") - @Valid - private Pagination pagination = null; - - -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankBranchIdentifier.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankBranchIdentifier.java deleted file mode 100644 index a938eb24a7..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bankaccount/BankBranchIdentifier.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.egov.web.models.bankaccount; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; -import javax.validation.constraints.Size; - -/** - * Object to capture bank branch identifier for a banking org to be used for wire transfers. - */ -@Schema(description = "Object to capture bank branch identifier for a banking org to be used for wire transfers.") -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-03-14T17:30:53.139+05:30[Asia/Kolkata]") -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class BankBranchIdentifier { - - @JsonProperty("id") - @Valid - private String id = null; - - @JsonProperty("type") - @Size(min = 2, max = 64) - private String type = null; - - @JsonProperty("code") - @Size(min = 2, max = 64) - private String code = null; - - @JsonProperty("additionalDetails") - private Object additionalDetails = null; - - -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/Bill.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/Bill.java deleted file mode 100644 index d26331c840..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/Bill.java +++ /dev/null @@ -1,118 +0,0 @@ -package org.egov.web.models.bill; - -import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.egov.web.models.enums.PaymentStatus; -import org.egov.web.models.enums.Status; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -/** - * A Object which holds the info about the expense details - */ -@Schema(description = "A Object which holds the info about the expense details") -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-02T17:49:59.877+05:30[Asia/Kolkata]") -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class Bill { - - @JsonProperty("id") - @Valid - private String id; - - @JsonProperty("tenantId") - @NotNull - @Size(min = 2, max = 64) - private String tenantId; - - @JsonProperty("billDate") - @Valid - @NotNull - private Long billDate; - - @JsonProperty("dueDate") - @Valid - private Long dueDate; - - @JsonProperty("totalAmount") - @Valid - @Builder.Default - private BigDecimal totalAmount = BigDecimal.ZERO; - - @JsonProperty("totalPaidAmount") - @Valid - @Builder.Default - private BigDecimal totalPaidAmount = BigDecimal.ZERO; - - @JsonProperty("businessService") - @NotNull - @Size(min = 2, max = 128) - private String businessService; - - @JsonProperty("referenceId") - @Size(min = 2, max = 128) - @NotNull - private String referenceId; - - @JsonProperty("fromPeriod") - @Valid - private Long fromPeriod; - - @JsonProperty("toPeriod") - @Valid - private Long toPeriod; - - @JsonProperty("paymentStatus") - private PaymentStatus paymentStatus; - - @JsonProperty("status") - private Status status; - - @JsonProperty("billNumber") - private String billNumber; - - @JsonProperty("payer") - @NotNull - @Valid - private Party payer; - - @JsonProperty("billDetails") - @NotNull - @Valid - private List billDetails; - - @JsonProperty("additionalDetails") - private Object additionalDetails; - - @JsonProperty("auditDetails") - @Valid - private AuditDetails auditDetails; - - @JsonProperty("wfStatus") - @Size(min = 2, max = 64) - private String wfStatus; - - public Bill addBillDetailsItem(BillDetail billDetailsItem) { - - if (null == this.billDetails) - this.billDetails = new ArrayList<>(); - - this.billDetails.add(billDetailsItem); - return this; - } - -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/BillCriteria.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/BillCriteria.java deleted file mode 100644 index 93e1e95ca9..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/BillCriteria.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.egov.web.models.bill; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.springframework.validation.annotation.Validated; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.util.HashSet; -import java.util.Set; - -/** - * BillCriteria - */ -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-02T17:49:59.877+05:30[Asia/Kolkata]") -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class BillCriteria { - - @JsonProperty("tenantId") - @NotNull - @Size(min = 2, max = 64) - private String tenantId; - - @JsonProperty("ids") - private Set ids; - - @JsonProperty("businessService") - @Size(min = 2, max = 64) - private String businessService; - - @JsonProperty("referenceIds") - private Set referenceIds; - - @JsonProperty("billNumbers") - private Set billNumbers; - - @JsonProperty("status") - private String status; - - @JsonProperty("statusNot") - private String statusNot; - - @JsonProperty("isPaymentStatusNull") - private Boolean isPaymentStatusNull; - - public BillCriteria addIdsItem(String idsItem) { - if (this.ids == null) { - this.ids = new HashSet<>(); - } - this.ids.add(idsItem); - return this; - } - - public BillCriteria addReferenceIdItem(String referenceIdItem) { - if (this.referenceIds == null) { - this.referenceIds = new HashSet<>(); - } - this.referenceIds.add(referenceIdItem); - return this; - } - -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/BillDetail.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/BillDetail.java deleted file mode 100644 index 8411f093bc..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/BillDetail.java +++ /dev/null @@ -1,113 +0,0 @@ -package org.egov.web.models.bill; - -import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.egov.web.models.enums.PaymentStatus; -import org.egov.web.models.enums.Status; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -/** - * Bill details of the individual payee - */ -@Schema(description = "Bill details of the individual payees") -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-02T17:49:59.877+05:30[Asia/Kolkata]") -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class BillDetail { - - @JsonProperty("id") - @Valid - private String id; - - @JsonProperty("tenantId") - @NotNull - @Size(min = 2, max = 64) - private String tenantId; - - @JsonProperty("billId") - @Valid - private String billId; - - @JsonProperty("totalAmount") - @Valid - @Builder.Default - private BigDecimal totalAmount = BigDecimal.ZERO;; - - @JsonProperty("totalPaidAmount") - @Valid - @Builder.Default - private BigDecimal totalPaidAmount = BigDecimal.ZERO; - - @JsonProperty("referenceId") - @Size(min = 2, max = 64) - private String referenceId; - - @JsonProperty("paymentStatus") - private PaymentStatus paymentStatus; - - @JsonProperty("status") - private Status status; - - @JsonProperty("fromPeriod") - @Valid - private Long fromPeriod; - - @JsonProperty("toPeriod") - @Valid - private Long toPeriod; - - @JsonProperty("payee") - @NotNull - @Valid - private Party payee; - - @JsonProperty("lineItems") - @Valid - private List lineItems; - - @JsonProperty("payableLineItems") - @NotNull - @Valid - private List payableLineItems; - - @JsonProperty("auditDetails") - @Valid - private AuditDetails auditDetails; - - @JsonProperty("additionalDetails") - private Object additionalDetails; - - public BillDetail addLineItems(LineItem lineItem) { - - if (this.lineItems == null) { - this.lineItems = new ArrayList<>(); - } - this.lineItems.add(lineItem); - return this; - } - - public BillDetail addPayableLineItems(LineItem payableLineItem) { - - if (this.payableLineItems == null) { - this.payableLineItems = new ArrayList<>(); - } - this.payableLineItems.add(payableLineItem); - return this; - } - -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/BillResponse.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/BillResponse.java deleted file mode 100644 index 3cba51ec51..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/BillResponse.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.egov.web.models.bill; - -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 org.egov.web.models.Pagination; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; -import java.util.ArrayList; -import java.util.List; - -/** - * BillResponse - */ -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-02T17:49:59.877+05:30[Asia/Kolkata]") -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class BillResponse { - - @JsonProperty("ResponseInfo") - @Valid - private ResponseInfo responseInfo; - - @JsonProperty("bills") - @Valid - private List bills; - - @JsonProperty("pagination") - @Valid - private Pagination pagination; - - public BillResponse addBillItem(Bill billItem) { - if (this.bills == null) { - this.bills = new ArrayList<>(); - } - this.bills.add(billItem); - return this; - } - -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/BillSearchRequest.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/BillSearchRequest.java deleted file mode 100644 index 8ee8acc9c6..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/BillSearchRequest.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.egov.web.models.bill; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Builder.Default; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.egov.common.contract.request.RequestInfo; -import org.egov.web.models.Pagination; -import org.egov.web.models.bill.BillCriteria; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; - -/** - * BillSearchRequest - */ -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-02T17:49:59.877+05:30[Asia/Kolkata]") -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class BillSearchRequest { - - @JsonProperty("RequestInfo") - @NotNull - private RequestInfo requestInfo; - - @JsonProperty("billCriteria") - @NotNull - @Valid - private BillCriteria billCriteria; - - @JsonProperty("pagination") - @NotNull - @Default - private Pagination pagination = new Pagination(); - -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/LineItem.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/LineItem.java deleted file mode 100644 index 0912e5eb01..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/LineItem.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.egov.web.models.bill; - -import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.egov.web.models.enums.LineItemType; -import org.egov.web.models.enums.PaymentStatus; -import org.egov.web.models.enums.Status; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.math.BigDecimal; - -/** - * Line items are the amount breakups for net amounts - */ -@Schema(description = "Line items are the amount breakups for net amounts") -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-02T17:49:59.877+05:30[Asia/Kolkata]") -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class LineItem { - - @JsonProperty("id") - @Valid - private String id; - - @JsonProperty("billDetailId") - @Valid - private String billDetailId; - - @JsonProperty("tenantId") - @NotNull - @Size(min = 2, max = 64) - private String tenantId; - - @JsonProperty("headCode") - @NotNull - @Size(min = 2, max = 64) - private String headCode; - - @JsonProperty("amount") - @NotNull - @Valid - private BigDecimal amount; - - @JsonProperty("type") - @NotNull - private LineItemType type; - - @JsonProperty("paidAmount") - @Valid - @Builder.Default - private BigDecimal paidAmount = BigDecimal.ZERO; - - @JsonProperty("status") - private Status status; - - @JsonProperty("paymentStatus") - private PaymentStatus paymentStatus; - - @JsonProperty("additionalDetails") - private Object additionalDetails; - - @JsonProperty("auditDetails") - @Valid - private AuditDetails auditDetails; - -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PISearchCriteria.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PISearchCriteria.java deleted file mode 100644 index 1277cfc01f..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PISearchCriteria.java +++ /dev/null @@ -1,4 +0,0 @@ -package org.egov.web.models.bill; - -public class PISearchCriteria { -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/Party.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/Party.java deleted file mode 100644 index 7346617ab0..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/Party.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.egov.web.models.bill; - -import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.egov.web.models.enums.Status; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -/** - * Account details - */ -@Schema(description = "Account details") -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-02T17:49:59.877+05:30[Asia/Kolkata]") -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class Party { - - @JsonProperty("id") - @Valid - private String id; - - @JsonProperty("parentId") - @Valid - private String parentId; - - @JsonProperty("tenantId") - @NotNull - @Size(min = 2, max = 64) - private String tenantId; - - @JsonProperty("type") - @NotNull - @Size(min = 2, max = 64) - private String type; - - @JsonProperty("identifier") - @NotNull - @Size(min = 2, max = 64) - private String identifier; - - @JsonProperty("status") - private Status status; - - @JsonProperty("additionalDetails") - private Object additionalDetails; - - @JsonProperty("auditDetails") - @Valid - private AuditDetails auditDetails; - -} - - - - diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/Payment.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/Payment.java deleted file mode 100644 index 2ade2ca539..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/Payment.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.egov.web.models.bill; - -import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.egov.web.models.enums.PaymentStatus; -import org.egov.web.models.enums.ReferenceStatus; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -/** - * Payment - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class Payment { - - @JsonProperty("tenantId") - @NotNull - private String tenantId; - - @JsonProperty("id") - @Valid - private String id; - - @JsonProperty("netPayableAmount") - @NotNull - private BigDecimal netPayableAmount; - - @JsonProperty("netPaidAmount") - @NotNull - private BigDecimal netPaidAmount; - - @JsonProperty("bills") - @Valid - @NotNull - private List bills; - - @JsonProperty("paymentNumber") - private String paymentNumber; - - @JsonProperty("status") - private PaymentStatus status; - - @JsonProperty("referenceStatus") - private ReferenceStatus referenceStatus; - - @JsonProperty("auditDetails") - private AuditDetails auditDetails; - - @JsonProperty("additionalDetails") - private Object additionalDetails; - - public Payment addBillItem(PaymentBill bill) { - - if (this.bills == null) - this.bills = new ArrayList<>(); - this.bills.add(bill); - return this; - } -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PaymentBill.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PaymentBill.java deleted file mode 100644 index 5eea673d9c..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PaymentBill.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.egov.web.models.bill; - -import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Builder.Default; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.egov.web.models.enums.PaymentStatus; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -/** - * A Object which holds the info about the expense details - */ -@AllArgsConstructor -@NoArgsConstructor -@Data -@Builder -public class PaymentBill { - - @JsonProperty("id") - private String id; - - @JsonProperty("billId") - @NotNull - private String billId; - - @JsonProperty("tenantId") - private String tenantId; - - @JsonProperty("totalAmount") - private BigDecimal totalAmount; - - @JsonProperty("totalPaidAmount") - @Default - private BigDecimal totalPaidAmount = BigDecimal.ZERO; - - @JsonProperty("status") - private PaymentStatus status; - - @JsonProperty("billDetails") - @Valid - @NotNull - private List billDetails; - - @JsonProperty("auditDetails") - private AuditDetails auditDetails; - - public PaymentBill addPaymentBillDetailItem (PaymentBillDetail paymentBillDetailItem) { - - if (null == this.billDetails) - this.billDetails = new ArrayList<>(); - - this.billDetails.add(paymentBillDetailItem); - return this; - } -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PaymentBillDetail.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PaymentBillDetail.java deleted file mode 100644 index b2c9c82eef..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PaymentBillDetail.java +++ /dev/null @@ -1,65 +0,0 @@ -package org.egov.web.models.bill; - -import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Builder.Default; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.egov.web.models.enums.PaymentStatus; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -/** - * Bill details of the individual payees - */ -@Validated -@AllArgsConstructor -@NoArgsConstructor -@Data -@Builder -public class PaymentBillDetail { - - @JsonProperty("id") - private String id; - - @JsonProperty("tenantId") - private String tenantId; - - @JsonProperty("billDetailId") - @NotNull - private String billDetailId; - - @JsonProperty("totalAmount") - private BigDecimal totalAmount; - - @JsonProperty("totalPaidAmount") - @Default - private BigDecimal totalPaidAmount = BigDecimal.ZERO; - - @JsonProperty("status") - private PaymentStatus status; - - @JsonProperty("payableLineItems") - @Valid - @NotNull - private List payableLineItems; - - @JsonProperty("auditDetails") - private AuditDetails auditDetails; - - public PaymentBillDetail addLineItem(PaymentLineItem paymentLineItem) { - - if (null == this.payableLineItems) - this.payableLineItems = new ArrayList<>(); - - this.payableLineItems.add(paymentLineItem); - return this; - } -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PaymentLineItem.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PaymentLineItem.java deleted file mode 100644 index 229aefea8e..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PaymentLineItem.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.egov.web.models.bill; - -import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.egov.web.models.enums.PaymentStatus; -import org.springframework.validation.annotation.Validated; - -import javax.validation.constraints.NotNull; -import java.math.BigDecimal; - -/** - * Line items are the amount breakups for net amounts - */ -@Validated -@AllArgsConstructor -@NoArgsConstructor -@Data -@Builder -public class PaymentLineItem { - - @JsonProperty("id") - private String id; - - @JsonProperty("lineItemId") - private String lineItemId; - - @JsonProperty("tenantId") - private String tenantId; - - @JsonProperty("paidAmount") - @NotNull - private BigDecimal paidAmount; - - @JsonProperty("status") - private PaymentStatus status; - - @JsonProperty("auditDetails") - private AuditDetails auditDetails; -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PaymentRequest.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PaymentRequest.java index 4e7806a22c..58332a4eb5 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PaymentRequest.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PaymentRequest.java @@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import org.egov.common.contract.request.RequestInfo; +import org.egov.works.services.common.models.expense.Payment; import org.springframework.validation.annotation.Validated; import javax.validation.Valid; diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PaymentResponse.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PaymentResponse.java deleted file mode 100644 index ba233d3178..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/bill/PaymentResponse.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.egov.web.models.bill; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.web.models.Pagination; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; -import java.util.ArrayList; -import java.util.List; - -/** - * PaymentResponse - */ -@Schema(description = "A Object which holds the info about the payment response") -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-02T17:49:59.877+05:30[Asia/Kolkata]") -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class PaymentResponse { - - @JsonProperty("ResponseInfo") - private ResponseInfo responseInfo; - - @JsonProperty("payments") - @Valid - private List payments; - - @JsonProperty("pagination") - private Pagination pagination; - - public PaymentResponse addPaymentItem(Payment paymentItem) { - if (this.payments == null) { - this.payments = new ArrayList<>(); - } - this.payments.add(paymentItem); - return this; - } -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/enums/LineItemType.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/enums/LineItemType.java deleted file mode 100644 index 15fc75d4d7..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/enums/LineItemType.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.egov.web.models.enums; - - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Type of line item - */ -public enum LineItemType { - - PAYABLE("PAYABLE"), - - DEDUCTION("DEDUCTION"); - - private String value; - - LineItemType(String value) { - this.value = value; - } - - @Override - @JsonValue - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static LineItemType fromValue(String text) { - for (LineItemType b : LineItemType.values()) { - if (String.valueOf(b.value).equalsIgnoreCase(text)) { - return b; - } - } - return null; - } -} \ No newline at end of file diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/enums/PaymentStatus.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/enums/PaymentStatus.java deleted file mode 100644 index ba88fd0836..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/enums/PaymentStatus.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.egov.web.models.enums; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -import javax.validation.constraints.NotNull; - -/** - * enum value for the payment status - */ -public enum PaymentStatus { - - INITIATED("INITIATED"), - - SUCCESSFUL("SUCCESSFUL"), - - FAILED("FAILED"), - - CANCELLED("CANCELLED"), - PARTIAL("PARTIAL"); - - private String value; - - PaymentStatus(String value) { - this.value = value; - } - - @Override - @JsonValue - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - @NotNull - public static PaymentStatus fromValue(String text) { - for (PaymentStatus b : PaymentStatus.values()) { - if (String.valueOf(b.value).equalsIgnoreCase(text)) { - return b; - } - } - return null; - } -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/enums/ReferenceStatus.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/enums/ReferenceStatus.java deleted file mode 100644 index 65dae13b6c..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/enums/ReferenceStatus.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.egov.web.models.enums; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -import javax.validation.constraints.NotNull; - -/** - * enum value for the payment status - */ -public enum ReferenceStatus { - - PAYMENT_INITIATED("PAYMENT_INITIATED"), - - PAYMENT_PARTIAL("PAYMENT_PARTIAL"), - - PAYMENT_FAILED("PAYMENT_FAILED"), - - PAYMENT_SUCCESS("PAYMENT_SUCCESS"), - - PAYMENT_ERROR_PROCESSING_PAYMENT("PAYMENT_ERROR_PROCESSING_PAYMENT"), - - PAYMENT_INSUFFICIENT_FUNDS("PAYMENT_INSUFFICIENT_FUNDS"), - - PAYMENT_SERVER_UNREACHABLE("PAYMENT_SERVER_UNREACHABLE"), - - PAYMENT_DECLINED("PAYMENT_DECLINED"); - - - private String value; - - ReferenceStatus(String value) { - this.value = value; - } - - @Override - @JsonValue - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - @NotNull - public static ReferenceStatus fromValue(String text) { - for (ReferenceStatus b : ReferenceStatus.values()) { - if (String.valueOf(b.value).equalsIgnoreCase(text)) { - return b; - } - } - return null; - } -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/enums/Status.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/enums/Status.java deleted file mode 100644 index 2bddb471be..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/enums/Status.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.egov.web.models.enums; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * status of the Property - */ -public enum Status { - - ACTIVE ("ACTIVE"), - - INACTIVE ("INACTIVE"), - - INWORKFLOW ("INWORKFLOW"), - - CANCELLED ("CANCELLED"), - - REJECTED ("REJECTED"); - - private String value; - - Status(String value) { - this.value = value; - } - - @Override - @JsonValue - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static Status fromValue(String text) { - for (Status b : Status.values()) { - if (String.valueOf(b.value).equalsIgnoreCase(text)) { - return b; - } - } - return null; - } -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/individual/IndividualSearch.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/individual/IndividualSearch.java deleted file mode 100644 index 318555f9e4..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/individual/IndividualSearch.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.egov.web.models.individual; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModel; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.egov.common.data.query.annotations.Exclude; -import org.egov.common.models.individual.Gender; -import org.egov.common.models.individual.Identifier; -import org.egov.common.models.individual.Name; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -/** -* A representation of an Individual. -*/ - @ApiModel(description = "A representation of an Individual.") -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-12-27T11:47:19.561+05:30") - -@Data -@NoArgsConstructor -@AllArgsConstructor -@Builder - @JsonIgnoreProperties(ignoreUnknown = true) -public class IndividualSearch { - @JsonProperty("id") - private List id = null; - - @JsonProperty("individualId") - private String individualId = null; - - @JsonProperty("clientReferenceId") - private List clientReferenceId = null; - - @JsonProperty("name") - @Valid - private Name name = null; - - @JsonProperty("dateOfBirth") - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd/MM/yyyy") - private Date dateOfBirth = null; - - @JsonProperty("gender") - @Valid - private Gender gender = null; - - @JsonProperty("mobileNumber") - private String mobileNumber = null; - - @JsonProperty("socialCategory") - @Exclude - private String socialCategory = null; - - @JsonProperty("wardCode") - @Exclude - private String wardCode = null; - - @JsonProperty("individualName") - @Exclude - private String individualName = null; - - @JsonProperty("createdFrom") - @Exclude - private BigDecimal createdFrom = null; - - @JsonProperty("createdTo") - @Exclude - private BigDecimal createdTo = null; - - @JsonProperty("identifier") - @Valid - @Exclude - private Identifier identifier = null; - - @JsonProperty("boundaryCode") - @Exclude - private String boundaryCode = null; - - @JsonProperty("roleCodes") - @Exclude - private List roleCodes = null; - - @Exclude - @JsonProperty("username") - private String username; - - @Exclude - @JsonProperty("userId") - private Long userId; -} - diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/individual/IndividualSearchRequest.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/individual/IndividualSearchRequest.java deleted file mode 100644 index 3fde9ab8e5..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/individual/IndividualSearchRequest.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.egov.web.models.individual; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.egov.web.models.individual.IndividualSearch; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; - -/** -* IndividualSearchRequest -*/ -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-12-27T11:47:19.561+05:30") - -@Data -@NoArgsConstructor -@AllArgsConstructor -@Builder -@JsonIgnoreProperties(ignoreUnknown = true) -public class IndividualSearchRequest { - @JsonProperty("RequestInfo") - @NotNull - @Valid - private org.egov.common.contract.request.RequestInfo requestInfo = null; - - @JsonProperty("Individual") - @NotNull - @Valid - private IndividualSearch individual = null; -} - diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/Allotment.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/Allotment.java index 36dbaaba7e..10df1e9fae 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/Allotment.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/Allotment.java @@ -2,12 +2,11 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import org.egov.common.data.query.annotations.Exclude; +import org.egov.common.contract.models.AuditDetails; import javax.validation.Valid; import java.math.BigDecimal; @@ -20,100 +19,100 @@ public class Allotment { @JsonProperty("id") - @Exclude + private String id = null; @JsonProperty("tenantId") - @Exclude + private String tenantId = null; @JsonProperty("programCode") - @Exclude + private String programCode = null; @JsonProperty("sanctionId") - @Exclude + private String sanctionId = null; @JsonProperty("additionalDetails") - @Exclude + private Object additionalDetails; @JsonProperty("allotmentSerialNo") - @Exclude + private int allotmentSerialNo; @JsonProperty("decimalAllottedAmount") - @Exclude + private BigDecimal decimalAllottedAmount = null; @JsonProperty("decimalSanctionBalance") - @Exclude + private BigDecimal decimalSanctionBalance = null; @JsonProperty("allotmentDateTimeStamp") - @Exclude + private Long allotmentDateTimeStamp = null; @JsonProperty("auditDetails") - @Exclude + private AuditDetails auditDetails; // JIT-VA response fields @JsonProperty("ddoCode") - @Exclude + private String hoaCode = null; @JsonProperty("schemeCode") - @Exclude + private String schemeCode; @JsonProperty("schemeName") - @Exclude + private String schemeName; @JsonProperty("granteeAgCode") - @Exclude + private String granteeAgCode; @JsonProperty("granteeName") - @Exclude + private String granteeName; @JsonProperty("ssuId") - @Exclude + private String ssuId; @JsonProperty("ssuOffice") - @Exclude + private String ssuOffice; @JsonProperty("allotmentDate") - @Exclude + private String allotmentDate; @JsonProperty("allotmentTxnSlNo") - @Exclude + private String allotmentTxnSlNo; @JsonProperty("allotmentAmount") - @Exclude + private String allotmentAmount; @JsonProperty("availableBalance") - @Exclude + private String availableBalance; @JsonProperty("allotmentTxnType") - @Exclude + private String allotmentTxnType; @JsonProperty("mstAllotmentDistId") - @Exclude + private String mstAllotmentDistId; @JsonProperty("ssuAllotmentId") - @Exclude + private String ssuAllotmentId; } diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/Beneficiary.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/Beneficiary.java index 2f119bf8e9..5fa928d85c 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/Beneficiary.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/Beneficiary.java @@ -3,12 +3,10 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; import lombok.*; -import org.egov.common.data.query.annotations.Exclude; +import org.egov.common.contract.models.AuditDetails; import org.egov.web.models.enums.BeneficiaryPaymentStatus; import org.egov.web.models.enums.BeneficiaryType; -import org.egov.web.models.enums.PaymentStatus; import java.math.BigDecimal; import java.util.List; @@ -25,91 +23,91 @@ public class Beneficiary { // Beneficiary Details fields stored in DB @JsonProperty("id") - @Exclude + private String id; @JsonProperty("tenantId") - @Exclude + private String tenantId; @JsonProperty("muktaReferenceId") - @Exclude + private String muktaReferenceId; @JsonProperty("piId") - @Exclude + private String piId; @JsonProperty("beneficiaryId") - @Exclude + private String beneficiaryId; @JsonProperty("beneficiaryType") - @Exclude + private BeneficiaryType beneficiaryType; @JsonProperty("beneficiaryNumber") - @Exclude + private String beneficiaryNumber; @JsonProperty("bankAccountId") - @Exclude + private String bankAccountId; @JsonProperty("amount") - @Exclude + private BigDecimal amount; @JsonProperty("voucherNumber") - @Exclude + private String voucherNumber; @JsonProperty("voucherDate") - @Exclude + private Long voucherDate; @JsonProperty("utrNo") - @Exclude + private String utrNo; @JsonProperty("utrDate") - @Exclude + private String utrDate; @JsonProperty("endToEndId") - @Exclude + private String endToEndId; @JsonProperty("challanNumber") - @Exclude + private String challanNumber; @JsonProperty("challanDate") - @Exclude + private String challanDate; @JsonProperty("paymentStatus") - @Exclude + private BeneficiaryPaymentStatus paymentStatus; @JsonProperty("paymentStatusMessage") - @Exclude + private String paymentStatusMessage; @JsonProperty("additionalDetails") - @Exclude + private Object additionalDetails; @JsonProperty("benfLineItems") private List benfLineItems; @JsonProperty("auditDetails") - @Exclude + private AuditDetails auditDetails; // PI request fields @JsonProperty("benefId") - @Exclude + private String benefId; @JsonProperty("benefName") diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/BenfLineItems.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/BenfLineItems.java index bb0706446f..435589723f 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/BenfLineItems.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/BenfLineItems.java @@ -1,12 +1,11 @@ package org.egov.web.models.jit; import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import org.egov.common.data.query.annotations.Exclude; +import org.egov.common.contract.models.AuditDetails; @AllArgsConstructor @NoArgsConstructor @@ -23,7 +22,7 @@ public class BenfLineItems { private String lineItemId; @JsonProperty("auditDetails") - @Exclude + private AuditDetails auditDetails; } diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/CORBeneficiaryDetails.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/CORBeneficiaryDetails.java index 4f9ad3a00c..7c76578df4 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/CORBeneficiaryDetails.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/CORBeneficiaryDetails.java @@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.*; -import org.egov.common.data.query.annotations.Exclude; @Getter @Setter @@ -17,35 +16,35 @@ public class CORBeneficiaryDetails { @JsonProperty("benefId") - @Exclude + private String benefId; @JsonProperty("jitCurBillRefNo") - @Exclude + private String jitCurBillRefNo; @JsonProperty("orgAccountNo") - @Exclude + private String orgAccountNo; @JsonProperty("orgIfsc") - @Exclude + private String orgIfsc; @JsonProperty("correctedAccountNo") - @Exclude + private String correctedAccountNo; @JsonProperty("correctedIfsc") - @Exclude + private String correctedIfsc; @JsonProperty("curAccountNo") - @Exclude + private String curAccountNo; @JsonProperty("curIfsc") - @Exclude + private String curIfsc; } diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/CORRequest.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/CORRequest.java index b2f66a6393..e237eb4fa9 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/CORRequest.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/CORRequest.java @@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.*; -import org.egov.common.data.query.annotations.Exclude; import java.util.List; @@ -19,31 +18,31 @@ public class CORRequest { @JsonProperty("jitCorBillNo") - @Exclude + private String jitCorBillNo; @JsonProperty("jitCorBillDate") - @Exclude + private String jitCorBillDate; @JsonProperty("jitCorBillDeptCode") - @Exclude + private String jitCorBillDeptCode; @JsonProperty("jitOrgBillRefNo") - @Exclude + private String jitOrgBillRefNo; @JsonProperty("jitOrgBillNo") - @Exclude + private String jitOrgBillNo; @JsonProperty("jitOrgBillDate") - @Exclude + private String jitOrgBillDate; @JsonProperty("beneficiaryDtls") - @Exclude + private List beneficiaryDtls; } diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/ExecutedVALog.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/ExecutedVALog.java index b82952001b..e4a8877063 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/ExecutedVALog.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/ExecutedVALog.java @@ -1,11 +1,11 @@ package org.egov.web.models.jit; import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import org.egov.common.contract.models.AuditDetails; @AllArgsConstructor @NoArgsConstructor diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/FundsSummary.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/FundsSummary.java index e797779fd1..70ccc7f529 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/FundsSummary.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/FundsSummary.java @@ -1,11 +1,11 @@ package org.egov.web.models.jit; import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import org.egov.common.contract.models.AuditDetails; import javax.validation.Valid; import java.math.BigDecimal; diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/PADetails.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/PADetails.java index f0ce8a552c..9941eec784 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/PADetails.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/PADetails.java @@ -1,12 +1,11 @@ package org.egov.web.models.jit; import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import org.egov.common.data.query.annotations.Exclude; +import org.egov.common.contract.models.AuditDetails; @AllArgsConstructor @NoArgsConstructor @@ -51,7 +50,7 @@ public class PADetails { private Object additionalDetails; @JsonProperty("auditDetails") - @Exclude + private AuditDetails auditDetails; diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/PISearchCriteria.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/PISearchCriteria.java index aff64dd0e5..4c4f8597c8 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/PISearchCriteria.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/PISearchCriteria.java @@ -5,7 +5,6 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import org.egov.common.data.query.annotations.Exclude; import org.egov.web.models.enums.PIStatus; import org.egov.web.models.enums.PIType; diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/PIStatusLog.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/PIStatusLog.java index 30942d8301..ddd439861b 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/PIStatusLog.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/PIStatusLog.java @@ -1,12 +1,11 @@ package org.egov.web.models.jit; import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import org.egov.common.data.query.annotations.Exclude; +import org.egov.common.contract.models.AuditDetails; import org.egov.web.models.enums.JITServiceId; import org.egov.web.models.enums.JitRespStatusForPI; @@ -31,6 +30,6 @@ public class PIStatusLog { private Object additionalDetails; @JsonProperty("auditDetails") - @Exclude + private AuditDetails auditDetails; } diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/PaymentInstruction.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/PaymentInstruction.java index 803dba7a0c..0c581a691b 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/PaymentInstruction.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/PaymentInstruction.java @@ -3,9 +3,8 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; import lombok.*; -import org.egov.common.data.query.annotations.Exclude; +import org.egov.common.contract.models.AuditDetails; import org.egov.web.models.enums.PIStatus; import java.math.BigDecimal; @@ -23,139 +22,139 @@ public class PaymentInstruction { // Fields @JsonProperty("id") - @Exclude + private String id; @JsonProperty("tenantId") - @Exclude + private String tenantId; @JsonProperty("programCode") private String programCode; @JsonProperty("parentPiNumber") - @Exclude + private String parentPiNumber; @JsonProperty("muktaReferenceId") - @Exclude + private String muktaReferenceId; @JsonProperty("numBeneficiaries") - @Exclude + private Integer numBeneficiaries; @JsonProperty("grossAmount") - @Exclude + private BigDecimal grossAmount; @JsonProperty("netAmount") - @Exclude + private BigDecimal netAmount; @JsonProperty("piStatus") - @Exclude + private PIStatus piStatus; @JsonProperty("piSuccessCode") - @Exclude + private String piSuccessCode; @JsonProperty("piSuccessDesc") - @Exclude + private String piSuccessDesc; @JsonProperty("piApprovedId") - @Exclude + private String piApprovedId; @JsonProperty("piApprovalDate") - @Exclude + private String piApprovalDate; @JsonProperty("piErrorResp") - @Exclude + private String piErrorResp; @JsonProperty("additionalDetails") - @Exclude + private Object additionalDetails; @JsonProperty("auditDetails") - @Exclude + private AuditDetails auditDetails; @JsonProperty("transactionDetails") - @Exclude + private List transactionDetails; @JsonProperty("paDetails") - @Exclude + private List paDetails; @JsonProperty("piStatusLogs") - @Exclude + private List piStatusLogs; @JsonProperty("isActive") - @Exclude + private Boolean isActive = true; // PI request fields @JsonProperty("jitBillNo") - @Exclude + private String jitBillNo; @JsonProperty("jitBillDate") - @Exclude + private String jitBillDate; @JsonProperty("jitBillDdoCode") - @Exclude + private String jitBillDdoCode; @JsonProperty("granteeAgCode") - @Exclude + private String granteeAgCode; @JsonProperty("schemeCode") - @Exclude + private String schemeCode; @JsonProperty("hoa") - @Exclude + private String hoa; @JsonProperty("ssuIaId") - @Exclude + private String ssuIaId; @JsonProperty("mstAllotmentDistId") - @Exclude + private String mstAllotmentDistId; @JsonProperty("ssuAllotmentId") - @Exclude + private String ssuAllotmentId; @JsonProperty("allotmentTxnSlNo") - @Exclude + private String allotmentTxnSlNo; @JsonProperty("billGrossAmount") - @Exclude + private String billGrossAmount; @JsonProperty("billNetAmount") - @Exclude + private String billNetAmount; @JsonProperty("billNumberOfBenf") - @Exclude + private String billNumberOfBenf; @JsonProperty("purpose") - @Exclude + private String purpose; @JsonProperty("beneficiaryDetails") diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/SanctionDetail.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/SanctionDetail.java index 6ddd68aabc..1f8cd3286d 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/SanctionDetail.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/SanctionDetail.java @@ -1,11 +1,12 @@ package org.egov.web.models.jit; import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import org.egov.common.contract.models.AuditDetails; + import java.math.BigDecimal; import java.util.List; diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/TransactionDetails.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/TransactionDetails.java index a2d30420fc..16d2149b03 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/TransactionDetails.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/jit/TransactionDetails.java @@ -1,11 +1,11 @@ package org.egov.web.models.jit; import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import org.egov.common.contract.models.AuditDetails; import org.egov.web.models.enums.TransactionType; import java.math.BigDecimal; diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/mdmsV2/MdmsResponseV2.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/mdmsV2/MdmsResponseV2.java new file mode 100644 index 0000000000..7d445315af --- /dev/null +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/mdmsV2/MdmsResponseV2.java @@ -0,0 +1,25 @@ +package org.egov.web.models.mdmsV2; + +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 javax.validation.Valid; +import java.util.List; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class MdmsResponseV2 { + + @JsonProperty("ResponseInfo") + @Valid + private ResponseInfo responseInfo = null; + + @JsonProperty("mdms") + private List mdms = null; +} \ No newline at end of file diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/mdmsV2/MdmsV2.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/mdmsV2/MdmsV2.java new file mode 100644 index 0000000000..2824683c18 --- /dev/null +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/mdmsV2/MdmsV2.java @@ -0,0 +1,50 @@ +package org.egov.web.models.mdmsV2; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.egov.common.contract.models.AuditDetails; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class MdmsV2 { + + @JsonProperty("id") + @Size(min = 2, max = 64) + private String id; + + @JsonProperty("tenantId") + @NotNull + @Size(min = 2, max = 128) + private String tenantId = null; + + @JsonProperty("schemaCode") + @NotNull + @Size(min = 2, max = 128) + private String schemaCode = null; + + @JsonProperty("uniqueIdentifier") + @Size(min = 2, max = 128) + private String uniqueIdentifier = null; + + @JsonProperty("data") + @NotNull + private JsonNode data = null; + + @JsonProperty("isActive") + private Boolean isActive = true; + + @JsonProperty("auditDetails") + @Valid + private AuditDetails auditDetails = null; + +} \ No newline at end of file diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/mock/MockRequest.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/mock/MockRequest.java new file mode 100644 index 0000000000..956c0e6cf4 --- /dev/null +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/mock/MockRequest.java @@ -0,0 +1,18 @@ +package org.egov.web.models.mock; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import org.egov.web.models.jit.JITRequest; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class MockRequest { + @JsonProperty("tenantId") + private String tenantId; + + @JsonProperty("jitRequest") + private JITRequest jitRequest; +} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Address.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Address.java deleted file mode 100644 index ab5edfe045..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Address.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.egov.web.models.organisation; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModel; -import lombok.*; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; - -/** - * 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-12-30T13:05:25.880+05:30") - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class Address { - - @JsonProperty("id") - @Valid - private String id = null; - - @JsonProperty("tenantId") - private String tenantId = null; - - @JsonProperty("orgId") - private String orgId = null; - - @JsonProperty("doorNo") - private String doorNo = null; - - @JsonProperty("plotNo") - private String plotNo = null; - - @JsonProperty("landmark") - private String landmark = null; - - @JsonProperty("city") - private String city = null; - - @JsonProperty("pincode") - private String pincode = null; - - @JsonProperty("district") - private String district = null; - - @JsonProperty("region") - private String region = null; - - @JsonProperty("state") - private String state = null; - - @JsonProperty("country") - private String country = null; - - @JsonProperty("additionDetails") - private Object additionDetails = null; - - @JsonProperty("buildingName") - private String buildingName = null; - - @JsonProperty("street") - private String street = null; - - @JsonProperty("boundaryType") - private String boundaryType = null; - - @JsonProperty("boundaryCode") - private String boundaryCode = null; - -// @JsonProperty("boundary") -// private Boundary boundary = null; - - @JsonProperty("geoLocation") - private GeoLocation geoLocation = null; -} - diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/ApplicationStatus.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/ApplicationStatus.java deleted file mode 100644 index 5e2076b3c5..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/ApplicationStatus.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.egov.web.models.organisation; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ApplicationStatus { - DEBARRED("DEBARRED"), - - ACTIVE("ACTIVE"), - - INACTIVE("INACTIVE"); - - private String value; - - ApplicationStatus(String value) { - this.value = value; - } - - @JsonCreator - public static ApplicationStatus fromValue(String text) { - for (ApplicationStatus b : ApplicationStatus.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } - - @Override - @JsonValue - public String toString() { - return String.valueOf(value); - } - -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/ContactDetails.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/ContactDetails.java deleted file mode 100644 index 61cce28524..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/ContactDetails.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.egov.web.models.organisation; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModel; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.egov.common.models.core.Role; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; -import javax.validation.constraints.Size; -import java.util.List; - -/** - * Captures details of a contact person - */ -@ApiModel(description = "Captures details of a contact person") -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-15T14:49:42.141+05:30") - -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class ContactDetails { - - @JsonProperty("id") - @Valid - private String id = null; - - @JsonProperty("tenantId") - private String tenantId = null; - - @JsonProperty("orgId") - private String orgId = null; - - @JsonProperty("contactName") - @Size(min = 2, max = 64) - private String contactName = null; - - @JsonProperty("contactMobileNumber") - @Size(max = 20) - private String contactMobileNumber = null; - - @JsonProperty("contactEmail") - @Size(min = 5, max = 200) - private String contactEmail = null; - - @JsonProperty("active") - private Boolean active; - - @JsonProperty("roles") - @Valid - private List roles; - - @Size(max=50) - @JsonProperty("type") - private String type; - - @Size(max=64) - //@DiffIgnore - @JsonProperty("createdBy") - private String createdBy; - - //@DiffIgnore - @JsonProperty("createdDate") - private Long createdDate; - - @Size(max=64) - //@DiffIgnore - @JsonProperty("lastModifiedBy") - private String lastModifiedBy; - - //@DiffIgnore - @JsonProperty("lastModifiedDate") - private Long lastModifiedDate; - -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Document.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Document.java deleted file mode 100644 index 39ecc2e213..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Document.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.egov.web.models.organisation; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModel; -import lombok.*; -import org.springframework.validation.annotation.Validated; - -/** - * This object holds list of documents attached during the transaciton for a property - */ -@ApiModel(description = "This object holds list of documents attached during the transaciton for a property") -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-12-08T16:20:57.141+05:30") - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class Document { - @JsonProperty("id") - private String id = null; - - @JsonProperty("orgId") - private String orgId = null; - - @JsonProperty("orgFunctionId") - private String orgFunctionId = null; - - @JsonProperty("documentType") - private String documentType = null; - - @JsonProperty("fileStore") - private String fileStore = null; - - @JsonProperty("documentUid") - private String documentUid = null; - - @JsonProperty("additionalDetails") - private Object additionalDetails = null; - - @JsonProperty("isActive") - private Boolean isActive = null; - -} - diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Function.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Function.java deleted file mode 100644 index 3a5c11a68c..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Function.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.egov.web.models.organisation; - -import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; -import io.swagger.annotations.ApiModel; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; -import javax.validation.constraints.Size; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -/** - * Represents the functions of an organisation - */ -@ApiModel(description = "Represents the functions of an organisation") -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-15T14:49:42.141+05:30") - -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class Function { - - @JsonProperty("id") - @Valid - private String id = null; - - @JsonProperty("orgId") - private String orgId = null; - - @JsonProperty("applicationNumber") - private String applicationNumber = null; - - @JsonProperty("type") - private String type = null; - - @JsonProperty("category") - @Size(min = 2, max = 64) - private String category = null; - - @JsonProperty("class") - @Size(min = 2, max = 64) - private String propertyClass = null; - - @JsonProperty("validFrom") - private BigDecimal validFrom = null; - - @JsonProperty("validTo") - private BigDecimal validTo = null; - - @JsonProperty("applicationStatus") - private ApplicationStatus applicationStatus = null; - - @JsonProperty("wfStatus") - private String wfStatus = null; - - @JsonProperty("isActive") - private Boolean isActive = null; - - @JsonProperty("documents") - @Valid - private List documents = null;//upsert - - @JsonProperty("additionalDetails") - private Object additionalDetails = null; - - @JsonProperty("auditDetails") - private AuditDetails auditDetails = null; - - public Function addDocumentsItem(Document documentsItem) { - if (this.documents == null) { - this.documents = new ArrayList<>(); - } - this.documents.add(documentsItem); - return this; - } - -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/GeoLocation.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/GeoLocation.java deleted file mode 100644 index 7c097c7bb6..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/GeoLocation.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.egov.web.models.organisation; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.*; - -import javax.validation.Valid; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class GeoLocation { - - @JsonProperty("id") - @Valid - private String id = null; - - @JsonProperty("addressId") - private String addressId = null; - - @JsonProperty("latitude") - private Double latitude = null; - - @JsonProperty("longitude") - private Double longitude = null; - - @JsonProperty("additionalDetails") - private Object additionalDetails = null; - -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Identifier.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Identifier.java deleted file mode 100644 index 7de0d5a451..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Identifier.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.egov.web.models.organisation; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModel; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; -import javax.validation.constraints.Size; - -/** - * Object to capture tax identifiers for a organisation - */ -@ApiModel(description = "Object to capture tax identifiers for a organisation") -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-15T14:49:42.141+05:30") - -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class Identifier { - - @JsonProperty("id") - @Valid - private String id = null; - - @JsonProperty("orgId") - private String orgId = null; - - @JsonProperty("type") - @Size(min = 2, max = 64) - private String type = null; - - @JsonProperty("value") - @Size(min = 2, max = 64) - private String value = null; - - @JsonProperty("additionalDetails") - private Object additionalDetails = null; - - @JsonProperty("isActive") - private Boolean isActive = null; - -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Jurisdiction.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Jurisdiction.java deleted file mode 100644 index 44ed17087a..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Jurisdiction.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.egov.web.models.organisation; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModel; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.springframework.validation.annotation.Validated; - -@ApiModel(description = "Organisation Jurisdiction") -@Validated - -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class Jurisdiction { - - @JsonProperty("id") - private String id = null; - - @JsonProperty("orgId") - private String orgId = null; - - @JsonProperty("code") - private String code = null; - - @JsonProperty("additionalDetails") - private Object additionalDetails = null; -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/OrgResponse.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/OrgResponse.java deleted file mode 100644 index d72bff3e70..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/OrgResponse.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.egov.web.models.organisation; - -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 org.egov.web.models.Pagination; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; -import java.util.ArrayList; -import java.util.List; - -/** - * OrgResponse - */ -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-15T14:49:42.141+05:30") - -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class OrgResponse { - - @JsonProperty("ResponseInfo") - private ResponseInfo responseInfo = null; - - @JsonProperty("organisations") - @Valid - private List organisations = null; - - @JsonProperty("pagination") - private Pagination pagination = null; - - public OrgResponse addOrganisationsItem(Organisation organisationsItem) { - if (this.organisations == null) { - this.organisations = new ArrayList<>(); - } - this.organisations.add(organisationsItem); - return this; - } - -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/OrgSearchCriteria.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/OrgSearchCriteria.java deleted file mode 100644 index 64010e1449..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/OrgSearchCriteria.java +++ /dev/null @@ -1,79 +0,0 @@ -package org.egov.web.models.organisation; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModel; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.springframework.validation.annotation.Validated; - -import javax.validation.constraints.Size; -import java.util.ArrayList; -import java.util.List; - -/** - * organisation search attributes - */ -@ApiModel(description = "organisation search attributes") -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-15T14:49:42.141+05:30") - -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class OrgSearchCriteria { - - @JsonProperty("id") - private List id = null; - - @JsonProperty("tenantId") - @Size(min = 2, max = 1000) - private String tenantId = null; - - @JsonProperty("name") - private String name = null; - - @JsonProperty("applicationNumber") - private String applicationNumber = null; - - @JsonProperty("orgNumber") - private String orgNumber = null; - - @JsonProperty("applicationStatus") - private String applicationStatus = null; - - @JsonProperty("contactMobileNumber") - private String contactMobileNumber = null; - - @JsonProperty("functions") - private Function functions = null; - - @JsonProperty("createdFrom") - private Long createdFrom = null; - - @JsonProperty("createdTo") - private Long createdTo = null; - - @JsonProperty("boundaryCode") - private String boundaryCode = null; - - @JsonProperty("identifierType") - private String identifierType = null; - - @JsonProperty("identifierValue") - private String identifierValue = null; - - @JsonProperty("includeDeleted") - private Boolean includeDeleted = false; - - public OrgSearchCriteria addIdItem(String idItem) { - if (this.id == null) { - this.id = new ArrayList<>(); - } - this.id.add(idItem); - return this; - } - -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/OrgSearchRequest.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/OrgSearchRequest.java deleted file mode 100644 index 54a8d4737c..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/OrgSearchRequest.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.egov.web.models.organisation; - -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 org.egov.web.models.Pagination; -import org.springframework.validation.annotation.Validated; - -/** - * OrgSearchRequest - */ -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-15T14:49:42.141+05:30") - -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class OrgSearchRequest { - - @JsonProperty("RequestInfo") - private RequestInfo requestInfo = null; - - @JsonProperty("SearchCriteria") - private OrgSearchCriteria searchCriteria = null; - - @JsonProperty("Pagination") - private Pagination pagination = null; -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Organisation.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Organisation.java deleted file mode 100644 index 1d64409fbf..0000000000 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/organisation/Organisation.java +++ /dev/null @@ -1,145 +0,0 @@ -package org.egov.web.models.organisation; - -import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; -import io.swagger.annotations.ApiModel; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -/** - * Organisation registry - */ -@ApiModel(description = "Organisation registry") -@Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-15T14:49:42.141+05:30") - -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class Organisation { - - @JsonProperty("id") - @Valid - private String id = null; - - @JsonProperty("tenantId") - @NotNull - @Size(min = 2, max = 64) - private String tenantId = null; - - @JsonProperty("name") - @NotNull - @Size(min = 2, max = 128) - private String name = null; - - @JsonProperty("applicationNumber") - private String applicationNumber = null;//idgen formatted number from start of the org creation request - - //Decided on 14th March : As of now, orgnumber will be generated from start of create org registry - @JsonProperty("orgNumber") - private String orgNumber = null;//idgen formatted number once workflow is 'APPROVED' - - @JsonProperty("applicationStatus") - private ApplicationStatus applicationStatus = null; - - @JsonProperty("externalRefNumber") - @Size(min = 2, max = 64) - private String externalRefNumber = null; - - @JsonProperty("dateOfIncorporation") - private BigDecimal dateOfIncorporation = null; - - @JsonProperty("orgAddress") - @Valid - private List
orgAddress = null;//no - - @JsonProperty("contactDetails") - @Valid - private List contactDetails = null;//no, as of now,it'll be only one - - @JsonProperty("identifiers") - @Valid - @Size(min = 1) - private List identifiers = null;//upsert - - @JsonProperty("functions") - @Valid - @Size(min = 1) - private List functions = null;//upsert - - @JsonProperty("jurisdiction") - private List jurisdiction = null; - - @JsonProperty("isActive") - private Boolean isActive = null; - - @JsonProperty("documents") - @Valid - private List documents = null;//upsert - - @JsonProperty("additionalDetails") - private Object additionalDetails = null; - - @JsonProperty("auditDetails") - private AuditDetails auditDetails = null; - - public Organisation addOrgAddressItem(Address orgAddressItem) { - if (this.orgAddress == null) { - this.orgAddress = new ArrayList<>(); - } - this.orgAddress.add(orgAddressItem); - return this; - } - - public Organisation addContactDetailsItem(ContactDetails contactDetailsItem) { - if (this.contactDetails == null) { - this.contactDetails = new ArrayList<>(); - } - this.contactDetails.add(contactDetailsItem); - return this; - } - - public Organisation addIdentifiersItem(Identifier identifiersItem) { - if (this.identifiers == null) { - this.identifiers = new ArrayList<>(); - } - this.identifiers.add(identifiersItem); - return this; - } - - public Organisation addFunctionsItem(Function functionsItem) { - if (this.functions == null) { - this.functions = new ArrayList<>(); - } - this.functions.add(functionsItem); - return this; - } - - public Organisation addJurisdictionItem(Jurisdiction jurisdictionItem) { - if (this.jurisdiction == null) { - this.jurisdiction = new ArrayList<>(); - } - this.jurisdiction.add(jurisdictionItem); - return this; - } - - public Organisation addDocumentsItem(Document documentsItem) { - if (this.documents == null) { - this.documents = new ArrayList<>(); - } - this.documents.add(documentsItem); - return this; - } - -} diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/program/Program.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/program/Program.java index bb613bb085..3237f83905 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/program/Program.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/web/models/program/Program.java @@ -2,10 +2,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; -import digit.models.coremodels.AuditDetails; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; +import org.egov.common.contract.models.AuditDetails; import org.egov.web.models.ExchangeCode; import javax.validation.constraints.NotNull; diff --git a/reference-adapters/ifms-adapter/src/main/resources/application.properties b/reference-adapters/ifms-adapter/src/main/resources/application.properties index 6558540a05..25ca4e914e 100644 --- a/reference-adapters/ifms-adapter/src/main/resources/application.properties +++ b/reference-adapters/ifms-adapter/src/main/resources/application.properties @@ -59,11 +59,21 @@ ifms.jit.client.secret=hjvkuhil ifms.jit.public.key.filepath=classpath:publicKey +# Mock API Configuration +ifms.jit.mock.enabled=true +ifms.jit.mock.enabled.tenants=pg.citya,pg.cityb +ifms.jit.mock.mdms.master.name=ifms.JitMockResponse + #mdms urls #egov.mdms.host=https://unified-dev.digit.org/ egov.mdms.host=http://localhost:8094/ egov.mdms.search.endpoint=egov-mdms-service/v1/_search +egov.mdms.v2.host=https://unified-dev.digit.org/ +#egov.mdms.v2.host=http://localhost:8081/ +egov.mdms.v2.v2.search.endpoint=mdms-v2/v2/_search +egov.mdms.v2.v1.search.endpoint=mdms-v2/v1/_search + #bill urls egov.bill.host=https://unified-dev.digit.org/ @@ -141,4 +151,7 @@ app.domain=https://unified-qa.digit.org #-----------------Kafka Error Queue-----------------# ifix.adapter.error.queue.topic=ifms-adapter-error-queue -ifix.adapter.es.error.queue.topic=ifms-adapter-es-error-queue \ No newline at end of file +ifix.adapter.es.error.queue.topic=ifms-adapter-es-error-queue +original.pi.expire.days=90 +original.pi.expire.financial.year.date=30 +original.pi.expire.financial.year.month=4 diff --git a/reference-adapters/ifms-adapter/src/main/resources/db/Dockerfile b/reference-adapters/ifms-adapter/src/main/resources/db/Dockerfile index a5699ff7d9..f38638a269 100644 --- a/reference-adapters/ifms-adapter/src/main/resources/db/Dockerfile +++ b/reference-adapters/ifms-adapter/src/main/resources/db/Dockerfile @@ -1,4 +1,4 @@ -FROM egovio/flyway:4.1.2 +FROM egovio/flyway:10.7.1 COPY ./migration/main /flyway/sql @@ -6,4 +6,4 @@ COPY migrate.sh /usr/bin/migrate.sh RUN chmod +x /usr/bin/migrate.sh -CMD ["/usr/bin/migrate.sh"] +ENTRYPOINT ["/usr/bin/migrate.sh"] diff --git a/reference-adapters/ifms-adapter/src/main/resources/db/migrate.sh b/reference-adapters/ifms-adapter/src/main/resources/db/migrate.sh index 43960b25cd..f9d6617822 100644 --- a/reference-adapters/ifms-adapter/src/main/resources/db/migrate.sh +++ b/reference-adapters/ifms-adapter/src/main/resources/db/migrate.sh @@ -1,3 +1,3 @@ #!/bin/sh -flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -ignoreMissingMigrations=true migrate \ No newline at end of file +flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true migrate From 9b384940722469035f05ccb98077ff70e1937056 Mon Sep 17 00:00:00 2001 From: manastanmay-eGov Date: Mon, 18 Nov 2024 20:42:35 +0530 Subject: [PATCH 2/6] Dependency Updated --- reference-adapters/ifms-adapter/pom.xml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/reference-adapters/ifms-adapter/pom.xml b/reference-adapters/ifms-adapter/pom.xml index 6c206c4cf6..0184e7f85a 100644 --- a/reference-adapters/ifms-adapter/pom.xml +++ b/reference-adapters/ifms-adapter/pom.xml @@ -79,10 +79,10 @@ 42.7.1 - org.springframework.boot - spring-boot-starter-validation - 3.2.3 - + org.springframework.boot + spring-boot-starter-validation + 3.2.3 + org.jsoup jsoup @@ -121,9 +121,19 @@ repo.digit.org - eGov DIGIT Releases Repository + eGov ERP Releases Repository + https://nexus-repo.digit.org/nexus/content/repositories/releases/ + + + repo.digit.org.snapshots + eGov ERP Releases Repository https://nexus-repo.digit.org/nexus/content/repositories/snapshots/ + + repo.digit.org.public + eGov Public Repository Group + https://nexus-repo.digit.org/nexus/content/groups/public/ + @@ -143,4 +153,4 @@ - + \ No newline at end of file From cefa3f960aca86a40bdbb2258d2647d769259ae4 Mon Sep 17 00:00:00 2001 From: manastanmay-eGov Date: Fri, 22 Nov 2024 12:52:39 +0530 Subject: [PATCH 3/6] Added the for SSL handshake --- .../org/egov/config/MainConfiguration.java | 26 ++++--------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/reference-adapters/ifms-adapter/src/main/java/org/egov/config/MainConfiguration.java b/reference-adapters/ifms-adapter/src/main/java/org/egov/config/MainConfiguration.java index 948e7e27e5..d859dffa7c 100644 --- a/reference-adapters/ifms-adapter/src/main/java/org/egov/config/MainConfiguration.java +++ b/reference-adapters/ifms-adapter/src/main/java/org/egov/config/MainConfiguration.java @@ -4,15 +4,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; import jakarta.annotation.PostConstruct; import lombok.extern.slf4j.Slf4j; -import org.apache.http.conn.ssl.SSLConnectionSocketFactory; -import org.apache.http.conn.ssl.TrustStrategy; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; + import org.egov.tracer.config.TracerConfiguration; -import org.egov.tracer.config.TracerProperties; -import org.egov.tracer.http.RestTemplateLoggingInterceptor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; + import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -20,12 +14,13 @@ import org.springframework.context.annotation.Primary; import org.springframework.http.client.*; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -import org.springframework.util.CollectionUtils; + import org.springframework.web.client.RestTemplate; import javax.net.ssl.*; -import java.util.Collections; +import java.security.cert.X509Certificate; + import java.util.TimeZone; @Slf4j @@ -48,15 +43,6 @@ public ObjectMapper ifmsObjectMapper() { return objectMapper; } - @Bean - @Primary - public RestTemplate restTemplate(TracerProperties tracerProperties) { - SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory(); - requestFactory.setOutputStreaming(false); - RestTemplate restTemplate = new RestTemplate(new BufferingClientHttpRequestFactory(requestFactory)); - restTemplate.setInterceptors(Collections.singletonList(new RestTemplateLoggingInterceptor(tracerProperties))); - return restTemplate; - } /** * It will disable ssl certification check @@ -64,7 +50,6 @@ public RestTemplate restTemplate(TracerProperties tracerProperties) { * @return * @throws Exception */ - /* @Bean public RestTemplate restTemplate() throws Exception { TrustManager[] trustAllCertificates = new TrustManager[]{ @@ -107,5 +92,4 @@ public MappingJackson2HttpMessageConverter jacksonConverter(ObjectMapper objectM converter.setObjectMapper(objectMapper); return converter; } - */ } From 72c151d970a1b1df7eadffc40ca7efbb2fe52e31 Mon Sep 17 00:00:00 2001 From: manastanmay-eGov Date: Wed, 4 Dec 2024 11:12:55 +0530 Subject: [PATCH 4/6] LTS Upgrade --- reference-adapters/sms-adapter/pom.xml | 34 ++++++++----------- .../egov/works/config/MainConfiguration.java | 2 +- .../NotificationServiceConfiguration.java | 2 +- .../java/org/egov/works/models/Address.java | 2 +- .../org/egov/works/models/AmountBreakup.java | 6 ++-- .../org/egov/works/models/AmountDetail.java | 2 +- .../egov/works/models/AttendanceEntry.java | 2 +- .../egov/works/models/AttendanceRegister.java | 2 +- .../models/AttendanceRegisterRequest.java | 2 +- .../models/AttendanceRegisterResponse.java | 4 +-- .../main/java/org/egov/works/models/Bill.java | 8 ++--- .../org/egov/works/models/BillDetail.java | 8 ++--- .../org/egov/works/models/BillRequest.java | 4 +-- .../org/egov/works/models/ContactDetails.java | 6 ++-- .../java/org/egov/works/models/Contract.java | 8 ++--- .../egov/works/models/ContractCriteria.java | 6 ++-- .../egov/works/models/ContractRequest.java | 6 ++-- .../egov/works/models/ContractResponse.java | 4 +-- .../java/org/egov/works/models/Document.java | 6 ++-- .../java/org/egov/works/models/Estimate.java | 6 ++-- .../org/egov/works/models/EstimateDetail.java | 6 ++-- .../egov/works/models/EstimateRequest.java | 4 +-- .../egov/works/models/EstimateResponse.java | 4 +-- .../java/org/egov/works/models/Function.java | 6 ++-- .../org/egov/works/models/Identifier.java | 6 ++-- .../egov/works/models/IndividualEntry.java | 4 +-- .../org/egov/works/models/Jurisdiction.java | 2 +- .../java/org/egov/works/models/LineItem.java | 8 ++--- .../java/org/egov/works/models/LineItems.java | 8 ++--- .../java/org/egov/works/models/Measure.java | 8 ++--- .../org/egov/works/models/Measurement.java | 8 ++--- .../egov/works/models/MeasurementService.java | 2 +- .../models/MeasurementServiceRequest.java | 6 ++-- .../org/egov/works/models/MusterRoll.java | 4 +-- .../egov/works/models/MusterRollRequest.java | 4 +-- .../org/egov/works/models/OrgRequest.java | 2 +- .../egov/works/models/OrgSearchCriteria.java | 4 +-- .../egov/works/models/OrgSearchRequest.java | 2 +- .../egov/works/models/OrgServiceResponse.java | 4 +-- .../org/egov/works/models/Organisation.java | 8 ++--- .../org/egov/works/models/Pagination.java | 4 +-- .../java/org/egov/works/models/Party.java | 8 ++--- .../java/org/egov/works/models/Project.java | 4 +-- .../org/egov/works/models/PurchaseBill.java | 8 ++--- .../works/models/PurchaseBillRequest.java | 4 +-- .../java/org/egov/works/models/Target.java | 2 +- .../java/org/egov/works/models/Workflow.java | 6 ++-- .../works/models/enums/PaymentStatus.java | 2 +- 48 files changed, 127 insertions(+), 131 deletions(-) diff --git a/reference-adapters/sms-adapter/pom.xml b/reference-adapters/sms-adapter/pom.xml index 25af459a17..0a0a77eb19 100644 --- a/reference-adapters/sms-adapter/pom.xml +++ b/reference-adapters/sms-adapter/pom.xml @@ -5,18 +5,20 @@ sms-adapter jar sms-adapter-service - 0.0.1 + 1.0.1 - 1.8 + 2.17.1 + UTF-8 + 17 + UTF-8 + 1.18.22 ${java.version} ${java.version} - 42.4.1 - 2.17.1 org.springframework.boot spring-boot-starter-parent - 2.2.13.RELEASE + 3.2.2 src/main/java @@ -43,14 +45,14 @@ org.springframework.boot spring-boot-starter-jdbc --> - + org.springframework.boot spring-boot-starter-test @@ -66,7 +68,7 @@ org.egov.services tracer - 2.1.2-SNAPSHOT + 2.9.0-SNAPSHOT org.egov.services @@ -76,7 +78,7 @@ org.egov mdms-client - 0.0.2-SNAPSHOT + 2.9.0-SNAPSHOT compile @@ -90,21 +92,15 @@ jackson-datatype-jsr310 - - javax.validation + org.egov.services tracer - 2.0.0-SNAPSHOT - - - - org.egov.services - services-common - 1.0.1-SNAPSHOT + 2.9.0-SNAPSHOT diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/config/MainConfiguration.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/config/MainConfiguration.java index dfd80fd75d..946b740814 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/config/MainConfiguration.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/config/MainConfiguration.java @@ -9,7 +9,7 @@ import org.springframework.context.annotation.Import; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -import javax.annotation.PostConstruct; +import jakarta.annotation.PostConstruct; import java.util.TimeZone; diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/config/NotificationServiceConfiguration.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/config/NotificationServiceConfiguration.java index 9c94346820..8c93816198 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/config/NotificationServiceConfiguration.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/config/NotificationServiceConfiguration.java @@ -12,7 +12,7 @@ import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.stereotype.Component; -import javax.annotation.PostConstruct; +import jakarta.annotation.PostConstruct; import java.util.TimeZone; @Component diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Address.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Address.java index dd8c6a0d1c..5dadaca970 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Address.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Address.java @@ -11,7 +11,7 @@ */ @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-12-30T13:05:25.880+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-12-30T13:05:25.880+05:30") @Getter @Setter diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AmountBreakup.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AmountBreakup.java index 03705075d0..b3ea05dea9 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AmountBreakup.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AmountBreakup.java @@ -9,14 +9,14 @@ import lombok.NoArgsConstructor; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; /** * AmountBreakup */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-01T15:45:33.268+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-01T15:45:33.268+05:30") @Data @AllArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AmountDetail.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AmountDetail.java index fde7cda474..1e3584ef9a 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AmountDetail.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AmountDetail.java @@ -8,7 +8,7 @@ * AmountDetail */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-12-30T13:05:25.880+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-12-30T13:05:25.880+05:30") @Getter @Setter diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AttendanceEntry.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AttendanceEntry.java index 33e35c013b..5f6407f4b9 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AttendanceEntry.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AttendanceEntry.java @@ -13,7 +13,7 @@ */ @ApiModel(description = "This computed data will also be stored as part of the muster roll db.") @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-14T19:58:09.415+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-14T19:58:09.415+05:30") @Getter @Setter diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AttendanceRegister.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AttendanceRegister.java index 03a489a4a1..b1a4fd3f3a 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AttendanceRegister.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AttendanceRegister.java @@ -10,7 +10,7 @@ * AttendanceRegister */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-14T14:44:21.051+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-14T14:44:21.051+05:30") @Getter @Setter diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AttendanceRegisterRequest.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AttendanceRegisterRequest.java index 95c1b978c7..75031cb1c2 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AttendanceRegisterRequest.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AttendanceRegisterRequest.java @@ -11,7 +11,7 @@ * AttendanceRegisterRequest */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-14T14:44:21.051+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-14T14:44:21.051+05:30") @Getter @Setter diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AttendanceRegisterResponse.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AttendanceRegisterResponse.java index d1e6d15f89..c4b3374a8e 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AttendanceRegisterResponse.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/AttendanceRegisterResponse.java @@ -5,7 +5,7 @@ import org.egov.common.contract.response.ResponseInfo; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; +import jakarta.validation.Valid; import java.util.ArrayList; import java.util.List; @@ -13,7 +13,7 @@ * AttendanceRegisterResponse */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-14T14:44:21.051+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-14T14:44:21.051+05:30") @Getter @Setter diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Bill.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Bill.java index 77beec69da..00e3b07bbe 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Bill.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Bill.java @@ -4,9 +4,9 @@ import java.util.ArrayList; import java.util.List; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import org.egov.works.models.enums.PaymentStatus; @@ -24,7 +24,7 @@ * A Object which holds the info about the expense details */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-02T17:49:59.877+05:30[Asia/Kolkata]") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-02T17:49:59.877+05:30[Asia/Kolkata]") @Data @AllArgsConstructor @NoArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/BillDetail.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/BillDetail.java index ac7c3969cd..f92ac10039 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/BillDetail.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/BillDetail.java @@ -4,9 +4,9 @@ import java.util.ArrayList; import java.util.List; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import org.egov.works.models.enums.PaymentStatus; @@ -25,7 +25,7 @@ */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-02T17:49:59.877+05:30[Asia/Kolkata]") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-02T17:49:59.877+05:30[Asia/Kolkata]") @Data @AllArgsConstructor @NoArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/BillRequest.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/BillRequest.java index 7c9e90ebcf..76e08cb09d 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/BillRequest.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/BillRequest.java @@ -1,6 +1,6 @@ package org.egov.works.models; -import javax.validation.Valid; +import jakarta.validation.Valid; import org.egov.common.contract.request.RequestInfo; import org.springframework.validation.annotation.Validated; @@ -16,7 +16,7 @@ * BillRequest */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-02T17:49:59.877+05:30[Asia/Kolkata]") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-02T17:49:59.877+05:30[Asia/Kolkata]") @Data @AllArgsConstructor @NoArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/ContactDetails.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/ContactDetails.java index 3893e126fd..46ed1b5d09 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/ContactDetails.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/ContactDetails.java @@ -10,8 +10,8 @@ import org.egov.common.models.core.Role; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Size; import java.util.List; /** @@ -19,7 +19,7 @@ */ @ApiModel(description = "Captures details of a contact person") @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-15T14:49:42.141+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-15T14:49:42.141+05:30") @Data @AllArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Contract.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Contract.java index 5ab97237da..07c61c36e0 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Contract.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Contract.java @@ -10,9 +10,9 @@ import lombok.NoArgsConstructor; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -22,7 +22,7 @@ */ @ApiModel(description = "Contract details") @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-01T15:45:33.268+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-01T15:45:33.268+05:30") @Data @AllArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/ContractCriteria.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/ContractCriteria.java index b0bf90b3a9..b2d75c5765 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/ContractCriteria.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/ContractCriteria.java @@ -8,8 +8,8 @@ import org.egov.common.contract.request.RequestInfo; import org.springframework.validation.annotation.Validated; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -19,7 +19,7 @@ */ @ApiModel(description = "The object will contain all the search parameters for contract service.") @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-01T15:45:33.268+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-01T15:45:33.268+05:30") @Data @AllArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/ContractRequest.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/ContractRequest.java index 6ac542dd55..455357a4ab 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/ContractRequest.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/ContractRequest.java @@ -5,14 +5,14 @@ import org.egov.common.contract.request.RequestInfo; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; /** * ContractRequest */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-01T15:45:33.268+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-01T15:45:33.268+05:30") @Getter @Setter diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/ContractResponse.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/ContractResponse.java index 48a8c7794d..187683229b 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/ContractResponse.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/ContractResponse.java @@ -8,7 +8,7 @@ import org.egov.common.contract.response.ResponseInfo; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; +import jakarta.validation.Valid; import java.util.ArrayList; import java.util.List; @@ -16,7 +16,7 @@ * ContractResponse */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-01T15:45:33.268+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-01T15:45:33.268+05:30") @Data @AllArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Document.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Document.java index 74c7845c57..35539c6e2d 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Document.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Document.java @@ -10,15 +10,15 @@ import lombok.NoArgsConstructor; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Size; /** * This object holds list of documents attached during the transaciton for a property */ @ApiModel(description = "This object holds list of documents attached during the transaciton for a property") @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-01T15:45:33.268+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-01T15:45:33.268+05:30") @Data @AllArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Estimate.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Estimate.java index c1f48bda30..a5030cdd28 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Estimate.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Estimate.java @@ -17,9 +17,9 @@ -import javax.validation.Valid; +import jakarta.validation.Valid; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.Size; import java.math.BigDecimal; @@ -37,7 +37,7 @@ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-12-30T13:05:25.880+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-12-30T13:05:25.880+05:30") diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/EstimateDetail.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/EstimateDetail.java index fad49ce261..d124a72ad0 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/EstimateDetail.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/EstimateDetail.java @@ -5,8 +5,8 @@ import lombok.*; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Size; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -15,7 +15,7 @@ * EstimateDetail */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-12-30T13:05:25.880+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-12-30T13:05:25.880+05:30") @Getter @Setter diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/EstimateRequest.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/EstimateRequest.java index 194d45a5f6..e759608147 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/EstimateRequest.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/EstimateRequest.java @@ -6,14 +6,14 @@ import org.egov.common.contract.request.RequestInfo; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; +import jakarta.validation.Valid; /** * Request for Estimate _create and _update api's */ @ApiModel(description = "Request for Estimate _create and _update api's") @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-12-30T13:05:25.880+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-12-30T13:05:25.880+05:30") @Getter @Setter diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/EstimateResponse.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/EstimateResponse.java index cc3ad59502..377bfca130 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/EstimateResponse.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/EstimateResponse.java @@ -6,7 +6,7 @@ import org.egov.common.contract.response.ResponseInfo; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; +import jakarta.validation.Valid; import java.util.ArrayList; import java.util.List; @@ -15,7 +15,7 @@ */ @ApiModel(description = "Response for the Estimate _create, _update and _search api's") @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-12-30T13:05:25.880+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-12-30T13:05:25.880+05:30") @Getter @Setter diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Function.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Function.java index 994a7f054b..7bd88a785b 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Function.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Function.java @@ -11,8 +11,8 @@ import org.egov.works.models.enums.ApplicationStatus; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Size; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -22,7 +22,7 @@ */ @ApiModel(description = "Represents the functions of an organisation") @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-15T14:49:42.141+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-15T14:49:42.141+05:30") @Data @AllArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Identifier.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Identifier.java index 2854c0a855..3ea542ec07 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Identifier.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Identifier.java @@ -9,15 +9,15 @@ import lombok.NoArgsConstructor; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Size; /** * Object to capture tax identifiers for a organisation */ @ApiModel(description = "Object to capture tax identifiers for a organisation") @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-15T14:49:42.141+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-15T14:49:42.141+05:30") @Data @AllArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/IndividualEntry.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/IndividualEntry.java index 3b151d0677..e73c1dacd9 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/IndividualEntry.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/IndividualEntry.java @@ -5,7 +5,7 @@ import lombok.*; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; +import jakarta.validation.Valid; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -14,7 +14,7 @@ * IndividualEntry */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-14T19:58:09.415+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-14T19:58:09.415+05:30") @Getter @Setter diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Jurisdiction.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Jurisdiction.java index 2d67b1798d..54a494abcf 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Jurisdiction.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Jurisdiction.java @@ -9,7 +9,7 @@ import lombok.NoArgsConstructor; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; +import jakarta.validation.Valid; @ApiModel(description = "Organisation Jurisdiction") @Validated diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/LineItem.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/LineItem.java index 971448d328..6b8ec4aa77 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/LineItem.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/LineItem.java @@ -2,9 +2,9 @@ import java.math.BigDecimal; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import org.egov.works.models.enums.LineItemType; @@ -23,7 +23,7 @@ * Line items are the amount breakups for net amounts */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-02T17:49:59.877+05:30[Asia/Kolkata]") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-02T17:49:59.877+05:30[Asia/Kolkata]") @Data @AllArgsConstructor @NoArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/LineItems.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/LineItems.java index 0affa1afa0..1553ae2df9 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/LineItems.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/LineItems.java @@ -9,9 +9,9 @@ import org.egov.works.models.Status; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import java.util.ArrayList; import java.util.List; @@ -20,7 +20,7 @@ */ @ApiModel(description = "Overide the negotiated amounts from line items of the estimate") @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-01T15:45:33.268+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-01T15:45:33.268+05:30") @Data @AllArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Measure.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Measure.java index 97c7512325..8c35d479e8 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Measure.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Measure.java @@ -9,9 +9,9 @@ import lombok.NoArgsConstructor; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -20,7 +20,7 @@ * Entity captures dimensions for a work item measurement */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-09-14T11:43:34.268+05:30[Asia/Calcutta]") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-09-14T11:43:34.268+05:30[Asia/Calcutta]") @Data @AllArgsConstructor @NoArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Measurement.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Measurement.java index 5b6b44d6f5..a13a6014ea 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Measurement.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Measurement.java @@ -6,9 +6,9 @@ import lombok.*; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -17,7 +17,7 @@ * This defines a measurement with or without detailed measures. */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-09-14T11:43:34.268+05:30[Asia/Calcutta]") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-09-14T11:43:34.268+05:30[Asia/Calcutta]") @Data @AllArgsConstructor @NoArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/MeasurementService.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/MeasurementService.java index 8b92f1c290..d116a1f9f9 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/MeasurementService.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/MeasurementService.java @@ -7,7 +7,7 @@ * MeasurementRegistry */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-09-15T11:39:57.604+05:30[Asia/Calcutta]") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-09-15T11:39:57.604+05:30[Asia/Calcutta]") @Data @AllArgsConstructor @NoArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/MeasurementServiceRequest.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/MeasurementServiceRequest.java index cd90d1b214..fb9682e8b0 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/MeasurementServiceRequest.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/MeasurementServiceRequest.java @@ -9,8 +9,8 @@ import org.egov.common.contract.request.RequestInfo; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Size; import java.util.ArrayList; import java.util.List; @@ -19,7 +19,7 @@ */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-09-15T11:39:57.604+05:30[Asia/Calcutta]") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-09-15T11:39:57.604+05:30[Asia/Calcutta]") @Data @AllArgsConstructor @NoArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/MusterRoll.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/MusterRoll.java index 1b67f4c91f..3fd8871f85 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/MusterRoll.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/MusterRoll.java @@ -6,7 +6,7 @@ import lombok.*; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; +import jakarta.validation.Valid; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -15,7 +15,7 @@ * MusterRoll */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-14T19:58:09.415+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-14T19:58:09.415+05:30") @Getter @Setter diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/MusterRollRequest.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/MusterRollRequest.java index b0a464ada6..ed4de6d374 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/MusterRollRequest.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/MusterRollRequest.java @@ -5,13 +5,13 @@ import org.egov.common.contract.request.RequestInfo; import org.springframework.validation.annotation.Validated; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; /** * MusterRollRequest */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-14T19:58:09.415+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-11-14T19:58:09.415+05:30") @Getter @Setter diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/OrgRequest.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/OrgRequest.java index 3976c542bf..39e8b82969 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/OrgRequest.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/OrgRequest.java @@ -12,7 +12,7 @@ * OrgRequest */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-15T14:49:42.141+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-15T14:49:42.141+05:30") @Data @AllArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/OrgSearchCriteria.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/OrgSearchCriteria.java index 133aca7c0f..e551f77e9d 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/OrgSearchCriteria.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/OrgSearchCriteria.java @@ -8,7 +8,7 @@ import lombok.NoArgsConstructor; import org.springframework.validation.annotation.Validated; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.Size; import java.util.ArrayList; import java.util.List; @@ -17,7 +17,7 @@ */ @ApiModel(description = "organisation search attributes") @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-15T14:49:42.141+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-15T14:49:42.141+05:30") @Data @AllArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/OrgSearchRequest.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/OrgSearchRequest.java index 7b0225f9b8..ce3a8ff111 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/OrgSearchRequest.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/OrgSearchRequest.java @@ -12,7 +12,7 @@ * OrgSearchRequest */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-15T14:49:42.141+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-15T14:49:42.141+05:30") @Data @AllArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/OrgServiceResponse.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/OrgServiceResponse.java index 53cfec0b71..7597e1b8d7 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/OrgServiceResponse.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/OrgServiceResponse.java @@ -9,7 +9,7 @@ import org.egov.common.contract.response.ResponseInfo; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; +import jakarta.validation.Valid; import java.util.ArrayList; import java.util.List; @@ -17,7 +17,7 @@ * OrgServiceResponse */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-15T14:49:42.141+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-15T14:49:42.141+05:30") @Data @AllArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Organisation.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Organisation.java index 2d29119eb7..151e375d01 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Organisation.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Organisation.java @@ -10,9 +10,9 @@ import org.egov.works.models.enums.ApplicationStatus; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -22,7 +22,7 @@ */ @ApiModel(description = "Organisation registry") @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-15T14:49:42.141+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-15T14:49:42.141+05:30") @Data @AllArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Pagination.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Pagination.java index 94cc05e5e5..67cc9046de 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Pagination.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Pagination.java @@ -1,6 +1,6 @@ package org.egov.works.models; -import javax.validation.Valid; +import jakarta.validation.Valid; import org.egov.tracer.model.CustomException; import org.springframework.validation.annotation.Validated; @@ -17,7 +17,7 @@ * Pagination details */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-02T17:49:59.877+05:30[Asia/Kolkata]") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-02T17:49:59.877+05:30[Asia/Kolkata]") @Data @AllArgsConstructor @NoArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Party.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Party.java index 60ced62fa6..c52352f0ca 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Party.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Party.java @@ -1,8 +1,8 @@ package org.egov.works.models; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import org.springframework.validation.annotation.Validated; @@ -21,7 +21,7 @@ */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-02T17:49:59.877+05:30[Asia/Kolkata]") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-02T17:49:59.877+05:30[Asia/Kolkata]") @Data @AllArgsConstructor @NoArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Project.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Project.java index bf11898bf2..3895697551 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Project.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Project.java @@ -7,7 +7,7 @@ import lombok.*; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; +import jakarta.validation.Valid; import java.util.ArrayList; import java.util.List; @@ -16,7 +16,7 @@ */ @ApiModel(description = "The purpose of this object to define the Project for a geography and period") @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-12-08T16:20:57.141+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-12-08T16:20:57.141+05:30") @Getter @Setter diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/PurchaseBill.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/PurchaseBill.java index 1bcad03519..fee3447fbe 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/PurchaseBill.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/PurchaseBill.java @@ -9,9 +9,9 @@ import lombok.NoArgsConstructor; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -21,7 +21,7 @@ */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-11T13:19:59.852+05:30[Asia/Kolkata]") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-11T13:19:59.852+05:30[Asia/Kolkata]") @Data @AllArgsConstructor @NoArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/PurchaseBillRequest.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/PurchaseBillRequest.java index d47d2e4e2b..045584aac1 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/PurchaseBillRequest.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/PurchaseBillRequest.java @@ -8,13 +8,13 @@ import org.egov.common.contract.request.RequestInfo; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; +import jakarta.validation.Valid; /** * PurchaseBillRequest */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-17T16:59:23.221+05:30[Asia/Kolkata]") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-04-17T16:59:23.221+05:30[Asia/Kolkata]") @Data @AllArgsConstructor @NoArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Target.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Target.java index 8f0b0e5e3a..d056f3b74d 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Target.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Target.java @@ -10,7 +10,7 @@ * Target */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-12-08T16:20:57.141+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2022-12-08T16:20:57.141+05:30") @Getter @Setter diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Workflow.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Workflow.java index 54d6460ad2..3f2f59dbce 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Workflow.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/Workflow.java @@ -8,8 +8,8 @@ import lombok.NoArgsConstructor; import org.springframework.validation.annotation.Validated; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; import java.util.ArrayList; import java.util.List; @@ -17,7 +17,7 @@ * Workflow */ @Validated -@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-01T15:45:33.268+05:30") +@jakarta.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-02-01T15:45:33.268+05:30") @Data @AllArgsConstructor diff --git a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/enums/PaymentStatus.java b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/enums/PaymentStatus.java index e10b1a9bfe..1cd2d77310 100644 --- a/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/enums/PaymentStatus.java +++ b/reference-adapters/sms-adapter/src/main/java/org/egov/works/models/enums/PaymentStatus.java @@ -1,6 +1,6 @@ package org.egov.works.models.enums; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; From b90be2aa7a3e15f466469a77ab9784b6fe31bd80 Mon Sep 17 00:00:00 2001 From: manastanmay-eGov <118505430+manastanmay-eGov@users.noreply.github.com> Date: Wed, 4 Dec 2024 14:18:26 +0530 Subject: [PATCH 5/6] Update build-config.yml --- build/build-config.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build/build-config.yml b/build/build-config.yml index 8a43979d46..fbe3cbf2ab 100644 --- a/build/build-config.yml +++ b/build/build-config.yml @@ -313,6 +313,11 @@ config: build: - work-dir: "backend/egov-notification-sms" image-name: "egov-notification-sms" - dockerfile: "build/maven-java17/Dockerfile" + dockerfile: "build/maven-java17/Dockerfile" + - name: "builds/mukta_impl/reference-adapters/sms-adapter" + build: + - work-dir: "reference-adapters/sms-adapter" + dockerfile: "build/maven-java17/Dockerfile" + image-name: "sms-adapter" From a6077ea44609b4d675afdbbbb954ff91fde0472d Mon Sep 17 00:00:00 2001 From: manastanmay-eGov <118505430+manastanmay-eGov@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:34:00 +0530 Subject: [PATCH 6/6] Removed maven- java 8 config --- build/build-config.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build/build-config.yml b/build/build-config.yml index fbe3cbf2ab..c8db139185 100644 --- a/build/build-config.yml +++ b/build/build-config.yml @@ -235,12 +235,6 @@ config: - work-dir: "reference-adapters/ifms-adapter/src/main/resources/db" image-name: "ifms-adapter-db" - - name: "builds/mukta_impl/reference-adapters/sms-adapter" - build: - - work-dir: "reference-adapters/sms-adapter" - dockerfile: "build/maven/Dockerfile" - image-name: "sms-adapter" - # mukta - name: "builds/mukta_impl/mukta/mukta-contracts" build: