feat(product): Update Product DTO and service to handle optional CategoryID and UomID
Deploy Application / deploy (push) Successful in 24s
Details
Deploy Application / deploy (push) Successful in 24s
Details
This commit is contained in:
parent
8c5735d62e
commit
36dd83d624
|
|
@ -55,9 +55,9 @@ type (
|
||||||
// LeadTime int `json:"lead_time"`
|
// LeadTime int `json:"lead_time"`
|
||||||
// MultiplyRate string `json:"multiply_rate"`
|
// MultiplyRate string `json:"multiply_rate"`
|
||||||
// DivideRate float64 `json:"divide_rate"`
|
// DivideRate float64 `json:"divide_rate"`
|
||||||
ClientID string `json:"client_id" binding:"required"`
|
ClientID string `json:"client_id" binding:"required"`
|
||||||
// CategoryID string `json:"category_id"`
|
CategoryID *string `json:"category_id"`
|
||||||
// UomID string `json:"uom_id"`
|
UomID *string `json:"uom_id"`
|
||||||
// DimUomID string `json:"dim_uom_id"`
|
// DimUomID string `json:"dim_uom_id"`
|
||||||
// WeightUomID string `json:"weight_uom_id"`
|
// WeightUomID string `json:"weight_uom_id"`
|
||||||
// VolumeUomID string `json:"volume_uom_id"`
|
// VolumeUomID string `json:"volume_uom_id"`
|
||||||
|
|
|
||||||
|
|
@ -107,8 +107,14 @@ func (s *productService) Create(ctx context.Context, req dto.ProductCreateReques
|
||||||
}
|
}
|
||||||
// UUID fields
|
// UUID fields
|
||||||
product.ClientID = parseUUID(req.ClientID)
|
product.ClientID = parseUUID(req.ClientID)
|
||||||
// product.CategoryID = parseUUID(req.CategoryID)
|
if req.CategoryID != nil {
|
||||||
// product.UomID = parseUUID(req.UomID)
|
id := parseUUID(*req.CategoryID)
|
||||||
|
product.CategoryID = &id
|
||||||
|
}
|
||||||
|
if req.UomID != nil {
|
||||||
|
id := parseUUID(*req.UomID)
|
||||||
|
product.UomID = &id
|
||||||
|
}
|
||||||
// product.DimUomID = parseUUID(req.DimUomID)
|
// product.DimUomID = parseUUID(req.DimUomID)
|
||||||
// product.WeightUomID = parseUUID(req.WeightUomID)
|
// product.WeightUomID = parseUUID(req.WeightUomID)
|
||||||
// product.VolumeUomID = parseUUID(req.VolumeUomID)
|
// product.VolumeUomID = parseUUID(req.VolumeUomID)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue