feat: Implement Day End Report feature logic

This commit is contained in:
2026-10-23 14:52:39 +05:30
parent c775146b64
commit 6674ba6aae
5 changed files with 224 additions and 0 deletions
@@ -0,0 +1,51 @@
using Distribution.Models;
namespace Distribution.Features.DayEndReport;
public record DayEndFilter(DateTime From, DateTime To);
public record DayEndRow(
string Date,
decimal TotalSales,
decimal Collected,
decimal Due,
decimal Cash,
decimal Cheque,
decimal Credit,
decimal Returns,
decimal Expenses,
decimal Income,
int InvoiceCount,
int PaymentCount,
decimal CashCollected,
decimal CashExpensesPaid,
decimal NetCash);
public record DayEndMethod(string Method, int Count, decimal Amount);
public record DayEndExpense(Guid Id, string Category, string? Payee, string? Description, string? Method, decimal Amount);
public record DayEndResponse(
string Date,
DayEndRow Summary,
List<DayEndMethod> ByMethod,
List<DayEndExpense> Expenses);
public record DayEndDailyResponse(DateTime From, DateTime To, List<DayEndRow> Days, DayEndRow Totals);
// Repository row shapes
public record DayEndInvoiceRow(Guid Id, DateTime FinalizedAt, decimal Total);
public record DayEndPaymentRow(Guid InvoiceId, PaymentMethod Method, decimal Amount, DateTime CollectedAt);
public record DayEndReturnRow(DateTime At, decimal Amount);
public record DayEndExpenseRow(
Guid Id, DateTime BillDate, DateTime? PaidAt, PaymentMethod? Method, decimal Amount,
string Category, string? Payee, string? Description);
public record DayEndData(
List<DayEndInvoiceRow> Invoices,
List<DayEndPaymentRow> Payments,
List<DayEndReturnRow> Returns,
List<DayEndExpenseRow> Expenses);