nxtgauge-backend-rust/crates/db/migrations
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
..
20260317000000_init_config_schema.down.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317000000_init_config_schema.up.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317000001_init_users_schema.down.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317000001_init_users_schema.up.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317000002_init_photographer_schema.down.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317000002_init_photographer_schema.up.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317000003_init_tutor_schema.down.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317000003_init_tutor_schema.up.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317000004_init_company_schema.down.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317000004_init_company_schema.up.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317184130_init_job_seeker_schema.down.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317184130_init_job_seeker_schema.up.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317184230_init_customer_schema.down.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317184230_init_customer_schema.up.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317184330_init_makeup_artist_schema.down.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317184330_init_makeup_artist_schema.up.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317184430_init_developer_schema.down.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317184430_init_developer_schema.up.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317184530_init_video_editor_schema.down.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317184530_init_video_editor_schema.up.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317184630_init_graphic_designer_schema.down.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317184630_init_graphic_designer_schema.up.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317184730_init_social_media_manager_schema.down.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317184730_init_social_media_manager_schema.up.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317184830_init_fitness_trainer_schema.down.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317184830_init_fitness_trainer_schema.up.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317184930_init_catering_service_schema.down.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317184930_init_catering_service_schema.up.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317190000_complete_users_schema.down.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317190000_complete_users_schema.up.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317190100_jobs_and_applications.down.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317190100_jobs_and_applications.up.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317190200_requirements_and_leads.down.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317190200_requirements_and_leads.up.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317190300_portfolio_payments.up.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317190400_notifications.up.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317195000_profession_specific_profiles.down.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317195000_profession_specific_profiles.up.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317201500_user_verification_tokens.down.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317201500_user_verification_tokens.up.sql feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
20260317202500_profession_profiles_custom_data.down.sql feat: add Redis for OTP, auth tokens, rate limiting, lead dedup and marketplace cache 2026-03-18 22:58:42 +01:00
20260317202500_profession_profiles_custom_data.up.sql feat: add Redis for OTP, auth tokens, rate limiting, lead dedup and marketplace cache 2026-03-18 22:58:42 +01:00