Skip to content

Commit

Permalink
current all entities to base-data
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeh committed Oct 25, 2024
1 parent a5f35df commit 35ed5c7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions api/src/modules/import/services/entity.preprocessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion shared/entities/base-data.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,5 +255,5 @@ export class BaseData extends BaseEntity {
name: "restorable_land",
referencedColumnName: "id",
})
restorableLand: EcosystemLoss;
restorableLand: RestorableLand;
}

0 comments on commit 35ed5c7

Please sign in to comment.