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
-- Nxtgauge Seed Script
-- Run: psql $DATABASE_URL -f scripts/seed.sql
-- Safe to re-run (uses INSERT ... ON CONFLICT DO UPDATE for configs)
-- ── 1. Roles ─────────────────────────────────────────────────────────────────
2026-04-15 06:23:27 +02:00
-- Internal roles
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
INSERT INTO roles ( key , name , audience ) VALUES
( ' SUPER_ADMIN ' , ' Super Admin ' , ' INTERNAL ' ) ,
( ' ADMIN ' , ' Admin ' , ' INTERNAL ' ) ,
2026-04-15 06:23:27 +02:00
( ' SUPPORT ' , ' Support Agent ' , ' INTERNAL ' )
ON CONFLICT ( key ) DO NOTHING ;
-- Internal role extensions
INSERT INTO internal_roles ( role_id , description )
SELECT id , ' Full system administrator with all permissions ' FROM roles WHERE key = ' SUPER_ADMIN '
ON CONFLICT ( role_id ) DO NOTHING ;
INSERT INTO internal_roles ( role_id , description , can_approve_requests , can_manage_system_settings )
SELECT id , ' Standard administrator ' , true , true FROM roles WHERE key = ' ADMIN '
ON CONFLICT ( role_id ) DO NOTHING ;
INSERT INTO internal_roles ( role_id , description )
SELECT id , ' Customer support agent ' FROM roles WHERE key = ' SUPPORT '
ON CONFLICT ( role_id ) DO NOTHING ;
-- External roles
INSERT INTO roles ( key , name , audience ) VALUES
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
( ' COMPANY ' , ' Company ' , ' EXTERNAL ' ) ,
( ' JOB_SEEKER ' , ' Job Seeker ' , ' EXTERNAL ' ) ,
( ' CUSTOMER ' , ' Customer ' , ' EXTERNAL ' ) ,
( ' PHOTOGRAPHER ' , ' Photographer ' , ' EXTERNAL ' ) ,
( ' MAKEUP_ARTIST ' , ' Makeup Artist ' , ' EXTERNAL ' ) ,
( ' TUTOR ' , ' Tutor ' , ' EXTERNAL ' ) ,
( ' DEVELOPER ' , ' Developer ' , ' EXTERNAL ' ) ,
( ' VIDEO_EDITOR ' , ' Video Editor ' , ' EXTERNAL ' ) ,
( ' GRAPHIC_DESIGNER ' , ' Graphic Designer ' , ' EXTERNAL ' ) ,
( ' SOCIAL_MEDIA_MANAGER ' , ' Social Media Manager ' , ' EXTERNAL ' ) ,
( ' FITNESS_TRAINER ' , ' Fitness Trainer ' , ' EXTERNAL ' ) ,
( ' CATERING_SERVICES ' , ' Catering Services ' , ' EXTERNAL ' )
ON CONFLICT ( key ) DO NOTHING ;
2026-04-15 06:23:27 +02:00
-- External role extensions
INSERT INTO external_roles ( role_id )
SELECT id FROM roles WHERE audience = ' EXTERNAL '
ON CONFLICT ( role_id ) DO NOTHING ;
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
-- ── 2. Super Admin User ──────────────────────────────────────────────────────
-- Default password: Admin@nxtgauge1 (bcrypt hash)
-- CHANGE THIS PASSWORD IMMEDIATELY AFTER FIRST LOGIN
DO $ $
DECLARE
super_admin_role_id UUID ;
admin_user_id UUID ;
BEGIN
SELECT id INTO super_admin_role_id FROM roles WHERE key = ' SUPER_ADMIN ' ;
2026-04-15 06:23:27 +02:00
INSERT INTO users ( email , password_hash , status , role_id , first_name , last_name , email_verified )
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
VALUES (
' admin@nxtgauge.com ' ,
' $2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TiGniB9GSmJBGp0K7RqUi/4hY/Ii ' ,
' ACTIVE ' ,
super_admin_role_id ,
2026-04-15 06:23:27 +02:00
' Super ' ,
' Admin ' ,
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
true
)
ON CONFLICT ( email ) DO NOTHING
RETURNING id INTO admin_user_id ;
IF admin_user_id IS NOT NULL THEN
INSERT INTO user_roles ( user_id , role_id , status , approved_at )
VALUES ( admin_user_id , super_admin_role_id , ' APPROVED ' , NOW ( ) )
ON CONFLICT ( user_id , role_id ) DO NOTHING ;
END IF ;
END $ $ ;
-- ── 3. Onboarding Configs ─────────────────────────────────────────────────────
-- Each role gets its own INSERT for clarity and maintainability.
-- Fields use "id" (not "key") to match the frontend field binding.
-- All document uploads accept PDF + images.
-- City fields are readOnly and default to "Chennai, India".
-- version = 2 to force updates on re-run.
2026-07-28 20:10:15 +05:30
-- CUSTOMER (basic + documents; no portfolio)
-- Field ids match src/lib/profile-fields-config.ts's `default` BASIC_FIELDS/DOC_FIELDS
-- (CUSTOMER has no dedicated entry there, so it falls back to `default`).
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
INSERT INTO onboarding_configs ( role_id , schema_json , version , is_active )
SELECT id , $ json $ {
2026-07-28 20:10:15 +05:30
" portfolioModel " : " none " ,
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
" steps " : [
{
2026-07-28 20:10:15 +05:30
" id " : " step_1_basic " ,
" title " : " Basic Information " ,
" type " : " basic " ,
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
" fields " : [
2026-07-28 20:10:15 +05:30
{ " id " : " first_name " , " label " : " First Name " , " type " : " text " , " required " : true , " lockAfterApproval " : true } ,
{ " id " : " last_name " , " label " : " Last Name " , " type " : " text " , " required " : true , " lockAfterApproval " : true } ,
{ " id " : " phone " , " label " : " Mobile Number " , " type " : " tel " , " required " : true } ,
{ " id " : " gender " , " label " : " Gender " , " type " : " select " , " required " : false ,
" options " : [ { " label " : " Male " , " value " : " Male " } , { " label " : " Female " , " value " : " Female " } , { " label " : " Other " , " value " : " Other " } , { " label " : " Prefer not to say " , " value " : " Prefer not to say " } ] } ,
{ " id " : " location " , " label " : " City " , " type " : " text " , " required " : true } ,
{ " id " : " state " , " label " : " State " , " type " : " text " , " required " : true } ,
{ " id " : " pin_code " , " label " : " PIN Code " , " type " : " text " , " required " : false } ,
{ " id " : " address " , " label " : " Address " , " type " : " textarea " , " required " : false }
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
]
} ,
{
2026-07-28 20:10:15 +05:30
" id " : " step_2_documents " ,
" title " : " Documents " ,
" type " : " documents " ,
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
" fields " : [
2026-07-28 20:10:15 +05:30
{ " id " : " aadhar_doc " , " label " : " Aadhar / Government ID " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " }
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
]
} ,
{
2026-07-28 20:10:15 +05:30
" id " : " step_3_review " ,
" title " : " Review and Submit " ,
" type " : " review " ,
" fields " : [ ]
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
}
]
} $ json $ : : jsonb , 2 , true
FROM roles WHERE key = ' CUSTOMER '
2026-03-21 15:17:59 +01:00
ON CONFLICT ( role_id ) WHERE is_active DO UPDATE SET schema_json = EXCLUDED . schema_json , version = EXCLUDED . version ;
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
2026-07-28 20:10:15 +05:30
-- COMPANY (basic + documents; no portfolio)
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
INSERT INTO onboarding_configs ( role_id , schema_json , version , is_active )
SELECT id , $ json $ {
2026-07-28 20:10:15 +05:30
" portfolioModel " : " none " ,
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
" steps " : [
{
2026-07-28 20:10:15 +05:30
" id " : " step_1_basic " ,
" title " : " Basic Information " ,
" type " : " basic " ,
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
" fields " : [
2026-07-28 20:10:15 +05:30
{ " id " : " company_name " , " label " : " Company Name " , " type " : " text " , " required " : true , " lockAfterApproval " : true } ,
{ " id " : " company_email " , " label " : " Company Email " , " type " : " email " , " required " : true } ,
{ " id " : " company_phone " , " label " : " Company Phone " , " type " : " tel " , " required " : false } ,
{ " id " : " website " , " label " : " Website URL " , " type " : " url " , " required " : false } ,
{ " id " : " location " , " label " : " City " , " type " : " text " , " required " : true } ,
{ " id " : " state " , " label " : " State " , " type " : " text " , " required " : true } ,
{ " id " : " pin_code " , " label " : " PIN Code " , " type " : " text " , " required " : false } ,
{ " id " : " address " , " label " : " Registered Address " , " type " : " textarea " , " required " : false } ,
{ " id " : " gst_number " , " label " : " GST Number (optional) " , " type " : " text " , " required " : false , " lockAfterApproval " : true }
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
]
} ,
{
2026-07-28 20:10:15 +05:30
" id " : " step_2_documents " ,
" title " : " Documents " ,
" type " : " documents " ,
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
" fields " : [
2026-07-28 20:10:15 +05:30
{ " id " : " registration_doc " , " label " : " Company Registration Certificate " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } ,
{ " id " : " gst_doc " , " label " : " GST Certificate (optional) " , " type " : " file " , " required " : false , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " }
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
]
} ,
{
2026-07-28 20:10:15 +05:30
" id " : " step_3_review " ,
" title " : " Review and Submit " ,
" type " : " review " ,
" fields " : [ ]
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
}
]
} $ json $ : : jsonb , 2 , true
FROM roles WHERE key = ' COMPANY '
2026-03-21 15:17:59 +01:00
ON CONFLICT ( role_id ) WHERE is_active DO UPDATE SET schema_json = EXCLUDED . schema_json , version = EXCLUDED . version ;
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
2026-07-28 20:10:15 +05:30
-- JOB_SEEKER (basic + documents + portfolio, portfolio saved into custom_data.job_seeker_portfolio)
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
INSERT INTO onboarding_configs ( role_id , schema_json , version , is_active )
SELECT id , $ json $ {
2026-07-28 20:10:15 +05:30
" portfolioModel " : " custom_data " ,
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
" steps " : [
{
" id " : " step_1_basic " ,
2026-07-28 20:10:15 +05:30
" title " : " Basic Information " ,
" type " : " basic " ,
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
" fields " : [
2026-07-28 20:10:15 +05:30
{ " id " : " first_name " , " label " : " First Name " , " type " : " text " , " required " : true , " lockAfterApproval " : true } ,
{ " id " : " last_name " , " label " : " Last Name " , " type " : " text " , " required " : true , " lockAfterApproval " : true } ,
{ " id " : " phone " , " label " : " Mobile Number " , " type " : " tel " , " required " : true } ,
{ " id " : " gender " , " label " : " Gender " , " type " : " select " , " required " : false ,
" options " : [ { " label " : " Male " , " value " : " Male " } , { " label " : " Female " , " value " : " Female " } , { " label " : " Other " , " value " : " Other " } , { " label " : " Prefer not to say " , " value " : " Prefer not to say " } ] } ,
{ " id " : " location " , " label " : " City " , " type " : " text " , " required " : true } ,
{ " id " : " state " , " label " : " State " , " type " : " text " , " required " : true } ,
{ " id " : " pin_code " , " label " : " PIN Code " , " type " : " text " , " required " : false } ,
{ " id " : " address " , " label " : " Address " , " type " : " textarea " , " required " : false }
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
]
} ,
{
2026-07-28 20:10:15 +05:30
" id " : " step_2_documents " ,
" title " : " Documents " ,
" type " : " documents " ,
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
" fields " : [
2026-07-28 20:10:15 +05:30
{ " id " : " aadhar_doc " , " label " : " Aadhar / Government ID " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " }
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
]
} ,
{
2026-07-28 20:10:15 +05:30
" id " : " step_3_portfolio " ,
" title " : " My Portfolio " ,
" type " : " portfolio " ,
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
" fields " : [
2026-07-28 20:10:15 +05:30
{ " id " : " headline " , " label " : " Professional Headline " , " type " : " text " , " required " : true } ,
{ " id " : " summary " , " label " : " Career Summary " , " type " : " textarea " , " required " : true } ,
{ " id " : " education " , " label " : " Education " , " type " : " textarea " , " required " : true } ,
{ " id " : " workExperience " , " label " : " Work Experience " , " type " : " textarea " , " required " : true } ,
{ " id " : " skills " , " label " : " Skills " , " type " : " textarea " , " required " : true }
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
]
} ,
{
" id " : " step_4_review " ,
2026-07-28 20:10:15 +05:30
" title " : " Review and Submit " ,
" type " : " review " ,
" fields " : [ ]
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
}
]
} $ json $ : : jsonb , 2 , true
FROM roles WHERE key = ' JOB_SEEKER '
2026-03-21 15:17:59 +01:00
ON CONFLICT ( role_id ) WHERE is_active DO UPDATE SET schema_json = EXCLUDED . schema_json , version = EXCLUDED . version ;
2026-07-28 20:10:15 +05:30
-- PHOTOGRAPHER (basic + documents + portfolio)
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
INSERT INTO onboarding_configs ( role_id , schema_json , version , is_active )
2026-07-28 20:10:15 +05:30
SELECT id , $ json $ { " portfolioModel " : " professional " , " steps " : [ { " id " : " step_1_basic " , " title " : " Basic Information " , " type " : " basic " , " fields " : [ { " id " : " first_name " , " label " : " First Name " , " type " : " text " , " required " : true , " lockAfterApproval " : true } , { " id " : " last_name " , " label " : " Last Name " , " type " : " text " , " required " : true , " lockAfterApproval " : true } , { " id " : " email " , " label " : " Email Address " , " type " : " email " , " required " : true } , { " id " : " phone " , " label " : " Mobile Number " , " type " : " tel " , " required " : true } , { " id " : " gender " , " label " : " Gender " , " type " : " select " , " required " : false , " options " : [ { " label " : " Male " , " value " : " Male " } , { " label " : " Female " , " value " : " Female " } , { " label " : " Other " , " value " : " Other " } , { " label " : " Prefer not to say " , " value " : " Prefer not to say " } ] } , { " id " : " address_line_1 " , " label " : " Address Line 1 " , " type " : " text " , " required " : true } , { " id " : " address_line_2 " , " label " : " Address Line 2 (Optional) " , " type " : " text " , " required " : false } , { " id " : " city " , " label " : " City " , " type " : " text " , " required " : true } , { " id " : " area " , " label " : " Area " , " type " : " text " , " required " : true } , { " id " : " state " , " label " : " State " , " type " : " text " , " required " : true } , { " id " : " pin_code " , " label " : " PIN Code " , " type " : " text " , " required " : false } ] } , { " id " : " step_2_documents " , " title " : " Documents " , " type " : " documents " , " fields " : [ { " id " : " aadhar_doc " , " label " : " Identity Proof " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } , { " id " : " address_proof " , " label " : " Address Proof " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } , { " id " : " portfolio_ownership_proof " , " label " : " Portfolio Ownership Proof " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } ] } , { " id " : " step_3_portfolio " , " title " : " My Portfolio " , " type " : " portfolio " , " fields " : [ { " id " : " about " , " label " : " About " , " type " : " textarea " , " required " : true } , { " id " : " services_offered " , " label " : " Services & Pricing " , " type " : " textarea " , " required " : true } , { " id " : " experience " , " label " : " Experience / Tools " , " type " : " textarea " , " required " : true } , { " id " : " faqs " , " label " : " FAQs " , " type " : " textarea " , " required " : false } ] } , { " id " : " step_4_review " , " title " : " Review and Submit " , " type " : " review " , " fields " : [ ] } ] } $ json $ : : jsonb , 2 , true
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
FROM roles WHERE key = ' PHOTOGRAPHER '
2026-03-21 15:17:59 +01:00
ON CONFLICT ( role_id ) WHERE is_active DO UPDATE SET schema_json = EXCLUDED . schema_json , version = EXCLUDED . version ;
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
2026-07-28 20:10:15 +05:30
-- MAKEUP_ARTIST (basic + documents + portfolio)
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
INSERT INTO onboarding_configs ( role_id , schema_json , version , is_active )
2026-07-28 20:10:15 +05:30
SELECT id , $ json $ { " portfolioModel " : " professional " , " steps " : [ { " id " : " step_1_basic " , " title " : " Basic Information " , " type " : " basic " , " fields " : [ { " id " : " first_name " , " label " : " First Name " , " type " : " text " , " required " : true , " lockAfterApproval " : true } , { " id " : " last_name " , " label " : " Last Name " , " type " : " text " , " required " : true , " lockAfterApproval " : true } , { " id " : " email " , " label " : " Email Address " , " type " : " email " , " required " : true } , { " id " : " phone " , " label " : " Mobile Number " , " type " : " tel " , " required " : true } , { " id " : " gender " , " label " : " Gender " , " type " : " select " , " required " : false , " options " : [ { " label " : " Male " , " value " : " Male " } , { " label " : " Female " , " value " : " Female " } , { " label " : " Other " , " value " : " Other " } , { " label " : " Prefer not to say " , " value " : " Prefer not to say " } ] } , { " id " : " address_line_1 " , " label " : " Address Line 1 " , " type " : " text " , " required " : true } , { " id " : " address_line_2 " , " label " : " Address Line 2 (Optional) " , " type " : " text " , " required " : false } , { " id " : " city " , " label " : " City " , " type " : " text " , " required " : true } , { " id " : " area " , " label " : " Area " , " type " : " text " , " required " : true } , { " id " : " state " , " label " : " State " , " type " : " text " , " required " : true } , { " id " : " pin_code " , " label " : " PIN Code " , " type " : " text " , " required " : false } ] } , { " id " : " step_2_documents " , " title " : " Documents " , " type " : " documents " , " fields " : [ { " id " : " aadhar_doc " , " label " : " Identity Proof " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } , { " id " : " address_proof " , " label " : " Address Proof " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } , { " id " : " professional_certifications " , " label " : " Professional Certifications " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } ] } , { " id " : " step_3_portfolio " , " title " : " My Portfolio " , " type " : " portfolio " , " fields " : [ { " id " : " about " , " label " : " About " , " type " : " textarea " , " required " : true } , { " id " : " services_offered " , " label " : " Services & Pricing " , " type " : " textarea " , " required " : true } , { " id " : " experience " , " label " : " Experience / Tools " , " type " : " textarea " , " required " : true } , { " id " : " faqs " , " label " : " FAQs " , " type " : " textarea " , " required " : false } ] } , { " id " : " step_4_review " , " title " : " Review and Submit " , " type " : " review " , " fields " : [ ] } ] } $ json $ : : jsonb , 2 , true
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
FROM roles WHERE key = ' MAKEUP_ARTIST '
2026-03-21 15:17:59 +01:00
ON CONFLICT ( role_id ) WHERE is_active DO UPDATE SET schema_json = EXCLUDED . schema_json , version = EXCLUDED . version ;
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
2026-07-28 20:10:15 +05:30
-- DEVELOPER (basic + documents + portfolio)
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
INSERT INTO onboarding_configs ( role_id , schema_json , version , is_active )
2026-07-28 20:10:15 +05:30
SELECT id , $ json $ { " portfolioModel " : " professional " , " steps " : [ { " id " : " step_1_basic " , " title " : " Basic Information " , " type " : " basic " , " fields " : [ { " id " : " first_name " , " label " : " First Name " , " type " : " text " , " required " : true , " lockAfterApproval " : true } , { " id " : " last_name " , " label " : " Last Name " , " type " : " text " , " required " : true , " lockAfterApproval " : true } , { " id " : " email " , " label " : " Email Address " , " type " : " email " , " required " : true } , { " id " : " phone " , " label " : " Mobile Number " , " type " : " tel " , " required " : true } , { " id " : " gender " , " label " : " Gender " , " type " : " select " , " required " : false , " options " : [ { " label " : " Male " , " value " : " Male " } , { " label " : " Female " , " value " : " Female " } , { " label " : " Other " , " value " : " Other " } , { " label " : " Prefer not to say " , " value " : " Prefer not to say " } ] } , { " id " : " address_line_1 " , " label " : " Address Line 1 " , " type " : " text " , " required " : true } , { " id " : " address_line_2 " , " label " : " Address Line 2 (Optional) " , " type " : " text " , " required " : false } , { " id " : " city " , " label " : " City " , " type " : " text " , " required " : true } , { " id " : " area " , " label " : " Area " , " type " : " text " , " required " : true } , { " id " : " state " , " label " : " State " , " type " : " text " , " required " : true } , { " id " : " pin_code " , " label " : " PIN Code " , " type " : " text " , " required " : false } ] } , { " id " : " step_2_documents " , " title " : " Documents " , " type " : " documents " , " fields " : [ { " id " : " aadhar_doc " , " label " : " Identity Proof " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } , { " id " : " address_proof " , " label " : " Address Proof " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } , { " id " : " tax_document " , " label " : " Tax Document " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } ] } , { " id " : " step_3_portfolio " , " title " : " My Portfolio " , " type " : " portfolio " , " fields " : [ { " id " : " about " , " label " : " About " , " type " : " textarea " , " required " : true } , { " id " : " services_offered " , " label " : " Services & Pricing " , " type " : " textarea " , " required " : true } , { " id " : " experience " , " label " : " Experience / Tools " , " type " : " textarea " , " required " : true } , { " id " : " faqs " , " label " : " FAQs " , " type " : " textarea " , " required " : false } ] } , { " id " : " step_4_review " , " title " : " Review and Submit " , " type " : " review " , " fields " : [ ] } ] } $ json $ : : jsonb , 2 , true
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
FROM roles WHERE key = ' DEVELOPER '
2026-03-21 15:17:59 +01:00
ON CONFLICT ( role_id ) WHERE is_active DO UPDATE SET schema_json = EXCLUDED . schema_json , version = EXCLUDED . version ;
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
2026-07-28 20:10:15 +05:30
-- VIDEO_EDITOR (basic + documents + portfolio)
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
INSERT INTO onboarding_configs ( role_id , schema_json , version , is_active )
2026-07-28 20:10:15 +05:30
SELECT id , $ json $ { " portfolioModel " : " professional " , " steps " : [ { " id " : " step_1_basic " , " title " : " Basic Information " , " type " : " basic " , " fields " : [ { " id " : " first_name " , " label " : " First Name " , " type " : " text " , " required " : true , " lockAfterApproval " : true } , { " id " : " last_name " , " label " : " Last Name " , " type " : " text " , " required " : true , " lockAfterApproval " : true } , { " id " : " email " , " label " : " Email Address " , " type " : " email " , " required " : true } , { " id " : " phone " , " label " : " Mobile Number " , " type " : " tel " , " required " : true } , { " id " : " gender " , " label " : " Gender " , " type " : " select " , " required " : false , " options " : [ { " label " : " Male " , " value " : " Male " } , { " label " : " Female " , " value " : " Female " } , { " label " : " Other " , " value " : " Other " } , { " label " : " Prefer not to say " , " value " : " Prefer not to say " } ] } , { " id " : " address_line_1 " , " label " : " Address Line 1 " , " type " : " text " , " required " : true } , { " id " : " address_line_2 " , " label " : " Address Line 2 (Optional) " , " type " : " text " , " required " : false } , { " id " : " city " , " label " : " City " , " type " : " text " , " required " : true } , { " id " : " area " , " label " : " Area " , " type " : " text " , " required " : true } , { " id " : " state " , " label " : " State " , " type " : " text " , " required " : true } , { " id " : " pin_code " , " label " : " PIN Code " , " type " : " text " , " required " : false } ] } , { " id " : " step_2_documents " , " title " : " Documents " , " type " : " documents " , " fields " : [ { " id " : " aadhar_doc " , " label " : " Identity Proof " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } , { " id " : " address_proof " , " label " : " Address Proof " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } , { " id " : " tax_document " , " label " : " Tax Document " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } ] } , { " id " : " step_3_portfolio " , " title " : " My Portfolio " , " type " : " portfolio " , " fields " : [ { " id " : " about " , " label " : " About " , " type " : " textarea " , " required " : true } , { " id " : " services_offered " , " label " : " Services & Pricing " , " type " : " textarea " , " required " : true } , { " id " : " experience " , " label " : " Experience / Tools " , " type " : " textarea " , " required " : true } , { " id " : " faqs " , " label " : " FAQs " , " type " : " textarea " , " required " : false } ] } , { " id " : " step_4_review " , " title " : " Review and Submit " , " type " : " review " , " fields " : [ ] } ] } $ json $ : : jsonb , 2 , true
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
FROM roles WHERE key = ' VIDEO_EDITOR '
2026-03-21 15:17:59 +01:00
ON CONFLICT ( role_id ) WHERE is_active DO UPDATE SET schema_json = EXCLUDED . schema_json , version = EXCLUDED . version ;
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
2026-07-28 20:10:15 +05:30
-- GRAPHIC_DESIGNER (basic + documents + portfolio)
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
INSERT INTO onboarding_configs ( role_id , schema_json , version , is_active )
2026-07-28 20:10:15 +05:30
SELECT id , $ json $ { " portfolioModel " : " professional " , " steps " : [ { " id " : " step_1_basic " , " title " : " Basic Information " , " type " : " basic " , " fields " : [ { " id " : " first_name " , " label " : " First Name " , " type " : " text " , " required " : true , " lockAfterApproval " : true } , { " id " : " last_name " , " label " : " Last Name " , " type " : " text " , " required " : true , " lockAfterApproval " : true } , { " id " : " email " , " label " : " Email Address " , " type " : " email " , " required " : true } , { " id " : " phone " , " label " : " Mobile Number " , " type " : " tel " , " required " : true } , { " id " : " gender " , " label " : " Gender " , " type " : " select " , " required " : false , " options " : [ { " label " : " Male " , " value " : " Male " } , { " label " : " Female " , " value " : " Female " } , { " label " : " Other " , " value " : " Other " } , { " label " : " Prefer not to say " , " value " : " Prefer not to say " } ] } , { " id " : " address_line_1 " , " label " : " Address Line 1 " , " type " : " text " , " required " : true } , { " id " : " address_line_2 " , " label " : " Address Line 2 (Optional) " , " type " : " text " , " required " : false } , { " id " : " city " , " label " : " City " , " type " : " text " , " required " : true } , { " id " : " area " , " label " : " Area " , " type " : " text " , " required " : true } , { " id " : " state " , " label " : " State " , " type " : " text " , " required " : true } , { " id " : " pin_code " , " label " : " PIN Code " , " type " : " text " , " required " : false } ] } , { " id " : " step_2_documents " , " title " : " Documents " , " type " : " documents " , " fields " : [ { " id " : " aadhar_doc " , " label " : " Identity Proof " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } , { " id " : " address_proof " , " label " : " Address Proof " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } , { " id " : " tax_document " , " label " : " Tax Document " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } ] } , { " id " : " step_3_portfolio " , " title " : " My Portfolio " , " type " : " portfolio " , " fields " : [ { " id " : " about " , " label " : " About " , " type " : " textarea " , " required " : true } , { " id " : " services_offered " , " label " : " Services & Pricing " , " type " : " textarea " , " required " : true } , { " id " : " experience " , " label " : " Experience / Tools " , " type " : " textarea " , " required " : true } , { " id " : " faqs " , " label " : " FAQs " , " type " : " textarea " , " required " : false } ] } , { " id " : " step_4_review " , " title " : " Review and Submit " , " type " : " review " , " fields " : [ ] } ] } $ json $ : : jsonb , 2 , true
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
FROM roles WHERE key = ' GRAPHIC_DESIGNER '
2026-03-21 15:17:59 +01:00
ON CONFLICT ( role_id ) WHERE is_active DO UPDATE SET schema_json = EXCLUDED . schema_json , version = EXCLUDED . version ;
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
2026-07-28 20:10:15 +05:30
-- SOCIAL_MEDIA_MANAGER (basic + documents + portfolio)
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
INSERT INTO onboarding_configs ( role_id , schema_json , version , is_active )
2026-07-28 20:10:15 +05:30
SELECT id , $ json $ { " portfolioModel " : " professional " , " steps " : [ { " id " : " step_1_basic " , " title " : " Basic Information " , " type " : " basic " , " fields " : [ { " id " : " first_name " , " label " : " First Name " , " type " : " text " , " required " : true , " lockAfterApproval " : true } , { " id " : " last_name " , " label " : " Last Name " , " type " : " text " , " required " : true , " lockAfterApproval " : true } , { " id " : " email " , " label " : " Email Address " , " type " : " email " , " required " : true } , { " id " : " phone " , " label " : " Mobile Number " , " type " : " tel " , " required " : true } , { " id " : " gender " , " label " : " Gender " , " type " : " select " , " required " : false , " options " : [ { " label " : " Male " , " value " : " Male " } , { " label " : " Female " , " value " : " Female " } , { " label " : " Other " , " value " : " Other " } , { " label " : " Prefer not to say " , " value " : " Prefer not to say " } ] } , { " id " : " address_line_1 " , " label " : " Address Line 1 " , " type " : " text " , " required " : true } , { " id " : " address_line_2 " , " label " : " Address Line 2 (Optional) " , " type " : " text " , " required " : false } , { " id " : " city " , " label " : " City " , " type " : " text " , " required " : true } , { " id " : " area " , " label " : " Area " , " type " : " text " , " required " : true } , { " id " : " state " , " label " : " State " , " type " : " text " , " required " : true } , { " id " : " pin_code " , " label " : " PIN Code " , " type " : " text " , " required " : false } ] } , { " id " : " step_2_documents " , " title " : " Documents " , " type " : " documents " , " fields " : [ { " id " : " aadhar_doc " , " label " : " Identity Proof " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } , { " id " : " address_proof " , " label " : " Address Proof " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } , { " id " : " tax_document " , " label " : " Tax Document " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } ] } , { " id " : " step_3_portfolio " , " title " : " My Portfolio " , " type " : " portfolio " , " fields " : [ { " id " : " about " , " label " : " About " , " type " : " textarea " , " required " : true } , { " id " : " services_offered " , " label " : " Services & Pricing " , " type " : " textarea " , " required " : true } , { " id " : " experience " , " label " : " Experience / Tools " , " type " : " textarea " , " required " : true } , { " id " : " faqs " , " label " : " FAQs " , " type " : " textarea " , " required " : false } ] } , { " id " : " step_4_review " , " title " : " Review and Submit " , " type " : " review " , " fields " : [ ] } ] } $ json $ : : jsonb , 2 , true
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
FROM roles WHERE key = ' SOCIAL_MEDIA_MANAGER '
2026-03-21 15:17:59 +01:00
ON CONFLICT ( role_id ) WHERE is_active DO UPDATE SET schema_json = EXCLUDED . schema_json , version = EXCLUDED . version ;
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
2026-07-28 20:10:15 +05:30
-- TUTOR (basic + documents + portfolio)
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
INSERT INTO onboarding_configs ( role_id , schema_json , version , is_active )
2026-07-28 20:10:15 +05:30
SELECT id , $ json $ { " portfolioModel " : " professional " , " steps " : [ { " id " : " step_1_basic " , " title " : " Basic Information " , " type " : " basic " , " fields " : [ { " id " : " first_name " , " label " : " First Name " , " type " : " text " , " required " : true , " lockAfterApproval " : true } , { " id " : " last_name " , " label " : " Last Name " , " type " : " text " , " required " : true , " lockAfterApproval " : true } , { " id " : " phone " , " label " : " Mobile Number " , " type " : " tel " , " required " : true } , { " id " : " location " , " label " : " City " , " type " : " text " , " required " : true } , { " id " : " state " , " label " : " State " , " type " : " text " , " required " : true } , { " id " : " subjects " , " label " : " Subjects Taught (comma separated) " , " type " : " text " , " required " : false } , { " id " : " experience_years " , " label " : " Years of Experience " , " type " : " number " , " required " : false } , { " id " : " bio " , " label " : " Short Bio " , " type " : " textarea " , " required " : false } ] } , { " id " : " step_2_documents " , " title " : " Documents " , " type " : " documents " , " fields " : [ { " id " : " aadhar_doc " , " label " : " Identity Proof " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } , { " id " : " address_proof " , " label " : " Address Proof " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } , { " id " : " qualification_proof " , " label " : " Qualification Proof " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } ] } , { " id " : " step_3_portfolio " , " title " : " My Portfolio " , " type " : " portfolio " , " fields " : [ { " id " : " about " , " label " : " About " , " type " : " textarea " , " required " : true } , { " id " : " services_offered " , " label " : " Services & Pricing " , " type " : " textarea " , " required " : true } , { " id " : " experience " , " label " : " Experience / Tools " , " type " : " textarea " , " required " : true } , { " id " : " faqs " , " label " : " FAQs " , " type " : " textarea " , " required " : false } ] } , { " id " : " step_4_review " , " title " : " Review and Submit " , " type " : " review " , " fields " : [ ] } ] } $ json $ : : jsonb , 2 , true
FROM roles WHERE key = ' TUTOR '
ON CONFLICT ( role_id ) WHERE is_active DO UPDATE SET schema_json = EXCLUDED . schema_json , version = EXCLUDED . version ;
-- FITNESS_TRAINER (basic + documents + portfolio)
INSERT INTO onboarding_configs ( role_id , schema_json , version , is_active )
SELECT id , $ json $ { " portfolioModel " : " professional " , " steps " : [ { " id " : " step_1_basic " , " title " : " Basic Information " , " type " : " basic " , " fields " : [ { " id " : " first_name " , " label " : " First Name " , " type " : " text " , " required " : true , " lockAfterApproval " : true } , { " id " : " last_name " , " label " : " Last Name " , " type " : " text " , " required " : true , " lockAfterApproval " : true } , { " id " : " phone " , " label " : " Mobile Number " , " type " : " tel " , " required " : true } , { " id " : " location " , " label " : " City " , " type " : " text " , " required " : true } , { " id " : " state " , " label " : " State " , " type " : " text " , " required " : true } , { " id " : " training_type " , " label " : " Training Type " , " type " : " select " , " required " : false , " options " : [ { " label " : " Personal Training " , " value " : " Personal Training " } , { " label " : " Group Fitness " , " value " : " Group Fitness " } , { " label " : " Yoga " , " value " : " Yoga " } , { " label " : " CrossFit " , " value " : " CrossFit " } , { " label " : " Zumba " , " value " : " Zumba " } , { " label " : " Pilates " , " value " : " Pilates " } , { " label " : " Other " , " value " : " Other " } ] } , { " id " : " experience_years " , " label " : " Years of Experience " , " type " : " number " , " required " : false } , { " id " : " bio " , " label " : " Short Bio " , " type " : " textarea " , " required " : false } ] } , { " id " : " step_2_documents " , " title " : " Documents " , " type " : " documents " , " fields " : [ { " id " : " aadhar_doc " , " label " : " Aadhar / Government ID " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } , { " id " : " certification_doc " , " label " : " Fitness Certification " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } ] } , { " id " : " step_3_portfolio " , " title " : " My Portfolio " , " type " : " portfolio " , " fields " : [ { " id " : " about " , " label " : " About " , " type " : " textarea " , " required " : true } , { " id " : " services_offered " , " label " : " Services & Pricing " , " type " : " textarea " , " required " : true } , { " id " : " experience " , " label " : " Experience / Tools " , " type " : " textarea " , " required " : true } , { " id " : " faqs " , " label " : " FAQs " , " type " : " textarea " , " required " : false } ] } , { " id " : " step_4_review " , " title " : " Review and Submit " , " type " : " review " , " fields " : [ ] } ] } $ json $ : : jsonb , 2 , true
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
FROM roles WHERE key = ' FITNESS_TRAINER '
2026-03-21 15:17:59 +01:00
ON CONFLICT ( role_id ) WHERE is_active DO UPDATE SET schema_json = EXCLUDED . schema_json , version = EXCLUDED . version ;
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
2026-07-28 20:10:15 +05:30
-- CATERING_SERVICES (basic + documents + portfolio)
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
INSERT INTO onboarding_configs ( role_id , schema_json , version , is_active )
2026-07-28 20:10:15 +05:30
SELECT id , $ json $ { " portfolioModel " : " professional " , " steps " : [ { " id " : " step_1_basic " , " title " : " Basic Information " , " type " : " basic " , " fields " : [ { " id " : " business_name " , " label " : " Business Name " , " type " : " text " , " required " : true , " lockAfterApproval " : true } , { " id " : " owner_name " , " label " : " Owner Name " , " type " : " text " , " required " : true , " lockAfterApproval " : true } , { " id " : " phone " , " label " : " Contact Number " , " type " : " tel " , " required " : true } , { " id " : " location " , " label " : " City " , " type " : " text " , " required " : true } , { " id " : " state " , " label " : " State " , " type " : " text " , " required " : true } , { " id " : " cuisine_types " , " label " : " Cuisine Types (comma separated) " , " type " : " text " , " required " : false } , { " id " : " bio " , " label " : " About Your Service " , " type " : " textarea " , " required " : false } ] } , { " id " : " step_2_documents " , " title " : " Documents " , " type " : " documents " , " fields " : [ { " id " : " aadhar_doc " , " label " : " Aadhar / Government ID " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } , { " id " : " fssai_license " , " label " : " FSSAI License " , " type " : " file " , " required " : true , " lockAfterApproval " : true , " accept " : " application/pdf,image/jpeg,image/jpg,image/png " , " maxSizeMB " : 10 , " helperText " : " JPG, PNG or PDF - Max 10MB " } ] } , { " id " : " step_3_portfolio " , " title " : " My Portfolio " , " type " : " portfolio " , " fields " : [ { " id " : " about " , " label " : " About " , " type " : " textarea " , " required " : true } , { " id " : " services_offered " , " label " : " Services & Pricing " , " type " : " textarea " , " required " : true } , { " id " : " experience " , " label " : " Experience / Tools " , " type " : " textarea " , " required " : true } , { " id " : " faqs " , " label " : " FAQs " , " type " : " textarea " , " required " : false } ] } , { " id " : " step_4_review " , " title " : " Review and Submit " , " type " : " review " , " fields " : [ ] } ] } $ json $ : : jsonb , 2 , true
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
FROM roles WHERE key = ' CATERING_SERVICES '
2026-03-21 15:17:59 +01:00
ON CONFLICT ( role_id ) WHERE is_active DO UPDATE SET schema_json = EXCLUDED . schema_json , version = EXCLUDED . version ;
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
-- ── 4. Default Dashboard Configs ─────────────────────────────────────────────
2026-04-26 23:58:43 +02:00
INSERT INTO role_sidebar_configs ( role_id , audience , config_json , version , is_active )
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
SELECT r . id ,
' EXTERNAL ' ,
jsonb_build_object (
' nav ' , CASE r . key
WHEN ' COMPANY ' THEN ' [
{ " key " : " jobs " , " label " : " My Jobs " , " path " : " /dashboard/jobs " , " icon " : " briefcase " } ,
{ " key " : " applications " , " label " : " Applications " , " path " : " /dashboard/applications " , " icon " : " users " } ,
{ " key " : " profile " , " label " : " Company Profile " , " path " : " /dashboard/profile " , " icon " : " building " }
] ' ::jsonb
WHEN ' JOB_SEEKER ' THEN ' [
{ " key " : " browse_jobs " , " label " : " Browse Jobs " , " path " : " /dashboard/jobs " , " icon " : " search " } ,
{ " key " : " my_applications " , " label " : " My Applications " , " path " : " /dashboard/applications " , " icon " : " file-text " } ,
{ " key " : " profile " , " label " : " My Profile " , " path " : " /dashboard/profile " , " icon " : " user " }
] ' ::jsonb
WHEN ' CUSTOMER ' THEN ' [
{ " key " : " requirements " , " label " : " My Requirements " , " path " : " /dashboard/requirements " , " icon " : " list " } ,
{ " key " : " profile " , " label " : " My Profile " , " path " : " /dashboard/profile " , " icon " : " user " }
] ' ::jsonb
ELSE ' [
{ " key " : " marketplace " , " label " : " Marketplace " , " path " : " /dashboard/marketplace " , " icon " : " store " } ,
{ " key " : " leads " , " label " : " My Leads " , " path " : " /dashboard/leads " , " icon " : " zap " } ,
{ " key " : " portfolio " , " label " : " Portfolio " , " path " : " /dashboard/portfolio " , " icon " : " image " } ,
{ " key " : " services " , " label " : " Services " , " path " : " /dashboard/services " , " icon " : " list " } ,
{ " key " : " wallet " , " label " : " Wallet " , " path " : " /dashboard/wallet " , " icon " : " wallet " } ,
{ " key " : " profile " , " label " : " My Profile " , " path " : " /dashboard/profile " , " icon " : " user " }
] ' ::jsonb
END ,
' enabled_modules ' , CASE r . key
WHEN ' COMPANY ' THEN ' ["jobs", "applications", "profile"] ' : : jsonb
WHEN ' JOB_SEEKER ' THEN ' ["browse_jobs", "my_applications", "profile"] ' : : jsonb
WHEN ' CUSTOMER ' THEN ' ["requirements", "profile"] ' : : jsonb
ELSE ' ["marketplace", "leads", "portfolio", "services", "wallet", "profile"] ' : : jsonb
2026-04-26 23:58:43 +02:00
END ,
' widgets ' , CASE r . key
WHEN ' COMPANY ' THEN ' ["total_jobs", "active_jobs", "pending_jobs", "applications_received", "shortlisted_candidates", "credits"] ' : : jsonb
WHEN ' JOB_SEEKER ' THEN ' ["available_jobs", "my_applications", "shortlisted", "saved_jobs", "profile_status", "portfolio"] ' : : jsonb
WHEN ' CUSTOMER ' THEN ' ["total_requirements", "open_requirements", "closed_requirements", "responses_received", "shortlisted_responses", "credits"] ' : : jsonb
ELSE ' ["open_leads", "my_requests", "accepted_requests", "tracecoins", "portfolio", "profile_status"] ' : : jsonb
END ,
' tabs ' , CASE r . key
WHEN ' COMPANY ' THEN ' ["overview"] ' : : jsonb
WHEN ' JOB_SEEKER ' THEN ' ["overview"] ' : : jsonb
WHEN ' CUSTOMER ' THEN ' ["overview"] ' : : jsonb
ELSE ' ["overview"] ' : : jsonb
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
END
) ,
1 ,
true
FROM roles r
WHERE r . audience = ' EXTERNAL '
2026-04-26 23:58:43 +02:00
ON CONFLICT ( role_id , audience ) WHERE is_active DO UPDATE SET
config_json = EXCLUDED . config_json ,
version = role_sidebar_configs . version + 1 ;
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
-- ── Done ──────────────────────────────────────────────────────────────────────
SELECT ' Seed completed successfully. ' AS status ;