Last deployment:

Turfi Platform Documentation

Official Turfi documentation portal for users, admins, and developers.

Back to support

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

columntypenullabledefaultnotes
created_atstringnodatabase default or generatedBase table field.
end_datestring \nullyesnullBase table field.
idstringnogenerated UUID defaultBase table field.
keystringnononeBase table field.
namestringnononeBase table field.
slugstring \nullyesnullBase table field.
start_datestring \nullyesnullBase table field.
statusstring \nullyesnullLifecycle field when present.
updated_atstring \nullyesnullBase 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)

namepurpose
v_seasonsCurated admin registry read model for seasons.

3. Import Contract

Accepted Columns

  • key
  • name
  • slug
  • start_date
  • end_date
  • status

Resolution Rules

  • Season imports are direct-field imports with no required FK resolution in the base entity contract.

Required Fields

  • name

Optional Fields

  • key
  • slug
  • start_date
  • end_date
  • status

Failure Rules

  • Missing name fails immediately.
  • Invalid date ranges or invalid lifecycle values fail normal validation rather than mismatch review.

4. Frontend Registry Mapping

Grid Columns

labelfieldsource
Namenamev_seasons.name / seasons.name
Start Datestart_dateseasons.start_date
End Dateend_dateseasons.end_date
Statusstatusseasons.status

Filters

filterfieldtype
Searchname, start_date, end_date, statustext substring
Yearyearderived select
Statusstatusselect

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.