From 2298e185875ef43122ea2b34e9b1dd35e076a255 Mon Sep 17 00:00:00 2001 From: andrea rota Date: Mon, 11 Jul 2022 16:47:05 +0200 Subject: [PATCH] remove feature tags --- .../api/1657544835000-RemoveFeatureTags.ts | 39 +++++++++++++++++++ .../geo-feature-set.api.entity.ts | 5 --- .../geo-features/geo-feature.api.entity.ts | 5 --- .../geo-features/geo-features-request-info.ts | 2 - .../geo-features/geo-features.service.ts | 10 ----- .../projects/dto/upload-shapefile.dto.ts | 5 --- .../modules/projects/projects.controller.ts | 3 -- .../__mocks__/scenario-features.view-data.ts | 3 -- .../scenario-features-gap-data.service.ts | 2 - ...enario-features-output-gap-data.service.ts | 2 - .../scenario-features.service.spec.ts | 2 - .../scenario-features.service.ts | 2 - api/apps/api/test/fixtures/test-features.sql | 12 +++++- .../get-scenario-features.e2e-spec.ts | 7 ---- .../upload-feature/upload-feature.fixtures.ts | 3 -- .../project-custom-features.piece-exporter.ts | 3 -- .../features.legacy-piece-importer.ts | 2 - .../test/integration/cloning/fixtures.ts | 2 - ...s-specification.piece-exporter.e2e-spec.ts | 1 - ...custom-features.piece-importer.e2e-spec.ts | 2 - ...fication.legacy-piece-importer.e2e-spec.ts | 1 - .../blm-calibration-run.e2e-spec.ts | 3 +- .../marxan-run/marxan-run.e2e-spec.ts | 3 +- .../project-custom-features.ts | 4 +- api/libs/features/src/domain/feature-tag.ts | 4 -- api/libs/features/src/domain/index.ts | 1 - api/libs/features/src/index.ts | 1 - .../src/scenario-features-data.geo.entity.ts | 7 ---- .../scenario-features-gap-data.geo.entity.ts | 6 --- 29 files changed, 52 insertions(+), 90 deletions(-) create mode 100644 api/apps/api/src/migrations/api/1657544835000-RemoveFeatureTags.ts delete mode 100644 api/libs/features/src/domain/feature-tag.ts delete mode 100644 api/libs/features/src/domain/index.ts diff --git a/api/apps/api/src/migrations/api/1657544835000-RemoveFeatureTags.ts b/api/apps/api/src/migrations/api/1657544835000-RemoveFeatureTags.ts new file mode 100644 index 0000000000..9c2dd38a66 --- /dev/null +++ b/api/apps/api/src/migrations/api/1657544835000-RemoveFeatureTags.ts @@ -0,0 +1,39 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; + +export class RemoveFeatureTags1657544835000 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(` + ALTER TABLE features + DROP COLUMN tag; + `); + + await queryRunner.query(` + DROP TYPE features_tags; + `); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(` + CREATE TYPE "features_tags" AS ENUM ( + 'bioregional', + 'species' + ); + `); + + /** + * As we cannot know whether existing features are of bioregional or + * species kind, we set them all as "bioregional" arbitrarily. This should + * not really apply in practice, of course. + */ + await queryRunner.query(` + ALTER TABLE features + ADD COLUMN tag features_tags; + + UPDATE features + SET tag = 'bioregional'; + + ALTER TABLE features + ALTER COLUMN tag SET NOT NULL; + `); + } +} diff --git a/api/apps/api/src/modules/geo-features/geo-feature-set.api.entity.ts b/api/apps/api/src/modules/geo-features/geo-feature-set.api.entity.ts index 13cee75c4a..4966de8481 100644 --- a/api/apps/api/src/modules/geo-features/geo-feature-set.api.entity.ts +++ b/api/apps/api/src/modules/geo-features/geo-feature-set.api.entity.ts @@ -12,11 +12,6 @@ export const geoFeatureResource: BaseServiceResource = { moduleControllerPrefix: 'geo-features', }; -export enum FeatureTags { - bioregional = 'bioregional', - species = 'species', -} - export interface GeoFeatureCategory { key: string; distinctValues: string[]; diff --git a/api/apps/api/src/modules/geo-features/geo-feature.api.entity.ts b/api/apps/api/src/modules/geo-features/geo-feature.api.entity.ts index 3d10d5ca4a..ef0498d209 100644 --- a/api/apps/api/src/modules/geo-features/geo-feature.api.entity.ts +++ b/api/apps/api/src/modules/geo-features/geo-feature.api.entity.ts @@ -8,7 +8,6 @@ import { PrimaryColumn, } from 'typeorm'; import { BaseServiceResource } from '@marxan-api/types/resource.interface'; -import { FeatureTag } from '@marxan/features/domain'; import { JobStatus } from '../scenarios/scenario.api.entity'; import { Project } from '../projects/project.api.entity'; import { User } from '../users/user.api.entity'; @@ -62,10 +61,6 @@ export class GeoFeature extends BaseEntity { @Column('uuid') intersection?: string[]; - @ApiProperty() - @Column('varchar') - tag!: FeatureTag; - @Column('varchar', { name: 'creation_status' }) creationStatus?: JobStatus; diff --git a/api/apps/api/src/modules/geo-features/geo-features-request-info.ts b/api/apps/api/src/modules/geo-features/geo-features-request-info.ts index 20bc677e73..9999b2d418 100644 --- a/api/apps/api/src/modules/geo-features/geo-features-request-info.ts +++ b/api/apps/api/src/modules/geo-features/geo-features-request-info.ts @@ -1,6 +1,5 @@ import { AppInfoDTO } from '@marxan-api/dto/info.dto'; import { BBox } from 'geojson'; -import { FeatureTags } from './geo-feature-set.api.entity'; export interface GeoFeaturesRequestInfo extends AppInfoDTO { params?: { @@ -8,6 +7,5 @@ export interface GeoFeaturesRequestInfo extends AppInfoDTO { projectId?: string; bbox?: BBox; ids?: string[]; - featureTag?: FeatureTags | FeatureTags[]; }; } diff --git a/api/apps/api/src/modules/geo-features/geo-features.service.ts b/api/apps/api/src/modules/geo-features/geo-features.service.ts index 88c849f9ef..b940197aa7 100644 --- a/api/apps/api/src/modules/geo-features/geo-features.service.ts +++ b/api/apps/api/src/modules/geo-features/geo-features.service.ts @@ -36,7 +36,6 @@ const geoFeatureFilterKeyNames = [ 'description', 'source', 'propertyName', - 'tag', 'projectId', ] as const; type GeoFeatureFilterKeys = keyof Pick< @@ -87,7 +86,6 @@ export class GeoFeaturesService extends AppBaseService< 'source', 'propertyName', 'intersection', - 'tag', 'properties', 'isCustom', ], @@ -160,7 +158,6 @@ export class GeoFeaturesService extends AppBaseService< * at some point, per project] * 2 move api.features into geo.features_data ... * 3 which also fixes issues with: - * * searching via tag * * searching via name * * pagination * * searching within one query (table) and single db @@ -227,12 +224,6 @@ export class GeoFeaturesService extends AppBaseService< ); } - if (info.params?.featureTag) { - queryFilteredByPublicOrProjectSpecificFeatures.andWhere( - `${this.alias}.tag = :tag`, - { tag: info.params.featureTag }, - ); - } return queryFilteredByPublicOrProjectSpecificFeatures; } @@ -363,7 +354,6 @@ export class GeoFeaturesService extends AppBaseService< id: v4(), featureClassName: data.name, description: data.description, - tag: data.type, projectId, creationStatus: JobStatus.done, }), diff --git a/api/apps/api/src/modules/projects/dto/upload-shapefile.dto.ts b/api/apps/api/src/modules/projects/dto/upload-shapefile.dto.ts index 508854220f..9b9833bffc 100644 --- a/api/apps/api/src/modules/projects/dto/upload-shapefile.dto.ts +++ b/api/apps/api/src/modules/projects/dto/upload-shapefile.dto.ts @@ -1,4 +1,3 @@ -import { FeatureTag } from '@marxan/features'; import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; import { IsEnum, IsOptional, IsString } from 'class-validator'; @@ -7,10 +6,6 @@ export class UploadShapefileDTO { @IsString() name!: string; - @ApiProperty() - @IsEnum(Object.values(FeatureTag)) - type!: FeatureTag; - @ApiPropertyOptional() @IsOptional() @IsString() diff --git a/api/apps/api/src/modules/projects/projects.controller.ts b/api/apps/api/src/modules/projects/projects.controller.ts index 943e8c45fb..eda96431da 100644 --- a/api/apps/api/src/modules/projects/projects.controller.ts +++ b/api/apps/api/src/modules/projects/projects.controller.ts @@ -70,7 +70,6 @@ import { ShapefileService } from '@marxan/shapefile-converter'; import { isFeatureCollection } from '@marxan/utils'; import { asyncJobTag } from '@marxan-api/dto/async-job-tag'; import { inlineJobTag } from '@marxan-api/dto/inline-job-tag'; -import { FeatureTags } from '@marxan-api/modules/geo-features/geo-feature-set.api.entity'; import { UpdateProjectBlmRangeDTO } from '@marxan-api/modules/projects/dto/update-project-blm-range.dto'; import { invalidRange } from '@marxan-api/modules/projects/blm'; import { @@ -172,7 +171,6 @@ export class ProjectsController { @Param('projectId', ParseUUIDPipe) projectId: string, @Req() req: RequestWithAuthenticatedUser, @Query('q') featureClassAndAliasFilter?: string, - @Query('tag') featureTag?: FeatureTags, ): Promise { const result = await this.projectsService.findAllGeoFeatures( fetchSpecification, @@ -181,7 +179,6 @@ export class ProjectsController { params: { projectId: projectId, featureClassAndAliasFilter: featureClassAndAliasFilter, - featureTag, }, }, ); diff --git a/api/apps/api/src/modules/scenarios-features/__mocks__/scenario-features.view-data.ts b/api/apps/api/src/modules/scenarios-features/__mocks__/scenario-features.view-data.ts index c6e9748047..f08b55b91c 100644 --- a/api/apps/api/src/modules/scenarios-features/__mocks__/scenario-features.view-data.ts +++ b/api/apps/api/src/modules/scenarios-features/__mocks__/scenario-features.view-data.ts @@ -1,5 +1,4 @@ import { ScenarioFeaturesData } from '@marxan/features'; -import { FeatureTag } from '@marxan/features/domain'; import { GeoFeature } from '../../geo-features/geo-feature.api.entity'; const featureIdMet = `feature-uuid-1-criteria-met`; @@ -56,13 +55,11 @@ export const getValidGeoFeature = (): GeoFeature[] => { entity1.id = metaFeatureIdMet; entity1.alias = 'feature-alias-1'; entity1.description = 'feature-desc-1'; - entity1.tag = FeatureTag.Bioregional; const entity2 = new GeoFeature(); entity2.id = metaFeatureIdFailed; entity2.alias = 'feature-alias-2'; entity2.description = 'feature-desc-2'; - entity2.tag = FeatureTag.Species; return [entity1, entity2]; }; diff --git a/api/apps/api/src/modules/scenarios-features/scenario-features-gap-data.service.ts b/api/apps/api/src/modules/scenarios-features/scenario-features-gap-data.service.ts index 852b503a5d..a1e63d8861 100644 --- a/api/apps/api/src/modules/scenarios-features/scenario-features-gap-data.service.ts +++ b/api/apps/api/src/modules/scenarios-features/scenario-features-gap-data.service.ts @@ -177,7 +177,6 @@ export class ScenarioFeaturesGapDataService extends AppBaseService< 'coverageTarget', 'featureClassName', 'name', - 'tag', 'description', ], keyForAttribute: 'camelCase', @@ -191,7 +190,6 @@ export class ScenarioFeaturesGapDataService extends AppBaseService< return { ...base, featureClassName: assign.featureClassName ?? undefined, - tag: assign.tag, name: assign.alias ?? undefined, // `null` description: assign.description ?? undefined, }; diff --git a/api/apps/api/src/modules/scenarios-features/scenario-features-output-gap-data.service.ts b/api/apps/api/src/modules/scenarios-features/scenario-features-output-gap-data.service.ts index 3394a90fb3..3be8f0eaf0 100644 --- a/api/apps/api/src/modules/scenarios-features/scenario-features-output-gap-data.service.ts +++ b/api/apps/api/src/modules/scenarios-features/scenario-features-output-gap-data.service.ts @@ -203,7 +203,6 @@ export class ScenarioFeaturesOutputGapDataService extends AppBaseService< 'coverageTarget', 'featureClassName', 'name', - 'tag', 'description', ], keyForAttribute: 'camelCase', @@ -217,7 +216,6 @@ export class ScenarioFeaturesOutputGapDataService extends AppBaseService< return { ...base, featureClassName: assign.featureClassName ?? undefined, - tag: assign.tag, name: assign.alias ?? undefined, // `null` description: assign.description ?? undefined, }; diff --git a/api/apps/api/src/modules/scenarios-features/scenario-features.service.spec.ts b/api/apps/api/src/modules/scenarios-features/scenario-features.service.spec.ts index ae2c856b92..c75f2f8fdc 100644 --- a/api/apps/api/src/modules/scenarios-features/scenario-features.service.spec.ts +++ b/api/apps/api/src/modules/scenarios-features/scenario-features.service.spec.ts @@ -81,7 +81,6 @@ describe(`when looking for a scenario's features`, () => { "name": "feature-alias-1", "onTarget": true, "scenarioId": "scenarioId", - "tag": "bioregional", "target": 50, "target2": 0, "totalArea": 20000, @@ -100,7 +99,6 @@ describe(`when looking for a scenario's features`, () => { "name": "feature-alias-2", "onTarget": false, "scenarioId": "scenarioId", - "tag": "species", "target": 50, "target2": 0, "totalArea": 10000, diff --git a/api/apps/api/src/modules/scenarios-features/scenario-features.service.ts b/api/apps/api/src/modules/scenarios-features/scenario-features.service.ts index fb8727ccc8..5f07625103 100644 --- a/api/apps/api/src/modules/scenarios-features/scenario-features.service.ts +++ b/api/apps/api/src/modules/scenarios-features/scenario-features.service.ts @@ -84,7 +84,6 @@ export class ScenarioFeaturesService extends AppBaseService< attributes: [ 'description', 'name', - 'tag', 'onTarget', 'metArea', 'met', @@ -112,7 +111,6 @@ export class ScenarioFeaturesService extends AppBaseService< coverageTarget: +(base?.target ?? 0).toFixed(2), coverageTargetArea: +((totalArea * (base?.target ?? 0)) / 100).toFixed(2), totalArea: +totalArea.toFixed(2), - tag: assign.tag, name: assign.alias ?? undefined, // `null` description: assign.description ?? undefined, }; diff --git a/api/apps/api/test/fixtures/test-features.sql b/api/apps/api/test/fixtures/test-features.sql index 64c69ac63f..c34f88229c 100644 --- a/api/apps/api/test/fixtures/test-features.sql +++ b/api/apps/api/test/fixtures/test-features.sql @@ -1,5 +1,13 @@ INSERT INTO features -(feature_class_name, alias, description, property_name, intersection, tag, creation_status, created_by) +(feature_class_name, alias, description, property_name, intersection, creation_status, created_by) VALUES -('demo_acinonyx_jubatus', 'Acinonyx_jubatus', null, ' name', null, 'species', 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), ('demo_bucorvus_leadbeateri', 'Bucorvus_leadbeateri', null, ' id', null, 'species', 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), ('demo_ceratotherium_simum', 'Ceratotherium_simum', null, ' name', null, 'species', 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), ('demo_civettictis_civetta', 'Civettictis_civetta', null, ' id', null, 'species', 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), ('demo_diceros_bicornis', 'Diceros_bicornis', null, ' name', null, 'species', 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), ('demo_equus_quagga', 'Equus_quagga', null, ' name', null, 'species', 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), ('demo_giraffa_camelopardalis', 'Giraffa_camelopardalis', null, ' name', null, 'species', 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), ('demo_kobus_leche', 'Kobus_leche', null, ' name', null, 'species', 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), ('demo_panthera_pardus', 'Panthera_pardus', null, ' name', null, 'species', 'created', (SELECT id FROM users WHERE email = 'aa@example.com')); +('demo_acinonyx_jubatus', 'Acinonyx_jubatus', null, ' name', null, 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), +('demo_bucorvus_leadbeateri', 'Bucorvus_leadbeateri', null, ' id', null, 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), +('demo_ceratotherium_simum', 'Ceratotherium_simum', null, ' name', null, 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), +('demo_civettictis_civetta', 'Civettictis_civetta', null, ' id', null, 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), +('demo_diceros_bicornis', 'Diceros_bicornis', null, ' name', null, 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), +('demo_equus_quagga', 'Equus_quagga', null, ' name', null, 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), +('demo_giraffa_camelopardalis', 'Giraffa_camelopardalis', null, ' name', null, 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), +('demo_kobus_leche', 'Kobus_leche', null, ' name', null, 'created', (SELECT id FROM users WHERE email = 'aa@example.com')), +('demo_panthera_pardus', 'Panthera_pardus', null, ' name', null, 'created', (SELECT id FROM users WHERE email = 'aa@example.com')); diff --git a/api/apps/api/test/scenario-features/get-scenario-features.e2e-spec.ts b/api/apps/api/test/scenario-features/get-scenario-features.e2e-spec.ts index c8e0ffd67d..8faf44ed5d 100644 --- a/api/apps/api/test/scenario-features/get-scenario-features.e2e-spec.ts +++ b/api/apps/api/test/scenario-features/get-scenario-features.e2e-spec.ts @@ -47,7 +47,6 @@ describe(`when user is logged in`, () => { "met": 110.94, "metArea": 49461858904.37, "onTarget": true, - "tag": "species", "totalArea": 44582822387.74, }, Object { @@ -56,7 +55,6 @@ describe(`when user is logged in`, () => { "met": 0, "metArea": 0, "onTarget": false, - "tag": "species", "totalArea": 2369906750.34, }, Object { @@ -65,7 +63,6 @@ describe(`when user is logged in`, () => { "met": 0, "metArea": 0, "onTarget": false, - "tag": "species", "totalArea": 7556941342.9, }, Object { @@ -74,7 +71,6 @@ describe(`when user is logged in`, () => { "met": 237.02, "metArea": 41436305173.17, "onTarget": true, - "tag": "species", "totalArea": 17482394162.77, }, Object { @@ -83,7 +79,6 @@ describe(`when user is logged in`, () => { "met": 105.34, "metArea": 49461858904.37, "onTarget": true, - "tag": "species", "totalArea": 46952729138.08, }, Object { @@ -92,7 +87,6 @@ describe(`when user is logged in`, () => { "met": 163.6, "metArea": 47131396118.24, "onTarget": true, - "tag": "species", "totalArea": 28809765713.5, }, Object { @@ -101,7 +95,6 @@ describe(`when user is logged in`, () => { "met": 12.84, "metArea": 2330463199.05, "onTarget": false, - "tag": "species", "totalArea": 18142963424.57, }, ] diff --git a/api/apps/api/test/upload-feature/upload-feature.fixtures.ts b/api/apps/api/test/upload-feature/upload-feature.fixtures.ts index b7a9ebc399..b6b1a1a23e 100644 --- a/api/apps/api/test/upload-feature/upload-feature.fixtures.ts +++ b/api/apps/api/test/upload-feature/upload-feature.fixtures.ts @@ -24,7 +24,6 @@ export const getFixtures = async () => { }, ); const customFeatureName = `User custom feature ${Date.now()}`; - const customFeatureTag = `bioregional`; const customFeatureDesc = `User custom feature desc`; const geoFeaturesApiRepo: Repository = app.get( @@ -59,7 +58,6 @@ export const getFixtures = async () => { .attach(`file`, __dirname + `/wetlands.zip`) .field({ name: customFeatureName, - type: customFeatureTag, description: customFeatureDesc, }), ThenGeoFeaturesAreCreated: async (result: request.Response) => { @@ -79,7 +77,6 @@ export const getFixtures = async () => { alias: null, propertyName: null, intersection: null, - tag: customFeatureTag, creationStatus: `done`, projectId, isCustom: true, diff --git a/api/apps/geoprocessing/src/export/pieces-exporters/project-custom-features.piece-exporter.ts b/api/apps/geoprocessing/src/export/pieces-exporters/project-custom-features.piece-exporter.ts index 57f7a52bbd..05ac68d9c6 100644 --- a/api/apps/geoprocessing/src/export/pieces-exporters/project-custom-features.piece-exporter.ts +++ b/api/apps/geoprocessing/src/export/pieces-exporters/project-custom-features.piece-exporter.ts @@ -6,7 +6,6 @@ import { ProjectCustomFeature, ProjectCustomFeaturesContent, } from '@marxan/cloning/infrastructure/clone-piece-data/project-custom-features'; -import { FeatureTag } from '@marxan/features'; import { CloningFilesRepository } from '@marxan/cloning-files-repository'; import { GeometrySource } from '@marxan/geofeatures'; import { Injectable, Logger } from '@nestjs/common'; @@ -28,7 +27,6 @@ type ProjectCustomFeaturesSelectResult = { description: string; property_name: string; intersection: string[]; - tag: FeatureTag; creation_status: CreationStatus; list_property_keys: string[]; }; @@ -72,7 +70,6 @@ export class ProjectCustomFeaturesPieceExporter 'description', 'property_name', 'intersection', - 'tag', 'creation_status', 'list_property_keys', ]) diff --git a/api/apps/geoprocessing/src/legacy-project-import/legacy-piece-importers/features.legacy-piece-importer.ts b/api/apps/geoprocessing/src/legacy-project-import/legacy-piece-importers/features.legacy-piece-importer.ts index 6866e28e85..cd79fabb7b 100644 --- a/api/apps/geoprocessing/src/legacy-project-import/legacy-piece-importers/features.legacy-piece-importer.ts +++ b/api/apps/geoprocessing/src/legacy-project-import/legacy-piece-importers/features.legacy-piece-importer.ts @@ -4,7 +4,6 @@ import { ProjectsPuEntity, } from '@marxan-jobs/planning-unit-geometry'; import { JobStatus } from '@marxan/cloning/infrastructure/clone-piece-data/project-custom-features'; -import { FeatureTag } from '@marxan/features'; import { GeoFeatureGeometry, GeometrySource } from '@marxan/geofeatures'; import { LegacyProjectImportFileSnapshot, @@ -281,7 +280,6 @@ export class FeaturesLegacyProjectPieceImporter project_id: projectId, id: featureId, feature_class_name: feature.name, - tag: FeatureTag.Species, creation_status: JobStatus.created, created_by: input.ownerId, }; diff --git a/api/apps/geoprocessing/test/integration/cloning/fixtures.ts b/api/apps/geoprocessing/test/integration/cloning/fixtures.ts index 35c1f1aa54..e1cd43bdac 100644 --- a/api/apps/geoprocessing/test/integration/cloning/fixtures.ts +++ b/api/apps/geoprocessing/test/integration/cloning/fixtures.ts @@ -406,7 +406,6 @@ export async function GivenFeatures( .map((_, index) => ({ id: v4(), feature_class_name: `custom-${projectId}-${index + 1}`, - tag: 'species', creation_status: 'done', project_id: projectId, })); @@ -415,7 +414,6 @@ export async function GivenFeatures( .map((_, index) => ({ id: v4(), feature_class_name: `platform-${projectId}-${index + 1}`, - tag: 'species', creation_status: 'created', project_id: null, })); diff --git a/api/apps/geoprocessing/test/integration/cloning/piece-exporters/scenario-features-specification.piece-exporter.e2e-spec.ts b/api/apps/geoprocessing/test/integration/cloning/piece-exporters/scenario-features-specification.piece-exporter.e2e-spec.ts index 6ef9cf9102..6b487c2ac7 100644 --- a/api/apps/geoprocessing/test/integration/cloning/piece-exporters/scenario-features-specification.piece-exporter.e2e-spec.ts +++ b/api/apps/geoprocessing/test/integration/cloning/piece-exporters/scenario-features-specification.piece-exporter.e2e-spec.ts @@ -32,7 +32,6 @@ let fixtures: FixtureType; type Features = { id: string; feature_class_name: string; - tag: string; creation_status: string; project_id: string | null; }; diff --git a/api/apps/geoprocessing/test/integration/cloning/piece-importers/project-custom-features.piece-importer.e2e-spec.ts b/api/apps/geoprocessing/test/integration/cloning/piece-importers/project-custom-features.piece-importer.e2e-spec.ts index cd1c2c453d..26c113c3d0 100644 --- a/api/apps/geoprocessing/test/integration/cloning/piece-importers/project-custom-features.piece-importer.e2e-spec.ts +++ b/api/apps/geoprocessing/test/integration/cloning/piece-importers/project-custom-features.piece-importer.e2e-spec.ts @@ -12,7 +12,6 @@ import { ProjectCustomFeature, ProjectCustomFeaturesContent, } from '@marxan/cloning/infrastructure/clone-piece-data/project-custom-features'; -import { FeatureTag } from '@marxan/features'; import { GeoFeatureGeometry, GeometrySource } from '@marxan/geofeatures'; import { FixtureType } from '@marxan/utils/tests/fixture-type'; import { Logger } from '@nestjs/common'; @@ -182,7 +181,6 @@ const getFixtures = async () => { .map((_, featureIndex) => ({ alias: '', feature_class_name: `${projectId}-${featureIndex + 1}`, - tag: FeatureTag.Species, creation_status: 'created' as ProjectCustomFeature['creation_status'], description: '', intersection: [], diff --git a/api/apps/geoprocessing/test/integration/legacy-project-import/features-specification.legacy-piece-importer.e2e-spec.ts b/api/apps/geoprocessing/test/integration/legacy-project-import/features-specification.legacy-piece-importer.e2e-spec.ts index 9177893451..d7e0fb2a11 100644 --- a/api/apps/geoprocessing/test/integration/legacy-project-import/features-specification.legacy-piece-importer.e2e-spec.ts +++ b/api/apps/geoprocessing/test/integration/legacy-project-import/features-specification.legacy-piece-importer.e2e-spec.ts @@ -639,7 +639,6 @@ const getFixtures = async () => { id, feature_class_name: feature.name, project_id: projectId, - tag: 'species', creation_status: 'created', }) .execute(); diff --git a/api/apps/geoprocessing/test/integration/marxan-run/blm-calibration-run.e2e-spec.ts b/api/apps/geoprocessing/test/integration/marxan-run/blm-calibration-run.e2e-spec.ts index 629271dae6..3c4bf7a1e4 100644 --- a/api/apps/geoprocessing/test/integration/marxan-run/blm-calibration-run.e2e-spec.ts +++ b/api/apps/geoprocessing/test/integration/marxan-run/blm-calibration-run.e2e-spec.ts @@ -9,7 +9,7 @@ import { ProjectsPuEntity, } from '@marxan-jobs/planning-unit-geometry'; import { BlmFinalResultEntity } from '@marxan/blm-calibration'; -import { FeatureTag, ScenarioFeaturesData } from '@marxan/features'; +import { ScenarioFeaturesData } from '@marxan/features'; import { GeoFeatureGeometry } from '@marxan/geofeatures'; import { ExecutionResult, @@ -281,7 +281,6 @@ const getFixtures = async () => { currentArea: 200, fpf: 1, met: 1, - tag: FeatureTag.Bioregional, target: 300, metArea: 200, onTarget: false, diff --git a/api/apps/geoprocessing/test/integration/marxan-run/marxan-run.e2e-spec.ts b/api/apps/geoprocessing/test/integration/marxan-run/marxan-run.e2e-spec.ts index 0ff51d0586..7fec82c2ba 100644 --- a/api/apps/geoprocessing/test/integration/marxan-run/marxan-run.e2e-spec.ts +++ b/api/apps/geoprocessing/test/integration/marxan-run/marxan-run.e2e-spec.ts @@ -10,7 +10,7 @@ import { PlanningUnitsGeom, ProjectsPuEntity, } from '@marxan-jobs/planning-unit-geometry'; -import { FeatureTag, ScenarioFeaturesData } from '@marxan/features'; +import { ScenarioFeaturesData } from '@marxan/features'; import { ExecutionResult, MarxanExecutionMetadataGeoEntity, @@ -234,7 +234,6 @@ const getFixtures = async () => { currentArea: 200, fpf: 1, met: 1, - tag: FeatureTag.Bioregional, target: 300, metArea: 200, onTarget: false, diff --git a/api/libs/cloning/src/infrastructure/clone-piece-data/project-custom-features.ts b/api/libs/cloning/src/infrastructure/clone-piece-data/project-custom-features.ts index 2253b44545..bef6ffe1a2 100644 --- a/api/libs/cloning/src/infrastructure/clone-piece-data/project-custom-features.ts +++ b/api/libs/cloning/src/infrastructure/clone-piece-data/project-custom-features.ts @@ -1,5 +1,4 @@ -import { FeatureTag } from '../../../../features/src'; -import { GeometrySource } from '../../../../geofeatures/src'; +import { GeometrySource } from '@marxan/geofeatures'; export const projectCustomFeaturesRelativePath = 'custom-features.json'; @@ -26,7 +25,6 @@ export type ProjectCustomFeature = { description: string; property_name: string; intersection: string[]; - tag: FeatureTag; creation_status: JobStatus; list_property_keys: string[]; data: FeatureData[]; diff --git a/api/libs/features/src/domain/feature-tag.ts b/api/libs/features/src/domain/feature-tag.ts deleted file mode 100644 index 63a31ccd88..0000000000 --- a/api/libs/features/src/domain/feature-tag.ts +++ /dev/null @@ -1,4 +0,0 @@ -export enum FeatureTag { - Bioregional = 'bioregional', - Species = 'species', -} diff --git a/api/libs/features/src/domain/index.ts b/api/libs/features/src/domain/index.ts deleted file mode 100644 index 9da83e2ccd..0000000000 --- a/api/libs/features/src/domain/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { FeatureTag } from './feature-tag'; diff --git a/api/libs/features/src/index.ts b/api/libs/features/src/index.ts index fdf24ffcb1..e071449acb 100644 --- a/api/libs/features/src/index.ts +++ b/api/libs/features/src/index.ts @@ -2,4 +2,3 @@ export { ScenarioFeaturesData } from './scenario-features-data.geo.entity'; export { ScenarioFeaturesGapData } from './scenario-features-gap-data.geo.entity'; export { ScenarioFeaturesOutputGapData } from './scenario-features-output-gap-data.geo.entity'; export { ScenarioFeaturesPreparation } from './scenario-features-preparation.geo.entity'; -export { FeatureTag } from './domain/feature-tag'; diff --git a/api/libs/features/src/scenario-features-data.geo.entity.ts b/api/libs/features/src/scenario-features-data.geo.entity.ts index e09e70e680..966d2d0d57 100644 --- a/api/libs/features/src/scenario-features-data.geo.entity.ts +++ b/api/libs/features/src/scenario-features-data.geo.entity.ts @@ -7,7 +7,6 @@ import { PrimaryGeneratedColumn, } from 'typeorm'; import { GeoFeatureGeometry } from '../../geofeatures/src'; -import { FeatureTag } from './domain'; @Entity(`scenario_features_data`) export class ScenarioFeaturesData { @@ -134,12 +133,6 @@ export class ScenarioFeaturesData { }) onTarget!: boolean; - // what we expose with Extend - @ApiProperty({ - enum: FeatureTag, - }) - tag!: FeatureTag; - @ApiPropertyOptional({ description: `Name of the feature, for example \`Lion in Deserts\`.`, }) diff --git a/api/libs/features/src/scenario-features-gap-data.geo.entity.ts b/api/libs/features/src/scenario-features-gap-data.geo.entity.ts index 80f03475e2..d9527fb463 100644 --- a/api/libs/features/src/scenario-features-gap-data.geo.entity.ts +++ b/api/libs/features/src/scenario-features-gap-data.geo.entity.ts @@ -1,6 +1,5 @@ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; import { Column, ViewEntity } from 'typeorm'; -import { FeatureTag } from './domain'; @ViewEntity('scenario_features_gap_data', { expression: ` @@ -65,11 +64,6 @@ export class ScenarioFeaturesGapData { @ApiPropertyOptional() featureClassName?: string | null; - @ApiProperty({ - enum: FeatureTag, - }) - tag!: FeatureTag; - @ApiPropertyOptional({ description: `Name of the feature, for example \`Lion in Deserts\`.`, })