Add Tuš klub weekly coupons to the card view #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "worktree-tus-klub-coupons"
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?
Summary
/api/coupons/{retailer}endpoint: scrapes the Tuš klub HTML catalog, pairs front/back images with each barcode, caches parsed metadata + rendered images server-side, refreshedlazily with a 6h TTL.
CouponStripcomponent on the Tuš card view: horizontally-scrolling thumbnail strip; tap a thumbnail to open a full-screen viewer that flips between front and back; T&C text shownbeneath the image when present.
coupon_imagesobject store (DB v4) andclearAll()clears it on logout. Stale-while-revalidate viacouponsCache.svelte.jspaints from cache instantly, then refreshes from the server.destroyedflag in the loader prevent the stale-then-fresh emit from racing duplicate fetches or leaking object URLs after unmount.Test plan
(hash, side)regardless of stale+freshloadCouponsemits.pytest backend/tests/test_coupons.py(12 tests) passes.cd frontend && npm run test— 115 tests pass, includingcouponsCache.test.js.