package entity

import (
	"chonho/pkg/model"
)

type SellerProduct struct {
	Id                   int64    `json:"id"`
	Name                 string   `json:"name"`
	Unit                 string   `json:"unit"`
	Stock                int      `json:"stock"`
	Price                int      `json:"price"`
	StoreId              int64    `json:"store_id"`
	CategoryId           int64    `json:"category_id"`
	Description          string   `json:"description"`
	DeliveryType         int      `json:"delivery_type"`
	DeliveryCommitTime   int      `json:"delivery_commit_time"`
	IsQuoteAfterOrdering bool     `json:"is_quote_after_ordering"`
	Thumbnail            string   `json:"thumbnail"`
	ImagesArray          []string `json:"images" gorm:"-"`
	Images               string   `json:"-"`
}

type AddSellerProductRequest struct {
	Name                 string   `json:"name"`
	StoreId              int64    `json:"store_id"`
	CategoryId           int64    `json:"category_id"`
	Description          string   `json:"description"`
	Unit                 string   `json:"unit"`
	Stock                int      `json:"stock"`
	Price                int      `json:"price"`
	DeliveryType         int      `json:"delivery_type"`
	DeliveryCommitTime   int      `json:"delivery_commit_time"`
	IsQuoteAfterOrdering bool     `json:"is_quote_after_ordering"`
	Thumbnail            string   `json:"thumbnail"`
	Images               []string `json:"images"`
}

type AddSellerProductResponse struct {
	Response
	Data SellerProduct
}

type UpdateSellerProductRequest struct {
	AddSellerProductRequest
	Status int
}

type UpdateSellerProductResponse struct {
	Response
	Data bool
}

type DeleteSellerProductResponse struct {
	Response
	Data bool
}

type GetSellerProductResponse struct {
	Response
	Data SellerProduct
}

type GetSellerProductsResponse struct {
	Response
	Data []SellerProduct
}

type PostSellerProduct struct {
	StoreId              int64    `json:"store_id"`
	Name                 string   `json:"name"`
	CategoryId           int64    `json:"category_id"`
	Description          string   `json:"description"`
	Unit                 string   `json:"unit"`
	Stock                int      `json:"stock"`
	Price                int      `json:"price"`
	DeliveryType         int      `json:"delivery_type"`
	DeliveryCommitTime   int      `json:"delivery_commit_time"`
	Status               int      `json:"status"`
	IsQuoteAfterOrdering bool     `json:"is_quote_after_ordering"`
	Thumbnail            string   `json:"thumbnail"`
	ImagesArray          []string `json:"images" gorm:"-"`
	Images               string   `json:"-"`
}

type ReturnedSellerProduct struct {
	Id int64 `json:"id"`
	PostSellerProduct
}

type SellerMultiProductResponse struct {
	Response
	Data []ReturnedSellerProduct
}

type SellerSingleProductResponse struct {
	Response
	Data ReturnedSellerProduct
}

type FullStoreProduct struct {
	model.StoreProduct
	Name                 string
	Thumbnail            string
	Images               string
	IsQuoteAfterOrdering bool
}
