Skip to content

Commit

Permalink
vendor and e-challan changes (#128)
Browse files Browse the repository at this point in the history
* Implementation - Accumulated bill id for consumer code and payment by… (#111)

* Vendor Creation integration for challan create (#115)

* Rahu vendor env (#116)

* Adding role details to vendor's owner.

* PSPCL name in env variable

* removed unnecessary constant

* Update CODEOWNERS

* [DPG-698] Adding ifix-es-pipeline service (#117)

* Revert "[DPG-698] Adding ifix-es-pipeline service (#117)" (#129)

This reverts commit e5a2945.

Co-authored-by: rahu-eGov <[email protected]>
Co-authored-by: nikesh-eGov <[email protected]>
Co-authored-by: Shashwat Mishra <[email protected]>
  • Loading branch information
4 people authored Sep 13, 2022
1 parent 6428068 commit c0d4ad8
Show file tree
Hide file tree
Showing 87 changed files with 4,076 additions and 195 deletions.
26 changes: 26 additions & 0 deletions reference-adapter/mgramseva-ifix-adapter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<lombok.version>1.18.8</lombok.version>
<jackson-datatype-jsr310.version>2.10.5</jackson-datatype-jsr310.version>
<gson.version>2.8.9</gson.version>
<postgresql.version>42.3.3</postgresql.version>
</properties>
<dependencies>
<dependency>
Expand All @@ -40,6 +43,12 @@
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
<version>${postgresql.version}</version>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>6.4.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -61,6 +70,7 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
</dependency>

<dependency>
Expand All @@ -79,7 +89,23 @@
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson-datatype-jsr310.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-quartz</artifactId>
</dependency>
<dependency>
<groupId>org.egov</groupId>
<artifactId>mdms-client</artifactId>
<version>0.0.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.vladmihalcea</groupId>
<artifactId>hibernate-types-52</artifactId>
<version>2.12.1</version>
</dependency>

</dependencies>
<repositories>
<repository>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
package org.egov.ifix.controller;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

import javax.validation.Valid;

import lombok.extern.slf4j.Slf4j;
import org.egov.ifix.models.CoaMappingDTO;
import org.egov.ifix.models.Event;
import org.egov.ifix.models.EventRequest;
import org.egov.ifix.models.EventResponse;
import org.egov.ifix.service.ChartOfAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
Expand All @@ -19,15 +11,15 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import lombok.extern.slf4j.Slf4j;
import java.util.Optional;

@RestController
@Slf4j
@RequestMapping("/master/v1")
public class MasterDataController {
public class MasterDataController {

@Autowired
ChartOfAccountService chartOfAccountService;
private ChartOfAccountService chartOfAccountService;

/**
* @param coaMappingDTO
Expand All @@ -36,14 +28,13 @@ public class MasterDataController {
@PostMapping("/mapping/coa/search")
public ResponseEntity<CoaMappingDTO> coaMappingSearch(@RequestBody CoaMappingDTO coaMappingDTO) {

Optional<CoaMappingDTO> coaMappingDTOOptional = chartOfAccountService
.getMappedCoaIdByClientCoaCode(coaMappingDTO);
Optional<CoaMappingDTO> coaMappingDTOOptional = chartOfAccountService
.getMappedCoaIdByClientCoaCode(coaMappingDTO);

if (coaMappingDTOOptional.isPresent()) {
return new ResponseEntity<CoaMappingDTO>(coaMappingDTOOptional.get(), HttpStatus.ACCEPTED);
}else {
} else {
return new ResponseEntity(null, HttpStatus.BAD_REQUEST);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public ResponseEntity<?> exceptionHandler(HttpServletRequest request, Exception
Error error = new Error();
error.setCode(customException.getCode());
error.setMessage(customException.getMessage());
error.setDescription(customException.getDescription());
errorList.add(error);
}
errorResponse.setErrors(errorList);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class HttpCustomException extends RuntimeException{
private String message;
private Map<String, String> errors;
private HttpStatus httpStatus = null;
private String description;

public HttpCustomException() {
}
Expand All @@ -31,5 +32,10 @@ public HttpCustomException(Map<String, String> errors) {
this.errors = errors;
}


public HttpCustomException(String code, String message, String description, HttpStatus httpStatus) {
this.code = code;
this.message = message;
this.description = description;
this.httpStatus = httpStatus;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public List<FiscalEvent> transformData(JsonObject data) {
.referenceId(demandJO.get(ID).getAsString())
.parentEventId(null)
.parentReferenceId(null)
.amountDetails(getAmountDetails(demandJO, data)).build();
.amountDetails(getAmountDetails(demandJO)).build();

fiscalEventList.add(fiscalEvent);
});
Expand Down Expand Up @@ -99,12 +99,12 @@ public List<String> getReferenceIdList(JsonObject data) {
return referenceIdList;
}


/**
* @param demand
* @param data
* @return
*/
private List<Amount> getAmountDetails(JsonObject demand, JsonObject data) {
private List<Amount> getAmountDetails(JsonObject demand) {
List<Amount> amountList = new ArrayList<>();
Long taxPeriodFrom = demand.get(BILL_DEMAND_FROM_BILLING_PERIOD).getAsLong();
Long taxPeriodTo = demand.get(BILL_DEMAND_TO_BILLING_PERIOD).getAsLong();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.egov.ifix.models;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand All @@ -10,6 +11,9 @@
@AllArgsConstructor
@NoArgsConstructor
public class CoaMappingDTO {
@JsonProperty("clientCode")
private String clientCode;

@JsonProperty("iFixCoaCode")
private String iFixCoaCode;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
@EqualsAndHashCode
@RedisHash
public class KeyCloackData implements Serializable{
public String client_id;
public String client_secret;
public String grant_type;
public String access_token;
public Long expires_in;
public Long refresh_expires_in;
public String token_type;
public String scope;

private String client_id;
private String client_secret;
private String grant_type;
private String access_token;
private Long expires_in;
private Long refresh_expires_in;
private String token_type;
private String scope;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
package org.egov.ifix.models.fiscalEvent;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.egov.common.contract.AuditDetails;

import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class FiscalEvent {

@JsonProperty("version")
private String version = null;

@JsonProperty("id")
private String id = null;

@JsonProperty("tenantId")
private String tenantId = null;

@JsonProperty("sender")
private String sender = null;

@JsonProperty("receivers")
@Valid
private List<String> receivers = new ArrayList<>();

@JsonProperty("eventType")
private EventTypeEnum eventType = null;

@JsonProperty("ingestionTime")
private Long ingestionTime = null;

@JsonProperty("eventTime")
private Long eventTime = null;

@JsonProperty("referenceId")
private String referenceId = null;

@JsonProperty("linkedEventId")
private String linkedEventId = null;

@JsonProperty("linkedReferenceId")
private String linkedReferenceId = null;

@JsonProperty("amountDetails")
@Valid
private List<FiscalEventAmountDTO> amountDetails = new ArrayList<>();

@JsonProperty("auditDetails")
private AuditDetails auditDetails = null;

@JsonProperty("attributes")
private Object attributes = null;

public FiscalEvent addAmountDetailsItem(FiscalEventAmountDTO amountDetailsItem) {
this.amountDetails.add(amountDetailsItem);
return this;
}

public enum EventTypeEnum {
Sanction("SANCTION"),
Appropriation("APPROPRIATION"),
Allocation("ALLOCATION"),
Intra_Transfer("INTRA_TRANSFER"),
Inter_Transfer("INTER_TRANSFER"),
Demand("DEMAND"),
Receipt("RECEIPT"),
Bill("BILL"),
Payment("PAYMENT");

private String value;

EventTypeEnum(String value) {
this.value = value;
}

@JsonCreator
public static EventTypeEnum fromValue(String text) {
for (EventTypeEnum eventTypeEnum : EventTypeEnum.values()) {
if (String.valueOf(eventTypeEnum.value).equals(text)) {
return eventTypeEnum;
}
}
return null;
}

@Override
@JsonValue
public String toString() {
return name();
}
}

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package org.egov.ifix.models.fiscalEvent;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class FiscalEventAmountDTO {
@JsonProperty("id")
private String id = null;

@JsonProperty("amount")
private BigDecimal amount = null;

@JsonProperty("coaCode")
@JsonInclude(JsonInclude.Include.NON_NULL)
private String coaCode = null;

@JsonProperty("coaId")
@JsonInclude(JsonInclude.Include.NON_NULL)
private String coaId = null;

@JsonProperty("fromBillingPeriod")
private Long fromBillingPeriod = null;

@JsonProperty("toBillingPeriod")
private Long toBillingPeriod = null;


}

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.egov.ifix.models.fiscalEvent;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.egov.common.contract.response.ResponseHeader;

import javax.validation.Valid;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class FiscalEventResponseDTO {
@JsonProperty("responseHeader")
private ResponseHeader responseHeader = null;

@JsonProperty("fiscalEvent")
@Valid
private List<FiscalEvent> fiscalEvent = null;

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.egov.ifix.models.fiscalEvent;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.egov.common.contract.request.RequestHeader;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class FiscalEventSearchRequestDTO {
@JsonProperty("requestHeader")
private RequestHeader requestHeader = null;

@JsonProperty("criteria")
private FiscalSearchCriteriaDTO criteria = null;
}

Loading

0 comments on commit c0d4ad8

Please sign in to comment.