obra-documents bucket and are accessible only to authenticated members of the obra’s tenant.
Document storage overview
Documents are organised in a virtual folder hierarchy under each obra. The platform tracks every upload in theobra_document_uploads table, recording who uploaded a file, when, and under which storage path. This gives you a full audit trail per obra.
Private bucket
The
obra-documents bucket is non-public. All read and write operations require an authenticated Supabase session belonging to the obra’s tenant.Upload audit log
Every uploaded file is recorded in
obra_document_uploads with uploader identity and timestamp, giving you a chronological history of documents added to each obra.Folder structure
Documents are grouped into logical folders per obra (certificates, general documentation, materials, etc.). Folders can be OCR-enabled, manual-input, or both.
Supported formats
PDFs, Excel workbooks, Word documents, and image files can be stored. OCR extraction is available for PDF and image documents in enabled folders.
Accessing documents
Documents for a specific obra are accessed from the obra detail view:Go to the Documents tab
Click the Documentos tab in the obra detail view. The documents tab loads lazily to keep the initial page fast.
Folder types
Folders for each obra are defined by your admin under Obra Defaults and can be extended with tablas-linked folders. Common default folder categories include:| Folder | Purpose |
|---|---|
| Certificados | Payment certificate documents (PDFs of certified amounts by period) |
| Certificados Extraídos | OCR-extracted certificate summaries used to auto-populate certificado_a_la_fecha |
| Documentación | General project documentation |
| Materiales | Material order forms and supplier documents |
| Planos | Architectural and engineering drawings |
| Pólizas | Insurance policy documents |
Folders linked to OCR-enabled tablas appear automatically in the documents tab for any obra that has those tablas configured. The
dataInputMethod setting on each folder controls whether users see an OCR upload button, a manual entry form, or both.Uploading documents
Upload a file
Use the file picker to select a file from your device. Drag-and-drop is also supported where your browser allows it. Accepted types include:
- PDF (
.pdf) - Excel (
.xlsx,.xls) - Word (
.docx,.doc) - Images (
.png,.jpg,.jpeg)
Document upload schema
Theobra_document_uploads table tracks every file upload:
| Column | Type | Description |
|---|---|---|
id | uuid | Primary key, auto-generated. |
obra_id | uuid | The obra this document belongs to. |
storage_bucket | text | Always obra-documents. |
storage_path | text | Full path within the bucket (unique). |
file_name | text | Original file name as uploaded. |
uploaded_by | uuid | The auth.users.id of the uploader. |
uploaded_at | timestamptz | Timestamp of the upload. |
created_at | timestamptz | Record creation timestamp. |
Storage bucket policies
Theobra-documents bucket enforces authenticated-only access at the storage layer:
obra_document_uploads table level — a user can only insert a record if:
uploaded_byequals their ownauth.uid().- The referenced obra belongs to a tenant they are a member of.
OCR-linked folders
Folders that have OCR enabled allow Sintesis to extract structured data from uploaded PDFs and images into a linked tabla. When a file is uploaded to an OCR folder:- Sintesis processes the file and extracts tabular data.
- The extracted rows are stored in the associated
obra_tabla. - If the folder is the Certificados Extraídos folder, the extracted
monto_acumuladois used to auto-suggest thecertificado_a_la_fechafield on the obra’s general tab.
