5707bd4c31
Introduced StoreCreditMovement entity and migration to track store credit usage and settlements. Updated payment flow to enforce credit limits and record credit movements. Modified outstanding balance calculation to use credit movements. Enhanced frontend to display real-time credit info and prevent over-credit payments. Updated API types, seed data, and DI registrations accordingly.
28 lines
868 B
C#
28 lines
868 B
C#
using Distribution.Models;
|
|
|
|
namespace Distribution.Features.Invoice;
|
|
|
|
public record CreateInvoiceRequest(Guid ShopPOId);
|
|
public record InvoiceItemAdjustment(Guid ShopPOItemId, int AdjustedQuantity, string? Note = null);
|
|
public record FinalizeInvoiceRequest(List<InvoiceItemAdjustment>? Adjustments = null, Guid? FinalizedByUserId = null);
|
|
public record PrintInvoiceRequest(Guid? PrintedByUserId = null);
|
|
|
|
public record InvoiceResponse(
|
|
Guid Id,
|
|
Guid ShopPOId,
|
|
Guid StoreId,
|
|
string StoreName,
|
|
InvoiceStatus Status,
|
|
PaymentStatus PaymentStatus,
|
|
Guid CreatedBy,
|
|
DateTime? PrintedAt,
|
|
Guid? PrintedBy,
|
|
DateTime? FinalizedAt,
|
|
Guid? FinalizedBy,
|
|
decimal TotalAmount,
|
|
decimal PaidAmount,
|
|
bool IsActive,
|
|
DateTime CreatedAt);
|
|
|
|
public record OutstandingPaymentsResponse(int InvoiceCount, decimal OutstandingAmount);
|