---
name: Booking flow pricing
description: How booking totalPrice is derived and validated in the model-directory app
---

Booking `totalPrice` is always computed on the server from the **provider's per-model price**, never trusted from the client. Currency is Bangladeshi Taka (৳), not dollars.

Rules:
- Each profile sets its own `price1h` / `price2h` / `priceFullDay` (integer Taka). The booking total = the provider's price for the chosen `duration`.
- `customer_location` adds a flat travel fee `CUSTOMER_LOCATION_FEE = 500৳`; `in_studio` adds nothing.
- Create-booking requires `profileId`, `serviceId`, `duration`, `locationType`, and `scheduledAt`. The service must exist and be active, AND the provider must be `approvalStatus="approved"` and `isActive=true` (booking unapproved/inactive providers is rejected with 400).
- Reject partial/invalid payloads with 400 instead of letting them reach the DB. If the provider has not set a price for the chosen duration, reject with 400.

**Why:** A mandatory multi-step flow must not produce inconsistent records (e.g. confirmed booking with null price), price must not be client-controlled, and the admin-approval gate must hold even against direct ID access.

**How to apply:** If the frontend wizard shows a live price preview, it must mirror the same per-provider price + travel-fee constant as the server, but the server value is authoritative. Keep the two in sync when the fee changes.
