> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maska.co.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Admin Settings

> Configure outlets, manage slots and zones, and control daily availability.

The settings page is at `/admin/settings`. It requires an active staff session —
unauthenticated users are redirected to the login page.

## Owner vs staff access

The settings page adapts based on your role:

* **Owners** see two tabs: **Outlet config** and **Day controls**. Owners can create,
  edit, activate, deactivate, and permanently delete slots and zones.
* **Staff** see only **Day controls**. Staff can block dates, mark slots as sold out,
  and adjust per-slot zone capacities, but cannot modify the outlet structure.

<Note>
  Roles are managed per outlet in the `res_staff` table. The first user to sign in
  before any staff records exist is treated as an owner (bootstrap mode).
</Note>

## Outlet config (owners only)

This tab lets you manage the time slots and seating zones that guests can book.

### Slots

Slots are time windows guests can reserve (e.g. "Dinner 19:30–21:30").

**Adding a slot**

1. Tap **Add slot**.
2. Enter a name, start time, and end time.
3. Tap **Create slot**.

When a slot is created, capacity rows are automatically generated for every active
zone, using each zone's `maxCovers` as the default.

**Editing a slot**

1. Tap **Edit** on the slot card.
2. Modify the name or times.
3. Tap **Save changes**.

**Activating / deactivating**

* **Deactivate** — hides the slot from guest bookings. Existing bookings remain intact.
* **Activate** — restores the slot for new bookings.

**Deleting a slot**

1. Tap **Delete** on an inactive slot.
2. Confirm with **Yes, delete** in the confirmation row that appears.

<Warning>
  Permanent deletion is only allowed if the slot has **zero bookings ever**.
  If any bookings (past or future) reference the slot, deletion is blocked and
  you must deactivate instead.
</Warning>

### Zones

Zones are seating areas within the restaurant (e.g. "Indoor", "Outdoor", "Bar").

**Adding a zone**

1. Tap **Add zone**.
2. Enter a name and max covers.
3. Tap **Create zone**.

When a zone is created, capacity rows are automatically generated for every active
slot, using the zone's `maxCovers` as the default.

**Editing a zone**

1. Tap **Edit** on the zone card.
2. Modify the name or max covers.
3. Tap **Save changes**.

**Activating / deactivating**

* **Deactivate** — hides the zone from guest bookings and removes it from the Day
  controls slot capacity list. Existing bookings remain intact.
* **Activate** — restores the zone for new bookings.

**Deleting a zone**

1. Tap **Delete** on an inactive zone.
2. Confirm with **Yes, delete**.

<Warning>
  Permanent deletion is only allowed if the zone has **zero bookings ever**.
  If any bookings reference the zone, deletion is blocked.
</Warning>

## Day controls

Block or unblock an entire date to stop guests from booking on that day.

1. Select a date from the 7-day scrollable strip.
2. Optionally enter a reason (e.g. `Private event`, `Maintenance`, `Public holiday`).
3. Tap **Block selected date** — no new bookings can be made for that date.
4. To re-open, tap **Unblock selected date**.

The current block status is shown below the buttons. If a block exists, the reason
is displayed (if one was entered when blocking).

<Note>
  Blocking a date does not cancel existing confirmed bookings. It only prevents
  new booking requests from being submitted.
</Note>

## Slot capacities

Per-slot, per-zone capacity controls let you adjust how many covers are available
in each zone for each time slot, and mark individual slots as sold out for a
specific date.

Only **active zones** appear in the slot capacity list. Deactivated zones are
hidden from Day controls entirely.

### Sold out toggle

Each slot card has an **Open / Sold out** indicator for the selected date.

* **Mark sold out** — removes all remaining availability for that slot on that date
* **Reopen slot** — restores availability

### Max covers

Each zone within a slot has a number input showing the current maximum covers.
Edit the value and tap **Save** to update it. The change takes effect immediately
for new booking requests.

<Warning>
  Reducing max covers below the number of already-confirmed bookings for that slot
  does not cancel those bookings — it only affects future requests.
</Warning>

## Navigation

* **Back to bookings** — returns to the Admin Dashboard
* **Sign out** — ends the session and redirects to login
