Initial commit: WaMarket MVP

Marketplace inversée (Next.js 16 App Router + Supabase Cloud) : auth,
schéma + RLS, publication de besoins avec upload d'images, feed avec
filtres, offres, acceptation via RPC, messagerie temps réel,
dashboards, et Dockerfile pour déploiement Coolify.
This commit is contained in:
2026-07-30 14:33:17 +00:00
commit af81124d48
82 changed files with 16824 additions and 0 deletions
@@ -0,0 +1,13 @@
-- Faille corrigée : la policy offers_update_own_pending ne limitait pas la
-- valeur cible de `status`, permettant à un marchand de passer directement sa
-- propre offre à 'accepted' via un simple PATCH, en contournant accept_offer().
-- Désormais, un marchand ne peut que rester en 'pending' (édition) ou passer
-- en 'withdrawn' (retrait volontaire) ; 'accepted'/'rejected' restent
-- exclusivement gérés par la fonction security definer accept_offer().
drop policy if exists "offers_update_own_pending" on public.offers;
create policy "offers_update_own_pending"
on public.offers for update
to authenticated
using ((select auth.uid()) = merchant_id and status = 'pending')
with check ((select auth.uid()) = merchant_id and status in ('pending', 'withdrawn'));