> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nekt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# BuildMate as a data source

> Bring stock, requisitions, kits, inventories, purchase orders, PPE and tools from BuildMate to Nekt.

BuildMate is a construction-site management system integrated with Sienge. It controls the warehouse of each site (cost center): supplies and stock, requisitions and kits, budget tasks (apropriações), inventories, purchase orders, personal protective equipment (PPE/EPI) and tools. The Nekt connector extracts all of it into your Catalog.

## Before you start

The connector reads BuildMate with the **e-mail and password of a BuildMate user**, the same login used in the BuildMate app. The data it extracts is what that user sees:

* only the **cost centers** the user has access to (a main administrator sees all of them);
* only the **modules** enabled for the user and the company (for example, the PPE streams need the PPE module and the tool streams need the tools module).

We recommend a dedicated, active user with read access to every cost center and module you want in Nekt.

## Configuring BuildMate as a Source

In the [Sources](https://app.nekt.ai/sources) tab, click on the "Add source" button located on the top right of your screen. Then, select the BuildMate option from the list of connectors.

Click **Next** and you'll be prompted to add your access.

### 1. Add account access

The following configurations are available:

* **E-mail**: The e-mail of the BuildMate user.
* **Password**: The password of that user.
* **Cost center IDs**: (Advanced, optional) Read only these cost centers, by their BuildMate ID or their Sienge code (for example `101`). Leave it empty to read every cost center the user can access. A value that matches no cost center the user can access makes the run fail with that value in the log.

Once you're done, click **Next**.

### 2. Select streams

Choose which data streams you want to sync. For faster extractions, select only the streams that are relevant to your analysis.

> Tip: The stream can be found more easily by typing its name.

Select the streams and click **Next**.

### 3. Configure data streams

Customize how you want your data to appear in your catalog. Select the desired layer where the data will be placed, a folder to organize it inside the layer, a name for each table (which will effectively contain the fetched data) and the type of sync.

* **Layer**: choose between the existing layers on your catalog. This is where you will find your new extracted tables as the extraction runs successfully.
* **Folder**: a folder can be created inside the selected layer to group all tables being created from this new data source.
* **Table name**: we suggest a name, but feel free to customize it. You have the option to add a **prefix** to all tables at once and make this process faster!
* **Sync Type**: every BuildMate stream is FULL\_TABLE. BuildMate does not let the connector ask only for what changed, and records change after they are created (a requisition is approved, a PPE item is returned, a unit goes to maintenance), so each run reads the current state of everything.

Once you are done configuring, click **Next**.

### 4. Configure data source

Describe your data source for easy identification within your organization, not exceeding 140 characters.

To define your [Trigger](https://docs.nekt.com/runs/scheduling-and-triggers.md), consider how often you want data to be extracted from this source. A daily run is usually enough. Each run opens every requisition and every inventory to read their lines (about 17 extra minutes per 10,000 requisitions), so it takes longer on accounts with many requisitions.

Optionally, you can define some additional settings:

* Configure Delta Log Retention and determine for how long we should store old states of this table as it gets updated. Read more about this resource [here](https://docs.nekt.com/get-started/core-concepts/resource-control).
* An **Additional [Full Sync](https://docs.nekt.com/get-started/core-concepts/types-of-sync#additional-full-sync)** is not needed: every run is already a full read.

Once you are ready, click **Next** to finalize the setup.

### 5. Check your new source

You can view your new source on the [Sources](https://app.nekt.ai/sources) page. If needed, manually trigger the source extraction by clicking on the arrow button. Once executed, your data will appear in your Catalog.

> [!WARNING]
>
> For you to be able to see it on your [Catalog](https://app.nekt.ai/catalog), you need at least one successful source run.

# Streams and Fields

## Available streams

The table below lists every stream, its **slug** (the exact identifier to pass when creating the source via API) and a short description.

| Stream | Slug | Description |
| - | - | - |
| Cost centers | `cost_centers` | Construction sites (cost centers) the user can access. |
| Products (supplies) | `products` | Supplies of each cost center: stock, reserved quantity, minimum stock, average cost, ABC curve, PPE flag. |
| Kits | `kits` | Active kits (sets of supplies requested together) and their structures. |
| Kit products | `kit_products` | The supplies of each kit, with quantity and budget task. |
| Requisitions | `orders` | Requisitions of every status (pending, approved, refused, supplied), with requester and collaborator. |
| Requisition items | `order_items` | The lines of each requisition: loose supplies and the supplies of its kits. |
| Tasks | `tasks` | Budget tasks (apropriações) synced from Sienge. |
| Task appropriations | `task_appropriations` | Supplies appropriated to each task, with budgeted and reserved quantity. |
| Inventories | `inventories` | Stock counts, with status, type, responsible and approver. |
| Inventory items | `inventory_items` | Items of each inventory: stock in the system and stock counted. |
| Purchase order items | `purchase_order_items` | Items of the Sienge purchase orders of each cost center, with invoices and delivery schedule. |
| PPE deliveries | `epi_deliveries` | PPE delivery sheets, with collaborator, status and signatures. |
| PPE delivery items | `epi_delivery_items` | PPE items of each delivery sheet, with CA number and return data. |
| PPE pending returns | `epi_pending_returns` | PPE items that must be returned and were not yet (current situation). |
| PPE trainings | `epi_trainings` | Safety trainings, with type and expiration date. |
| PPE training participants | `epi_training_participants` | Collaborators who took part in each training. |
| PPE training types | `epi_training_type_options` | The company's training types. |
| PPE matrices | `epi_matrices` | Which PPE each job function must receive. |
| PPE matrix items | `epi_matrix_items` | The PPE required by each matrix. |
| Tool models | `tool_models` | Tool and equipment models, with the number of units. |
| Tool units | `tool_units` | Physical units of each cost center, with status and current holder. |
| Tool suppliers | `tool_suppliers` | Rental and maintenance suppliers. |
| Tool usage history | `tool_usage_history` | Deliveries and returns of tool units. |
| Tool maintenance history | `tool_maintenance_history` | Tool movements that went through maintenance, with cost and supplier. |

Small nested objects are split into their own columns (for example `cost_center_name`). Lists that are not a stream of their own are stored as JSON text, for example `json_extract_scalar(nfs, '$[0].number')`. Money and quantities are decimal numbers.

> [!NOTE]
>
> **Products**: BuildMate returns the supplies with stock, plus the supplies at or below a configured minimum stock (including those at zero). A supply with zero stock and **no minimum stock** is not returned by BuildMate, so it leaves the `products` table.

> [!NOTE]
>
> **Current lists**: `kits` has only active kits, and `epi_pending_returns` only items not yet returned. When a kit is replaced by a new version or an item is returned, it leaves those tables on the next run. Requisition lines keep the kit ID and name, and `epi_delivery_items` keeps the return data.

> [!NOTE]
>
> **Cost centers the user cannot open**: in the streams read per cost center (`purchase_order_items`, `tool_units`, `tool_usage_history`), a cost center where the user has no access to that data is skipped, and the run log names the skipped cost centers; their rows are not in that table. If the user has no access in any cost center, or BuildMate refuses a stream for another reason (for example a module the company does not have), that stream fails with BuildMate's message in the run log and the other streams are still extracted.
>
> If a list cannot be read consistently after a few attempts, or BuildMate returns an unexpected response, the stream fails instead of saving a partial table. A requisition or inventory deleted while the sync runs is skipped with a warning.

## Fields by stream

> [accordion] Cost centers
>
> Stream name: `cost_centers`. One row per cost center (construction site) the user can access.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | String | Unique identifier (UUID) of the cost center (construction site). |
> | `name` | String | Name of the cost center. |
> | `external_id` | Integer | Code of the cost center in Sienge. |
> | `cnpj` | String | CNPJ (Brazilian company tax id) of the cost center, when set. |
> | `building_appropriation_level` | Integer | Appropriation level: 0 site, 1 building cell, 2 stage, 3 sub-stage, 4 service. |
> | `build_mate_price` | Number | BuildMate price configured for the cost center (returned only to main administrators). |
> | `active` | Boolean | Whether the cost center is active. |

> [accordion] Products (supplies)
>
> Stream name: `products`. One row per supply of a cost center, with stock, costs and ABC curve.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | String | Unique identifier (UUID) of the supply in this cost center. |
> | `cost_center_id` | String | Cost center (construction site) the supply belongs to. |
> | `external_id` | Integer | Code of the supply (resource) in Sienge. |
> | `description` | String | Name of the supply. |
> | `detail_id` | Integer | Sienge id of the supply detail. |
> | `detail_description` | String | Supply detail (e.g. size or packaging). |
> | `detail_code` | String | Code of the supply detail. |
> | `trademark_id` | Integer | Sienge id of the brand. |
> | `trademark_description` | String | Brand of the supply. |
> | `unit_of_measure` | String | Unit of measure (e.g. SC, M3, UN). |
> | `category` | String | Category of the supply. |
> | `resource_code` | String | Resource code of the supply. |
> | `bar_code` | String | Bar code of the supply. |
> | `quantity` | Number | Quantity in stock. |
> | `reserved_quantity` | Number | Quantity reserved by pending requisitions. |
> | `minimum_stock` | Number | Minimum stock configured for the supply. |
> | `unit_price` | Number | Unit price (BRL). |
> | `total_price` | Number | Total price (BRL). |
> | `average_price` | Number | Average cost (BRL). |
> | `total_cost` | Number | Total cost of the quantity in stock (BRL). |
> | `percentage_stock` | Number | Share of the supply in the total stock value (%). |
> | `cumulative_percentage_stock` | Number | Cumulative share used for the ABC curve (%). |
> | `curve` | String | ABC curve class of the supply (A, B or C). |
> | `orcado_obra` | Boolean | True when the supply is budgeted for the site; false when it is warehouse stock. |
> | `sheet_item_id` | Integer | Budget sheet item id in Sienge. |
> | `sheet_item_wbs_code` | String | WBS code of the budget sheet item. |
> | `building_unit_id` | Integer | Sienge building unit id. |
> | `appropriations_building_unit_id` | Integer | Building unit id of the appropriations. |
> | `appropriations_sheet_item_id` | Integer | Budget sheet item id of the appropriations. |
> | `location` | String | Location in the warehouse. |
> | `lot` | String | Lot of the supply. |
> | `is_epi` | Boolean | Whether the supply is personal protective equipment (PPE/EPI). |
> | `epi_control_type` | String | PPE control type: CONSUMPTION or RETURN (must be returned). |
> | `active` | Boolean | Whether the supply is active. |
> | `created_at` | Datetime | When the record was created in BuildMate. |
> | `updated_at` | Datetime | When the record was last updated in BuildMate. |
> | `deleted_at` | Datetime | When the record was soft-deleted (null while active). |

> [accordion] Kits
>
> Stream name: `kits`. One row per active kit.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | String | Unique identifier (UUID) of the kit. |
> | `name` | String | Name of the kit. |
> | `cost_center_id` | String | Cost center (construction site) of the kit. |
> | `cost_center_name` | String | Name of the cost center. |
> | `parent_id` | String | Id of the original kit when this kit is a new version of it. |
> | `version_kit` | Integer | Version number of the kit (0 for the initial version). |
> | `active` | Boolean | Whether the kit is active. |
> | `consumption` | String | Structures with consumption over total structures (e.g. 1/2). |
> | `has_consumption` | Boolean | True when at least one structure of the kit had consumption. |
> | `structures` | String (JSON) | Structures (e.g. building floors) of the kit (JSON array). |
> | `group_structures` | String (JSON) | Structure groups with their ranges (JSON array). |
> | `orders_kits` | String (JSON) | Links between the kit and requisitions (JSON array). |

> [accordion] Kit products
>
> Stream name: `kit_products`. One row per supply in a kit.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `kit_id`, `line_key`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `kit_id` | String | Kit the line belongs to. |
> | `line_key` | String | Identity of the line inside the kit: product\|task\|unit of movement (#n when repeated). |
> | `cost_center_id` | String | Cost center of the kit. |
> | `quantity` | Number | Quantity of the supply in the kit. |
> | `product_id` | String | Supply (product) id. |
> | `product_external_id` | Integer | Code of the supply in Sienge. |
> | `product_description` | String | Name of the supply. |
> | `product_detail_description` | String | Supply detail. |
> | `product_trademark_description` | String | Brand of the supply. |
> | `product_unit_of_measure` | String | Unit of measure of the supply. |
> | `product_category` | String | Category of the supply. |
> | `product_unit_price` | Number | Unit price of the supply (BRL). |
> | `product_is_epi` | Boolean | Whether the supply is PPE (EPI). |
> | `task_id` | String | Budget task (appropriation) the supply is charged to. |
> | `task_external_id` | Integer | Sienge id of the task. |
> | `task_description` | String | Description of the task. |
> | `task_wbs_code` | String | WBS code of the task. |
> | `unit_of_movement_id` | String | Movement unit used for the quantity, when not the default. |
> | `unit_of_movement_symbol` | String | Symbol of the movement unit (e.g. CX). |
> | `unit_of_movement_description` | String | Description of the movement unit. |
> | `unit_of_movement_conversion_factor` | Number | Conversion factor of the movement unit. |

> [accordion] Requisitions
>
> Stream name: `orders`. One row per requisition, of every status.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | String | Unique identifier (UUID) of the requisition. |
> | `id_number` | Integer | Sequential, human-friendly number of the requisition. |
> | `type` | Integer | Requisition type: 1 supplies, 2 kits, 3 inventory. |
> | `type_label` | String | Requisition type label (Insumos, Kits, Inventário). |
> | `status` | Integer | Status: 1 pending, 2 approved, 3 refused, 4 supplied. |
> | `status_label` | String | Status label (Pendente, Aprovado, Recusado, Abastecido). |
> | `cost_center_id` | String | Cost center (construction site) of the requisition. |
> | `cost_center_name` | String | Name of the cost center. |
> | `cost_center_external_id` | Integer | Code of the cost center in Sienge. |
> | `requester_id` | String | BuildMate user who made the requisition. |
> | `requester_name` | String | Name of the requester. |
> | `collaborator_id` | String | Collaborator who picks up the material. |
> | `collaborator_name` | String | Name of the collaborator. |
> | `note` | String | Note of the requisition. |
> | `sienge_count_id` | Integer | Related Sienge count id. |
> | `date_of_need` | Datetime | Date the materials are needed. |
> | `has_associate_kit` | Boolean | Whether the requisition has a complement kit. |
> | `date_approved` | Datetime | When the requisition was approved. |
> | `requester_approved_id` | String | User who approved the requisition. |
> | `approval_note` | String | Approval note. |
> | `date_refuse` | Datetime | When the requisition was refused. |
> | `requester_refuse_id` | String | User who refused the requisition. |
> | `refuse_note` | String | Refusal note. |
> | `kit_names` | Array (strings) | Names of the kits in the requisition. |
> | `count_kits` | Integer | Number of (non-deleted) kits in the requisition. |
> | `count_products` | Integer | Number of (non-deleted) loose supplies in the requisition. |
> | `active` | Boolean | Whether the requisition is active. |
> | `created_at` | Datetime | When the requisition was created. |
> | `updated_at` | Datetime | When the requisition was last updated. |
> | `deleted_at` | Datetime | When the requisition was soft-deleted. |

> [accordion] Requisition items
>
> Stream name: `order_items`. One row per line of a requisition: loose supplies and the supplies of its kits.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `order_id`, `line_key`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `order_id` | String | Requisition the line belongs to. |
> | `line_key` | String | Identity of the line in the requisition: 'product\|\<product>\|\<task>\|\<unit>' for loose supplies, 'kit\|\<kit>\|\<structure>\|\<kit line>' for kit supplies (#n when repeated). |
> | `item_source` | String | 'product' for a loose supply, 'kit' for a supply that came in a kit. |
> | `cost_center_id` | String | Cost center of the requisition. |
> | `order_updated_at` | Datetime | Last update of the requisition when the line was read. |
> | `quantity` | Number | Quantity requested (for kit lines: quantity of the supply in one kit). |
> | `quantity_appropriation` | Number | Budgeted quantity of the supply for the task (loose lines; 0 if none). |
> | `kit_id` | String | Kit of the line (kit lines). |
> | `kit_name` | String | Name of the kit (kit lines). |
> | `kit_product_id` | String | Id of the supply line inside the kit (kit lines). |
> | `structure_id` | String | Kit structure requested, e.g. a building floor (kit lines). |
> | `structure_name` | String | Name of the kit structure (kit lines). |
> | `product_id` | String | Supply (product) requested. |
> | `product_external_id` | Integer | Code of the supply in Sienge. |
> | `product_description` | String | Name of the supply. |
> | `product_detail_description` | String | Supply detail. |
> | `product_trademark_description` | String | Brand of the supply. |
> | `product_unit_of_measure` | String | Unit of measure of the supply. |
> | `product_category` | String | Category of the supply. |
> | `task_id` | String | Budget task (appropriation) the supply is charged to. |
> | `task_external_id` | Integer | Sienge id of the task. |
> | `task_description` | String | Description of the task. |
> | `task_wbs_code` | String | WBS code of the task. |
> | `unit_of_movement_id` | String | Movement unit used for the quantity, when not the default. |
> | `unit_of_movement_symbol` | String | Symbol of the movement unit (e.g. CX). |
> | `unit_of_movement_description` | String | Description of the movement unit. |
> | `unit_of_movement_conversion_factor` | Number | Conversion factor of the movement unit. |

> [accordion] Tasks (apropriações)
>
> Stream name: `tasks`. One row per budget task synced from Sienge.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | String | Unique identifier (UUID) of the task. |
> | `cost_center_id` | String | Cost center (construction site) of the task. |
> | `external_id` | Integer | Id of the task in Sienge. |
> | `wbs_code` | String | WBS code of the task. |
> | `work_item_id` | Integer | Sienge work item id. |
> | `description` | String | Description of the task. |
> | `unit_of_measure` | String | Unit of measure of the task. |
> | `quantity` | Number | Budgeted quantity. |
> | `unit_price` | Number | Budgeted unit price (BRL). |
> | `total_price` | Number | Budgeted total price (BRL). |
> | `sheet_id` | Integer | Budget sheet id in Sienge. |
> | `sheet_description` | String | Budget sheet description. |
> | `active` | Boolean | Whether the task is active. |
> | `created_at` | Datetime | When the record was created in BuildMate. |
> | `updated_at` | Datetime | When the record was last updated in BuildMate. |
> | `deleted_at` | Datetime | When the record was soft-deleted (null while active). |

> [accordion] Task appropriations
>
> Stream name: `task_appropriations`. One row per supply appropriated to a task.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | String | Unique identifier (UUID) of the appropriation. |
> | `task_id` | String | Task the supply is appropriated to. |
> | `product_id` | String | Supply (product) appropriated. |
> | `cost_center_id` | String | Cost center of the task. |
> | `building_unit_id` | Integer | Sienge building unit id. |
> | `sheet_item_id` | Integer | Budget sheet item id in Sienge. |
> | `cost_estimation_item_reference` | String | Reference of the cost estimation item. |
> | `quantity` | Number | Budgeted quantity of the supply for the task. |
> | `reserved_quantity` | Number | Quantity already reserved by requisitions. |
> | `active` | Boolean | Whether the appropriation is active. |
> | `created_at` | Datetime | When the record was created in BuildMate. |
> | `updated_at` | Datetime | When the record was last updated in BuildMate. |
> | `deleted_at` | Datetime | When the record was soft-deleted (null while active). |

> [accordion] Inventories
>
> Stream name: `inventories`. One row per inventory (stock count).
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | String | Unique identifier (UUID) of the inventory. |
> | `cost_center_id` | String | Cost center (construction site) of the inventory. |
> | `status` | String | Status: GENERATING\_REPORT, FAILED\_TO\_GENERATE\_REPORT, PENDING, APPROVED, REJECTED. |
> | `status_label` | String | Status label in Portuguese. |
> | `inventory_type` | String | Inventory type: complete, random or specific. |
> | `inventory_date` | Datetime | Date of the inventory count. |
> | `approval_date` | Datetime | When the inventory was approved. |
> | `responsible_id` | String | Collaborator responsible for the count. |
> | `responsible_name` | String | Name of the responsible collaborator. |
> | `approved_by_id` | String | Collaborator who approved the inventory. |
> | `approver_name` | String | Name of the approver. |
> | `created_by_adm_id` | String | BuildMate user who created the inventory. |
> | `stock_location` | String | Stock location counted. |
> | `observation` | String | Observation of the inventory. |
> | `inventory_config` | String (JSON) | Configuration of the inventory type (JSON object). |
> | `count_items` | Integer | Number of items in the inventory. |
> | `created_at` | Datetime | When the inventory was created. |
> | `updated_at` | Datetime | When the inventory was last updated. |

> [accordion] Inventory items
>
> Stream name: `inventory_items`. One row per item counted in an inventory.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `inventory_report_id`, `id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | Integer | Identifier of the inventory item. |
> | `inventory_report_id` | String | Inventory the item belongs to. |
> | `cost_center_id` | String | Cost center of the inventory. |
> | `product_id` | String | Supply (product) counted. |
> | `task_id` | String | Task of the item (only in 'specific' inventories). |
> | `current_stock` | Number | Stock in the system when the inventory was taken. |
> | `new_stock` | Number | Stock physically counted. |
> | `new_average_unit_price` | Number | New average unit price informed in the count (BRL). |
> | `product_external_id` | Integer | Code of the supply in Sienge. |
> | `product_description` | String | Name of the supply. |
> | `product_detail_description` | String | Supply detail. |
> | `product_unit_of_measure` | String | Unit of measure of the supply. |
> | `task_description` | String | Description of the task. |
> | `task_wbs_code` | String | WBS code of the task. |
> | `task_sheet_description` | String | Budget sheet of the task. |

> [accordion] Purchase order items
>
> Stream name: `purchase_order_items`. One row per purchase-order item synced from Sienge.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | String | Unique identifier (UUID) of the purchase-order item. |
> | `cost_center_id` | String | Cost center (construction site) the item was read for. |
> | `purchase_order_id` | String | Purchase order the item belongs to. |
> | `external_id` | Integer | Item number in Sienge. |
> | `resource_id` | Integer | Sienge resource (supply) id. |
> | `resource_description` | String | Name of the supply. |
> | `detail_description` | String | Supply detail. |
> | `trademark_description` | String | Brand of the supply. |
> | `quantity` | Number | Quantity ordered. |
> | `unit_price` | Number | Unit price (BRL). |
> | `unit_of_measure` | String | Unit of measure. |
> | `purchase_order_external_id` | Integer | Purchase order number in Sienge. |
> | `purchase_order_date` | Datetime | Date of the purchase order. |
> | `purchase_order_status_label` | String | Purchase order status: Pendente, Parcialmente entregue, Totalmente entregue or Cancelado. |
> | `purchase_order_supplier_id` | Integer | Supplier id in Sienge. |
> | `purchase_order_authorized_at` | Datetime | When the purchase order was authorized. |
> | `nfs` | String (JSON) | Invoices (notas fiscais) delivered for the item, by delivery date (JSON array). |
> | `schedules` | String (JSON) | Delivery schedule of the item, by scheduled date (JSON array). |
> | `created_at` | Datetime | When the item was created in BuildMate. |
> | `modified_at` | Datetime | When the item was last modified. |

> [accordion] PPE deliveries
>
> Stream name: `epi_deliveries`. One row per PPE delivery sheet.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | String | Unique identifier (UUID) of the delivery sheet. |
> | `id_number` | Integer | Sequential number of the delivery sheet. |
> | `company_id` | String | Company of the sheet. |
> | `cost_center_id` | String | Cost center (construction site) of the sheet. |
> | `cost_center_name` | String | Name of the cost center. |
> | `collaborator_id` | String | Collaborator who received the PPE. |
> | `collaborator_name` | String | Name of the collaborator. |
> | `collaborator_cpf` | String | CPF of the collaborator. |
> | `collaborator_matricula` | String | Registration number (matrícula) of the collaborator. |
> | `collaborator_function` | String | Job function of the collaborator. |
> | `collaborator_company` | String | Company of the collaborator (third parties). |
> | `responsible_adm_id` | String | BuildMate user responsible for the delivery. |
> | `responsible_adm_name` | String | Name of the responsible user. |
> | `status` | String | Status: PENDING, ACTIVE, RETURNED, EXPIRED or CANCELLED. |
> | `has_training` | Boolean | Whether the collaborator had training. |
> | `training_date` | Datetime | Date of the training. |
> | `training_responsible` | String | Who gave the training. |
> | `terms_text` | String | Terms accepted by the collaborator. |
> | `terms_version` | String | Version of the terms. |
> | `terms_accepted` | Boolean | Whether the terms were accepted. |
> | `collaborator_signature_type` | String | How the collaborator signed. |
> | `collaborator_selfie_url` | String | URL of the collaborator's selfie. |
> | `collaborator_signature_url` | String | URL of the collaborator's signature. |
> | `collaborator_signed_at` | Datetime | When the collaborator signed. |
> | `collaborator_signature_lat` | Number | Latitude of the collaborator's signature. |
> | `collaborator_signature_lng` | Number | Longitude of the collaborator's signature. |
> | `collaborator_device_info` | String | Device of the collaborator's signature. |
> | `responsible_signature_type` | String | How the responsible signed. |
> | `responsible_selfie_url` | String | URL of the responsible's selfie. |
> | `responsible_signature_url` | String | URL of the responsible's signature. |
> | `responsible_signed_at` | Datetime | When the responsible signed. |
> | `responsible_signature_lat` | Number | Latitude of the responsible's signature. |
> | `responsible_signature_lng` | Number | Longitude of the responsible's signature. |
> | `responsible_device_info` | String | Device of the responsible's signature. |
> | `note` | String | Note of the delivery sheet. |
> | `pdf_file_url` | String | URL of the sheet's PDF. |
> | `created_at` | Datetime | When the sheet was created. |
> | `updated_at` | Datetime | When the sheet was last updated. |
> | `deleted_at` | Datetime | When the sheet was soft-deleted. |

> [accordion] PPE delivery items
>
> Stream name: `epi_delivery_items`. One row per PPE item delivered.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | String | Unique identifier (UUID) of the delivered PPE item. |
> | `epi_delivery_id` | String | Delivery sheet the item belongs to. |
> | `epi_certificate_id` | String | Approval certificate (CA) record of the PPE. |
> | `ca_number` | String | Approval certificate (CA) number of the PPE. |
> | `description` | String | Description of the PPE. |
> | `product_id` | String | Supply (product) delivered. |
> | `control_type` | String | CONSUMPTION, or RETURN when the item must be returned. |
> | `quantity` | Integer | Quantity delivered. |
> | `unit_of_measure` | String | Unit of measure. |
> | `lot_number` | String | Lot number. |
> | `manufacturer` | String | Manufacturer. |
> | `condition` | String | Condition of the item at delivery. |
> | `control_number` | String | Control number of the item. |
> | `task_id` | String | Budget task the item is charged to. |
> | `expected_return_date` | Datetime | When the item is expected back. |
> | `return_date` | Datetime | Return date informed. |
> | `returned_at` | Datetime | When the return was registered. |
> | `return_condition` | String | Condition when returned: GOOD, DAMAGED or DISCARDED. |
> | `return_note` | String | Note about the return. |
> | `batch_id` | String | Batch the delivery item was registered in. |
> | `signature_url` | String | URL of the collaborator's signature for the item. |
> | `signed_at` | Datetime | When the item was signed for. |
> | `signature_lat` | Number | Latitude where the item was signed. |
> | `signature_lng` | Number | Longitude where the item was signed. |
> | `signature_device_info` | String | Device used to sign. |
> | `created_at` | Datetime | When the item was created. |
> | `updated_at` | Datetime | When the item was last updated. |
> | `cost_center_id` | String | Cost center of the delivery sheet. |
> | `collaborator_id` | String | Collaborator of the delivery sheet. |

> [accordion] PPE pending returns
>
> Stream name: `epi_pending_returns`. One row per PPE item that must be returned and was not yet.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | String | Unique identifier (UUID) of the delivered PPE item. |
> | `epi_delivery_id` | String | Delivery sheet the item belongs to. |
> | `epi_certificate_id` | String | Approval certificate (CA) record of the PPE. |
> | `ca_number` | String | Approval certificate (CA) number of the PPE. |
> | `description` | String | Description of the PPE. |
> | `product_id` | String | Supply (product) delivered. |
> | `control_type` | String | CONSUMPTION, or RETURN when the item must be returned. |
> | `quantity` | Integer | Quantity delivered. |
> | `unit_of_measure` | String | Unit of measure. |
> | `lot_number` | String | Lot number. |
> | `manufacturer` | String | Manufacturer. |
> | `condition` | String | Condition of the item at delivery. |
> | `control_number` | String | Control number of the item. |
> | `task_id` | String | Budget task the item is charged to. |
> | `expected_return_date` | Datetime | When the item is expected back. |
> | `return_date` | Datetime | Return date informed. |
> | `returned_at` | Datetime | When the return was registered. |
> | `return_condition` | String | Condition when returned: GOOD, DAMAGED or DISCARDED. |
> | `return_note` | String | Note about the return. |
> | `batch_id` | String | Batch the delivery item was registered in. |
> | `signature_url` | String | URL of the collaborator's signature for the item. |
> | `signed_at` | Datetime | When the item was signed for. |
> | `signature_lat` | Number | Latitude where the item was signed. |
> | `signature_lng` | Number | Longitude where the item was signed. |
> | `signature_device_info` | String | Device used to sign. |
> | `created_at` | Datetime | When the item was created. |
> | `updated_at` | Datetime | When the item was last updated. |
> | `cost_center_id` | String | Cost center of the delivery sheet. |
> | `cost_center_name` | String | Name of the cost center. |
> | `collaborator_id` | String | Collaborator who has the item. |
> | `collaborator_name` | String | Name of the collaborator. |
> | `delivery_id_number` | Integer | Sequential number of the delivery sheet. |
> | `delivery_status` | String | Status of the delivery sheet (ACTIVE or PENDING). |

> [accordion] PPE trainings
>
> Stream name: `epi_trainings`. One row per training.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | String | Unique identifier (UUID) of the training. |
> | `company_id` | String | Company of the training. |
> | `cost_center_id` | String | Cost center of the training (null for company-wide trainings). |
> | `epi_delivery_id` | String | Delivery sheet the training is linked to. |
> | `training_type` | String | Training type (e.g. NR-35). |
> | `types` | Array (strings) | All training types of the training. |
> | `training_date` | Datetime | Date of the training. |
> | `expiration_date` | Datetime | When the training expires. |
> | `responsible_name` | String | Who gave the training. |
> | `certificate` | String | Certificate of the training. |
> | `note` | String | Note of the training. |
> | `created_at` | Datetime | When the training was created. |
> | `updated_at` | Datetime | When the training was last updated. |
> | `deleted_at` | Datetime | When the training was soft-deleted. |

> [accordion] PPE training participants
>
> Stream name: `epi_training_participants`. One row per participant of a training.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | String | Unique identifier (UUID) of the participation. |
> | `epi_training_id` | String | Training. |
> | `collaborator_id` | String | Collaborator who took part. |
> | `collaborator_name` | String | Name of the collaborator. |
> | `cost_center_id` | String | Cost center of the training. |
> | `signature_url` | String | URL of the participant's signature. |
> | `signed_at` | Datetime | When the participant signed. |
> | `signature_lat` | Number | Latitude of the signature. |
> | `signature_lng` | Number | Longitude of the signature. |
> | `signature_device_info` | String | Device used to sign. |
> | `created_at` | Datetime | When the participation was created. |

> [accordion] PPE training types
>
> Stream name: `epi_training_type_options`. One row per training type of the company.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | String | Unique identifier (UUID) of the training type option. |
> | `company_id` | String | Company. |
> | `label` | String | Label of the training type (e.g. Trabalho em altura). |
> | `value` | String | Value of the training type (e.g. NR-35). |
> | `name` | String | Same as label. |
> | `is_active` | Boolean | Whether the option is active. |
> | `created_at` | Datetime | When the option was created. |

> [accordion] PPE matrices
>
> Stream name: `epi_matrices`. One row per PPE matrix (PPE required by a job function).
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | String | Unique identifier (UUID) of the PPE matrix. |
> | `company_id` | String | Company. |
> | `function_id` | String | Job function the matrix applies to. |
> | `function_name` | String | Name of the job function. |
> | `cost_center_id` | String | Cost center of the matrix (null when company-wide). |
> | `cost_center_name` | String | Name of the cost center. |
> | `created_at` | Datetime | When the matrix was created. |
> | `updated_at` | Datetime | When the matrix was last updated. |
> | `deleted_at` | Datetime | When the matrix was soft-deleted. |

> [accordion] PPE matrix items
>
> Stream name: `epi_matrix_items`. One row per PPE required by a matrix.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | String | Unique identifier (UUID) of the matrix item. |
> | `epi_matrix_id` | String | PPE matrix. |
> | `epi_certificate_id` | String | Approval certificate (CA) record of the required PPE. |
> | `epi_description` | String | Description of the required PPE. |
> | `function_id` | String | Job function of the matrix. |
> | `cost_center_id` | String | Cost center of the matrix (null when company-wide). |
> | `created_at` | Datetime | When the item was created. |

> [accordion] Tool models
>
> Stream name: `tool_models`. One row per tool or equipment model.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | String | Unique identifier (UUID) of the tool model. |
> | `cost_center_id` | String | Cost center (construction site) of the model. |
> | `name` | String | Name of the tool or equipment. |
> | `tool_type` | String | TOOL or EQUIPMENT. |
> | `rental_status` | String | RENTED or OWNED. |
> | `supplier_id` | String | Rental supplier of the model. |
> | `price` | Number | Price of the model (BRL). |
> | `tool_class` | Integer | Class of the tool (API field `class`). |
> | `entry_date` | Datetime | Entry date of the model. |
> | `description` | String | Description of the model. |
> | `count_units` | Integer | Number of physical units of the model. |
> | `created_at` | Datetime | When the model was created. |
> | `updated_at` | Datetime | When the model was last updated. |

> [accordion] Tool units
>
> Stream name: `tool_units`. One row per physical tool or equipment unit.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | String | Unique identifier (UUID) of the unit. |
> | `cost_center_id` | String | Cost center (construction site) the unit was read for. |
> | `tool_id` | String | Tool model of the unit. |
> | `code` | Integer | Sequential code of the unit. |
> | `status` | String | AVAILABLE, IN\_USE, DAMAGED, MAINTENANCE, DISABLED or RETURN\_SUPPLIER. |
> | `serial` | String | Serial number. |
> | `property_id` | String | Asset (patrimônio) number. |
> | `tool_name` | String | Name of the tool model. |
> | `tool_type` | String | TOOL or EQUIPMENT. |
> | `tool_rental_status` | String | RENTED or OWNED. |
> | `tool_class` | Integer | Class of the tool model. |
> | `tool_price` | Number | Price of the tool model (BRL). |
> | `tool_supplier_id` | String | Rental supplier of the model. |
> | `tool_supplier_name` | String | Name of the rental supplier. |
> | `current_collaborator_id` | String | Collaborator holding the unit (last delivery); null if never delivered. |
> | `current_collaborator_name` | String | Name of the collaborator holding the unit. |
> | `maintenance_supplier_id` | String | Supplier of the last movement with a delivery. |
> | `maintenance_supplier_name` | String | Name of that supplier. |
> | `created_at` | Datetime | When the unit was created. |
> | `updated_at` | Datetime | When the unit was last updated. |

> [accordion] Tool suppliers
>
> Stream name: `tool_suppliers`. One row per tool supplier.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | String | Unique identifier (UUID) of the supplier. |
> | `cost_center_id` | String | Cost center (construction site) of the supplier. |
> | `code` | Integer | Code of the supplier. |
> | `name` | String | Legal name of the supplier. |
> | `trade_name` | String | Trade name of the supplier. |
> | `person_type` | String | LEGAL (company) or NATURAL (person). |
> | `document` | String | CNPJ or CPF of the supplier. |
> | `status` | Boolean | Whether the supplier is active. |
> | `is_rental` | Boolean | Whether the supplier rents tools. |
> | `is_maintenance` | Boolean | Whether the supplier does maintenance. |
> | `contact_name` | String | Contact person. |
> | `email` | String | E-mail. |
> | `phone` | String | Phone. |
> | `mobile_phone` | String | Mobile phone. |
> | `website` | String | Website. |
> | `zip_code` | String | ZIP code (CEP). |
> | `address` | String | Street address. |
> | `number` | String | Address number. |
> | `complement` | String | Address complement. |
> | `district` | String | District. |
> | `city` | String | City. |
> | `state` | String | State. |
> | `count_tool_movement` | Integer | Number of tool movements with this supplier. |
> | `count_tool` | Integer | Number of tool models linked to this supplier. |
> | `created_at` | Datetime | When the supplier was created. |
> | `deleted_at` | Datetime | When the supplier was soft-deleted. |

> [accordion] Tool usage history
>
> Stream name: `tool_usage_history`. One row per delivery or return of a tool unit.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | String | Unique identifier (UUID) of the status event. |
> | `cost_center_id` | String | Cost center (construction site) the history was read for. |
> | `tool_movement_id` | String | Movement the event belongs to. |
> | `type` | String | DELIVERY or RETURN. |
> | `created_at` | Datetime | When the event was registered. |
> | `tool_unit_id` | String | Tool unit moved. |
> | `collaborator_id` | String | Collaborator of the movement. |
> | `event_date` | Datetime | Date of the event. |
> | `observation` | String | Observation of the movement. |
> | `supplier_id` | String | Supplier of the movement (maintenance or rental). |
> | `send_maintenance_date` | Datetime | When the unit was sent to maintenance. |
> | `receive_maintenance_date` | Datetime | When the unit came back from maintenance. |
> | `maintenance_cost` | Number | Maintenance cost (BRL). |
> | `collaborator_name` | String | Name of the collaborator. |
> | `tool_unit_code` | Integer | Sequential code of the unit. |
> | `tool_unit_property_id` | String | Asset (patrimônio) number of the unit. |
> | `tool_id` | String | Tool model of the unit. |
> | `tool_name` | String | Name of the tool model. |
> | `movement_created_at` | Datetime | When the movement was created. |
> | `movement_updated_at` | Datetime | When the movement was last updated. |

> [accordion] Tool maintenance history
>
> Stream name: `tool_maintenance_history`. One row per tool movement that went through maintenance.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `id` | String | Unique identifier (UUID) of the movement. |
> | `cost_center_id` | String | Cost center of the tool model. |
> | `tool_unit_id` | String | Tool unit moved. |
> | `collaborator_id` | String | Collaborator of the movement. |
> | `event_date` | Datetime | Date of the event. |
> | `observation` | String | Observation of the movement. |
> | `supplier_id` | String | Supplier of the movement (maintenance or rental). |
> | `send_maintenance_date` | Datetime | When the unit was sent to maintenance. |
> | `receive_maintenance_date` | Datetime | When the unit came back from maintenance. |
> | `maintenance_cost` | Number | Maintenance cost (BRL). |
> | `collaborator_name` | String | Name of the collaborator. |
> | `supplier_name` | String | Name of the maintenance supplier. |
> | `supplier_document` | String | CNPJ or CPF of the maintenance supplier. |
> | `tool_unit_code` | Integer | Sequential code of the unit. |
> | `tool_unit_serial` | String | Serial number of the unit. |
> | `tool_unit_property_id` | String | Asset (patrimônio) number of the unit. |
> | `tool_unit_status` | String | Current status of the unit. |
> | `tool_id` | String | Tool model of the unit. |
> | `tool_name` | String | Name of the tool model. |
> | `tool_type` | String | TOOL or EQUIPMENT. |
> | `created_at` | Datetime | When the movement was created. |
> | `updated_at` | Datetime | When the movement was last updated. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.