Основные сущности и связи в PostgreSQL
id UUID PKusername str uniqueemail str uniquepassword_hash strrole enum (admin, user)is_active boolcreated_at timestamp
id UUID PKuser_id FK → Usertitle strfile_path strfile_size bigintduration intervalformat str (mp4, webm, mp3…)source enum (web, telegram, lensa)status enum (uploaded, processing, done, error)created_at timestamp
id UUID PKrecording_id FK → Recordingtext textsegments JSONB (таймкоды)language strwhisper_model strprocessing_time intervalcreated_at timestamp
id UUID PKtranscription_id FK → Transcriptiontemplate_id FK → PromptTemplatecontent JSONB (структурированный)raw_text textllm_model strstatus enum (generating, done, error)created_at timestampupdated_at timestamp
id UUID PKname strdescription strtype enum (client_survey, internal, standup, custom)system_prompt textuser_prompt textoutput_schema JSONBis_default boolcreated_at timestamp
id UUID PKprotocol_id FK → Protocolformat enum (docx, pdf, md)file_path strfile_size bigintcreated_at timestamp