Skip to main content

Booking services

The booking-services slice lets a professional list, create, edit, and remove the services offered on their own unarchived schedules. A service defines what a client or the professional books: its name, description, duration, price, and how many people can book the same start.

Ownership is checked through the schedule. A service on another professional's schedule, or on an archived schedule, cannot be read or changed and gives the same not-found result as a missing one.

Service fields​

FieldRule
Name1 to 100 characters, trimmed
DescriptionUp to 2,000 characters; may be empty
Duration15 to 480 minutes
Maximum bookings1 to 99 per start time
PriceOptional; a decimal amount with at most two fractional digits
CurrencyUAH or USD

The price is sent in major units as a decimal string and stored as an integer number of minor units, so 450.5 becomes 45050. The conversion never uses floating-point arithmetic. An amount too large to represent exactly is rejected. A service without a price is stored with no price, not as zero.

An edit replaces all fields of the service at once. Changing the maximum bookings affects only booking sessions created afterwards; see Booking persistence schema.

Removing a service​

Removal archives the service instead of deleting it. An archived service no longer appears in the owner's service list, cannot be edited, and cannot be chosen for a new manual or public booking.

Appointments keep the service details that applied when they were booked: name, duration, price, and currency are copied onto the appointment as a snapshot at booking time. Removing or editing the service later does not change those snapshots, so history still shows what was booked.