package validation

type Create struct {
	Name string `json:"name" validate:"required_strict,min=3"`
}

type Query struct {
	Page   int    `query:"page" validate:"omitempty,number,min=1"`
	Limit  int    `query:"limit" validate:"omitempty,number,min=1,max=100"`
	Search string `query:"search" validate:"omitempty,max=50"`
}

type TransferProduct struct {
	ProductID  uint    `json:"product_id" validate:"required"`
	ProductQty float64 `json:"product_qty" validate:"required,gt=0"`
}

type TransferDeliveryProduct struct {
	ProductID  uint    `json:"product_id" validate:"required"`
	ProductQty float64 `json:"product_qty" validate:"required,gt=0"`
}

type TransferDelivery struct {
	DeliveryCost        float64                   `json:"delivery_cost"`
	DeliveryCostPerItem float64                   `json:"delivery_cost_per_item"`
	DocumentIndex       int                       `json:"document_index" validate:"omitempty,min=-1" default:"-1"`
	DriverName          string                    `json:"driver_name"`
	VehiclePlate        string                    `json:"vehicle_plate"`
	SupplierID          uint                      `json:"supplier_id" `
	Products            []TransferDeliveryProduct `json:"products" validate:"required,dive"`
}

type TransferRequest struct {
	TransferReason         string             `json:"transfer_reason" validate:"required"`
	TransferDate           string             `json:"transfer_date" validate:"required,datetime=2006-01-02"`
	SourceWarehouseID      uint               `json:"source_warehouse_id" validate:"required"`
	DestinationWarehouseID uint               `json:"destination_warehouse_id" validate:"required"`
	Products               []TransferProduct  `json:"products" validate:"required,dive"`
	Deliveries             []TransferDelivery `json:"deliveries" validate:"required,dive"`
}
