Skip to content

Commit

Permalink
2.8 release code (#61)
Browse files Browse the repository at this point in the history
* 2.8 release code

* sewerage code added
  • Loading branch information
kavi-egov committed Feb 16, 2023
1 parent 2f4fc0f commit 1cfce1d
Show file tree
Hide file tree
Showing 2,026 changed files with 159,497 additions and 13,024 deletions.
12 changes: 10 additions & 2 deletions build/build-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,14 @@ config:
dockerfile: "build/maven/Dockerfile"
- work-dir: "municipal-services/birth-death-services/src/main/resources/db"
image-name: "birth-death-services-db"

- name: "builds/digit-dev/municipal-services/birth-registration"
build:
- work-dir: "municipal-services/birth-registration"
image-name: "birth-registration"
dockerfile: "build/maven/Dockerfile"
- work-dir: "municipal-services/birth-registration/src/main/resources/db"
image-name: "birth-registration-db"

# Utilities

Expand Down Expand Up @@ -670,7 +678,7 @@ config:
build:
- work-dir: "utilities/demo-utility"
image-name: "demo-utility"
dockerfile: "build/maven/Dockerfile"
dockerfile: "build/maven/Dockerfile"

# Frontend

Expand Down Expand Up @@ -749,4 +757,4 @@ config:
- work-dir: finance/egov
image-name: egov-finance
dockerfile: finance/Dockerfile

6 changes: 3 additions & 3 deletions build/maven/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#FROM egovio/alpine-maven-builder-jdk-8:1-master-NA-6036091e AS build
FROM ghcr.io/egovernments/alpine-maven-builder-jdk-8:1-master-na-6036091e AS build
FROM egovio/alpine-maven-builder-jdk-8:1-master-NA-6036091e AS build
# FROM ghcr.io/egovernments/alpine-maven-builder-jdk-8:1-master-na-6036091e AS build
ARG WORK_DIR
WORKDIR /app

Expand All @@ -26,4 +26,4 @@ COPY --from=build /app/target/*.jar /app/start.sh /opt/egov/

RUN chmod +x /opt/egov/start.sh

CMD ["/opt/egov/start.sh"]
CMD ["/opt/egov/start.sh"]
10 changes: 9 additions & 1 deletion business-services/billing-service/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@

All notable changes to this module will be documented in this file.
## 1.3.4 - 2022-01-13
## 1.3.5 - 2023-02-01

- Transition from 1.3.5-beta version to 1.3.5 version

## 1.3.5-beta - 2022-11-13
- Amendment Query bug fix

## 1.3.4 - 2022-01-04
- Updated to log4j2 version 2.17.1

## 1.3.3 - 2021-07-26

- Earliest bill search
Expand Down
2 changes: 1 addition & 1 deletion business-services/billing-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ NA

### Swagger API Contract

https://raw.githubusercontent.com/egovernments/DIGIT-OSS/master/business-services/Docs/billingservice/V-2.0.yml
https://raw.githubusercontent.com/egovernments/business-services/master/Docs/billingservice/V-2.0.yml

## Service Details

Expand Down
23 changes: 8 additions & 15 deletions business-services/billing-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</parent>
<groupId>com.egov.demand</groupId>
<artifactId>billing-service</artifactId>
<version>1.3.4-SNAPSHOT</version>
<version>1.3.5-SNAPSHOT</version>
<name>billing-service</name>
<description>Demo project for Spring Boot</description>
<properties>
Expand All @@ -30,6 +30,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>5.2.20.RELEASE</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
Expand All @@ -47,18 +52,6 @@
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.6.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.6.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
Expand Down Expand Up @@ -86,12 +79,12 @@
<dependency>
<groupId>org.egov.services</groupId>
<artifactId>services-common</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.1.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.egov.services</groupId>
<artifactId>tracer</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>2.1.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,5 @@ public Action addRolesItem(String rolesItem) {
this.roles.add(rolesItem);
return this;
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@
import java.util.HashSet;
import java.util.Set;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

import org.egov.demand.amendment.model.enums.AmendmentStatus;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Builder.Default;
Expand All @@ -64,12 +63,19 @@ public class AmendmentCriteria {
private String tenantId;

private String amendmentId;

@Min(0)
private Integer offset;

@Min(1)
private Integer limit;

@Default
private Set<String> consumerCode = new HashSet<>();

@NotNull
private String businessService;

private AmendmentStatus status;
@Default
private Set<String> status = new HashSet<>();
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import javax.validation.Valid;
import javax.validation.constraints.NotNull;

import org.egov.demand.amendment.model.enums.AmendmentReason;
import org.egov.demand.amendment.model.enums.AmendmentStatus;
import org.egov.demand.model.AuditDetails;

Expand Down Expand Up @@ -53,7 +54,20 @@ public class AmendmentUpdate {
@JsonProperty("documents")
@Valid
private List<Document> documents;


@NotNull
@JsonProperty("amendmentReason")
private AmendmentReason amendmentReason;

@JsonProperty("reasonDocumentNumber")
private String reasonDocumentNumber;

@JsonProperty("effectiveFrom")
private Long effectiveFrom;

@JsonProperty("effectiveTill")
private Long effectiveTill;

public AmendmentCriteria toSearchCriteria() {

return AmendmentCriteria.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@

package org.egov.demand.config;

import java.util.Map;

import lombok.Getter;
import lombok.ToString;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

import lombok.Getter;
import lombok.ToString;
import java.util.List;
import java.util.Map;

@Configuration
@Getter
Expand Down Expand Up @@ -192,5 +192,7 @@ public class ApplicationProperties {

@Value("${amendment.id.format.name}")
private String amendmentIdFormatName;


@Value("${statelevel.rolecode.excluded.list}")
private List<String> statelevelRolecodeExclusionList;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
package org.egov.demand.consumer;

import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

import org.egov.demand.model.BulkBillGenerator;
import org.egov.demand.model.Demand;
import org.egov.demand.model.GenerateBillCriteria;
import org.egov.demand.model.MigrationCount;
import org.egov.demand.service.BillServicev2;
import org.egov.demand.service.DemandService;
import org.egov.demand.web.contract.DemandRequest;
import org.egov.tracer.kafka.CustomKafkaTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.support.KafkaHeaders;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import com.fasterxml.jackson.databind.ObjectMapper;

import lombok.extern.slf4j.Slf4j;

@Service
@Slf4j
public class BulkBillGenerationConsumer {

@Autowired
private DemandService demandService;

@Autowired
private ObjectMapper objectMapper;

@Autowired
private BillServicev2 billService;

@Autowired
private CustomKafkaTemplate<String, Object> kafkaTemplate;

@KafkaListener(topics = { "${kafka.topics.bulk.bill.generation}" })
public void processMessage(Map<String, Object> consumerRecord, @Header(KafkaHeaders.RECEIVED_TOPIC) String topic) {

log.debug("key:" + topic + ":" + "value:" + consumerRecord);

BulkBillGenerator billGenerator = objectMapper.convertValue(consumerRecord, BulkBillGenerator.class);
DemandRequest request = DemandRequest.builder()
.requestInfo(billGenerator.getRequestInfo())
.demands(billGenerator.getCreateDemands())
.build();

log.info(" Billing-bulkbill-consumer-batch log for batch : " + billGenerator.getMigrationCount().getOffset()
+ " with no of records " + billGenerator.getCreateDemands().size());

try {
demandService.create(request);
} catch (Exception e) {
logError(" Demand creation ", e.getMessage(), billGenerator.getMigrationCount());
}

request.setDemands(billGenerator.getUpdateDemands());
try {
if (!CollectionUtils.isEmpty(billGenerator.getUpdateDemands()))
demandService.updateAsync(request, null);
} catch (Exception e) {
logError(" Demand update ", e.getMessage(), billGenerator.getMigrationCount());
}

Set<String> consumerCodes = billGenerator.getCreateDemands()
.stream()
.map(Demand::getConsumerCode)
.collect(Collectors.toSet());
String tenantId = billGenerator.getCreateDemands().get(0).getTenantId();
String businessService = billGenerator.getCreateDemands().get(0).getBusinessService();

GenerateBillCriteria genBillCriteria = GenerateBillCriteria.builder()
.consumerCode(consumerCodes)
.businessService(businessService)
.tenantId(tenantId)
.build();

try {
billService.generateBill(genBillCriteria, billGenerator.getRequestInfo());
} catch (Exception e) {
logError(" Bill Gen ", e.getMessage(), billGenerator.getMigrationCount());
}

MigrationCount migrationCount = billGenerator.getMigrationCount();
migrationCount.setAuditTime(System.currentTimeMillis());
migrationCount.setMessage("prcoess succeded in billing service");
kafkaTemplate.send(migrationCount.getAuditTopic(), billGenerator.getMigrationCount());
}

private void logError(String process, String message, MigrationCount bulkBillCount) {
bulkBillCount.setAuditTime(System.currentTimeMillis());
bulkBillCount.setMessage("prcoess failed in billing service during "+ process + " with error message : " + message);
kafkaTemplate.send(bulkBillCount.getAuditTopic(), bulkBillCount);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public class BillV2 {
@JsonProperty("id")
@Size(max = 256)
private String id;

@JsonProperty("userId")
private String userId;

@JsonProperty("mobileNumber")
@Pattern(regexp = "^[0-9]{10}$", message = "MobileNumber should be 10 digit number")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.egov.demand.model;

import java.util.List;

import org.egov.common.contract.request.RequestInfo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class BulkBillGenerator {

private RequestInfo requestInfo;

private List<Demand> createDemands;

private List<Demand> updateDemands;

private MigrationCount migrationCount;
}
Loading

0 comments on commit 1cfce1d

Please sign in to comment.