Documents Extraction
allowed_document_child_tenancies
| Column | Type | Description |
|---|---|---|
allowed_document_child_tenancy_id | int64 | Synthetic key: crc32("{document_id}_{allowed_tenancy_id}"). Not a database primary key. |
document_id | int64 | documents.id of the document. |
allowed_tenancy_id | int64 | tenancies.id of a tenancy that is allowed to access the document (after partner sharing, child-tenancy recursion, and company parent-tenancy expansion per product rules). |
updated_at | dateTime | Timestamp carried from the document’s change tracking for that extraction batch. |
deleted_at | dateTime | Soft-delete signal from the document or related tenancy, depending on how the row was generated. |
custom_document_matrix_status
| Column | Type | Description |
|---|---|---|
custom_document_matrix_status_id | int64 | Primary key of custom_document_type_group_status_by_resources. |
business_group_id | int64 | business_groups.id via the tenancy’s company. |
tenancy_id | int64 | tenancies.id where the matrix row applies. |
resource_id | int64 | Primary key of the linked resource (company, partner, or collaborator). |
resource_type | string | Human-readable kind of linked resource: e.g. Empresa, Parceiro, Colaborador, Não Vinculado (see getResourceType in the DTO). |
status | string | Matrix completion status in Portuguese labels (Completo, Incompleto, Parcialmente Completo, Nenhum Salvo, etc.). |
message | string | Optional status message from the matrix row. |
updated_at | dateTime | Last update on the source record. |
deleted_at | dateTime | Soft delete of the matrix row when applicable. |
custom_document_matrix_status_totalizers
| Column | Type | Description |
|---|---|---|
custom_document_matrix_status_totalizer_id | int64 | Primary key of the totalizer row. |
custom_document_matrix_status_id | int64 | Foreign key to the parent matrix row: custom_document_type_group_status_by_resources.id. |
business_group_id | int64 | business_groups.id via the parent row’s tenancy → company. |
tenancy_id | int64 | tenancies.id of the parent matrix row. |
type | string | Internal totalizer type code (DocumentStatusGroupByResourceTotalizerTypeEnum value). |
translated_type | string | Human-oriented label for analytics, often Portuguese (and may include business-group aliases for document statuses/situations). |
value | double | Numeric metric (e.g. count) for that breakdown. |
created_at | datetime | Creation time of the totalizer row. |
updated_at | datetime | Last update of the totalizer row. |
deleted_at | datetime | Soft delete when applicable. |
custom_tags
| Column | Type | Description |
|---|---|---|
custom_tag_id | int64 | custom_tags.id. |
business_group_id | int64 | business_groups.id via the tag’s tenancy → company. |
tenancy_id | int64 | tenancies.id that owns the tag. |
name | string | Tag display name. |
type | string | Tag type/category in the application. |
color | string | Color token with the bg- prefix removed from background_color (e.g. Tailwind-style class suffix). |
updated_at | dateTime | Last update of the tag. |
deleted_at | dateTime | Soft delete of the tag. |
documents
| Column | Type | Description |
|---|---|---|
document_id | int64 | documents.id. |
business_group_id | int64 | business_groups.id via the document’s company. |
tenancy_id | int64 | tenancies.id the document belongs to. |
company_id | int64 | companies.id linked through the tenancy (tenancy.company_id). |
related_resource_id | int64 | ID of the related entity: documentable_id for the main link, or partner_id when the document is tied via contract instead of documentable. |
shared_with_tenancy_ids | string | Comma-separated list of tenancy IDs the document is shared with (see DataExtractionHelper::getSharedTenanciesIds). |
responsible_ids | string | Comma-separated responsible_users.id values for users marked responsible for the document. |
custom_tag_ids | string | Comma-separated custom_tags.id attached to the document. |
formatted_cpf_cnpj | string | Tax ID of the tenancy’s company, formatted for display (CPF/CNPJ). |
tenancy_name | string | Tenancy display name. |
company_alias_name | string | Trade / alias name of the company (alias_name). |
responsible_names | string | Comma-separated names of those responsible users. |
custom_tag_names | string | Comma-separated tag names. |
document_type | string | Name of the document type (document_types.name). |
situation | string | Raw status or situation enum value for analytics: prefers expired/archived status, otherwise non-canceled situation (see getDocumentSituationOrStatus). |
internal_auditorship_status | string | Internal audit workflow status when present. |
description | string | Document description. |
observation | string | Free-text observation. |
document_situation | string | Human-readable situation/status label, usually Portuguese, with optional business-group aliases for DOCUMENT_STATUS. |
current_risk_type | string | Risk level label (Baixo / Médio / …) when the document is expired or pending; otherwise Sem Risco. |
risk_type_by_document_type | string | Risk level configured on the document type (risk_level), default Sem Risco. |
documentable_type | string | Category of the linked primary resource: Parceiro, Empresa, Colaborador, Veículo, Resíduo, Não Vinculado, etc. |
protocol_type | string | Translated protocol situation label (or “not applicable” when there is no protocol situation). |
related_resource_name | string | Display name of that entity (name, plate for vehicles, etc.). |
related_resource_active | string | Ativo / Inativo for the related entity when applicable. |
related_resource_company | string | Company line related to the resource (format varies by resource type). |
related_resource_state | string | State from the related address (or tenancy company address when no resource address). |
related_resource_city | string | City from the same address logic. |
share_approval_status | string | Latest document share approval status (DocumentShareHistoryEnum); defaults to approved when missing. |
document_link | string | Deep link to edit the document in the web app (includes target_tenancy_id). |
document_situation_link | string | Web app list URL filtered by situation/status for drill-down. |
default_days_expiration | int64 | Days-before-expiry hint: document override or document type default. |
is_auto_approved | boolean | Whether the document was auto-approved. |
is_renewal_process | boolean | Computed: true when renewal is required and the document is in an “in renewal” window (issued, or expired + protocoled per getIsRenewalProcess). |
is_required | boolean | Whether the document type is mandatory. |
protocol_date | dateTime | Timestamp of the latest protocol history entry when a protocol situation exists. |
issue_date | dateTime | Document issue date. |
due_date | dateTime | Expiry / due date; years may be clamped to a safe range (2000–2049) by adjustDueDateInterval. |
approved_at | dateTime | First share-history created_at, or document created_at if none. |
created_at | dateTime | Document creation time. |
updated_at | dateTime | Last update of the document. |
deleted_at | dateTime | Soft delete of the document. |
responsible_users
| Column | Type | Description |
|---|---|---|
responsible_user_id | int64 | responsible_users.id. |
user_id | int64 | users.id of the assigned person. |
responsible_id | int64 | Primary key of the parent entity (e.g. a document when responsible_type is the document model). |
responsible_type | string | Fully qualified Eloquent class name of the parent model. |
updated_at | dateTime | In this DTO, set to current time at extraction (not necessarily the DB updated_at). |
deleted_at | dateTime | Soft delete of the responsible_users row. |