System architecture

Verdanta is organised as four role workspaces on top of six domain services, a shared rule engine and one persistence layer.

Service topology

Workspaces, gateway and the domain services behind them.

┌───────────────┐   ┌───────────────┐   ┌───────────────┐   ┌───────────────┐
│  Employee     │   │  Employer     │   │  Provider     │   │  Platform     │
│  workspace    │   │  workspace    │   │  workspace    │   │  admin        │
└───────┬───────┘   └───────┬───────┘   └───────┬───────┘   └───────┬───────┘
        └───────────────────┴─────────┬─────────┴───────────────────┘
                                      ▼
                       ┌──────────────────────────────┐
                       │      Experience gateway      │
                       │  session · role · routing    │
                       └───────────────┬──────────────┘
                                       ▼
   ┌────────────┬────────────┬─────────┴────────┬────────────┬────────────┐
   ▼            ▼            ▼                  ▼            ▼            ▼
Catalog     Booking      Wallet &           Billing      Analytics    Notification
service     service      allowance          service      service      service
   │            │            │                  │            │            │
   └────────────┴────────────┴────────┬─────────┴────────────┴────────────┘
                                      ▼
                        ┌──────────────────────────┐
                        │   Persistence layer      │
                        │  activities · bookings   │
                        │  people · invoices       │
                        └──────────────────────────┘

Booking business flow

From catalog search to confirmation, settlement and reminders.

Employee                Booking service          Provider            Wallet
   │  search catalog           │                       │                  │
   ├──────────────────────────▶│                       │                  │
   │  request booking          │   capacity check      │                  │
   ├──────────────────────────▶├──────────────────────▶│                  │
   │                           │   hold allowance      │                  │
   │                           ├──────────────────────────────────────────▶
   │   status: pending         │                       │                  │
   │◀──────────────────────────┤   confirm / decline   │                  │
   │                           │◀──────────────────────┤                  │
   │   status: confirmed       │   settle or release   │                  │
   │◀──────────────────────────┼──────────────────────────────────────────▶
   │   reminder e-mail 24h     │                       │                  │
   │◀──────────────────────────┤                       │                  │

Data flow and relationships

How records relate as they move toward billing and analytics.

employers ──1:N──▶ employees ──1:N──▶ bookings ──N:1──▶ activities
    │                   │                  │                  │
    │                   │                  │                  └──N:1──▶ providers
    │                   └──1:1──▶ allowance ledger                        │
    └──1:N──▶ invoices ◀────────── commission engine ◀────────────────────┘
                                          │
                                          └──▶ analytics warehouse ──▶ reports

Rule engine

Every booking passes through an ordered rule chain. The first rule that rejects stops evaluation.

1. Allowance guard

WHEN booking.amount > employee.remainingAllowance

THEN Reject with ALLOWANCE_EXCEEDED and suggest lower-priced sessions.

2. Capacity guard

WHEN activity.booked >= activity.capacity

THEN Block booking, offer the waitlist and the next available slot.

3. Cancellation window

WHEN now > activity.startsAt - provider.cancellationHours

THEN Cancellation becomes chargeable; allowance is not refunded.

4. Auto-confirm

WHEN provider.autoConfirm && capacity available

THEN Booking moves straight from pending to confirmed.

5. Commission split

WHEN booking.status transitions to completed

THEN provider payout = amount × (1 − commissionRate); rest accrues to the platform.

6. Employer suspension

WHEN invoice.status = overdue for 30 days

THEN New bookings pause for that employer; existing bookings are honoured.

Booking state machine

draftpendingconfirmedcompleted·cancelleddeclined