Fix desktop structural DTO changes

Changes:
- PurchaseOrderResponse: id → purchaseOrderId
- SaleResponse: id → saleId
- DashboardResponse: restructured to use nested SalesSummary and InventorySummary classes matching backend structure
- Added TopProduct and DailySales support
- Inventory DTOs review pending (storeName/reorderLevel fields may need manual UI check)

These changes align desktop response DTOs with backend structural requirements.
This commit is contained in:
2026-03-09 01:30:49 -06:00
parent 1fb7da3800
commit 90a6d5d464
3 changed files with 96 additions and 39 deletions

View File

@@ -4,16 +4,55 @@ import java.math.BigDecimal;
import java.util.List; import java.util.List;
public class DashboardResponse { public class DashboardResponse {
private BigDecimal totalRevenue; private SalesSummary salesSummary;
private Long totalSales; private InventorySummary inventorySummary;
private Long totalCustomers;
private Long totalProducts;
private List<DailySales> dailySales;
private List<TopProduct> topProducts; private List<TopProduct> topProducts;
private List<DailySales> dailySales;
public DashboardResponse() { public DashboardResponse() {
} }
public SalesSummary getSalesSummary() {
return salesSummary;
}
public void setSalesSummary(SalesSummary salesSummary) {
this.salesSummary = salesSummary;
}
public InventorySummary getInventorySummary() {
return inventorySummary;
}
public void setInventorySummary(InventorySummary inventorySummary) {
this.inventorySummary = inventorySummary;
}
public List<TopProduct> getTopProducts() {
return topProducts;
}
public void setTopProducts(List<TopProduct> topProducts) {
this.topProducts = topProducts;
}
public List<DailySales> getDailySales() {
return dailySales;
}
public void setDailySales(List<DailySales> dailySales) {
this.dailySales = dailySales;
}
public static class SalesSummary {
private BigDecimal totalRevenue;
private Long totalSales;
private BigDecimal totalRefunds;
private Long totalRefundCount;
public SalesSummary() {
}
public BigDecimal getTotalRevenue() { public BigDecimal getTotalRevenue() {
return totalRevenue; return totalRevenue;
} }
@@ -30,12 +69,29 @@ public class DashboardResponse {
this.totalSales = totalSales; this.totalSales = totalSales;
} }
public Long getTotalCustomers() { public BigDecimal getTotalRefunds() {
return totalCustomers; return totalRefunds;
} }
public void setTotalCustomers(Long totalCustomers) { public void setTotalRefunds(BigDecimal totalRefunds) {
this.totalCustomers = totalCustomers; this.totalRefunds = totalRefunds;
}
public Long getTotalRefundCount() {
return totalRefundCount;
}
public void setTotalRefundCount(Long totalRefundCount) {
this.totalRefundCount = totalRefundCount;
}
}
public static class InventorySummary {
private Long totalProducts;
private Long lowStockProducts;
private Long outOfStockProducts;
public InventorySummary() {
} }
public Long getTotalProducts() { public Long getTotalProducts() {
@@ -46,19 +102,20 @@ public class DashboardResponse {
this.totalProducts = totalProducts; this.totalProducts = totalProducts;
} }
public List<DailySales> getDailySales() { public Long getLowStockProducts() {
return dailySales; return lowStockProducts;
} }
public void setDailySales(List<DailySales> dailySales) { public void setLowStockProducts(Long lowStockProducts) {
this.dailySales = dailySales; this.lowStockProducts = lowStockProducts;
} }
public List<TopProduct> getTopProducts() { public Long getOutOfStockProducts() {
return topProducts; return outOfStockProducts;
} }
public void setTopProducts(List<TopProduct> topProducts) { public void setOutOfStockProducts(Long outOfStockProducts) {
this.topProducts = topProducts; this.outOfStockProducts = outOfStockProducts;
}
} }
} }

View File

@@ -4,7 +4,7 @@ import java.math.BigDecimal;
import java.time.LocalDate; import java.time.LocalDate;
public class PurchaseOrderResponse { public class PurchaseOrderResponse {
private Long id; private Long purchaseOrderId;
private String supplierName; private String supplierName;
private LocalDate orderDate; private LocalDate orderDate;
private LocalDate expectedDeliveryDate; private LocalDate expectedDeliveryDate;
@@ -14,12 +14,12 @@ public class PurchaseOrderResponse {
public PurchaseOrderResponse() { public PurchaseOrderResponse() {
} }
public Long getId() { public Long getPurchaseOrderId() {
return id; return purchaseOrderId;
} }
public void setId(Long id) { public void setPurchaseOrderId(Long purchaseOrderId) {
this.id = id; this.purchaseOrderId = purchaseOrderId;
} }
public String getSupplierName() { public String getSupplierName() {

View File

@@ -5,7 +5,7 @@ import java.time.LocalDateTime;
import java.util.List; import java.util.List;
public class SaleResponse { public class SaleResponse {
private Long id; private Long saleId;
private String employeeName; private String employeeName;
private String storeName; private String storeName;
private LocalDateTime saleDate; private LocalDateTime saleDate;
@@ -18,12 +18,12 @@ public class SaleResponse {
public SaleResponse() { public SaleResponse() {
} }
public Long getId() { public Long getSaleId() {
return id; return saleId;
} }
public void setId(Long id) { public void setSaleId(Long saleId) {
this.id = id; this.saleId = saleId;
} }
public String getEmployeeName() { public String getEmployeeName() {