Turfi Platform Documentation
Official Turfi documentation portal for users, admins, and developers.
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
| column | type | nullable | default | notes | |
|---|---|---|---|---|---|
| address_line1 | string \ | null | yes | null | Base table field. |
| address_line2 | string \ | null | yes | null | Base table field. |
| business_type | string \ | null | yes | null | Base table field. |
| city | string \ | null | yes | null | Base table field. |
| contact_email | string \ | null | yes | null | Base table field. |
| 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. | |
| is_active | boolean | no | database default or generated | Base table field. | |
| key | string | no | none | Base table field. | |
| location | unknown | no | database default or generated | Base table field. | |
| name | string | no | none | Base table field. | |
| phone | string \ | null | yes | null | Base table field. |
| postal_code | 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. |
| updated_at | string \ | null | yes | null | Base table field. |
| website | string \ | null | yes | null | Base 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)
| name | purpose |
|---|---|
| v_businesses | Curated admin registry read model for businesses. |
3. Import Contract
Accepted Columns
keynameslugvenue_keyvenuevenue_idbusiness_typecityprovincecountrywebsitestatus
Resolution Rules
venue_keyresolves by venue key.- Non-suffixed venue input resolves by
key, thenslug, thenname.
Required Fields
name
Optional Fields
keyslugvenue_keyvenuevenue_idbusiness_typecityprovincecountrywebsitestatus
Failure Rules
- Missing
namefails immediately. - Venue mismatches route through relationship resolution before write.
- Status or business-type normalization failures fail validation.
4. Frontend Registry Mapping
Grid Columns
| label | field | source |
|---|---|---|
| Name | name | v_businesses.name / businesses.name |
| Business Type | business_type | businesses.business_type |
| Address | address | business row.address / address_line1 |
| City | city | businesses.city |
| Province | province | businesses.province |
| Postal Code | postal_code | businesses.postal_code |
| Country | country | businesses.country |
| Phone | phone | normalized businesses.phone |
| businesses.email | ||
| Website | website | normalized businesses.website |
| Status | status | businesses.status / derived is_active |
Filters
| filter | field | type |
|---|---|---|
| Search | name, business_type, address, city, province | text substring |
| Business Type | business_type | select |
| Province | province | select |
| Status | status | select |
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.