feat[BE-222]: create migration create template for SO API and kandang id param on product warehouse

This commit is contained in:
aguhh18
2025-11-10 14:49:46 +07:00
parent b2ed58c734
commit fd0943dfaf
12 changed files with 147 additions and 31 deletions
@@ -1,11 +1,25 @@
package validation
type Create struct {
Name string `json:"name" validate:"required_strict,min=3"`
CustomerId uint `json:"customer_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"`
KandangId uint `json:"kandang_id" validate:"required,gt=0"`
ProductWarehouseId uint `json:"product_warehouse_id" validate:"required,gt=0"`
UnitPrice float64 `json:"unit_price" validate:"required,gt=0"`
TotalWeight float64 `json:"total_weight" validate:"required,gt=0"`
Qty float64 `json:"qty" validate:"required,gt=0"`
AvgWeight float64 `json:"avg_weight" validate:"required,gt=0"`
TotalPrice float64 `json:"total_price" validate:"required,gt=0"`
}
type Update struct {
Name *string `json:"name,omitempty" validate:"omitempty"`
Name *string `json:"name,omitempty" validate:"omitempty"`
}
type Query struct {