Data model
The Keystone lists, their relationships, and the lifecycles behind Openfront Barbershop.
The schema has 49 lists in features/keystone/models.
Relationships
Shopowns nearly everything: memberships, chairs, barbers, customers, services, products, appointments, policies, queue entries, transactions, commissions, suppliers, and lots.ServiceCategoryhasService.Servicelinks toBarberthroughspecialistsand hasPractitionerCredentialrequirements.Barberhas aBarberChair,BarberSchedulerows (weekly hours),ScheduleException,StaffShift, andCommission.Appointmentlinks customer, barber, chair, service, optionalWalkInQueueEntry, and oneCheckoutTransaction. It hasAppointmentLineItem,PaymentSession,NoShowEvent, andAppointmentChangeEvent.CheckoutTransactionhasProductSaleLine,Tip,CashRefund,PackageUsage, andCommission.Commissionbelongs to aCommissionPayout.CustomerhasCustomerNote,GroomingNote,WaiverForm,CustomerPackagebalances, andMembershipEvent.ProducthasInventoryLotandInventoryMovement.PaymentProviderhasPaymentSession,PaymentReconciliation, andPaymentWebhookEvent.
Lifecycles
| Entity | States |
|---|---|
| Appointment | requested, confirmed, checked_in, in_chair, completed, cancelled, no_show |
| Walk-in | waiting, texted, in_chair, served, left |
| Waitlist | waiting, notified, booked, expired |
| Commission | projected, approved, paid, voided |
| CheckoutTransaction | open, paid, partially_refunded, refunded, voided |
| CustomerPackage | active, paused, used_up, expired, cancelled |
| PractitionerCredential | active, suspended, revoked, expired |
| BookingPolicy | active, retired |
| ShopMembership | invited, active, suspended, revoked |
Commands and ledgers
Many lists reject generic create and update. They change through named commands that take an idempotency key, write the ledger row, and record a LifecycleOutboxEvent. System ledgers such as GuestBookingCommand, PaymentWebhookEvent, and LifecycleOutboxEvent are read only in the dashboard.
Money is stored in whole cents.