Appointment Field Configuration
Dynamic field configuration schemas for collecting additional appointment information. Implements a three-level hierarchy for flexible field management.
Source: src/core/business-mgt/appointment-field-config.schema.ts, src/core/business-mgt/appointment-additional-info.schema.ts
Hierarchy Overview​
Organization Level (AppointmentFieldConfigSchema)
│
â–¼ services inherit via inheritedFieldKeys
Service Level (ServiceAppointmentFieldConfigSchema)
│
â–¼ stores captured values
Appointment Level (AppointmentAdditionalInfoSchema)
AppointmentFieldConfig​
Organization-level field definitions available to all services.
Schema: AppointmentFieldConfigSchema
Attributes​
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | — | — | Unique identifier for the configuration |
fields | array<FieldDefinition> | No | [] | Field definitions available at org level |
groups | array<FieldGroup> | No | [] | Logical groupings for organizing fields |
reuseDetails | boolean | No | false | Whether captured data can be reused across appointments |
ensureEmail | boolean | No | false | Always include email field |
ensurePhone | boolean | No | false | Always include phone field |
createdAt | number | — | — | Unix timestamp when created |
updatedAt | number | — | — | Unix timestamp when last updated |
AppointmentAdditionalInfo​
Stores captured field values for a specific appointment.
Schema: AppointmentAdditionalInfoSchema
Attributes​
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | — | — | Unique identifier for the record |
organizationId | string | Yes | — | Reference to the organization |
businessServiceId | string | Yes | — | Reference to the business service |
appointmentId | string | Yes | — | Reference to the appointment |
customerId | string | Yes | — | Reference to the customer |
data | object | No | {} | Key-value store of captured field values |
createdAt | number | — | — | Unix timestamp when created |
updatedAt | number | — | — | Unix timestamp when last updated |
Related Types​
FieldDefinition​
Individual field definition (from dynamic-fields).
| Attribute | Type | Description |
|---|---|---|
fieldKey | string | Unique identifier for the field |
fieldType | DynamicFieldType | Field type (TEXT, NUMBER, DATE, SELECT, etc.) |
label | string | Display label for the field |
validation | object | Validation rules (required, min, max, pattern) |
uiHints | object | UI rendering hints (placeholder, helpText) |
defaultValue | any | Default value for the field |
options | array | Options for SELECT/MULTISELECT fields |
isActive | boolean | Whether field is active |
groupKey | string | Reference to field group |
FieldGroup​
Logical grouping of fields.
| Attribute | Type | Description |
|---|---|---|
groupKey | string | Unique identifier for the group |
label | string | Display label for the group |
description | string | Group description |
collapsible | boolean | Whether group can be collapsed |
displayOrder | number | Display order among groups |
Example​
Organization Field Config​
{
"id": "afc_abc123",
"fields": [
{
"fieldKey": "allergies",
"fieldType": "TEXT",
"label": "Known Allergies",
"validation": { "required": false },
"uiHints": { "placeholder": "List any allergies" },
"groupKey": "medical"
},
{
"fieldKey": "emergency_contact",
"fieldType": "TEXT",
"label": "Emergency Contact",
"validation": { "required": true },
"groupKey": "contact"
}
],
"groups": [
{
"groupKey": "medical",
"label": "Medical Information",
"collapsible": true,
"displayOrder": 1
},
{
"groupKey": "contact",
"label": "Contact Information",
"collapsible": false,
"displayOrder": 0
}
],
"reuseDetails": true,
"ensureEmail": true,
"ensurePhone": true,
"createdAt": 1709856000000,
"updatedAt": 1709856000000
}
Appointment Additional Info​
{
"id": "aai_xyz789",
"organizationId": "org_abc",
"businessServiceId": "svc_haircut",
"appointmentId": "appt_def456",
"customerId": "cust_ghi789",
"data": {
"allergies": "Latex",
"emergency_contact": "Jane Doe - 555-1234",
"preferred_pressure": "Medium"
},
"createdAt": 1709856000000,
"updatedAt": 1709856000000
}
Create / Update Schemas​
| Schema | Description | Omits |
|---|---|---|
CreateAppointmentFieldConfigSchema | For creating org config | createdAt, updatedAt |
UpdateAppointmentFieldConfigSchema | For updating org config | All fields optional except id |
CreateAppointmentAdditionalInfoSchema | For creating appointment data | id, createdAt, updatedAt |
UpdateAppointmentAdditionalInfoSchema | For updating appointment data | All fields optional except id |