Turfi Platform Documentation
Official Turfi documentation portal for users, admins, and developers.
Documentation Search
Search only within Turfi documentation pages.
C
Seasons
Season registry contract.
Entity: Seasons
1. Overview
- Defines reusable time windows that competitions, registrations, and imports depend on for schedule context and lifecycle grouping.
- Referenced by competitions and player registrations.
- Acts as a temporal grouping primitive for import and reporting flows.
- Visible at
/admin/data/registries/seasons.
2. Database Schema
Columns
| column | type | nullable | default | notes | |
|---|---|---|---|---|---|
| created_at | string | no | database default or generated | Base table field. | |
| end_date | string \ | null | yes | null | Base table field. |
| id | string | no | generated UUID default | Base table field. | |
| key | string | no | none | Base table field. | |
| name | string | no | none | Base table field. | |
| slug | string \ | null | yes | null | Base table field. |
| start_date | string \ | null | yes | null | Base table field. |
| status | string \ | null | yes | null | Lifecycle field when present. |
| updated_at | string \ | null | yes | null | Base table field. |
Foreign Keys
No foreign keys documented by the generated schema contract.
Indexes
No migration-defined indexes were discovered in the checked-in SQL history for this table.
Constraints
- Unique: none discovered in checked-in migrations.
- Check: none discovered in checked-in migrations.
Triggers
No migration-defined triggers were discovered in the checked-in SQL history for this table.
Views (if any)
| name | purpose |
|---|---|
| v_seasons | Curated admin registry read model for seasons. |
3. Import Contract
Accepted Columns
keynameslugstart_dateend_datestatus
Resolution Rules
- Season imports are direct-field imports with no required FK resolution in the base entity contract.
Required Fields
name
Optional Fields
keyslugstart_dateend_datestatus
Failure Rules
- Missing
namefails immediately. - Invalid date ranges or invalid lifecycle values fail normal validation rather than mismatch review.
4. Frontend Registry Mapping
Grid Columns
| label | field | source |
|---|---|---|
| Name | name | v_seasons.name / seasons.name |
| Start Date | start_date | seasons.start_date |
| End Date | end_date | seasons.end_date |
| Status | status | seasons.status |
Filters
| filter | field | type |
|---|---|---|
| Search | name, start_date, end_date, status | text substring |
| Year | year | derived select |
| Status | status | select |
Display Logic
- A derived year filter prefers explicit
year, then start date year, then end date year, then a year parsed from the season name. - No foreign relationship labels are required in the grid.
5. Lifecycle Rules
- Season status governs whether linked competitions should be treated as current or historical in admin workflows.
- Soft lifecycle transitions are preferred over delete because competitions and registrations hold season references.