This commit is contained in:
aditya.siregar
2025-04-10 11:21:08 +07:00
parent c642c5c61b
commit 09c9a4d59d
30 changed files with 1797 additions and 758 deletions
+15 -1
View File
@@ -88,7 +88,7 @@ type CreateOrderResponse struct {
Status string `json:"status"`
Amount float64 `json:"amount"`
Total float64 `json:"total"`
Fee float64 `json:"fee"`
Tax float64 `json:"tax"`
PaymentType string `json:"payment_type"`
CreatedAt time.Time `json:"created_at"`
OrderItems []CreateOrderItemResponse `json:"order_items"`
@@ -187,3 +187,17 @@ type OrderDetailItem struct {
UnitPrice float64 `json:"unit_price"` // Price per unit
TotalPrice float64 `json:"total_price"` // Total price for this item (Quantity * UnitPrice)
}
type OrderHistoryResponse struct {
ID int64 `json:"id"`
CustomerName string `json:"customer_name"`
Status string `json:"status"`
Amount float64 `json:"amount"`
Total float64 `json:"total"`
PaymentType string `json:"payment_type"`
TableNumber string `json:"table_number"`
OrderType string `json:"order_type"`
OrderItems []OrderItemResponse `json:"order_items"`
CreatedAt string `json:"created_at"`
Tax float64 `json:"tax"`
}
+4 -4
View File
@@ -9,7 +9,7 @@ type OrderInquiryResponse struct {
ID string `json:"id"`
Status string `json:"status"`
Amount float64 `json:"amount"`
Fee float64 `json:"fee"`
Tax float64 `json:"tax"`
Total float64 `json:"total"`
CustomerID int64 `json:"customer_id"`
PaymentType string `json:"payment_type"`
@@ -54,7 +54,7 @@ func MapToInquiryResponse(result *entity.OrderInquiryResponse) OrderInquiryRespo
ID: result.OrderInquiry.ID,
Status: result.OrderInquiry.Status,
Amount: result.OrderInquiry.Amount,
Fee: result.OrderInquiry.Fee,
Tax: result.OrderInquiry.Tax,
Total: result.OrderInquiry.Total,
CustomerID: result.OrderInquiry.CustomerID,
PaymentType: result.OrderInquiry.PaymentType,
@@ -74,7 +74,7 @@ type OrderResponse struct {
ID int64 `json:"id"`
Status string `json:"status"`
Amount float64 `json:"amount"`
Fee float64 `json:"fee"`
Tax float64 `json:"tax"`
Total float64 `json:"total"`
CustomerName string `json:"customer_name,omitempty"`
PaymentType string `json:"payment_type"`
@@ -89,7 +89,7 @@ func MapToOrderResponse(result *entity.OrderResponse) OrderResponse {
ID: result.Order.ID,
Status: result.Order.Status,
Amount: result.Order.Amount,
Fee: result.Order.Fee,
Tax: result.Order.Tax,
Total: result.Order.Total,
PaymentType: result.Order.PaymentType,
CreatedAt: result.Order.CreatedAt,
+1 -1
View File
@@ -3,5 +3,5 @@ package response
type PagingMeta struct {
Page int `json:"page"`
Limit int `json:"limit"`
Total int64 `json:"total_data"`
Total int64 `json:"total"`
}