Skip to main content

ingestData

chainalign-backend


chainalign-backend / ingestionService / ingestData

Function: ingestData()

ingestData(sourceType, sourceParams, tenantId, user): Promise<any>

Defined in: ingestionService.js:79

Orchestrates the data ingestion process, including fetching, mapping, initial sanity checks, feature engineering (seasonality, promotions, stockout periods), and formatting for statistical models and AI (LLM) processing.

Parameters

sourceType

string

The type of data source (e.g., 'googleSheet', 'postgresql').

sourceParams

any

Parameters specific to the source (e.g., { sheetId, range } or { tableName }).

tenantId

string

The ID of the tenant.

user

any

The user object (e.g., from req.user).

Returns

Promise<any>

An object containing the ingested data, mappings, and sanity check results.