feat: redesign superadmin agencies list, implement flat design, add date filters, and fix UI bugs

This commit is contained in:
Erik Silva
2025-12-11 23:39:54 -03:00
parent 053e180321
commit dc98d5dccc
129 changed files with 20730 additions and 1611 deletions

View File

@@ -0,0 +1,38 @@
-- Agency Signup Templates (SuperAdmin → Agencies)
CREATE TABLE IF NOT EXISTS agency_signup_templates (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name VARCHAR(255) NOT NULL,
slug VARCHAR(100) UNIQUE NOT NULL,
description TEXT,
-- Campos do formulário (JSONB com campos habilitados/desabilitados)
form_fields JSONB NOT NULL DEFAULT '[]',
-- Módulos disponíveis para a agência
available_modules JSONB NOT NULL DEFAULT '[]',
-- Personalização
custom_primary_color VARCHAR(7),
custom_logo_url TEXT,
-- Redirecionamento após cadastro
redirect_url TEXT,
success_message TEXT,
-- Controle
is_active BOOLEAN DEFAULT true,
usage_count INTEGER DEFAULT 0,
max_uses INTEGER,
expires_at TIMESTAMP WITH TIME ZONE,
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);
-- Index para busca rápida por slug
CREATE INDEX idx_agency_templates_slug ON agency_signup_templates(slug);
CREATE INDEX idx_agency_templates_active ON agency_signup_templates(is_active);
COMMENT ON TABLE agency_signup_templates IS 'Templates de cadastro de agências (SuperAdmin → Agências)';
COMMENT ON COLUMN agency_signup_templates.form_fields IS 'Campos do formulário em JSONB: [{"name": "cnpj", "required": true, "enabled": true}]';
COMMENT ON COLUMN agency_signup_templates.available_modules IS 'Módulos disponíveis: ["CRM", "Financial", "Projects"]';