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; 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 BigDecimal getTotalRevenue() { public SalesSummary getSalesSummary() {
return totalRevenue; return salesSummary;
} }
public void setTotalRevenue(BigDecimal totalRevenue) { public void setSalesSummary(SalesSummary salesSummary) {
this.totalRevenue = totalRevenue; this.salesSummary = salesSummary;
} }
public Long getTotalSales() { public InventorySummary getInventorySummary() {
return totalSales; return inventorySummary;
} }
public void setTotalSales(Long totalSales) { public void setInventorySummary(InventorySummary inventorySummary) {
this.totalSales = totalSales; this.inventorySummary = inventorySummary;
} }
public Long getTotalCustomers() { public List<TopProduct> getTopProducts() {
return totalCustomers; return topProducts;
} }
public void setTotalCustomers(Long totalCustomers) { public void setTopProducts(List<TopProduct> topProducts) {
this.totalCustomers = totalCustomers; this.topProducts = topProducts;
}
public Long getTotalProducts() {
return totalProducts;
}
public void setTotalProducts(Long totalProducts) {
this.totalProducts = totalProducts;
} }
public List<DailySales> getDailySales() { public List<DailySales> getDailySales() {
@@ -54,11 +44,78 @@ public class DashboardResponse {
this.dailySales = dailySales; this.dailySales = dailySales;
} }
public List<TopProduct> getTopProducts() { public static class SalesSummary {
return topProducts; 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) { public static class InventorySummary {
this.topProducts = topProducts; 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; 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() {