Commit graph

69 commits

Author SHA1 Message Date
Tiago Yamamoto
1d79276e13 fix(backend): consolidated duplicate routes, fixed E2E tests for UUIDs and paths 2025-12-24 13:42:45 -03:00
Tiago Yamamoto
c1078563df refactor(roles): rename companyAdmin->admin and jobSeeker->candidate 2025-12-24 13:30:50 -03:00
Tiago Yamamoto
1b4f1d1555 refactor: migrate core tables to UUID v7 and update roadmap 2025-12-24 12:30:49 -03:00
Tiago Yamamoto
e6fb6dd8cd fix: uuid_generate_v7 integer overflow and seeder role constraint
Migration 009:
- Simplified uuid_generate_v7() to avoid integer overflow on bit shifts
- Uses double precision for timestamp then converts to hex

Seeder:
- Changed roles from 'admin','company' to 'companyAdmin'
- Matches users table CHECK constraint: superadmin, companyAdmin, recruiter, jobSeeker
2025-12-24 11:56:31 -03:00
Tiago Yamamoto
5f3430bd98 fix: reorder uuid_generate_v7 migration to run before tables that use it
- Rename 021_create_uuid_v7_function.sql to 009_create_uuid_v7_function.sql
- Add CREATE EXTENSION IF NOT EXISTS pgcrypto for gen_random_bytes()
- Remove obsolete 022_migrate_to_uuid_v7.sql (already handled by table def)

This fixes the error where migration 017 tried to use uuid_generate_v7()
before it was created.
2025-12-24 11:52:44 -03:00
Tiago Yamamoto
9a4e469a18 chore: remove unused google/uuid dependency
- Replaced with internal utils/uuid package using UUID v7
- go mod tidy removes orphaned dependency
2025-12-24 11:42:46 -03:00
Tiago Yamamoto
38a94bcbce feat: implement high priority features
1. Advanced Search (backend)
   - Add salaryMin, salaryMax, currency, sortBy to JobFilterQuery
   - Add 5+ filters: visa, salary range, currency, language level
   - Add 4 sort options: recent, salary_asc, salary_desc, relevance

2. Email Service (backend)
   - Create Resend API integration (email_service.go)
   - 3 HTML email templates: welcome, password_reset, application_received
   - Add RESEND_API_KEY, EMAIL_FROM, APP_URL env vars

3. i18n (frontend)
   - Create 4 language files: pt-BR, en-US, es-ES, ja-JP
   - 100+ translation keys per language
   - Covers: common, nav, auth, jobs, profile, company, footer

4. Stripe Integration (backend)
   - Create payment_handler.go with checkout session creation
   - Webhook handler with signature verification
   - Support for checkout.session.completed, payment_intent events
2025-12-24 11:40:53 -03:00
Tiago Yamamoto
7310627bee refactor: remove google/uuid from register_candidate.go
- IDs are now auto-generated by DB SERIAL columns
- No need to generate UUID in application code
- Let repository handle ID assignment from DB response
- Removed unused import
2025-12-24 11:31:57 -03:00
Tiago Yamamoto
568b4ebb88 refactor: clean up legacy UUID v4, use UUID v7 everywhere
Migrations:
- 016, 017, 019: Replace gen_random_uuid() with uuid_generate_v7()
- All UUID tables now use custom uuid_generate_v7() function

Backend:
- Create internal/utils/uuid/uuid.go with V7() function (RFC 9562)
- Update storage_handler.go to use internal uuid.V7()
- Remove dependency on google/uuid for file naming

All new UUIDs in the system are now UUID v7 (time-ordered)
2025-12-24 11:29:55 -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
254d7c3216 fix(migrations): change job_payments FK types from UUID to INT
- job_id changed from UUID to INT to match jobs.id SERIAL
- user_id changed from UUID to INT to match users.id SERIAL
- Added user_id FK to users table
2025-12-24 10:49:33 -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
02f35b46b6 feat: implement dynamic dashboard, auth hardening (pepper/httponly) and backend tests 2025-12-24 01:30:33 -03:00
Tiago Yamamoto
0f2aae3073 fix(backoffice): force 0.0.0.0 binding to resolve deployment crash
refactor(backend): consolidate admin routes and implement RBAC

feat(frontend): update api client to use consolidated routes
2025-12-24 00:59:33 -03:00
Tiago Yamamoto
72174b5232 docs(backend): update Swagger annotations for admin and core handlers 2025-12-24 00:45:48 -03:00
Tiago Yamamoto
ae7003d3fa feat(backoffice): add CORS_ORIGINS env var support 2025-12-24 00:03:52 -03:00
Tiago Yamamoto
dfdb8bc943 chore: update CORS_ORIGINS with production domains 2025-12-24 00:02:07 -03:00
Tiago Yamamoto
6bb90bdd1c fix: add missing /api/v1/notifications route to router 2025-12-23 23:46:18 -03:00
Tiago Yamamoto
0693e30922 refactor: rename PORT to BACKEND_PORT and API_HOST to BACKEND_HOST 2025-12-23 23:28:17 -03:00
Tiago Yamamoto
924255fdfb feat: prefer DATABASE_URL format for db connection, fallback to individual params 2025-12-23 23:23:42 -03:00
Tiago Yamamoto
2111e7e32d chore: remove unused file upload config, already using S3 with pre-signed URLs 2025-12-23 23:19:44 -03:00
Tiago Yamamoto
9f7d8e9ca5 feat: add 6-step job wizard with Preview, Billing, Payment steps and Stripe integration preparation 2025-12-23 23:00:17 -03:00
Tiago Yamamoto
42e9f81f48 feat: enhance job form with currency, salary periods, contract types, and add ER diagram docs 2025-12-23 22:49:33 -03:00
Tiago Yamamoto
7bb081f7c2 fix(backend): Resolve compilation error in update_user.go 2025-12-23 19:24:58 -03:00
Tiago Yamamoto
78ce341370 feat: Implement Ticket System, Profile Page integration, and fix migrations 2025-12-23 19:22:55 -03:00
Tiago Yamamoto
f81a97a224 Fix 500 error: handle NULL company name in GetJobs 2025-12-23 15:17:36 -03:00
Tiago Yamamoto
0e265e64b8 Refactor backend to use string IDs for Job, Company, and Application 2025-12-23 14:46:17 -03:00
Tiago Yamamoto
d36331140e Fix jobs query joins and scan order 2025-12-23 14:18:16 -03:00
Tiago Yamamoto
ce0531fefc feat: connect registration and jobs to real API
Backend fixes:
- Fix FK violation in candidate registration by creating company first
- Add CompanyRepository to RegisterCandidateUseCase
- Add handler integration tests for validation

Frontend improvements:
- Add registerCompany function in auth.ts
- Connect company registration form to backend API
- Replace mockJobs with API call in job detail page
- Add loading/error states to job detail page
- Add Jest tests for auth module
2025-12-23 08:19:49 -03:00
Tiago Yamamoto
b09bd023ed feat: security refactor, server-side pagination, and docs update
- impl(frontend): server-side pagination for jobs listing
- impl(frontend): standardized api error handling and sonner integration
- test(frontend): added unit tests for JobCard
- impl(backend): added SanitizeMiddleware for XSS protection
- test(backend): added table-driven tests for JobService
- docs: updated READMES, created ROADMAP.md and DATABASE.md
- fix(routing): redirected landing page buttons to /jobs
2025-12-23 00:50:51 -03:00
Tiago Yamamoto
743b2842c0 feat: Enhance platform with funny jobs, FAQ, Skeleton UI, and Tests 2025-12-22 23:48:56 -03:00
Tiago Yamamoto
1de5d31815 Fix user list pagination response type 2025-12-22 20:44:13 -03:00
Tiago Yamamoto
e71fc361ac Add dynamic candidate management data 2025-12-22 19:18:15 -03:00
Tiago Yamamoto
9c17a7a15a Add paginated users listing 2025-12-22 16:43:54 -03:00
Tiago Yamamoto
58cfd76675 Add admin backoffice routes and dashboard 2025-12-22 16:37:05 -03:00
Tiago Yamamoto
640eb10703 feat(frontend): add work mode filter and randomize seeder types 2025-12-15 14:44:14 -03:00
Tiago Yamamoto
d369835999 fix(docs): update swagger annotations with /api/v1 prefix 2025-12-15 13:46:51 -03:00
Tiago Yamamoto
720eda91c7 fix(router): add /api/v1 prefix to jobs and applications routes 2025-12-15 13:42:50 -03:00
Tiago Yamamoto
1002a2ec83 fix(config): auto-detect http/https scheme for swagger 2025-12-15 13:24:37 -03:00
Tiago Yamamoto
52f31710cf fix(config): remove duplicate API_HOST and strip protocol prefix in main.go 2025-12-15 11:08:18 -03:00
Tiago Yamamoto
0a69406b31 feat(config): enable dynamic API host configuration via env var 2025-12-15 10:55:16 -03:00
Tiago Yamamoto
ce31ab8e67 feat(migration): move admin cloudflare routes to backoffice and cleanup backend 2025-12-15 10:52:40 -03:00
Tiago Yamamoto
1caeb72d7c chore: update env example and fix swagger host port 2025-12-15 10:44:28 -03:00
Tiago Yamamoto
c9747d3596 fix(integration): correct frontend fallback port to 8521 and handle NULL fields in company entity 2025-12-15 10:19:31 -03:00
Tiago Yamamoto
28733fff95 feat(tests): �� added unit tests and E2E tests for handlers 2025-12-15 09:08:32 -03:00
Tiago Yamamoto
430e0f534d feat(db): 🏠 added work_mode because office is overrated anyway 2025-12-15 08:53:41 -03:00
Tiago Yamamoto
67c2ccdffe Integrate backend jobs feed into frontend and improve seeder 2025-12-14 20:32:20 -03:00
Tiago Yamamoto
47b9e4feaf Add example for hiring application status update 2025-12-14 17:26:39 -03:00
Tiago Yamamoto
7d5c6cc1d4 Remove unused models import 2025-12-14 17:16:29 -03:00