Implement Phase 1a, 1b, 1c: Database, Auth, and API Endpoints
Phase 1a - Database Setup:
- Add PostgreSQL connection pooling with pg client
- Create 8 SQL migrations for all database schemas
- Implement migration execution system with tracking
- Add environment configuration for database and JWT settings
Phase 1b - Authentication & Authorization:
- Implement password hashing with bcrypt
- Create JWT token generation (access + refresh tokens)
- Implement RBAC with 5 roles (Admin, Manager, Analyst, Auditor, Viewer)
- Create auth middleware for authentication and authorization
- Add auth routes (login, register, refresh, logout, profile)
Phase 1c - API Endpoints (Full CRUD):
- Transaction endpoints with evaluation and batch processing
- Account management (treasury and subledger accounts)
- User management (admin-only)
- FX contract management
- Compliance endpoints (rules, results, thresholds)
- Reporting endpoints (summary, compliance, audit logs)
- Health check endpoints with database status
Phase 1d - Data Seeding:
- Create database seeding system with roles, permissions, users
- Add sample data (treasury accounts, FX contracts)
- Implement admin user creation from environment variables
All endpoints protected with authentication and role-based access control.