Commit graph

6 commits

Author SHA1 Message Date
Tiago Yamamoto
41d7d9ee70 fix: update superadmin hash to match deployed PASSWORD_PEPPER
Uses pepper: some-random-string-for-password-hashing
Password: Admin@2025!
2025-12-24 17:14:50 -03:00
Tiago Yamamoto
d3c06f5564 feat: expand testing, add fast seeder options, hardcode superadmin
- start.sh: Add options 8 (Seed LITE - skip cities) and 9 (Run All Tests)
- seeder: Add seed:lite, seed:fast scripts and --skip-locations flag
- seeder: Remove superadmin creation (now via backend migration)
- backend: Update 010_seed_super_admin.sql with hardcoded hash (Admin@2025! + pepper)
- backend: Expand jwt_service_test.go with 5 new tests (+10% coverage)
- frontend: Fix api.test.ts URL duplication bug, add error handling tests
- seeder: Add SQL data files to .gitignore
2025-12-24 17:07:45 -03:00
Tiago Yamamoto
ae4a3e5e63 feat: migrate from UUID v4 to UUID v7
Migrations:
- Fix 010_seed_super_admin.sql: only use columns from migration 001
- Add 021_create_uuid_v7_function.sql: PostgreSQL uuid_generate_v7() function
- Add 022_migrate_to_uuid_v7.sql: update notifications, tickets, job_payments to use v7

Seeder:
- Create seeder-api/src/utils/uuid.js with uuidv7() function
- Update notifications.js to use uuidv7() instead of randomUUID()

Docs:
- Update DATABASE.md with UUID v7 section and benefits

UUID v7 benefits:
- Time-ordered (sortable by creation time)
- Better index performance than v4
- RFC 9562 compliant
2025-12-24 11:19:26 -03:00
Tiago Yamamoto
7d99e77468 refactor: unify schema - eliminate core_* tables
BREAKING CHANGE: Removed core_companies, core_users, core_user_roles tables

Migrations:
- Create 020_unify_schema.sql: adds tenant_id, email, name to users table
- Create user_roles table (replaces core_user_roles)
- Disable 009_create_core_tables.sql (renamed to .disabled)
- Update 010_seed_super_admin.sql to use unified tables

Backend Repositories:
- company_repository.go: use companies table with INT id
- user_repository.go: use users/user_roles with INT id conversion

Seeders:
- All seeders now use companies/users/user_roles tables
- Removed all core_* table insertions
- Query companies by slug to get SERIAL id

This eliminates the redundancy between core_* and legacy tables.
2025-12-24 11:06:31 -03:00
Tiago Yamamoto
340911b4d1 feat(auth): add cookie parsing and JWT auth guard to backoffice
- Add JWT auth guard with Bearer token and cookie support
- Update .env.example files with PASSWORD_PEPPER documentation
- Update seeder to use PASSWORD_PEPPER for password hashing
- Update seeder README with hash verification examples
- Fix frontend auth and page components
- Update backend JWT service and seed migration
2025-12-24 10:27:04 -03:00
Tiago Yamamoto
1c7ef95c1a first commit 2025-12-09 19:04:48 -03:00