template-saas/apps/database/ddl/01-schemas.sql
rckrdmrd 40d57f8124 feat: Add AI Integration, Notifications UI and Settings Page
FASE 1: Notifications UI
- Add NotificationBell, NotificationDrawer, NotificationItem components
- Integrate notification bell in DashboardLayout header
- Real-time unread count with polling

FASE 2: AI Integration Backend
- Add AI module with OpenRouter client
- Endpoints: POST /ai/chat, GET /ai/models, GET/PATCH /ai/config
- GET /ai/usage, GET /ai/usage/current, GET /ai/health
- Database: schema ai with configs and usage tables
- Token tracking and cost calculation

FASE 3: Settings Page Refactor
- Restructure with tabs navigation
- GeneralSettings: profile, organization, appearance
- NotificationSettings: channels and categories toggles
- SecuritySettings: password change, 2FA placeholder, sessions

Files created: 25+
Endpoints added: 7
Story Points completed: 21

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 07:04:29 -06:00

31 lines
1.3 KiB
SQL

-- ============================================
-- TEMPLATE-SAAS: Schema Creation
-- Version: 1.0.0
-- ============================================
-- Core schemas
CREATE SCHEMA IF NOT EXISTS auth;
CREATE SCHEMA IF NOT EXISTS tenants;
CREATE SCHEMA IF NOT EXISTS users;
CREATE SCHEMA IF NOT EXISTS billing;
CREATE SCHEMA IF NOT EXISTS plans;
-- Feature schemas
CREATE SCHEMA IF NOT EXISTS audit;
CREATE SCHEMA IF NOT EXISTS notifications;
CREATE SCHEMA IF NOT EXISTS feature_flags;
CREATE SCHEMA IF NOT EXISTS storage;
CREATE SCHEMA IF NOT EXISTS ai;
-- Comments
COMMENT ON SCHEMA auth IS 'Authentication: sessions, tokens, OAuth';
COMMENT ON SCHEMA tenants IS 'Multi-tenancy: tenant configuration and settings';
COMMENT ON SCHEMA users IS 'User management: profiles, roles, permissions';
COMMENT ON SCHEMA billing IS 'Billing: subscriptions, invoices, payments';
COMMENT ON SCHEMA plans IS 'Plans: pricing plans, features, limits';
COMMENT ON SCHEMA audit IS 'Audit: activity logs, audit trail';
COMMENT ON SCHEMA notifications IS 'Notifications: templates, queue, delivery logs';
COMMENT ON SCHEMA feature_flags IS 'Feature flags: flags, rollouts, experiments';
COMMENT ON SCHEMA storage IS 'Storage: files, metadata, CDN';
COMMENT ON SCHEMA ai IS 'AI Integration: configurations, usage tracking, rate limits';