package entity

import "time"

type SellerOrderItem struct {
	Id                   int64   `json:"id"`
	ProductId            int     `json:"product_id"`
	Status               int     `json:"status"`
	Name                 string  `json:"name"`
	Quantity             float64 `json:"quantity"`
	QuoteQuantity        float64 `json:"quote_quantity"`
	Unit                 string  `json:"unit"`
	Price                int     `json:"price"`
	SubtotalPrice        int     `json:"subtotal_price"`
	Thumbnail            string  `json:"thumbnail"`
	DeliveryType         int     `json:"delivery_type"`
	DeliveryCommitTime   int     `json:"delivery_commit_time"`
	IsQuoteAfterOrdering bool    `json:"is_quote_after_ordering"`
	Note                 string  `json:"note"`
}

type SellerOrder struct {
	Id                    int64             `json:"id"`
	Code                  string            `json:"code"`
	Status                int               `json:"status"`
	PaymentStatus         int               `json:"payment_status"`
	PaymentProof          string            `json:"payment_proof"`
	ShippingAddressString string            `json:"shipping_address_string"`
	Note                  string            `json:"note"`
	Price                 int               `json:"price"`
	TotalItems            int               `json:"total_items"`
	TotalDelivered        int               `json:"total_delivered"`
	CanceledReason        string            `json:"canceled_reason"`
	BuyerId               int64             `json:"buyer_id"`
	BuyerName             string            `json:"buyer_name"`
	BuyerPhone            string            `json:"buyer_phone"`
	ReceiverName          string            `json:"receiver_name"`
	ReceiverPhone         string            `json:"receiver_phone"`
	ApartmentHouseNumber  string            `json:"apartment_house_number"`
	StoreId               int               `json:"store_id"`
	StoreName             string            `json:"store_name"`
	SellerId              int64             `json:"seller_id"`
	SellerName            string            `json:"seller_name"`
	IsQuoteAfterOrdering  bool              `json:"is_quote_after_ordering"`
	CreatedAt             time.Time         `json:"created_at"`
	CreatedAtSecond       int64             `json:"created_at_in_second" gorm:"-"`
	Items                 []SellerOrderItem `json:"items" gorm:"-"`
}

type SellerOrderListResponse struct {
	Code    int
	Message string
	Data    []SellerOrder
}

type SellerOrderDetailResponse struct {
	Code    int
	Message string
	Data    *SellerOrder
}

type OrderItemConfirmRequest struct {
	ProductId int64
	Status    int
	Quantity  float64
	Note      string
}
type OrderConfirmRequest struct {
	ProductUpdate []OrderItemConfirmRequest `json:"product_update"`
}

type OrderDeliveredRequest struct {
	DeliveredProductIds []int64 `json:"delivered_product_ids"`
}
