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
|
|
@ -56,8 +56,8 @@ type (
|
|||
// MultiplyRate string `json:"multiply_rate"`
|
||||
// DivideRate float64 `json:"divide_rate"`
|
||||
ClientID string `json:"client_id" binding:"required"`
|
||||
// CategoryID string `json:"category_id"`
|
||||
// UomID string `json:"uom_id"`
|
||||
CategoryID *string `json:"category_id"`
|
||||
UomID *string `json:"uom_id"`
|
||||
// DimUomID string `json:"dim_uom_id"`
|
||||
// WeightUomID string `json:"weight_uom_id"`
|
||||
// VolumeUomID string `json:"volume_uom_id"`
|
||||
|
|
|
|||
|
|
@ -107,8 +107,14 @@ func (s *productService) Create(ctx context.Context, req dto.ProductCreateReques
|
|||
}
|
||||
// UUID fields
|
||||
product.ClientID = parseUUID(req.ClientID)
|
||||
// product.CategoryID = parseUUID(req.CategoryID)
|
||||
// product.UomID = parseUUID(req.UomID)
|
||||
if req.CategoryID != nil {
|
||||
id := parseUUID(*req.CategoryID)
|
||||
product.CategoryID = &id
|
||||
}
|
||||
if req.UomID != nil {
|
||||
id := parseUUID(*req.UomID)
|
||||
product.UomID = &id
|
||||
}
|
||||
// product.DimUomID = parseUUID(req.DimUomID)
|
||||
// product.WeightUomID = parseUUID(req.WeightUomID)
|
||||
// product.VolumeUomID = parseUUID(req.VolumeUomID)
|
||||
|
|
|
|||
Loading…
Reference in New Issue