Commit graph

83 commits

Author SHA1 Message Date
Tracewebstudio Dev
f82d0c5153 chore: trigger gitea pipeline - rebuild gateway 2026-05-05 19:22:10 +02:00
Tracewebstudio Dev
f75a348fc7 feat(ai): add missing intents, admin guards, and validation checks
- Add missing AI intents: generate_cover_letter, improve_resume, request_view_contact, auto_apply_job, unknown
- Add is_internal_admin helper to prevent admin/super_admin users from using user-facing AI flows
- Add admin guards to: ai_generate_job_field, ai_generate_cover_letter, ai_tailor_resume, ai_auto_apply, ai_auto_respond_to_lead
- Add professional approval check in ai_auto_respond_to_lead - must be APPROVED status
- Add tracecoin balance check before contact reveal (requires 30 tracecoins)
- Add KB escalation: when no articles found, suggest creating support ticket
- Add explicit unknown intent handler with helpful message
2026-05-05 17:44:40 +02:00
Tracewebstudio Dev
2aba45c9fa feat: password reset via 6-digit code instead of token link
- Generate 6-digit code instead of UUID token for password reset
- Store in Redis with 15 min TTL (was 1 hour)
- Update email template to show code instead of reset link
- Update ResetPasswordPayload to accept code instead of token
- Update send_password_reset_email to accept code parameter
2026-05-05 17:21:56 +02:00
Tracewebstudio Dev
c443ff5b50 chore: trigger rebuild with real code change 2026-05-01 21:50:24 +02:00
Tracewebstudio Dev
42a9a17133 Add Redis caching for AI generation rate limiting
- Add cache::ai module with Redis rate limiting for AI generations
- Add functions: check_ai_rate_limit, get_ai_usage, cache_ai_response,
  get_cached_ai_response, invalidate_ai_cache, reset_daily_usage
- Update check_and_increment_usage to use Redis fast-path before DB
- Redis key pattern: ai:rate:{user_id} for 24hr sliding window counter
2026-05-01 03:02:46 +02:00
Tracewebstudio Dev
aa71ccdf36 Add AI endpoints and gateway route fix
- Fix gateway: add /api/ai route to users_url
- Add AI job field generation endpoints (generate-job-field, generate-cover-letter, tailor-resume, auto-apply)
- Add AI usage tracking and rate limiting
- Add professional auto-respond-to-lead endpoint (30 tracecoins)
- Add DB migrations for AI usage tracking tables
- Update leads service with AI auto-respond functionality
2026-05-01 02:54:42 +02:00
Tracewebstudio Dev
8128bd0d30 fix(pricing): support roleKey alias and leads schema 2026-04-29 09:59:41 +02:00
Tracewebstudio Dev
5946bfe3a8 chore: checkpoint workspace updates 2026-04-26 23:58:43 +02:00
Tracewebstudio Dev
1ac60f9756 fix: gateway routes /api/runtime-config to users service (was missing, causing 404) 2026-04-22 01:13:59 +02:00
Tracewebstudio Dev
f37c48f1ee fix: get_user_role_keys returns newest role first, not oldest
- models/user.rs: ORDER BY ur.created_at DESC so most recently assigned role is returned first
- handlers/auth.rs: resolve_signup_role_candidates returns empty vec instead of JOB_SEEKER when no valid intent
2026-04-21 21:51:02 +02:00
Tracewebstudio Dev
04f9ab52fa fix: suppress dead_code warnings with #[allow(dead_code)] 2026-04-18 18:30:56 +02:00
Tracewebstudio Dev
0e7ab9ceb8 fix: add v1 otp routes and fail on email send errors 2026-04-17 12:02:26 +02:00
Tracewebstudio Dev
d08449185e feat: add v1 users API routes for backward compatibility
- Add /api/v1/users path routing to users service in gateway
- Add v1_router() in auth.rs with resend-otp endpoint
- Nest /api/v1/users route in main.rs
- Support legacy /api/v1/users/resend-otp endpoint
2026-04-16 18:06:06 +02:00
Tracewebstudio Dev
52ed6d7975 fix(support): add missing status bind parameter in admin create case
- Fix INSERT statement to use , ,  instead of hardcoded 'new' with placeholders
- Add .bind("new") for status parameter
2026-04-16 10:28:05 +02:00
Tracewebstudio Dev
ebc0a29437 fix(ai): use Ollama cluster URL and gemma3:270m model defaults
- Default OLLAMA_BASE_URL to http://ollama.nxtgauge-ai.svc.cluster.local:11434
- Default OLLAMA_CHAT_MODEL to gemma3:270m (matches gitops configmap)
2026-04-15 19:54:58 +02:00
Tracewebstudio Dev
430711a0ae feat: add AI endpoints for chat, tickets, form extraction via Ollama
- Add /api/ai/chat/message: LLM-powered chat with intent classification
- Add /api/ai/tickets/create and /api/ai/tickets/🆔 AI ticket management
- Add /api/ai/forms/extract: LLM-powered form field extraction
- Add /api/support/tickets/ai/create: unauthenticated ticket creation for AI service
- Add reqwest to workspace dependencies
2026-04-15 18:19:07 +02:00
Tracewebstudio Dev
a3076ed526 feat: update DB schema - split users.first_name, users.last_name, roles split 2026-04-15 06:23:27 +02:00
Tracewebstudio Dev
92ded2b43d Fix role/config schema alignment and external dashboard runtime loading 2026-04-15 00:16:25 +02:00
Tracewebstudio Dev
3432d67cc4 fix(auth): remove phone from INSERT and User struct since column doesn't exist
- Remove phone from INSERT INTO users (users table has no phone column)
- Remove phone from User struct and CreateUserPayload
- Return null for phone in API responses
- Keep phone field in RegisterPayload for backward compat (just not persisted)
2026-04-13 20:15:32 +02:00
Tracewebstudio Dev
1d50d21f00 fix(auth): also accept 'name' field for signup compatibility
Frontend sends 'name' field directly. RegisterPayload now accepts:
- name (direct, used by frontend)
- full_name (legacy)
- first_name + last_name (new format)
2026-04-13 20:13:53 +02:00
Tracewebstudio Dev
63eb27a160 fix(auth): accept both full_name and first_name+last_name for backward compatibility
RegisterPayload now accepts:
- full_name (single field, for old frontend clients)
- first_name + last_name (new format)

Error returned only if none of these are provided.
2026-04-13 19:59:48 +02:00
Tracewebstudio Dev
2861e7a5fe fix: replace u.full_name with u.name in remaining services
- companies: user.name in email and contact queries
- customers: user.name in email
- job_seekers: u.name in company user query
- cron tasks (jobs/leads/requirements): use u.name instead of u.full_name
- contracts/profession_shared: u.name for customer_name fields
2026-04-13 17:12:49 +02:00
Tracewebstudio Dev
231ff9530f fix(auth): use 'name' column instead of 'full_name', combine first_name + last_name
- Replace full_name with name in User struct and all queries
- RegisterPayload now takes first_name + last_name instead of full_name
- Combine first_name and last_name into name before saving to DB
- Update all response structs to use 'name' field instead of 'full_name'
- Fix support and dashboard queries to use u.name instead of u.full_name

Root cause: DB has 'name' column, code was using 'full_name' which doesn't exist.
2026-04-13 16:55:09 +02:00
Tracewebstudio Dev
f5130569e5 fix: migrate route params to Axum 0.7+ syntax ({id} instead of :id)
- apps/jobs/src/main.rs: Update /jobs/:id to /jobs/{id}
- apps/leads/src/main.rs: Update /leads/:id to /leads/{id}
2026-04-13 16:04:55 +02:00
Tracewebstudio Dev
f7e18cd4d6 feat: pricing packages with multi-select roles, lead requests, mock checkout 2026-04-13 01:36:13 +02:00
Tracewebstudio Dev
c433ab5fed feat(db): update service handlers and models for new schema
- Update leads service to use 'leads' table
- Update extension models to use user_role_profile_id
- Update ProfessionalRepository to work with new schema
- Create TracecoinWalletRepository for wallet operations
- Update all handlers to use new model fields
- Rename Application fields (job_seeker_id -> applicant_user_id)
- Update cron tasks for new schema
- Fix compilation errors across all services
2026-04-13 00:29:44 +02:00
Tracewebstudio Dev
1e6abd9397 feat: add separate jobs and leads services
- Create jobs service (port 9103) for job postings management
- Create leads service (port 9118) for lead/requirement management
- Update gateway to route /api/jobs to jobs service
- Update gateway to route /api/leads to leads service
- Add jobs and leads to Woodpecker CI matrix
2026-04-12 22:03:06 +02:00
Tracewebstudio Dev
8d920c4b34 fix(users): update Axum routes to 0.7 syntax for email templates 2026-04-12 16:58:07 +02:00
Ashwin Kumar
e948dc7175 feat(smtp): add SMTP management APIs and test functionality
- Add GET /api/admin/email/smtp-config endpoint

- Add POST /api/admin/email/smtp-config endpoint

- Add POST /api/admin/email/smtp-test endpoint

- Add send_test_email method to Mailer

- Update SMTP management page with test functionality
2026-04-10 04:55:35 +02:00
Ashwin Kumar
b4f714f43f feat(emails): complete email system with 35 branded templates and full wiring
- Add 35 branded HTML email templates with Nxtgauge styling

- Create email template engine with base template system

- Add email management API for admin panel

- Wire email triggers from all services

- All services compile successfully
2026-04-10 04:49:39 +02:00
Ashwin Kumar
ff4e23d991 fix(payments): update axum router path syntax to v0.7 2026-04-10 03:09:16 +02:00
Ashwin Kumar
d46f455c03 fix: use unique ports 9100-9117 (avoids conflicts with BrowserOS on 9000/9103) 2026-04-09 22:18:30 +02:00
Ashwin Kumar
d151653ab1 chore: trigger rebuild 2026-04-09 21:51:17 +02:00
Ashwin Kumar
4fbc8d8b1f chore: trigger CI rebuild 2026-04-09 13:51:11 +02:00
Ashwin Kumar
73d167c333 fix: add OpenSSL static linking for musl builds
Added openssl-libs-static and OPENSSL_STATIC=1 environment variable
to fix reqwest/native-tls compilation errors with musl target.

Changes:
- Install openssl-libs-static in builder
- Set OPENSSL_STATIC=1 and OPENSSL_DIR=/usr
- Ensures OpenSSL is statically linked for all services
2026-04-09 11:59:57 +02:00
Ashwin Kumar
5b4e8fe908 refactor: use Alpine Linux with static musl binaries for all services
Switched from Debian to Alpine Linux for significant improvements:
- Image size: ~5MB vs ~100MB (95% smaller)
- Security: Minimal attack surface, no glibc vulnerabilities
- Static linking: No glibc version issues ever again
- Uses rust:alpine builder with x86_64-unknown-linux-musl target
- Static binaries with RUSTFLAGS='-C target-feature=+crt-static'

Fixes the GLIBC_2.38 error permanently by avoiding glibc entirely.
2026-04-09 11:51:57 +02:00
Ashwin Kumar
219960399b fix: update Dockerfiles to use debian:trixie-slim for glibc 2.38+ compatibility
Fixed glibc version mismatch between rust:latest builder (glibc 2.38+)
and debian:bookworm-slim runtime (glibc 2.36). This was causing:
- ./companies: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.38 not found
- ./payments: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.38 not found
- Similar errors for users service

Updated all 19 service Dockerfiles + Dockerfile.template to use
debian:trixie-slim which includes glibc 2.38+.
2026-04-09 11:48:46 +02:00
Ashwin Kumar
3e557e54e8 fix: convert all remaining SQLx macros in handlers to runtime API 2026-04-09 08:11:26 +02:00
Ashwin Kumar
83c62a1c5e fix: convert all SQLx macros to runtime API, remove SQLX_OFFLINE requirement 2026-04-09 07:40:15 +02:00
Ashwin Kumar
1d3d07f001 fix: add Docker Hub login + switch runtime to AWS ECR Public to avoid rate limits 2026-04-09 06:26:01 +02:00
Ashwin Kumar
085b3169f6 fix: limit CARGO_BUILD_JOBS=2 to reduce OOM during parallel matrix builds 2026-04-09 05:55:50 +02:00
Ashwin Kumar
329f650079 fix: add SQLx offline cache and SQLX_OFFLINE=true for Docker builds 2026-04-09 05:46:32 +02:00
Ashwin Kumar
a2fa6cfbb9 fix: use rust:latest image tag (1.88 tag does not exist yet) 2026-04-09 05:34:07 +02:00
Ashwin Kumar
3318a0aec1 fix: bump Rust to 1.88 to satisfy dependency toolchain requirements 2026-04-09 01:49:34 +02:00
Ashwin Kumar
0a067bcb7b fix: add libssl-dev and Cargo.lock to all service Dockerfiles 2026-04-09 01:43:28 +02:00
Ashwin Kumar
4b4a45f90d fix: bump Rust to 1.85 to support required dependency features 2026-04-09 01:23:44 +02:00
Ashwin Kumar
235c5fce76 ci: add Woodpecker CI matrix pipeline and missing cron Dockerfile
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 00:09:04 +02:00
Ashwin Kumar
2ded64e71b feat: extend admin/user flows with settings, verification, and approval updates 2026-04-08 22:40:54 +02:00
Ashwin Kumar
23c2edd567 feat: improve startup and routing
- Create scripts/init-db.sql for DB schema initialization
- Enhance start-services.sh to auto-initialize DB if needed
- Fix users admin handler: change root route from '/users' to '/' to avoid double prefix
- Remove deprecated handlers (departments/designations/employees) from users service
- Add missing admin route mappings for users and approval/case endpoints in gateway
- Update gateway to correctly handle /api/admin/users, /api/admin/approvals, etc.
- Update .env.example and docs

These changes enable running the stack without Docker and fix admin panel routing.
2026-04-07 22:12:37 +02:00
Ashwin Kumar
7928e21a21 fix: resolve all compilation warnings and errors across services
- Remove duplicate departments/designations/employees handlers from users service (already in employees service)
- Fix all 9 profession admin handlers to use correct DB schema (display_name, bio, location, custom_data)
- Fix companies admin handler to match CompanyProfile DB model with all fields
- Fix customers admin handler to match Requirement model with preferred_date
- Fix missing serde_json imports and type annotations in admin handlers
- Add #[allow(dead_code)] for intentionally unused structs/fields
- Add test infrastructure: auth crypto tests (2 passing), test directory structure
- Zero compilation warnings across all services
2026-04-07 12:52:55 +02:00