GET /eestat/1/elujoud/:id - Get the company based on registration numberPOST /eestat/1/elujoud - Get the company data with JSON body- Company ID isn't exactly 8 digits
- Cluster value isn't valid
- All fields are null
-
With complete data:
- All 5 models will give you predictions (y1, y2, y3)
-
With missing monthly data:
- Models 1-4 work normally
- Model 5 returns null
- Monthly stats return null
-
With some missing monthly data:
- Up to 3 missing months: Model 5 still works
- More than 3 missing months: Model 5 returns null
- Annual data works independently of monthly data
- Monthly stats only show up if monthly data exists
- You can have up to 3 missing fields before Model 5 stops working
The results are mapped to the PredictionResponse object as follows:
Each model represents a specific aspect of the prediction and maps the dimensions as follows:
- Model 1 (likviidsus)
- Model 2 (efektiivsus)
- Model 3 (struktuur)
- Model 4 (tasuvus)
- Model 5 (kasvu)
For each model:
modelY1: Represents the X dimension of the prediction.modelY2: Represents the Y dimension of the prediction.modelY3: Represents the Z dimension of the prediction.
Open your terminal and run:
npm i -g mintlifyNavigate to the docs folder:
cd stat-ee/docsStart the development server:
mintlify devThis opens the docs in your web browser, usually at http://localhost:4111/.
chmod +x build-docker.sh
Execute the script:
./build-docker.sh
docker build -t stat-ee:latest . && docker save -o stat-ee.tar stat-ee:latest
This route allows you to get company predictions by providing JSON data directly, rather than using a company ID.
The request body should be a JSON object with the following structure:
From company_year_repository.ts:
The CompanyRepository class provides two key methods for retrieving company data:
- Filters for companies with maa_protsent >= 90%
- Returns most recent valid year's data
WITH Filtered AS (
SELECT *
FROM "ELUJOULISUSEINDEKS"."AASTASED"
WHERE "jykood" = :jykood
ORDER BY "aasta" DESC
FETCH FIRST 2 ROWS ONLY
)
SELECT *
FROM Filtered
WHERE "maa_protsent" >= 0.9
ORDER BY "aasta" DESC
FETCH FIRST 1 ROW ONLY- Gets most recent year without filtering
- Used for prediction target year
SELECT *
FROM "ELUJOULISUSEINDEKS"."AASTASED"
WHERE "jykood" = :jykood
ORDER BY "aasta" DESC
FETCH FIRST 1 ROWS ONLYBoth queries return data in this structure:
{
// ...
"company": {
"jykood": "string",
"klaster": "string",
"aasta": "number",
"emtak": "string",
"sektor_nr": "number",
"ettevotte_suurusklass": "number",
"maakond": "number",
"kov": "number"
},
"lastYearCompany": {
"jykood": "string",
"klaster": "string",
"aasta": "number",
"emtak": "string",
"sektor_nr": "number",
"ettevotte_suurusklass": "number",
"maakond": "number",
"kov": "number"
}
// ...
}From norm_monthly_repository.ts:
SELECT *
FROM "ELUJOULISUSEINDEKS"."NORM_KUU_KESK"
WHERE "klaster" = :klaster
FETCH FIRST 1 ROWS ONLYFrom norm_monthly_repository.ts:
SELECT *
FROM "ELUJOULISUSEINDEKS"."NORM_KUU_SDS"
WHERE "klaster" = :klaster
FETCH FIRST 1 ROWS ONLY{
// ...
"monthlyMea": {
// Fields from NORM_KUU_KESK query
},
"monthlySds": {
// Fields from NORM_KUU_SDS query
},
"yearlyMea": {
// Fields from NORM_AASTA_KESK query
},
"yearlySds": {
// Fields from NORM_AASTA_SDS query
}
// ...
}From norm_monthly_repository.ts:
SELECT *
FROM "ELUJOULISUSEINDEKS"."KUISED"
WHERE "kood" = :kood
FETCH FIRST 1 ROWS ONLY {
// ...
"monthly": {
"emtak08": "number",
"emtak_estat": "string",
"maa": "number",
"vald": "number",
"tarv_h": "number",
"oig_grupp": "string",
"sektor_nr": "number",
"sektor": "string",
"kmd_m_min12": "number"
// ... other monthly metrics
}
// ...
}