> ## 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.

# Siecon as a data source

> Bring data from Siecon to Nekt.

Siecon is an ERP platform built exclusively for the construction and real-estate development industry. It manages projects (empreendimentos), contracts, financials, and cash flow for construction companies.

<Note>
  Siecon is **self-hosted**: each customer runs its own MobileApi instance. You must provide the base URL of your installation and it must be reachable from Nekt. There is no shared/public environment.
</Note>

## 1. Add your Siecon access

1. 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 Siecon option from the list of connectors.

2. Click **Next** and you'll be prompted to fill the configuration.

   * **API Base URL**: The base URL of your Siecon MobileApi, including the path prefix — for example `https://erp.yourcompany.com:8080/MobileApi`. Ask your Siecon administrator for the address and make sure it is reachable from the internet.
   * **Username**: The Siecon system user used to authenticate against the MobileApi.
   * **Password**: The password for that user. Nekt encodes it as required by the API.
   * **Start date**: The earliest record date to sync (used for incremental streams).
   * **Revenue/Expense Filter** *(advanced)*: Limit the cash-flow stream to revenue or expense rows. `-1` all, `0` revenue, `1` expense.
   * **Realized/Committed Filter** *(advanced)*: Limit the cash-flow stream by realization status. `-1` all, `P` forecast + committed, `E` realized.

3. Click **Next**.

## 2. Select your Siecon streams

1. The next step is letting us know which streams you want to bring. You can select entire groups of streams or only a subset of them.

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

2. Click **Next**.

## 3. Configure your Siecon data streams

1. 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**: depending on the data you are bringing to the lake, you can choose between INCREMENTAL and FULL\_TABLE. Read more about Sync Types [here](https://docs.nekt.com/get-started/core-concepts/types-of-sync).

2. Click **Next**.

## 4. Configure your Siecon data source

1. Describe your data source for easy identification within your organization. You can inform things like what data it brings, to which team it belongs, etc.

2. To define your [Trigger](https://docs.nekt.com/get-started/core-concepts/triggers), consider how often you want data to be extracted from this source.

3. Optionally, you can define some additional settings (if available).

   * 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).
   * Determine when to execute an **Additional [Full Sync](https://docs.nekt.com/get-started/core-concepts/types-of-sync#additional-full-sync)**.

### Check your new source!

1. Click **Next** to finalize the setup. Once completed, you'll receive confirmation that your new source is set up!

2. You can view your new source on the [Sources](https://app.nekt.ai/sources) page. Now, for you to be able to see it on your [Catalog](https://app.nekt.ai/catalog), you have to wait for the pipeline to run. If needed, manually trigger the pipeline by clicking on the refresh icon.

> If you encounter any issues, reach out to us, and we'll gladly assist you!

# Streams and Fields

Below you'll find all available data streams from Siecon.

<AccordionGroup>
  <Accordion title="Razão Financeiro Consolidado (Cash Flow)">
    Consolidated cash-flow ledger from the Fluxo de Caixa module (`/api/FluxoCaixa/RazaoFinanConsol`). Synced incrementally across monthly date windows, bookmarked on `DtVenc`.

    **Fields:**

    * `CCDCdg`: `String` - Cost-center code
    * `CCDDesc`: `String` - Cost-center description
    * `CCDTipo`: `String` - Cost-center type
    * `ReceitaDespesa`: `String` - Revenue/expense indicator
    * `TpEfetComp`: `String` - Forecast/committed/realized type
    * `TipoMovDesc`: `String` - Movement type description
    * `DtVenc`: `DateTime` - Due date
    * `DtVencOrig`: `DateTime` - Original due date
    * `DtDoc`: `DateTime` - Document date
    * `DtRecto`: `DateTime` - Receipt date
    * `DtMovBanc`: `DateTime` - Bank movement date
    * `Total`: `Number` - Total amount
    * `TotalEfetuado`: `Number` - Realized amount
    * `TotalEfet`: `Number` - Realized amount (alt.)
    * `TotalSaldoAtual`: `Number` - Current balance
    * `TotalPrev`: `Number` - Forecast amount
    * `TotalComp`: `Number` - Committed amount
    * `TotalResp`: `Number` - Responsible amount
    * `TotalAtualTxAdmPrev`: `Number` - Admin fee (forecast)
    * `TotalAtualTxAdmComp`: `Number` - Admin fee (committed)
    * `TotalAtualTxAdmEfet`: `Number` - Admin fee (realized)
    * `EmprdDesc`: `String` - Project (empreendimento) description
    * `EmpreCdg`: `String` - Company code
    * `EmpreRazao`: `String` - Company name
    * `CLiForCdg`: `String` - Client/supplier code
    * `CliForRazao`: `String` - Client/supplier name
    * `NumDoc`: `String` - Document number
    * `Historico`: `String` - Description/history
    * `PgtoRectoCdg`: `String` - Payment/receipt code
    * `ApRecCdg`: `String` - Payable record code
    * `ArRecCdg`: `String` - Receivable record code
    * `RiCdg`: `String` - RI code
    * `OperCdg`: `String` - Operation code
    * `OperDesc`: `String` - Operation description
    * `Fd`: `String` - Priority flag
    * `ApContaCdg`: `String` - Payable account code
    * `ApContaDesc`: `String` - Payable account description
    * `ArContaCdg`: `String` - Receivable account code
    * `ArContaDesc`: `String` - Receivable account description
    * `ApStatusDesc`: `String` - Payable status
    * `ArStatusDesc`: `String` - Receivable status
    * `EnvioCrbNum`: `String` - Collection batch number
    * `EnvioCrbData`: `DateTime` - Collection batch date
    * `UsuarioCad`: `String` - User who created the record
  </Accordion>

  <Accordion title="Empreendimentos">
    Real-estate/construction projects (`/api/DadosEmprd`). Useful as a dimension to join cash-flow rows.

    **Fields:**

    * `Codigo`: `Integer` - Project code
    * `Descricao`: `String` - Project name
    * `TipoDesc`: `String` - Project type
  </Accordion>

  <Accordion title="Dados Cliente (Clients)">
    Client master data (`/api/DadosCliente`). Synced incrementally on `DtUltimaAlteracao`.

    **Fields:**

    * `CodigoCliente`: `Integer` - Client code
    * `Fantasia`: `String` - Trade name
    * `Razao`: `String` - Legal name
    * `RazaoLongo`: `String` - Full legal name
    * `CnpjCpf`: `String` - Tax document
    * `DataNascCliente`: `DateTime` - Birth date
    * `FormaPgto`: `String` - Default payment method
    * `FormaRecto`: `String` - Default receipt method
    * `Endereco`: `String` - Address
    * `Bairro`: `String` - Neighborhood
    * `Cidade`: `String` - City
    * `Uf`: `String` - State
    * `Cep`: `String` - Postal code
    * `Email`: `String` - Email
    * `EmailCobranca`: `String` - Billing email
    * `CodigoContrato`: `String` - Comma-separated contract codes
    * `DtCadastro`: `DateTime` - Registration date
    * `DtUltimaAlteracao`: `DateTime` - Last update date
    * `DadosCtrs`: `Array of Objects` - Contract summaries for the client
      * `CodigoContrato`: `String` - Contract code
      * `Emprd`: `Integer` - Project code
      * `Bloco`: `Integer` - Block code
      * `Unidade`: `String` - Unit
      * `DtAssCtr`: `DateTime` - Contract signature date
      * `SitFaturamento`: `String` - Billing status
      * `DadosAvalistas`: `Array of Objects` - Guarantors

    > Additional contact, document and address fields (phones, RG, parents' names, occupation, tax classification flags, etc.) are also available.
  </Accordion>

  <Accordion title="Contratos (Contracts)">
    Contract details (`/api/DadosCtr/CtrConsulta`), fetched per contract found on each client.

    **Fields:**

    * `CodigoContrato`: `String` - Contract code
    * `Emprd`: `Integer` - Project code
    * `Bloco`: `Integer` - Block code
    * `BlocoDesc`: `String` - Block description
    * `Unidade`: `String` - Unit
    * `DtAssCtr`: `DateTime` - Contract signature date
    * `SitFaturamento`: `String` - Billing status
    * `StatusDistratoDesc`: `String` - Termination status
    * `DtAssFinanBanc`: `DateTime` - Bank financing signature date
    * `CodCtrFinanBanc`: `String` - Bank financing contract code
    * `CodigoExportacao`: `String` - Export code
    * `CodigoNovoRemanejamento`: `String` - Reallocation code
    * `Observacao`: `String` - Notes
    * `DadosAvalistas`: `Array of Objects` - Guarantors
      * `CnpjCpf`: `String` - Tax document
      * `Nome`: `String` - Name
      * `Email`: `String` - Email
  </Accordion>
</AccordionGroup>
