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

Competition Registrations

Competition registration registry contract, standalone grid behavior, and validation rules.

Entity: Competition Registrations

1. Overview

  • Join table registering teams into competitions, with group and seeding metadata used by scheduling and standings logic.
  • Belongs to a competition and team.
  • Drives competition team lists, group assignments, and seed ordering.
  • Visible at /admin/data/registries/competition-registrations.
  • Primary operator surfaces are the standalone registry grid, the competition Teams tab, and the import route /admin/imports/new?entity=team_competitions.

2. Database Schema

Columns

columntypenullabledefaultnotes
competition_idstringnononeRelationship-bearing column.
created_atstring \nullyesnullBase table field.
group_namestring \nullyesnullBase table field.
idstringnogenerated UUID defaultBase table field.
seednumber \nullyesnullBase table field.
team_idstringnononeRelationship-bearing column.

Foreign Keys

columnreferencestableon delete
competition_ididcompetitionsNO ACTION
team_ididteamsNO ACTION

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
public.v_team_competitionsAdmin registry read model for resolved competition-registration labels.
base-table fallback readsDevelopment fallback when the registry view is not yet deployed.

3. Import Contract

Accepted Columns

  • competition_key
  • competition
  • competition_id
  • team_key
  • team
  • team_id
  • group_name
  • seed

Resolution Rules

  • competition_key and team_key resolve on key first.
  • Non-suffixed competition/team inputs resolve by key, then slug, then name.

Required Fields

  • competition_id
  • team_id

Optional Fields

  • competition_key
  • competition
  • team_key
  • team
  • group_name
  • seed

Failure Rules

  • Competition and team resolution fail hard because the join table is meaningless without both sides.
  • Age-group and gender mismatch with the target competition fails validation in the admin workflow.

4. Frontend Registry Mapping

Grid Columns

labelfieldsource
Competitioncompetition_namecompetitions.name
Seasonseason_nameseasons.name
Organizationorganization_nameorganizations.name
Teamteam_nameteams.name
Clubclub_nameclubs.name
Team Keyteam_keyteams.key
Groupgroup_nameteam_competitions.group_name
Seedseedteam_competitions.seed

Filters

filterfieldtype
Organizationorganization_identity
Seasonseason_identity
Competitioncompetition_identity
Clubclub_identity
Teamteam_identity

Display Logic

  • Competition team options display as Team (Club) [key] in the editor.
  • Registry reads prefer v_team_competitions so the grid can show competition, season, organization, team, and club context from one source.
  • Registrations sort by group name, then seed, then creation time.
  • Save-time validation enforces age-group and gender compatibility with the competition.

5. Lifecycle Rules

  • Competition registrations should be edited or archived carefully because games and standings depend on them.
  • Uniqueness of (competition_id, team_id) is a core lifecycle invariant.