mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 21:41:55 +00:00
32 lines
1.7 KiB
Go
32 lines
1.7 KiB
Go
package validation
|
|
|
|
type Create struct {
|
|
CustomerId uint `json:"customer_id" validate:"required,gt=0"`
|
|
SalesPersonId uint `json:"sales_person_id" validate:"required,gt=0"`
|
|
Date string `json:"date" validate:"required,datetime=2006-01-02"`
|
|
Notes string `json:"notes" validate:"omitempty,max=500"`
|
|
MarketingProducts []CreateMarketingProduct `json:"marketing_products" validate:"required,min=1,dive"`
|
|
}
|
|
|
|
type CreateMarketingProduct struct {
|
|
VehicleNumber string `json:"vehicle_number" validate:"required,min=1,max=50"`
|
|
ProductWarehouseId uint `json:"product_warehouse_id" validate:"required,gt=0"`
|
|
UnitPrice float64 `json:"unit_price" validate:"required,gt=0"`
|
|
Qty float64 `json:"qty" validate:"required,gt=0"`
|
|
AvgWeight float64 `json:"avg_weight" validate:"required,gt=0"`
|
|
}
|
|
|
|
type Update struct {
|
|
CustomerId uint `json:"customer_id" validate:"omitempty,gt=0"`
|
|
SalesPersonId uint `json:"sales_person_id" validate:"omitempty,gt=0"`
|
|
Date string `json:"date" validate:"omitempty,datetime=2006-01-02"`
|
|
Notes string `json:"notes" validate:"omitempty,max=500"`
|
|
MarketingProducts []CreateMarketingProduct `json:"marketing_products" validate:"omitempty,min=1,dive"`
|
|
}
|
|
|
|
type Approve struct {
|
|
Action string `json:"action" validate:"required_strict"`
|
|
ApprovableIds []uint `json:"approvable_ids" validate:"required_strict,min=1,dive,gt=0"`
|
|
Notes *string `json:"notes,omitempty" validate:"omitempty,max=500"`
|
|
}
|