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

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 Associations at /admin/data/registries/associations.
  • A generic /admin/data/registries/organizations route exists but is not the primary curated surface.

2. Database Schema

Columns

columntypenullabledefaultnotes
address_idstring \nullyesnullRelationship-bearing column.
citystring \nullyesnullBase table field.
created_atstringnodatabase default or generatedBase table field.
emailstring \nullyesnullBase table field.
idstringnogenerated UUID defaultBase table field.
keystringnononeBase table field.
namestringnononeBase table field.
normalized_namestring \nullyesnullBase table field.
parent_organization_idstring \nullyesnullRelationship-bearing column.
phonestring \nullyesnullBase table field.
provincestring \nullyesnullBase table field.
slugstring \nullyesnullBase table field.
statusstring \nullyesnullLifecycle field when present.
typestringnononeBase table field.
updated_atstring \nullyesnullBase table field.
websitestring \nullyesnullBase table field.

Foreign Keys

columnreferencestableon delete
address_ididaddressesNO ACTION
parent_organization_ididorganizationsNO 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_organizationsCurated admin registry read model for associations.

3. Import Contract

Accepted Columns

  • key
  • name
  • slug
  • status
  • phone
  • email
  • website
  • city
  • province
  • address_line1
  • address_line2
  • postal_code
  • country
  • parent_organization_key
  • parent_organization
  • parent_organization_id

Resolution Rules

  • parent_organization_key resolves by organization key first.
  • parent_organization resolves by key, then slug, then name.
  • Address text fields are normalized into the shared address model before base-table write fields are assigned.

Required Fields

  • name

Optional Fields

  • key
  • slug
  • status
  • phone
  • email
  • website
  • city
  • province
  • address_line1
  • address_line2
  • postal_code
  • country
  • parent_organization_key
  • parent_organization
  • parent_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

labelfieldsource
Namenamev_organizations.name / organizations.name
Addressaddressv_organizations.address / addresses
Citycityv_organizations.city / addresses.city
Provinceprovincev_organizations.province / addresses.province
Phonephoneorganizations.phone
Emailemailorganizations.email
Websitewebsiteorganizations.website
Statusstatusorganizations.status
Parent Organizationparent_organization_namev_organizations.parent_organization_name / organizations.name

Filters

filterfieldtype
Searchname, normalized_name, city, province, phone, email, website, parent_organization_name, statustext substring
Provinceprovincetext / distinct select
Parent Organizationparent_organization_idselect
Statusstatusselect

Display Logic

  • Association registry renders resolved parent organization names instead of raw ids.
  • Address, city, and province are flattened from the linked address_id relationship 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.