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

Players

Player registry contract.

Entity: Players

1. Overview

  • Player identity registry for athlete naming, gender metadata, lifecycle status, and downstream registration/media attribution.
  • Uses gender lookup metadata.
  • Participates in clubs and teams through registrations rather than a single direct FK.
  • Feeds media, stats, and claim systems downstream.
  • Visible at /admin/data/registries/players.

2. Database Schema

Columns

columntypenullabledefaultnotes
birth_yearnumber \nullyesnullBase table field.
club_textstring \nullyesnullBase table field.
created_atstringnodatabase default or generatedBase table field.
first_namestringnononeBase table field.
gender_idstring \nullyesnullRelationship-bearing column.
idstringnogenerated UUID defaultBase table field.
keystringnononeBase table field.
last_namestringnononeBase table field.
normalized_namestring \nullyesnullBase table field.
slugstring \nullyesnullBase table field.
statusstringnodatabase default or generatedLifecycle field when present.
updated_atstringnodatabase default or generatedBase table field.

Foreign Keys

columnreferencestableon delete
gender_ididgendersNO 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
v_playersCurated admin registry read model for players.

3. Import Contract

Accepted Columns

  • key
  • first_name
  • last_name
  • birth_year
  • gender_key
  • gender
  • gender_id
  • club_text
  • slug

Resolution Rules

  • Player base imports are primarily direct-field imports; club affinity is captured as text in the player base template.
  • Gender supports key-first lookup resolution with label fallback through mismatch handling.

Required Fields

  • first_name
  • last_name

Optional Fields

  • key
  • birth_year
  • gender_key
  • gender
  • gender_id
  • club_text
  • slug

Failure Rules

  • Missing first or last name fails immediately.
  • Invalid gender values route through mismatch handling before hitting lookup/database validation.
  • Player lifecycle operations must preserve historical identity references.

4. Frontend Registry Mapping

Grid Columns

labelfieldsource
Last Namelast_namederived from v_players.full_name / players.last_name
First Namefirst_namederived from v_players.full_name / players.first_name
Birth Yearbirth_yearplayers.birth_year
Gendergender_keygenders
Statusstatusplayers.status

Filters

filterfieldtype
Searchname, club_name, team_nametext substring
Clubclub_idrelationship select
Birth Yearbirth_yearderived select
Gendergender_idlookup select
Statusstatusselect

Display Logic

  • First and last name columns are derived from full_name when structured name parts are absent.
  • Search spans related club and team context even though the grid only shows player-centric columns.

5. Lifecycle Rules

  • Player lifecycle is protected by the finalized delete system. Historical match participation must never be erased.
  • Player delete behavior must use the official archive/delete functions rather than ad hoc row deletes.
  • Snapshot fields and match history invariants remain authoritative across lifecycle transitions.