sms entegrasyonu ve ana sayfa işlemleri

This commit is contained in:
2026-01-26 00:19:09 +03:00
parent 1e1baa84ff
commit 5c34df0f09
19 changed files with 1018 additions and 17 deletions

View File

@@ -0,0 +1,35 @@
-- Create customers table
CREATE TABLE IF NOT EXISTS customers (
id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
full_name TEXT NOT NULL,
email TEXT,
phone TEXT,
address TEXT,
notes TEXT,
created_at TIMESTAMP WITH TIME ZONE DEFAULT timezone('utc'::text, now()) NOT NULL,
updated_at TIMESTAMP WITH TIME ZONE DEFAULT timezone('utc'::text, now()) NOT NULL
);
-- Enable Row Level Security
ALTER TABLE customers ENABLE ROW LEVEL SECURITY;
-- Policies
-- 1. Admin read access
CREATE POLICY "Admins can view customers"
ON customers FOR SELECT
USING (auth.role() = 'authenticated');
-- 2. Admin insert access
CREATE POLICY "Admins can insert customers"
ON customers FOR INSERT
WITH CHECK (auth.role() = 'authenticated');
-- 3. Admin update access
CREATE POLICY "Admins can update customers"
ON customers FOR UPDATE
USING (auth.role() = 'authenticated');
-- 4. Admin delete access
CREATE POLICY "Admins can delete customers"
ON customers FOR DELETE
USING (auth.role() = 'authenticated');