Rebuild the community feed around verified businesses - #10
Draft
arka97 wants to merge 44 commits into
Draft
Conversation
X-Lovable-Edit-ID: edt-f862208e-41a8-4e86-9c5e-502a4bd5d93c Co-authored-by: arka97 <52138004+arka97@users.noreply.github.com>
Plan file updated during planning mode X-Lovable-Edit-ID: edt-fcda4131-7ae5-46f7-908e-5daa065a6547 Co-authored-by: arka97 <52138004+arka97@users.noreply.github.com>
X-Lovable-Edit-ID: edt-52b0d764-3033-4208-a9b8-929fb14442b5 Co-authored-by: arka97 <52138004+arka97@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Open business community
/marketas a publicly readable business community.Business attribution
companies_public, not the individual profile name.Anonymous publishing retired
is_anonymous = false, including old administrator tooling.PaywallOverlaycomponent.Feed scope
New business posts support:
New sourcing asks are deliberately removed from the feed composer. Structured sourcing requirements belong in RFQs, private quotations and deal rooms. Existing legacy sourcing posts continue to render with a migration notice.
Poll and engagement privacy
Database and RLS
community-mediastorage policy before installing the final public-read / verified-upload / owner-delete set.New RPCs
has_verified_business()create_business_post(...)create_business_poll_post(...)add_business_comment(...)set_business_post_like(...)record_business_post_view(...)cast_business_poll_vote(...)get_business_poll(...)get_business_post_engagement(...)Product boundary
This PR does not add:
The feed is a public business-information surface. Commercial transactions remain in RFQs, private quotations and deal rooms.
Lovable impact
This PR contains three Supabase migrations and requires generated-type refresh.
Migration order:
20260720100000_business_community_feed.sql20260720100100_lock_community_read_and_storage.sql20260720100200_community_admin_and_rate_guards.sqlAfter applying them, Lovable must regenerate
src/integrations/supabase/types.tsand replace the temporarycommunityRpc.tsadapter with typedsupabase.rpc(...)calls across the community repositories.Validation completed
mainand 0 behind.Mandatory Lovable checklist
1. Apply migrations and regenerate types
src/repositories/communityRpc.ts.supabase.rpc(...)calls.2. Public read
As an anonymous visitor:
/marketloads visible non-anonymous posts.companies_public.3. Verified-business participation
Test approved verified Business A:
4. Invalid business states
Test account without business, pending business, rejected business, hidden business and unverified business:
community-media.5. Cross-business and privacy tests
Use Businesses A, B and C:
post_poll_votesor voter IDs.author_idfor B.auth.uid()inside RPCs.6. Administrator compatibility
7. Abuse and media guards
posts/{auth.uid()}/...is rejected.8. UI review
Test desktop and mobile:
/marketDo not merge until migrations, generated types, build and public/verified/admin RLS tests pass.