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

Player Registrations

Player registration registry contract, standalone grid behavior, and import/write rules.

Entity: Player Registrations

1. Overview

  • Import-linked registration table connecting players to teams, clubs, seasons, competitions, and roster metadata.
  • Belongs to a player and team.
  • May also carry club, organization, season, and competition context.
  • Supports roster-derived metadata such as jersey number and registration type.
  • May retain import provenance through source_roster_entry_id into team_roster_entries.
  • Visible at /admin/data/registries/player-registrations.
  • Primary operator surfaces are the standalone registry grid and the import route /admin/imports/new?entity=player_registrations.

2. Database Schema

Columns

columntypenullabledefaultnotes
club_idstring \nullyesnullRelationship-bearing column.
competition_idstring \nullyesnullRelationship-bearing column.
created_atstringnodatabase default or generatedBase table field.
end_datestring \nullyesnullBase table field.
idstringnogenerated UUID defaultBase table field.
is_primarybooleannodatabase default or generatedBase table field.
jersey_numbernumber \nullyesnullBase table field.
notesstring \nullyesnullBase table field.
organization_idstring \nullyesnullRelationship-bearing column.
player_idstringnononeRelationship-bearing column.
positionstring \nullyesnullBase table field.
registration_typestringnodatabase default or generatedBase table field.
season_idstring \nullyesnullRelationship-bearing column.
source_roster_entry_idstring \nullyesnullRelationship-bearing column.
start_datestring \nullyesnullBase table field.
statusstringnodatabase default or generatedLifecycle field when present.
team_idstringnononeRelationship-bearing column.
updated_atstringnodatabase default or generatedBase table field.

Foreign Keys

columnreferencestableon delete
club_ididclubsNO ACTION
competition_ididcompetitionsNO ACTION
organization_ididorganizationsNO ACTION
player_ididplayersNO ACTION
season_ididseasonsNO ACTION
source_roster_entry_ididteam_roster_entriesNO 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_player_registrationsAdmin registry read model for resolved registration labels.
base-table fallback readsDevelopment fallback when the registry view is not yet deployed.

3. Import Contract

Accepted Columns

  • player_id
  • team_id
  • club_id
  • competition_id
  • season_id
  • organization_id
  • club_key
  • club
  • competition_key
  • competition
  • season_key
  • season
  • organization_key
  • organization
  • start_date
  • end_date
  • status
  • position
  • registration_type
  • jersey_number
  • is_primary
  • notes

Resolution Rules

  • Direct ids are accepted for all relationship columns.
  • Competition, season, club, and organization may also be provided in normalized key or human-readable form and resolved before write.
  • Player/team resolution should be treated as required direct relationships in the current contract.

Required Fields

  • player_id
  • team_id

Optional Fields

  • club_id
  • competition_id
  • season_id
  • organization_id
  • club_key
  • club
  • competition_key
  • competition
  • season_key
  • season
  • organization_key
  • organization
  • start_date
  • end_date
  • status
  • position
  • registration_type
  • jersey_number
  • is_primary
  • notes

Failure Rules

  • Missing player or team ids fail immediately.
  • Related competition/season/club/organization mismatches should be resolved before the registration is written.
  • Invalid status or registration metadata fails normal validation.

4. Frontend Registry Mapping

Grid Columns

labelfieldsource
Playerplayer_nameplayers.first_name + players.last_name via v_player_registrations
Teamteam_nameteams.name
Clubclub_nameclubs.name
Competitioncompetition_namecompetitions.name
Seasonseason_nameseasons.name
Organizationorganization_nameorganizations.name
Registration Typeregistration_typeplayer_registrations.registration_type
Positionpositionplayer_registrations.position
Jerseyjersey_numberplayer_registrations.jersey_number
Primaryis_primaryplayer_registrations.is_primary
Statusstatusplayer_registrations.status

Filters

filterfieldtype
Organizationorganization_identity
Seasonseason_identity
Competitioncompetition_identity
Clubclub_identity
Teamteam_identity
Playerplayer_identity
Registration Typeregistration_typeselect
Statusstatusselect

Display Logic

  • Registry reads prefer v_player_registrations so the grid can show resolved player, team, club, competition, season, and organization labels from one source.
  • Registry writes still target the base player_registrations table through a dedicated service path.
  • Registration type is normalized to the live database contract before write.

5. Lifecycle Rules

  • Registration status should preserve historical roster context rather than relying on destructive delete.
  • Updates should preserve the player/team link because downstream participation logic depends on it.