mirror of
https://github.com/Traceworks2023/nxtgauge-backend-rust.git
synced 2026-06-11 14:00:01 +00:00
DB:
- Add niche_tags column to ugc_content_creator_profiles (was blocking UGC service)
- Add turnaround_days and fix user_role_profile_id NOT NULL for UGC
- leads/lead_requests tables (already created in session 1)
Code:
- Add UGC_CONTENT_CREATOR to is_professional_role() to auto-create user_role_profiles
- Fix onboarding INSERT to include user_id for photographer_profiles
- Fix send_lead_request_ai to use correct customer_user_id (was self-notifying)
- Add PATCH /api/leads/:id support + mount leads at /api/* for gateway compatibility
- Fix admin_list_cases query (WHERE was using wrong params)
- Fix admin_get_case query (was using list query instead of fetch-by-id)
- Add GET /api/me in profile.rs (moved from onboarding)
- Add KB articles by ID route /api/kb/articles/id/{id}
- Rewrite reviews handlers to match actual reviews table schema
- Add public reviews router GET /api/reviews
Gateway:
- Add /api/reviews route to users service
27 lines
1.1 KiB
SQL
27 lines
1.1 KiB
SQL
-- Create the leads table (also called "requirements" in some contexts)
|
|
-- Required by RequirementRepository in crates/db/src/models/requirement.rs
|
|
CREATE TABLE IF NOT EXISTS leads (
|
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
profession_key VARCHAR(100) NOT NULL,
|
|
title VARCHAR(255) NOT NULL,
|
|
description TEXT NOT NULL DEFAULT '',
|
|
location VARCHAR(255) NOT NULL DEFAULT '',
|
|
budget_inr INT,
|
|
required_date DATE,
|
|
extra_data_json JSONB,
|
|
status VARCHAR(50) NOT NULL DEFAULT 'DRAFT',
|
|
rejection_reason TEXT,
|
|
request_count INT NOT NULL DEFAULT 0,
|
|
accepted_count INT NOT NULL DEFAULT 0,
|
|
expires_at TIMESTAMPTZ,
|
|
approved_at TIMESTAMPTZ,
|
|
approved_by UUID,
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
|
created_by_user_id UUID,
|
|
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_leads_status ON leads(status);
|
|
CREATE INDEX IF NOT EXISTS idx_leads_profession_key ON leads(profession_key);
|
|
CREATE INDEX IF NOT EXISTS idx_leads_created_by_user_id ON leads(created_by_user_id);
|
|
CREATE INDEX IF NOT EXISTS idx_leads_status_profession ON leads(status, profession_key);
|