-- TellerPro SaaS - Seed Data
USE `tellerpro`;

-- ============================================================
-- PLANS
-- ============================================================
INSERT IGNORE INTO `plans` (`name`,`slug`,`price_monthly`,`price_yearly`,`max_products`,`max_users`,`max_locations`,`storage_mb`,`features`,`sort_order`) VALUES
('Free',       'free',       0.00,   0.00,   50,  2,  1,   100,  '{"pos":true,"invoice":false,"batch_tracking":false,"reports_basic":true,"reports_advanced":false,"export":false,"ai_analytics":false}', 1),
('Pro',         'pro',       29.00, 290.00, 500, 10,  3,  1024,  '{"pos":true,"invoice":true,"batch_tracking":true,"reports_basic":true,"reports_advanced":true,"export":true,"ai_analytics":false}', 2),
('Business',   'business',   79.00, 790.00,  -1, 25, 10,  5120,  '{"pos":true,"invoice":true,"batch_tracking":true,"reports_basic":true,"reports_advanced":true,"export":true,"ai_analytics":true}', 3),
('Enterprise', 'enterprise', 199.00,1990.00, -1, -1, -1, 20480,  '{"pos":true,"invoice":true,"batch_tracking":true,"reports_basic":true,"reports_advanced":true,"export":true,"ai_analytics":true,"custom_domain":true,"priority_support":true}', 4);

-- ============================================================
-- SUPER ADMIN (password: SuperAdmin@123)
-- ============================================================
INSERT IGNORE INTO `superadmins` (`name`,`email`,`password`) VALUES
('Platform Admin','superadmin@tellerpro.com','$2y$12$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi');

-- ============================================================
-- PERMISSIONS
-- ============================================================
INSERT IGNORE INTO `permissions` (`name`,`display_name`,`description`,`category`) VALUES
-- Dashboard
('dashboard.view','View Dashboard','Access dashboard overview','Dashboard'),
-- Sales
('sales.view','View Sales','View sales history and invoices','Sales'),
('sales.create','Create Sale','Create new sales and invoices','Sales'),
('sales.edit','Edit Sale','Edit existing sales','Sales'),
('sales.delete','Delete Sale','Delete sales','Sales'),
-- POS
('pos.access','Access POS','Access point of sale terminal','POS'),
-- Products
('products.view','View Products','View product list','Products'),
('products.create','Create Product','Add new products','Products'),
('products.edit','Edit Product','Edit product details','Products'),
('products.delete','Delete Product','Delete products','Products'),
-- Inventory
('stock.view','View Stock','View stock levels','Inventory'),
('stock.adjust','Adjust Stock','Make stock adjustments','Inventory'),
('stock.transfer','Transfer Stock','Transfer stock between locations','Inventory'),
-- Purchases
('purchases.view','View Purchases','View purchase history','Purchases'),
('purchases.create','Create Purchase','Create new purchases','Purchases'),
('purchases.edit','Edit Purchase','Edit existing purchases','Purchases'),
-- Reports
('reports.view','View Reports','Access reports','Reports'),
-- Settings
('categories.manage','Manage Categories','Manage product categories','Settings'),
('units.manage','Manage Units','Manage measurement units','Settings'),
('tax.manage','Manage Tax','Manage tax groups','Settings'),
('settings.view','View Settings','Access settings','Settings'),
-- Users
('users.manage','Manage Users','Manage tenant users','Users'),
('roles.manage','Manage Roles','Manage user roles','Users'),
-- Billing
('billing.view','View Billing','Access billing and plans','Billing');

-- ============================================================
-- DEFAULT CATEGORIES (Sample data for new tenants)
-- ============================================================
-- Note: These will be inserted when a new tenant is created via migration or onboarding
-- The actual tenant_id will be set dynamically during tenant creation

-- ============================================================
-- DEFAULT UNITS (Sample data for new tenants)
-- ============================================================
-- Note: These will be inserted when a new tenant is created via migration or onboarding

-- ============================================================
-- DEFAULT TAX GROUPS (Sample data for new tenants)
-- ============================================================
-- Note: These will be inserted when a new tenant is created via migration or onboarding
