feat(offer): live catalog price list in the public offer (render sidecar) #244
Reference in New Issue
Block a user
Delete Branch "feature/offer-pricing-live"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 runsui/src/libserver-side). It reads the owner-editedui/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 sameui/src/lib/offer.tsthe browser build used — one renderer, no drift, no goldmark.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 — viapayments.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.GET /offer/: fetch tables → substitute marker → render.offer_ru.mdbaked into the image;markedbundled from ui. Only/offer/is edge-exposed;/renderstays internal./offer/→ sidecar; drop the dead landing/offer/handlers + the viteemit-offerplugin.The three asks
Публичная оферта | Обратная связь→t.me/Erudit_GameBot(the offer's own contact)./offer/.No
Export Offerbutton (agreed): with live serving the offer auto-updates on any catalog edit, so a manual export is redundant.Review notes
/offer/price list is empty until the catalog has active products — add one in/_gm/catalogand reload/offer/to watch it appear live./offer/serves the rendered offer (seller INN present, pricing marker substituted).Verification (local)
gofmt/vetclean · backend unit + integration (TestOfferPricingReflectsCatalogEdits, real PG) · UIsvelte-checkclean + 584 unit + build · renderer node tests + an end-to-end/offer/drive (fake backend → real sidecar: table spliced, marker gone, no back link) · both Caddyfilescaddy validateclean.New commits pushed, approval review dismissed automatically according to repository settings