-- Insert initial subscription plans for the SaaS platform

USE freedb_test45;

-- Insert Free Trial Plan
INSERT INTO subscription_plans (
  name, display_name, description, 
  price_monthly, price_yearly, 
  max_users, max_projects, max_integrations, 
  features, is_active
) VALUES (
  'free_trial', 'Free Trial', 
  '14-day free trial with full access to all features',
  0, 0,
  5, 3, 1,
  '["task_management", "project_tracking", "slack_integration", "recommendations", "team_updates"]',
  TRUE
);

-- Insert Starter Plan
INSERT INTO subscription_plans (
  name, display_name, description, 
  price_monthly, price_yearly, 
  max_users, max_projects, max_integrations, 
  features, is_active
) VALUES (
  'starter', 'Starter', 
  'Perfect for small teams getting started with task management',
  19, 190,
  5, 10, 2,
  '["task_management", "project_tracking", "slack_integration", "recommendations", "team_updates", "basic_reporting"]',
  TRUE
);

-- Insert Professional Plan
INSERT INTO subscription_plans (
  name, display_name, description, 
  price_monthly, price_yearly, 
  max_users, max_projects, max_integrations, 
  features, is_active
) VALUES (
  'professional', 'Professional', 
  'Advanced features for growing teams and organizations',
  49, 490,
  15, 50, 5,
  '["task_management", "project_tracking", "slack_integration", "recommendations", "team_updates", "advanced_reporting", "custom_workflows", "time_tracking", "priority_support"]',
  TRUE
);

-- Insert Business Plan
INSERT INTO subscription_plans (
  name, display_name, description, 
  price_monthly, price_yearly, 
  max_users, max_projects, max_integrations, 
  features, is_active
) VALUES (
  'business', 'Business', 
  'Comprehensive solution for large teams and enterprises',
  99, 990,
  50, 200, 10,
  '["task_management", "project_tracking", "slack_integration", "recommendations", "team_updates", "advanced_reporting", "custom_workflows", "time_tracking", "priority_support", "api_access", "white_labeling", "advanced_security"]',
  TRUE
);

-- Insert Enterprise Plan
INSERT INTO subscription_plans (
  name, display_name, description, 
  price_monthly, price_yearly, 
  max_users, max_projects, max_integrations, 
  features, is_active
) VALUES (
  'enterprise', 'Enterprise', 
  'Ultimate solution with unlimited access and premium support',
  199, 1990,
  -1, -1, -1,
  '["task_management", "project_tracking", "slack_integration", "recommendations", "team_updates", "advanced_reporting", "custom_workflows", "time_tracking", "priority_support", "api_access", "white_labeling", "advanced_security", "dedicated_support", "custom_integrations", "audit_logs"]',
  TRUE
);

-- Display the inserted plans
SELECT 
  id, name, display_name, 
  price_monthly, price_yearly, 
  max_users, max_projects, max_integrations,
  is_active
FROM subscription_plans 
ORDER BY price_monthly ASC;