← Anmelden

Entwicklungsstand

# Progress

- 2026-11-16 Jarwis: environment created (repo, Postgres 18 + Node 24 containers, DEV URL, migration runner, plan). Next: WP 0 inventory.
- 2026-11-16 Jarwis: central start page (/) with the four areas, login page per area (/admin/login, /hotel/login, /sales/login, /customer/login) with DEV demo login, links to the old APEX version, status page (/status). Password protection removed (Sajjad). Real login/roles = WP 2.
- 2026-11-16 Palma: **WP 0 inventory done** (branch wp0-inventory, nothing built). `docs/inventory/`: pages/authorizations/shared components per app (100: 34 pages, 200: 67, 300: 14, 400: 6, 1999: 3, 750: 16), `db.md` (87 tables, 117 packages, 22 triggers, change scripts 0001-0062), `portal-api.md` (≈45 portal endpoints in 3 ORDS modules), `jobs.md` (6 scheduler jobs + app 1999 backup). Generators: `scripts/inventory-apex.py`, `scripts/inventory-db.py`. Findings: Oracle test copy `wess-db` is an old snapshot (35 tables, small data) → question for Sajjad on WP 9 data source; `rup.portal.v1` handlers only partly in git (read `RUP_API_PKG` in WP 7). Standard check: 24 pending updates, Telegram not set up, Oracle connection fails (not fixed, waiting for Sajjad). Next: WP 1 schema.
- 2026-11-16 Palma: **WP 1 schema done** (branch wp1-schema). 65 tables, 74 FKs, generic `history` table (31 tables), status/touch triggers, tenant RLS (37 tables, role `hotel2_tenant`), seeds (roles, rights, status lookups, parameters). Generated from the Oracle DDL by `scripts/gen-schema.py` + `scripts/gen-rls.py` (re-runnable); migrations 0002-0011 applied on DEV. Tests: `scripts/test-schema.sh` (fresh scratch DB + `test/db/schema-test.sql`: defaults, history without passwords, status, room number, FKs, tenant A/B isolation, sales scope, seeds) – passed. Decisions: old prefixed column names stay (1:1 mapping for import), flags → boolean, e-mail → citext, password hash column renamed `*_password_hash` and not migrated (reset by mail), see `docs/schema.md`. Open for later WPs: views (V_RESERVATION etc.) with the module that needs them; portal `RUP_*` seed content (WP 7/9). Next: WP 2 core (login, roles, tenants).
- 2026-11-16 Palma: **WP 2 core done** (branch wp2-core, stacked on wp1-schema). Real login for the four areas (argon2id; customer = number + date of birth), lock 5/15 min, IP rate limit, server-side sessions (8 h / 30 min idle), CSRF, roles → rights → menu, tenant transactions (role `hotel2_tenant` + RLS), read-only support view for platform staff, invite/reset links, optional e-mail-code MFA, EN/DE i18n, audit log, mail queue with allow-list (needs `SMTP_URL` for real sending), DEV demo sign-in on the existing login pages. Start page and per-area login pages kept and extended. Migration 0012 (sessions + least-privilege grants: the tenant role cannot read password hashes, sessions, tokens, history). Docs: `docs/core.md`. Tests: `scripts/test.sh` = 23 tests passed (isolation, lock, idle, CSRF, reset flow, MFA, mail modes, demo only in DEV). Screenshots `docs/evidence/wp2/`. DEV app container restarted once (its `--watch` does not reload). Questions: customer login stays number + date of birth for now (security weak, see open.md). Next: WP 3 Admin (app 100).
- 2026-11-16 Palma: **WP 3 Admin done** (branch wp3-admin, stacked on wp2-core). All 33 pages of app 100 mapped (docs/inventory/app-100.md): dashboard with status counters / needs attention / recent activity; companies (+logo upload, employees, history, CSV), company users, super admins, sales users (invitation mail on create, resend button), contracts (approval recorded once), onboarding (stage rules), parameters (secrets masked, no create/delete), cancellation policies, amenities, all reservations (view `v_reservation`, security_invoker so RLS applies), portal accounts (block/release with reason + audit), mail queue (resend), system audit, archive candidates, change own password. New generic CRUD framework (`docs/core.md`). Migration 0013 (views). 37 tests green (`scripts/test.sh`), screenshots `docs/evidence/wp3/`. Improvements over APEX: company address + invoice address are saved (old bug), users get an invitation link instead of a password set by the admin, last platform admin and own account cannot be deleted, roles validated and required, email unique case-insensitive, postcode no longer numeric-only. Open: page 9980 Help (needs `page_help` content, WP 9); direct password setting by admins intentionally not rebuilt. Next: WP 4 Hotel management (app 200).
- 2026-11-16 Palma: **WP 4 Hotel management done** (branch wp4-hotel). All 67 pages of app 200 mapped (docs/inventory/app-200.md; only page 9980 Help stays open). New shared **booking engine** `src/modules/booking/` (pricing, quote/booking/cancellation, staff reservation actions, invoices/DATEV/XRechnung) = port of RUP_PRICING_PKG / RUP_BOOKING_PKG / RESERVATION_PKG / INVOICE_PKG, reused by WP 7. Hotel area: dashboard, reservations (+counters, detail with actions, new reservation with price check, arrivals, warnings, calendar, Meldeschein), housekeeping, tasks, guests + preferences, hotels/rooms/room types/rate plans/prices/promos/occupancy rules/price preview/set prices, packages/services/room services, portal profile, photos, amenities, reviews, messages, invoices/payments/DATEV/XML, reports, company + colleagues, document uploads. Migrations 0014 (view) and 0015 (guest RLS insert fix). DEV demo company now has a demo hotel with rooms, prices, rate plans and 4 reservations (`src/dev/seed-hotel.js`). 55 tests green (`scripts/test.sh`), 18 new in `test/int/hotel.test.js`. Screenshots `docs/evidence/wp4/`. Details and differences: `docs/hotel.md`. Next: WP 5 Sales (app 300).
- 2026-11-16 Palma: **WP 5 Sales done** (branch wp5-sales, stacked on wp4-hotel). All 14 pages of app 300 mapped (page 9980 Help open). Leads with stages, follow-up flags and filters, my customers (shared guest form, only own by RLS, bookings of the customer), dashboard with own figures. Differences: reps no longer see all reps' provision. 59 tests green (4 new in `test/int/sales.test.js`). Docs `docs/sales.md`. DEV demo sales user has 3 demo leads. Next: WP 6 Customer (app 400).
- 2026-11-16 Palma: **WP 6 Customer done** (branch wp6-customer, stacked on wp5-sales). All 6 pages of app 400 mapped (login is WP 2; dashboard built; page 9980 Help open). Dashboard: bookings and upcoming stays, payments, spend, recent bookings, most booked packages/services, per month, status overview, profile; every query bound to the session's customer id. 62 tests green (3 new in `test/int/customer.test.js`). Docs `docs/customer.md`. DEV demo customer has 2 demo bookings. Next: WP 7 portal API (rup.portal.v1).
- 2026-11-16 Palma: **WP 7 Portal API done** (branch wp7-portal-api, stacked on wp6-customer). `/portal/v1/` (alias `/api/portal/v1/`) + `/oauth/token`: public catalog (health, fx, destinations, suggest, search, hotel, offers, reviews, images) and all secure operations (quote, bookings, group, detail, cancel preview/cancel, my bookings, pre-check-in, reviews, favourites, contact, outbox, accounts incl. GDPR delete) with the shapes and error codes of `RUP_API_PKG`. OAuth client credentials (table `portal_api_client`, `scripts/portal-client.js`, HMAC bearer tokens 1 h). Migrations 0016 (unaccent, API clients, FX seed) and 0017 (review ratings numeric(3,1)). **The real portal (production image in a throw-away container, nothing of production touched) ran against the new API: existing Playwright suites 55 of 57 checks pass (the 2 misses are demo data)**; evidence `docs/evidence/wp7/portal-e2e.md`, docs `docs/portal-api.md`. 71 tests green (9 new in `test/int/portal.test.js`). Not rebuilt: legacy modules wess.website.v1 / website-booking (question in open.md). Not yet diffed against Oracle answers (needs the imported data, WP 9). Next: WP 8 Jobs, WP 9 data import, WP 10 tests (not part of this order).

- 2026-11-16 Palma (session Palma Neu, Awais): **UI redesign in the Lumen look + single login** (branch ui-lumen, on top of wp7-portal-api, not committed yet). Reference: the Lumen app (31-70-116-136, demo login checked: iris/teal tokens, light + dark, sidebar shell, split login). `public/app.css` rewritten (same class names, so all modules are restyled), new shell in `src/web/layout.js` (sidebar with only the menu entries the user may see, top bar, user, language, light/dark mode via `public/mode.js`, CSS-only mobile menu). **One login page `/login`**: tabs Staff & partners (e-mail + password) and Guest (number + date of birth); the area follows from the account (`areasForEmail`), an e-mail with accounts in several areas is tried area by area; DEV demo buttons per area. Old `/<area>/login` URLs show the same page and still work. 72 tests green (1 new). DEV app restarted. Open: no browser on the server, so no screenshots yet - needs a visual check by Awais; icons per menu entry, dashboard KPI cards and table polish still to do per page.
- 2026-11-16 Palma (Awais): **Enterprise look + login as start page** (branch ui-lumen, not committed). Shell switched to Lumen concept 02 "Modern Enterprise": dark app bar (DEV badge, area, language, light/dark, user menu), grouped navigation tree (`menuGroups` in `src/web/menu.js`, groups by menu order), breadcrumbs, page head, compact 6px/4px radii, dense tables with sticky headers, calmer status tiles. `/` now redirects to `/login`; the login page lists every module with its roles (read from `access_roles`, legacy roles hidden) and a DEV demo button per module; links to portal + status in its footer. The old "New version / Old version" start page is gone; old APEX apps are reached by direct links (see chat). Responsive check with Playwright (phone 375, tablet 820, desktop 1440): no horizontal overflow on login, hotel (dashboard, reservations, calendar), admin (dashboard, companies), sales, customer; phone menu drawer and dark mode checked by screenshot. 72 tests green.
- 2026-11-16 Palma (Awais): **List tools + menu icons** (branch ui-lumen, not committed). Ideas taken from the WESS 2.0 app as an example only (not copied): every generic list (`renderList` in `src/web/crud.js`, so all admin/hotel/sales lists) now has the count "1–50 of 53", search, a **Filter drawer** (the list's own filters + a date range on the created date: any / today / this week / this month / last 30 days / custom from-to; all filters work together; active-filter badge), a **column chooser**, **saved views** and CSV export. State of filters is the URL (shareable); columns and saved views are kept per browser (localStorage) - a server-side per-user store would need a new table. Navigation entries have Lucide icons (`src/web/icons.js`, ISC licence). EN/DE texts added. Browser-checked (desktop + 390 px phone): date range, badge, hide column, save + reopen view, no horizontal overflow. 72 tests green. Not done yet: reports page as a card gallery, KPI hero strip on dashboards, global search, roles overview page (no APEX page for it - would be new, to be decided by Sajjad).
- 2026-11-16 Palma (Awais): **Forms, cards view, report tiles** (branch ui-lumen, not committed). Ideas from WESS 2.0 (example only): all generic forms use a two-column grid, required marks (*), a sticky save bar and invalid-field highlight; every list has a **Cards / List** switch (`?view=cards`: avatar, title, subtitle, status, 4 key facts per record); the hotel reports page (APEX page 112, still one page) has KPI tiles with icons and the filter bar in the list-tool style. 72 tests green; browser-checked at 1440 and 390 px (no overflow). Not done: action-list start page ("needs attention" with Open buttons) and count badges in the menu, global search, side-panel forms (forms still open as full pages), per-user saved views on the server.
- 2026-11-16 Palma (Awais): **WESS-like layout + colour themes** (branch ui-lumen, not committed). On Awais's request the shell now follows the layout of WESS 2.0 (own S&H product, checked at dev.wessapp.de office/admin with its DEV demo users): orange DEV strip, top bar with brand, quick search (Ctrl+K over the menu entries, navigation only), language, dark mode, user menu; sidebar with brand card (area, company, text), sections with icons, optional count badge (`item.badge`, not filled yet), user block and "collapse menu" (icon rail, key `[`, state in localStorage); page head with breadcrumb above the serif title; Fraunces + Nunito Sans self-hosted in `public/fonts` (OFL). **Colour themes** in the user menu: palm (default, teal green), iris, burgundy (WESS), each with dark mode; kept in localStorage. Login page uses the theme gradient. 72 tests green; browser-checked at 1440 and 390 px, collapsed rail, command palette, themes, dark. Open: notifications bell + count badges (needs data per page), help page (APEX 9980 still open), side-panel forms, KPI hero strip on dashboards, global data search, per-user saved views/theme on the server.
- 2026-11-16 Palma (Awais): **Dashboard KPI strip + action list** (branch ui-lumen, not committed). New shared widgets `src/web/widgets.js`: KPI strip (gradient band with big numbers, `heroTile`/`kpiStrip`) and "needs attention" action list (`actionRow`/`actionCard`: icon, text, Open button, count badge, empty state). Same data as before on all four dashboards: hotel (today: arrivals, departures, in house, open requests + 48 h new), admin (status counters per object), sales (6 key figures), customer (bookings, upcoming stays, payments, spend). Old per-status coloured tiles removed. Three tests adapted to the new markup (admin counters, sales conversion, hotel "Arrivals today"); 72 green. Still open: notification bell, count badges in the menu, side-panel forms, help page (APEX 9980), global data search, per-user saved views/theme on the server.
- 2026-11-16 Palma (Awais): **Demo data DE/AT/CH + public site + browser language** (branch ui-lumen, not committed). (1) `src/dev/seed-dach.js` + `dach-data.js` (run in DEV start, `DEMO_DACH=0` to skip; `node scripts/seed-dach.js`): 13 hotels (6 DE, 4 AT, 3 CH) with German/English texts, 91 photos, amenities, 48 room types / 163 rooms, seasonal prices (summer/winter), rate plans, promo codes, 8 packages, extras, 30 guests, ~170 reservations (past, in house, upcoming, requests, options, cancelled), 65 reviews. Photos: 10 locations from Wikimedia Commons (credit + licence stored in `rhim_credit`, shown on the hotel page) and our own portal photos (`src/dev/demo-images`, WebP 1200 px q82, `credits.json`). **No images were generated** (rule: test image + Sajjad's OK first). (2) Public site: `/` (hero search, destinations, top hotels, themes, reasons to book), `/hotels` (search with destination/dates/guests, filters: stars, price, rating, facilities, free cancellation, breakfast, pets; sort; paging), `/hotels/<slug>` (gallery, facilities, rooms with live prices for the dates, reviews, location, house rules, photo credits), `/book` (summary + guest form -> booking engine, channel WEB, pay at hotel, confirmation page), `/photos/<id>`; sign-in via `/login` (button in the header). Reads through the portal catalog (same visibility rules). (3) Language: German or English from the browser (`Accept-Language`), `?lang=` and the saved choice win, English when the browser language is not offered (`browserLang` in `src/core/i18n.js`). 77 tests green (5 new public + 1 language). Open before go-live: imprint/privacy/terms pages (texts needed from Sajjad, see skill recht-webseiten), real e-mail sending (allow-list only), booking by guest account, map (OpenStreetMap link only, no embedded map because of the CSP), DACH VAT/tax values are demo values.
- 2026-11-16 Palma (Awais): **Login page with hotel map** (branch ui-lumen, not committed). The left side of `/login` now shows what the platform is about: headline "Hotels in Germany, Austria and Switzerland" (DE/EN), a map of the three countries (outlines Natural Earth 1:50m, public domain, `public/dach-map.svg`, projection in `src/web/dach-map.js`) with one pulsing dot and city label per published hotel (each links to its hotel page), the three best-rated hotels as photo cards and a "Browse all hotels" link. Data comes from the published hotels (cached for a minute in `loginHotels()` in `src/app.js`). Reduced motion respected; on phones the left side is a compact header. 77 tests green.
- 2026-11-16 Palma (Awais): **Detail pages, documents, history and audit in the WESS style** (branch ui-lumen, not committed). Studied WESS 2.0 office (customer page, "Akte" with Anmerkungen / Dokumente / E-Mails / Verlauf, global Änderungsprotokoll, Anmeldeprotokoll) and applied the ideas: (1) every form (`renderForm`, `src/web/crud.js`): sticky header (record name, number chip, status, **Back / Save / More as icon + text, icon only on phones**), field sections as cards (General, Contact, Address, Rules, Notes, Status - assigned by field name), "On this page" navigator on the right (scroll-aware; chips on phones), tabs Details / Related / Documents / History, two-column fields with required marks, short select lists (up to 4 values) as segmented buttons, yes/no as switches, locked fields with a lock icon. The duplicate title (page title + card title + form title) is gone. (2) Lists: short status filters become tabs with counts, New / Filter / Columns / Views / Export in one bar. (3) **History** is a timeline per day: who, chip created / changed / deleted / restored, old -> new with field labels. (4) **Documents** (`src/web/documents.js`): drop area (drag & drop or click, max 25 MB), type and content check (extension decides, images and PDF must match their bytes; html/svg/exe/js rejected), thumbnails / file icons, image preview in a dialog, PDF opens in the browser, download, delete, per-record tab with count; tenant rules of `uploads` apply; every upload / view / download / delete is written to the activity log. The older hotel upload panel (types + remark) uses the same look; hotel photos no longer show up there. (5) Admin audit: colour chips with icons per action, system actors muted, source tabs with counts. (6) Phone: fixed bottom tab bar (area quick links + More). Seeds: upload types (contract, invoice, ...). 81 tests green (4 new for documents). Not done: summary tiles at the top of detail pages, "notes" and "e-mails" sub-tabs of the WESS record file (notes with @mentions would be a new feature), virus scan of uploads, per-user saved views on the server.
- 2026-11-17 Palma: **Debug mode (tester feedback) – pilot admin** (branch wp-debug-mode, worktree /opt/wess-hotel-2-debug). Bar with Screenshot / Area / Element, automatic voice recording, tester picker, My/All reports with audio + marked screenshot + context, status flow, ZIP export (md, docx, json, screenshots, audio). Generic: on in all areas via `appPage()`. DEV only (404 otherwise, proven by test). Migration 0090, `scripts/debug-process.js` stub (Whisper = TODO). 3 new integration tests green + Playwright run with fake microphone (`scripts/debug-e2e.py`, all checks passed). Docs `docs/debug-mode.md`. Next: Awais/Sajjad try it on the DEV URL; transcription (Whisper) as a later task; then roll out to the other areas (nothing to build, check each page type).
- 2026-11-16 Palma (Awais): **Polish and full QA pass** (branch ui-lumen, after commit 2ec56d8; not committed). Changes: (1) facilities of hotels and room types as selectable **cards with icons** per category (live counter, all / none), option lists of forms (roles etc.) as selectable pills; (2) hotel photos page as a **gallery** with large photos, cover badge, caption, hotel and credit (`defaultView: 'cards'`, `card()` per list); (3) **Active / Inactive switch in the record header** (one click, POST `<path>/<id>/active`, history records it, form keeps the value so saving never flips it), active / inactive as badges in lists; (4) New button always in the list bar (`newPath` for custom pages, panels use the same icon button, icon only on phones); (5) dates in the local format (21.06.2027), never split over two lines; raw codes (ROOM_ONLY) readable; button-style selects only for short labels, otherwise drop-down; long labels and long e-mails can no longer widen the page; title chip no longer repeats the title; (6) **documents on guest records** (migration 0018, extra RLS policy for CUSTOMER uploads). **QA:** `crawl` of every menu page, first record and "new" page of all four areas plus the public site at 390 / 820 / 1440 px: 279 page loads, 0 layout or image problems (the only "bad" entry is the intended 404 page); 5 real defects found and fixed on the way (overflowing select buttons, long labels, long e-mail, duplicate chip, raw codes). **Real-world browser scenarios** `scripts/e2e.sh` (test/e2e/scenarios.py, Playwright image, screenshots in docs/evidence/e2e): 12/12 pass - guest books on the public site; hotel finds and cancels the booking; hotel creates / edits / deactivates a guest, uploads a document, history; package create / delete; facilities cards save; photo gallery; sales lead; admin audit; guest area; phone (bottom tabs, icon-only buttons, no sideways scroll); tablet; language / theme / sidebar / quick search. `scripts/e2e-clean.js` removes the E2E test records afterwards. Tests: 85 green (4 new in test/int/ui.test.js).
- 2026-11-18 Palma (Awais): **List toolbar like WESS, no delete concept, language menu** (branch ui-lumen, not committed). (1) Toolbar order as in WESS: [Cards|List icons] · count · search (grows, suggestions dropdown from `?format=suggest`, arrow keys) · **Active switch** (on = only active, off = active + inactive; `?act=`) · Filters · Columns · Views · Download; the **New button sits in the page head** (`data-pagenew`, moved by `appShell`; icon-only on phones). Card view uses the name as title and the number as sub line. (2) **No delete anywhere in the UI**: delete/restore buttons, `/delete` + `/restore` routes and the "Not deleted / Deleted / All" filters are gone; records are Active or Inactive (header switch, `/active` route). Legacy `*_deleted_yn` rows never show. Guards that protected deletion now protect deactivation (own account, last platform admin) via `def.beforeDeactivate`. New migration 0019 adds `*_active_yn` to room, room type, rate plan, amenity, cancellation policy, lead (inactive rooms/room types/rate plans are not offered by the booking engine or the public site). A form that does not carry the active field keeps the value (new records start active; the field is not shown on "new"). (3) **Language menu** in the top bar: Automatic (browser) / English / Deutsch (`?lang=auto` forgets the saved choice). Tests: ui.test.js (toolbar, language), updated admin/hotel/sales tests, e2e scenario 4 rewritten. Debug-mode tests (debug.test.js 403 vs 401) fail since commit c770b19 (public-site debug mode) - not from this change.
- 2026-11-18 Palma (Awais): **Admin Start, Dashboard and Notices like WESS 2.0 Super Admin** (branch ui-lumen, not committed). Studied dev.wessapp.de (Super admin: Start, Dashboard, Notices) read-only. (1) `/admin` = Start: greeting + weekday/date, hide-able "Your start page" banner, Notices card (top 5, Open button, ⋯ menu), key figures (companies, hotels, active users, signed in now), "Coming up" (arrivals, option deadlines, requests, contracts ending), "Your access" + "Quick links", "Your rights" checklist from the rights matrix. (2) `/admin/dashboard`: strip of 4 key figures with trend + sparkline, "as of … · next update in N min" (30 min cache per user and filter, `?refresh=1`), tile search, company/hotel filter, 6 sections / 19 tiles (overview, revenue & bookings, ADR, cancellations, web share, occupancy, rooms, rating, content quality, guests, reviews, requests, mail, tasks, notices, access) with real data (view `v_reservation`, RLS applies), pin tiles (kept per browser). Trend = last 3 months vs the 3 before. (3) `/admin/notices`: urgency + area chips with counts, groups Urgent / Do soon / Good to know, rows with icon, Open, examples (chevron) and ⋯ menu, "N checks". 30 checks in `src/modules/admin/notices.js` (company invoice address / onboarding / no user, contracts expired / draft / ending, hotels without photo / rights / facilities / room type / rate plan / not published / not on map, booking requests, options, missed arrivals, failed / stuck / suppressed mail, users never signed in, old invitations, guest-account deletion requests, locked accounts, guest messages, unpublished reviews, tester reports); a check is only shown to users who have the right for its target page; counts of 0 are hidden. Menu: Start, Dashboard, Notices (badge with the number of open notices, cached 1 min). New files: `src/modules/admin/{home-lib,notices,start,dashboards}.js`, `public/home.css`, `public/home.js`, `test/int/admin-home.test.js` (4 tests); small edits: `src/web/{menu,icons,layout,pages}.js`, `src/modules/admin/index.js`; old admin dashboard (`dashboard.js`) is no longer used. Texts are bilingual in the code (no new i18n keys). Checked with Playwright at 1440/820/390 in EN and DE (no overflow, no console errors; menu, banner, search, pin, filter work). Tests: 91 of 93 green; the 2 failures (`test/int/debug.test.js`, 401 expected, 403 returned) come from commit c770b19 (debug mode on the public website), not from this change. Open: notification bell in the top bar, per-user saved pins on the server, trend needs 6 months of data (demo data starts in Aug 2026, so most trends are empty).
- 2026-11-18 Palma (Awais): **Top bar + labels + demo history** (branch ui-lumen, not committed). (1) **Help** button in the top bar of every area (`/<area>/help`: welcome, menu of the area, tips for lists/forms/Active-Inactive/language, shortcuts, contact) - `src/web/help.js`. (2) **Notification bell** with count badge and list (`GET /<area>/bell`, `src/web/bell.js`): admin = open notices, hotel = requests/arrivals/messages/tasks, sales = follow-ups/new leads; not for guests. (3) **Language menu with flags** (inline SVG UK/DE; Automatic uses the globe). (4) **New button names the record** ("New company", "New guest", "New photo", ...) from `def.newTitle`. (5) **Demo history**: `src/dev/seed-history.js` (DEV start in the background, `DEMO_HISTORY=0` skips, `node scripts/seed-history.js`) adds ~750 stays over ~5 years (seasonality, growth, hotels opening at different times, channels incl. WEB, 8 % cancellations, reviews) marked `book_remark = 'demo-history'`; bookings now run from 2021-11, so the dashboard periods 3 years / 5 years / All show data.
- 2026-11-18 Palma (Awais / coordinator): **Report pages for the 20 dashboard tiles with the WESS period bar** (branch ui-lumen, not committed). Every tile opens `/admin/dashboard/<key>` (glance, bookings, hotels, forecast, revenue, adr, cancellations, webshare, occupancy, rooms, rating, content, guests, reviews, accounts, requests, mail, tasks, notices, access). Page: breadcrumb "Dashboard", title + subtitle, Back + Pin (same pin as the tile, kept per browser), tabs of the same section, period bar card (Month, Quarter, Year, 12 months, 3 years, 5 years, All, Custom with from/to; resolved range label; Compare = previous period / same period last year / none; Company + Hotel), 3-4 KPI cards (value, trend vs the compare period, sparkline), "as of … next update" line (30 min cache per user and filter, `?refresh=1`), stacked bar chart by hotel (top 6 + Other, legend, hover/focus/tap tooltip, inline SVG-free CSS bars), two rankings (bar, sparkline, trend, "N more"), heat map hotel x period. Query: `period=month|quarter|year|12m|3y|5y|all|custom&from=&to=&compare=prev|yoy|none&company=&hotel=`; default 12 months; Month = current month by day, Quarter = current quarter by week, Year = calendar year, the rest by month; invalid values fall back (custom reversed = swapped, max 10 years). All numbers (KPIs, chart, rankings, heat map, trends) use the chosen period and compare period. Live reports (hotels, rooms, content, accounts, requests, tasks, notices, access) show the period bar disabled ("live snapshot of today"), forecast = next 12 weeks, mail = e-mails of the period by status and template. Empty periods show "No data in this period". Rights: reports follow the dashboard right; mail needs MAIL_QUEUE_VIEW, accounts PORTAL_ACCOUNTS_EDIT, access AUDIT_VIEW (tiles and tabs of reports the user may not open are hidden, direct URL = 403). The overview page passes company/hotel to the reports. New: `src/modules/admin/{period,reports,report-ui}.js`, `test/unit/period.test.js` (7), `test/int/admin-reports.test.js` (7); edited `dashboards.js`, `index.js`, `public/home.css|js`. Checked with Playwright at 1440/820/390 (all 20 reports, EN + DE, no overflow, no console errors; tooltip, custom dates, company filter, pin work). Tests: 106 of 108 green; the 2 failures are the debug tests (401 vs 403) from commit c770b19, not this change. Notes: "Guest arrivals" counts distinct guests per day and hotel; trends need data in the compare period (demo data starts Aug 2026).
- 2026-11-18 Palma (Awais): **Date picker, option cards, rich text, date bug** (branch ui-lumen, not committed). (1) **Date picker as in WESS** (`public/datepicker.js` + `datepicker.css`, also on the public site): every `<input type=date>` becomes a text field (DD.MM.YYYY, dots added while typing) + calendar button + popup (month/year arrows, weekday header, today dot, selected pill, Today / Clear, keyboard arrows, Esc, phones: bottom sheet); the hidden input keeps the ISO value. (2) **Option cards**: status/stage selects with 3-8 known values (`OPTION_META` in crud.js: contract DRAFT/SENT/SIGNED/ACTIVE/ENDED, lead NEW...LOST) render as small selectable cards with icon, name and one-line explanation instead of a drop-down; `f.cards` forces or `cards:false` disables. (3) **Rich text editor** (`type: 'richtext'`, `public/richtext.js`, `src/web/richtext.js`): bold, italic, underline, bullet/numbered list, heading, link, clear; paste as plain text; server keeps only an allow-list (no attributes, safe links only), old plain texts show as paragraphs; used for contract notes ("Description and notes") and internal remarks (company, hotel, room, guest, users, leads). Public-facing descriptions stay plain text for now. (4) **Bug fixed: DATE columns showed one day earlier** (pg builds local-midnight Date objects, server TZ Europe/Berlin): `pg.types.setTypeParser(1082, v => v)` in `src/db.js` + `dayOf()` in crud.js; DATE values are now 'YYYY-MM-DD' strings everywhere. Tests: `test/unit/richtext.test.js`.
- 2026-11-18 Palma (Awais): **System pages of the Admin app, WESS style** (branch ui-lumen, not committed). (1) **Sign-in log** `/admin/signins`: every sign-in (success, wrong credentials, locked, not allowed, e-mail code sent) from `user_activity_log` with person, result badge, app, IP, device (browser · OS); KPI tiles (today, failed 24 h, locked accounts, people 7 days); result tabs with counts, app filter, date range, search with suggestions, CSV. `audit()` now stores result/area/short user agent; all refused sign-ins with a name are logged (not only wrong password). (2) **Active sessions** `/admin/sessions` (view `v_active_session`, no token data): person, role, app, started, last seen ("5 minutes ago"), ends, IP, device; menu badge (sessions seen in 30 min, "99+"); "End" per row (own session protected, CSRF, audited `SESSION_ENDED`) and "End all other sessions" (`SESSIONS_ENDED`). (3) **Change log** `/admin/audit` (replaces the old audit list): timeline grouped by day from `history` (old -> new, created / changed / activated / deactivated, record links where an admin page exists) plus events (documents, invitations, support view, password); filters: period presets + custom dates (date picker), record type, user, search, "Include system changes" (system actors hidden by default), CSV. Migration 0021 (columns, view, rights SIGNINS_VIEW / SESSIONS_VIEW / SESSIONS_END / CHANGELOG_VIEW granted to roles that had AUDIT_VIEW = Super admin and Support). Files: `src/modules/admin/system.js`, `public/system.css`, `src/dev/seed-signins.js` (DEV demo rows). Tests: `test/int/system.test.js` (rights, log, sessions, change log, helpers); 120/122 pass, the 2 debug-mode tests fail since commit c770b19. Note: Admin (non-super) role has no access to these pages by design.
- 2026-11-18 Palma (Awais / coordinator): **ONE users mechanism + Roles & rights + role tiers + app switcher (WESS 2.0 style)** (branch ui-lumen, not committed). (1) `/admin/users`: one list over the three account tables (view `v_user`, migration 0020; ids sa-12 / cu-7 / sl-3 work as short links), area tabs with counts, filters Role / Company, Active switch, search, cards/list, columns, views, CSV; status Active / Invited (no password yet; in the hotel app: never signed in) / Inactive; last sign-in "never / 9 days ago". **Invite person** (page head) opens a right-hand drawer: name, e-mail, role cards grouped by tier (Super admin / Admin / Hotel management / Sales; legacy roles hidden), role help, company select for hotel roles; creating inserts into the right table by the role's scope, sends the invitation mail, validates (role, unique e-mail across all three tables, company), the 422 reopens the drawer with the errors. Full-screen on phones. Detail pages (sticky header, Active switch, History / Related with "resend invitation") keep the existing CRUD framework under `/admin/users/<sa|cu|sl>/<id>`; the role can only change within the same area (hint explains: invite a new person for another area); own account and last Super admin guards unchanged. Old pages Super admins / Company users / Sales users are gone from the menu; their URLs redirect (list -> tab, record -> new URL, /new -> drawer). Hotel app: same list + drawer limited to the own company (menu label "Users"; /hotel/company-users redirects). (2) `/admin/roles`: read-only matrix like WESS: roles by tier with app badges (Admin / Hotel / Sales) and user counts, rights of the selected role grouped by section with search and "Only granted rights", full matrix per area with sticky headers; Customer tier shows the guest accounts. New rights PLATFORM_USERS_VIEW and ROLES_VIEW (migration 0020, granted to everybody who managed one of the three kinds before). (3) **Tiers** (migration 0022): new role SUPER_ADMIN (all 19 platform rights, sorted first); PLATFORM_ADMIN is now "Admin" without system / security rights (PARAMS_EDIT, AUDIT_VIEW, MAIL_QUEUE_VIEW/EDIT, SUPER_ADMINS_EDIT removed); mapping of accounts: every super_admin row with PLATFORM_ADMIN became SUPER_ADMIN (demo admin and the real admin), so nobody is locked out; SUPPORT and SALES_MANAGER unchanged. Consequence: only a Super admin creates / changes platform users (roles of the Admin area incl. Admin, Support, Sales management); an Admin invites hotel and sales users. (4) **App switcher** in the brand card (chevron button): only for Super admins; Admin, Hotel management (read-only support view of a chosen company = the existing mechanism) and Sales (new read-only support view as a chosen sales user: `POST /admin/support/enter-sales`, column `app_session.sess_support_sales_id`, banner + leave link, audited as SUPPORT_ENTER, all writes 403). Hidden for everybody else. Files: `src/modules/users/{users,roles-info}.js`, `src/modules/admin/roles.js`, `src/web/switcher.js`, `public/{users,switcher}.css|js`, migrations 0020 + 0022; edited `crud.js` (noList flag, sections Person / Role & scope), `layout.js`, `icons.js`, `auth.js`, `db.js`, `app.js`, admin/hotel `entities.js` + `index.js`, notices/start links. Tests (`test/int/users.test.js`, 8): invite per table + mail + set password, validations, guards, rights per kind, role change same area only, list filters, redirects, matrix counts, Super admin vs Admin rights, switcher visibility + support views + audit, hotel users + tenant isolation; old user tests in admin/hotel tests replaced. Suite: 114 of 117 green; failures are not from this work: 2 debug tests (401 vs 403, commit c770b19) and the audit list test (`/admin/audit` chip markup, in-progress change log work of another session; also `/admin/audit` is still reachable for an Admin because of that work). Note: migration 0021 is another session's `0021_system_pages.sql` (not applied to DEV by me). Open: MFA tag on roles (no per-role MFA flag exists), changing a role across areas = invite a new person.
- 2026-11-18 Palma (Awais): **E-mail templates like WESS "Templates"** (branch ui-lumen, not committed). Migration 0023: `mail_template` (code, level GLOBAL|COMPANY, company, category GUESTS|LEADS|STAFF|BOOKINGS|SYSTEM, names/descriptions EN+DE, placeholders, active flag, history + touch triggers) and `mail_template_version` (no, status DRAFT|PUBLISHED|ARCHIVED, subject/heading/body per language, note, published at/by; one published + one draft per template); row level security: companies read global + own copies and write only their own copies; rights TEMPLATES_VIEW/EDIT (Super admin, Admin; Support view) and COMPANY_TEMPLATES_VIEW/EDIT (Company admin, Hotel manager). 9 global templates seeded from the former built-in texts: invite, reset, login-code, review-notification, contact-reply (all in use) and booking-confirmation, booking-cancelled, booking-request-received, lead-welcome (prepared, inactive: no automatic guest e-mails are sent yet). `src/core/templates.js` builds mails from the published version (company copy first, then global): placeholders `{{name}}` are replaced with ESCAPED values after the body went through the rich text allow-list; `{{link_button}}` makes the styled button; the old built-in text stays as fallback in `core/accounts.js` (invite/reset), `core/mfa.js`, hotel reply (`modules/hotel/entities.js`) and review notice (`portal/accounts.js`). UI (`src/modules/templates/templates.js`, `public/templates.css|js`), mounted at /admin/templates (menu System) and /hotel/templates (menu Company): KPI chips, Global/Local tabs, category chips with colour dots, standard list toolbar; record page with Preview (mail frame with test data, DE/EN, version select, placeholder chips, open in new window), General, Versions (restore as new draft), History; editor with rich text, insert-placeholder chips, Save draft, Publish (checks unknown and required placeholders, e.g. invite must keep its link), Discard, test e-mail only to the signed-in person (queue allow-list applies); a company creates an own copy of a global template, edits and publishes it. Tests: `test/int/templates.test.js` (8). Limits: no automatic guest e-mails yet (the prepared templates wait for a sender); only e-mail templates (no invoice texts / text rules / invoice layout like WESS); saving a draft keeps one draft per template (opening the editor creates it).
- 2026-11-18 Palma (Awais) **Auto-save instead of Save buttons** (branch ui-lumen, not committed). Existing records save themselves: `public/autosave.js` + `autosave.css`, chip in the top bar (green "Saves automatically" / "Saving…" / "Saved 14:05" / red "Not saved – fix the highlighted fields" / "Changed by someone else – reload" / connection problem with "Try again"). Debounce 800 ms for typing, immediate for selects, switches, option cards, date picks, amenity cards; richtext on input; Enter does not reload; leaving the page flushes (`pagehide`, keepalive) and warns only if the last save failed. Two modes: `data-autosave="json"` = generic crud forms (POST with `X-Autosave: 1` → `{ok, changed, v}` / 422 `{errors}` per field / 409 conflict) and `data-autosave="html"` for older custom forms (hotel guest registration, guest preferences, housekeeping, photo edit, facilities cards, template draft with `data-autosave-extra="act=save"`). Server: hidden `_v` = `<prefix>_updated` of the record; a save on a newer version is refused (409); a save without any real change writes nothing (no UPDATE → no history row, `afterSave` side effects such as mails do not run again); **history coalescing**: consecutive saves by the same person on the same record within 5 minutes become ONE history entry (`coalesceHistory` drops the older snapshot after commit) — decision: least risky way, because the history trigger writes one row per UPDATE. New records keep a **Create** button (`f.create`; also invite drawers: "Create and invite"), after creation the record page autosaves. Without JavaScript a Save button inside `<noscript>` and the normal POST still work. Not autosaved on purpose (actions with their own buttons): reservation creation, price runs ("Save prices" = apply to a date range), check-in/out, payments, cancellations, change password, publish/test of templates. Tests: `test/int/autosave.test.js` (4), e2e scenarios 3 and 5 now wait for the chip instead of clicking Save.
- 2026-11-18 Palma (Awais, fork): **Phone field like WESS + user header card with picture** (branch ui-lumen, not committed). (1) **Phone**: every `<input type=tel>` (admin, hotel, sales, guest, hotel/company forms, staff reservation form, public booking form) becomes a country button (flag + dialling code) + number field with a searchable country list (DE, AT, CH, NL, PL, TR first, ~80 countries, names DE/EN, flags as inline SVG for the usual countries, emoji/code tile for the rest) - `public/phone.js` + `phone.css`, plain input without JS. Stored value = one text form `+49 151 2345 6789` in the existing column (no schema change); `0…` numbers use the record's country (else Germany), `+49…`/`0049…` pick the country, letters are refused (red field, old value kept); old values stay as they are. Server: `src/web/phone.js` (`normalizePhone`, applied in `readValues` for fields of type `tel`/`phone`, the staff reservation form and the public booking). WESS has no number *type* labels in the phone field itself, so none were added; the field keeps its visible label (Phone / Mobile / Telephone). (2) **User header card** (`src/modules/users/summary.js`, hooks `def.summary` / `def.headActions` in crud.js): round avatar with initials or picture + "Add / Change picture" (PNG/JPG/WebP ≤ 2 MB, extension + content check, table `user_avatar` via migration 0024, served by permission-checked routes `/<area>/avatar/<kind>/<id>` and `/<area>/avatar/me` with nosniff + CSP sandbox, audit AVATAR_SET / AVATAR_REMOVED), chips (Active/Inactive, role, area), e-mail + hint about changing it, four tiles (Last sign-in, Active sessions, Hotels/Leads/Companies in scope, Rights of the role), header button "Send a password link". The picture shows in the top bar, user menu, sidebar, users list and cards. No sharp on the server: no cropping, CSS `object-fit`. Tests: `test/int/users-summary.test.js` (3). Limits: tab names stay Details / Related / History (not WESS's Profile / Access & role / Sign-in & security / Records); pictures are not resized.

## 2026-11-18 – Super admin and Admin separated (migration 0025)
- Two separate roles: SUPER_ADMIN (all rights incl. system/security, manages everybody) and PLATFORM_ADMIN "Admin" (new right ADMINS_EDIT: manages Admin/Support people, companies, hotel and sales users).
- An Admin can never see (hidden in the Users list and role filter), open (404), change, invite, set a picture for, deactivate, or create/promote a Super admin (invite drawer has no Super-admin card; server rejects it). Only SUPER_ADMINS_EDIT (Super admin only) does that.
- Mechanism: `rowGuard` in crud.js, `platformRight()/isSuperRole()` in core/access.js; test/int/admin-vs-super.test.js (4 tests). Full run 138/140 (2 old debug failures).
- Still the same table `super_admin` underneath (role decides); a physically separate table was not built.

## 2026-11-19 – QA reports, second pass (branch ui-lumen, commits f20e4f1, d8dc4a4; not pushed)
- Reports #46–#81 transcribed locally (only #46–#58 done, the rest by screenshot); 20 reports set to fixed (list in the debug history). Open: 33.
- Fixed: Help welcome card layout; guest dashboard (dates DD/MM/YYYY, status/payment badges, no duplicate heading); calendar shows one bar per stay with the guest name + legend + single title; user header shows the person's own company (the Hotels tile showed the viewer's company before); input checks for names, city, state, country, company name and VAT id (`src/core/patterns.js`, messages f.name_chars / f.company_name / f.vat); debug screenshots no longer print `<noscript>` text (the raw SVG text seen in several screenshots).
- Not done / open questions: info box on contract and company pages (#53, #58 – needs a decision what it shows); "All notices" button alignment (#47, subjective); filter drawer details (#27, #37); ~30 older reports whose audio could not be understood (Urdu/Hindi transcription is rough).
- Tests: 141/143 (2 old debug-mode failures, 403 vs 401, since c770b19).

## 2026-11-20 – App icon, dashboard totals, company addresses
- New app icon (hotel + palm) in top bar, login and public pages. Dashboard totals ignore deleted hotels (same as "At a glance"); trend tooltip explains the 3-month comparison (reports #82, #83).
- Company addresses: table `company_address` (migration 0026) with types INVOICE / MAILING / BRANCH / OTHER, label, recipient, optional lat/lng, one default per type (set in the save step). Main address stays in the company columns; the two old free-text fields (company/invoice address) are removed from the forms, the old invoice text was migrated to an invoice address. "Addresses" card on the company page (admin and hotel app); invoices use the default invoice address. Notice "company without an invoice address" now reads the new table.
- Open: map and "set pin by hand" (waiting for the decision Google key vs OpenStreetMap); WESS 2.0 itself is not on this server, so the type list is my proposal.
- Address search + map (2026-11-20, like WESS 2.0 "Find address"): `src/web/geo.js` (route `<area>/geo/search`, OpenStreetMap Nominatim, 1 request/s queue, cache, GEO_SEARCH_URL to switch provider), `public/address.js|css`, Leaflet vendored in `public/vendor/leaflet`, OSM tiles (CSP img-src). Every generic form with street/address + city + latitude/longitude gets it automatically (`hasGeo`/`geoWidget` in crud.js): company (admin + hotel), company addresses, hotel (position also copied to the portal profile), guests. Migration 0027 adds the position columns. Pick a suggestion -> fields fill and lock, "Enter by hand" unlocks, "Set position by hand" = drag pin / click map. Not done: sales leads (no street field), portal registration, a Google provider (needs a key); for production check the Nominatim usage policy or use a paid/own geocoder + tile server.
- UI finishing (2026-11-20): `public/select.js` + `public/ui.css`: every plain select becomes a themed dropdown (search for long lists, check mark, keyboard, opens upwards near the bottom edge, light/dark/all themes; native select stays hidden for forms/autosave; opt out with `data-native`), slim themed scrollbars, selection colour, accent colour for checkboxes/radios, calm arrow on any remaining select.
- Virtual tours (2026-11-20): migration 0028, profile field, public hotel page section (click-to-load, sandboxed frame, CSP frame-src), "360° tour" badge in search, API fields. Europe-wide: audit and plan in docs/EUROPE-PLAN.md (phase 1 foundation next; decisions for Sajjad listed there).
- Login page redesigned for Europe (2026-11-20): Europe map (public/europe-map.svg, scripts/build-europe-map.py, src/web/europe-map.js), countries with hotels lit up, counts, hotel cards; query no longer limited to DE/AT/CH.
- Public home (2026-11-20): 3D hero (floating hotel card stack that follows the pointer, parallax photo), count-up stat band, scroll reveal, tilt + glare on cards (public/home3d.js, site.css); wording Europe. All motion off for prefers-reduced-motion.
- Public home stage (2026-11-20): ideas taken from a reference site (not its colours): carousels with round arrows and drag, dark glass cards, two-tone headings, phone mock-up with floating objects. All colours come from the theme variables (palm / iris / burgundy).
- Public home rebuilt from zero (2026-11-20): one continuous glass stage in the theme colours: crossfading hero photos that fade into the stage, glass search + numbers, Europe map section, destination and hotel carousels, inspiration tiles with phone, promise cards, closing call; header and footer in the same glass. Only the home uses the stage (publicLayout stage option).
- Colour scheme picker (2026-11-20): palette menu next to the dark-mode button in the public header and on the login page; new fourth scheme 'White' (plain white, graphite accent; light and dark variant, own light version of the public home). Schemes: palm, iris, burgundy, light (public/mode.js THEMES, theme-we.css, themeMenu in layout.js).
- Public home redone again (2026-11-20, after the glass-stage design was rejected): light and consistent with the other public pages, theme variables only. Causes fixed: hero photos were 1200 px wide and stretched full-bleed (now a mosaic of photos at natural size); SVG map replaced by a real Leaflet/OSM map with hotel markers; carousel shadows no longer clipped; one card style everywhere; dark mode and the four schemes follow the tokens. The earlier .pt-stage styles were removed.
- Public inner pages (2026-11-20): new design language for all pages except the home page: results (src/public/inner.js: filters apply by themselves, removable filter chips, list/grid/map view, new result cards), new Destinations (/destinations: search, country chips, cards, map) and Wellness (/wellness) pages with nav links, hotel page (photo viewer, sticky section menu with highlight, map, card sections, sticky booking card), booking steps and confirmation. Scripts: public/pages-inner.js, public/hotel-page.js. Open: other languages of the new texts only EN/DE; Europe-wide country names (countryName covers 4 countries); hotelPage/bookPage were restyled, not rewritten.

## 2026-11-21 – Room search fields, services with a live bill, phone widths
- Hotel page "Rooms & rates": adults/children/rooms dropdowns showed clipped numbers (the top-bar search style leaked into the form). Own layout now: dates side by side, three number fields below, button full width; works on desktop and phone. The date picker buttons inside the form no longer get the form button style (calendar looked broken on phones).
- Booking page: new "Extras & services" card (breakfast, transfer, spa, parking, late check-out, dog) with tick boxes and days/trips selector where it makes sense. Ticking recalculates the bill on the right at once (`GET /book/price`, calculation only, nothing stored; public/book-extras.js). On phones a fixed total bar shows the live total. On submit the price is re-quoted with the chosen services, the booking keeps them (extras total + lines).
- Phone/tablet sweep (360 and 768 px) over all public pages and the first 14 menu pages of every role: sideways overflow fixed on results (grid min-width, sort dropdown), hotel page and booking page. No overflow left.
- Tests: services flow, price endpoint (unknown code 400), stored extras total, CSS guards. 152 + new pass; the 2 old debug tests (403 vs 401) still fail.
- Next: look at dark mode and the other colour schemes on the inner pages; Europe plan answers; push only after OK.

## 2026-11-21 (later) – Header switch, button icons
- Active/Inactive switch now sits on the right of the form header next to the Back button (all record forms and the template page).
- Icons inside buttons in a section header (e.g. "+ Add address") took the brand colour and vanished on the brand-coloured button (`.fsec-h .ic`). Now only the section's own icon is coloured; button icons inherit the text colour. Icon contrast audit over all pages of the 4 roles, light and dark: no other invisible icon found.

## 2026-11-21 (later) – Floating rounded header on the public site
- The public top bar is still sticky, but now a rounded bar (22 px corners, blur, soft shadow) as wide as the page content, from the brand to the Sign-in button, with space around it; the page shows behind and beside it while scrolling. All public pages share it (home, hotels, destinations, wellness, hotel page, booking). Sticky side cards/menus moved down to clear it.

## 2026-11-21 (later) – Tester reports, second pass
- The 100 open reports have no transcripts (voice only). Four read-only helpers judged them from screenshot + live page; only clearly visible defects were fixed.
- Fixed in shared code: list toolbar stays on one row (search shrinks), header links dark (only the page title colour is accent), empty cells show "–", phone/number cells do not wrap, wide tables show a soft edge, nicer empty state, tables inside tabs have no second scroll box; double pill around filter chips; raw codes (IN_HOUSE, CITY_TAX, FRONTDESK, PENDING ...) now shown as translated labels/badges on hotel dashboard, reservation detail and mail queue; ranking rows show "–" and align; calendar bars/legend visible, Apply is a normal button; DATEV link got an explanation; roles matrix tighter.
- Public header: hero colour now runs behind the floating bar (no white strip).
- Set to fixed: 49 reports (25 fixed now, 24 already fixed by the redesign). Still open: ~50 unclear ones (no marked spot or no visible defect) – need Rehan/Asif.

## 2026-11-21 (later) – Results header, virtual tour visibility
- Results page header compact: no extra "Hotels" chip, smaller title, tighter gaps (breadcrumb, title, search sit close together).
- Virtual tour is now offered where guests look: landing page section "Look around before you book" (up to 3 tour hotels; click opens the hotel page and starts the tour), hotel page (button on the main photo, "View 360° tour" button in the header, highlighted menu entry; all jump to the tour and start it), search filter "With 360° tour" (+ removable chip, `?tour=1`), and the hotel profile has its own "Virtual tour" section.

## 2026-11-21 (later) – Live price, offers & packages, clear rates, feel
- Hotel page: dates, adults, children, rooms update the offers and the price on the right by themselves (no "Show prices" button). Prices count from the old to the new number (public/numflow.js), also the booking summary and the mobile total bar.
- Offers: new Offers page (`/offers`, in the nav), home section, "Offers for your stay" card on the hotel page. A promo code can be marked as public offer with title/text (migration 0029, hotel app section "Public offer"); opening an offer carries the code (`?promo=`) to the booking; if it does not fit the dates the guest books at the normal price and is told so. Packages (company packages) are shown as cards on the Offers page and chips on the home page.
- Rates under each room are now cards: name, tags (Lowest price / Flexible), cancellation, breakfast/half board, pay at hotel, total + per night, button "Book this rate"; "What do the rates mean?" explains them.
- Feel: thin progress bar on every step, busy buttons (booking cannot be sent twice), results dim while filters apply (public/feel.js).
- Found missing: no Imprint, Privacy, Terms, Cookie, Contact, About/FAQ pages, no sitemap.xml/robots.txt; the booking page asks to accept terms/privacy that cannot be opened. Needs company/legal details from Sajjad (question written).

## 2026-11-21 (later) – Guests coming back: manage booking + e-mail code sign-in
- Problem found: website bookings create a customer without date of birth, the old guest sign-in (customer number + birth date) cannot work for them, and nobody tells them the number.
- `/booking` (no account): booking number + e-mail → signed 30-minute cookie → view the booking, cancel it (fee shown first, free cancellation noted), done. After a booking the cookie is set, so the confirmation page links straight to "Manage this booking". Rate-limited, same answer for wrong data.
- Guest tab on `/login`: e-mail → 6-digit code by e-mail → guest area `/customer` with all bookings of that address (`POST /login/guest-code`, reuses the code mechanism of core/mfa.js: 10 minutes, 5 tries, one use). Same answer for unknown addresses (no mail sent), max 5 codes per address and hour, IP rate limit. Customer number + birth date stays under "I have a customer number".
- Footer: "Manage booking". Not done: the booking-confirmation e-mail (template is still "prepared", not sent) should contain the manage link when mail sending for bookings is switched on; invoices are not in the guest view yet.

## 2026-11-21 (later) – Login: back to hotel search
- The small link at the very bottom of the login page is now also a filled button at the top left of the form panel ("Back to hotel search", arrow, brand colour, works in all schemes and on phones); the colour-scheme icon at the top right got the same size as its neighbours.

- Redesign (the pill was still too easy to miss): the login form now starts with a full-width brand-colour card "Looking for a hotel? Browse, compare and book directly – no account needed." with a white "Search hotels →" button; on phones the button spans the card. The earlier corner pill was removed.
- Customer-number sign-in (guest tab): fields and the Sign in button now have clear spacing (the details element ignored the flex gap; content is wrapped), the button is full width.

## 2026-11-21 (later) – Company page: employees
- The employees list was hidden in the generic 'Related' tab. Now: own tab 'Employees' (with count) on the company page (avatar, name, e-mail, roles, status, last login, 'Invite employee'), the header people row and the 'Employees' tile link to it (`#tab-employees`), empty state with an invite hint. Generic: any page can return `<!--panel:id|EN|DE|icon|count-->…<!--/panel-->` to get its own tab.

## 2026-11-21 (later) – Logo in the header, company cards, hotels from the platform side, lists, admin menu
- Company logo: no upload box inside the form any more (also not in the new-company form). The logo in the header is the upload spot: click it or the round camera badge (or drop a file), it is saved at once; a small x (shown on hover) removes it (`POST /admin/companies/:id/logo`). WESS 2.0 itself could not be opened by me (no access) – this is the usual profile-picture pattern; adjust when a screenshot of the WESS 2.0 logo block is available.
- Company cards: one avatar, name, badges, "N Hotels" and "N Employees" are links to the Hotels / Employees tab of the company, "+ Add hotel" button on every card.
- Hotels can now be created from the platform side: company page → new "Hotels" tab with "Add hotel" (`/admin/hotels/new?company=ID`, same form as in the hotel app plus the company). Before, hotels could only be created by the company's own users in the hotel app.
- Admin menu has a new group "Hotels & offers": Hotels, Packages, Offers & promo codes, Room types, Rate plans (all companies, editable by the platform admin).
- Lists everywhere: search (grows when clicked, recent searches on focus, suggestions while typing) + Active switch + Filter/Columns/Views/Download on the left; count and Cards/List on the right.

## 2026-11-21 (later) – List header like WESS 2.0
- Every list (all areas, incl. the hotel app): info strip above the list (what the page is for, "More" opens how Search/Filter/Columns/Views/Download work, ✕ hides it and is remembered per page; an (i) next to the page title brings it back; per-page text via `def.about`, generic text otherwise). Toolbar: "1–25 of 53" with prev/next arrows, search (grows when clicked, recent searches, suggestions), Active switch, Cards/List, then Filter / Columns / Views / Download; the labels shrink to icons when the list is narrow (container query).
- Not done yet: the dashboard redesign ("a different style").

## 2026-11-21 (later) – Dashboard style, packages with ticked services and price calculation
- Dashboard (admin): new look – soft hero with live chip, four key-figure cards (own accent colour, icon, trend chip, area chart across the card), sections with coloured icons/accents, tiles with accent top edge, pin on hover.
- Package form (hotel app and platform admin): section "Included services": every service of the company as a tick card with price/unit and quantity, plus the hotels the package applies to (default all); saving writes the allocation rows (services × hotels), also by autosave. Generic: field type `services` + `def.syncVirtual`.
- Right side of the package form: live price calculation (adults/nights, lines per unit rule, total as animated number, optional own package price → guest saving).

## 2026-11-21 (later) – Hotel ↔ website linked (platform admin)
- Admin hotel page has a new "Website" tab: readiness checklist (published, photos with credit, cover, EN/DE description, room types, public rate plans, map position, 360° tour), photo manager (upload with credit and rights, make cover, delete), link to the website profile (`/admin/profiles/:id`, incl. virtual tour link and publishing) and the list of places where the hotel appears (home top-rated + destination card + map, search, destinations, hotel page, home 360° section) with links.
- A hotel created by the platform admin now gets its portal profile at once (before, it never appeared on the website; photos on the home page come from `rup_hotel_image`: cover photo of a published hotel with photo credit).

## 2026-11-21 (later) – Search and info strip polish
- Search field itself now grows when clicked (it only grew its wrapper before, leaving a gap before the Active switch). On click it shows a tip (which columns are searched), recent searches and the first records to open directly; typing shows live suggestions (suggestion title uses one name column only).
- Info strip: closed by default (opened by the (i) next to the title, remembered per page); More and ✕ same height, centred on the title line; the short line is hidden while the details are open.

## 2026-11-21 (later) – Cards open on click, the hierarchy company → hotel → everything linked
- public/cardlink.js (loaded everywhere): a card that leads somewhere (`.rcard .pcard .cocard .rc [data-cardlink]`, plus the cards that already are links) opens its page when you click anywhere on it; buttons/links/inputs inside keep their job; Ctrl/⌘-click or middle click opens a new tab. Reservation cards in the admin have no page to open (the admin has no reservation detail yet).
- Company page tabs: Hotels, Packages, Contracts, Onboarding, Employees (+ Documents, History). Hotel page (admin) tabs: Rooms, Room types, Rate plans, Offers, Packages (with their services), Reservations, Website. Each tab lists the linked records with a link to the record and an Add button that pre-fills the hotel. New admin menu entry "Rooms".
- Open: a reservation detail page for the platform admin (reservations are only listed there).

## 2026-11-21 (later) – Column headings
- Table/list column headings are no longer upper case (also the rights matrix section rows): first word capital, the rest as written (e.g. Booking no., Check-in). Rule: header text-transform none in app.css / users.css.
- Whole table rows are clickable (every list, every linked-records tab, hotel dashboard tables): click anywhere on the row opens the first record link of the row; links/buttons inside keep their job; calendar and rights matrix excluded.

## 2026-11-21 – Header cards hold the key figures
Company and user header card: identity left, the four figures right (2x2) inside the same card; separate people row removed (avatars live in the Employees figure); count badges removed from the Hotels/Employees tabs; Active chip removed (the switch at top shows it). Same layout for all user pages (admin, hotel, sales).

- 2026-11-21 Header cards in WESS 2.0 style (Awais photo): status chips, address and contact lines with icons, tinted figure cards (green/blue). Company and all user pages.
- 2026-11-21 Linked tabs of company and hotel (hotels, packages, contracts, employees; rooms, room types, rate plans, offers, packages, reservations) have a Cards / List switch (remembered per browser, public/viewtoggle.js). Hotel cards show the cover photo, location, rooms, photos, online/tour badges; others use generic record cards (kcard in admin/linked.js). Onboarding stays a status panel (no list). Admin reservations cards are not clickable (no detail page).
- 2026-11-21 Country flags: real SVG flags (flag-icons, MIT, public/flags, 52 countries: Europe + a few) via src/web/country.js; shown for *_country cells in all lists/cards, company header, company cards, hotel cards. Country text matched in EN/DE; unknown countries show no flag.
- 2026-11-21 No count inside linked tabs and the Documents tab (the tab label already shows it). Documents count is kept as data-doc-count for the tab.
- 2026-11-23 Fix: rows of /admin/offers opened /admin/promos/N (404). toAdmin now maps the hotel-app path to the admin path (promos -> offers). Crawl of 24 admin and 25 hotel pages (first row links): no 404. Test added.

## 2026-11-23 – Debug: "Set aside" status and status per tester (branch ui-lumen, not pushed)
- New report status `parked` (Set aside / Zurückgestellt): decided not to do it now. Migration 0092, `debug-status.js … parked`, filter, badge, timeline.
- Debug overview: new "Status per tester" table (Total, Pending, In progress, Fixed, Set aside, Rejected, progress bar, every number links to the reports); Set aside tile; Set aside column in the per-day tables.
- Test added (parked status + overview). Suite: only the 2 old debug failures (403 vs 401).
- Next: Awais approves which of Rehan's 47 open reports are done and which are set aside; then statuses are set with a note each.

## 2026-11-23 – Rehan's reports (batch 1), guest sign-in on the public site (branch ui-lumen, not pushed)
- Hotel page: WESS-style header card (cover photo, company, place with flag, contact, Rooms / Reservations / Rate plans / Photos). Company header: no repeated "Active" chip (the switch says it). Reservations tab count = real total (110, not 15).
- New admin reservation page `/admin/reservations/:id` (read only: key figures, details, price breakdown, tasks); rows in the list and in the hotel tab open it.
- Record cards: long names wrap to two lines, values stay on one line. Package form: nicer empty state for "Included services". Test junk soft-deleted on DEV (companies 1234542ff / asdfhjk / 67777@3, their users, hotel and 6 packages).
- Guest sign-in is now a public-site page `/sign-in` (e-mail code, customer number + date of birth, DEV demo-guest button, link to manage a booking). `/login` is staff only (guest tab removed, "Are you a guest?" link); `/login?tab=guest` and `/customer/login` redirect to `/sign-in`; the code page and errors stay in the public layout. "Staff login" button in the public header.
- Debug: statuses set for Rehan's reports (fixed / set aside with notes). Tests: only the 2 old debug failures.

## 2026-11-23 – Dashboard reports: a different picture for each report (branch ui-lumen)
- New `src/modules/admin/report-viz.js`: line/area chart (average line, highest/lowest), gauge with colour bands, donut, dot plot, podium, watch list, share bars, score card, room dots. Same data payload as before; `report-ui.js` chooses the picture per report.
- Revenue: podium + share donut + stacked bars. Average daily rate: line chart + dot plot. Cancellations: gauge + red line + watch list with colour pills. Web share: web-vs-other donut + line + share bars. Occupancy: gauge + line + heat map first. Guest rating: score card + line + dot plot (5–10). Rooms: one dot per room per hotel. Guests: line chart. Other reports unchanged.

## 2026-11-23 – Guest self-service in the customer area (branch ui-lumen, not pushed)
- New menu entries: My bookings, My profile, Sign-in & security (`src/modules/customer/self.js`, `public/customer.css`, migration 0093 = guest pictures).
- My profile: header card with picture upload / change / remove, own figures; form for first and last name, date of birth, mobile and phone (checked and normalised), full address; e-mail is read only (sign-in name). Validation messages per field; CSRF required.
- My bookings: tabs Upcoming / Past / Cancelled / All with counts, booking cards (hotel photo, dates, room, total, status); booking detail (facts, hotel contact, price breakdown, cancellation rule) and cancel with fee preview – only the guest's own bookings (other ids = 404). Cancel uses the same booking engine as the public "manage booking" page.
- Sign-in & security: list of signed-in devices, "sign out all other devices". The user menu now has My profile and Sign-in & security for guests.
- Tests: profile edit + checks + isolation, bookings list/detail/cancel + isolation, security, picture. Suite: only the 2 old debug failures.
- Not built yet (proposals): change e-mail with a code, invoices / documents for guests, leave a review from the account, account deletion request, favourites, notification settings.

## 2026-11-23 – Tester split applied; Overview, Bookings and Reviews get their own visuals
- Approved split applied: Rehan 0 pending (12 in progress, 49 fixed, 26 set aside), Asif 7 in progress / 23 set aside, Shahzaib and Awais in progress. Reports with an untranscribable voice note and no visible defect are set aside with a note; the tester can reopen with one written line.
- Overview: two donuts (revenue and bookings by hotel), line chart per month, two podiums. Bookings: cancellation gauge, line, donut, podium. Reviews: score card, line, podium, dot plot. Half-width line charts use a narrower drawing so the text stays readable.

## 2026-11-23 – Guest area polish: icons, demo history, dashboard visuals, address search (branch ui-lumen)
- Menu icons: guest menu now has its own icon per entry (bookings, profile, security); "Offers" in the admin menu has one; customers use a different icon than users. Missing icon names fixed (calendar-check, pin, calculator added; banknote → euro, so the euro icon shows on the admin reservation page, guest tiles and totals).
- Demo guest has a history (`scripts/seed-demo-guest.js`, DEV only): 7 bookings over the last 10 months, packages and services. Guest dashboard: tile icons, € amounts, packages as bars, spend by month as columns, status as a donut, profile completeness hint.
- My profile: three cards (personal, contact, address) with hints; address uses the same address search + map as companies/hotels (street and number in one field, postcode, city, country, position saved as latitude/longitude); e-mail shown read only with a lock; sticky save bar.
- Samples from Awais (housekeeping floor board, digital-twin floor plan, room quick-action dialog, operations dashboard) are ideas only – not built.

## 2026-11-23 – Hotel inventory module (branch ui-lumen, not pushed)
- Where it lives: Hotel app → Operations → **Inventory** (`/hotel/inventory`), next to Housekeeping and Tasks; read-only **Inventory tab** on the hotel page in the Admin app; "items to order" hint on the hotel dashboard.
- Data (migration 0094): `inv_item` (hotel, name, category, unit, stock, minimum, fill-up level, cost, supplier, storage place) and `inv_movement` (delivery / use / count / loss with note, room, who, stock after); tenant isolation like the other hotel tables; rights INVENTORY_VIEW (all hotel roles) and INVENTORY_EDIT (company admin, hotel manager, housekeeping).
- Screens: list (cards / table) with level filter (all / to order / out of stock) and category filter, KPI strip (items, running low, out, stock value); item page with header card, stock meter and the **Stock** tab ("Book stock": delivery, used, counted, loss; never below zero; history); **Order list** grouped by supplier with suggested quantities (fill up to target), cost estimate and copy button.
- Demo data: `scripts/seed-inventory.js` (DEV) – 18 typical items for each demo hotel (bed linen, towels, bath mats, shampoo, coffee beans, cleaning detergent …) with a short history.
- Tests: `test/int/hotel-inventory.test.js` (movements, floor at zero, history, list/filter, dashboard hint, order list, isolation).
- Ideas for later: deduct stock when housekeeping cleans a room (standard use per room), reorder e-mail to the supplier, suppliers as own records, minibar per room, barcode scan for counts, stock take sheet to print.

## 2026-11-23 – Inventory: automatic use when a room is cleaned (branch ui-lumen)
- New field "Used per cleaned room" on each inventory item (migration 0095; e.g. 2 bath towels, 2 soaps, 1 bath mat). When housekeeping sets a **dirty** room to clean or inspected, every active item of that hotel with a standard use is taken off the stock (never below zero) and logged as "Room cleaned (automatic)" with the room number. Clean → clean does not use anything again. Demo items carry typical values.
- Test: dirty → clean uses once, an item without standard use is untouched, never below zero, movement names the room. Checked on DEV as the housekeeping user (12 items deducted, stock −2 each as set).

## 2026-11-24 – Housekeeping: consistent list + floor board
- Housekeeping page now uses the same pattern as the other lists: intro, KPI tiles (to clean / clean / inspected / out of order), badges in EN/DE, room cards, no raw capitals, no empty out-of-order columns.
- New floor board: rooms grouped by hotel and floor, each room a numbered tile coloured by cleaning state, dot = occupied, red ring = arrival today, struck through = out of order; click opens the room. Floor is still the free-text `room_floor`.
- Next: same floor view for Tasks if wanted; floors as real values later.

## 2026-11-24 – Housekeeping floor plan
- Housekeeping: three views (`?view=plan|next|list`): Floor plan (corridor per floor, door tiles with number, room-type icon, state icon, arrival/departure/occupied marks, ring "x of y ready"), My next rooms (priority: arrival today and dirty, dirty and empty, after check-out), All rooms (list). New `hideList` hook in `mountCrud`.
- Room floor is now a select (basement -1, ground floor 0, floors 1–20); odd test value fixed on DEV.
- Housekeeping page redesigned: one coloured status row (replaces the duplicate tiles/legend/"to clean" lines), view tabs, hotel pills (one hotel at a time), floor cards with ring and corridor, one-line key. A room opens in a dialog (`public/housekeeping.js`, `?modal=1` fragment); the form has big status buttons and an "out of order" switch that reveals reason and dates, prefilled with today / tomorrow, in the app's standard date picker.
- Housekeeping page: the long list at the bottom is gone (floor plan + "Next to clean" panel are the page); hotel switch as a select; theme tokens only (palm/iris/burgundy, light/dark).
- Housekeeping staff (HOUSEKEEPING right, no RESERVATIONS_VIEW) get their own dashboard: progress of the day, cleaned by you / team, still to clean, arriving today and still dirty, next rooms, "Done today" log. New table `hk_log` (migration 0096) records every cleaning status change. `list.where` in `mountCrud` may be a function of the request.
- Open: menu of the housekeeping role still has Hotels and Rooms (read-only) – recommend removing; Tasks and Inventory stay.
- Housekeeping role menu is now Dashboard, Housekeeping, Tasks, Inventory (migration 0097 removes HOTELS_VIEW and ROOMS_VIEW).

## 2026-11-24 – Supply requests
- Housekeeping (and reception/manager) can ask for supplies: `/hotel/inventory/requests` (item from the list or free text, quantity, note). Buttons on the inventory list and on each item; housekeeping dashboard shows "Need something?" with the person's open requests.
- Managers (right `INVENTORY_REQUEST_HANDLE`) mark requests ordered / delivered / declined; hotel dashboard has an "open supply requests" attention row. Table `inv_request` (migration 0098), rights `INVENTORY_REQUEST`, `INVENTORY_REQUEST_HANDLE`.
- Ideas for later: e-mail to the manager on a new request, "delivered" booking the stock in directly, request from the order list.
- Inventory page simplified: one hotel at a time (select), two tiles (running low / out of stock), cards by default, no filter/columns/views/export buttons (`list.simple`), `list.where` default = first hotel. "Request supplies" and "Order list" open as popups (`public/modal.js`, `data-modal` links, `?modal=1` fragments; forms inside send in the background and reload the page on close). Housekeeping dashboard uses the same popup for requests.
- Housekeeping role no longer has `INVENTORY_EDIT` (migration 0099): items, article numbers, supplier and stock levels are for the manager. Housekeeping sees only items used for cleaning rooms and washrooms (linen, bathroom, amenities, cleaning), taps an item for a read-only card (`/hotel/inventory/:id/info`) with a "Request more" button, and sees "My requests" (waiting / ordered / delivered / declined with dates) on the Inventory page. The edit URL redirects to the read-only card for people without edit right. Order list button is for managers only.
- Inventory redesigned around pictures: cards with a photo of the item (upload on the item form, `iitm_image`, migration 0100) or, without a photo, an illustration of the item type (`src/modules/hotel/inv-art.js`: towels, mats, bottles, soap, slippers, sheets, pillow, coffee, tea, milk, paper, spray, bulb, box). Slim top bar (hotel, low/out chips, request button). Item card of housekeeping opens the request popup directly.
- Request popup: no drop-down; search field, tap several items, quantity stepper (− number +) for each, "Your request" summary with quantities, one request row per item. Hotel select removed.
- Open: real photos need an image-generation key (none on this server) or uploads per item.
- A room saved as clean/inspected is locked for housekeeping staff (read-only dialog with who/when); managers, company admins and reception may correct it (right HOUSEKEEPING_CORRECT, migration 0101). A new dirty status (e.g. after check-out) opens it again.

- 2026-11-25 Palma (Awais): from the feature wish-list document: (1) public **Help & contact** page `/contact` (`src/public/contact.js`): hotel phone/e-mail/address + emergency note when a hotel is chosen (`?hotel=slug`), message form (hotel, name, e-mail, optional booking number, subject, message) → `rup_contact_message` with the hotel id, so it shows in the hotel's Messages inbox and bell; rate limit 5/10 min, honeypot. Links: footer, hotel page menu, booking confirmation ("Ask a question"). (2) Booking form stays short (name, e-mail, phone required); new optional fold-out "I need an invoice with my address" (street, postcode, city) stored on the customer (kept if the customer already exists and has none). Tests: public.test.js (+1 test, address check). 183 pass + 2 old debug failures. Not pushed. Not done (later, waiting on keys/decisions): currency, SMS, online payment, events/Privilege Club, AI planner.

- 2026-11-25 Palma (Awais), admin QA doc + new requests (branch ui-lumen, not pushed): (1) required dropdowns start empty ("Select company/hotel", crud.js); (2) stricter e-mail check with typo hints (gmial.com → gmail.com, `emailProblem` in core/patterns.js), duplicate user name refused per company/area, company name min. 3 characters; (3) all generic lists open as **cards** by default (List stays one click away; mail queue, sessions, contracts keep the table because of their action columns); new generic card: title, "Company › Hotel" path line, labelled facts; (4) hotel cards (photo, Online/Tour, place, rooms, photos, status) on Hotels lists of admin and hotel app = same card as on the company page (`hotelCard` in admin/linked.js); (5) **Rooms** = board by hotel and floor with state chips (vacant, occupied, arriving, leaving, clean, dirty, out of order), table at `?view=list` (`hotel/rooms-board.js`, `public/rooms.css`); (6) admin lists room types / rate plans / offers / packages are scoped by a **Company › Hotel bar** (default: first company that has records) and every card shows its path; (7) detail pages: the second tab is named for what it holds (map `RELATED` in crud.js, `def.relatedTab`); role choices on user pages are cards with icon + description; (8) **role review** (migration 0102: READ_ONLY loses USERS_VIEW; downloads of hotel/room/package/service documents via /hotel/uploads/:id now need the view right of the record). Open for the role review: SUPPORT has COMPANIES_EDIT (needed for the support view; discuss), legacy roles untouched. Not yet done from the QA doc: rate-plan validation (percent 0–100, min stay < max stay), onboarding vs companies count, hotel/room photo upload, contract file upload, package services before first save, packages/promos naming details.
- 2026-11-25 Palma (Awais): **Filter drawer is dynamic everywhere**: every plain list column that maps to a table column and has 2–40 different values (company, hotel, country, city, floor, kind, board ...) becomes a filter with counts, taken from the list itself (`facetCols` in `src/web/crud.js`, params `f_<column>`, bound as SQL parameters, e-mail/phone/code-like columns skipped). Smoke-crawled all menu pages of admin, hotel, sales with a facet applied: no errors. Test in forms-ux.test.js.
- 2026-11-25 Palma (Awais): **Guided "New ..." forms**: `def.wizard` turns the form sections into steps (progress on top, Back/Next, Create on the last step, required fields checked per step; without JavaScript the whole form shows) – used for New hotel (admin + hotel app) and New company (`public/wizard.js`, `wizard.css`, crud.js). New hotel has a **cover photo** in step 1 (`hote_cover`, `saveHotelCover` → first/cover picture of the public hotel page). **Column panel** for every table view like WESS: search, show all / selected only, drag to reorder, up/down, pin left/right, reset (`public/columns.js`, kept per browser in `h2-colorder:<list>`; hide/show still `h2-cols:<list>`).

- 2026-11-27 Palma (Awais): **No more full page reloads in the app** (branch ui-lumen, not pushed). New `public/nav.js` (first script in the head of every app page: admin, hotel, sales, customer; `layout(..., { nav: true })` in `src/web/layout.js`, not on login/public/embed pages). Links, form posts (also multipart), `location.href = …`, `location.reload()` and Back/Forward now fetch the next page as HTML and swap the `<body>` in place (scroll, active tab via the hash, focus of a search field and the sidebar scroll are kept; thin progress bar; submit button is busy while it runs). Uses the browser **Navigation API** (Chrome, Edge, Safari 26); other browsers get a click/submit fallback (programmatic `form.submit()` / `location.href` there stay normal loads). After the swap the page scripts are started again like on a fresh load; to make that safe `nav.js` records what scripts attach to `document`/`window` (listeners, intervals, observers, a few globals) and removes it before the next page starts; a script that is started after load gets its `DOMContentLoaded` handler called at once; vendor scripts (Leaflet) are loaded only once. Opt-outs (real navigation): `<a data-full>` / `<form data-full>`, `target`/`download`, `?format=`, `?embed=` / `?modal=`, `/logout`, `/login`, other areas or sites, non-HTML or attachment answers (GET → real navigation, POST → blob download), pages without the app shell (session expired → login), any error in the swap (real navigation). Server side unchanged (the header `X-H2-Ajax: 1` is only informative). `?lang=` links also swap (the cookie is set by the answer).

## 2026-11-27 – Admin Room types and Rate plans & extras: matrix pages (Glass)
- `/admin/room-types` and `/admin/rate-plans` are now Glass overview pages (`src/modules/admin/matrix-pages.js`, `public/matrix3.js`, `public/matrix3.css`): hotels down, standard types / plans across (derived from the data: the 4 room types / 5 plan codes offered by most hotels), teal = larger version, dashed "+ add" = missing (opens the existing popup form pre-filled with hotel and the usual values), "Other" column with the odd ones in rust. Matrix | Cards | List share one set of filters (scope company › hotel, search, Active/Inactive/All, Guests / kind / board) and one set of counts; the last view is remembered in localStorage (default Matrix). Rate plans: 12 hotels per page. The hotel cell links to the hotel page (`#tab-roomtypes` / `#tab-rates`) with a hover animation.
- "Looks odd" rules (yellow banner): room type = 10+ beds, 100+ m² or 10+ guests; rate plan = numeric-only code of 6+ digits, percentage above 100, or 300+ per person and night. Only a hint, nothing is changed.
- Visibility: only deleted records are hidden (disabled companies/hotels stay visible). Generic lists of these two entities are off (`noList`); create/edit forms are unchanged and read `?hotel_id=&name=&adults=...` / `?code=&name_en=...` defaults.
- 2026-11-27 (matrix pages, list view): the List view of Room types and Rate plans & extras is a grouped table (Group: Hotel | None | Company, collapsible groups remembered in localStorage, group checkboxes, sortable headers, Columns chooser remembered, row menu "···", odd rows highlighted). Bulk bar with real actions (CSRF, COMPANIES_EDIT, audit): room types Edit size / Copy to hotels / Deactivate; rate plans Show / Hide on website, Copy to hotels, Deactivate. Routes `POST /admin/room-types/bulk|copy`, `/admin/rate-plans/bulk|copy`. Copy skips hotels that already have the name / code; copying a rate plan does not copy price rows per room type. "Duplicate" = copy in the same hotel with "(copy)" / "-2".

- 2026-11-27 Palma (Awais): **History tab redeveloped (Glass)** (branch ui-lumen, not committed). Every record History (generic detail pages of admin + hotel app via `historyPanel` in `src/web/crud.js`, reservation page, e-mail templates) now renders `src/web/history-view.js` + `public/history3.js/.css`: search, All / People / System, field dropdown, "Compare versions" (net difference of two points, built from the embedded old/new values), day-grouped timeline with avatar nodes (person / database / demo data), changed-back note, "AT A GLANCE / MOST CHANGED / WHO" cards, tab count. **Restore this version**: new route `POST <record>/history/:hid/restore` (mountCrud; CSRF, edit right, same validation and update as a normal save; the restore is a new history entry); the entry that equals the current record shows a disabled button. Other themes keep the old timeline (`.tl`). The global Change log (`/admin/audit`) keeps its own filters and page but uses the same look (CSS only: `.cl-list` rules in `history3.css`). Test side effect: offer W10-KITZBUEHEL got two extra history entries (restore tests); its values are back as before.

## 2026-11-27 – Admin Contracts and Onboarding & hand-over pages (Glass, mockups 94/95)
- `/admin/contracts` and `/admin/onboarding` are Glass pages (`src/modules/admin/cob-pages.js`, `public/cob3.js`, `public/cob3.css`); generic lists are off (`noList`), create/edit forms unchanged (`?company=` prefills the company).
- Contracts: Draft / Sent / Signed / Ended board, attention cards (ends within 14 days, waiting for signature, placeholder names), timeline on a shared month axis, Board | List switch (remembered), filters with chips. Actions: Send (DRAFT→SENT, no e-mail), Remind (sets reminder date), Rename placeholder names, Renew (copy as new draft "(2)"). All audited; right CONTRACTS_EDIT.
- Onboarding: cards with 5-step stepper + ring, one primary next action (contract, hotels, users, owner, bookable), set sales owner dialog, hand over only when all five steps are green. Cards | List switch, filters.
- Redirect after an action goes back only to the exact page (the loose `referer.includes()` caused a 404 with the in-place navigation).
- Tests: UI test (board, filters, actions, DE, in-place swap, no 390px overflow, no JS errors) passed; test data restored. `test/int/admin.test.js` contracts test now checks "In force" / "Ends in 10 days" (old "ENDS SOON" badge no longer exists). `scripts/test.sh`: 184/186; the two failing debug tests (`debug.test.js:90` expects 401, gets 403 for an unauthenticated upload) are in untouched code – to check.
- Next: confirm with Awais, then push (secret-scan, PR to main).

## 2026-11-27 – Admin Reservations (list + cards) and Portal accounts redeveloped (Glass)
- New: src/modules/admin/res-pages.js, public/res3.js, public/res3.css; `noList: true` on `reservations` and `portalAccounts` in admin/lists.js; mounted in admin/index.js.
- Reservations: grouped list / ticket cards / calendar link, 50 per page server side, status+hotel+company+arrival filters, live page search (Enter = whole list), real "Remind hotel" (mail queue + audit). Check in/out/Confirm/Release link to the read-only admin reservation (no admin routes exist).
- Portal accounts: guest cards + list; SAMPLE accounts derived from real test bookings while rup_account is empty (buttons disabled, "Sample data"); real accounts get View profile / Block (profile page) / Delete (soft).
- Open: Send password link / Resend confirmation not wired (no portal account mail helper); Invite guest disabled; reservations of deleted hotels still listed.

## 2026-11-27 – Admin reservation detail (Glass, "as in the mockup")
- New: `src/modules/admin/res-detail.js`, `public/rd3.css`, `public/rd3.js`; wired in `lists.js` (`mountReservationPage`). Old markup kept in `.rd-old` for other themes.
- Header card (breadcrumb, number + copy, status/payment/timing/channel chips, Open in hotel app, Back), ticket band + total with paid bar, read-only bar, Guest/Stay/Stepper/Hotel cards, price breakdown with zig-zag edge, tasks, payments/invoices, messages, History tab. EN+DE, reduced motion, stacks under 1100px.
- Tested on 12 reservations in different states: totals equal SQL; copy, links, Back, tab switch, DE, 390px (no overflow), in-place nav (no reload) OK; 0 JS errors.
- Open: PAID without payment rows is shown as paid in full (payment table empty on DEV). Hotel-app own detail not restyled.

## 2026-11-27 – E-mail queue as a three-pane mail app (Glass)
- New `src/modules/admin/mail-page.js`, `public/mail3.js`, `public/mail3.css`; generic list `mail-queue` set to `noList`.
- Mailbox (All/Delivered/Held/Pending/Failed), templates, threaded list by day, Envelopes/List views, search operators (to:, from:, subject:, template:, company:), detail pane with delivery timeline and thread list.
- Safety: the browser never receives raw mail HTML; links/tokens are stripped, sign-in codes masked, names shown as placeholders.
- Actions (JSON POST, CSRF, MAIL_QUEUE_EDIT, audit): requeue (retry/release), soft-delete for held/pending. Old `/resend` route kept.
- Open: "Send anyway" for held mails is not supported (release = requeue; re-held if the address is still not allowed).
- Envelopes view (airmail tiles, stamps/postmarks by status, "Where the N e-mails went" bar, duplicate banner with "Show them", status/template/search filters, Cards|List) and List view (timeline rows, dot per status, View / Send anyway) added to `public/mail3.js` + `mail3.css`; click opens the Inbox with `?m=<id>`. "Send anyway" = same re-queue as Release (confirm; may be held again).

- 2026-11-27 Palma (Awais): **Templates and Parameters in Glass** (branch ui-lumen, not committed). `/admin/templates` (cards as letters / grouped list, category chips, Global e-mails | Hotel copies, "Send test" = test mail only to the signed-in admin through the normal queue) via `src/modules/admin/tpl-pages.js` (old list still at `?view=old`, CSV/suggest unchanged); `/admin/parameters` (settings cards that save on change through `POST /admin/parameters/:id/quick` with validation per parameter, DATEV card, city-tax bars, grouped list, go-live strip) via `param-pages.js`. New reusable company switcher card `src/modules/admin/switcher.js` + `public/sw3.*` (on Parameters it filters the city taxes of that company's hotels; settings/invoice numbers are platform-wide). Assets `public/tp3.*`, `pm3.*`, `sw3.*`. Test: templates.test.js now checks the Glass page and keeps the old markup via `?view=old`.

- 2026-11-27 Palma (Awais): **Cancellation policies page (Glass)** (branch ui-lumen, not committed). `/admin/policies` is now Cards | List (`src/modules/admin/policy-pages.js`, `public/pol3.js`, `public/pol3.css`; `noList: true` on the `policies` def, edit form `/admin/policies/:id` unchanged). Cards: coloured header, schematic "what the guest gets" bar (free part / amber hatched deadline part / fully hatched no-refund; the bar is not to scale: a 48 h deadline fills 25 %), names on the portal (EN/DE), checkout mock, matching rate plan (plan carrying the policy code, else the most used one) + hotel count, Order; "Side by side" table; English | Deutsch switch. List: legend, drag handle (mouse drag or ArrowUp/ArrowDown on the handle, or "···" menu Move up/down) saves the order for real (`POST /admin/policies/order`, 10, 20, 30 …), column chooser, bulk bar (CSV / copy), row menu (Open, Move, Activate/Deactivate via `POST /admin/policies/:id/set-active`). Banner when active policies share an order; "Fix order" / "Auto-fix" = `POST /admin/policies/fix-order` (free policies first, then by name, steps of 10). Policies are platform-wide (no company column), so the company switcher card shows "Platform-wide"; "+ New policy" is disabled (the table has `noCreate`: a policy needs rules and legal text).
- 2026-11-27 Palma (Awais): **New e-mail template dialog** (Glass): '+ New template' and the dashed 'add one' cards of /admin/templates open a large dialog (who receives it, EN/DE names, code from the English name with live availability check, descriptions, live preview + 'what happens next'); POST /admin/templates/create (JSON, same validation and insert as the old form via src/modules/admin/tpl-new.js; audit TEMPLATE_CREATED) and GET /admin/templates/code-check. Old form /admin/templates/new stays as the no-JS fallback (category preselect via ?category=). Files: src/modules/admin/tpl-new.js, public/tpn3.js/css.

- 2026-11-27 Palma (Awais): **Amenity catalogue redone (Glass)** (branch ui-lumen, not committed). `/admin/amenities` is now Cards | List (`src/modules/admin/amenity-pages.js`, `public/am3.js`, `public/am3.css`; `noList: true` on the `amenities` def, create/edit forms unchanged, `?category=` pre-fills "New amenity"). Header with 20 / 11 in guest search / 0 with icon, "What guests see when they search" pill row (filter-flagged amenities in order), search + In search / Not in search + category dropdown, groups by category with cards (icon tile — dashed = suggestion, order #, EN/DE label, code, "In guest search" pill). List = grouped table with collapse, group checkboxes, bulk CSV/Copy, Columns chooser (remembered), row menu. Real actions (CSRF, PARAMS_EDIT, audit): `POST /admin/amenities/suggest-icons` (names from `AMENITY_ICONS`, now exported from `src/web/icons.js`), `/fix-text` (decodes `&amp;`-style entities saved twice; the banner and a rust note on the card only appear while such text exists), `/order` (drag / arrow keys inside one category: the same set of order numbers is handed out in the new order, so the global order and the preview row stay valid), `/:id/set-active`. Platform-wide, so the company switcher is the disabled "Platform-wide" variant (like the policies page). Idempotent init, works with the in-place navigation.

- 2026-11-27 Palma (Awais): **New amenity dialog (Glass)** (branch ui-lumen, not committed). "+ New amenity" (header) and the "+ Add" of each category group open a large dialog (`src/modules/admin/amenity-new.js`, `public/amn3.js`, `public/amn3.css`, modelled on the e-mail template dialog): category chips (+ dashed "+ New category"), EN/DE required and IT/ES optional names with "n of 4 languages", code auto-built from the English name (umlauts → AE/OE/UE/SS) with live "Free to use / Already used" check (`GET /admin/amenities/code-check`), searchable icon grid (`AMENITY_ICON_CHOICES`), "Guests can search for it" toggle, "Position: after …" dropdown, live card preview, portal-search pills with the new one highlighted. `POST /admin/amenities/create` (JSON, CSRF, edit right, 422 `{errors}`, audit AMENITY_CREATED); order = midpoint of the gap (renumber in steps of 10 only if no gap). After creating, the catalogue refreshes in place with the new card highlighted (`?new=<id>`). Old form `/admin/amenities/new` stays as the no-JS fallback.

- 2026-11-27 Palma (Awais): **Roles & rights in the Glass design** (branch ui-lumen, not committed). `/admin/roles` is now `src/modules/admin/roles-pages.js` + `public/rr3.js` + `public/rr3.css` (the former page stays at `?view=old`, route in `src/modules/admin/index.js`). Read-only: header (Roles 14 = 13 database roles + the guest account, Rights · platform 22, Unused roles = roles with nobody in them), info bar "View only…" (the "Request a change →" link is disabled: the app has no feedback route yet), four tiles, role list by group (Platform / Hotel management / Sales / Customer, legacy roles folded into a dashed row, people dots), detail pane per role (ring granted/total of the rights of its scope, apps, "See them →" = `/admin/users?role=CODE`, granted / missing / all, search, **Compare with…** dialog = rights only in A / only in B), and "Who can do what" matrix per app group (only rights held by at least one listed role; selected role column tinted). Data: `access_roles`, `access_rights`, `role_rights`, people = active rows of super_admin / company_user / sales_user by role code, guest account = active portal accounts. Rights are grouped by `RIGHTS`/`SECTIONS` in `src/modules/users/roles-info.js` (unknown codes fall into System). The company switcher is the disabled "Platform-wide" variant (roles have no company). Test `roles & rights page` in `test/int/users.test.js` rewritten for the new markup (old checks kept on `?view=old`).

## 2026-11-27 – Admin "Active sessions" (Glass, from mockup 116)
- New `src/modules/admin/session-pages.js` (GET /admin/sessions, POST /sessions/end-expired, POST /sessions/end-person; SESSIONS_VIEW / SESSIONS_END, audit), `public/ss3.js`, `public/ss3.css`; `system.js` sessions def `noList: true`; mounted in `admin/index.js`; `system.test.js` asserts `ss-tiles`.
- Page: figures, 4 tiles, expired banner, "This is you" card, search + app filter, views By person / Timeline / List, company switcher. No token/hash/cookie ever sent to the browser.
- Tests: scripts/test.sh 184/186 (only the 2 old debug.test.js 403-vs-401 failures). Counts checked against SQL; end actions verified and data restored; 390px and DE checked.
- Open: menu badge counts sessions seen in last 30 min (not open sessions); should "End expired sessions" also run automatically?

- 2026-11-27 Palma (Awais): **Sign-in log redone in Glass** (branch ui-lumen, not committed). `/admin/signins` is now `src/modules/admin/signin-pages.js` + `public/si3.js` + `public/si3.css` (`noList: true` on the old def in `system.js`, mounted in `admin/index.js`): header figures, four stat tiles (sign-ins today / failed 24 h / locked accounts / people 7 days), today's dot timeline (one dot per successful sign-in, colour per computer = OS + IP) with the "same person, same computer" insight (>= 20 sign-ins by one person+computer inside any 2 h window), "Other results" tiles that apply the filter, result pills with counts, search (types, then reloads), "Fold repeats" (default on) and the log grouped by day with 50 raw rows per page ("1-50 of N"). Folding happens per page and day (a fold group never spans two pages); successful sign-ins of the same person from the same computer (IP + user agent) become one row "signed in 47 times" with a "Show/Hide times" toggle. CSV (`?format=csv`, current filter, up to 50,000 rows) and `?format=suggest` (search palette) are kept. Company switcher: a sign-in belongs to a company only through the e-mail of a company user (`v_user`); platform and sales staff show under "All companies" (note under the switcher). Results: `GUEST_CODE_SENT` counts as "Code sent". Old test `sign-in log ...` in `test/int/system.test.js` adapted to the new markup.

## 2026-11-27 – Public portal redesign (Sunlit look), first part
- Added `public/portal2.css` / `portal2.js` (layered over `site.css`, own tokens/fonts, no dependency on the admin Glass theme). New nav: language, dark mode, **Saved** popover (localStorage), Sign in; footer countries from published hotels; `/maptile/:z/:x/:y` proxy (own map API, key server-side) used by all public maps instead of OSM.
- **Home** restyled: italic accent headline, trust row, theme chips, 6-tile destination mosaic, top-4 grid, 360° banner. **Offers**: campaign card (codes sharing a prefix, 12 hotels), copy code, package filter by nights; unusual codes (≥50 %, ≥30 min nights) and draft packages hidden. **Guest sign-in** "Welcome back": two columns, tabs (e-mail code / customer number), 6 digit boxes + resend countdown on the existing guest-code flow (`/login/guest-code`, `/customer/mfa`; no new endpoint or table needed).
- Not done yet: Hotels list, Hotel detail, Booking step 2, Home hero rating card / favourite hearts on cards. Next: those pages.
- Open: DEV code display for the e-mail code was not added (DEV uses the demo-guest button).

## 2026-11-27 – Admin "Archive candidates" rebuilt (Glass)
- New: `src/modules/admin/archive-pages.js`, `public/ar3.css`, `public/ar3.js`; old `archive` def got `noList: true` (lists.js), route mounted in admin/index.js.
- Candidates by kind (company/hotel/user/booking/email, flag based, deleted never counted); per-candidate row total = sum of the per-table breakdown (all rows, soft-deleted included). Cards | List, search, kind filter, company switcher, "all clear" tiles, EN+DE.
- Export (copy only, nothing is deleted): `/admin/archive?export=<kind>:<id>&format=csv|json`, streamed, audit `ARCHIVE_EXPORT`, secret/binary columns dropped, 413 above 200,000 rows.
- Next: archiving itself stays a separate work package. Open: the mockup's "1,934 rows" counted bookings only; ours counts all company tables (5,933 for Demo Hotels).

### 2026-11-27 (later) – Public portal redesign, second part
- **Hotels list**: heading "N hotels *for your stay*", "Active:" chips, campaign notice strip (from the shared-prefix codes), price histogram, facility counts + "Show all N", −X % ribbon from the hotel's best public offer, heart on every card (feeds the Saved popover), "See rooms →", "Show N more hotels" (8 per page, appends in place); map pins come from the whole result via the tile proxy.
- **Hotel detail**: rate radio columns per room (BELIEBT/POPULAR, GÜNSTIGSTER/LOWEST), one "Book <room>" button that follows the chosen rate, "Only N left" on the image, heart + share, review count in the tab, offer strip + "Choose a room" in the booking card.
- **Booking step 2**: three cards (Who is staying? / Make it yours / Confirm), extras tiles, arrival-time pills, live total inside the button, summary with check-in/out tiles, price-hold countdown and cancellation chip. Server logic, field names and pricing untouched. End-to-end test booking done on the live DB (total €439.95 = button = confirmation), then removed again (booking, lines, ext, customer).
- Home: hearts on the top-4 cards.
- Not done: "Tip: switch rate" box and the review filter pills / "Read all N reviews" on the hotel page; hold countdown counts 15 min from page load (not from the server hold time); DEV code display for the e-mail code.

## 2026-11-27 – My profile, Change password, Help (Glass)
- **Done:** `src/modules/users/profile-pages.js` (admin/hotel/sales: My profile with banner, 4 tiles from real data, details edit (name; e-mail with current password + new reset link), Look & language (language via `?lang=`, theme `h2-mode`, accent `h2-accent` -> `html[data-accent]` in `public/mode.js` + `public/glass.css`), security card (score, MFA_MODE link, End the others, Recent sign-ins link); Change password with strength meter/rules, reset link, "sign out other sessions", lock logic, audit, password-changed mail). Picture upload/remove re-use the existing routes (`back=profile` in `summary.js`). Help rewritten in `src/web/help.js` (cards from `menuGroups` filtered by rights) + `public/help3.js/css`. Assets `public/pf3.js/css`. Old markup stays inside `.pf-old` / `.hl-old` for the other skins.
- **Changed behaviour:** a successful password change now redirects to `/<area>/profile?m=pw` (was 200 with a message); test in `test/int/admin.test.js` adjusted + new profile test.
- **Open:** no per-user two-step sign-in exists (platform-wide parameter MFA_MODE), so "Set up" only links to Parameters.

## 2026-11-27 – Guest area in Sunlit Glass (dashboard, My bookings, My profile, security) – branch ui-lumen, not committed
- Own assets `public/cust3.css` + `public/cust3.js` (own tokens on `body.area-customer`, so it looks the same in every admin theme; dark mode supported). New helpers `src/modules/customer/ui3.js`.
- Dashboard (`customer/index.js`): next-stay hero (Directions = OpenStreetMap link, Message hotel = existing /contact form with hotel + booking no., Add to calendar = new `GET /customer/bookings/:id/calendar.ics`, owner-checked), 4 stat tiles, "For you to know" (open request, profile %), stays, spend-by-month SVG chart with table fallback, extras.
- My bookings (`customer/self.js`): pills filter on the page (counts real, URL kept, works without JS), cards, past stays + "Show N more", new review form `/customer/bookings/:id/review` (stored unpublished).
- My profile: banner, picture upload, progress ring, 3 sections, address typeahead via the server-side geocoder, e-mail read-only; save keeps the old route/validation (landline is no longer wiped when its field is not shown).
- Shell (`layout.js`, guest area only): "Guest area", customer no. in the user card, "Plan your next stay" card, "Back to website", sign-out in the sidebar; `auth.js` now carries `number`.
- Tests: `customer.test.js` updated to the new markup; browser run 55/55; `scripts/test.sh` 187/189 (only the 2 old debug.test.js failures).

## 30.11.2026 – Hotel app: Housekeeping page (Glass, mockup 148)
- New `src/modules/hotel/hk-page.js` + `public/hkp3.css/js`: floor plan / board / list of one hotel, status tiles that filter, selected-room panel (Start cleaning, Mark clean, Mark inspected, Needs cleaning again, Report issue, Out of order / Back in order), "Next to clean" with tick boxes, "Give N rooms to" + printable cleaning round (`/hotel/housekeeping/round`), "Today's flow" with drag and drop (buttons as fallback), live search (?q=).
- Migration 0106: `room.room_cleaning_since/by` ("cleaning now" = DIRTY + since), `rup_task.rtsk_assigned_fk` (round task per room, team HOUSEKEEPING, due today; closed when the room is marked clean).
- Rights: HOUSEKEEPING opens the page and starts/cleans; HOUSEKEEPING_CORRECT inspects and takes rooms back; a round is handed out with HOUSEKEEPING_CORRECT or TASKS_EDIT. The old room dialog `/hotel/housekeeping/:id` stays (dashboard links).
- Test: `test/int/hotel.test.js` (housekeeping page); full suite 191/191.

## 30.11.2026 – Hotel app: Tasks board and "New task" dialog (Glass, mockups 149 + 150)
- Tasks board (`src/modules/hotel/tasks-page.js`, `public/tasks3.css/js`, route `/hotel/tasks`): header with open / overdue / done figures, live search (?q=), team pills (All / Reception / Housekeeping / Maintenance / Mine), Board | List; quick-add card with themed chips and QUICK presets; board columns Overdue / Today / Coming up / Done with drag and drop (click menu as fallback); card menu (edit & history, reschedule, assign, delete with themed confirm). Migration 0107 adds the Maintenance team.
- "New task" dialog (opened by the header button; native `<dialog>`, opaque, backdrop blur, focus trap, Esc / click outside ask before discarding typed text, Enter adds, Ctrl+Enter in notes): big title, preset chips (prefill title, team, time), hotel picker with cover photo, room picker with live status chip ("to clean · empty"), Due Today / Tomorrow / Pick a date (the shared date picker) + "by 14:00" time picker, Team, Who (avatar pills: eligible colleagues of that team and hotel; no hotel assignment = whole company; read-only accounts never), Priority Normal / Urgent, Reservation (live search by guest or booking no., only with RESERVATIONS_VIEW), Notes, live "On the board" preview (column, chips, hotel · room · who) and an info box that tells what really happens, "Create another after this", full-height sheet at <= 860 px. Handles `html{zoom:.85}` when placing popups.
- Migration 0108: `rup_task.rtsk_due_time`, `rtsk_priority` (NORMAL / URGENT), `rtsk_notes`. A task due today with a time that has passed is Overdue; urgent tasks are listed first and marked red; moving a card to Today drops a time that has passed; "no date" drops the time.
- Server: one `createTask` for the quick-add card and the dialog (`POST /hotel/tasks/create` answers JSON): title required, hotel / room / assignee (company, team, hotel) / reservation (hotel) checked, past day or past time refused, history entry by the generic trigger. `GET /hotel/tasks/find-reservation`. Bell: "N tasks assigned to you" (link to Mine) + "other open tasks"; that is the real notification — there is no push or mail.
- Tests: `test/int/hotel-tasks.test.js` (dialog markup, create with all fields + history + bell, validation and rights, overdue-by-time / urgent order / move, reservation search scope, generic form).

## 30.11.2026 – Hotel app: Guests guest book, duplicates + merge, "New guest" dialog (Glass, mockup 153)
- New `src/modules/hotel/guests-page.js` + `public/guests3.css/js` (route `/hotel/customers`, right GUESTS_VIEW; the generic list of the guests def is off via `noList`, `/hotel/customers/new` and `/:id` stay the generic CRUD pages = plain fallback; the sales "My customers" list switches the list back on with `noList: false`).
- Header with figures (guests / countries / duplicate groups / inactive), live search (?q= name, e-mail, phone in any writing, guest no., city, booking no.; server side before the letter blocks), pills Active / Inactive / Staying now / Coming soon / Needs a fix (real filters), Guest book | Cards. A–Z rail (jump loads missing letter blocks, current letter follows the scroll), whole letter blocks lazy loaded (`?part=rows&offset=&to=`), rows with initials avatar, test data / incomplete / staying badges, country chip (code typed instead of a name = red).
- Side cards: Possible duplicates (same name or same e-mail, union of both), Tidy up (without country / phone, look like test data, country typed as a code, each filters the list; "Fix all" writes known codes out as names, own company only), Where guests come from (names normalised: DE / Germany = one bar).
- **Merge** (`POST /hotel/customers/merge`, right RESERVATIONS_EDIT, CSRF): pick the guest to keep in a themed dialog; empty fields of the kept guest are filled from the others, the others are archived (deleted + inactive, remark "Merged into …"), then bookings, help links, reviews, consents and (if the kept guest has none) preferences move over; one transaction; history by the table triggers. Refused: another company's guest, a guest with stays at another company (`shared`), a guest with a portal account (`account`), fewer than two, master not in the group; repeating it answers `gone`, never a 500.
- **"New guest" dialog** (header button; native `<dialog>`, opaque, blur, Esc / outside click ask before discarding, sheet at 390 px): first / last name, e-mail, phone + mobile (phone widget), date of birth (date picker), country (themed searchable list with flags, written out as English name), address, notes, "Create another after this". While typing, `GET /hotel/customers/find` shows guests with the same e-mail or name; `POST /hotel/customers/create` (JSON) validates (e-mail typo check, phone, date, country, lengths), refuses a second guest with the same e-mail unless "Create anyway", writes the row (history by trigger) and answers the new row, which is placed in its letter block with a highlight and a toast. There is no salutation / language / marketing flag on the guest record, so the dialog has none.
- Tests: `test/int/hotel-guests.test.js` (page, filters, search, lazy rows, merge + refusals, tidy up, new guest dialog endpoints); with customer / sales / hotel / ui / forms / users / tenant / auth suites 95/95 (the inventory tests were red while another fork was still working on them).

## 30.11.2026 – Hotel app: Inventory list + "New item" dialog (Glass, mockups 151 + 152)
- New `src/modules/hotel/inv-list.js` + `public/invlist3.css/js` (route `GET /hotel/inventory`, right INVENTORY_VIEW; the generic list of the inventory def is off via `noList`). Header (kicker with hotel, counters items / out of stock / running low / supply requests, "+ New item"), hotel pill, live search (?q= name, article no., supplier, storage place, category; server side), "Supply requests · N open" (existing requests page), Cards | List. Category pills with counts, sections with serif headings, cards (icon / photo, big quantity, status chip, bar up to 4 × minimum with minimum marker, "min N" / "x.x× minimum", "− Used" and "+ Delivery"), legend. `?cat=`, `?level=order|out` (old filter) still work. People without INVENTORY_EDIT see the same guest-facing categories as before, no order card, no quick buttons, no new button.
- **Order now** (editors): every active item at or below its minimum, ticked, suggested amount = twice the minimum minus stock (as the mockup says), stepper; Print → `GET /hotel/inventory/order-print?hotel=&i=id:qty,…` (printable sheet grouped by supplier, cost estimate); "Send order list" → `POST /hotel/inventory/order`: ticked items become supply requests with status ORDERED, an OPEN request of the same item is turned into the order (not doubled), an item that is already on order is skipped. No mail leaves the system. Items already on order are unticked by default and say "N already ordered".
- **Quick booking**: "− Used" / "+ Delivery" open one themed popover (quantity stepper, note) that posts to the existing `POST /hotel/inventory/:id/move` with a `back` address (only `/hotel/inventory…` addresses are accepted); the list shows "Stock updated." or the error. History stays in `inv_movement`.
- **New item** (`src/modules/hotel/inv-new.js` + `public/invnew3.css/js`): mockup 151 as a large native `<dialog>` on the list (opaque, backdrop blur, focus trap, Esc / outside click / ✕ ask before discarding typed input, scrollable body, live "How it will look in the list" card sticky beside the form, sheet with sticky Cancel / Create bar at 390 px). `GET /hotel/inventory/new` renders the same form as a plain page (direct links / no JS); `POST /hotel/inventory/new` answers JSON for the dialog (`X-Requested-With: fetch`): success → dialog closes, toast, list refreshes without reload, "Create & book first delivery" opens the "+ Delivery" popover of the new item with the fill-up quantity; errors → the form is replaced with the marked fields. Without JS it redirects (`first=1&qty=…#tab-stock` opens the stock tab with the quantity filled in).
- Steps: What is it? (hotel picker with photo + item count, item name with live "Similar – use as template" from the same hotel, category chips mapped to the stored categories – Bathroom & towels appears when a template uses it –, counted in, article number, optional photo with preview, PNG / JPEG / WebP ≤ 5 MB checked by content), When to reorder (live bar 0 / reorder at / fill up to, steppers, hints), Supply & storage (cost, supplier, stored in). Server validation: required name, same-company hotel, numbers ≥ 0 (comma or point, 2 decimals), minimum ≤ fill-up, category / unit from the lists, duplicate name in the hotel (case-insensitive, advisory lock → two quick submits create one item), CSRF, INVENTORY_EDIT; no 500s.
- Migration 0110: history triggers on `inv_item` and `inv_request` (they had none, so item edits were not in the History tab).
- Shared `crud.js`: new flag `customNew` (skips the generic `GET /new`) – used by the inventory def.
- Tests: `test/int/hotel-inventory.test.js` (new item page + JSON, validation matrix, double submit, first delivery, order list / send / print, quick booking `back`, rights, tenants).
- Open questions: (1) The mockup shows "Linen / Toiletries / Cleaning / Food & drink / Technical / Other" but the database has seven categories (Bathroom & towels is extra) – kept as is. (2) "Send order list" only marks requests as ordered – there is no supplier mail; should it also send an e-mail per supplier (DEV: example addresses only)? (3) Suggested order amount is "twice the minimum − stock" (mockup), the item's own "fill up to" is not used for it – ok? (4) Housekeeping demo user has no INVENTORY_EDIT right here, so cannot book stock from the list (as before).

## 30.11.2026 – Hotel app: Hotel rule page + Prices overview (Glass, mockups 154 + 155)
- **Hotel rule** (`src/modules/hotel/rule-page.js`, `public/rule3.css/js`): the edit page of a price that hangs on a hotel (`offer_price`, table HOTEL) – the weekend surcharge. Hooked into the generic price form through a new optional `def.editPage` in `crud.js` (room / package / service prices keep the generic form). Rule in one sentence with pill popups (amount + type, nights, from / until with "no end date"; hotel is fixed, room type is listed but not selectable), "Euro or percent?" bar with "Make it +N %", How much (+€ / + % / ×, counted per room & night / person & night / stay), When (dates, nights), Only for some guests (adults, children, child age, country, devices, browsers; warning for "only 1 adult"), Note, live "What a guest pays" example (real room of the hotel, same `nightPrice` function as the booking engine) and the valid timeline. Explicit save: the chip shows Saved / Unsaved changes / Saving, Ctrl+S, leaving with unsaved changes asks; it posts to the generic form with `X-Autosave: 1` (JSON, version check 409, field errors 422).
- **Engine**: `pricing.js` `weekendRule()` – the booking engine uses the old remark `WEEKEND_FACTOR_PCT` (amount always read as percent, whatever the type says) or a rule made on this page as PERCENT on WEEKEND nights for every guest. EUR / FACTOR / every-night / weekday rules are saved but do not change booking prices yet – the page says so. Open: the engine ignores the valid-from / until dates of this rule (it takes the newest one).
- **Validation** (`panels.js` priceDef): percent 0.01–100, factor 0.01–10, nights from a list, until >= from; `ofpr_nights` defaults to EVERY (also on create). Migration 0109 `ofpr_nights` (existing weekend rules become WEEKEND), migration 0111 history trigger on `offer_price` (prices had none, so the History tab was always empty).
- **Prices** (`src/modules/hotel/prices-page.js`, `public/prices3.css/js`, route `GET /hotel/prices`, right PRICES_EDIT; the generic list is off via `noList`): counters (room prices / hotel rules / services / conflicts), hotel switcher, tabs Rooms · Hotel rules · Services · Packages, view Seasons | Cards | List (search pill in List and the other tabs). Seasons = 12-month timeline Oct–Sep per room with prev / next year, base / winter / summer bars chosen exactly like the engine (valid, no guest restriction, newest start wins), today marker, "no winter price · base applies" notes, hover titles. Room price table (Base / Winter / Summer / Child / Weekend, Edit / Fix), weekend surcharge per hotel grid (opens the rule page, "+ Add" for hotels without a rule).
- **Conflicts**: two base prices of a room that overlap in time with different amounts → banner + counter; "Choose one" dialog → `POST /hotel/prices/resolve` ({room, keep}, CSRF, PRICES_EDIT, own company only): an older overlapping price ends the day before the chosen one starts, one that starts the same day or later is closed (soft delete); history by the table trigger. "+ New price" dialog picks what the price is for (room / hotel rule / service / package) and opens the existing create form (a new hotel rule opens the rule page).
- Tests: `test/int/hotel-prices.test.js` (kinds + conflict detection, page / views / tabs / search / German / rights, Choose one incl. rights, CSRF and tenants, rule page markup, JSON save + validation matrix + 409, engine rule, new price). Full suite 218/218.
- Open questions: (1) Should EUR / FACTOR / weekday rules be applied by the booking engine (today only percent on weekend nights)? (2) Should the engine respect the valid-from / until dates of the weekend rule? (3) A rule cannot change its hotel (create it at the other hotel) – OK? (4) Room-type specific rules need an engine change – wanted? (5) The mockup header has no search pill; it is shown in List view and the other tabs.

## 30.11.2026 – Booking engine: all hotel rule types apply (answers the open pricing questions of the Hotel rule page)
- **Decision (Awais: "implement what is business-logic-correct")**: the engine (`src/modules/booking/pricing.js`) now applies every hotel rule (`offer_price`, table HOTEL): types EUR / PERCENT / FACTOR; counted per room & night, per person & night (adults + children) or per stay; nights every / weekend (Fri + Sat nights) / weekdays (Sun – Thu); only inside valid from – until (empty until = open-ended); only for the room type it is made for (empty = every room); guest conditions adults (exactly N in the room), children (exactly N), child age (every child up to N), country (needs a known guest country – `calc` takes `guestCountry`, the staff/portal forms do not pass one yet, so such rules do not count there). Device / browser limits cannot be checked on the server: a rule that has them is **not applied** (the page says so).
- **Order and stacking (documented on the Hotel rule page too)**: per night percent, then factor (rounded to whole euros as the old weekend surcharge), occupancy rule, single-guest factor 0.85, then fixed euro amounts (room / person); per-stay rules on the room total afterwards (percent, factor, then euro, once per room). Of the same kind + counting + nights + guest conditions only ONE rule counts: a room type rule replaces the every-room rule, then the newest start date, then the newest id. Different kinds add up. The night price never drops below 0. Old rows with remark `WEEKEND_FACTOR_PCT` are still read as "percent on weekend nights, every room, every guest" (so existing quotes do not change; delete / change the remark to make the saved type count).
- **One function everywhere**: `nightFinal()` is used by the stay price (`roomCost` → `calc`, search, staff reservation), the night breakdown and the live example; `weekendPct`/`weekendRule` stay only for old callers. Invoices take the booked price lines, so they follow automatically.
- **Hotel rule page**: the "for" pill works (room type scope, saved in the new column `ofpr_rtype_fk`, migration 0112, must be a type of the same hotel); "What a guest pays" is computed by the server with the same engine (`GET /hotel/prices/:id/example`, right PRICES_EDIT, tenant checked) for the rule as edited, Wed + Sat night of a real room type, for the guests the rule is made for; the "does not change prices yet" disclaimers are gone; new info notes (how rules combine, device/browser, country). Prices page: the Weekend column shows the rules the engine really uses per room type (`+10% weekend`, `+€10 weekend`, `×1.1 weekend`, `/ person`, `/ stay`).
- **Validation** (generic price form + rule page): percent 0.01–100, factor 0.01–10, hotel rule in euro up to 10,000, room type must belong to the hotel; a rule can only add or multiply (price min 0.01, factor min 0.01), so a negative night price cannot arise; the engine clamps at 0 anyway.
- Differences for existing data: none for the 14 old weekend rules (same numbers; they now also respect their valid-from date, e.g. the rule dated 17 Oct 2026 does not charge nights before that day).
- Tests: `test/unit/pricing-rules.test.js` (types, counting, nights, dates, room type, conditions, stacking, legacy remark, rounding, clamp), `test/int/pricing-rules.test.js` (quote through `calc`, room type scope saved from the page, validation, example = quote, rights, tenants), `test/int/hotel-prices.test.js` updated.

## 30.11.2026 – Housekeeping: rights split and the employee dashboard (Glass)
- **Rights (migration 0113)**: `HOUSEKEEPING_VIEW` opens the floor plan (company admin, manager, reception, housekeeping); `HOUSEKEEPING` (start / clean / report issue / out of order) is unchanged; `HOUSEKEEPING_ASSIGN` hands out a cleaning round (company admin, manager, reception – no longer `TASKS_EDIT`, so housekeeping staff cannot hand out rounds); `HOUSEKEEPING_CORRECT` (inspect / take back) unchanged. Read-only users still get 403. The menu entry follows `HOUSEKEEPING_VIEW`.
- **Reception**: sees the page read-only (`data-ro="1"`: all room buttons disabled with "View only", no drag), may hand out a round. The employee picker still falls back to all housekeeping staff of the company when nobody is assigned to the hotel.
- **Round sheet** (`/hotel/housekeeping/round`): managers / reception open any round, housekeeping staff only their own (403 otherwise, checked before the lookup).
- **Employee dashboard** (`src/modules/hotel/hk-dash.js`, `public/hkd3.css/js`, replaces the old plain page): greeting + sentence, ready-for-guests ring, tiles (still to clean, cleaned by you, team today, out of order), "My rooms today" (rooms handed to me via `rtsk_assigned_fk`, arrivals first, one tap Start → Mark clean / Pause through `POST /hotel/housekeeping/act`, same rules / history / stock booking as the floor plan; a room with a finished and an open task shows once), "Next to clean" when nothing is handed out, "My tasks" (other open tasks assigned to me, urgent first), "Need something?" (own supply requests, request link), links to the floor plan and my round sheet. Mobile first (390 px, no sideways scroll), German, dark, hover and flash animation; the script is idempotent (`window.__hkdDoc`).
- Tests: `test/int/hotel.test.js` (housekeeping page: reception read-only, cannot act, can hand out; housekeeping cannot hand out; read-only 403; round sheet rights; dashboard markup, German, finished room stays as done).
- Open: housekeeping staff of one hotel still see all rooms of the company on the dashboard counters (hotel assignment is recorded, not enforced); no "assigned to you" push, only the bell count of tasks.

## 30.11.2026 – Hotel app: Reviews and Messages (Glass)
- **Reviews** (`src/modules/hotel/rev-page.js`, `public/rev3.css/js`): rating summary (average, three score bands, five topics), cards / list, filters (unanswered, 9+, 8–8.9, under 8, hidden), live search (?q=, server side before the page is cut), hotel switcher, answer dialog (empty answer removes it, themed confirm). Scores are 0–10 as in the portal, the stars show score/2. Publishing / hiding stays a platform decision, so the page only shows it.
- **Messages** (`src/modules/hotel/msg-page.js`, `public/msg3.css/js`): inbox with unread dot, filters (All / Unread / Seen / Answered / Done), search, conversation dialog; opening marks an unread message as read (POST /seen, never turns answered / done back), "Mark unread", "Mark done", answer by e-mail through the queue (`sendMessageReply()` in entities.js, shared with the generic form). The e-mail queue cannot be read by the tenant role, so earlier answers are not shown in the conversation.
- The generic forms `/hotel/reviews/:id` and `/hotel/messages/:id` stay as plain-page fallback (`noList` on both definitions). Tests: `test/int/hotel-reviews-messages.test.js` (4).

## 30.11.2026 – Hotel app: Occupancy rules (Glass)
- **Page** (`src/modules/hotel/occ-page.js`, `public/occ3.css/js`, `/hotel/occupancy-rules`, `noList` on the definition; the generic form `/hotel/occupancy-rules/new` and `/:id` stay as fallback): header with counters (rules, active now, hotels with rules, conflicts), hotel switcher, live search (?q=), filter pills (Active / Upcoming / Expired / Off / All), one card per rule. A rule is one sentence with pill popups ("When occupancy is at or above [80 %], change the room price by [+10 %]"), name inline, on/off switch, valid from / until (shared date picker), status chip, warnings, per-card Save with the Saved / Unsaved chip (own `POST /hotel/occupancy-rules/save`, JSON, version check -> 409), Delete (themed confirm, soft delete, stays in the history). "+ New rule" opens an opaque dialog (sheet at 390 px).
- **Live example**: the real occupancy of the next 7 days and the base price of a real room of the hotel (same functions as the booking: `occupancyPct`, `occupancyAdj`, `nightPrice`); while a rule is edited the table recomputes with the engine's rule (highest reached threshold wins, then the higher change; whole-euro rounding) and shows the night price a guest pays. Step chart: price change by occupancy with today's occupancy marked.
- **Warnings**: two active rules with the same threshold in an overlapping period = conflict (counted in the header; saving such an active rule is refused with a friendly message); a price that falls as occupancy rises = soft warning. Expired / off / upcoming rules explain themselves.
- Validation: name required, occupancy 0-100, change -50..+100 (DB checks), until not before from, hotel / rule of another company -> 404 (RLS), reception / housekeeping / read-only 403 (PRICES_EDIT as before). History: table trigger (`rup_occupancy_rule_history`).
- Script is idempotent for in-place navigation: nav.js removes the recorded document listeners and starts the page scripts again, so `bind()` drops its previous listener pair (`window.__occOff`) and binds a new one. **Bug found and fixed in `public/nav.js`**: the "bind once" flags `window.__xxDoc` (hres, prices3, rule3, tasks3, hkp/hkd, guests ... ) were never reset, so after an in-place navigation (tab link, `location.reload()`) the document listeners had been removed and the script did not bind again = dead buttons (e.g. "+ New price" after clicking the Hotel rules tab). `teardown()` now deletes every `window.__*Doc` flag together with the listeners.
- Tests: `test/int/hotel-occupancy.test.js` (4: pure analysis, page / filters / search / German / rights, save + validation + clash + version + history, remove + tenant isolation).
- Open: the engine counts the occupancy rule once per night for the whole room price (percent), after the weekend/percent rules and before fixed euro rules; rules per room type or per hotel group are not possible.

## 2026-11-30 – Hotel app: Invoices, Services / Room services, Portal profiles, Photos (Glass) – work package C
- **Invoices** (`/hotel/invoices`, `src/modules/hotel/inv-page.js`, `public/inv3b.*`): counters (invoices / open / overdue / paid, amount still to collect), status pills (All / Open / Overdue / Paid / Drafts / Credit notes), hotel pill, live search on the server before the pages are cut (number, guest, booking number, hotel, amount), 25 per page, CSV (all matches), DATEV link, "+ New draft" dialog (`POST /hotel/invoices/new-draft`, JSON; same rules as the reservation page). Overdue = issued, still open, older than the 14 day term printed on the bill. The old `?inv=open|paid|draft` filter still works. The generic list is switched off (`noList`), invoice detail / print / PDF / XML / payment routes are unchanged.
- **Services and Room services** (`svc-page.js`, `public/svc3.*`): cards / list, current price with unit (from the price table), where it is used (packages / rooms), Active switch (saves at once, `POST …/set-active`), "+ New" dialog (`POST …/create`: name, unit for services, note, active; duplicate names refused; "Create & add price" continues in the price form). Detail pages stay generic.
- **Portal profiles** (`prof-page.js`, `public/prof3.*`): one card per hotel with cover photo, stars, rating, completeness meter (the 8 things a hotel needs before going online) and the Published switch (`POST /hotel/profiles/:id/publish`; going online needs the same checks as the profile form, going offline always works).
- **Photos** (`photo-page.js`, `public/photo3.*`): gallery per hotel (or all hotels while searching), counters, pills (All / Cover / Needs credit), upload dialog with preview (credit and rights confirmation required, JPEG / PNG / WebP up to 5 MB, magic-number check), make cover, move earlier / later, delete with confirmation. **New right PHOTOS_VIEW** (migration 0114) for every hotel role: reception, housekeeping and read-only can look at the photos and load the cover pictures (before: 403 for housekeeping); editing stays with PORTAL_CONTENT_EDIT.
- Shared: `public/gx3.css/js` (dialog with unsaved-input check, toast, hotel pill, switches, action forms, tables turn into cards at phone width). Migration 0114 also adds history triggers for services, photos and portal profiles.
- Tests: `test/int/hotel-lists-glass.test.js` (6); `ui.test.js` now uses the Users list as the generic-list sample (services have their own page). Open: `hotel-occupancy.test.js` and the guest detail assertion in `hotel.test.js` ("Stays & invoices") belong to other work in progress.

## 2026-11-30 — Country picker (all forms) + hotel guest detail page (Glass)
- **Country picker** `public/cpick.js/css` (global in `layout.js`, data from `/assets/countries.js` = `countryPickerData()` in `src/web/country.js`): every text field named `country` / `*_country` (or `data-cpick`) becomes a left-aligned searchable list that floats above the form (top-layer popover inside open dialogs, flips upward, bottom sheet at ≤560 px), "Most guests come from" first (`data-top`, computed from the company's guests by `topCountryCodes()`; fallback DE, CH, AT), flag + name + dial code, matched part highlighted, keyboard hints. After a pick the form gets `h2:country` and phone fields (`phone.js`) follow the country until the dial code was chosen by hand ("phone set to +41"). Optional map preview (`data-cpick-map`): tiles from our own `/maptile` proxy, ring + dot + name. The old guest-dialog list (`gu-cb`) is gone.
- **Guest detail page** `src/modules/hotel/guest-page.js` (+ `public/guest3.css/js`), hooked in as `editPage` of the customers def (the sales area keeps the generic form: `editPage: null` in `sales/index.js`): header (avatar/photo, name, badges, figures, Saved chip, Preferences, active switch with confirm, tabs Details · Stays · Invoices · Documents · History), Who / How to reach / Where (country picker + map) / Notes, right cards (Stays, Invoices open amount, Possible duplicate with the real merge, Data quality hints incl. "write out DE as Germany", Consents). Explicit save through the generic form (`X-Autosave: 1`, version check 409, field errors 422, history). Profile photo is served by `GET /hotel/customers/:id/photo` (view right, tenant isolated). Merge from the page: `POST /hotel/customers/merge` with `next=detail` comes back to the guest that stays. Country is stored as one name (`sanitize` of the customers def: DE / Deutschland / "Germany" → Germany).
- Tests: `test/int/hotel-guest-detail.test.js` (4); `hotel.test.js` guest-page assertion updated. Full suite 256/257 (only the occupancy fork's `hotel-occupancy` save test fails, not part of this work).

## 2026-11-30 – Hotel app: E-mail templates (Glass, mockup 161)
- **Page** `/hotel/templates` (`src/modules/hotel/tpl-page.js`, `public/tpl3h.css/js`; routed from `src/modules/templates/templates.js`, the old record/list pages stay reachable with `?view=old`, the platform page is unchanged): header with counters (active / own copies / need a look), tabs Global · N | My copies · N, search, category pills; left list grouped by use (when a guest writes / for the hotel team / sign-in & accounts / prospects / bookings), version chips (v1 live, v2 draft, not published, own copy), "Turned off · N" behind a button. Right: live preview (teal chips = fields the system fills in; "Example" = the real renderer `buildMail` with sample data; EN | DE). Below: "Used for your hotels" (global: "Make my own copy"; own copy: Edit draft, Switch off, Go back to global with confirm), "Versions" (click = preview of that version), "Needs a look" (never published = red, newer draft = amber, own copy still a draft = amber; links to the template).
- **Logic unchanged** (shared with the platform): one text per code, a company copy wins for that company only, draft -> published, placeholders escaped, rights `COMPANY_TEMPLATES_VIEW/EDIT` (company admin, hotel manager; others 403), CSRF, history triggers. A company never edits a global template and never sees another company's copy (row level security + checks). New: `POST /hotel/templates/:id/revert` = "Go back to global" (own copy only, soft delete, audit `TEMPLATE_COPY_REVERTED`).
- **Editor** (the old draft page, also used by the platform): two columns with a **live preview** (`public/tpl3e.js`: subject, heading and text as typed, fields as chips or sample values; the body is cleaned in an inert document first), placeholder chips restyled.
- Tests: `test/int/templates.test.js` (new test: groups, preview, copy, own list, record forward, editor live preview, isolation, revert, global text again). Browser: hotel/hotelmgr 200, reception / read-only / housekeeping 403; German, dark, 390 px (no sideways scroll).

## 30.11.2026 (Awais/Palma): hotel app Reports (Finance · insights), Glass
- **Page** `/hotel/reports` (`src/modules/hotel/rep-page.js`, pure metrics in `rep-metrics.js`, `public/rep3.css/js`; the old tables page in `operations.js` is gone, the CSV keys `pickup`, `channel`, `hotel`, `authorities` stay). Right `REPORTS_VIEW` (company admin, hotel manager, read-only; reception / housekeeping 403). Own company only (row level security on `v_reservation`); a hotel id of another company is ignored.
- **Header:** period pills This month / Last month / This year / Custom (popup with the shared date picker), hotel pill (themed list), "Download all (CSV)" (one file, sections `# summary`, `# pickup`, `# channel`, `# hotel`, `# authorities`).
- **Definitions** (printed under the page): revenue = gross `total_amount` of the bookings that ARRIVE in the period (CONFIRMED / IN_HOUSE / CHECKED_OUT; CANCELLED and NO_SHOW left out); room nights = nights x rooms of those bookings; available = rooms of the hotel(s) x days of the period (rooms out of order are not subtracted); occupancy = room nights / available; ADR = revenue / room nights; RevPAR = revenue / available. Kept vs cancelled = arrivals in the period that stayed vs CANCELLED / NO_SHOW; the info box shows when more than 25 % did not happen. Pickup = kept bookings by the day they were created (Berlin time), last 30 days, Bookings | Room nights | Revenue; a peak above 5 x the median of the other busy days and at least 30 % of the series is annotated, "likely the test data import" when most of that day's bookings share one minute of creation. Channels = revenue share and average booking per `channel` (Front desk / Phone / Agent / Portal). Revenue by hotel = top 12, dashed mean over all hotels with revenue, darker = at or above the mean. Countries = guest arrivals (adults + children, at least 1 per booking) and overnight stays (persons x nights) per guest country; "DE" and "Germany" are one country, no country = "Not set"; treemap (squarified) + map (`public/europe-map.svg` land loaded by `rep3.js`, bubbles by `web/europe-map.js` projection; countries outside the map are listed under it) + "Export for the statistics office" (`?csv=authorities`: month, country, arrivals, overnight_stays_persons, bookings).
- **Charts** are hand-written SVG / CSS (draw-in of the line, rings, bars, bubbles; tooltips; phone sizes: own small line chart, rows instead of lollipops). No library, no CDN, no Google map.
- Tests: `test/unit/rep-metrics.test.js` (10), `test/int/hotel-reports.test.js` (5: hero numbers, sections, periods / filters / bad input, CSV, rights and tenant isolation). Browser: hotelmgr / readonly 200, reception / housekeeping 403; German, dark, 390 px (no sideways scroll).

## 30.11.2026 (Awais/Palma): hotel app Services, Room services, Invoices reworked to the mockups (157, 158, 159)
- **Services** `/hotel/services` (`svc-page.js`, `svc-lib.js`, `public/svc3.css/js`): sections by category (new column `serv_category`, migration 0115), cards with language note / unit / price, duplicate marking, "What guests see when booking" checklist, "Tidy up" shortcuts (without a unit / one language only / unit and German name hidden in the remark — filters `?tidy=`), "N services exist twice" with a real **Merge** (POST `/hotel/services/merge`: the one with more prices and package links stays, the English name stays, the German name goes to the remark `DE: ...`, prices / package links / files move over, the other one is archived; same-company only, `SERVICES_EDIT`). The remark convention `unit: X | DE: name | note` is parsed in `svc-lib.js`; pairs come from a small bilingual dictionary (Parking/Garagenstellplatz, Spa access/Spa-Eintritt, Late check-out/Später Check-out ...). "Unit not set" opens a small dialog (`/hotel/services/:id/unit`). New dialog: section, other-language name, unit. Default status filter is Active.
- **Room services** `/hotel/room-services` (`rsv-page.js`, `public/rsv3.css/js`): room services are now the things a guest can order to the room (migration 0115: category, icon, unit label, serving hours / on arrival / anytime, lead time; new table `room_service_order` with RLS, history and status NEW -> DELIVERING / READY -> DONE / CANCELLED). Cards by category, edit dialog (click a card), On switch, today's open orders with a status menu, "Add an order" dialog, phone preview. Without any room service the page shows clearly marked **sample data** (read-only); "Use these as a start" creates the 11 samples as real entries (prices in the price table). Prices stay in `offer_price` (`ROOM_SERVICES`). Not done yet: the guest cannot order on his own (no guest-area ordering), and an order is not booked on the room bill.
- **Invoices** `/hotel/invoices` (`inv-page.js`, `public/inv3b.css/js`): test-mode banner, counters, month picker (`?month=YYYY-MM|all`, default = current / latest month), "<Month> at a glance" (billed, cancelled, revenue, still to collect, share cancelled again), invoices grouped by day with their credit notes, preview of the bill on the right (`/hotel/invoices/:id/preview`), pills All / Open / Overdue / Paid / Drafts / Cancelled (+ credit notes). **Send** (`/hotel/invoices/:id/send`): queues the bill through the mail queue; in TEST mode only a `[TEST]` copy to the signed-in user, in LIVE to the guest e-mail of the booking (422 if there is none), never for drafts or with INVOICE_MODE off.
- Tests: `test/int/hotel-lists-glass.test.js` (services pairs / merge / unit / create, room services samples / seed / save / orders / status, invoices month / glance / preview / send). Browser: hotelmgr, 1477 and 390 px, German, dark, no sideways scroll.

- 2026-11-30 Palma (Awais): **Hotel app Company page** (mockup 166), `/hotel/company` -> `/hotel/company/:id` (company admin, `USERS_VIEW` to look, `USERS_EDIT` to change). Hand-built page `src/modules/hotel/co-page.js` (+ `public/co3.css/js`, `test/int/hotel-company.test.js`), hooked in as `editPage` of the generic company definition, so the generic form, version check, history and documents stay. Header with banner, logo tile (upload/remove, PNG/JPEG/GIF/WebP up to 1 MB), chips and tabs Details | Colleagues | Documents | History. Details: auto-saving form (generic company form, `X-Autosave` JSON) + further addresses + at-a-glance card. Colleagues: org chart (company admin > hotel manager > front desk / rooms > read only), Team | Table (shared segmented control, table search = shared `hsearch` client pill), person panel, "Today" card, add person (name, e-mail, role, hotels; invitation through the mail queue), change role, password link, deactivate / activate; protections: not the own account, never the last company admin, own company only. "Who can open what" is computed from the real `role_rights` (areas -> view / change rights in `AREAS`). Hotel assignment of a new colleague is written with the owner connection (tenant role may only read `company_user_hotel`). Not in the schema, so not on the page: legal name, billing e-mail (invoice address text field added to the form instead).

## 30.11.2026 (Awais/Palma): hotel app Hotel page, tab "Prices & files" (mockup 169)
- The Hotel page (`/hotel/hotels/:id`, Glass header + tabs Details / Rooms / Room types / Rate plans / Offers / Packages / Reservations / Inventory / Prices & files / Documents) already existed (admin `hotelDetail('hotel')`); new: the sub line under the name ("Kitzbühel, Austria · 15 rooms · 4 room types", `.hh-sub`) and the **Prices & files** tab, which is now hand-built (`src/modules/hotel/hd-prices.js`, `public/hdet3.css/js`) instead of the old price table.
- **Hotel-wide price rules** (table `offer_price`, `ofpr_table_name = 'HOTEL'`) as cards: icon, derived name (weekend / weekday / country / child / seasonal surcharge), big value (+10 % / +€10 / ×1.1), chips From / Until / Counted / Guests / Countries, amber bar "Saved as EUR 10.00, but the remark says WEEKEND_FACTOR_PCT — it probably means 10 %" with **Make it N %** (type -> PERCENT, remark untouched), **Edit** (Hotel rule page `/hotel/prices/:id`), **Duplicate** (copy, opens on the rule page), **End this rule** (confirm; ends today, a rule that has not started is removed; history by the table trigger). Rules ended before today sit under "Ended rules (n)".
- **What a week costs**: 7 day tiles of the next Monday-Sunday for the first room type with a price, computed with the booking engine (`nightPrice` / `roomCost` with the hotel's rules, 2 adults), changed nights highlighted with "+10 %" (or "+€N" when only euro rules apply); caption "base €x · if read as +10 %"; note on two base prices at the same time (same detection as the Prices page).
- **Add a hotel rule**: templates Child price, Seasonal surcharge, Country price open the "New hotel rule" dialog (amount type, amount, counting, nights, dates, room type, country / children); `POST /hotel/hotels/:id/rules` validates (percent 0.01-100, factor 0.01-10, euro up to 10,000, until >= from, room type of this hotel, country from the list, adults 1-20, children 0-20, age 0-17), creates the rule and opens the Hotel rule page. **Last-minute discount** and **Long-stay discount** are shown with the note "Not applied to bookings yet" because the booking engine knows neither lead time nor minimum stay (needs a pricing change + columns); no button.
- Rights: PRICES_EDIT for the buttons and POST routes (reception / read-only see the cards with "View"); other company's hotel or rule -> 404; CSRF on every POST; all POST routes answer after the commit.
- Tests: `test/int/hotel-detail-rules.test.js` (page EN/DE, cards, templates, honest notes; create validation / success / rights / tenant / CSRF; fix, duplicate, end, delete). Browser (Playwright): hotelmgr (create via dialog with validation errors, duplicate, Make it 10 %, End with confirm), reception / readonly (no buttons), housekeeping 403, German, dark, 390 px (no sideways scroll). Full suite 284 of 284.
- 2026-11-30 Palma (Awais, fork "My leads"): **Sales "My leads" rebuilt from the mockup** (branch ui-lumen, not committed). `/sales/leads` is a hand-built Glass page (`src/modules/sales/leads-page.js`, `public/leads3.css/js`, `leads-geo.js`): header (kicker with the date, counters active / won / overdue, "+ New lead"), live search pill (`?q=` company, contact, city, country, e-mail, phone), Pipeline | Cards | List (list sortable, CSV export, `?stage=OPEN|<stage>` filter that the dashboard links to). Pipeline = New / Contacted / Demo / Offer / Won (Negotiation is shown in Offer, Lost only in Cards/List); lead cards with follow-up chip (late red / today amber / later neutral), Call (tel: link + logs the call, a new lead becomes Contacted), E-mail (dialog, goes through the mail queue and is logged; in test mode nothing is delivered), Snooze (tomorrow / 3 days / next week / date), "Start onboarding" for won leads (creates a company in Draft for the rep and links it; the platform team finishes it in Onboarding), a dashed card for test entries (no contact, no city and a name that is no company name) with Fix or delete; drag & drop and the "…" menu change the stage (with history), Lost asks for a reason. "Call today" lists overdue / due follow-ups and says what is wrong with the dates; "Where your leads are" draws the cities on a map from the own outlines (`worldgeo.json`, no tiles); cities are looked up once with our own map server (Photon, server side, key never in the browser) and cached in `lead_geo` (equal names: the place nearest to a known lead wins). New lead / quick edit dialog (country picker, phone widget, live duplicate hint, "save anyway", unsaved-changes check, delete with confirm). Sidebar badge = number of overdue follow-ups. Migration `0116_lead_pipeline.sql` (`lead_activity`, `lead_geo`, both with row level security for the rep). Rules: a rep sees only own leads (other rep gets 404 on every action), CSRF on every action, support view (super admin) is read-only, the past-date rule cannot be switched off by the client. Tests: `test/int/sales-leads.test.js` (5), `test/unit/leads-geo.test.js` (3); `sales.test.js` follows the new page. Open: Start onboarding only creates the Draft company (no sales-side onboarding page); the top-bar Ctrl+K search is navigation only (the mockup's "Search company, contact or city" would need a data search); salesmgr works in the admin area, there is no team view in the sales app.
DE