diff --git a/admin/components/dashboard.tsx b/admin/components/dashboard.tsx new file mode 100644 index 00000000..71bccccb --- /dev/null +++ b/admin/components/dashboard.tsx @@ -0,0 +1,21 @@ +import { Box, H1, Text } from "@adminjs/design-system"; + +const Dashboard = () => { + return ( + + +

Welcome to Blue Carbon Cost Admin Panel

+ Manage your data effectively and efficiently +
+
+ ); +}; + +export default Dashboard; diff --git a/admin/datasource.ts b/admin/datasource.ts index d16efd19..4aaa52f9 100644 --- a/admin/datasource.ts +++ b/admin/datasource.ts @@ -85,4 +85,5 @@ export const dataSource = new DataSource({ process.env.NODE_ENV === "production" ? { rejectUnauthorized: false } : false, + logging: false, }); diff --git a/admin/index.ts b/admin/index.ts index 23123778..a6bdaa1b 100644 --- a/admin/index.ts +++ b/admin/index.ts @@ -6,7 +6,6 @@ import * as AdminJSTypeorm from "@adminjs/typeorm"; import { dataSource } from "./datasource.js"; import { AuthProvider } from "./providers/auth.provider.js"; import { UserResource } from "./resources/users/user.resource.js"; -import { Country } from "@shared/entities/country.entity.js"; import { FeasibilityAnalysisResource } from "./resources/feasability-analysis/feasability-analysis.resource.js"; import { ConservationAndPlanningAdminResource } from "./resources/conservation-and-planning-admin/conservation-and-planning-admin.resource.js"; import { CommunityRepresentationResource } from "./resources/community-representation/community-representation.resource.js"; @@ -37,6 +36,7 @@ import { UserUploadCostInputs } from "@shared/entities/users/user-upload-cost-in import { UserUploadConservationInputs } from "@shared/entities/users/user-upload-conservation-inputs.entity.js"; import { UserUploadRestorationInputs } from "@shared/entities/users/user-upload-restoration-inputs.entity.js"; import { GLOBAL_COMMON_PROPERTIES } from "./resources/common/common.resources.js"; +import { CountryResource } from "./resources/countries/country.resource.js"; AdminJS.registerAdapter({ Database: AdminJSTypeorm.Database, @@ -47,6 +47,10 @@ const PORT = 1000; export const API_URL = process.env.API_URL || "http://localhost:4000"; const componentLoader = new ComponentLoader(); + +const Components = { + Dashboard: componentLoader.add("Dashboard", "./components/dashboard"), +}; const authProvider = new AuthProvider(); const start = async () => { @@ -59,6 +63,14 @@ const start = async () => { }; const admin = new AdminJS({ + branding: { + companyName: "Blue Carbon Cost", + withMadeWithLove: false, + logo: false, + }, + dashboard: { + component: Components.Dashboard, + }, rootPath: "/admin", componentLoader, resources: [ @@ -128,14 +140,7 @@ const start = async () => { BaseSizeResource, BaseIncreaseResource, ModelAssumptionResource, - { - resource: Country, - name: "Country", - options: { - parent: databaseNavigation, - icon: "Globe", - }, - }, + CountryResource, ], locale: { language: "en", @@ -145,6 +150,14 @@ const start = async () => { User: "Users", Country: "Countries", Project: "Projects", + ProjectSize: "Project Sizes", + }, + resources: { + ProjectSize: { + properties: { + countryCode: "Country", + }, + }, }, }, }, diff --git a/admin/package.json b/admin/package.json index 1ffbc269..0ef4cd33 100644 --- a/admin/package.json +++ b/admin/package.json @@ -11,6 +11,7 @@ "author": "", "license": "ISC", "dependencies": { + "@adminjs/design-system": "^4.1.1", "@adminjs/express": "^6.1.0", "@adminjs/typeorm": "^5.0.1", "adminjs": "^7.8.13", diff --git a/admin/resources/baseline-reassesment/baseline-reassesment.resource.ts b/admin/resources/baseline-reassesment/baseline-reassesment.resource.ts index 4debab13..bac5bd14 100644 --- a/admin/resources/baseline-reassesment/baseline-reassesment.resource.ts +++ b/admin/resources/baseline-reassesment/baseline-reassesment.resource.ts @@ -15,6 +15,9 @@ export const BaselineReassessmentResource: ResourceWithOptions = { }, properties: { ...GLOBAL_COMMON_PROPERTIES, + baselineReassessmentCost: { + isVisible: { list: true, show: true, filter: false, edit: true }, + }, }, }, }; diff --git a/admin/resources/blue-carbon-project-planning/blue-carbon-project-planning.resource.ts b/admin/resources/blue-carbon-project-planning/blue-carbon-project-planning.resource.ts index c35a9b8c..6ba4e0a8 100644 --- a/admin/resources/blue-carbon-project-planning/blue-carbon-project-planning.resource.ts +++ b/admin/resources/blue-carbon-project-planning/blue-carbon-project-planning.resource.ts @@ -6,29 +6,18 @@ export const BlueCarbonProjectPlanningResource: ResourceWithOptions = { resource: BlueCarbonProjectPlanning, options: { properties: { - id: { - isVisible: { list: false, show: false, edit: false, filter: false }, - }, - country: { - isVisible: { list: true, show: true, edit: true, filter: true }, - }, - inputSelection: { - isVisible: { list: true, show: true, edit: true, filter: true }, - }, + ...GLOBAL_COMMON_PROPERTIES, input1: { - isVisible: { list: true, show: true, edit: true, filter: true }, + isVisible: { show: false, edit: true, filter: false, list: true }, }, input2: { - isVisible: { list: true, show: true, edit: true, filter: true }, + isVisible: { show: false, edit: true, filter: false, list: true }, }, input3: { - isVisible: { list: true, show: true, edit: true, filter: true }, + isVisible: { show: false, edit: true, filter: false, list: true }, }, blueCarbon: { - isVisible: { list: true, show: true, edit: false, filter: true }, - }, - properties: { - ...GLOBAL_COMMON_PROPERTIES, + isVisible: { show: true, edit: true, filter: false, list: true }, }, }, sort: { diff --git a/admin/resources/carbon-estandard-fees/carbon-estandard-fees.resource.ts b/admin/resources/carbon-estandard-fees/carbon-estandard-fees.resource.ts index cd17383c..3cdd7a38 100644 --- a/admin/resources/carbon-estandard-fees/carbon-estandard-fees.resource.ts +++ b/admin/resources/carbon-estandard-fees/carbon-estandard-fees.resource.ts @@ -15,6 +15,9 @@ export const CarbonStandardFeesResource: ResourceWithOptions = { }, properties: { ...GLOBAL_COMMON_PROPERTIES, + carbonStandardFee: { + isVisible: { list: true, show: true, filter: false, edit: true }, + }, }, }, }; diff --git a/admin/resources/carbon-righs/carbon-rights.resource.ts b/admin/resources/carbon-righs/carbon-rights.resource.ts index e824c570..f65a8fde 100644 --- a/admin/resources/carbon-righs/carbon-rights.resource.ts +++ b/admin/resources/carbon-righs/carbon-rights.resource.ts @@ -15,6 +15,9 @@ export const CarbonRightsResource: ResourceWithOptions = { }, properties: { ...GLOBAL_COMMON_PROPERTIES, + carbonRightsCost: { + isVisible: { list: true, show: true, filter: false, edit: true }, + }, }, }, }; diff --git a/admin/resources/community-benefit/community-benefit.resource.ts b/admin/resources/community-benefit/community-benefit.resource.ts index 01c7c5ba..21501a62 100644 --- a/admin/resources/community-benefit/community-benefit.resource.ts +++ b/admin/resources/community-benefit/community-benefit.resource.ts @@ -15,6 +15,9 @@ export const CommunityBenefitResource: ResourceWithOptions = { }, properties: { ...GLOBAL_COMMON_PROPERTIES, + communityBenefitSharingFund: { + isVisible: { list: true, show: true, filter: false, edit: true }, + }, }, }, }; diff --git a/admin/resources/community-representation/community-representation.resource.ts b/admin/resources/community-representation/community-representation.resource.ts index dbb58a35..1e6b9c5c 100644 --- a/admin/resources/community-representation/community-representation.resource.ts +++ b/admin/resources/community-representation/community-representation.resource.ts @@ -15,6 +15,9 @@ export const CommunityRepresentationResource: ResourceWithOptions = { }, properties: { ...GLOBAL_COMMON_PROPERTIES, + liaisonCost: { + isVisible: { list: true, show: true, filter: false, edit: true }, + }, }, }, }; diff --git a/admin/resources/conservation-and-planning-admin/conservation-and-planning-admin.resource.ts b/admin/resources/conservation-and-planning-admin/conservation-and-planning-admin.resource.ts index 4cf58646..9c41fbfb 100644 --- a/admin/resources/conservation-and-planning-admin/conservation-and-planning-admin.resource.ts +++ b/admin/resources/conservation-and-planning-admin/conservation-and-planning-admin.resource.ts @@ -5,7 +5,12 @@ import { GLOBAL_COMMON_PROPERTIES } from "../common/common.resources.js"; export const ConservationAndPlanningAdminResource: ResourceWithOptions = { resource: ConservationPlanningAndAdmin, options: { - properties: {...GLOBAL_COMMON_PROPERTIES}, + properties: { + ...GLOBAL_COMMON_PROPERTIES, + planningCost: { + isVisible: { list: true, show: true, edit: true, filter: false }, + }, + }, sort: { sortBy: "planningCost", direction: "desc", diff --git a/admin/resources/countries/country.resource.ts b/admin/resources/countries/country.resource.ts new file mode 100644 index 00000000..4b252d77 --- /dev/null +++ b/admin/resources/countries/country.resource.ts @@ -0,0 +1,23 @@ +import { ResourceWithOptions } from "adminjs"; +import { GLOBAL_COMMON_PROPERTIES } from "../common/common.resources.js"; +import { Country } from "@shared/entities/country.entity.js"; + +export const CountryResource: ResourceWithOptions = { + resource: Country, + options: { + properties: { + ...GLOBAL_COMMON_PROPERTIES, + geometry: { + isVisible: { list: false, edit: false, show: false, filter: false }, + }, + }, + sort: { + sortBy: "name", + direction: "asc", + }, + navigation: { + name: "Data Management", + icon: "Database", + }, + }, +}; diff --git a/admin/resources/data-collection-and-field-cost/data-collection-and-field-cost.resource.ts b/admin/resources/data-collection-and-field-cost/data-collection-and-field-cost.resource.ts index 8bef62af..cfceb2de 100644 --- a/admin/resources/data-collection-and-field-cost/data-collection-and-field-cost.resource.ts +++ b/admin/resources/data-collection-and-field-cost/data-collection-and-field-cost.resource.ts @@ -15,6 +15,9 @@ export const DataCollectionAndFieldCostResource: ResourceWithOptions = { }, properties: { ...GLOBAL_COMMON_PROPERTIES, + fieldCost: { + isVisible: { list: true, show: true, filter: false, edit: true }, + }, }, }, }; diff --git a/admin/resources/ecosystem-loss/ecosystem-loss.resource.ts b/admin/resources/ecosystem-loss/ecosystem-loss.resource.ts index a0e4f771..eb2496a6 100644 --- a/admin/resources/ecosystem-loss/ecosystem-loss.resource.ts +++ b/admin/resources/ecosystem-loss/ecosystem-loss.resource.ts @@ -14,6 +14,9 @@ export const EcosystemLossResource: ResourceWithOptions = { }, properties: { ...GLOBAL_COMMON_PROPERTIES, + ecosystemLossRate: { + isVisible: { list: true, show: true, filter: false, edit: true }, + }, }, }, }; diff --git a/admin/resources/emission-factors/emission-factors.resource.ts b/admin/resources/emission-factors/emission-factors.resource.ts index a3aef66c..ce199c81 100644 --- a/admin/resources/emission-factors/emission-factors.resource.ts +++ b/admin/resources/emission-factors/emission-factors.resource.ts @@ -14,6 +14,24 @@ export const EmissionFactorsResource: ResourceWithOptions = { }, properties: { ...GLOBAL_COMMON_PROPERTIES, - }, + emissionFactor: { + isVisible: { show: true, edit: true, list: true, filter: false }, + }, + AGB: { + isVisible: { show: true, edit: true, list: true, filter: false }, + }, + SOC: { + isVisible: { show: true, edit: true, list: true, filter: false }, + }, + global: { + isVisible: { show: true, edit: true, list: true, filter: false }, + }, + t2CountrySpecificAGB: { + isVisible: { show: true, edit: true, list: true, filter: false }, + }, + t2CountrySpecificSOC: { + isVisible: { show: true, edit: true, list: true, filter: false }, + }, + }, }, }; diff --git a/admin/resources/feasability-analysis/feasability-analysis.resource.ts b/admin/resources/feasability-analysis/feasability-analysis.resource.ts index 1b419ce9..1932ef4a 100644 --- a/admin/resources/feasability-analysis/feasability-analysis.resource.ts +++ b/admin/resources/feasability-analysis/feasability-analysis.resource.ts @@ -15,6 +15,9 @@ export const FeasibilityAnalysisResource: ResourceWithOptions = { }, properties: { ...GLOBAL_COMMON_PROPERTIES, + analysisCost: { + isVisible: { list: true, show: true, edit: true, filter: false }, + }, }, }, }; diff --git a/admin/resources/financing-cost/financing-cost.resource.ts b/admin/resources/financing-cost/financing-cost.resource.ts index 1d97f2e1..98366465 100644 --- a/admin/resources/financing-cost/financing-cost.resource.ts +++ b/admin/resources/financing-cost/financing-cost.resource.ts @@ -14,6 +14,9 @@ export const FinancingCostResource: ResourceWithOptions = { }, properties: { ...GLOBAL_COMMON_PROPERTIES, + financingCostCapexPercent: { + isVisible: { list: true, show: true, filter: false, edit: true }, + }, }, }, }; diff --git a/admin/resources/implementation-labor-cost/implementation-labor-cost.resource.ts b/admin/resources/implementation-labor-cost/implementation-labor-cost.resource.ts index c458bb8f..3e259d17 100644 --- a/admin/resources/implementation-labor-cost/implementation-labor-cost.resource.ts +++ b/admin/resources/implementation-labor-cost/implementation-labor-cost.resource.ts @@ -15,6 +15,15 @@ export const ImplementationLaborCostResource: ResourceWithOptions = { }, properties: { ...GLOBAL_COMMON_PROPERTIES, + plantingCost: { + isVisible: { list: true, show: true, filter: false, edit: true }, + }, + hybridCost: { + isVisible: { list: true, show: true, filter: false, edit: true }, + }, + hydrologyCost: { + isVisible: { list: true, show: true, filter: false, edit: true }, + }, }, }, }; diff --git a/admin/resources/long-term-project-operating/long-term-project-operating.resource.ts b/admin/resources/long-term-project-operating/long-term-project-operating.resource.ts index f733d4b1..09f68a96 100644 --- a/admin/resources/long-term-project-operating/long-term-project-operating.resource.ts +++ b/admin/resources/long-term-project-operating/long-term-project-operating.resource.ts @@ -14,6 +14,9 @@ export const LongTermProjectOperatingResource: ResourceWithOptions = { }, properties: { ...GLOBAL_COMMON_PROPERTIES, + longTermProjectOperatingCost: { + isVisible: { list: true, show: true, filter: false, edit: true }, + }, }, }, }; diff --git a/admin/resources/maintenance/maintenance.resource.ts b/admin/resources/maintenance/maintenance.resource.ts index 0aa13da9..21628570 100644 --- a/admin/resources/maintenance/maintenance.resource.ts +++ b/admin/resources/maintenance/maintenance.resource.ts @@ -14,6 +14,9 @@ export const MaintenanceResource: ResourceWithOptions = { }, properties: { ...GLOBAL_COMMON_PROPERTIES, + monitoringCost: { + isVisible: { show: true, edit: true, list: true, filter: false }, + }, }, }, }; diff --git a/admin/resources/model-assumptions/model-assumptions.resource.ts b/admin/resources/model-assumptions/model-assumptions.resource.ts index cebb3307..87b07aac 100644 --- a/admin/resources/model-assumptions/model-assumptions.resource.ts +++ b/admin/resources/model-assumptions/model-assumptions.resource.ts @@ -15,6 +15,9 @@ export const ModelAssumptionResource: ResourceWithOptions = { }, properties: { ...GLOBAL_COMMON_PROPERTIES, + name: { + isVisible: { list: true, show: true, filter: true, edit: false }, + }, }, }, }; diff --git a/admin/resources/monitoring-cost/monitoring-cost.resource.ts b/admin/resources/monitoring-cost/monitoring-cost.resource.ts index 0c62dfa3..bbf093e7 100644 --- a/admin/resources/monitoring-cost/monitoring-cost.resource.ts +++ b/admin/resources/monitoring-cost/monitoring-cost.resource.ts @@ -15,6 +15,9 @@ export const MonitoringCostResource: ResourceWithOptions = { }, properties: { ...GLOBAL_COMMON_PROPERTIES, + monitoringCost: { + isVisible: { list: true, show: true, filter: false, edit: true }, + }, }, }, }; diff --git a/admin/resources/mrv/mrv.resource.ts b/admin/resources/mrv/mrv.resource.ts index eeb005e6..dab640f8 100644 --- a/admin/resources/mrv/mrv.resource.ts +++ b/admin/resources/mrv/mrv.resource.ts @@ -14,6 +14,9 @@ export const MRVResource: ResourceWithOptions = { }, properties: { ...GLOBAL_COMMON_PROPERTIES, + mrvCost: { + isVisible: { list: true, show: true, filter: false, edit: true }, + }, }, }, }; diff --git a/admin/resources/project-size/project-size.resource.ts b/admin/resources/project-size/project-size.resource.ts index 43c44a24..b32671f2 100644 --- a/admin/resources/project-size/project-size.resource.ts +++ b/admin/resources/project-size/project-size.resource.ts @@ -14,6 +14,11 @@ export const ProjectSizeResource: ResourceWithOptions = { }, properties: { ...GLOBAL_COMMON_PROPERTIES, + sizeHa: { + type: "number", + isVisible: { list: true, show: true, edit: true, filter: false }, + description: "Size in hectares", + }, }, }, }; diff --git a/admin/resources/projects/projects.resource.ts b/admin/resources/projects/projects.resource.ts index 0503371e..184e72ad 100644 --- a/admin/resources/projects/projects.resource.ts +++ b/admin/resources/projects/projects.resource.ts @@ -1,37 +1,32 @@ -import { - ActionContext, - ActionRequest, - ActionResponse, - BaseRecord, - ResourceWithOptions, -} from "adminjs"; -import { dataSource } from "../../datasource.js"; +import { ResourceWithOptions } from "adminjs"; import { Project } from "@shared/entities/projects.entity.js"; -import { Country } from "@shared/entities/country.entity.js"; -import { - COMMON_RESOURCE_LIST_PROPERTIES, - GLOBAL_COMMON_PROPERTIES, -} from "../common/common.resources.js"; +import { GLOBAL_COMMON_PROPERTIES } from "../common/common.resources.js"; export const ProjectsResource: ResourceWithOptions = { resource: Project, options: { properties: { ...GLOBAL_COMMON_PROPERTIES, - ...COMMON_RESOURCE_LIST_PROPERTIES, + projectSize: { + isVisible: { list: true, show: true, edit: true, filter: false }, + }, + abatementPotential: { + isVisible: { list: true, show: true, edit: true, filter: false }, + }, + totalCostNPV: { + isVisible: { list: true, show: true, edit: true, filter: false }, + }, + totalCost: { + isVisible: { list: true, show: true, edit: true, filter: false }, + }, + costPerTCO2eNPV: { + isVisible: { list: true, show: true, edit: true, filter: false }, + }, + costPerTCO2e: { + isVisible: { list: true, show: true, edit: true, filter: false }, + }, }, - listProperties: [ - "projectName", - "projectSize", - "projectSizeFilter", - "abatementPotential", - "totalCostNPV", - "costPerTCO2eNPV", - "initialPriceAssumption", - "restorationActivity", - "projectSizeFilter", - "priceType", - ], + sort: { sortBy: "projectName", direction: "asc", @@ -40,54 +35,5 @@ export const ProjectsResource: ResourceWithOptions = { name: "Data Management", icon: "Database", }, - actions: { - list: { - after: async ( - request: ActionRequest, - response: ActionResponse, - context: ActionContext, - ) => { - const { records } = context; - const projectDataRepo = dataSource.getRepository(Project); - const queryBuilder = projectDataRepo - .createQueryBuilder("project") - .leftJoin(Country, "country", "project.countryCode = country.code") - .select("project.id", "id") - .addSelect("project.projectName", "projectName") - .addSelect("project.ecosystem", "ecosystem") - .addSelect("project.activity", "activity") - .addSelect("project.restorationActivity", "restorationActivity") - .addSelect("country.name", "countryName") - .addSelect("project.projectSize", "projectSize") - .addSelect("project.projectSizeFilter", "projectSizeFilter") - .addSelect("project.abatementPotential", "abatementPotential") - .addSelect("project.totalCostNPV", "totalCostNPV") - .addSelect("project.costPerTCO2eNPV", "costPerTCO2eNPV") - .addSelect("project.totalCost", "totalCost") - .addSelect("project.costPerTCO2e", "costPerTCO2e") - .addSelect("project.priceType", "priceType") - .addSelect( - "project.initialPriceAssumption", - "initialPriceAssumption", - ); - - if (records?.length) { - queryBuilder.andWhere("project.id IN (:...ids)", { - ids: records.map((r) => r.params.id), - }); - } - - const result = await queryBuilder.getRawMany(); - - return { - ...request, - records: records!.map((record: BaseRecord) => { - record.params = result.find((q) => q.id === record.params.id); - return record; - }), - }; - }, - }, - }, }, }; diff --git a/admin/resources/restorable-land/restorable-land.resource.ts b/admin/resources/restorable-land/restorable-land.resource.ts index a82ec46c..4fdf8db3 100644 --- a/admin/resources/restorable-land/restorable-land.resource.ts +++ b/admin/resources/restorable-land/restorable-land.resource.ts @@ -14,6 +14,9 @@ export const RestorableLandResource: ResourceWithOptions = { }, properties: { ...GLOBAL_COMMON_PROPERTIES, + restorableLand: { + isVisible: { list: true, show: true, filter: false, edit: true }, + }, }, }, }; diff --git a/admin/resources/sequestration-rate/sequestration-rate.resource.ts b/admin/resources/sequestration-rate/sequestration-rate.resource.ts index c05368ba..ec06939f 100644 --- a/admin/resources/sequestration-rate/sequestration-rate.resource.ts +++ b/admin/resources/sequestration-rate/sequestration-rate.resource.ts @@ -12,6 +12,17 @@ export const SequestrationRateResource: ResourceWithOptions = { name: "Data Management", icon: "Database", }, - properties: GLOBAL_COMMON_PROPERTIES, + properties: { + ...GLOBAL_COMMON_PROPERTIES, + tier1Factor: { + isVisible: { list: false, show: true, filter: false, edit: true }, + }, + tier2Factor: { + isVisible: { list: false, show: true, filter: false, edit: true }, + }, + sequestrationRate: { + isVisible: { list: true, show: true, filter: false, edit: true }, + }, + }, }, }; diff --git a/admin/resources/validation-cost/validation-cost.resource.ts b/admin/resources/validation-cost/validation-cost.resource.ts index d140c7e6..13df8322 100644 --- a/admin/resources/validation-cost/validation-cost.resource.ts +++ b/admin/resources/validation-cost/validation-cost.resource.ts @@ -14,6 +14,9 @@ export const ValidationCostResource: ResourceWithOptions = { }, properties: { ...GLOBAL_COMMON_PROPERTIES, + validationCost: { + isVisible: { list: true, show: true, edit: true, filter: false }, + }, }, }, }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ec8d30cd..94d18513 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -46,6 +46,9 @@ importers: admin: dependencies: + '@adminjs/design-system': + specifier: ^4.1.1 + version: 4.1.1(@babel/core@7.25.2)(@tiptap/extension-text-style@2.8.0(@tiptap/core@2.1.13(@tiptap/pm@2.1.13)))(@types/react@18.3.5)(prop-types@15.8.1)(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1) '@adminjs/express': specifier: ^6.1.0 version: 6.1.0(adminjs@7.8.13(@tiptap/extension-text-style@2.8.0(@tiptap/core@2.1.13(@tiptap/pm@2.1.13)))(@types/babel__core@7.20.5)(@types/react-dom@18.3.0)(@types/react@18.3.5))(express-formidable@1.2.0)(express-session@1.18.0)(express@4.21.0)(tslib@2.7.0) @@ -771,12 +774,6 @@ packages: resolution: {integrity: sha512-o0xCgpNmRohmnoWKQ0Ij8IdddjyBFE4T2kagL/x6M3+4zUgc+4qTOUBoNe4XxDskt1HPKO007ZPiMgLDq2s7Kw==} engines: {node: '>=6.9.0'} - '@babel/helper-module-transforms@7.25.2': - resolution: {integrity: sha512-BjyRAbix6j/wv83ftcVJmBt72QtHI56C7JXZoG2xATiLpmoC7dpd8WnkikExHDVPpi/3qCmO6WY1EaXOluiecQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - '@babel/helper-module-transforms@7.25.7': resolution: {integrity: sha512-k/6f8dKG3yDz/qCwSM+RKovjMix563SLxQFo0UhRNo239SP6n9u5/eLtKD6EAjwta2JHJ49CsD8pms2HdNiMMQ==} engines: {node: '>=6.9.0'} @@ -807,10 +804,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-simple-access@7.24.7': - resolution: {integrity: sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==} - engines: {node: '>=6.9.0'} - '@babel/helper-simple-access@7.25.7': resolution: {integrity: sha512-FPGAkJmyoChQeM+ruBGIDyrT2tKfZJO8NcxdC+CWNJi7N8/rZpSxK7yvBJ5O/nF1gfu5KzN7VKG3YVSLFfRSxQ==} engines: {node: '>=6.9.0'} @@ -8484,17 +8477,17 @@ snapshots: '@babel/core@7.25.2': dependencies: '@ampproject/remapping': 2.3.0 - '@babel/code-frame': 7.24.7 - '@babel/generator': 7.25.6 - '@babel/helper-compilation-targets': 7.25.2 - '@babel/helper-module-transforms': 7.25.2(@babel/core@7.25.2) + '@babel/code-frame': 7.25.7 + '@babel/generator': 7.25.7 + '@babel/helper-compilation-targets': 7.25.7 + '@babel/helper-module-transforms': 7.25.7(@babel/core@7.25.2) '@babel/helpers': 7.25.6 - '@babel/parser': 7.25.6 - '@babel/template': 7.25.0 - '@babel/traverse': 7.25.6 - '@babel/types': 7.25.6 + '@babel/parser': 7.25.7 + '@babel/template': 7.25.7 + '@babel/traverse': 7.25.7(supports-color@5.5.0) + '@babel/types': 7.25.7 convert-source-map: 2.0.0 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -8503,7 +8496,7 @@ snapshots: '@babel/generator@7.25.6': dependencies: - '@babel/types': 7.25.6 + '@babel/types': 7.25.7 '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 jsesc: 2.5.2 @@ -8521,7 +8514,7 @@ snapshots: '@babel/helper-builder-binary-assignment-operator-visitor@7.25.7': dependencies: - '@babel/traverse': 7.25.7 + '@babel/traverse': 7.25.7(supports-color@5.5.0) '@babel/types': 7.25.7 transitivePeerDependencies: - supports-color @@ -8550,7 +8543,7 @@ snapshots: '@babel/helper-optimise-call-expression': 7.25.7 '@babel/helper-replace-supers': 7.25.7(@babel/core@7.25.2) '@babel/helper-skip-transparent-expression-wrappers': 7.25.7 - '@babel/traverse': 7.25.7 + '@babel/traverse': 7.25.7(supports-color@5.5.0) semver: 6.3.1 transitivePeerDependencies: - supports-color @@ -8575,7 +8568,7 @@ snapshots: '@babel/helper-member-expression-to-functions@7.25.7': dependencies: - '@babel/traverse': 7.25.7 + '@babel/traverse': 7.25.7(supports-color@5.5.0) '@babel/types': 7.25.7 transitivePeerDependencies: - supports-color @@ -8587,37 +8580,20 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-module-imports@7.24.7(supports-color@5.5.0)': - dependencies: - '@babel/traverse': 7.25.6(supports-color@5.5.0) - '@babel/types': 7.25.6 - transitivePeerDependencies: - - supports-color - - '@babel/helper-module-imports@7.25.7': + '@babel/helper-module-imports@7.25.7(supports-color@5.5.0)': dependencies: - '@babel/traverse': 7.25.7 + '@babel/traverse': 7.25.7(supports-color@5.5.0) '@babel/types': 7.25.7 transitivePeerDependencies: - supports-color - '@babel/helper-module-transforms@7.25.2(@babel/core@7.25.2)': - dependencies: - '@babel/core': 7.25.2 - '@babel/helper-module-imports': 7.24.7 - '@babel/helper-simple-access': 7.24.7 - '@babel/helper-validator-identifier': 7.24.7 - '@babel/traverse': 7.25.6 - transitivePeerDependencies: - - supports-color - '@babel/helper-module-transforms@7.25.7(@babel/core@7.25.2)': dependencies: '@babel/core': 7.25.2 - '@babel/helper-module-imports': 7.25.7 + '@babel/helper-module-imports': 7.25.7(supports-color@5.5.0) '@babel/helper-simple-access': 7.25.7 '@babel/helper-validator-identifier': 7.25.7 - '@babel/traverse': 7.25.7 + '@babel/traverse': 7.25.7(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -8634,7 +8610,7 @@ snapshots: '@babel/core': 7.25.2 '@babel/helper-annotate-as-pure': 7.25.7 '@babel/helper-wrap-function': 7.25.7 - '@babel/traverse': 7.25.7 + '@babel/traverse': 7.25.7(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -8643,27 +8619,20 @@ snapshots: '@babel/core': 7.25.2 '@babel/helper-member-expression-to-functions': 7.25.7 '@babel/helper-optimise-call-expression': 7.25.7 - '@babel/traverse': 7.25.7 - transitivePeerDependencies: - - supports-color - - '@babel/helper-simple-access@7.24.7': - dependencies: - '@babel/traverse': 7.25.6 - '@babel/types': 7.25.6 + '@babel/traverse': 7.25.7(supports-color@5.5.0) transitivePeerDependencies: - supports-color '@babel/helper-simple-access@7.25.7': dependencies: - '@babel/traverse': 7.25.7 + '@babel/traverse': 7.25.7(supports-color@5.5.0) '@babel/types': 7.25.7 transitivePeerDependencies: - supports-color '@babel/helper-skip-transparent-expression-wrappers@7.25.7': dependencies: - '@babel/traverse': 7.25.7 + '@babel/traverse': 7.25.7(supports-color@5.5.0) '@babel/types': 7.25.7 transitivePeerDependencies: - supports-color @@ -8683,15 +8652,15 @@ snapshots: '@babel/helper-wrap-function@7.25.7': dependencies: '@babel/template': 7.25.7 - '@babel/traverse': 7.25.7 + '@babel/traverse': 7.25.7(supports-color@5.5.0) '@babel/types': 7.25.7 transitivePeerDependencies: - supports-color '@babel/helpers@7.25.6': dependencies: - '@babel/template': 7.25.0 - '@babel/types': 7.25.6 + '@babel/template': 7.25.7 + '@babel/types': 7.25.7 '@babel/highlight@7.24.7': dependencies: @@ -8719,7 +8688,7 @@ snapshots: dependencies: '@babel/core': 7.25.2 '@babel/helper-plugin-utils': 7.25.7 - '@babel/traverse': 7.25.7 + '@babel/traverse': 7.25.7(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -8746,7 +8715,7 @@ snapshots: dependencies: '@babel/core': 7.25.2 '@babel/helper-plugin-utils': 7.25.7 - '@babel/traverse': 7.25.7 + '@babel/traverse': 7.25.7(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -8886,14 +8855,14 @@ snapshots: '@babel/helper-plugin-utils': 7.25.7 '@babel/helper-remap-async-to-generator': 7.25.7(@babel/core@7.25.2) '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.25.2) - '@babel/traverse': 7.25.7 + '@babel/traverse': 7.25.7(supports-color@5.5.0) transitivePeerDependencies: - supports-color '@babel/plugin-transform-async-to-generator@7.25.7(@babel/core@7.25.2)': dependencies: '@babel/core': 7.25.2 - '@babel/helper-module-imports': 7.25.7 + '@babel/helper-module-imports': 7.25.7(supports-color@5.5.0) '@babel/helper-plugin-utils': 7.25.7 '@babel/helper-remap-async-to-generator': 7.25.7(@babel/core@7.25.2) transitivePeerDependencies: @@ -8933,7 +8902,7 @@ snapshots: '@babel/helper-compilation-targets': 7.25.7 '@babel/helper-plugin-utils': 7.25.7 '@babel/helper-replace-supers': 7.25.7(@babel/core@7.25.2) - '@babel/traverse': 7.25.7 + '@babel/traverse': 7.25.7(supports-color@5.5.0) globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -8999,7 +8968,7 @@ snapshots: '@babel/core': 7.25.2 '@babel/helper-compilation-targets': 7.25.7 '@babel/helper-plugin-utils': 7.25.7 - '@babel/traverse': 7.25.7 + '@babel/traverse': 7.25.7(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -9048,7 +9017,7 @@ snapshots: '@babel/helper-module-transforms': 7.25.7(@babel/core@7.25.2) '@babel/helper-plugin-utils': 7.25.7 '@babel/helper-validator-identifier': 7.25.7 - '@babel/traverse': 7.25.7 + '@babel/traverse': 7.25.7(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -9158,7 +9127,7 @@ snapshots: dependencies: '@babel/core': 7.25.2 '@babel/helper-annotate-as-pure': 7.25.7 - '@babel/helper-module-imports': 7.25.7 + '@babel/helper-module-imports': 7.25.7(supports-color@5.5.0) '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-jsx': 7.25.7(@babel/core@7.25.2) '@babel/types': 7.25.7 @@ -9185,7 +9154,7 @@ snapshots: '@babel/plugin-transform-runtime@7.25.7(@babel/core@7.25.2)': dependencies: '@babel/core': 7.25.2 - '@babel/helper-module-imports': 7.25.7 + '@babel/helper-module-imports': 7.25.7(supports-color@5.5.0) '@babel/helper-plugin-utils': 7.25.7 babel-plugin-polyfill-corejs2: 0.4.11(@babel/core@7.25.2) babel-plugin-polyfill-corejs3: 0.10.6(@babel/core@7.25.2) @@ -9390,9 +9359,9 @@ snapshots: '@babel/template@7.25.0': dependencies: - '@babel/code-frame': 7.24.7 - '@babel/parser': 7.25.6 - '@babel/types': 7.25.6 + '@babel/code-frame': 7.25.7 + '@babel/parser': 7.25.7 + '@babel/types': 7.25.7 '@babel/template@7.25.7': dependencies: @@ -9401,18 +9370,6 @@ snapshots: '@babel/types': 7.25.7 '@babel/traverse@7.25.6': - dependencies: - '@babel/code-frame': 7.24.7 - '@babel/generator': 7.25.6 - '@babel/parser': 7.25.6 - '@babel/template': 7.25.0 - '@babel/types': 7.25.6 - debug: 4.3.6 - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - - '@babel/traverse@7.25.6(supports-color@5.5.0)': dependencies: '@babel/code-frame': 7.24.7 '@babel/generator': 7.25.6 @@ -9424,7 +9381,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/traverse@7.25.7': + '@babel/traverse@7.25.7(supports-color@5.5.0)': dependencies: '@babel/code-frame': 7.25.7 '@babel/generator': 7.25.7 @@ -9470,7 +9427,7 @@ snapshots: '@emotion/babel-plugin@11.12.0': dependencies: - '@babel/helper-module-imports': 7.24.7(supports-color@5.5.0) + '@babel/helper-module-imports': 7.25.7(supports-color@5.5.0) '@babel/runtime': 7.25.7 '@emotion/hash': 0.9.2 '@emotion/memoize': 0.9.0 @@ -9622,7 +9579,7 @@ snapshots: '@eslint/eslintrc@2.1.4': dependencies: ajv: 6.12.6 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) espree: 9.6.1 globals: 13.24.0 ignore: 5.3.2 @@ -9675,7 +9632,7 @@ snapshots: '@humanwhocodes/config-array@0.11.14': dependencies: '@humanwhocodes/object-schema': 2.0.3 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -10669,7 +10626,7 @@ snapshots: '@rollup/plugin-babel@6.0.4(@babel/core@7.25.2)(@types/babel__core@7.20.5)(rollup@4.24.0)': dependencies: '@babel/core': 7.25.2 - '@babel/helper-module-imports': 7.24.7(supports-color@5.5.0) + '@babel/helper-module-imports': 7.24.7 '@rollup/pluginutils': 5.1.2(rollup@4.24.0) optionalDependencies: '@types/babel__core': 7.20.5 @@ -11372,24 +11329,24 @@ snapshots: '@types/babel__core@7.20.5': dependencies: - '@babel/parser': 7.25.6 - '@babel/types': 7.25.6 + '@babel/parser': 7.25.7 + '@babel/types': 7.25.7 '@types/babel__generator': 7.6.8 '@types/babel__template': 7.4.4 '@types/babel__traverse': 7.20.6 '@types/babel__generator@7.6.8': dependencies: - '@babel/types': 7.25.6 + '@babel/types': 7.25.7 '@types/babel__template@7.4.4': dependencies: - '@babel/parser': 7.25.6 - '@babel/types': 7.25.6 + '@babel/parser': 7.25.7 + '@babel/types': 7.25.7 '@types/babel__traverse@7.20.6': dependencies: - '@babel/types': 7.25.6 + '@babel/types': 7.25.7 '@types/bcrypt@5.0.2': dependencies: @@ -11748,7 +11705,7 @@ snapshots: '@typescript-eslint/types': 7.18.0 '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.4.5) '@typescript-eslint/visitor-keys': 7.18.0 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) eslint: 8.57.0 optionalDependencies: typescript: 5.4.5 @@ -11764,7 +11721,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.4.5) '@typescript-eslint/utils': 7.18.0(eslint@8.57.0)(typescript@5.4.5) - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) eslint: 8.57.0 ts-api-utils: 1.3.0(typescript@5.4.5) optionalDependencies: @@ -11778,7 +11735,7 @@ snapshots: dependencies: '@typescript-eslint/types': 7.18.0 '@typescript-eslint/visitor-keys': 7.18.0 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.5 @@ -11967,7 +11924,7 @@ snapshots: agent-base@6.0.2: dependencies: - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -12177,8 +12134,8 @@ snapshots: babel-plugin-jest-hoist@29.6.3: dependencies: - '@babel/template': 7.25.0 - '@babel/types': 7.25.6 + '@babel/template': 7.25.7 + '@babel/types': 7.25.7 '@types/babel__core': 7.20.5 '@types/babel__traverse': 7.20.6 @@ -12215,8 +12172,8 @@ snapshots: babel-plugin-styled-components@2.1.4(@babel/core@7.25.2)(styled-components@5.3.9(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1))(supports-color@5.5.0): dependencies: '@babel/helper-annotate-as-pure': 7.25.7 - '@babel/helper-module-imports': 7.24.7(supports-color@5.5.0) - '@babel/plugin-syntax-jsx': 7.24.7(@babel/core@7.25.2) + '@babel/helper-module-imports': 7.25.7(supports-color@5.5.0) + '@babel/plugin-syntax-jsx': 7.25.7(@babel/core@7.25.2) lodash: 4.17.21 picomatch: 2.3.1 styled-components: 5.3.9(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1) @@ -12879,10 +12836,6 @@ snapshots: dependencies: ms: 2.1.3 - debug@4.3.6: - dependencies: - ms: 2.1.2 - debug@4.3.6(supports-color@5.5.0): dependencies: ms: 2.1.2 @@ -13338,7 +13291,7 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 @@ -13935,7 +13888,7 @@ snapshots: https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -14192,7 +14145,7 @@ snapshots: istanbul-lib-instrument@5.2.1: dependencies: '@babel/core': 7.25.2 - '@babel/parser': 7.25.6 + '@babel/parser': 7.25.7 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 semver: 6.3.1 @@ -14202,7 +14155,7 @@ snapshots: istanbul-lib-instrument@6.0.3: dependencies: '@babel/core': 7.25.2 - '@babel/parser': 7.25.6 + '@babel/parser': 7.25.7 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 semver: 7.6.3 @@ -14217,7 +14170,7 @@ snapshots: istanbul-lib-source-maps@4.0.1: dependencies: - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) istanbul-lib-coverage: 3.2.2 source-map: 0.6.1 transitivePeerDependencies: @@ -15241,7 +15194,7 @@ snapshots: parse-json@5.2.0: dependencies: - '@babel/code-frame': 7.24.7 + '@babel/code-frame': 7.25.7 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -16311,8 +16264,8 @@ snapshots: styled-components@5.3.9(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1): dependencies: - '@babel/helper-module-imports': 7.24.7(supports-color@5.5.0) - '@babel/traverse': 7.25.6(supports-color@5.5.0) + '@babel/helper-module-imports': 7.25.7(supports-color@5.5.0) + '@babel/traverse': 7.25.7(supports-color@5.5.0) '@emotion/is-prop-valid': 1.3.1 '@emotion/stylis': 0.8.5 '@emotion/unitless': 0.7.5 @@ -16364,7 +16317,7 @@ snapshots: dependencies: component-emitter: 1.3.1 cookiejar: 2.1.4 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) fast-safe-stringify: 2.1.1 form-data: 4.0.0 formidable: 3.5.1 @@ -16683,7 +16636,7 @@ snapshots: chalk: 4.1.2 cli-highlight: 2.1.11 dayjs: 1.11.13 - debug: 4.3.6 + debug: 4.3.6(supports-color@5.5.0) dotenv: 16.4.5 glob: 10.4.5 mkdirp: 2.1.6 diff --git a/shared/entities/carbon-inputs/ecosystem-extent.entity.ts b/shared/entities/carbon-inputs/ecosystem-extent.entity.ts index 6404701e..623130ea 100644 --- a/shared/entities/carbon-inputs/ecosystem-extent.entity.ts +++ b/shared/entities/carbon-inputs/ecosystem-extent.entity.ts @@ -20,6 +20,9 @@ export class EcosystemExtent extends BaseEntity { @JoinColumn({ name: "country_code" }) country: Country; + @Column({ name: "country_code", type: "char", length: 3 }) + countryCode: string; + @Column({ name: "ecosystem", enum: ECOSYSTEM, type: "enum" }) ecosystem: ECOSYSTEM; diff --git a/shared/entities/carbon-inputs/ecosystem-loss.entity.ts b/shared/entities/carbon-inputs/ecosystem-loss.entity.ts index 975a7927..7e34195b 100644 --- a/shared/entities/carbon-inputs/ecosystem-loss.entity.ts +++ b/shared/entities/carbon-inputs/ecosystem-loss.entity.ts @@ -20,6 +20,9 @@ export class EcosystemLoss extends BaseEntity { @JoinColumn({ name: "country_code" }) country: Country; + @Column({ name: "country_code", type: "char", length: 3 }) + countryCode: string; + @Column({ name: "ecosystem", enum: ECOSYSTEM, type: "enum" }) ecosystem: ECOSYSTEM; diff --git a/shared/entities/carbon-inputs/emission-factors.entity.ts b/shared/entities/carbon-inputs/emission-factors.entity.ts index a0c92443..99f9459c 100644 --- a/shared/entities/carbon-inputs/emission-factors.entity.ts +++ b/shared/entities/carbon-inputs/emission-factors.entity.ts @@ -29,6 +29,9 @@ export class EmissionFactors extends BaseEntity { @JoinColumn({ name: "country_code" }) country: Country; + @Column({ name: "country_code", type: "char", length: 3 }) + countryCode: string; + @Column({ name: "ecosystem", enum: ECOSYSTEM, type: "enum" }) ecosystem: ECOSYSTEM; diff --git a/shared/entities/carbon-inputs/restorable-land.entity.ts b/shared/entities/carbon-inputs/restorable-land.entity.ts index 6609dec2..d9480cdf 100644 --- a/shared/entities/carbon-inputs/restorable-land.entity.ts +++ b/shared/entities/carbon-inputs/restorable-land.entity.ts @@ -20,6 +20,9 @@ export class RestorableLand extends BaseEntity { @JoinColumn({ name: "country_code" }) country: Country; + @Column({ name: "country_code", type: "char", length: 3 }) + countryCode: string; + @Column({ name: "ecosystem", enum: ECOSYSTEM, type: "enum" }) ecosystem: ECOSYSTEM; diff --git a/shared/entities/carbon-inputs/sequestration-rate.entity.ts b/shared/entities/carbon-inputs/sequestration-rate.entity.ts index 28f52b10..c2617cf2 100644 --- a/shared/entities/carbon-inputs/sequestration-rate.entity.ts +++ b/shared/entities/carbon-inputs/sequestration-rate.entity.ts @@ -30,6 +30,9 @@ export class SequestrationRate extends BaseEntity { @JoinColumn({ name: "country_code" }) country: Country; + @Column({ name: "country_code", type: "char", length: 3 }) + countryCode: string; + @Column({ name: "ecosystem", enum: ECOSYSTEM, type: "enum" }) ecosystem: ECOSYSTEM; diff --git a/shared/entities/cost-inputs/baseline-reassessment.entity.ts b/shared/entities/cost-inputs/baseline-reassessment.entity.ts index bf459e6e..b62cee50 100644 --- a/shared/entities/cost-inputs/baseline-reassessment.entity.ts +++ b/shared/entities/cost-inputs/baseline-reassessment.entity.ts @@ -19,6 +19,9 @@ export class BaselineReassessment extends BaseEntity { @JoinColumn({ name: "country_code" }) country: Country; + @Column({ name: "country_code", type: "char", length: 3 }) + countryCode: string; + @Column("decimal", { name: "baseline_reassessment_cost_per_event" }) baselineReassessmentCost: number; } diff --git a/shared/entities/cost-inputs/blue-carbon-project-planning.entity.ts b/shared/entities/cost-inputs/blue-carbon-project-planning.entity.ts index 0522027c..5395e69b 100644 --- a/shared/entities/cost-inputs/blue-carbon-project-planning.entity.ts +++ b/shared/entities/cost-inputs/blue-carbon-project-planning.entity.ts @@ -27,6 +27,9 @@ export class BlueCarbonProjectPlanning extends BaseEntity { @JoinColumn({ name: "country_code" }) country: Country; + @Column({ name: "country_code", type: "char", length: 3 }) + countryCode: string; + @Column({ type: "enum", enum: INPUT_SELECTION, diff --git a/shared/entities/cost-inputs/carbon-standard-fees.entity.ts b/shared/entities/cost-inputs/carbon-standard-fees.entity.ts index 82e181b0..f196c691 100644 --- a/shared/entities/cost-inputs/carbon-standard-fees.entity.ts +++ b/shared/entities/cost-inputs/carbon-standard-fees.entity.ts @@ -19,6 +19,9 @@ export class CarbonStandardFees extends BaseEntity { @JoinColumn({ name: "country_code" }) country: Country; + @Column({ name: "country_code", type: "char", length: 3 }) + countryCode: string; + @Column("decimal", { name: "cost_per_carbon_credit_issued" }) carbonStandardFee: number; } diff --git a/shared/entities/cost-inputs/community-benefit-sharing-fund.entity.ts b/shared/entities/cost-inputs/community-benefit-sharing-fund.entity.ts index 37a70ba3..12810064 100644 --- a/shared/entities/cost-inputs/community-benefit-sharing-fund.entity.ts +++ b/shared/entities/cost-inputs/community-benefit-sharing-fund.entity.ts @@ -19,6 +19,9 @@ export class CommunityBenefitSharingFund extends BaseEntity { @JoinColumn({ name: "country_code" }) country: Country; + @Column({ name: "country_code", type: "char", length: 3 }) + countryCode: string; + @Column("decimal", { name: "community_benefit_sharing_fund_pc_of_revenue" }) communityBenefitSharingFund: number; } diff --git a/shared/entities/cost-inputs/community-cash-flow.entity.ts b/shared/entities/cost-inputs/community-cash-flow.entity.ts index 5349ad92..49d60fcc 100644 --- a/shared/entities/cost-inputs/community-cash-flow.entity.ts +++ b/shared/entities/cost-inputs/community-cash-flow.entity.ts @@ -24,6 +24,9 @@ export class CommunityCashFlow extends BaseEntity { @JoinColumn({ name: "country_code" }) country: Country; + @Column({ name: "country_code", type: "char", length: 3 }) + countryCode: string; + @Column({ type: "enum", enum: COMMUNITY_CASH_FLOW_TYPES, nullable: true }) cashflowType: COMMUNITY_CASH_FLOW_TYPES; } diff --git a/shared/entities/cost-inputs/community-representation.entity.ts b/shared/entities/cost-inputs/community-representation.entity.ts index f2c3f897..40d1b670 100644 --- a/shared/entities/cost-inputs/community-representation.entity.ts +++ b/shared/entities/cost-inputs/community-representation.entity.ts @@ -20,6 +20,9 @@ export class CommunityRepresentation extends BaseEntity { @JoinColumn({ name: "country_code" }) country: Country; + @Column({ name: "country_code", type: "char", length: 3 }) + countryCode: string; + @Column({ name: "ecosystem", enum: ECOSYSTEM, type: "enum" }) ecosystem: ECOSYSTEM; diff --git a/shared/entities/cost-inputs/conservation-and-planning-admin.entity.ts b/shared/entities/cost-inputs/conservation-and-planning-admin.entity.ts index 02867df7..96feea7d 100644 --- a/shared/entities/cost-inputs/conservation-and-planning-admin.entity.ts +++ b/shared/entities/cost-inputs/conservation-and-planning-admin.entity.ts @@ -20,6 +20,9 @@ export class ConservationPlanningAndAdmin extends BaseEntity { @JoinColumn({ name: "country_code" }) country: Country; + @Column({ name: "country_code", type: "char", length: 3 }) + countryCode: string; + @Column({ name: "ecosystem", enum: ECOSYSTEM, type: "enum" }) ecosystem: ECOSYSTEM; diff --git a/shared/entities/cost-inputs/data-collection-and-field-costs.entity.ts b/shared/entities/cost-inputs/data-collection-and-field-costs.entity.ts index 1b23afbe..e450c5cb 100644 --- a/shared/entities/cost-inputs/data-collection-and-field-costs.entity.ts +++ b/shared/entities/cost-inputs/data-collection-and-field-costs.entity.ts @@ -20,6 +20,9 @@ export class DataCollectionAndFieldCosts extends BaseEntity { @JoinColumn({ name: "country_code" }) country: Country; + @Column({ name: "country_code", type: "char", length: 3 }) + countryCode: string; + @Column({ name: "ecosystem", enum: ECOSYSTEM, type: "enum" }) ecosystem: ECOSYSTEM; diff --git a/shared/entities/cost-inputs/establishing-carbon-rights.entity.ts b/shared/entities/cost-inputs/establishing-carbon-rights.entity.ts index c430df40..a5d9a2d5 100644 --- a/shared/entities/cost-inputs/establishing-carbon-rights.entity.ts +++ b/shared/entities/cost-inputs/establishing-carbon-rights.entity.ts @@ -19,6 +19,9 @@ export class CarbonRights extends BaseEntity { @JoinColumn({ name: "country_code" }) country: Country; + @Column({ name: "country_code", type: "char", length: 3 }) + countryCode: string; + @Column("decimal", { name: "carbon_rights_cost" }) carbonRightsCost: number; } diff --git a/shared/entities/cost-inputs/feasability-analysis.entity.ts b/shared/entities/cost-inputs/feasability-analysis.entity.ts index 3e7e6c6c..3dff7406 100644 --- a/shared/entities/cost-inputs/feasability-analysis.entity.ts +++ b/shared/entities/cost-inputs/feasability-analysis.entity.ts @@ -20,6 +20,9 @@ export class FeasibilityAnalysis extends BaseEntity { @JoinColumn({ name: "country_code" }) country: Country; + @Column({ name: "country_code", type: "char", length: 3 }) + countryCode: string; + @Column({ name: "ecosystem", enum: ECOSYSTEM, type: "enum" }) ecosystem: ECOSYSTEM; diff --git a/shared/entities/cost-inputs/financing-cost.entity.ts b/shared/entities/cost-inputs/financing-cost.entity.ts index babe28d0..4766f8e1 100644 --- a/shared/entities/cost-inputs/financing-cost.entity.ts +++ b/shared/entities/cost-inputs/financing-cost.entity.ts @@ -19,6 +19,9 @@ export class FinancingCost extends BaseEntity { @JoinColumn({ name: "country_code" }) country: Country; + @Column({ name: "country_code", type: "char", length: 3 }) + countryCode: string; + @Column("decimal", { name: "financing_cost_capex_percent" }) financingCostCapexPercent: number; } diff --git a/shared/entities/cost-inputs/implementation-labor-cost.entity.ts b/shared/entities/cost-inputs/implementation-labor-cost.entity.ts index 77bfc9fa..a732c598 100644 --- a/shared/entities/cost-inputs/implementation-labor-cost.entity.ts +++ b/shared/entities/cost-inputs/implementation-labor-cost.entity.ts @@ -20,6 +20,9 @@ export class ImplementationLaborCost extends BaseEntity { @JoinColumn({ name: "country_code" }) country: Country; + @Column({ name: "country_code", type: "char", length: 3 }) + countryCode: string; + @Column({ name: "ecosystem", enum: ECOSYSTEM, type: "enum" }) ecosystem: ECOSYSTEM; diff --git a/shared/entities/cost-inputs/long-term-project-operating.entity.ts b/shared/entities/cost-inputs/long-term-project-operating.entity.ts index 03028c96..c0a06ada 100644 --- a/shared/entities/cost-inputs/long-term-project-operating.entity.ts +++ b/shared/entities/cost-inputs/long-term-project-operating.entity.ts @@ -20,6 +20,9 @@ export class LongTermProjectOperating extends BaseEntity { @JoinColumn({ name: "country_code" }) country: Country; + @Column({ name: "country_code", type: "char", length: 3 }) + countryCode: string; + @Column({ name: "ecosystem", enum: ECOSYSTEM, type: "enum" }) ecosystem: ECOSYSTEM; diff --git a/shared/entities/cost-inputs/maintenance.entity.ts b/shared/entities/cost-inputs/maintenance.entity.ts index 0d9ef713..a5dd01ba 100644 --- a/shared/entities/cost-inputs/maintenance.entity.ts +++ b/shared/entities/cost-inputs/maintenance.entity.ts @@ -19,6 +19,9 @@ export class Maintenance extends BaseEntity { @JoinColumn({ name: "country_code" }) country: Country; + @Column({ name: "country_code", type: "char", length: 3 }) + countryCode: string; + @Column("decimal", { name: "maintenance_cost_pc_of_impl_labor_cost" }) maintenanceCost: number; diff --git a/shared/entities/cost-inputs/monitoring.entity.ts b/shared/entities/cost-inputs/monitoring.entity.ts index df8891f9..49fa2322 100644 --- a/shared/entities/cost-inputs/monitoring.entity.ts +++ b/shared/entities/cost-inputs/monitoring.entity.ts @@ -20,6 +20,9 @@ export class MonitoringCost extends BaseEntity { @JoinColumn({ name: "country_code" }) country: Country; + @Column({ name: "country_code", type: "char", length: 3 }) + countryCode: string; + @Column({ name: "ecosystem", enum: ECOSYSTEM, type: "enum" }) ecosystem: ECOSYSTEM; diff --git a/shared/entities/cost-inputs/mrv.entity.ts b/shared/entities/cost-inputs/mrv.entity.ts index bc5820f5..0484860d 100644 --- a/shared/entities/cost-inputs/mrv.entity.ts +++ b/shared/entities/cost-inputs/mrv.entity.ts @@ -19,6 +19,9 @@ export class MRV extends BaseEntity { @JoinColumn({ name: "country_code" }) country: Country; + @Column({ name: "country_code", type: "char", length: 3 }) + countryCode: string; + @Column("decimal", { name: "mrv_cost_per_event" }) mrvCost: number; } diff --git a/shared/entities/cost-inputs/project-size.entity.ts b/shared/entities/cost-inputs/project-size.entity.ts index 4c1a9166..73c62ba5 100644 --- a/shared/entities/cost-inputs/project-size.entity.ts +++ b/shared/entities/cost-inputs/project-size.entity.ts @@ -17,16 +17,21 @@ export class ProjectSize extends BaseEntity { @PrimaryGeneratedColumn("uuid") id: string; - @ManyToOne(() => Country, (country) => country.code, { onDelete: "CASCADE" }) + @ManyToOne(() => Country, (country) => country.code, { + onDelete: "CASCADE", + }) @JoinColumn({ name: "country_code" }) country: Country; + @Column({ name: "country_code", type: "char", length: 3 }) + countryCode: string; + @Column({ name: "ecosystem", enum: ECOSYSTEM, type: "enum" }) ecosystem: ECOSYSTEM; @Column({ name: "activity", enum: ACTIVITY, type: "enum" }) activity: ACTIVITY; - @Column("decimal", { name: "size" }) + @Column({ name: "size", type: "decimal" }) sizeHa: number; } diff --git a/shared/entities/cost-inputs/validation.entity.ts b/shared/entities/cost-inputs/validation.entity.ts index f7d5b843..f3ed44ed 100644 --- a/shared/entities/cost-inputs/validation.entity.ts +++ b/shared/entities/cost-inputs/validation.entity.ts @@ -19,6 +19,9 @@ export class ValidationCost extends BaseEntity { @JoinColumn({ name: "country_code" }) country: Country; + @Column({ name: "country_code", type: "char", length: 3 }) + countryCode: string; + @Column("decimal", { name: "validation_cost" }) validationCost: number; } diff --git a/shared/entities/country.entity.ts b/shared/entities/country.entity.ts index 38f493c9..8b24e125 100644 --- a/shared/entities/country.entity.ts +++ b/shared/entities/country.entity.ts @@ -50,6 +50,7 @@ export class Country extends BaseEntity { srid: 4326, // TODO: Make it nullable false once we have all the data nullable: true, + select: false, }) geometry: Geometry; } diff --git a/shared/entities/projects.entity.ts b/shared/entities/projects.entity.ts index 2b209d5b..13dd5eaf 100644 --- a/shared/entities/projects.entity.ts +++ b/shared/entities/projects.entity.ts @@ -52,8 +52,8 @@ export class Project extends BaseEntity { // TODO: We need to make this a somehow enum, as a subactivity of restoration, that can be null for conservation, and can represent all restoration activities @Column({ name: "restoration_activity", - type: "varchar", - length: 255, + type: "enum", + enum: RESTORATION_ACTIVITY_SUBTYPE, nullable: true, }) restorationActivity: RESTORATION_ACTIVITY_SUBTYPE; diff --git a/tsconfig.json b/tsconfig.json index 8fcbed30..c7c145e1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,6 +16,7 @@ "@shared/*": ["./shared/*"], "@data/*": ["./data/*"] }, - "allowSyntheticDefaultImports": true + "allowSyntheticDefaultImports": true, + "jsx": "react" } } \ No newline at end of file