@nextsparkjs/theme-default 0.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/about/business.md +49 -0
- package/about/features.json +302 -0
- package/about/team.md +79 -0
- package/api/ai/chat/stream/route.ts +212 -0
- package/api/ai/orchestrator/route.ts +226 -0
- package/api/ai/single-agent/route.ts +291 -0
- package/api/ai/usage/route.ts +122 -0
- package/blocks/benefits/component.tsx +100 -0
- package/blocks/benefits/config.ts +11 -0
- package/blocks/benefits/examples.ts +85 -0
- package/blocks/benefits/fields.ts +156 -0
- package/blocks/benefits/schema.ts +33 -0
- package/blocks/cta-section/component.tsx +100 -0
- package/blocks/cta-section/config.ts +11 -0
- package/blocks/cta-section/examples.ts +41 -0
- package/blocks/cta-section/fields.ts +89 -0
- package/blocks/cta-section/index.ts +6 -0
- package/blocks/cta-section/schema.ts +32 -0
- package/blocks/cta-section/thumbnail.png +1 -0
- package/blocks/faq-accordion/component.tsx +156 -0
- package/blocks/faq-accordion/config.ts +11 -0
- package/blocks/faq-accordion/examples.ts +77 -0
- package/blocks/faq-accordion/fields.ts +119 -0
- package/blocks/faq-accordion/index.ts +6 -0
- package/blocks/faq-accordion/schema.ts +45 -0
- package/blocks/features-grid/component.tsx +112 -0
- package/blocks/features-grid/config.ts +11 -0
- package/blocks/features-grid/examples.ts +63 -0
- package/blocks/features-grid/fields.ts +97 -0
- package/blocks/features-grid/index.ts +6 -0
- package/blocks/features-grid/schema.ts +40 -0
- package/blocks/features-grid/thumbnail.png +1 -0
- package/blocks/hero/component.tsx +100 -0
- package/blocks/hero/config.ts +11 -0
- package/blocks/hero/examples.ts +35 -0
- package/blocks/hero/fields.ts +60 -0
- package/blocks/hero/index.ts +6 -0
- package/blocks/hero/schema.ts +32 -0
- package/blocks/hero/thumbnail.png +1 -0
- package/blocks/hero/thumbnail.png.txt +6 -0
- package/blocks/hero-with-form/component.tsx +232 -0
- package/blocks/hero-with-form/config.ts +11 -0
- package/blocks/hero-with-form/examples.ts +16 -0
- package/blocks/hero-with-form/fields.ts +207 -0
- package/blocks/hero-with-form/index.ts +6 -0
- package/blocks/hero-with-form/schema.ts +54 -0
- package/blocks/jumbotron/component.tsx +136 -0
- package/blocks/jumbotron/config.ts +11 -0
- package/blocks/jumbotron/examples.ts +36 -0
- package/blocks/jumbotron/fields.ts +202 -0
- package/blocks/jumbotron/index.ts +6 -0
- package/blocks/jumbotron/schema.ts +55 -0
- package/blocks/logo-cloud/component.tsx +154 -0
- package/blocks/logo-cloud/config.ts +11 -0
- package/blocks/logo-cloud/examples.ts +34 -0
- package/blocks/logo-cloud/fields.ts +133 -0
- package/blocks/logo-cloud/index.ts +6 -0
- package/blocks/logo-cloud/schema.ts +46 -0
- package/blocks/post-content/component.tsx +197 -0
- package/blocks/post-content/config.ts +11 -0
- package/blocks/post-content/examples.ts +33 -0
- package/blocks/post-content/fields.ts +165 -0
- package/blocks/post-content/index.ts +4 -0
- package/blocks/post-content/schema.ts +46 -0
- package/blocks/pricing-table/component.tsx +154 -0
- package/blocks/pricing-table/config.ts +11 -0
- package/blocks/pricing-table/examples.ts +96 -0
- package/blocks/pricing-table/fields.ts +161 -0
- package/blocks/pricing-table/index.ts +4 -0
- package/blocks/pricing-table/schema.ts +50 -0
- package/blocks/split-content/component.tsx +135 -0
- package/blocks/split-content/config.ts +11 -0
- package/blocks/split-content/examples.ts +38 -0
- package/blocks/split-content/fields.ts +198 -0
- package/blocks/split-content/index.ts +6 -0
- package/blocks/split-content/schema.ts +67 -0
- package/blocks/stats-counter/component.tsx +124 -0
- package/blocks/stats-counter/config.ts +11 -0
- package/blocks/stats-counter/examples.ts +61 -0
- package/blocks/stats-counter/fields.ts +134 -0
- package/blocks/stats-counter/index.ts +6 -0
- package/blocks/stats-counter/schema.ts +47 -0
- package/blocks/testimonials/component.tsx +114 -0
- package/blocks/testimonials/config.ts +11 -0
- package/blocks/testimonials/examples.ts +65 -0
- package/blocks/testimonials/fields.ts +105 -0
- package/blocks/testimonials/index.ts +6 -0
- package/blocks/testimonials/schema.ts +41 -0
- package/blocks/testimonials/thumbnail.png +1 -0
- package/blocks/text-content/component.tsx +97 -0
- package/blocks/text-content/config.ts +11 -0
- package/blocks/text-content/examples.ts +30 -0
- package/blocks/text-content/fields.ts +88 -0
- package/blocks/text-content/index.ts +6 -0
- package/blocks/text-content/schema.ts +30 -0
- package/blocks/text-content/thumbnail.png +1 -0
- package/blocks/timeline/component.tsx +267 -0
- package/blocks/timeline/config.ts +11 -0
- package/blocks/timeline/examples.ts +68 -0
- package/blocks/timeline/fields.ts +147 -0
- package/blocks/timeline/index.ts +6 -0
- package/blocks/timeline/schema.ts +49 -0
- package/blocks/video-hero/component.tsx +270 -0
- package/blocks/video-hero/config.ts +11 -0
- package/blocks/video-hero/examples.ts +24 -0
- package/blocks/video-hero/fields.ts +98 -0
- package/blocks/video-hero/index.ts +6 -0
- package/blocks/video-hero/schema.ts +39 -0
- package/components/ai-chat/ChatPanel.tsx +575 -0
- package/components/ai-chat/ConversationItem.tsx +266 -0
- package/components/ai-chat/ConversationSidebar.tsx +99 -0
- package/components/ai-chat/MarkdownRenderer.tsx +15 -0
- package/components/ai-chat/Message.tsx +42 -0
- package/components/ai-chat/MessageInput.tsx +49 -0
- package/components/ai-chat/MessageList.tsx +46 -0
- package/components/ai-chat/TypingIndicator.tsx +11 -0
- package/config/app.config.ts +367 -0
- package/config/billing.config.ts +349 -0
- package/config/dashboard.config.ts +506 -0
- package/config/dev.config.ts +104 -0
- package/config/features.config.ts +203 -0
- package/config/flows.config.ts +129 -0
- package/config/permissions.config.ts +245 -0
- package/config/theme.config.ts +74 -0
- package/docs/01-overview/01-introduction.md +335 -0
- package/docs/01-overview/02-customization.md +671 -0
- package/docs/02-features/01-components.md +155 -0
- package/docs/02-features/02-styling.md +139 -0
- package/docs/02-features/03-tasks-entity.md +407 -0
- package/docs/03-ai/01-overview.md +211 -0
- package/docs/03-ai/02-customization.md +436 -0
- package/entities/customers/customers.config.ts +75 -0
- package/entities/customers/customers.fields.ts +165 -0
- package/entities/customers/customers.service.ts +516 -0
- package/entities/customers/customers.types.ts +83 -0
- package/entities/customers/messages/en.json +66 -0
- package/entities/customers/messages/es.json +66 -0
- package/entities/customers/migrations/001_customers_table.sql +102 -0
- package/entities/customers/migrations/002_customers_metas.sql +92 -0
- package/entities/pages/messages/en.json +41 -0
- package/entities/pages/messages/es.json +41 -0
- package/entities/pages/migrations/001_pages_table.sql +112 -0
- package/entities/pages/migrations/002_pages_metas.sql +56 -0
- package/entities/pages/migrations/003_add_status.sql +50 -0
- package/entities/pages/pages-management.service.ts +610 -0
- package/entities/pages/pages.config.ts +94 -0
- package/entities/pages/pages.fields.ts +101 -0
- package/entities/pages/pages.service.ts +290 -0
- package/entities/pages/pages.types.ts +124 -0
- package/entities/posts/components/post-header.tsx +97 -0
- package/entities/posts/messages/en.json +55 -0
- package/entities/posts/messages/es.json +55 -0
- package/entities/posts/migrations/001_posts_table.sql +115 -0
- package/entities/posts/migrations/003_add_status.sql +44 -0
- package/entities/posts/migrations/004_entity_taxonomy_relations.sql +129 -0
- package/entities/posts/migrations/006_posts_metas.sql +56 -0
- package/entities/posts/posts.config.ts +101 -0
- package/entities/posts/posts.fields.ts +116 -0
- package/entities/posts/posts.service.ts +376 -0
- package/entities/posts/posts.types.ts +74 -0
- package/entities/tasks/messages/en.json +204 -0
- package/entities/tasks/messages/es.json +204 -0
- package/entities/tasks/migrations/001_tasks_table.sql +105 -0
- package/entities/tasks/migrations/002_task_metas.sql +85 -0
- package/entities/tasks/migrations/sample_data.json +77 -0
- package/entities/tasks/tasks.config.ts +79 -0
- package/entities/tasks/tasks.fields.ts +196 -0
- package/entities/tasks/tasks.service.ts +541 -0
- package/entities/tasks/tasks.types.ts +56 -0
- package/lib/hooks/useAiChat.ts +114 -0
- package/lib/hooks/useConversations.ts +376 -0
- package/lib/hooks/useOrchestratorChat.ts +122 -0
- package/lib/hooks/usePersistentChat.ts +315 -0
- package/lib/hooks/useStreamingChat.ts +127 -0
- package/lib/hooks/useTokenUsage.ts +63 -0
- package/lib/langchain/agents/customer-assistant.md +69 -0
- package/lib/langchain/agents/index.ts +61 -0
- package/lib/langchain/agents/orchestrator.md +59 -0
- package/lib/langchain/agents/page-assistant.md +85 -0
- package/lib/langchain/agents/single-agent.md +46 -0
- package/lib/langchain/agents/task-assistant.md +55 -0
- package/lib/langchain/config.ts +45 -0
- package/lib/langchain/handlers/customer-handler.ts +338 -0
- package/lib/langchain/handlers/page-handler.ts +232 -0
- package/lib/langchain/handlers/task-handler.ts +323 -0
- package/lib/langchain/langchain.config.ts +223 -0
- package/lib/langchain/observability.config.ts +30 -0
- package/lib/langchain/orchestrator.ts +562 -0
- package/lib/langchain/tools/customers.ts +176 -0
- package/lib/langchain/tools/index.ts +10 -0
- package/lib/langchain/tools/orchestrator.ts +92 -0
- package/lib/langchain/tools/pages.ts +289 -0
- package/lib/langchain/tools/tasks.ts +167 -0
- package/lib/scheduled-actions/billing.ts +149 -0
- package/lib/scheduled-actions/index.ts +170 -0
- package/lib/scheduled-actions/webhook.ts +231 -0
- package/lib/selectors.ts +197 -0
- package/messages/de/admin.json +219 -0
- package/messages/de/aiUsage.json +36 -0
- package/messages/de/buttons.json +19 -0
- package/messages/de/categories.json +35 -0
- package/messages/de/common.json +16 -0
- package/messages/de/dev.json +101 -0
- package/messages/de/docs.json +27 -0
- package/messages/de/entities.json +7 -0
- package/messages/de/features.json +119 -0
- package/messages/de/footer.json +22 -0
- package/messages/de/home.json +57 -0
- package/messages/de/index.ts +39 -0
- package/messages/de/mobileNav.json +13 -0
- package/messages/de/navigation.json +8 -0
- package/messages/de/observability.json +74 -0
- package/messages/de/posts.json +54 -0
- package/messages/de/pricing.json +102 -0
- package/messages/de/support.json +9 -0
- package/messages/de/teams.json +8 -0
- package/messages/en/admin.json +219 -0
- package/messages/en/aiUsage.json +36 -0
- package/messages/en/buttons.json +19 -0
- package/messages/en/categories.json +35 -0
- package/messages/en/common.json +16 -0
- package/messages/en/dev.json +106 -0
- package/messages/en/docs.json +27 -0
- package/messages/en/entities.json +7 -0
- package/messages/en/features.json +119 -0
- package/messages/en/footer.json +22 -0
- package/messages/en/home.json +57 -0
- package/messages/en/index.ts +39 -0
- package/messages/en/mobileNav.json +13 -0
- package/messages/en/navigation.json +8 -0
- package/messages/en/observability.json +74 -0
- package/messages/en/posts.json +54 -0
- package/messages/en/pricing.json +102 -0
- package/messages/en/support.json +9 -0
- package/messages/en/teams.json +8 -0
- package/messages/es/admin.json +219 -0
- package/messages/es/aiUsage.json +36 -0
- package/messages/es/buttons.json +19 -0
- package/messages/es/categories.json +35 -0
- package/messages/es/common.json +16 -0
- package/messages/es/dev.json +101 -0
- package/messages/es/docs.json +27 -0
- package/messages/es/entities.json +7 -0
- package/messages/es/features.json +119 -0
- package/messages/es/footer.json +22 -0
- package/messages/es/home.json +57 -0
- package/messages/es/index.ts +39 -0
- package/messages/es/mobileNav.json +13 -0
- package/messages/es/navigation.json +8 -0
- package/messages/es/observability.json +74 -0
- package/messages/es/posts.json +54 -0
- package/messages/es/pricing.json +102 -0
- package/messages/es/support.json +9 -0
- package/messages/es/teams.json +8 -0
- package/messages/fr/admin.json +219 -0
- package/messages/fr/aiUsage.json +36 -0
- package/messages/fr/buttons.json +19 -0
- package/messages/fr/categories.json +35 -0
- package/messages/fr/common.json +16 -0
- package/messages/fr/dev.json +101 -0
- package/messages/fr/docs.json +27 -0
- package/messages/fr/entities.json +7 -0
- package/messages/fr/features.json +119 -0
- package/messages/fr/footer.json +22 -0
- package/messages/fr/home.json +57 -0
- package/messages/fr/index.ts +39 -0
- package/messages/fr/mobileNav.json +13 -0
- package/messages/fr/navigation.json +8 -0
- package/messages/fr/observability.json +74 -0
- package/messages/fr/posts.json +54 -0
- package/messages/fr/pricing.json +102 -0
- package/messages/fr/support.json +9 -0
- package/messages/fr/teams.json +8 -0
- package/messages/it/admin.json +219 -0
- package/messages/it/aiUsage.json +36 -0
- package/messages/it/buttons.json +19 -0
- package/messages/it/categories.json +35 -0
- package/messages/it/common.json +16 -0
- package/messages/it/dev.json +101 -0
- package/messages/it/docs.json +27 -0
- package/messages/it/entities.json +7 -0
- package/messages/it/features.json +119 -0
- package/messages/it/footer.json +22 -0
- package/messages/it/home.json +57 -0
- package/messages/it/index.ts +39 -0
- package/messages/it/mobileNav.json +13 -0
- package/messages/it/navigation.json +8 -0
- package/messages/it/observability.json +74 -0
- package/messages/it/posts.json +54 -0
- package/messages/it/pricing.json +102 -0
- package/messages/it/support.json +9 -0
- package/messages/it/teams.json +8 -0
- package/messages/pt/admin.json +219 -0
- package/messages/pt/aiUsage.json +36 -0
- package/messages/pt/buttons.json +19 -0
- package/messages/pt/categories.json +35 -0
- package/messages/pt/common.json +16 -0
- package/messages/pt/dev.json +101 -0
- package/messages/pt/docs.json +27 -0
- package/messages/pt/entities.json +7 -0
- package/messages/pt/features.json +119 -0
- package/messages/pt/footer.json +22 -0
- package/messages/pt/home.json +57 -0
- package/messages/pt/index.ts +39 -0
- package/messages/pt/mobileNav.json +13 -0
- package/messages/pt/navigation.json +8 -0
- package/messages/pt/observability.json +74 -0
- package/messages/pt/posts.json +54 -0
- package/messages/pt/pricing.json +102 -0
- package/messages/pt/support.json +9 -0
- package/messages/pt/teams.json +8 -0
- package/migrations/089_add_editor_team_role.sql +39 -0
- package/migrations/090_demo_users_teams.sql +540 -0
- package/migrations/091_greek_teams_billing.sql +523 -0
- package/migrations/092_billing_sample_data.sql +774 -0
- package/migrations/093_pages_sample_data.sql +1158 -0
- package/migrations/094_posts_sample_data.sql +278 -0
- package/migrations/095_tasks_sample_data.sql +440 -0
- package/migrations/096_customers_sample_data.sql +358 -0
- package/migrations/097_scheduled_actions_sample_data.sql +111 -0
- package/package.json +22 -0
- package/public/docs/desktop-layout-example.png +0 -0
- package/styles/components.css +11 -0
- package/styles/globals.css +179 -0
- package/templates/(public)/blog/[slug]/page.tsx +65 -0
- package/templates/(public)/layout.tsx +25 -0
- package/templates/(public)/page.tsx +200 -0
- package/templates/(public)/support/page.tsx +321 -0
- package/templates/dashboard/(main)/agent-multi/page.tsx +63 -0
- package/templates/dashboard/(main)/agent-single/page.tsx +142 -0
- package/templates/dashboard/(main)/settings/ai-usage/page.tsx +157 -0
- package/templates/superadmin/ai-observability/[traceId]/page.tsx +27 -0
- package/templates/superadmin/ai-observability/page.tsx +17 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
-- Migration: 089_add_editor_team_role.sql
|
|
2
|
+
-- Description: Add 'editor' role to team_role ENUM
|
|
3
|
+
-- Date: 2025-12-24
|
|
4
|
+
-- Theme: default
|
|
5
|
+
-- Phase: Theme extension - demonstrates extensible team roles system
|
|
6
|
+
--
|
|
7
|
+
-- This migration adds the 'editor' team role as an example of the extensible
|
|
8
|
+
-- team roles system. The role is added to the PostgreSQL ENUM type.
|
|
9
|
+
--
|
|
10
|
+
-- Note: ALTER TYPE ADD VALUE cannot run inside a transaction block in PostgreSQL.
|
|
11
|
+
-- The migration runner handles this automatically.
|
|
12
|
+
|
|
13
|
+
-- Add 'editor' value to team_role ENUM
|
|
14
|
+
-- Inserted after 'member' in the hierarchy order
|
|
15
|
+
ALTER TYPE team_role ADD VALUE IF NOT EXISTS 'editor';
|
|
16
|
+
|
|
17
|
+
-- Success message
|
|
18
|
+
DO $$
|
|
19
|
+
BEGIN
|
|
20
|
+
RAISE NOTICE '';
|
|
21
|
+
RAISE NOTICE '════════════════════════════════════════════════════════════';
|
|
22
|
+
RAISE NOTICE ' Migration 089_add_editor_team_role.sql completed!';
|
|
23
|
+
RAISE NOTICE '════════════════════════════════════════════════════════════';
|
|
24
|
+
RAISE NOTICE '';
|
|
25
|
+
RAISE NOTICE ' ✅ Added "editor" to team_role ENUM';
|
|
26
|
+
RAISE NOTICE '';
|
|
27
|
+
RAISE NOTICE ' Team role hierarchy (config-driven):';
|
|
28
|
+
RAISE NOTICE ' owner: 100 (protected)';
|
|
29
|
+
RAISE NOTICE ' admin: 50';
|
|
30
|
+
RAISE NOTICE ' member: 10';
|
|
31
|
+
RAISE NOTICE ' editor: 5 (NEW)';
|
|
32
|
+
RAISE NOTICE ' viewer: 1';
|
|
33
|
+
RAISE NOTICE '';
|
|
34
|
+
RAISE NOTICE ' Editor permissions (defined in app.config.ts):';
|
|
35
|
+
RAISE NOTICE ' - team.view';
|
|
36
|
+
RAISE NOTICE ' - team.members.view';
|
|
37
|
+
RAISE NOTICE '';
|
|
38
|
+
RAISE NOTICE '════════════════════════════════════════════════════════════';
|
|
39
|
+
END $$;
|
|
@@ -0,0 +1,540 @@
|
|
|
1
|
+
-- Migration: 090_demo_users_teams.sql
|
|
2
|
+
-- Description: Demo users, teams, and invoices for default theme
|
|
3
|
+
-- Date: 2025-12-24
|
|
4
|
+
-- Theme: default
|
|
5
|
+
-- Phase: Theme sample data - runs AFTER core migrations (090_sample_data.sql)
|
|
6
|
+
--
|
|
7
|
+
-- This file contains demo data for testing and demonstration:
|
|
8
|
+
-- - 8 TMT.dev users with realistic profiles
|
|
9
|
+
-- - Personal teams for each user
|
|
10
|
+
-- - 3 company teams with multiple members
|
|
11
|
+
-- - Invoices for company teams
|
|
12
|
+
--
|
|
13
|
+
-- Password for all users: Testing1234
|
|
14
|
+
-- Hash: 3db9e98e2b4d3caca97fdf2783791cbc:34b293de615caf277a237773208858e960ea8aa10f1f5c5c309b632f192cac34d52ceafbd338385616f4929e4b1b6c055b67429c6722ffdb80b01d9bf4764866
|
|
15
|
+
|
|
16
|
+
-- ============================================
|
|
17
|
+
-- STEP 1: CREATE TMT.DEV USERS
|
|
18
|
+
-- ============================================
|
|
19
|
+
|
|
20
|
+
INSERT INTO "users" (
|
|
21
|
+
id,
|
|
22
|
+
email,
|
|
23
|
+
name,
|
|
24
|
+
"firstName",
|
|
25
|
+
"lastName",
|
|
26
|
+
role,
|
|
27
|
+
"emailVerified",
|
|
28
|
+
language,
|
|
29
|
+
country,
|
|
30
|
+
timezone,
|
|
31
|
+
"createdAt",
|
|
32
|
+
"updatedAt"
|
|
33
|
+
) VALUES
|
|
34
|
+
(
|
|
35
|
+
'usr-carlos-001',
|
|
36
|
+
'carlos.mendoza@nextspark.dev',
|
|
37
|
+
'Carlos Mendoza',
|
|
38
|
+
'Carlos',
|
|
39
|
+
'Mendoza',
|
|
40
|
+
'member',
|
|
41
|
+
true,
|
|
42
|
+
'es',
|
|
43
|
+
'AR',
|
|
44
|
+
'America/Argentina/Buenos_Aires',
|
|
45
|
+
NOW(),
|
|
46
|
+
NOW()
|
|
47
|
+
),
|
|
48
|
+
(
|
|
49
|
+
'usr-james-002',
|
|
50
|
+
'james.wilson@nextspark.dev',
|
|
51
|
+
'James Wilson',
|
|
52
|
+
'James',
|
|
53
|
+
'Wilson',
|
|
54
|
+
'member',
|
|
55
|
+
true,
|
|
56
|
+
'en',
|
|
57
|
+
'US',
|
|
58
|
+
'America/New_York',
|
|
59
|
+
NOW(),
|
|
60
|
+
NOW()
|
|
61
|
+
),
|
|
62
|
+
(
|
|
63
|
+
'usr-diego-003',
|
|
64
|
+
'diego.ramirez@nextspark.dev',
|
|
65
|
+
'Diego Ramírez',
|
|
66
|
+
'Diego',
|
|
67
|
+
'Ramírez',
|
|
68
|
+
'member',
|
|
69
|
+
true,
|
|
70
|
+
'es',
|
|
71
|
+
'MX',
|
|
72
|
+
'America/Mexico_City',
|
|
73
|
+
NOW(),
|
|
74
|
+
NOW()
|
|
75
|
+
),
|
|
76
|
+
(
|
|
77
|
+
'usr-michael-004',
|
|
78
|
+
'michael.brown@nextspark.dev',
|
|
79
|
+
'Michael Brown',
|
|
80
|
+
'Michael',
|
|
81
|
+
'Brown',
|
|
82
|
+
'member',
|
|
83
|
+
true,
|
|
84
|
+
'en',
|
|
85
|
+
'US',
|
|
86
|
+
'America/Los_Angeles',
|
|
87
|
+
NOW(),
|
|
88
|
+
NOW()
|
|
89
|
+
),
|
|
90
|
+
(
|
|
91
|
+
'usr-ana-005',
|
|
92
|
+
'ana.garcia@nextspark.dev',
|
|
93
|
+
'Ana García',
|
|
94
|
+
'Ana',
|
|
95
|
+
'García',
|
|
96
|
+
'member',
|
|
97
|
+
true,
|
|
98
|
+
'es',
|
|
99
|
+
'ES',
|
|
100
|
+
'Europe/Madrid',
|
|
101
|
+
NOW(),
|
|
102
|
+
NOW()
|
|
103
|
+
),
|
|
104
|
+
(
|
|
105
|
+
'usr-emily-006',
|
|
106
|
+
'emily.johnson@nextspark.dev',
|
|
107
|
+
'Emily Johnson',
|
|
108
|
+
'Emily',
|
|
109
|
+
'Johnson',
|
|
110
|
+
'member',
|
|
111
|
+
true,
|
|
112
|
+
'en',
|
|
113
|
+
'GB',
|
|
114
|
+
'Europe/London',
|
|
115
|
+
NOW(),
|
|
116
|
+
NOW()
|
|
117
|
+
),
|
|
118
|
+
(
|
|
119
|
+
'usr-sofia-007',
|
|
120
|
+
'sofia.lopez@nextspark.dev',
|
|
121
|
+
'Sofia López',
|
|
122
|
+
'Sofia',
|
|
123
|
+
'López',
|
|
124
|
+
'member',
|
|
125
|
+
true,
|
|
126
|
+
'es',
|
|
127
|
+
'AR',
|
|
128
|
+
'America/Argentina/Buenos_Aires',
|
|
129
|
+
NOW(),
|
|
130
|
+
NOW()
|
|
131
|
+
),
|
|
132
|
+
(
|
|
133
|
+
'usr-sarah-008',
|
|
134
|
+
'sarah.davis@nextspark.dev',
|
|
135
|
+
'Sarah Davis',
|
|
136
|
+
'Sarah',
|
|
137
|
+
'Davis',
|
|
138
|
+
'member',
|
|
139
|
+
true,
|
|
140
|
+
'en',
|
|
141
|
+
'CA',
|
|
142
|
+
'America/Toronto',
|
|
143
|
+
NOW(),
|
|
144
|
+
NOW()
|
|
145
|
+
)
|
|
146
|
+
ON CONFLICT (email) DO NOTHING;
|
|
147
|
+
|
|
148
|
+
-- ============================================
|
|
149
|
+
-- STEP 2: CREATE ALL TEAMS
|
|
150
|
+
-- ============================================
|
|
151
|
+
|
|
152
|
+
INSERT INTO "teams" (
|
|
153
|
+
id,
|
|
154
|
+
name,
|
|
155
|
+
slug,
|
|
156
|
+
description,
|
|
157
|
+
"ownerId",
|
|
158
|
+
metadata,
|
|
159
|
+
"createdAt",
|
|
160
|
+
"updatedAt"
|
|
161
|
+
) VALUES
|
|
162
|
+
-- ========================================
|
|
163
|
+
-- PERSONAL TEAMS
|
|
164
|
+
-- ========================================
|
|
165
|
+
(
|
|
166
|
+
'team-personal-carlos-001',
|
|
167
|
+
'Carlos Mendoza Team',
|
|
168
|
+
'carlos-mendoza-team',
|
|
169
|
+
'Default workspace',
|
|
170
|
+
'usr-carlos-001',
|
|
171
|
+
'{}'::jsonb,
|
|
172
|
+
NOW(),
|
|
173
|
+
NOW()
|
|
174
|
+
),
|
|
175
|
+
(
|
|
176
|
+
'team-personal-james-002',
|
|
177
|
+
'James Wilson Team',
|
|
178
|
+
'james-wilson-team',
|
|
179
|
+
'Default workspace',
|
|
180
|
+
'usr-james-002',
|
|
181
|
+
'{}'::jsonb,
|
|
182
|
+
NOW(),
|
|
183
|
+
NOW()
|
|
184
|
+
),
|
|
185
|
+
(
|
|
186
|
+
'team-personal-diego-003',
|
|
187
|
+
'Diego Ramírez Team',
|
|
188
|
+
'diego-ramirez-team',
|
|
189
|
+
'Default workspace',
|
|
190
|
+
'usr-diego-003',
|
|
191
|
+
'{}'::jsonb,
|
|
192
|
+
NOW(),
|
|
193
|
+
NOW()
|
|
194
|
+
),
|
|
195
|
+
(
|
|
196
|
+
'team-personal-michael-004',
|
|
197
|
+
'Michael Brown Team',
|
|
198
|
+
'michael-brown-team',
|
|
199
|
+
'Default workspace',
|
|
200
|
+
'usr-michael-004',
|
|
201
|
+
'{}'::jsonb,
|
|
202
|
+
NOW(),
|
|
203
|
+
NOW()
|
|
204
|
+
),
|
|
205
|
+
(
|
|
206
|
+
'team-personal-ana-005',
|
|
207
|
+
'Ana García Team',
|
|
208
|
+
'ana-garcia-team',
|
|
209
|
+
'Default workspace',
|
|
210
|
+
'usr-ana-005',
|
|
211
|
+
'{}'::jsonb,
|
|
212
|
+
NOW(),
|
|
213
|
+
NOW()
|
|
214
|
+
),
|
|
215
|
+
(
|
|
216
|
+
'team-personal-emily-006',
|
|
217
|
+
'Emily Johnson Team',
|
|
218
|
+
'emily-johnson-team',
|
|
219
|
+
'Default workspace',
|
|
220
|
+
'usr-emily-006',
|
|
221
|
+
'{}'::jsonb,
|
|
222
|
+
NOW(),
|
|
223
|
+
NOW()
|
|
224
|
+
),
|
|
225
|
+
(
|
|
226
|
+
'team-personal-sofia-007',
|
|
227
|
+
'Sofia López Team',
|
|
228
|
+
'sofia-lopez-team',
|
|
229
|
+
'Default workspace',
|
|
230
|
+
'usr-sofia-007',
|
|
231
|
+
'{}'::jsonb,
|
|
232
|
+
NOW(),
|
|
233
|
+
NOW()
|
|
234
|
+
),
|
|
235
|
+
(
|
|
236
|
+
'team-personal-sarah-008',
|
|
237
|
+
'Sarah Davis Team',
|
|
238
|
+
'sarah-davis-team',
|
|
239
|
+
'Default workspace',
|
|
240
|
+
'usr-sarah-008',
|
|
241
|
+
'{}'::jsonb,
|
|
242
|
+
NOW(),
|
|
243
|
+
NOW()
|
|
244
|
+
),
|
|
245
|
+
|
|
246
|
+
-- ========================================
|
|
247
|
+
-- COMPANY TEAMS
|
|
248
|
+
-- ========================================
|
|
249
|
+
(
|
|
250
|
+
'team-everpoint-001',
|
|
251
|
+
'Everpoint Labs',
|
|
252
|
+
'everpoint-labs',
|
|
253
|
+
'Technology Company - Software development and innovation',
|
|
254
|
+
'usr-carlos-001',
|
|
255
|
+
'{"segment": "startup", "industry": "technology"}'::jsonb,
|
|
256
|
+
NOW(),
|
|
257
|
+
NOW()
|
|
258
|
+
),
|
|
259
|
+
(
|
|
260
|
+
'team-ironvale-002',
|
|
261
|
+
'Ironvale Global',
|
|
262
|
+
'ironvale-global',
|
|
263
|
+
'Consulting Firm - Business strategy and management consulting',
|
|
264
|
+
'usr-ana-005',
|
|
265
|
+
'{"segment": "enterprise", "industry": "consulting"}'::jsonb,
|
|
266
|
+
NOW(),
|
|
267
|
+
NOW()
|
|
268
|
+
),
|
|
269
|
+
(
|
|
270
|
+
'team-riverstone-003',
|
|
271
|
+
'Riverstone Ventures',
|
|
272
|
+
'riverstone-ventures',
|
|
273
|
+
'Investment Fund - Early-stage startup investments',
|
|
274
|
+
'usr-sofia-007',
|
|
275
|
+
'{"segment": "startup", "industry": "finance"}'::jsonb,
|
|
276
|
+
NOW(),
|
|
277
|
+
NOW()
|
|
278
|
+
)
|
|
279
|
+
ON CONFLICT (id) DO NOTHING;
|
|
280
|
+
|
|
281
|
+
-- ============================================
|
|
282
|
+
-- STEP 3: CREATE TEAM MEMBERSHIPS
|
|
283
|
+
-- ============================================
|
|
284
|
+
|
|
285
|
+
INSERT INTO "team_members" (
|
|
286
|
+
id,
|
|
287
|
+
"teamId",
|
|
288
|
+
"userId",
|
|
289
|
+
role,
|
|
290
|
+
"joinedAt"
|
|
291
|
+
) VALUES
|
|
292
|
+
-- ========================================
|
|
293
|
+
-- PERSONAL TEAM MEMBERSHIPS
|
|
294
|
+
-- ========================================
|
|
295
|
+
('tm-tmt-personal-carlos', 'team-personal-carlos-001', 'usr-carlos-001', 'owner', NOW()),
|
|
296
|
+
('tm-tmt-personal-james', 'team-personal-james-002', 'usr-james-002', 'owner', NOW()),
|
|
297
|
+
('tm-tmt-personal-diego', 'team-personal-diego-003', 'usr-diego-003', 'owner', NOW()),
|
|
298
|
+
('tm-tmt-personal-michael', 'team-personal-michael-004', 'usr-michael-004', 'owner', NOW()),
|
|
299
|
+
('tm-tmt-personal-ana', 'team-personal-ana-005', 'usr-ana-005', 'owner', NOW()),
|
|
300
|
+
('tm-tmt-personal-emily', 'team-personal-emily-006', 'usr-emily-006', 'owner', NOW()),
|
|
301
|
+
('tm-tmt-personal-sofia', 'team-personal-sofia-007', 'usr-sofia-007', 'owner', NOW()),
|
|
302
|
+
('tm-tmt-personal-sarah', 'team-personal-sarah-008', 'usr-sarah-008', 'owner', NOW()),
|
|
303
|
+
|
|
304
|
+
-- ========================================
|
|
305
|
+
-- EVERPOINT LABS - Technology Company
|
|
306
|
+
-- Owner: Carlos Mendoza
|
|
307
|
+
-- ========================================
|
|
308
|
+
('tm-everpoint-carlos', 'team-everpoint-001', 'usr-carlos-001', 'owner', NOW()),
|
|
309
|
+
('tm-everpoint-james', 'team-everpoint-001', 'usr-james-002', 'admin', NOW()),
|
|
310
|
+
('tm-everpoint-emily', 'team-everpoint-001', 'usr-emily-006', 'member', NOW()),
|
|
311
|
+
('tm-everpoint-diego', 'team-everpoint-001', 'usr-diego-003', 'editor', NOW()),
|
|
312
|
+
|
|
313
|
+
-- ========================================
|
|
314
|
+
-- IRONVALE GLOBAL - Consulting Firm
|
|
315
|
+
-- Owner: Ana García
|
|
316
|
+
-- ========================================
|
|
317
|
+
('tm-ironvale-ana', 'team-ironvale-002', 'usr-ana-005', 'owner', NOW()),
|
|
318
|
+
('tm-ironvale-sofia', 'team-ironvale-002', 'usr-sofia-007', 'admin', NOW()),
|
|
319
|
+
('tm-ironvale-michael', 'team-ironvale-002', 'usr-michael-004', 'member', NOW()),
|
|
320
|
+
('tm-ironvale-sarah', 'team-ironvale-002', 'usr-sarah-008', 'viewer', NOW()),
|
|
321
|
+
|
|
322
|
+
-- ========================================
|
|
323
|
+
-- RIVERSTONE VENTURES - Investment Fund
|
|
324
|
+
-- Owner: Sofia López
|
|
325
|
+
-- ========================================
|
|
326
|
+
('tm-riverstone-sofia', 'team-riverstone-003', 'usr-sofia-007', 'owner', NOW()),
|
|
327
|
+
('tm-riverstone-emily', 'team-riverstone-003', 'usr-emily-006', 'admin', NOW()),
|
|
328
|
+
('tm-riverstone-carlos', 'team-riverstone-003', 'usr-carlos-001', 'member', NOW())
|
|
329
|
+
|
|
330
|
+
ON CONFLICT (id) DO NOTHING;
|
|
331
|
+
|
|
332
|
+
-- ============================================
|
|
333
|
+
-- STEP 4: CREATE ACCOUNT CREDENTIALS
|
|
334
|
+
-- ============================================
|
|
335
|
+
-- Password: Testing1234
|
|
336
|
+
-- Hash: 3db9e98e2b4d3caca97fdf2783791cbc:34b293de615caf277a237773208858e960ea8aa10f1f5c5c309b632f192cac34d52ceafbd338385616f4929e4b1b6c055b67429c6722ffdb80b01d9bf4764866
|
|
337
|
+
|
|
338
|
+
INSERT INTO "account" (
|
|
339
|
+
id,
|
|
340
|
+
"userId",
|
|
341
|
+
"accountId",
|
|
342
|
+
"providerId",
|
|
343
|
+
"accessToken",
|
|
344
|
+
"refreshToken",
|
|
345
|
+
"idToken",
|
|
346
|
+
"accessTokenExpiresAt",
|
|
347
|
+
"refreshTokenExpiresAt",
|
|
348
|
+
"scope",
|
|
349
|
+
"password",
|
|
350
|
+
"createdAt",
|
|
351
|
+
"updatedAt"
|
|
352
|
+
) VALUES
|
|
353
|
+
(
|
|
354
|
+
'account-tmt-carlos',
|
|
355
|
+
'usr-carlos-001',
|
|
356
|
+
'carlos.mendoza@nextspark.dev',
|
|
357
|
+
'credential',
|
|
358
|
+
NULL, NULL, NULL, NULL, NULL, NULL,
|
|
359
|
+
'3db9e98e2b4d3caca97fdf2783791cbc:34b293de615caf277a237773208858e960ea8aa10f1f5c5c309b632f192cac34d52ceafbd338385616f4929e4b1b6c055b67429c6722ffdb80b01d9bf4764866',
|
|
360
|
+
NOW(), NOW()
|
|
361
|
+
),
|
|
362
|
+
(
|
|
363
|
+
'account-tmt-james',
|
|
364
|
+
'usr-james-002',
|
|
365
|
+
'james.wilson@nextspark.dev',
|
|
366
|
+
'credential',
|
|
367
|
+
NULL, NULL, NULL, NULL, NULL, NULL,
|
|
368
|
+
'3db9e98e2b4d3caca97fdf2783791cbc:34b293de615caf277a237773208858e960ea8aa10f1f5c5c309b632f192cac34d52ceafbd338385616f4929e4b1b6c055b67429c6722ffdb80b01d9bf4764866',
|
|
369
|
+
NOW(), NOW()
|
|
370
|
+
),
|
|
371
|
+
(
|
|
372
|
+
'account-tmt-diego',
|
|
373
|
+
'usr-diego-003',
|
|
374
|
+
'diego.ramirez@nextspark.dev',
|
|
375
|
+
'credential',
|
|
376
|
+
NULL, NULL, NULL, NULL, NULL, NULL,
|
|
377
|
+
'3db9e98e2b4d3caca97fdf2783791cbc:34b293de615caf277a237773208858e960ea8aa10f1f5c5c309b632f192cac34d52ceafbd338385616f4929e4b1b6c055b67429c6722ffdb80b01d9bf4764866',
|
|
378
|
+
NOW(), NOW()
|
|
379
|
+
),
|
|
380
|
+
(
|
|
381
|
+
'account-tmt-michael',
|
|
382
|
+
'usr-michael-004',
|
|
383
|
+
'michael.brown@nextspark.dev',
|
|
384
|
+
'credential',
|
|
385
|
+
NULL, NULL, NULL, NULL, NULL, NULL,
|
|
386
|
+
'3db9e98e2b4d3caca97fdf2783791cbc:34b293de615caf277a237773208858e960ea8aa10f1f5c5c309b632f192cac34d52ceafbd338385616f4929e4b1b6c055b67429c6722ffdb80b01d9bf4764866',
|
|
387
|
+
NOW(), NOW()
|
|
388
|
+
),
|
|
389
|
+
(
|
|
390
|
+
'account-tmt-ana',
|
|
391
|
+
'usr-ana-005',
|
|
392
|
+
'ana.garcia@nextspark.dev',
|
|
393
|
+
'credential',
|
|
394
|
+
NULL, NULL, NULL, NULL, NULL, NULL,
|
|
395
|
+
'3db9e98e2b4d3caca97fdf2783791cbc:34b293de615caf277a237773208858e960ea8aa10f1f5c5c309b632f192cac34d52ceafbd338385616f4929e4b1b6c055b67429c6722ffdb80b01d9bf4764866',
|
|
396
|
+
NOW(), NOW()
|
|
397
|
+
),
|
|
398
|
+
(
|
|
399
|
+
'account-tmt-emily',
|
|
400
|
+
'usr-emily-006',
|
|
401
|
+
'emily.johnson@nextspark.dev',
|
|
402
|
+
'credential',
|
|
403
|
+
NULL, NULL, NULL, NULL, NULL, NULL,
|
|
404
|
+
'3db9e98e2b4d3caca97fdf2783791cbc:34b293de615caf277a237773208858e960ea8aa10f1f5c5c309b632f192cac34d52ceafbd338385616f4929e4b1b6c055b67429c6722ffdb80b01d9bf4764866',
|
|
405
|
+
NOW(), NOW()
|
|
406
|
+
),
|
|
407
|
+
(
|
|
408
|
+
'account-tmt-sofia',
|
|
409
|
+
'usr-sofia-007',
|
|
410
|
+
'sofia.lopez@nextspark.dev',
|
|
411
|
+
'credential',
|
|
412
|
+
NULL, NULL, NULL, NULL, NULL, NULL,
|
|
413
|
+
'3db9e98e2b4d3caca97fdf2783791cbc:34b293de615caf277a237773208858e960ea8aa10f1f5c5c309b632f192cac34d52ceafbd338385616f4929e4b1b6c055b67429c6722ffdb80b01d9bf4764866',
|
|
414
|
+
NOW(), NOW()
|
|
415
|
+
),
|
|
416
|
+
(
|
|
417
|
+
'account-tmt-sarah',
|
|
418
|
+
'usr-sarah-008',
|
|
419
|
+
'sarah.davis@nextspark.dev',
|
|
420
|
+
'credential',
|
|
421
|
+
NULL, NULL, NULL, NULL, NULL, NULL,
|
|
422
|
+
'3db9e98e2b4d3caca97fdf2783791cbc:34b293de615caf277a237773208858e960ea8aa10f1f5c5c309b632f192cac34d52ceafbd338385616f4929e4b1b6c055b67429c6722ffdb80b01d9bf4764866',
|
|
423
|
+
NOW(), NOW()
|
|
424
|
+
)
|
|
425
|
+
ON CONFLICT ("providerId", "accountId") DO NOTHING;
|
|
426
|
+
|
|
427
|
+
-- ============================================
|
|
428
|
+
-- STEP 5: CREATE USER METADATA
|
|
429
|
+
-- ============================================
|
|
430
|
+
|
|
431
|
+
INSERT INTO "users_metas" (
|
|
432
|
+
"userId", "metaKey", "metaValue", "dataType", "isPublic", "isSearchable", "createdAt", "updatedAt"
|
|
433
|
+
) VALUES
|
|
434
|
+
('usr-carlos-001', 'uiPreferences', '{"theme": "light", "sidebarCollapsed": false}', 'json', false, false, NOW(), NOW()),
|
|
435
|
+
('usr-carlos-001', 'activeTeamId', '"team-personal-carlos-001"', 'json', false, false, NOW(), NOW()),
|
|
436
|
+
('usr-james-002', 'uiPreferences', '{"theme": "dark", "sidebarCollapsed": false}', 'json', false, false, NOW(), NOW()),
|
|
437
|
+
('usr-james-002', 'activeTeamId', '"team-personal-james-002"', 'json', false, false, NOW(), NOW()),
|
|
438
|
+
('usr-diego-003', 'uiPreferences', '{"theme": "light", "sidebarCollapsed": false}', 'json', false, false, NOW(), NOW()),
|
|
439
|
+
('usr-diego-003', 'activeTeamId', '"team-personal-diego-003"', 'json', false, false, NOW(), NOW()),
|
|
440
|
+
('usr-michael-004', 'uiPreferences', '{"theme": "light", "sidebarCollapsed": false}', 'json', false, false, NOW(), NOW()),
|
|
441
|
+
('usr-michael-004', 'activeTeamId', '"team-personal-michael-004"', 'json', false, false, NOW(), NOW()),
|
|
442
|
+
('usr-ana-005', 'uiPreferences', '{"theme": "light", "sidebarCollapsed": false}', 'json', false, false, NOW(), NOW()),
|
|
443
|
+
('usr-ana-005', 'activeTeamId', '"team-personal-ana-005"', 'json', false, false, NOW(), NOW()),
|
|
444
|
+
('usr-emily-006', 'uiPreferences', '{"theme": "dark", "sidebarCollapsed": false}', 'json', false, false, NOW(), NOW()),
|
|
445
|
+
('usr-emily-006', 'activeTeamId', '"team-personal-emily-006"', 'json', false, false, NOW(), NOW()),
|
|
446
|
+
('usr-sofia-007', 'uiPreferences', '{"theme": "light", "sidebarCollapsed": false}', 'json', false, false, NOW(), NOW()),
|
|
447
|
+
('usr-sofia-007', 'activeTeamId', '"team-personal-sofia-007"', 'json', false, false, NOW(), NOW()),
|
|
448
|
+
('usr-sarah-008', 'uiPreferences', '{"theme": "light", "sidebarCollapsed": false}', 'json', false, false, NOW(), NOW()),
|
|
449
|
+
('usr-sarah-008', 'activeTeamId', '"team-personal-sarah-008"', 'json', false, false, NOW(), NOW())
|
|
450
|
+
ON CONFLICT ("userId", "metaKey") DO NOTHING;
|
|
451
|
+
|
|
452
|
+
-- ============================================
|
|
453
|
+
-- STEP 6: CREATE INVOICES FOR COMPANY TEAMS
|
|
454
|
+
-- ============================================
|
|
455
|
+
-- 6 invoices per work team (5 paid + 1 pending)
|
|
456
|
+
|
|
457
|
+
INSERT INTO "invoices" (
|
|
458
|
+
id,
|
|
459
|
+
"teamId",
|
|
460
|
+
"invoiceNumber",
|
|
461
|
+
date,
|
|
462
|
+
amount,
|
|
463
|
+
currency,
|
|
464
|
+
status,
|
|
465
|
+
"pdfUrl",
|
|
466
|
+
description
|
|
467
|
+
) VALUES
|
|
468
|
+
-- Everpoint Labs - $99/month
|
|
469
|
+
('inv-ever-001', 'team-everpoint-001', 'INV-EVER-001', NOW() - INTERVAL '5 months', 99.00, 'USD', 'paid', 'https://billing.example.com/inv-ever-001.pdf', 'Business Plan - Monthly'),
|
|
470
|
+
('inv-ever-002', 'team-everpoint-001', 'INV-EVER-002', NOW() - INTERVAL '4 months', 99.00, 'USD', 'paid', 'https://billing.example.com/inv-ever-002.pdf', 'Business Plan - Monthly'),
|
|
471
|
+
('inv-ever-003', 'team-everpoint-001', 'INV-EVER-003', NOW() - INTERVAL '3 months', 99.00, 'USD', 'paid', 'https://billing.example.com/inv-ever-003.pdf', 'Business Plan - Monthly'),
|
|
472
|
+
('inv-ever-004', 'team-everpoint-001', 'INV-EVER-004', NOW() - INTERVAL '2 months', 99.00, 'USD', 'paid', 'https://billing.example.com/inv-ever-004.pdf', 'Business Plan - Monthly'),
|
|
473
|
+
('inv-ever-005', 'team-everpoint-001', 'INV-EVER-005', NOW() - INTERVAL '1 month', 99.00, 'USD', 'paid', 'https://billing.example.com/inv-ever-005.pdf', 'Business Plan - Monthly'),
|
|
474
|
+
('inv-ever-006', 'team-everpoint-001', 'INV-EVER-006', NOW(), 99.00, 'USD', 'pending', NULL, 'Business Plan - Monthly'),
|
|
475
|
+
|
|
476
|
+
-- Ironvale Global - $199/month
|
|
477
|
+
('inv-iron-001', 'team-ironvale-002', 'INV-IRON-001', NOW() - INTERVAL '5 months', 199.00, 'USD', 'paid', 'https://billing.example.com/inv-iron-001.pdf', 'Enterprise Plan - Monthly'),
|
|
478
|
+
('inv-iron-002', 'team-ironvale-002', 'INV-IRON-002', NOW() - INTERVAL '4 months', 199.00, 'USD', 'paid', 'https://billing.example.com/inv-iron-002.pdf', 'Enterprise Plan - Monthly'),
|
|
479
|
+
('inv-iron-003', 'team-ironvale-002', 'INV-IRON-003', NOW() - INTERVAL '3 months', 199.00, 'USD', 'paid', 'https://billing.example.com/inv-iron-003.pdf', 'Enterprise Plan - Monthly'),
|
|
480
|
+
('inv-iron-004', 'team-ironvale-002', 'INV-IRON-004', NOW() - INTERVAL '2 months', 199.00, 'USD', 'paid', 'https://billing.example.com/inv-iron-004.pdf', 'Enterprise Plan - Monthly'),
|
|
481
|
+
('inv-iron-005', 'team-ironvale-002', 'INV-IRON-005', NOW() - INTERVAL '1 month', 199.00, 'USD', 'paid', 'https://billing.example.com/inv-iron-005.pdf', 'Enterprise Plan - Monthly'),
|
|
482
|
+
('inv-iron-006', 'team-ironvale-002', 'INV-IRON-006', NOW(), 199.00, 'USD', 'pending', NULL, 'Enterprise Plan - Monthly'),
|
|
483
|
+
|
|
484
|
+
-- Riverstone Ventures - $149/month
|
|
485
|
+
('inv-river-001', 'team-riverstone-003', 'INV-RIVER-001', NOW() - INTERVAL '5 months', 149.00, 'USD', 'paid', 'https://billing.example.com/inv-river-001.pdf', 'Pro Plan - Monthly'),
|
|
486
|
+
('inv-river-002', 'team-riverstone-003', 'INV-RIVER-002', NOW() - INTERVAL '4 months', 149.00, 'USD', 'paid', 'https://billing.example.com/inv-river-002.pdf', 'Pro Plan - Monthly'),
|
|
487
|
+
('inv-river-003', 'team-riverstone-003', 'INV-RIVER-003', NOW() - INTERVAL '3 months', 149.00, 'USD', 'paid', 'https://billing.example.com/inv-river-003.pdf', 'Pro Plan - Monthly'),
|
|
488
|
+
('inv-river-004', 'team-riverstone-003', 'INV-RIVER-004', NOW() - INTERVAL '2 months', 149.00, 'USD', 'paid', 'https://billing.example.com/inv-river-004.pdf', 'Pro Plan - Monthly'),
|
|
489
|
+
('inv-river-005', 'team-riverstone-003', 'INV-RIVER-005', NOW() - INTERVAL '1 month', 149.00, 'USD', 'paid', 'https://billing.example.com/inv-river-005.pdf', 'Pro Plan - Monthly'),
|
|
490
|
+
('inv-river-006', 'team-riverstone-003', 'INV-RIVER-006', NOW(), 149.00, 'USD', 'pending', NULL, 'Pro Plan - Monthly')
|
|
491
|
+
ON CONFLICT (id) DO NOTHING;
|
|
492
|
+
|
|
493
|
+
-- ============================================
|
|
494
|
+
-- SUCCESS SUMMARY
|
|
495
|
+
-- ============================================
|
|
496
|
+
|
|
497
|
+
DO $$
|
|
498
|
+
DECLARE
|
|
499
|
+
user_count INTEGER;
|
|
500
|
+
team_count INTEGER;
|
|
501
|
+
member_count INTEGER;
|
|
502
|
+
invoice_count INTEGER;
|
|
503
|
+
BEGIN
|
|
504
|
+
SELECT COUNT(*) INTO user_count FROM "users" WHERE email LIKE '%@nextspark.dev';
|
|
505
|
+
SELECT COUNT(*) INTO team_count FROM "teams" WHERE id LIKE 'team-personal-%' OR id LIKE 'team-everpoint%' OR id LIKE 'team-ironvale%' OR id LIKE 'team-riverstone%';
|
|
506
|
+
SELECT COUNT(*) INTO member_count FROM "team_members" WHERE id LIKE 'tm-tmt-%' OR id LIKE 'tm-everpoint%' OR id LIKE 'tm-ironvale%' OR id LIKE 'tm-riverstone%';
|
|
507
|
+
SELECT COUNT(*) INTO invoice_count FROM "invoices" WHERE id LIKE 'inv-ever%' OR id LIKE 'inv-iron%' OR id LIKE 'inv-river%';
|
|
508
|
+
|
|
509
|
+
RAISE NOTICE '';
|
|
510
|
+
RAISE NOTICE '════════════════════════════════════════════════════════════';
|
|
511
|
+
RAISE NOTICE ' Theme Migration 090_demo_users_teams.sql completed!';
|
|
512
|
+
RAISE NOTICE '════════════════════════════════════════════════════════════';
|
|
513
|
+
RAISE NOTICE '';
|
|
514
|
+
RAISE NOTICE ' 📊 DEMO DATA STATISTICS:';
|
|
515
|
+
RAISE NOTICE ' TMT.dev Users: %', user_count;
|
|
516
|
+
RAISE NOTICE ' Teams: %', team_count;
|
|
517
|
+
RAISE NOTICE ' Memberships: %', member_count;
|
|
518
|
+
RAISE NOTICE ' Invoices: %', invoice_count;
|
|
519
|
+
RAISE NOTICE '';
|
|
520
|
+
RAISE NOTICE ' 🔐 TMT.DEV CREDENTIALS (Password: Testing1234):';
|
|
521
|
+
RAISE NOTICE ' carlos.mendoza@nextspark.dev → Everpoint Labs (owner)';
|
|
522
|
+
RAISE NOTICE ' james.wilson@nextspark.dev → Everpoint Labs (admin)';
|
|
523
|
+
RAISE NOTICE ' diego.ramirez@nextspark.dev → Everpoint Labs (editor)';
|
|
524
|
+
RAISE NOTICE ' ana.garcia@nextspark.dev → Ironvale Global (owner)';
|
|
525
|
+
RAISE NOTICE ' sofia.lopez@nextspark.dev → Ironvale + Riverstone';
|
|
526
|
+
RAISE NOTICE ' emily.johnson@nextspark.dev → Everpoint + Riverstone';
|
|
527
|
+
RAISE NOTICE ' michael.brown@nextspark.dev → Ironvale Global (member)';
|
|
528
|
+
RAISE NOTICE ' sarah.davis@nextspark.dev → Ironvale Global (viewer)';
|
|
529
|
+
RAISE NOTICE '';
|
|
530
|
+
RAISE NOTICE ' 🏢 COMPANY TEAMS:';
|
|
531
|
+
RAISE NOTICE ' Everpoint Labs - Technology Company (4 members)';
|
|
532
|
+
RAISE NOTICE ' Ironvale Global - Consulting Firm (4 members)';
|
|
533
|
+
RAISE NOTICE ' Riverstone Ventures - Investment Fund (3 members)';
|
|
534
|
+
RAISE NOTICE '';
|
|
535
|
+
RAISE NOTICE ' 💳 INVOICES:';
|
|
536
|
+
RAISE NOTICE ' All company teams have 6 invoices (5 paid + 1 pending)';
|
|
537
|
+
RAISE NOTICE ' Everpoint: $99/mo | Ironvale: $199/mo | Riverstone: $149/mo';
|
|
538
|
+
RAISE NOTICE '';
|
|
539
|
+
RAISE NOTICE '════════════════════════════════════════════════════════════';
|
|
540
|
+
END $$;
|