This repository has been archived by the owner on Nov 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #964 from egovernments/ISTE-345
ISTE-345: Added chnages to remove multiple call to fetch bill API .
- Loading branch information
Showing
4 changed files
with
202 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...-services/ws-calculator/src/main/java/org/egov/wscalculation/web/models/BillDetailV2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package org.egov.wscalculation.web.models; | ||
|
||
public class BillDetailV2 { | ||
} |
30 changes: 30 additions & 0 deletions
30
...ervices/ws-calculator/src/main/java/org/egov/wscalculation/web/models/BillResponseV2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package org.egov.wscalculation.web.models; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import org.egov.common.contract.response.ResponseInfo; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* BillResponse | ||
*/ | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
public class BillResponseV2 { | ||
|
||
@JsonProperty("ResposneInfo") | ||
private ResponseInfo resposneInfo = null; | ||
|
||
@JsonProperty("Bill") | ||
private List<BillV2> bill = new ArrayList<>(); | ||
|
||
} |
136 changes: 136 additions & 0 deletions
136
municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/web/models/BillV2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
package org.egov.wscalculation.web.models; | ||
|
||
import java.math.BigDecimal; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import javax.validation.Valid; | ||
import javax.validation.constraints.Pattern; | ||
import javax.validation.constraints.Size; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonValue; | ||
import com.fasterxml.jackson.databind.JsonNode; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
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") | ||
private String mobileNumber; | ||
|
||
@JsonProperty("payerName") | ||
@Size(max = 256) | ||
private String payerName; | ||
|
||
@JsonProperty("payerAddress") | ||
@Size(max = 1024) | ||
private String payerAddress; | ||
|
||
@JsonProperty("payerEmail") | ||
@Size(max = 256) | ||
private String payerEmail; | ||
|
||
@JsonProperty("status") | ||
private BillStatus status; | ||
|
||
@JsonProperty("totalAmount") | ||
private BigDecimal totalAmount; | ||
|
||
@JsonProperty("businessService") | ||
@Size(max = 256) | ||
private String businessService; | ||
|
||
@JsonProperty("billNumber") | ||
@Size(max = 256) | ||
private String billNumber; | ||
|
||
@JsonProperty("billDate") | ||
private Long billDate; | ||
|
||
@JsonProperty("consumerCode") | ||
@Size(max = 256) | ||
private String consumerCode; | ||
|
||
@JsonProperty("additionalDetails") | ||
private JsonNode additionalDetails; | ||
|
||
@JsonProperty("billDetails") | ||
@Valid | ||
private List<BillDetailV2> billDetails; | ||
|
||
@JsonProperty("tenantId") | ||
@Size(max = 256) | ||
private String tenantId; | ||
|
||
@JsonProperty("fileStoreId") | ||
private String fileStoreId; | ||
|
||
@JsonProperty("auditDetails") | ||
private AuditDetails auditDetails; | ||
|
||
/** | ||
* status of the bill . | ||
*/ | ||
public enum BillStatus { | ||
|
||
ACTIVE("ACTIVE"), | ||
|
||
CANCELLED("CANCELLED"), | ||
|
||
PAID("PAID"), | ||
|
||
PARTIALLY_PAID("PARTIALLY_PAID"), | ||
|
||
PAYMENT_CANCELLED("PAYMENT_CANCELLED"), | ||
|
||
EXPIRED("EXPIRED"); | ||
|
||
private String value; | ||
|
||
BillStatus(String value) { | ||
this.value = value; | ||
} | ||
|
||
@Override | ||
@JsonValue | ||
public String toString() { | ||
return String.valueOf(value); | ||
} | ||
|
||
@JsonCreator | ||
public static BillStatus fromValue(String text) { | ||
for (BillStatus b : BillStatus.values()) { | ||
if (String.valueOf(b.value).equalsIgnoreCase(text)) { | ||
return b; | ||
} | ||
} | ||
return null; | ||
} | ||
} | ||
|
||
public BillV2 addBillDetailsItem(BillDetailV2 billDetailsItem) { | ||
if (this.billDetails == null) { | ||
this.billDetails = new ArrayList<>(); | ||
} | ||
this.billDetails.add(billDetailsItem); | ||
return this; | ||
} | ||
} | ||
|