Commit Graph

247 Commits

Author SHA1 Message Date
pavlov346346-source
41ebe89f8f Verify single item PDF module in production 2026-09-22 22:57:44 +08:00
pavlov346346-source
dee3252dc8 Cache single item PDF module 2026-09-22 22:57:41 +08:00
pavlov346346-source
fb8f7c351a Load single item PDF export 2026-09-22 22:57:37 +08:00
pavlov346346-source
4265a88c34 Add single catalog item PDF export 2026-09-22 22:57:23 +08:00
pavlov346346-source
923ea64650 feat: hide per-item prices in client banquet menu, add 3 layout themes
The one-page banquet menu PDF for clients no longer prints a price
next to each dish, and the footer no longer shows a grand total —
only the price per guest is shown, so the document can't be read
as a per-dish price list. Added a theme selector (Золото/Ночь/
Минимал) with three visually distinct color/typography treatments
for the same one-page layout.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 17:49:36 +03:00
pavlov346346-source
a6bd7f911b fix: remove duplicate delivery/total line in order cost summary
order-enhancements-v1775.js appended its own Доставка/Итого
paragraphs to .order-summary even after app-runtime.js's
ensureDiscountUI() already renders a full breakdown (positions,
discount, promo, delivery, total, prepayment, balance) — resulting
in a duplicate Доставка line at the bottom of the order details
cost panel. Now it skips the extra append when the richer summary
UI is present.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 17:32:09 +03:00
pavlov346346-source
40b5c146c2 feat: add photos for the 34 training-catalog items that had none
The banquet menu (18 dishes) and extras/supplies/delivery items (16)
in the training catalog were seeded with photo:'', which the catalog
tiles render as a plain red placeholder square. Sourced a real photo
for each item (mostly Pexels, free license, picked and visually
reviewed one by one to avoid mismatches -- several first search hits
were wrong: a live chicken for "chicken caesar salad", a person in
frame, branded bottles/cups) and two AI-generated (banquet-caprese,
banquet-roastbeef). Converted to square 1024x1024 WebP with sharp.

Wires the paths through the actual source of truth: ops/demo/trial-
banquet-data.mjs and trial-extras-data.mjs now set photo to the real
path, then ops/demo/build-trial-*.mjs regenerated public/demo/*.json
and the matching Supabase seed-function migrations, so the client's
static JSON fetch and the server-side company-provisioning function
stay in sync.

Bumped the demo-catalog fetch's own cache-busting query string in
training-catalog.js (and its script-tag/precache version), since it's
fetched by the client with a separate version from the outer script
tags -- the same stale-cache class of bug fixed earlier this session.

Verified: all 34 referenced files resolve (200) and decode as real
1024x1024 images; confirmed via the actual rendered catalog tiles
(#tiles img[src]) that the extras category -- where the user's
red-square screenshot was taken -- now serves the real photo paths.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 17:00:45 +03:00
pavlov346346-source
72d8ca6c1a Test cached signup policy lookup 2026-09-22 19:25:04 +08:00
pavlov346346-source
8e0da59b09 Cache public signup policy lookup 2026-09-22 19:24:45 +08:00
pavlov346346-source
646edfefde Track public signup policy security migration 2026-09-22 19:06:05 +08:00
pavlov346346-source
403676ab69 Harden public signup policy function 2026-09-22 19:06:02 +08:00
pavlov346346-source
a7252e4065 Remove obsolete database-secret migration workflow 2026-09-22 19:04:39 +08:00
pavlov346346-source
16308a35c4 Remove superseded Basic signup migration timestamp 2026-09-22 19:04:36 +08:00
pavlov346346-source
e6376c80d4 Align Basic signup migration with Supabase history 2026-09-22 19:04:33 +08:00
pavlov346346-source
7c05b63846 Support existing database secret names for Basic signup migration 2026-09-22 18:45:27 +08:00
pavlov346346-source
7ed7fdad79 Apply Basic signup migration safely 2026-09-22 18:43:52 +08:00
pavlov346346-source
941a568f4c Verify auth guard in production deploy 2026-09-22 18:34:19 +08:00
pavlov346346-source
111760f9f2 Load Basic signup auth release 2026-09-22 18:34:15 +08:00
pavlov346346-source
ae44b3eb6c Refresh auth module for Basic signup 2026-09-22 18:34:09 +08:00
pavlov346346-source
ca402418c4 Test Basic signup without promo 2026-09-22 18:33:57 +08:00
pavlov346346-source
b103d4aa24 Add public Basic signup migration 2026-09-22 18:33:24 +08:00
pavlov346346-source
c7aa7371d0 Add server policy for Basic signup without promo 2026-09-22 18:33:21 +08:00
pavlov346346-source
3d712eb19a Allow Basic registration without promo code 2026-09-22 18:32:47 +08:00
pavlov346346-source
10415fd539 Fix order deletion, line removal and Telegram provenance in documents 2026-09-22 16:05:38 +08:00
pavlov346346-source
32d6eb86c8 feat: replace the large training banner with a one-line notice
The big "Учебный каталог включён" card with its buttons sat on top of the
order screen. While training mode is on, the order screen now shows only
"Включён учебный режим · отключить в настройках"; the link opens Settings
at the training switch. The guide (trial order, stock, purchasing, TTK)
moves into the "Обучение и знакомство" settings card, so nothing is lost.
The invitation card for companies with an empty catalog is unchanged.

Specs updated for the new placement, plus a check that the notice link
lands on (and focuses) the switch.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-21 17:36:00 +03:00
pavlov346346-source
2e6c0e3939 fix: stop re-sending every client on each start; drop rejected error-log records
Some checks failed
Caterium QA / qa (push) Failing after 8m8s
Clients: every page load re-sent all clients (72 requests for 18 clients)
because pushAll ran from several startup events at once, never skipped
unchanged clients, and overlapping saves of one client read the same stale
version, so ~40% ended in 409 conflicts. The payload also carried a fresh
updatedAt, so even identical re-sends bumped the server version and wrote a
change event, which made other devices' next save conflict too.

- Remember what the server holds per client (content fingerprint, scoped to
  the workspace) and skip unchanged clients; seed it from the server
  snapshot so a device that is already in sync sends nothing.
- Serialise saves per client and make pushAll single-flight.
- Load the server snapshot before the startup push instead of racing it.
- Drop the volatile updatedAt from the payload (server keeps updated_at).

Error log: a record the server refuses (Access denied for a workspace the
user is not in) stayed in the IndexedDB queue forever, was re-sent on every
flush and could block newer records behind it. Records from another
workspace are now dropped, others after 3 attempts.

Adds tests/client-sync-v1780.mjs (fake server enforcing the SQL conflict
rule; fails on the old module) to test:static, and bumps the cache-busting
versions of performance.js / app-runtime.js.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-21 16:48:16 +03:00
pavlov346346-source
5e72b23161
Correct support mailbox to support@caterium.ru (#42)
Apply the user's explicit address correction to the PHP recipient, Help links, contact form and tests. Refresh the form URL and PWA cache. Exact-recipient PHP tests and support/Help browser tests passed in isolated run 35575721587. No real mail sent, delivery not claimed. Keep standard main QA and production publication gates unchanged; no auth, database or unrelated feature changes.
2026-09-21 11:04:06 +03:00
pavlov346346-source
c3cb44419b
Add human support form with fixed email recipient (#40)
Add Help contact form and PHP mail endpoint for support@katerion.ru, with validated Reply-To, explicit diagnostics consent, CSRF/origin checks, hashed rate limits and duplicate protection. Preserve drafts on error and avoid serializing customer data or SDK internals. Full PR QA passed in 35559317001; isolated PHP and 30 browser cases passed in 35559179372. Standard production gates unchanged. Publication checks do not send real mail; inbox receipt remains unverified. No training photo assets or unfinished training lifecycle changes.
2026-09-21 07:12:26 +03:00
pavlov346346-source
298b29cd52
Expose developer promo creation with three subscription plans (#39)
Load the missing promo module, add a prominent creation button and place Promos beside Overview. Use existing AAL2-guarded server RPCs with selected plan, subscription duration and code validity; preserve form input, honest clipboard feedback and scope async responses. Full PR QA succeeded in run 35547013076. No live data, SQL, MFA or unfinished training branch changes. Preserve normal main QA and exact-asset/browser publication verification.
2026-09-21 03:30:21 +03:00
pavlov346346-source
8b25918e30
Fix reopening incomplete developer MFA setup (#38)
Recover only unverified Caterium Developer TOTP factors from the full factor list. Preserve verified MFA, reuse the in-memory QR after closing the dialog, serialize enrollment and retain correct-code/AAL2 checks. Complete pull-request QA passed in run 35518429693. Standard main QA and publication gates remain unchanged.
2026-09-20 20:08:46 +03:00
pavlov346346-source
1e644e6dfb
Fix employee sync and expose mobile profile/logout (#37)
Keep notification-read state personal to user/company, preserve server read-only sections during staff synchronization, and respect separate order-create/edit/delete rights. Add visible mobile header session actions and a sticky logout that survives profile RPC failure; scope asynchronous profile/branding to user and workspace. Targeted browser suites and isolated SQL recovery tests passed in run 35506145405, iPhone screenshots reviewed. Full main QA remains required before production promotion. Workspace branding RPC migration is included but has NOT been applied to production Supabase; older servers retain safe owner-only fallback. No live membership/business-data repair is claimed without identifying the reported employee.
2026-09-20 13:55:56 +03:00
pavlov346346-source
bc3f186992
One-page banquet menu for the client (#36)
Add a single-page A4 preview and PDF for all selected banquet dishes or a ready-menu selection, with company branding and optional costs. Preserve draft/order state and saved line prices, enforce access and tenant scope, and fail clearly rather than clipping oversized menus. Nineteen targeted browser scenarios passed twice and the generated iPhone PDF was visually checked. Full main QA must pass before the existing automatic production promotion; production verification includes the new renderer and real-asset client menu export.
2026-09-20 12:54:42 +03:00
pavlov346346-source
eab678adbe fix: harden inline handlers against id injection, fix stale version label
Some checks failed
Caterium QA / qa (push) Has been cancelled
Inline handlers built as onclick="fn('${esc(id)}')" were injectable:
esc() turns ' into &#39;, which the browser decodes back to ' before
the JS runs, so an id like x');alert(1);// broke out of the string.
Ids can come from a restored backup file or a synced catalog. Add
SunSafe.jsArg (JSON.stringify + HTML escape) and use it in all 23
handlers in app-runtime.js and index.html. Verified in a browser: a
payload id is passed through as a plain string and nothing executes.

Also replace the Settings version label that still showed
v17.6.0 · 2026.09.07, and bump the cache-busting version of the two
changed scripts (sun-safe.js, app-runtime.js).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-20 12:28:35 +03:00
pavlov346346-source
716a79c58d
Optional per-profile training catalog with reversible example visibility (#35)
Add Settings > Учебный каталог, off by default and available on ordinary writable profiles. Load ready example boxes, photos, TTKs and linked sample inventory additively; preserve own data, saved orders and edited examples when hiding or re-enabling. Respect company/profile scope, read-only permissions, failed downloads and tenant changes. Preserve the opened recipe guide across real catalog refreshes on iPhone. Integrated feature checks and full pull-request QA passed. Standard main QA and exact-asset production UI verification remain in place.
2026-09-20 12:18:40 +03:00
pavlov346346-source
ab32199bd6 Retry transient npm audit service failures without weakening the security gate 2026-09-19 20:18:06 +03:00
pavlov346346-source
5ce7d8d353
Mobile menu editor above boxes with a matching return arrow (#34)
On phones place the existing menu editor above the catalog and add the same return-to-top control used by New Order. Preserve form nodes, unsaved values and active input focus; keep desktop/tablet layout and read-only permissions. Full QA passed, including iPhone WebKit and existing promotion focus regression. Extend real-asset production verification with a backend-blocked mobile-menu scenario.
2026-09-19 20:02:43 +03:00
pavlov346346-source
ee70c66ed8
Fix iPhone offer template flicker (#33)
Avoid rebuilding the offer template picker during the five-second maintenance pass unless the selected template or template list actually changed. Includes a regression test for repeated maintenance cycles.
2026-09-19 19:28:57 +03:00
pavlov346346-source
b99bb30aa1
Merge pull request #32 from pavlov346346-source/feature/support-bot
Add AI support assistant to the Help dialog
2026-09-19 18:42:50 +03:00
pavlo
d7d6f6ff38 Add AI support assistant to the Help dialog
The Поддержка tab opens an assistant that answers how-to questions from
the handbook. The chat is a sandboxed iframe on the assistant's own
origin and is only loaded after an explicit click, so Help and its search
stay local and no third-party script runs inside the app.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-19 18:27:47 +03:00
pavlov346346-source
16400425e4 Capture promotion screenshots without holding a row replaced by the normal save refresh 2026-09-19 09:51:41 +03:00
pavlov346346-source
424bf8ce87
Compact clients and explicit timed menu promotions (#31)
Add compact accessible client summaries and menu discounts in percent or rubles with explicit durations. Preserve ordinary catalog prices and order line snapshots; derive current prices and expire promotions automatically without background writes. Keep fractional prices, legacy sale compatibility, and regression coverage. Full pull-request QA passed. Publication remains gated by full main QA and byte-for-byte production asset and UI verification.
2026-09-19 09:34:50 +03:00
pavlov346346-source
b6e4a1aaad Check square icon mask within the shared 24px sidebar flex slot 2026-09-19 08:14:52 +03:00
pavlov346346-source
9f6ed42b0a Verify changed production CSS and rendered UI after QA-approved promotion 2026-09-19 08:07:02 +03:00
pavlov346346-source
2f7257f823 Verify published Help icon and quiet loading without touching customer accounts 2026-09-19 08:06:27 +03:00
pavlov346346-source
262711daab Complete full-app network fixture and preserve workspace across startup 2026-09-19 08:05:27 +03:00
pavlov346346-source
006ba12f98 Test Help against responsive native sidebar geometry in all browser engines 2026-09-19 08:04:32 +03:00
pavlov346346-source
15ab908836
Match Help icon to native sidebar styling (#30)
Add a question-circle SVG mask to Help using the existing sidebar pseudo-element. Preserve shared icon geometry, theme colors and navigation behavior. Add full-app icon regression and correct the previous loading-recovery fixture. Production promotion remains gated by full main QA.
2026-09-19 07:52:30 +03:00
pavlov346346-source
b2bcb0f4db
Make workspace loading a calm progress-only screen (#29)
* Make workspace loading a calm progress-only screen

* Cover quiet workspace loading and error recovery on desktop and mobile

* Run workspace loading regressions in desktop, mobile and WebKit QA
2026-09-19 06:57:27 +03:00
pavlov346346-source
43219c49a1 Mock both configured proxies in UI integration fixture 2026-09-18 21:23:36 +03:00
pavlov346346-source
4f518b3663 Stabilize settings updates, auth gates and modal lifecycle 2026-09-18 21:15:26 +03:00