Turfi Platform Documentation
Official Turfi documentation portal for users, admins, and developers.
Documentation Search
Search only within Turfi documentation pages.
C
Organizations
Association and organization registry contract.
Entity: Organizations
1. Overview
- Authoritative organization registry for associations and parent governance entities used across clubs, leagues, competitions, and venue ownership.
- Acts as the canonical parent registry for associations shown in the admin UI.
- Can reference a parent organization for hierarchy and governance roll-up.
- Supplies organization identity to leagues, clubs, competitions, venues, and regions.
- Curated frontend registry label is
Associationsat/admin/data/registries/associations. - A generic
/admin/data/registries/organizationsroute exists but is not the primary curated surface.
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. |
| 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. | |
| name | string | no | none | Base table field. | |
| normalized_name | string \ | null | yes | null | Base table field. |
| parent_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. |
| slug | string \ | null | yes | null | Base table field. |
| status | string \ | null | yes | null | Lifecycle field when present. |
| type | string | no | none | Base table field. | |
| updated_at | string \ | null | yes | null | Base table field. |
| website | string \ | null | yes | null | Base table field. |
Foreign Keys
| column | references | table | on delete |
|---|---|---|---|
| address_id | id | addresses | NO ACTION |
| parent_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_organizations | Curated admin registry read model for associations. |
3. Import Contract
Accepted Columns
keynameslugstatusphoneemailwebsitecityprovinceaddress_line1address_line2postal_codecountryparent_organization_keyparent_organizationparent_organization_id
Resolution Rules
parent_organization_keyresolves by organizationkeyfirst.parent_organizationresolves bykey, thenslug, thenname.- Address text fields are normalized into the shared address model before base-table write fields are assigned.
Required Fields
name
Optional Fields
keyslugstatusphoneemailwebsitecityprovinceaddress_line1address_line2postal_codecountryparent_organization_keyparent_organizationparent_organization_id
Failure Rules
- Name is required and fails validation immediately when missing.
- Parent organization mismatches enter relationship resolution when a human-readable value is provided and no match is found.
- Invalid lifecycle values fail before insert/update once they hit adapter or database validation.
4. Frontend Registry Mapping
Grid Columns
| label | field | source |
|---|---|---|
| Name | name | v_organizations.name / organizations.name |
| Address | address | v_organizations.address / addresses |
| City | city | v_organizations.city / addresses.city |
| Province | province | v_organizations.province / addresses.province |
| Phone | phone | organizations.phone |
| organizations.email | ||
| Website | website | organizations.website |
| Status | status | organizations.status |
| Parent Organization | parent_organization_name | v_organizations.parent_organization_name / organizations.name |
Filters
| filter | field | type |
|---|---|---|
| Search | name, normalized_name, city, province, phone, email, website, parent_organization_name, status | text substring |
| Province | province | text / distinct select |
| Parent Organization | parent_organization_id | select |
| Status | status | select |
Display Logic
- Association registry renders resolved parent organization names instead of raw ids.
- Address, city, and province are flattened from the linked
address_idrelationship when the registry view is available. - Phone values are formatted for display in the grid.
5. Lifecycle Rules
- Uses lifecycle status values on the base table; see schema constraints below for allowed values when present.
- Delete is governed. Organizations use the protected deletion workflow rather than immediate hard delete from the registry grid.
- Parent organization rewiring must preserve downstream league, club, and competition relationships.