-- ============================================================================
-- LASER CUT SAAS - COMBINED DATABASE SCHEMA
-- Multi-Tenant Industrial E-Commerce Platform
-- ============================================================================

-- This file imports all schema components
-- Run this file OR run individual schema files in sequence:
-- 1. schema.sql (core tables)
-- 2. schema_auth.sql (authentication)
-- 3. schema_payments.sql (Asaas integration)
-- 4. schema_production.sql (production workflow)
-- 5. schema_shipping.sql (local delivery)
-- 6. schema_support.sql (support tickets)
-- 7. schema_notifications.sql (notification system)
-- 8. schema_whatsapp.sql (WhatsApp quotes)

SET FOREIGN_KEY_CHECKS = 0;
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

-- ============================================================================
-- IMPORT ORDER FOR MANUAL INSTALLATION:
-- ============================================================================
-- SOURCE schema.sql;
-- SOURCE schema_auth.sql;
-- SOURCE schema_payments.sql;
-- SOURCE schema_production.sql;
-- SOURCE schema_shipping.sql;
-- SOURCE schema_support.sql;
-- SOURCE schema_notifications.sql;
-- SOURCE schema_whatsapp.sql;
-- SOURCE seed.sql;

SET FOREIGN_KEY_CHECKS = 1;

-- ============================================================================
-- SCHEMA FILES SUMMARY:
-- ============================================================================
-- schema.sql: Core tables (tenants, users, customers, products, orders, etc.)
-- schema_auth.sql: API tokens for authentication
-- schema_payments.sql: Asaas payment integration (payments, transactions)
-- schema_production.sql: Production workflow (jobs, steps, operators, logs)
-- schema_shipping.sql: Local delivery (config, zones, calculations, zipcode cache)
-- schema_support.sql: Support system (tickets, messages, canned responses)
-- schema_notifications.sql: Notifications (notifications, templates, preferences)
-- schema_whatsapp.sql: WhatsApp quotes (quotes, config)
-- 
-- TOTAL: 50+ tables for complete multi-tenant SaaS platform
