update order
This commit is contained in:
@@ -190,6 +190,8 @@ type OrderDetailItem struct {
|
||||
|
||||
type OrderHistoryResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
IsMember bool `json:"is_member"`
|
||||
CustomerID *int64 `json:"customer_id"`
|
||||
CustomerName string `json:"customer_name"`
|
||||
Status string `json:"status"`
|
||||
Amount float64 `json:"amount"`
|
||||
|
||||
@@ -102,14 +102,9 @@ func MapToOrderResponse(result *entity.OrderResponse) OrderResponse {
|
||||
func MapToOrderItemResponses(items []entity.OrderItem) []OrderItemResponse {
|
||||
result := make([]OrderItemResponse, 0, len(items))
|
||||
for _, item := range items {
|
||||
productName := ""
|
||||
if item.Product != nil {
|
||||
productName = item.Product.Name
|
||||
}
|
||||
|
||||
result = append(result, OrderItemResponse{
|
||||
ProductID: item.ItemID,
|
||||
ProductName: productName,
|
||||
ProductName: item.ItemName,
|
||||
Price: item.Price,
|
||||
Quantity: item.Quantity,
|
||||
Subtotal: item.Price * float64(item.Quantity),
|
||||
|
||||
Reference in New Issue
Block a user