feat: metrics dashboard with WoW/MoM/YoY and creatives pipeline
Rebuild KPIs as a real dashboard (period deltas, tenant zoom), clarify objetivos/calendario/activos sources, and turn creatives into a status pipeline with delete. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
11
sql/creatives_delete_policy.sql
Normal file
11
sql/creatives_delete_policy.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
-- Allow tenant-scoped delete on creatives (clients); agency uses service role.
|
||||
alter table public.creatives enable row level security;
|
||||
|
||||
drop policy if exists creatives_tenant_delete on public.creatives;
|
||||
create policy creatives_tenant_delete on public.creatives
|
||||
for delete using (
|
||||
tenant_id::text = coalesce(
|
||||
auth.jwt() -> 'app_metadata' ->> 'tenant_id',
|
||||
auth.jwt() -> 'user_metadata' ->> 'tenant_id'
|
||||
)
|
||||
);
|
||||
Reference in New Issue
Block a user