54 lines
1.8 KiB
C#
54 lines
1.8 KiB
C#
using Distribution.Models;
|
|
|
|
namespace Distribution.Features.Invoice;
|
|
|
|
public record CreateInvoiceRequest(Guid ShopPOId, Guid? CreatedByUserId = null);
|
|
public record InvoiceItemAdjustment(Guid InvoiceItemId, int AdjustedQuantity, bool IsRemoved = false, string? Note = null);
|
|
public record FinalizeInvoiceRequest(List<InvoiceItemAdjustment>? Adjustments = null, Guid? FinalizedByUserId = null);
|
|
public record PrintInvoiceRequest(Guid? PrintedByUserId = null);
|
|
|
|
// InvoiceItemId set = edit/remove/restore an existing line; ItemId set (InvoiceItemId null) = add a new line.
|
|
public record InvoiceItemEdit(Guid? InvoiceItemId, Guid? ItemId, int Quantity, decimal? UnitPrice = null, bool IsRemoved = false);
|
|
public record UpdateInvoiceItemsRequest(List<InvoiceItemEdit> Items, Guid? EditedByUserId = null);
|
|
|
|
public record InvoiceVersionItemResponse(Guid? ShopPOItemId, Guid ItemId, string ItemName, int Quantity, decimal UnitPrice, bool IsRemoved);
|
|
|
|
public record InvoiceVersionResponse(
|
|
Guid Id,
|
|
int VersionNumber,
|
|
InvoiceVersionStage Stage,
|
|
decimal TotalAmount,
|
|
Guid CreatedBy,
|
|
DateTime CreatedAt,
|
|
List<InvoiceVersionItemResponse> Items);
|
|
|
|
public record InvoiceItemResponse(
|
|
Guid Id,
|
|
Guid? ShopPOItemId,
|
|
Guid ItemId,
|
|
string ItemName,
|
|
int? OrderedQuantity,
|
|
int Quantity,
|
|
decimal UnitPrice,
|
|
bool IsRemoved);
|
|
|
|
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,
|
|
List<InvoiceItemResponse> Items);
|
|
|
|
public record OutstandingPaymentsResponse(int InvoiceCount, decimal OutstandingAmount);
|