mirror of
https://github.com/renee-png/acmcc.git
synced 2026-06-21 09:50:01 +00:00
Add ACMCC app source, Supabase backend, and project config
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
|
||||
-- Store validation proof records for forms & letters
|
||||
CREATE TABLE public.document_validation_proofs (
|
||||
id UUID NOT NULL DEFAULT gen_random_uuid() PRIMARY KEY,
|
||||
document_type TEXT NOT NULL,
|
||||
document_title TEXT,
|
||||
generated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
|
||||
generated_by UUID,
|
||||
association_id UUID REFERENCES public.associations(id),
|
||||
metadata JSONB DEFAULT '{}',
|
||||
verification_hash TEXT NOT NULL,
|
||||
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
ALTER TABLE public.document_validation_proofs ENABLE ROW LEVEL SECURITY;
|
||||
|
||||
CREATE POLICY "Staff full access on document_validation_proofs"
|
||||
ON public.document_validation_proofs
|
||||
FOR ALL
|
||||
TO authenticated
|
||||
USING (public.has_role(auth.uid(), 'admin'::app_role) OR public.has_role(auth.uid(), 'manager'::app_role))
|
||||
WITH CHECK (public.has_role(auth.uid(), 'admin'::app_role) OR public.has_role(auth.uid(), 'manager'::app_role));
|
||||
|
||||
-- Anyone can verify a proof by ID (public read for verification)
|
||||
CREATE POLICY "Anyone can verify proofs"
|
||||
ON public.document_validation_proofs
|
||||
FOR SELECT
|
||||
TO authenticated
|
||||
USING (true);
|
||||
Reference in New Issue
Block a user