# Multi-till operations

## Recommended layout

| PC | Role | Notes |
|----|------|-------|
| Till 1…N | Electron POS | Own receipt + label printers; own till settings |
| Back office | Browser / admin | Products, stock, reports, backups |

## Setup per till

1. Install `Primewear-POS-Setup-*.exe`.
2. Set POS URL (e.g. `https://pos.store.local` or Laragon host).
3. Set receipt printer + XP-420B label printer.
4. Enable **Offline mode** in server Settings (once for the store).
5. Create a `pos_terminals` row per counter; cashiers select it at login/checkout.

## Sync / stock policy

- Server MySQL is the stock of truth.
- Offline sales decrement local cache optimistically.
- On sync, if server stock is insufficient → `rejected_insufficient_stock` → cashier review UI.
- Duplicate UUID sync is ignored (no double stock cut).

## Security notes

- Till API tokens are issued for the web session + terminal (Sanctum).
- Renderer has no Node integration (`contextIsolation`).
- Print/sync logs are local under the app userData folder.
- Prefer HTTPS for `posUrl` in production.
- Future hardening: move long-lived till secrets into `safeStorage` (Electron reports availability in Till settings).

## Backup

- Database backups are a **server** responsibility (Settings → Backup / hosting snapshots).
- Till PCs are not the backup source of truth.
