Skip to main content

Documents Extraction

allowed_document_child_tenancies

ColumnTypeDescription
allowed_document_child_tenancy_idint64Synthetic key: crc32("{document_id}_{allowed_tenancy_id}"). Not a database primary key.
document_idint64documents.id of the document.
allowed_tenancy_idint64tenancies.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_atdateTimeTimestamp carried from the document’s change tracking for that extraction batch.
deleted_atdateTimeSoft-delete signal from the document or related tenancy, depending on how the row was generated.

custom_document_matrix_status

ColumnTypeDescription
custom_document_matrix_status_idint64Primary key of custom_document_type_group_status_by_resources.
business_group_idint64business_groups.id via the tenancy’s company.
tenancy_idint64tenancies.id where the matrix row applies.
resource_idint64Primary key of the linked resource (company, partner, or collaborator).
resource_typestringHuman-readable kind of linked resource: e.g. Empresa, Parceiro, Colaborador, Não Vinculado (see getResourceType in the DTO).
statusstringMatrix completion status in Portuguese labels (Completo, Incompleto, Parcialmente Completo, Nenhum Salvo, etc.).
messagestringOptional status message from the matrix row.
updated_atdateTimeLast update on the source record.
deleted_atdateTimeSoft delete of the matrix row when applicable.

custom_document_matrix_status_totalizers

ColumnTypeDescription
custom_document_matrix_status_totalizer_idint64Primary key of the totalizer row.
custom_document_matrix_status_idint64Foreign key to the parent matrix row: custom_document_type_group_status_by_resources.id.
business_group_idint64business_groups.id via the parent row’s tenancy → company.
tenancy_idint64tenancies.id of the parent matrix row.
typestringInternal totalizer type code (DocumentStatusGroupByResourceTotalizerTypeEnum value).
translated_typestringHuman-oriented label for analytics, often Portuguese (and may include business-group aliases for document statuses/situations).
valuedoubleNumeric metric (e.g. count) for that breakdown.
created_atdatetimeCreation time of the totalizer row.
updated_atdatetimeLast update of the totalizer row.
deleted_atdatetimeSoft delete when applicable.

custom_tags

ColumnTypeDescription
custom_tag_idint64custom_tags.id.
business_group_idint64business_groups.id via the tag’s tenancy → company.
tenancy_idint64tenancies.id that owns the tag.
namestringTag display name.
typestringTag type/category in the application.
colorstringColor token with the bg- prefix removed from background_color (e.g. Tailwind-style class suffix).
updated_atdateTimeLast update of the tag.
deleted_atdateTimeSoft delete of the tag.

documents

ColumnTypeDescription
document_idint64documents.id.
business_group_idint64business_groups.id via the document’s company.
tenancy_idint64tenancies.id the document belongs to.
company_idint64companies.id linked through the tenancy (tenancy.company_id).
related_resource_idint64ID 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_idsstringComma-separated list of tenancy IDs the document is shared with (see DataExtractionHelper::getSharedTenanciesIds).
responsible_idsstringComma-separated responsible_users.id values for users marked responsible for the document.
custom_tag_idsstringComma-separated custom_tags.id attached to the document.
formatted_cpf_cnpjstringTax ID of the tenancy’s company, formatted for display (CPF/CNPJ).
tenancy_namestringTenancy display name.
company_alias_namestringTrade / alias name of the company (alias_name).
responsible_namesstringComma-separated names of those responsible users.
custom_tag_namesstringComma-separated tag names.
document_typestringName of the document type (document_types.name).
situationstringRaw status or situation enum value for analytics: prefers expired/archived status, otherwise non-canceled situation (see getDocumentSituationOrStatus).
internal_auditorship_statusstringInternal audit workflow status when present.
descriptionstringDocument description.
observationstringFree-text observation.
document_situationstringHuman-readable situation/status label, usually Portuguese, with optional business-group aliases for DOCUMENT_STATUS.
current_risk_typestringRisk level label (Baixo / Médio / …) when the document is expired or pending; otherwise Sem Risco.
risk_type_by_document_typestringRisk level configured on the document type (risk_level), default Sem Risco.
documentable_typestringCategory of the linked primary resource: Parceiro, Empresa, Colaborador, Veículo, Resíduo, Não Vinculado, etc.
protocol_typestringTranslated protocol situation label (or “not applicable” when there is no protocol situation).
related_resource_namestringDisplay name of that entity (name, plate for vehicles, etc.).
related_resource_activestringAtivo / Inativo for the related entity when applicable.
related_resource_companystringCompany line related to the resource (format varies by resource type).
related_resource_statestringState from the related address (or tenancy company address when no resource address).
related_resource_citystringCity from the same address logic.
share_approval_statusstringLatest document share approval status (DocumentShareHistoryEnum); defaults to approved when missing.
document_linkstringDeep link to edit the document in the web app (includes target_tenancy_id).
document_situation_linkstringWeb app list URL filtered by situation/status for drill-down.
default_days_expirationint64Days-before-expiry hint: document override or document type default.
is_auto_approvedbooleanWhether the document was auto-approved.
is_renewal_processbooleanComputed: true when renewal is required and the document is in an “in renewal” window (issued, or expired + protocoled per getIsRenewalProcess).
is_requiredbooleanWhether the document type is mandatory.
protocol_datedateTimeTimestamp of the latest protocol history entry when a protocol situation exists.
issue_datedateTimeDocument issue date.
due_datedateTimeExpiry / due date; years may be clamped to a safe range (2000–2049) by adjustDueDateInterval.
approved_atdateTimeFirst share-history created_at, or document created_at if none.
created_atdateTimeDocument creation time.
updated_atdateTimeLast update of the document.
deleted_atdateTimeSoft delete of the document.

responsible_users

ColumnTypeDescription
responsible_user_idint64responsible_users.id.
user_idint64users.id of the assigned person.
responsible_idint64Primary key of the parent entity (e.g. a document when responsible_type is the document model).
responsible_typestringFully qualified Eloquent class name of the parent model.
updated_atdateTimeIn this DTO, set to current time at extraction (not necessarily the DB updated_at).
deleted_atdateTimeSoft delete of the responsible_users row.