From 35ed5c7ce8bb34c7ce065b7247dd70f53ac6fe5d Mon Sep 17 00:00:00 2001 From: alexeh Date: Fri, 25 Oct 2024 05:20:53 +0200 Subject: [PATCH] current all entities to base-data --- api/src/modules/import/services/entity.preprocessor.ts | 8 ++++++++ shared/entities/base-data.entity.ts | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/api/src/modules/import/services/entity.preprocessor.ts b/api/src/modules/import/services/entity.preprocessor.ts index d568847b..e08158ee 100644 --- a/api/src/modules/import/services/entity.preprocessor.ts +++ b/api/src/modules/import/services/entity.preprocessor.ts @@ -17,6 +17,8 @@ import { DataCollectionAndFieldCosts } from '@shared/entities/data-collection-an import { CommunityBenefitSharingFund } from '@shared/entities/community-benefit-sharing-fund.entity'; import { CarbonStandardFees } from '@shared/entities/carbon-standard-fees.entity'; import { CommunityCashFlow } from '@shared/entities/community-cash-flow.entity'; +import { EcosystemLoss } from '@shared/entities/ecosystem-loss.entity'; +import { RestorableLand } from '@shared/entities/restorable-land.entity'; export type ParsedDBEntities = { baseData: BaseData[]; @@ -91,6 +93,12 @@ export class EntityPreprocessor { baseData.communityCashFlow = { cashflowType: this.emptyStringToNull(row.other_community_cash_flow), } as CommunityCashFlow; + baseData.ecosystemLoss = { + ecosystemLossRate: this.emptyStringToZero(row.ecosystem_loss_rate), + } as EcosystemLoss; + baseData.restorableLand = { + restorableLand: this.emptyStringToZero(row.restorable_land), + } as RestorableLand; parsedArray.push(baseData); }); diff --git a/shared/entities/base-data.entity.ts b/shared/entities/base-data.entity.ts index 5f16ff8d..1b2f2862 100644 --- a/shared/entities/base-data.entity.ts +++ b/shared/entities/base-data.entity.ts @@ -255,5 +255,5 @@ export class BaseData extends BaseEntity { name: "restorable_land", referencedColumnName: "id", }) - restorableLand: EcosystemLoss; + restorableLand: RestorableLand; }