Skip to content

Commit

Permalink
4135 - Fix table name usage (#4136)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorja authored Nov 21, 2024
1 parent 8acf7f9 commit bfa8f8d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/meta/assessment/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export enum TableNames {
carbonStockTotal = 'carbonStockTotal',
climaticDomain = 'climaticDomain',
extentOfForest = 'extentOfForest',
extentOfForest_forestAreaStatusAndTrend = 'extentOfForest_forestAreaStatusAndTrend',
growingStock_growingStockStatus = 'growingStock_growingStockStatus',
biomassStock_biomassStockStatus = 'biomassStock_biomassStockStatus',
forestAreaWithinProtectedAreas = 'forestAreaWithinProtectedAreas',
forestCharacteristics = 'forestCharacteristics',
forestOwnership = 'forestOwnership',
Expand Down
11 changes: 8 additions & 3 deletions src/server/controller/cycleData/getBulkDownload/getTierData.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { TableNames } from 'meta/assessment'
import { RecordAssessmentDatas } from 'meta/data'

import { climaticDomain } from 'server/controller/cycleData/getBulkDownload/climaticDomain'
Expand All @@ -8,9 +9,13 @@ import { Props } from 'server/controller/cycleData/getBulkDownload/props'
const baseVariables = ['status']

const tableNames = [
{ tableName: 'extentofforest_forestareastatusandtrend', csvPrefix: '1a', variables: [...baseVariables, 'trend'] },
{ tableName: 'growingstock_growingstockstatus', csvPrefix: '2a', variables: baseVariables },
{ tableName: 'biomassstock_biomassstockstatus', csvPrefix: '2c', variables: baseVariables },
{
tableName: TableNames.extentOfForest_forestAreaStatusAndTrend,
csvPrefix: '1a',
variables: [...baseVariables, 'trend'],
},
{ tableName: TableNames.growingStock_growingStockStatus, csvPrefix: '2a', variables: baseVariables },
{ tableName: TableNames.biomassStock_biomassStockStatus, csvPrefix: '2c', variables: baseVariables },
]

export const getTierData = async (props: Props): Promise<Array<Record<string, string>>> => {
Expand Down

0 comments on commit bfa8f8d

Please sign in to comment.