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

Businesses

Business registry contract.

Entity: Businesses

1. Overview

  • Commercial registry for venue-linked businesses and operational partners surfaced in facility management workflows.
  • May belong to a venue.
  • Can be surfaced as venue management information in venue read models.
  • Visible at /admin/data/registries/businesses.

2. Database Schema

Columns

columntypenullabledefaultnotes
address_line1string \nullyesnullBase table field.
address_line2string \nullyesnullBase table field.
business_typestring \nullyesnullBase table field.
citystring \nullyesnullBase table field.
contact_emailstring \nullyesnullBase table field.
countrystring \nullyesnullBase table field.
created_atstringnodatabase default or generatedBase table field.
emailstring \nullyesnullBase table field.
idstringnogenerated UUID defaultBase table field.
is_activebooleannodatabase default or generatedBase table field.
keystringnononeBase table field.
locationunknownnodatabase default or generatedBase table field.
namestringnononeBase table field.
phonestring \nullyesnullBase table field.
postal_codestring \nullyesnullBase table field.
provincestring \nullyesnullBase table field.
slugstring \nullyesnullBase table field.
statusstring \nullyesnullLifecycle field when present.
updated_atstring \nullyesnullBase table field.
websitestring \nullyesnullBase table field.

Foreign Keys

No foreign keys documented by the generated schema contract.

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_businessesCurated admin registry read model for businesses.

3. Import Contract

Accepted Columns

  • key
  • name
  • slug
  • venue_key
  • venue
  • venue_id
  • business_type
  • city
  • province
  • country
  • website
  • status

Resolution Rules

  • venue_key resolves by venue key.
  • Non-suffixed venue input resolves by key, then slug, then name.

Required Fields

  • name

Optional Fields

  • key
  • slug
  • venue_key
  • venue
  • venue_id
  • business_type
  • city
  • province
  • country
  • website
  • status

Failure Rules

  • Missing name fails immediately.
  • Venue mismatches route through relationship resolution before write.
  • Status or business-type normalization failures fail validation.

4. Frontend Registry Mapping

Grid Columns

labelfieldsource
Namenamev_businesses.name / businesses.name
Business Typebusiness_typebusinesses.business_type
Addressaddressbusiness row.address / address_line1
Citycitybusinesses.city
Provinceprovincebusinesses.province
Postal Codepostal_codebusinesses.postal_code
Countrycountrybusinesses.country
Phonephonenormalized businesses.phone
Emailemailbusinesses.email
Websitewebsitenormalized businesses.website
Statusstatusbusinesses.status / derived is_active

Filters

filterfieldtype
Searchname, business_type, address, city, provincetext substring
Business Typebusiness_typeselect
Provinceprovinceselect
Statusstatusselect

Display Logic

  • Phone and website values are normalized before display.
  • Venue relationship is handled through form linkage even when the grid does not always show the venue id directly.
  • Bundled address/contact editors support facility management workflows.

5. Lifecycle Rules

  • Inactive/archive transitions are safer than destructive delete for venue-linked management history.
  • Venue relationships should remain intact during updates to preserve management displays.