feat(offer): live catalog price list in the public offer (render sidecar) #244

Merged
developer merged 5 commits from feature/offer-pricing-live into development 2026-07-11 09:51:49 +00:00
Owner

Why

Robokassa moderation requires the public offer to list every digital good with its price, and to carry a contact for support. This wires that in — with the price list always reflecting the live catalog, no redeploy to update it.

Approach (agreed)

/offer/ moves off the static landing container to the existing render sidecar (renderer/, already runs ui/src/lib server-side). It reads the owner-edited ui/legal/offer_ru.md, fetches the catalog price list from the backend and splices it in at the <#pricing_template#> marker, then renders with the same ui/src/lib/offer.ts the browser build used — one renderer, no drift, no goldmark.

  • backend GET /api/v1/internal/offer/pricing (internal, off the edge allow-list): projects the active catalog into two markdown tables — chip packs priced per rail (₽ / VK votes / TG Stars) and chip-priced values — via payments.Money (no float). Cached in memory: warmed at boot ("regenerate on startup"), marked stale on every catalog mutation ⇒ no DB query per render, always current.
  • renderer GET /offer/: fetch tables → substitute marker → render. offer_ru.md baked into the image; marked bundled from ui. Only /offer/ is edge-exposed; /render stays internal.
  • caddy: route /offer/ → sidecar; drop the dead landing /offer/ handlers + the vite emit-offer plugin.

The three asks

  1. Footer feedback linkПубличная оферта | Обратная связьt.me/Erudit_GameBot (the offer's own contact).
  2. Removed the in-page "back" link on /offer/.
  3. §4.3 chip-payment wording written; §4.4 = the generated tables (live catalog).

No Export Offer button (agreed): with live serving the offer auto-updates on any catalog edit, so a manual export is redundant.

Review notes

  • The /offer/ price list is empty until the catalog has active products — add one in /_gm/catalog and reload /offer/ to watch it appear live.
  • New edge route ⇒ a data-independent CI probe asserts /offer/ serves the rendered offer (seller INN present, pricing marker substituted).

Verification (local)

gofmt/vet clean · backend unit + integration (TestOfferPricingReflectsCatalogEdits, real PG) · UI svelte-check clean + 584 unit + build · renderer node tests + an end-to-end /offer/ drive (fake backend → real sidecar: table spliced, marker gone, no back link) · both Caddyfiles caddy validate clean.

## Why Robokassa moderation requires the **public offer** to list every digital good with its price, and to carry a **contact for support**. This wires that in — with the price list always reflecting the live catalog, no redeploy to update it. ## Approach (agreed) `/offer/` moves off the static landing container to the existing **render sidecar** (`renderer/`, already runs `ui/src/lib` server-side). It reads the owner-edited `ui/legal/offer_ru.md`, fetches the catalog price list from the backend and splices it in at the `<#pricing_template#>` marker, then renders with the **same** `ui/src/lib/offer.ts` the browser build used — one renderer, no drift, no goldmark. - **backend** `GET /api/v1/internal/offer/pricing` (internal, off the edge allow-list): projects the active catalog into two markdown tables — chip packs priced per rail (₽ / VK votes / TG Stars) and chip-priced values — via `payments.Money` (no float). **Cached in memory**: warmed at boot ("regenerate on startup"), marked stale on every catalog mutation ⇒ **no DB query per render**, always current. - **renderer** `GET /offer/`: fetch tables → substitute marker → render. `offer_ru.md` baked into the image; `marked` bundled from ui. Only `/offer/` is edge-exposed; `/render` stays internal. - **caddy**: route `/offer/` → sidecar; drop the dead landing `/offer/` handlers + the vite `emit-offer` plugin. ## The three asks 1. **Footer feedback link** — `Публичная оферта | Обратная связь` → `t.me/Erudit_GameBot` (the offer's own contact). 2. **Removed the in-page "back" link** on `/offer/`. 3. **§4.3** chip-payment wording written; **§4.4** = the generated tables (live catalog). **No `Export Offer` button** (agreed): with live serving the offer auto-updates on any catalog edit, so a manual export is redundant. ## Review notes - The `/offer/` price list is empty until the catalog has active products — add one in `/_gm/catalog` and reload `/offer/` to watch it appear live. - New edge route ⇒ a data-independent CI probe asserts `/offer/` serves the rendered offer (seller INN present, pricing marker substituted). ## Verification (local) `gofmt`/`vet` clean · backend unit + **integration** (`TestOfferPricingReflectsCatalogEdits`, real PG) · UI `svelte-check` clean + 584 unit + build · renderer node tests + an end-to-end `/offer/` drive (fake backend → real sidecar: table spliced, marker gone, no back link) · both Caddyfiles `caddy validate` clean.
developer added 1 commit 2026-07-10 18:26:12 +00:00
feat(offer): live catalog price list in the public offer, served by the render sidecar
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 11s
CI / integration (pull_request) Successful in 26s
CI / ui (pull_request) Successful in 1m13s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Failing after 16m19s
b6c2598710
Robokassa moderation requires the public offer to list every digital good with
its price. Move /offer/ off the static landing container to the render sidecar:
it splices the live catalog price list (§4.4) into the owner-edited
ui/legal/offer_ru.md and renders it with the shared ui/src/lib/offer.ts — one
renderer, no drift, always matching the current catalog with no redeploy.

- backend: /api/v1/internal/offer/pricing (internal, off the edge allow-list)
  projects the active catalog into two markdown tables — chip packs priced per
  rail (roubles / VK votes / Telegram Stars) and chip-priced values — through
  payments.Money so no float reaches the page. Cached in memory: warmed at boot,
  marked stale on every catalog mutation, so a served render issues no query.
- renderer: GET /offer/ fetches the tables and substitutes them at the
  <#pricing_template#> marker, then renders; offer_ru.md is baked into the image
  and marked is bundled from ui. GET /offer -> 301. Only /offer/ is edge-exposed.
- caddy: route /offer/ to the sidecar; drop the now-dead landing /offer/
  handlers and the vite emit-offer plugin.
- offer: fill §4.3 (the chip-payment wording) and drop the in-page back link.
- landing footer: a feedback link (the offer's Telegram contact) beside the
  offer link.
- docs (ARCHITECTURE, FUNCTIONAL +_ru, renderer README), CI /offer/ probe,
  unit + integration + node tests.
developer added 1 commit 2026-07-10 18:30:45 +00:00
harden(offer): escape admin product titles against HTML/markdown injection
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 11s
CI / integration (pull_request) Successful in 21s
CI / ui (pull_request) Successful in 1m11s
CI / conformance (pull_request) Successful in 11s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m21s
b54371845f
The offer price list projects the admin-entered product title into a markdown
table cell that is rendered, unsanitised, into the public /offer/ page. Escape
the title at the projection boundary so it renders as literal text: HTML
metacharacters become entities and the markdown table pipe and link brackets are
escaped, so a title can neither inject markup nor form a javascript: link. The
committed offer prose keeps its trusted-content treatment (code-reviewed, not
runtime input).
developer added 1 commit 2026-07-11 09:30:30 +00:00
feat(offer): sort and align the §4.4 price tables, style them for both themes
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 12s
CI / integration (pull_request) Successful in 20s
CI / ui (pull_request) Successful in 1m10s
CI / conformance (pull_request) Successful in 9s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m47s
40acbcccdd
- packs sorted by ascending rouble price;
- values grouped hints-only -> no-ads-only -> no-ads+hints -> tournament
  (the tournament group is empty until such products become sellable),
  ascending chip price within each group;
- price columns right-aligned (GFM "---:" separators);
- tables span the full content width; the name column shrinks to its content
  and never wraps;
- muted-but-visible cell borders on the dark theme, where the section rule
  colour blends into the background.
developer added 1 commit 2026-07-11 09:39:48 +00:00
docs(offer): update phrasing
CI / changes (pull_request) Successful in 3s
CI / unit (pull_request) Successful in 10s
CI / integration (pull_request) Successful in 20s
CI / ui (pull_request) Successful in 1m10s
CI / conformance (pull_request) Successful in 9s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 2m24s
6e120bdaa7
owner approved these changes 2026-07-11 09:43:39 +00:00
Dismissed
developer added 1 commit 2026-07-11 09:46:33 +00:00
chore(offer): fix typo
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 11s
CI / integration (pull_request) Successful in 19s
CI / ui (pull_request) Successful in 1m11s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m54s
b3cf024e9e
developer dismissed owner's review 2026-07-11 09:46:33 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

owner approved these changes 2026-07-11 09:48:30 +00:00
developer merged commit 5c1f64c7d1 into development 2026-07-11 09:51:49 +00:00
developer deleted branch feature/offer-pricing-live 2026-07-11 09:51:49 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: developer/scrabble-game#244