Update company form validation to make fields optional and enhance service logic for registration number and tax ID checks
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
- Modified CompanyForm fields (RegistrationNumber, TaxID, Industry) to be optional, allowing for more flexible company creation. - Updated the Create method in company service to check for existing companies by registration number and tax ID only if provided, improving error handling and user experience during company creation. This update enhances the company creation process by allowing optional fields while ensuring that existing company checks are performed only when necessary.
This commit is contained in:
@@ -7,9 +7,9 @@ type (
|
||||
CompanyForm struct {
|
||||
Name string `json:"name" valid:"required,length(2|200)" example:"Opplens"`
|
||||
Type string `json:"type" valid:"required,in(private|public|government|ngo|startup)" example:"private"`
|
||||
RegistrationNumber string `json:"registration_number" valid:"required,length(5|50)" example:"1234567890"`
|
||||
TaxID string `json:"tax_id" valid:"required,length(5|50)" example:"1234567890"`
|
||||
Industry string `json:"industry" valid:"required,length(2|100)" example:"Technology"`
|
||||
RegistrationNumber string `json:"registration_number" valid:"optional,length(5|50)" example:"1234567890"`
|
||||
TaxID string `json:"tax_id" valid:"optional,length(5|50)" example:"1234567890"`
|
||||
Industry string `json:"industry" valid:"optional,length(2|100)" example:"Technology"`
|
||||
Description *string `json:"description,omitempty" valid:"optional,length(10|1000)" example:"Opplens is a technology company"`
|
||||
Website *string `json:"website,omitempty" valid:"optional,url" example:"https://opplens.com"`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user