fix(companies): align optional numeric fields with API validation
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
Make employee_count, annual_revenue, and founded_year truly optional in the create company form and payload. Add field validation docs and Cypress e2e coverage for dashboard and notifications. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
# Create Company Field Validations
|
||||
|
||||
This document describes validation rules for selected fields in the `Create Company` API request body (`POST /admin/v1/companies`).
|
||||
|
||||
Source of truth: `internal/company/form.go` (`CompanyForm`).
|
||||
|
||||
## employee_count
|
||||
|
||||
- JSON field: `employee_count`
|
||||
- Type: `integer` (`*int`, optional)
|
||||
- Validation tag: `optional,range(1|100000)`
|
||||
- Rules:
|
||||
- Field is optional.
|
||||
- If provided, value must be between `1` and `100000` (inclusive).
|
||||
|
||||
## annual_revenue
|
||||
|
||||
- JSON field: `annual_revenue`
|
||||
- Type: `number` (`*float64`, optional)
|
||||
- Validation tag: `optional,range(0|999999999999)`
|
||||
- Rules:
|
||||
- Field is optional.
|
||||
- If provided, value must be between `0` and `999999999999` (inclusive).
|
||||
|
||||
## founded_year
|
||||
|
||||
- JSON field: `founded_year`
|
||||
- Type: `integer` (`*int`, optional)
|
||||
- Validation tag: `optional,range(1800|2100)`
|
||||
- Rules:
|
||||
- Field is optional.
|
||||
- If provided, value must be between `1800` and `2100` (inclusive).
|
||||
Reference in New Issue
Block a user