Files
tm_panel/docs/client/create-company-field-validations.md
AmirReza Jamali 169708e49d
continuous-integration/drone/push Build is passing
fix(companies): align optional numeric fields with API validation
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>
2026-06-16 11:47:45 +03:30

33 lines
945 B
Markdown

# 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).