diff --git a/model/data-model-v5.18.dbml b/model/data-model-v5.18.dbml index 165f433..6b78f45 100644 --- a/model/data-model-v5.18.dbml +++ b/model/data-model-v5.18.dbml @@ -726,7 +726,6 @@ Table s3_object { Table stored_file { id uuid [pk] legal_entity_id uuid [not null, ref: > legal_entity.id, note: 'организация-владелец (выбрана при загрузке)'] - consolidation_id uuid [ref: > consolidation.id, note: 'v5.18: консолидация (период ГК), в контексте которой загружен файл — «рабочий стол консоли», общий для всех версий периода; NULL — без контекста. Пишется при загрузке; при автозамене файл без контекста наследует значение заменённого'] file_type file_type [not null] original_name varchar s3_object_id uuid [not null, ref: > s3_object.id, note: 'исходный файл в uploads'] @@ -739,6 +738,7 @@ Table stored_file { uploaded_by uuid [ref: > app_user.id] uploaded_at timestamptz updated_at timestamptz + consolidation_id uuid [ref: > consolidation.id, note: 'v5.18: консолидация (период ГК), в контексте которой загружен файл — «рабочий стол консоли», общий для всех версий периода; NULL — без контекста. Пишется при загрузке; при автозамене файл без контекста наследует значение заменённого'] Indexes { (legal_entity_id, status) (legal_entity_id, consolidation_id) [note: 'v5.18: рабочий стол консоли для ЮЛ'] diff --git a/model/diagrams/part04_files_jobs.png b/model/diagrams/part04_files_jobs.png index a69e01f..29b8b89 100644 Binary files a/model/diagrams/part04_files_jobs.png and b/model/diagrams/part04_files_jobs.png differ diff --git a/model/diagrams/part04_files_jobs.svg b/model/diagrams/part04_files_jobs.svg index 4d0fa1f..ee162ea 100644 --- a/model/diagrams/part04_files_jobs.svg +++ b/model/diagrams/part04_files_jobs.svg @@ -4,213 +4,213 @@ - - + + dbml document_type - - - -       document_type        - - -    BALANCE     - - -    INCOME     - - -    OSV     - - -    DISCLOSURE     - - -    OTHER     - + + + +       document_type        + + +    BALANCE     + + +    INCOME     + + +    OSV     + + +    DISCLOSURE     + + +    OTHER     + file_type - - - -       file_type        - - -    XLS     - - -    XLSX     - - -    XLSB     - - -    PDF     - - -    PNG     - - -    JPG     - + + + +       file_type        + + +    XLS     + + +    XLSX     + + +    XLSB     + + +    PDF     + + +    PNG     + + +    JPG     + recognition_pipeline - - - -       recognition_pipeline        - - -    tabular     - - -    image     - + + + +       recognition_pipeline        + + +    tabular     + + +    image     + period_quarter - - - -       period_quarter        - - -    Q1     - - -    Q2     - - -    Q3     - - -    Q4     - + + + +       period_quarter        + + +    Q1     + + +    Q2     + + +    Q3     + + +    Q4     + file_status - - - -       file_status        - - -    UPLOADED     - - -    PROCESSING     - - -    PROCESSED     - - -    ERROR     - - -    SUPERSEDED     - + + + +       file_status        + + +    UPLOADED     + + +    PROCESSING     + + +    PROCESSED     + + +    ERROR     + + +    SUPERSEDED     + document_status - - - -       document_status        - - -    RECOGNIZED     - - -    NEEDS_CHECK     - - -    CONFIRMED     - - -    ERROR     - + + + +       document_status        + + +    RECOGNIZED     + + +    NEEDS_CHECK     + + +    CONFIRMED     + + +    ERROR     + s3_bucket_role - - - -       s3_bucket_role        - - -    uploads     - - -    results     - - -    exports     - - -    archive     - + + + +       s3_bucket_role        + + +    uploads     + + +    results     + + +    exports     + + +    archive     + recognition_status - - - -       recognition_status        - - -    queued     - - -    published     - - -    processing     - - -    done     - - -    needs_check     - - -    error     - - -    timeout     - - -    dlq     - + + + +       recognition_status        + + +    queued     + + +    published     + + +    processing     + + +    done     + + +    needs_check     + + +    error     + + +    timeout     + + +    dlq     + document_check_result - - - -       document_check_result        - - -    MATCH     - - -    MISMATCH     - - -    UNKNOWN     - + + + +       document_check_result        + + +    MATCH     + + +    MISMATCH     + + +    UNKNOWN     + @@ -233,16 +233,16 @@ consolidation - - - -       consolidation        - - -id -     -uuid - + + + +       consolidation        + + +id +     +uuid + @@ -250,16 +250,16 @@ legal_entity - - - -       legal_entity        - - -id -     -uuid - + + + +       legal_entity        + + +id +     +uuid + @@ -267,526 +267,526 @@ s3_object - - - -       s3_object        - - -id -     -uuid - - -bucket_role     -s3_bucket_role - -(!) - - -bucket     -varchar - -(!) - - -key     -varchar - -(!) - - -content_type     -varchar - - -size_bytes     -bigint - - -sha256     -varchar - - -version_id     -varchar - - -created_by     -varchar - - -created_at     -timestamptz - -(!) - - -expires_at     -timestamptz - - -archived_to     -varchar - + + + +       s3_object        + + +id +     +uuid + + +bucket_role     +s3_bucket_role + +(!) + + +bucket     +varchar + +(!) + + +key     +varchar + +(!) + + +content_type     +varchar + + +size_bytes     +bigint + + +sha256     +varchar + + +version_id     +varchar + + +created_by     +varchar + + +created_at     +timestamptz + +(!) + + +expires_at     +timestamptz + + +archived_to     +varchar + s3_object:e->s3_bucket_role:w - + stored_file - - - -       stored_file        - - -id -     -uuid - - -legal_entity_id     -uuid - -(!) - - -consolidation_id     -uuid - - -file_type     -file_type - -(!) - - -original_name     -varchar - - -s3_object_id     -uuid - -(!) - - -content_hash     -varchar - - -size_bytes     -bigint - - -status     -file_status - -(!) - - -version_no     -int - -(!) - - -superseded_by_file_id     -uuid - - -current_recognition_job_id     -uuid - - -uploaded_by     -uuid - - -uploaded_at     -timestamptz - - -updated_at     -timestamptz - + + + +       stored_file        + + +id +     +uuid + + +legal_entity_id     +uuid + +(!) + + +file_type     +file_type + +(!) + + +original_name     +varchar + + +s3_object_id     +uuid + +(!) + + +content_hash     +varchar + + +size_bytes     +bigint + + +status     +file_status + +(!) + + +version_no     +int + +(!) + + +superseded_by_file_id     +uuid + + +current_recognition_job_id     +uuid + + +uploaded_by     +uuid + + +uploaded_at     +timestamptz + + +updated_at     +timestamptz + + +consolidation_id     +uuid + stored_file:e->file_type:w - + stored_file:e->file_status:w - + - + stored_file:e->app_user:w - - + + 1 -* +* - + stored_file:e->consolidation:w - - -1 -* + + +1 +* stored_file:e->legal_entity:w - - -1 -* + + +1 +* - + stored_file:e->s3_object:w - - -1 -* + + +1 +* - + stored_file:e->stored_file:w - - -1 -* + + +1 +* recognition_job - - - -       recognition_job        - - -id -     -uuid - - -file_id     -uuid - -(!) - - -pipeline     -recognition_pipeline - -(!) - - -request_subject     -varchar - -(!) - - -request_msg_id     -varchar - - -result_msg_id     -varchar - - -schema_version     -varchar - -(!) - - -service_name     -varchar - - -service_version     -varchar - - -status     -recognition_status - -(!) - - -attempt     -smallint - -(!) - - -max_attempts     -smallint - -(!) - - -requested_at     -timestamptz - - -published_at     -timestamptz - - -started_at     -timestamptz - - -finished_at     -timestamptz - - -reply_deadline     -timestamptz - - -external_task_id     -varchar - - -error_code     -varchar - - -error_message     -text - - -result_s3_object_id     -uuid - - -result_schema_version     -varchar - - -group_schema     -jsonb - - -metrics     -jsonb - - -fields_total     -int - - -fields_low_confidence     -int - - -fields_unrecognized     -int - + + + +       recognition_job        + + +id +     +uuid + + +file_id     +uuid + +(!) + + +pipeline     +recognition_pipeline + +(!) + + +request_subject     +varchar + +(!) + + +request_msg_id     +varchar + + +result_msg_id     +varchar + + +schema_version     +varchar + +(!) + + +service_name     +varchar + + +service_version     +varchar + + +status     +recognition_status + +(!) + + +attempt     +smallint + +(!) + + +max_attempts     +smallint + +(!) + + +requested_at     +timestamptz + + +published_at     +timestamptz + + +started_at     +timestamptz + + +finished_at     +timestamptz + + +reply_deadline     +timestamptz + + +external_task_id     +varchar + + +error_code     +varchar + + +error_message     +text + + +result_s3_object_id     +uuid + + +result_schema_version     +varchar + + +group_schema     +jsonb + + +metrics     +jsonb + + +fields_total     +int + + +fields_low_confidence     +int + + +fields_unrecognized     +int + - + stored_file:e->recognition_job:w - - -1 -* + + +1 +* document - - - -       document        - - -id -     -uuid - - -stored_file_id     -uuid - -(!) - - -legal_entity_id     -uuid - -(!) - - -document_type     -document_type - -(!) - - -osv_account_code     -varchar - - -period_year     -smallint - - -period_quarter     -period_quarter - - -is_cumulative     -boolean - - -reporting_date     -date - - -locator     -varchar - - -status     -document_status - -(!) - - -period_check     -document_check_result - - -counterparty_check     -document_check_result - - -confirmed_by     -uuid - - -confirmed_at     -timestamptz - - -created_at     -timestamptz - - -updated_at     -timestamptz - + + + +       document        + + +id +     +uuid + + +stored_file_id     +uuid + +(!) + + +legal_entity_id     +uuid + +(!) + + +document_type     +document_type + +(!) + + +osv_account_code     +varchar + + +period_year     +smallint + + +period_quarter     +period_quarter + + +is_cumulative     +boolean + + +reporting_date     +date + + +locator     +varchar + + +status     +document_status + +(!) + + +period_check     +document_check_result + + +counterparty_check     +document_check_result + + +confirmed_by     +uuid + + +confirmed_at     +timestamptz + + +created_at     +timestamptz + + +updated_at     +timestamptz + document:e->document_type:w - + document:e->period_quarter:w - + document:e->document_status:w - + document:e->document_check_result:w - + document:e->document_check_result:w - + document:e->app_user:w - + 1 -* +* document:e->legal_entity:w - - -1 -* + + +1 +* document:e->stored_file:w - - -1 -* + + +1 +* recognition_job:e->recognition_pipeline:w - + recognition_job:e->recognition_status:w - + recognition_job:e->s3_object:w - - -1 -* + + +1 +* recognition_job:e->stored_file:w - - -1 -* + + +1 +*