52 lines
1.5 KiB
C#
52 lines
1.5 KiB
C#
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);
|