Skip to main content

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​

AttributeTypeRequiredDefaultDescription
idstring——Unique identifier for the configuration
fieldsarray<FieldDefinition>No[]Field definitions available at org level
groupsarray<FieldGroup>No[]Logical groupings for organizing fields
reuseDetailsbooleanNofalseWhether captured data can be reused across appointments
ensureEmailbooleanNofalseAlways include email field
ensurePhonebooleanNofalseAlways include phone field
createdAtnumber——Unix timestamp when created
updatedAtnumber——Unix timestamp when last updated

AppointmentAdditionalInfo​

Stores captured field values for a specific appointment.

Schema: AppointmentAdditionalInfoSchema

Attributes​

AttributeTypeRequiredDefaultDescription
idstring——Unique identifier for the record
organizationIdstringYes—Reference to the organization
businessServiceIdstringYes—Reference to the business service
appointmentIdstringYes—Reference to the appointment
customerIdstringYes—Reference to the customer
dataobjectNo{}Key-value store of captured field values
createdAtnumber——Unix timestamp when created
updatedAtnumber——Unix timestamp when last updated

FieldDefinition​

Individual field definition (from dynamic-fields).

AttributeTypeDescription
fieldKeystringUnique identifier for the field
fieldTypeDynamicFieldTypeField type (TEXT, NUMBER, DATE, SELECT, etc.)
labelstringDisplay label for the field
validationobjectValidation rules (required, min, max, pattern)
uiHintsobjectUI rendering hints (placeholder, helpText)
defaultValueanyDefault value for the field
optionsarrayOptions for SELECT/MULTISELECT fields
isActivebooleanWhether field is active
groupKeystringReference to field group

FieldGroup​

Logical grouping of fields.

AttributeTypeDescription
groupKeystringUnique identifier for the group
labelstringDisplay label for the group
descriptionstringGroup description
collapsiblebooleanWhether group can be collapsed
displayOrdernumberDisplay 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​

SchemaDescriptionOmits
CreateAppointmentFieldConfigSchemaFor creating org configcreatedAt, updatedAt
UpdateAppointmentFieldConfigSchemaFor updating org configAll fields optional except id
CreateAppointmentAdditionalInfoSchemaFor creating appointment dataid, createdAt, updatedAt
UpdateAppointmentAdditionalInfoSchemaFor updating appointment dataAll fields optional except id