From 861c40fa39d75eda0c28856a15ac4c12c548b5b9 Mon Sep 17 00:00:00 2001 From: himeshr Date: Tue, 21 May 2024 17:13:18 +0530 Subject: [PATCH] #124 | Include AvniImplementationInventory field in for DistributionLineItem, while posting Distribution upsert request. --- .../goonj/dto/DistributionLine.java | 16 +++++++++++++++- .../goonj/repository/DistributionRepository.java | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/goonj/src/main/java/org/avni_integration_service/goonj/dto/DistributionLine.java b/goonj/src/main/java/org/avni_integration_service/goonj/dto/DistributionLine.java index 7e16e1c6..9c8d4382 100644 --- a/goonj/src/main/java/org/avni_integration_service/goonj/dto/DistributionLine.java +++ b/goonj/src/main/java/org/avni_integration_service/goonj/dto/DistributionLine.java @@ -10,6 +10,7 @@ "sourceId", "distributedTo", "implementationInventoryId", + "avniImplementationInventory", "quantity", "unit" }) @@ -21,6 +22,8 @@ public class DistributionLine { private String distributedTo; @JsonProperty("implementationInventoryId") private String implementationInventoryId; + @JsonProperty("avniImplementationInventory") + private String avniImplementationInventory; @JsonProperty("quantity") private int quantity; @JsonProperty("unit") @@ -40,14 +43,17 @@ public DistributionLine() { * @param quantity * @param unit * @param implementationInventoryId + * @param avniImplementationInventory */ - public DistributionLine(String sourceId, String distributedTo, String implementationInventoryId, int quantity, String unit) { + public DistributionLine(String sourceId, String distributedTo, String implementationInventoryId, int quantity, String unit, + String avniImplementationInventory) { super(); this.sourceId = sourceId; this.distributedTo = distributedTo; this.implementationInventoryId = implementationInventoryId; this.quantity = quantity; this.unit = unit; + this.avniImplementationInventory = avniImplementationInventory; } @JsonProperty("sourceId") @@ -74,6 +80,14 @@ public String getimplementationInventoryId() { public void setimplementationInventoryId(String implementationInventoryId) { this.implementationInventoryId = implementationInventoryId; } + @JsonProperty("avniImplementationInventory") + public String getAvniImplementationInventory() { + return avniImplementationInventory; + } + @JsonProperty("avniImplementationInventory") + public void setAvniImplementationInventory(String avniImplementationInventory) { + this.avniImplementationInventory = avniImplementationInventory; + } @JsonProperty("quantity") public int getQuantity() { return quantity; diff --git a/goonj/src/main/java/org/avni_integration_service/goonj/repository/DistributionRepository.java b/goonj/src/main/java/org/avni_integration_service/goonj/repository/DistributionRepository.java index df5f8c5d..11ab5296 100644 --- a/goonj/src/main/java/org/avni_integration_service/goonj/repository/DistributionRepository.java +++ b/goonj/src/main/java/org/avni_integration_service/goonj/repository/DistributionRepository.java @@ -184,7 +184,7 @@ private DistributionLine createDistributionLine(HashMap entry, S String distributedTo = (String) entry.get(DISTRIBUTED_TO); String unit = (String) inventorySubject.getObservation(UNIT); int quantity = (Integer) entry.get(QUANTITY); - return new DistributionLine(sourceId, distributedTo, inventoryExternalId, quantity, unit); + return new DistributionLine(sourceId, distributedTo, inventoryExternalId, quantity, unit, inventorySubject.getUuid()); } private List fetchActivities(Subject subject) {