Make vendor nullable

This commit is contained in:
2026-06-18 11:04:59 +07:00
parent 2ad9e2f85f
commit c1d859ebdd
13 changed files with 88 additions and 39 deletions
@@ -29,8 +29,8 @@ func (v *PurchaseOrderValidatorImpl) ValidateCreatePurchaseOrderRequest(req *con
return errors.New("request body is required"), constants.MissingFieldErrorCode
}
if req.VendorID == uuid.Nil {
return errors.New("vendor_id is required"), constants.MissingFieldErrorCode
if req.VendorID != nil && *req.VendorID == uuid.Nil {
return errors.New("vendor_id cannot be empty"), constants.MalformedFieldErrorCode
}
if strings.TrimSpace(req.PONumber) == "" {