diff --git a/sql/cms_integrations.sql b/sql/cms_integrations.sql new file mode 100644 index 0000000..8905ae0 --- /dev/null +++ b/sql/cms_integrations.sql @@ -0,0 +1,31 @@ +-- CMS / ecommerce connection slots per tenant +-- Idempotent. + +alter table public.integrations drop constraint if exists integrations_provider_check; +alter table public.integrations + add constraint integrations_provider_check + check (provider in ( + 'meta_ads', + 'google_ads', + 'ga4', + 'search_console', + 'tag_manager', + 'clientify', + 'klaviyo', + 'mailchimp', + 'google_drive', + 'wordpress', + 'prestashop', + 'shopify' + )); + +insert into public.integrations (tenant_id, provider, status, label) +select t.id, p.provider, 'disconnected', p.label +from public.tenants t +cross join ( + values + ('wordpress', 'WordPress'), + ('prestashop', 'PrestaShop'), + ('shopify', 'Shopify') +) as p(provider, label) +on conflict (tenant_id, provider) do nothing; diff --git a/src/app/api/admin/create-client/route.ts b/src/app/api/admin/create-client/route.ts index 7bbe59c..5338681 100644 --- a/src/app/api/admin/create-client/route.ts +++ b/src/app/api/admin/create-client/route.ts @@ -55,6 +55,9 @@ export async function POST(req: NextRequest) { ['klaviyo', 'Klaviyo'], ['mailchimp', 'Mailchimp'], ['google_drive', 'Google Drive'], + ['wordpress', 'WordPress'], + ['prestashop', 'PrestaShop'], + ['shopify', 'Shopify'], ]; await fetch(`${url}/rest/v1/integrations`, { method: 'POST', diff --git a/src/components/AgencyPortfolioBoard.tsx b/src/components/AgencyPortfolioBoard.tsx index e6456b9..17850a9 100644 --- a/src/components/AgencyPortfolioBoard.tsx +++ b/src/components/AgencyPortfolioBoard.tsx @@ -55,17 +55,17 @@ type AlertRow = { const MATRIX_PROVIDERS = [ 'meta_ads', 'google_ads', - 'ga4', 'clientify', 'google_drive', + 'wordpress', ] as const; const SHORT: Record = { meta_ads: 'Meta', google_ads: 'GAds', - ga4: 'GA4', clientify: 'CRM', google_drive: 'Drive', + wordpress: 'WP', }; function healthBadge(h: string) { @@ -241,8 +241,8 @@ export default function AgencyPortfolioBoard() { Panel de control · clientes y conexiones

- Cada cliente con su Meta, Google Ads, GA4, Clientify y Drive. - Activa/apaga canales en Integraciones. + Cada cliente con su Meta, Google Ads, Clientify, Drive y web + (WordPress…). Activa/apaga canales en Conexiones.