Service Appointment
Service appointment schema for managing appointment bookings. Supports scheduling, calendar integration, and service provider assignment.
Schema: ServiceAppointmentSchema
Source: src/core/business-mgt/service-appointment.schema.ts
Attributes​
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | — | — | Unique identifier for the appointment |
businessServiceId | string | Yes | — | References Business Service being booked |
customerId | string | Yes | — | References Customer who booked |
startTime | number | Yes | — | Unix timestamp for appointment start |
endTime | number | No | — | Unix timestamp for appointment end |
duration | number | No | 30 | Appointment length in minutes |
totalPrice | number | No | 0 | Total service cost |
depositPaid | number | No | 0 | Deposit amount already paid |
status | enum | No | PENDING | Current appointment status. One of PENDING, CONFIRMED, IN_PROGRESS, COMPLETED, CANCELLED, or NO_SHOW. |
assignedUserAccountId | string | null | No | — | Service Person assigned to perform service |
calendarId | string | null | No | — | External calendar system ID |
calendarEventId | string | null | No | — | Event ID in external calendar |
calendarProvider | enum | null | No | — | Calendar system type. One of GOOGLE, MICROSOFT, or APPLE. |
cancelReason | string | null | No | — | Reason for cancellation |
serviceConversationConfigId | string | null | No | — | AI service conversation config ID |
createdAt | number | — | — | Unix timestamp when created |
updatedAt | number | — | — | Unix timestamp when last updated |
Example​
{
"id": "appt_abc123",
"businessServiceId": "svc_haircut",
"customerId": "cust_def456",
"startTime": 1709910000000,
"endTime": 1709912700000,
"duration": 45,
"totalPrice": 35.00,
"depositPaid": 10.00,
"status": "CONFIRMED",
"assignedUserAccountId": "user_stylist01",
"calendarId": "cal_primary",
"calendarEventId": "evt_xyz789",
"calendarProvider": "GOOGLE",
"createdAt": 1709856000000,
"updatedAt": 1709856000000
}
Create / Update Schemas​
| Schema | Description | Omits |
|---|---|---|
CreateServiceAppointmentSchema | For creating appointments | id, createdAt, updatedAt, status, cancelReason, serviceConversationConfigId |
UpdateServiceAppointmentSchema | For partial updates | All fields optional except id |