mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
FEAT[BE] :add marketing type field to delivery and sales order DTOs, enhance validation and service logic for consistent marketing type handling
This commit is contained in:
@@ -5,11 +5,11 @@ type Create struct {
|
||||
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"`
|
||||
MarketingType string `json:"marketing_type" validate:"required,min=1,max=50"`
|
||||
MarketingProducts []CreateMarketingProduct `json:"marketing_products" validate:"required,min=1,dive"`
|
||||
}
|
||||
|
||||
type CreateMarketingProduct struct {
|
||||
MarketingType string `json:"marketing_type" validate:"required,min=1,max=50"`
|
||||
VehicleNumber string `json:"vehicle_number" validate:"required,min=1,max=50"`
|
||||
ConvertionUnit *string `json:"convertion_unit" validate:"omitempty,min=1,max=20"`
|
||||
WeightPerConvertion *float64 `json:"weight_per_convertion" validate:"omitempty,gt=0"`
|
||||
@@ -25,7 +25,6 @@ type Update struct {
|
||||
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"`
|
||||
MarketingType string `json:"marketing_type" validate:"omitempty,min=1,max=50"`
|
||||
MarketingProducts []CreateMarketingProduct `json:"marketing_products" validate:"omitempty,min=1,dive"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user