Skip to content

feat(favourites): heart a club, «Любими» on the web, API for the phone (#672) - #678

Merged
h0mele55 merged 3 commits into
mainfrom
feat/672-favourite-clubs
Nov 12, 2026
Merged

h0mele55 merged 3 commits into
mainfrom
feat/672-favourite-clubs

Conversation

@h0mele55

Copy link
Copy Markdown
Collaborator

Closes the server and web part of #672 (owner decision 2026-11-12: favourite clubs on phone and web).

Data (P87, additive): favourite_venue (userId, venueId, createdAt), PK on both ids. Owner-only RLS on app.user_id (as the bell, P22), the P69 account_not_deleted trigger, and a delete in account deletion (plan + new-rows rule updated). No foreign keys, like push_subscription: a venue that is gone or suspended drops out because every read goes through publicVenueFilter.

API:

  • GET /api/v1/me/favourites/venues → { ids, items: VenueSummary[] }, newest heart first, public venues only.
  • PUT / DELETE /api/v1/me/favourites/venues/{venueId} → { favourite }, idempotent. A venue that is not public is 404; more than 200 is 409.
  • favourites.ts is added to the BYPASSRLS allowlist (public venue cards for ids the person chose).

Web: a heart (aria-pressed, 44 px) on each /venues card, above the card's stretched link, and next to the venue page's title. Signed out there is no heart. A «Любими» toggle on /venues shows the hearted venues, with its own empty state. Strings in bg + en.

Checked locally: tsc; eslint; guardrails + unit + rendered (313 suites, 9957 tests, incl. new favourite-button); integration favourite-venues (new: 401, idempotent on/off and order, owner-only under RLS, 404, suspended venue drops out), account-deletion, rls-policy-shape, least-privileged-role (47) on a private test DB.

The iOS heart follows in playerz-ios once this is merged.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DfeuWUNfBvCav72pHsXdHa

user and others added 3 commits November 12, 2026 15:24
#672)

Owner decision 2026-11-12: players can mark clubs as favourites, phone and
web.
- P87: `favourite_venue`, owner-only RLS on app.user_id like the bell, the
  P69 deleted-account trigger, and removal in account deletion.
- GET /me/favourites/venues (ids + cards, newest heart first, public venues
  only), PUT and DELETE /me/favourites/venues/{venueId} (idempotent; a
  non-public venue is 404; at most 200).
- Web: a heart on every venue card and on the venue page (signed in only),
  and a «Любими» toggle on /venues.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DfeuWUNfBvCav72pHsXdHa
# Conflicts:
#	openapi/playerz-v1.json
#	tests/guardrails/superuser-call-sites.test.ts
@h0mele55
h0mele55 enabled auto-merge (squash) November 12, 2026 14:17
@h0mele55
h0mele55 merged commit edce013 into main Nov 12, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant