Add analytics functionality for stores

This commit is contained in:
2026-10-08 16:28:56 +05:30
parent dd8f50f54c
commit 4e12b03e4b
5 changed files with 141 additions and 0 deletions
+37
View File
@@ -59,3 +59,40 @@ public record SchemeEligibilityResponse(bool Eligible, string? Reason);
public record PatchStoreStatusRequest(bool IsActive);
public record StoreDashboardResponse(Guid StoreId, string Period, int OrderCount, decimal TotalOrderValue, DateTime? LastOrderDate);
public record StoreAnalyticsSummary(
decimal TotalSales,
decimal TotalCollected,
decimal Outstanding,
decimal OverdueAmount,
int OverdueInvoiceCount,
int InvoiceCount,
decimal AverageOrderValue,
DateTime? LastSaleDate,
decimal CreditLimit,
decimal CreditUtilizationPercent);
public record StoreMonthlySales(string Month, decimal Invoiced, decimal Collected, decimal Outstanding);
public record StoreTopProduct(Guid ItemId, string Name, int Quantity, decimal Revenue, DateTime LastSoldAt);
public record StoreAgeingBucket(string Label, decimal Amount, int InvoiceCount);
public record StoreAnalyticsInvoice(
Guid InvoiceId,
DateTime InvoiceDate,
DateTime DueDate,
decimal TotalAmount,
decimal PaidAmount,
decimal Balance,
string PaymentStatus,
int DaysOverdue);
public record StoreAnalyticsResponse(
Guid StoreId,
int OverdueDays,
StoreAnalyticsSummary Summary,
List<StoreMonthlySales> MonthlySales,
List<StoreTopProduct> TopProducts,
List<StoreAgeingBucket> Ageing,
List<StoreAnalyticsInvoice> Invoices);