Turfi Platform Documentation
Official Turfi documentation portal for users, admins, and developers.
Documentation Search
Search only within Turfi documentation pages.
C
Clubs
Club registry contract.
Entity: Clubs
1. Overview
- Club registry connecting organizations, licensing, identity, and shared communication/address data used throughout player and team workflows.
- Belongs to an organization.
- May carry a club license level lookup assignment.
- Owns teams and participates in address/contact-linked infrastructure records.
- Visible at
/admin/data/registries/clubs.
2. Database Schema
Columns
| column | type | nullable | default | notes | |
|---|---|---|---|---|---|
| address_id | string \ | null | yes | null | Relationship-bearing column. |
| city | string \ | null | yes | null | Base table field. |
| club_license_lookup_id | string \ | null | yes | null | Relationship-bearing column. |
| country | string \ | null | yes | null | Base table field. |
| created_at | string | no | database default or generated | Base table field. | |
| string \ | null | yes | null | Base table field. | |
| id | string | no | generated UUID default | Base table field. | |
| key | string | no | none | Base table field. | |
| license_level_id | string \ | null | yes | null | Relationship-bearing column. |
| logo_url | string \ | null | yes | null | Base table field. |
| name | string | no | none | Base table field. | |
| normalized_name | string \ | null | yes | null | Base table field. |
| organization_id | string \ | null | yes | null | Relationship-bearing column. |
| phone | string \ | null | yes | null | Base table field. |
| province | string \ | null | yes | null | Base table field. |
| short_name | string \ | null | yes | null | Base table field. |
| slug | string \ | null | yes | null | Base table field. |
| status | string | no | database default or generated | Lifecycle field when present. | |
| updated_at | string | no | database default or generated | Base table field. | |
| website | string \ | null | yes | null | Base table field. |
Foreign Keys
| column | references | table | on delete |
|---|---|---|---|
| address_id | id | addresses | NO ACTION |
| license_level_id | id | club_license_levels | NO ACTION |
| organization_id | id | organizations | NO 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)
| name | purpose |
|---|---|
| v_clubs | Curated admin registry read model for clubs. |
3. Import Contract
Accepted Columns
keynameshort_nameslugstatusorganization_keyorganizationorganization_idlicense_level_codelicense_levellicense_level_idlogo_urladdress_line1address_line2cityprovincepostal_codecountryphoneemailwebsite
Resolution Rules
organization_keyresolves by organization key.- Organization and license-level non-suffixed inputs resolve by
key, thenslug, thennamewhen applicable. - Address inputs are normalized into shared address records before the club write contract is assembled.
Required Fields
name
Optional Fields
keyshort_nameslugstatusorganization_keyorganizationorganization_idlicense_level_codelicense_levellicense_level_idlogo_urladdress_line1address_line2cityprovincepostal_codecountryphoneemailwebsite
Failure Rules
- Missing
namefails immediately. - Unresolved organization or invalid license-level values route through mismatch handling before persistence.
- Delete is blocked by governed entity protections when dependencies exist.
4. Frontend Registry Mapping
Grid Columns
| label | field | source |
|---|---|---|
| Name | name | v_clubs.name / clubs.name |
| License Level | license_level_name | club_license_levels |
| Address | address | v_clubs.address / addresses |
| City | city | v_clubs.city / addresses.city |
| Province | province | v_clubs.province / addresses.province |
| Phone | phone | clubs.phone |
| clubs.email | ||
| Website | website | clubs.website |
| Organization | organization_name | organizations.name |
| Status | status | clubs.status |
Filters
| filter | field | type |
|---|---|---|
| Search | name | text substring |
| Organization | organization_id | select |
| Province | province | distinct select |
| License | license_level_id | lookup select |
| Status | status | select |
Display Logic
- Organization displays as the resolved association name in the curated registry.
- Address is flattened for grid display and phone is formatted.
- Club read behavior prefers
v_clubsand falls back to base tables plus joined lookups.
5. Lifecycle Rules
- Clubs are governed entities and use the protected delete flow.
- Lifecycle status should preserve historical team and player relationships rather than relying on destructive delete.
- License level changes are administrative metadata updates and should not mutate identity keys.