Commit graph

232 commits

Author SHA1 Message Date
GoHorse Deploy
e157910dd4 fix: handle duplicate user email errors properly 2026-03-06 09:40:49 -03:00
Redbull Deployer
cf305d096e fix(auth): accept email or identifier login payload 2026-03-04 21:39:52 -06:00
Tiago Yamamoto
9ccb15882e feat: optimize jobs database querying and immutable indexes 2026-02-25 07:23:45 -06:00
Tiago Yamamoto
e5e43974a5 fix(migrations): increase users.status VARCHAR(20→30), fix 010 status value
- 009: status column was VARCHAR(20), causing 'force_change_password' (21 chars)
  to fail on INSERT — changed to VARCHAR(30)
- 010: changed initial status from 'force_change_password' to 'pending' (fits
  any column size ≥7 chars, avoids future truncation)
- 046: ALTER TABLE for existing deployments where 009 already applied with VARCHAR(20)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 21:17:34 -06:00
Tiago Yamamoto
8ee0d59a61 feat: fix seeder password hashing, add custom questions, navbar/footer on register, payment handler
- fix(seeder): add PASSWORD_PEPPER to all bcrypt hashes (admin + candidates/recruiters)
- fix(seeder): add created_by field to jobs INSERT (was causing NOT NULL violation)
- feat(backend): add custom job questions support in applications
- feat(backend): add payment handler and Stripe routes
- feat(frontend): add navbar and footer to /register and /register/user pages
- feat(frontend): add custom question answers to job apply page
- feat(frontend): update home page hero section and navbar buttons
- feat(frontend): update auth/api lib with new endpoints
- chore(db): add migration 045 for application answers

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 20:26:49 -06:00
Tiago Yamamoto
59cd1fa01a feat: add pagination to candidates list endpoint
- Add PaginationInfo struct to candidates DTO
- Update ListCandidates service to support page/perPage params
- Update handler to parse pagination query params
- Update frontend candidates page with pagination controls
2026-02-23 18:02:41 -06:00
Tiago Yamamoto
fa1d397c01 fix: sync credentials services between backend and frontend
- Update ListConfiguredServices to use correct service names
- Add fcm_service_account, appwrite, smtp to BootstrapCredentials
- Remove unused payment_gateway from frontend schema
- Rename firebase to fcm_service_account in frontend
2026-02-23 16:20:25 -06:00
Tiago Yamamoto
74afffa4a9 feat: add category field to tickets system 2026-02-23 15:43:35 -06:00
Tiago Yamamoto
3583ef89d8 fix: set cookie Secure=true and SameSite=None for cross-origin auth 2026-02-23 13:44:34 -06:00
Tiago Yamamoto
0876584499 feat(seeder): add realistic job templates with all new fields
Replace placeholder job data with 10 varied templates covering:
- employment_type (full-time, part-time, contract, dispatch)
- work_mode (remote, hybrid, onsite)
- salary_min/max, salary_type, currency (BRL/USD/EUR/GBP/JPY)
- salary_negotiable, language_level, visa_support
- date_posted, realistic descriptions and locations

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 13:06:32 -06:00
Tiago Yamamoto
45659f4a76 fix(search): add companies JOIN to countQuery so keyword search works
The countQuery was missing LEFT JOIN companies c, causing a PostgreSQL
error when the search filter referenced c.name ILIKE. This made every
keyword search return a 500 error instead of results.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 13:02:29 -06:00
Tiago Yamamoto
3a26af3df5 fix: global document and phone handling — remove Brazil-specific formatting
Frontend (jobs/new):
- Replace isValidCNPJ (checksum algorithm) with isValidDocument: accepts
  any tax document with 5–30 alphanumeric chars (CNPJ, EIN, VAT, etc.)
- Add cleanPhone(): strips formatting chars (dashes, spaces, parens) and
  keeps only digits + optional leading '+'; replaces cleanDigits+prepend
- Phone sent as '+5511999998888' if user typed '+55...', or '11999998888'
  if no country code was provided — no '+' blindly prepended anymore
- Company document sent stripped of all non-alphanumeric before API call
- Update label placeholder from '00.000.000/0000-00' to 'CNPJ, EIN, VAT...'
- Rename error key invalidCnpj → invalidDocument in all 3 locales (pt, en, es)

Backend (create_company use case):
- Add SanitizePhone() to utils/sanitizer.go: strips all non-digit chars
  except a leading '+'; '(11) 99999-8888' → '11999998888'
- Apply SanitizePhone to input.Phone before persisting to DB

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 12:46:54 -06:00
Tiago Yamamoto
61d64d846a fix(jobs): enforce CreateJob validation and sanitize DB constraint errors
- Add validateCreateJobRequest() checking required fields (companyId,
  title ≥5 chars, description ≥20 chars) and enum values
  (employmentType, workMode, status) before hitting the DB
- Catch *pq.Error in handler: check_violation (23514) and
  foreign_key_violation (23503) now return 400; unique_violation (23505)
  returns 409; other DB errors return 500 without leaking raw pq messages
- Fix test fixtures: description and companyId now meet validation
  requirements

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 12:26:14 -06:00
Tiago Yamamoto
89358acc13 refactor(auth): remove hash hardcoded da migration, seeder gera em runtime
Antes: 010_seed_super_admin.sql tinha hash bcrypt fixo amarrado a um pepper
específico. Qualquer mudança no PASSWORD_PEPPER quebrava todos os logins
silenciosamente após reset do banco.

Agora:
- migration 010: insere superadmin com placeholder inválido + force_change_password.
  ON CONFLICT DO NOTHING preserva o hash se o seeder já rodou.
- seeder users.js: faz upsert de 'lol' com bcrypt(senha + env.PASSWORD_PEPPER)
  em runtime. Mudar o pepper e re-rodar o seeder é suficiente para atualizar
  as credenciais sem tocar em nenhuma migration.
- docs/AGENTS.md: atualiza gotcha #1 explicando o novo fluxo migrate → seed
- docs/DEVOPS.md: fix opção 1 do troubleshooting inclui re-deploy do seeder

Fluxo correto após reset do banco (coberto pelo start.sh opções 2, 6, 8):
  npm run migrate  →  superadmin criado, hash = placeholder
  npm run seed     →  hash recalculado com PEPPER do ambiente, status = active

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 12:05:54 -06:00
Tiago Yamamoto
fcf960381c fix(auth): corrige hash seed e documenta alinhamento do PASSWORD_PEPPER
- Atualiza hash hardcoded em 010_seed_super_admin.sql para hash válido
  gerado com pepper=gohorse-pepper (o antigo hash estava inválido e causava
  AUTH_INVALID_CREDENTIALS em qualquer reset do banco)
- Corrige valor de PASSWORD_PEPPER e CORS_ORIGINS no DEVOPS.md para
  refletir os valores reais do Coolify DEV
- Adiciona seção de troubleshooting no DEVOPS.md com diagnóstico e fix
  passo-a-passo para mismatch de pepper
- Adiciona seção "Known Gotchas" no AGENTS.md documentando:
  * Regra do PASSWORD_PEPPER (deve ser gohorse-pepper em todos ambientes)
  * Campo de login é email no DTO, não identifier
  * Hashes bcrypt em SQL devem usar arquivo -f, nunca -c ($ é expandido)
  * Credenciais de teste do ambiente DEV

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 11:43:35 -06:00
Tiago Yamamoto
d7b03dad19 docs: add AI context rules and missing READMEs 2026-02-21 13:33:36 -06:00
Tiago Yamamoto
8b37b87398 fix: adiciona CORS_ORIGINS para permitir frontend HTTPS 2026-02-17 11:46:22 -06:00
Tiago Yamamoto
15b462b143 test: increase backend use case coverage 2026-02-16 23:25:26 -03:00
Tiago Yamamoto
6ec54460f8 docs: unify documentation structure
- Create docs/AGENTS.md for AI assistants context
- Create docs/WORKFLOWS.md consolidating deployment workflows
- Remove redundant docs/root/ folder
- Remove .agent/ folder (consolidated into docs/)
- Update dates in all documentation files
- Simplify README.md documentation section
2026-02-16 05:57:02 -06:00
Tiago Yamamoto
6fbd1f5ffc feat: implement full auth system with HTTPOnly cookies + JWT, fix migrations to UUID v7, remove mock data from frontend
Backend:
- Fix migrations 037-041 to use UUID v7 (uuid_generate_v7)
- Fix CORS defaults to include localhost:8963
- Fix FRONTEND_URL default to localhost:8963
- Update superadmin password hash with pepper
- Add PASSWORD_PEPPER environment variable

Frontend:
- Replace mockJobs with real API calls in home page
- Replace mockNotifications with notificationsApi in context
- Replace mockApplications with applicationsApi in dashboard
- Fix register/user page to call real registerCandidate API
- Fix hardcoded values in backoffice and messages pages

Auth:
- Support both HTTPOnly cookie and Bearer token authentication
- Login returns token + sets HTTPOnly cookie
- Logout clears HTTPOnly cookie
- Token valid for 24h
2026-02-16 05:20:46 -06:00
Tiago Yamamoto
fb5aba4ed7 backend: suportar workMode em vagas e reforçar schema 2026-02-15 13:36:32 -03:00
Tiago Yamamoto
bdbc6f6b5b
Merge pull request #65 from rede5/codex/verificar-rotas-e-campos-faltantes-aqvrgs
Align backend company registration payloads and add PATCH notification routes
2026-02-15 13:16:55 -03:00
Tiago Yamamoto
4544a1d5b2 Align backend company registration and notification routes with frontend 2026-02-15 13:16:37 -03:00
GoHorse Deploy
694f6c3313 chore: commit pending changes 2026-02-15 16:03:40 +00:00
GoHorse Deploy
a3c2a18e61 Merge branch 'dev' of github.com:rede5/gohorsejobs into dev 2026-02-15 14:20:28 +00:00
Tiago Yamamoto
d7be83f1f0 feat(backend): add missing storage routes and job datePosted support 2026-02-14 21:16:12 -03:00
GoHorse Deploy
2a66e2888a Merge branch 'main' of github.com:rede5/gohorsejobs into dev 2026-02-14 21:58:08 +00:00
GoHorse Deploy
ae475e41a9 feat: implement careerjet gap analysis improvements
- Video Interview system (backend + frontend)
- Date Posted filter (24h, 7d, 30d)
- Company filter in jobs listing
- Recent searches persistence (LocalStorage)
- Job Alerts with email confirmation
- Favorite jobs with API
- Company followers system
- Careerjet URL compatibility (s/l aliases)
2026-02-14 19:37:25 +00:00
Tiago Yamamoto
b41bf56585 Refine migrations flow and lint tooling across apps 2026-02-14 15:42:40 -03:00
Tiago Yamamoto
b166ff440a Add Careerjet-compatible job search params and gap analysis 2026-02-14 15:12:04 -03:00
GoHorse Deploy
ed982caccc merge: resolve conflicts by accepting dev changes 2026-02-14 17:38:47 +00:00
Rede5
ff17eb2e4c fix: remove duplicate fields in User model 2026-02-14 17:28:46 +00:00
Rede5
948858eca0 fix: resolve remaining merge conflicts 2026-02-14 17:21:10 +00:00
GoHorse Deploy
eb1276eac4 fix: restore frontend dependencies and update environment 2026-02-14 17:19:53 +00:00
Rede5
4e2c6a5726 fix: use Docker Hub instead of gcr mirror 2026-02-14 17:14:31 +00:00
Tiago Yamamoto
eab6c26aca chore: padroniza conexão de banco via DATABASE_URL 2026-02-12 20:13:46 -03:00
Tiago Yamamoto
3ac4bc5fd5 chore: remove docker compose artifacts and references 2026-02-12 20:06:40 -03:00
Gabbriiel
f700dd075c Merge branch 'dev' of https://github.com/rede5/gohorsejobs into dev 2026-02-12 19:10:31 -03:00
Gabbriiel
1d8fe78697 docs: move diagrama de arquitetura para STATUS_REPORT.md 2026-02-12 19:09:41 -03:00
Tiago Yamamoto
2fe7280600
Merge pull request #44 from rede5/claude/claude-md-mljq7u1y78t7vtbx-Oz1po
Add candidate profile management, password reset, and support features
2026-02-12 14:34:16 -03:00
GoHorse Deploy
1c29e469a7 fix: make migration 032 idempotent and fix UUID type in credentials bootstrap
- Migration 032: add NOT EXISTS check to avoid duplicate key violation
- CredentialsBootstrap: use NULLIF for updated_by UUID column, pass empty string instead of system_bootstrap
2026-02-07 17:22:15 +00:00
GoHorse Deploy
fee98a651b fix: standardize apiUrl to api.rede5.com.br 2026-02-07 16:51:04 +00:00
GoHorse Deploy
51f01dae6a fix(backend): use default RSA key if env var missing 2026-02-07 15:51:22 +00:00
GoHorse Deploy
bf41617ac6 chore: merge dev into hml resolving conflicts 2026-02-07 14:46:03 +00:00
Marcus Bohessef
ea5a0032eb Ajuste nas migrations 2026-02-07 11:02:02 -03:00
Marcus Bohessef
1b1a7d1d00 Ajuste nas migrations 2026-02-07 10:54:21 -03:00
Marcus Bohessef
40e7cce971 Ajuste nas migrations 2026-02-07 10:48:42 -03:00
Marcus Bohessef
4253f49cbf Ajuste nas migrations 2026-02-07 10:41:16 -03:00
GoHorse Deploy
e1a5163c3b Merge branch 'dev' into hml 2026-02-07 13:29:01 +00:00
Marcus
99b787056a ajustes novos 2026-01-31 15:44:44 -03:00