43 lines
1.3 KiB
Go
43 lines
1.3 KiB
Go
package contract
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type CreateProductOutletPriceRequest struct {
|
|
ProductID uuid.UUID `json:"product_id" validate:"required"`
|
|
OutletID uuid.UUID `json:"outlet_id" validate:"required"`
|
|
Price float64 `json:"price" validate:"required,min=0"`
|
|
}
|
|
|
|
type UpdateProductOutletPriceRequest struct {
|
|
Price float64 `json:"price" validate:"required,min=0"`
|
|
}
|
|
|
|
type ProductOutletPriceResponse struct {
|
|
ID uuid.UUID `json:"id,omitempty"`
|
|
ProductID uuid.UUID `json:"product_id,omitempty"`
|
|
OutletID uuid.UUID `json:"outlet_id"`
|
|
OutletName string `json:"outlet_name,omitempty"`
|
|
Price float64 `json:"price"`
|
|
CreatedAt time.Time `json:"created_at,omitempty"`
|
|
UpdatedAt time.Time `json:"updated_at,omitempty"`
|
|
}
|
|
|
|
type ListProductOutletPricesResponse struct {
|
|
Prices []ProductOutletPriceResponse `json:"prices"`
|
|
TotalCount int `json:"total_count"`
|
|
}
|
|
|
|
type BulkCreateProductOutletPriceRequest struct {
|
|
ProductID uuid.UUID `json:"product_id" validate:"required"`
|
|
Prices []CreateProductOutletPricePerOutletRequest `json:"prices" validate:"required,dive"`
|
|
}
|
|
|
|
type CreateProductOutletPricePerOutletRequest struct {
|
|
OutletID uuid.UUID `json:"outlet_id" validate:"required"`
|
|
Price float64 `json:"price" validate:"required,min=0"`
|
|
}
|