Commit graph

19 commits

Author SHA1 Message Date
Tracewebstudio Dev
d29c755899 fix(users): add missing password_hash bind parameter in user create
- INSERT statement had only 4 placeholders but 5 columns specified
- Add  placeholder for password_hash and bind it properly
2026-04-16 10:35:47 +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
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
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
2e283e5d67 feat(db): add complete migration and update extension models to use user_role_profile_id
- Add comprehensive migration script for database schema redesign
- Update all extension profile models to reference user_role_profile_id
- Create user_role_profiles as root table for all role profiles
- Remove external portfolio links (github_url, portfolio_url, reel_url)
- Rename applications→job_applications, requirements→leads
- Drop deprecated tables (professionals, onboarding_submissions, etc.)
2026-04-12 23:55:08 +02:00
Tracewebstudio Dev
03376b9567 feat: Add database redesign documentation and Phase 1-2 migrations
- Add schema_audit.md documenting current schema issues
- Add target_schema.md with complete target schema design
- Add old_to_new_mapping.md with table mapping
- Add migration_plan.md with phased migration strategy
- Add Phase 1 migrations (core infrastructure):
  - user_sessions table
  - users missing columns
  - departments updates
  - designations updates
  - employees updates
- Add Phase 2 migrations (profile domain - CRITICAL):
  - create user_role_profiles root table
  - backfill user_role_profiles from existing profiles
  - add user_role_profile_id to extension tables
  - remove forbidden external portfolio links
- Add user_role_profile Rust model
- Update photographer model to use user_role_profile_id
2026-04-12 23:21:11 +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
58eff5ce63 fix: regenerate SQLx cache and fix type annotation errors in offline mode 2026-04-09 07:01:31 +02:00
Ashwin Kumar
cb53b68f49 feat: complete backend implementation - payments service, admin endpoints, auth guards, submit-for-verification for all roles
- Add payments service proxying to Beeceptor mock gateway (create-order, verify, status)
- Add companies admin approve/reject/suspend + get detail endpoints
- Apply require_admin auth guards to all employee/department/designation handlers
- Add submit-for-verification endpoint to all 12 roles (10 professions + job seekers + customers + companies)
- Fix port conflict (employees moved from 8085 to 8096)
- Add submit_for_verification methods to all profile repositories
2026-04-06 06:19:10 +02:00
Ashwin Kumar
5cd00b74bc feat: implement user verification system and database migrations 2026-04-06 03:39:41 +02:00
Ashwin Kumar
89b055b329 Add UGC Content Creator microservice (10th professional role)
- New service at apps/ugc_content_creators (port 8095)
- DB model + repository in crates/db/src/models/ugc_content_creator.rs
- Migration: ugc_content_creator_profiles table with platforms, content_niches,
  content_formats, follower_count, handles, and standard status/timestamps
- Contracts: is_professional_profile_approved() handles UGC_CONTENT_CREATOR case
- Gateway: routes /api/ugc-content-creators to new service
- Workspace Cargo.toml updated with new member

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 21:14:02 +02:00
Ashwin Kumar
446b6322de feat(admin): wire management modules to live backend and add UGC role 2026-04-02 13:09:43 +02:00
Ashwin Kumar
91534d74c0 chore: checkpoint current workspace changes 2026-03-22 15:55:29 +01:00
Ashwin Kumar
3b6d0f4951 feat(backend): enforce profile approvals and complete migration approval flows 2026-03-19 00:30:23 +01:00
Ashwin Kumar
9764a7acdd feat: commit remaining service files, migrations, and model updates
- gateway, companies, customers, job_seekers apps updated
- users config/mod/mail handlers
- auth middleware and jwt crate updates
- db models: user, config, mod updates
- all remaining migrations: portfolio, notifications, reviews, kb, support, coupons, onboarding states

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 22:59:47 +01:00
Ashwin Kumar
bb8155dd27 feat: add Redis for OTP, auth tokens, rate limiting, lead dedup and marketplace cache
- Add crates/cache with client, otp, rate_limit, token, lead, jobs modules
- OTP tokens stored in Redis (15-min TTL, single-use GETDEL on verify)
- Refresh tokens stored in Redis (30-day TTL) — removed DB storage
- Password reset tokens stored in Redis (1-hour TTL, single-use)
- Rate limiting: register (10/hr), login (10/15min), OTP resend (3/hr), lead (5/hr), job post (20/hr)
- Lead request deduplication: 24-hour Redis lock per professional+requirement pair
- Marketplace listings cached in Redis (5-min TTL per profession+page+limit)
- Add ProfessionState{pool, redis} to contracts crate, replacing bare PgPool in all 9 profession apps
- All profession handlers and main.rs updated to use ProfessionState
- REDIS_URL env var (default: redis://127.0.0.1:6379) used across all services
- Fix profession model struct name mangling in 6 handlers (MakeupArtistRepository etc.)
- Add custom_data JSONB migration for all 9 profession profile tables
- Add onboarding_state model and repository (save_progress, complete, is_complete)
- Add onboarding handler accepting roleKey:String (not role_id:UUID) for frontend compat

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 22:58:42 +01:00
Ashwin Kumar
5640cd4ee5 feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00