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,46 +4,36 @@ import java.math.BigDecimal;
import java.util.List;
public class DashboardResponse {
private BigDecimal totalRevenue;
private Long totalSales;
private Long totalCustomers;
private Long totalProducts;
private List<DailySales> dailySales;
private SalesSummary salesSummary;
private InventorySummary inventorySummary;
private List<TopProduct> topProducts;
private List<DailySales> dailySales;
public DashboardResponse() {
}
public BigDecimal getTotalRevenue() {
return totalRevenue;
public SalesSummary getSalesSummary() {
return salesSummary;
}
public void setTotalRevenue(BigDecimal totalRevenue) {
this.totalRevenue = totalRevenue;
public void setSalesSummary(SalesSummary salesSummary) {
this.salesSummary = salesSummary;
}
public Long getTotalSales() {
return totalSales;
public InventorySummary getInventorySummary() {
return inventorySummary;
}
public void setTotalSales(Long totalSales) {
this.totalSales = totalSales;
public void setInventorySummary(InventorySummary inventorySummary) {
this.inventorySummary = inventorySummary;
}
public Long getTotalCustomers() {
return totalCustomers;
public List<TopProduct> getTopProducts() {
return topProducts;
}
public void setTotalCustomers(Long totalCustomers) {
this.totalCustomers = totalCustomers;
}
public Long getTotalProducts() {
return totalProducts;
}
public void setTotalProducts(Long totalProducts) {
this.totalProducts = totalProducts;
public void setTopProducts(List<TopProduct> topProducts) {
this.topProducts = topProducts;
}
public List<DailySales> getDailySales() {
@@ -54,11 +44,78 @@ public class DashboardResponse {
this.dailySales = dailySales;
}
public List<TopProduct> getTopProducts() {
return topProducts;
public static class SalesSummary {
private BigDecimal totalRevenue;
private Long totalSales;
private BigDecimal totalRefunds;
private Long totalRefundCount;
public SalesSummary() {
}
public BigDecimal getTotalRevenue() {
return totalRevenue;
}
public void setTotalRevenue(BigDecimal totalRevenue) {
this.totalRevenue = totalRevenue;
}
public Long getTotalSales() {
return totalSales;
}
public void setTotalSales(Long totalSales) {
this.totalSales = totalSales;
}
public BigDecimal getTotalRefunds() {
return totalRefunds;
}
public void setTotalRefunds(BigDecimal totalRefunds) {
this.totalRefunds = totalRefunds;
}
public Long getTotalRefundCount() {
return totalRefundCount;
}
public void setTotalRefundCount(Long totalRefundCount) {
this.totalRefundCount = totalRefundCount;
}
}
public void setTopProducts(List<TopProduct> topProducts) {
this.topProducts = topProducts;
public static class InventorySummary {
private Long totalProducts;
private Long lowStockProducts;
private Long outOfStockProducts;
public InventorySummary() {
}
public Long getTotalProducts() {
return totalProducts;
}
public void setTotalProducts(Long totalProducts) {
this.totalProducts = totalProducts;
}
public Long getLowStockProducts() {
return lowStockProducts;
}
public void setLowStockProducts(Long lowStockProducts) {
this.lowStockProducts = lowStockProducts;
}
public Long getOutOfStockProducts() {
return outOfStockProducts;
}
public void setOutOfStockProducts(Long outOfStockProducts) {
this.outOfStockProducts = outOfStockProducts;
}
}
}

View File

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

View File

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