Add order items

This commit is contained in:
Aditya Siregar
2025-08-08 22:33:08 +07:00
parent c18e915d1e
commit 8e9c14b860
14 changed files with 427 additions and 200 deletions
+4
View File
@@ -65,6 +65,7 @@ type PaymentOrderItem struct {
ID uuid.UUID
PaymentID uuid.UUID
OrderItemID uuid.UUID
Quantity int // Quantity paid for this specific payment
Amount float64
CreatedAt time.Time
UpdatedAt time.Time
@@ -114,6 +115,7 @@ type UpdateOrderRequest struct {
type CreatePaymentOrderItemRequest struct {
OrderItemID uuid.UUID `validate:"required"`
Quantity int `validate:"required,min=1"` // Quantity being paid for
Amount float64 `validate:"required,min=0"`
}
@@ -205,12 +207,14 @@ type OrderItemResponse struct {
CreatedAt time.Time
UpdatedAt time.Time
PrinterType string
PaidQuantity int
}
type PaymentOrderItemResponse struct {
ID uuid.UUID
PaymentID uuid.UUID
OrderItemID uuid.UUID
Quantity int // Quantity paid for this specific payment
Amount float64
CreatedAt time.Time
UpdatedAt time.Time
+1 -1
View File
@@ -27,7 +27,7 @@ func (s *SplitBillRequest) IsAmount() bool {
type SplitBillItemRequest struct {
OrderItemID uuid.UUID `validate:"required"`
Amount float64 `validate:"required,min=0"`
Quantity int `validate:"required,min=0"`
}
type SplitBillResponse struct {