Добавляет endpoint для приёма заявок на пилот (lead-gen).
INSERT в pilot_requests, response {id, created_at, status}.
Telegram-уведомление — TODO (creds не настроены, #307 SF-B3).
Migration: data/sql/118_pilot_requests.sql
21 lines
655 B
PL/PgSQL
21 lines
655 B
PL/PgSQL
BEGIN;
|
|
|
|
CREATE TABLE IF NOT EXISTS pilot_requests (
|
|
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
name text NOT NULL,
|
|
phone text,
|
|
email text,
|
|
company text,
|
|
message text,
|
|
source text, -- 'landing', 'analyze_page', etc
|
|
user_agent text,
|
|
created_at timestamptz NOT NULL DEFAULT NOW(),
|
|
notified_at timestamptz -- when Telegram sent
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS pilot_requests_created_idx
|
|
ON pilot_requests (created_at DESC);
|
|
|
|
COMMENT ON TABLE pilot_requests IS '#307 SF-B3 lead generation, опционально notified в Telegram.';
|
|
|
|
COMMIT;
|