diff --git a/alcs-frontend/src/app/features/admin/tag/tag-dialog/tag-dialog.component.html b/alcs-frontend/src/app/features/admin/tag/tag-dialog/tag-dialog.component.html index 592795f77..c5a734706 100644 --- a/alcs-frontend/src/app/features/admin/tag/tag-dialog/tag-dialog.component.html +++ b/alcs-frontend/src/app/features/admin/tag/tag-dialog/tag-dialog.component.html @@ -15,14 +15,13 @@

{{ isEdit ? 'Edit' : 'Create New' }} Tag

diff --git a/alcs-frontend/src/app/features/admin/tag/tag-dialog/tag-dialog.component.ts b/alcs-frontend/src/app/features/admin/tag/tag-dialog/tag-dialog.component.ts index b2019b123..b03786f32 100644 --- a/alcs-frontend/src/app/features/admin/tag/tag-dialog/tag-dialog.component.ts +++ b/alcs-frontend/src/app/features/admin/tag/tag-dialog/tag-dialog.component.ts @@ -15,7 +15,7 @@ export class TagDialogComponent implements OnInit { destroy = new Subject(); uuid = ''; name = ''; - category: TagCategoryDto = { + category: TagCategoryDto | undefined = { uuid: '', name: '', }; @@ -37,8 +37,8 @@ export class TagDialogComponent implements OnInit { if (data) { this.uuid = data.uuid; this.name = data.name; - this.category = data.category; - this.categoryId = data.category.uuid; + this.category = data.category ? data.category : undefined; + this.categoryId = data.category ? data.category.uuid : ''; this.isActive = data.isActive.toString(); } this.isEdit = !!data; @@ -60,14 +60,13 @@ export class TagDialogComponent implements OnInit { async onSubmit() { this.isLoading = true; - const dto: TagDto = { uuid: this.uuid, name: this.name, - category: { + category: this.categoryId && this.categoryId !== '' ? { uuid: this.categoryId, name: '', - }, + } : undefined, isActive: this.isActive === 'true', }; diff --git a/alcs-frontend/src/app/features/admin/tag/tag.component.html b/alcs-frontend/src/app/features/admin/tag/tag.component.html index e3df013ef..ff35f9e49 100644 --- a/alcs-frontend/src/app/features/admin/tag/tag.component.html +++ b/alcs-frontend/src/app/features/admin/tag/tag.component.html @@ -37,7 +37,7 @@ Category - {{ row.category.name }} + {{ row.category ? row.category.name : '' }} diff --git a/alcs-frontend/src/app/services/tag/tag.dto.ts b/alcs-frontend/src/app/services/tag/tag.dto.ts index c026c4809..1a1115677 100644 --- a/alcs-frontend/src/app/services/tag/tag.dto.ts +++ b/alcs-frontend/src/app/services/tag/tag.dto.ts @@ -3,6 +3,6 @@ import { TagCategoryDto } from "./tag-category/tag-category.dto"; export interface TagDto { uuid: string; name: string; - category: TagCategoryDto; + category?: TagCategoryDto; isActive: boolean; } diff --git a/services/apps/alcs/src/alcs/tag/tag.controller.spec.ts b/services/apps/alcs/src/alcs/tag/tag.controller.spec.ts index 3f0347f5f..8042769a4 100644 --- a/services/apps/alcs/src/alcs/tag/tag.controller.spec.ts +++ b/services/apps/alcs/src/alcs/tag/tag.controller.spec.ts @@ -7,6 +7,7 @@ import { initTagMockEntity } from '../../../test/mocks/mockEntities'; import { mockKeyCloakProviders } from '../../../test/mocks/mockTypes'; import { Tag } from './tag.entity'; import { TagDto } from './tag.dto'; +import { UpdateResult } from 'typeorm'; describe('TagController', () => { let controller: TagController; @@ -46,9 +47,19 @@ describe('TagController', () => { }); it('should create a tag', async () => { + const dto: TagDto = { + name: mockTag.name, + category: mockTag.category + ? { + uuid: mockTag.category?.uuid, + name: mockTag.name, + } + : null, + isActive: mockTag.isActive, + }; tagService.create.mockResolvedValue(mockTag); - const result = await controller.create(mockTag); + const result = await controller.create(dto); expect(tagService.create).toHaveBeenCalledTimes(1); expect(result).toEqual(mockTag); }); @@ -71,10 +82,10 @@ describe('TagController', () => { }); it('should delete a tag', async () => { - tagService.delete.mockResolvedValue(mockTag); + tagService.delete.mockResolvedValue({} as UpdateResult); const result = await controller.delete(mockTag.uuid); expect(tagService.delete).toHaveBeenCalledTimes(1); - expect(result).toEqual(mockTag); + expect(result).toBeDefined(); }); }); diff --git a/services/apps/alcs/src/alcs/tag/tag.dto.ts b/services/apps/alcs/src/alcs/tag/tag.dto.ts index ee315d080..8088d8dc6 100644 --- a/services/apps/alcs/src/alcs/tag/tag.dto.ts +++ b/services/apps/alcs/src/alcs/tag/tag.dto.ts @@ -1,4 +1,4 @@ -import { IsBoolean, IsObject, IsString } from 'class-validator'; +import { IsBoolean, IsObject, IsOptional, IsString } from 'class-validator'; import { TagCategoryDto } from './tag-category/tag-category.dto'; export class TagDto { @@ -9,5 +9,6 @@ export class TagDto { isActive: boolean; @IsObject() - category: TagCategoryDto; + @IsOptional() + category?: TagCategoryDto | null; } diff --git a/services/apps/alcs/src/alcs/tag/tag.entity.ts b/services/apps/alcs/src/alcs/tag/tag.entity.ts index 3fa395ba4..0ddd5c09d 100644 --- a/services/apps/alcs/src/alcs/tag/tag.entity.ts +++ b/services/apps/alcs/src/alcs/tag/tag.entity.ts @@ -24,6 +24,8 @@ export class Tag extends Base { @Column({ default: true }) isActive: boolean; - @ManyToOne(() => TagCategory) - category: TagCategory; + @ManyToOne(() => TagCategory, { + nullable: true, + }) + category?: TagCategory | null; } diff --git a/services/apps/alcs/src/alcs/tag/tag.service.spec.ts b/services/apps/alcs/src/alcs/tag/tag.service.spec.ts index d709ed1b2..b853208c7 100644 --- a/services/apps/alcs/src/alcs/tag/tag.service.spec.ts +++ b/services/apps/alcs/src/alcs/tag/tag.service.spec.ts @@ -5,16 +5,12 @@ import { Repository } from 'typeorm'; import { Tag } from './tag.entity'; import { createMock, DeepMocked } from '@golevelup/nestjs-testing'; import { TagCategory } from '../tag/tag-category/tag-category.entity'; -import { - initTagCategoryMockEntity, - initTagMockEntity, -} from '../../../test/mocks/mockEntities'; +import { initTagCategoryMockEntity, initTagMockEntity } from '../../../test/mocks/mockEntities'; import { AutomapperModule } from 'automapper-nestjs'; import { classes } from 'automapper-classes'; import { getRepositoryToken } from '@nestjs/typeorm'; import * as config from 'config'; import { TagDto } from './tag.dto'; -import { ServiceValidationException } from '@app/common/exceptions/base.exception'; describe('TagCategoryService', () => { let service: TagService; @@ -82,29 +78,6 @@ describe('TagCategoryService', () => { expect(tagRepositoryMock.save).toHaveBeenCalledWith(mockTagEntity); }); - it('should fail update if tag does not exist', async () => { - const payload: TagDto = { - name: mockTagEntity.name, - isActive: mockTagEntity.isActive, - category: mockTagCategoryEntity, - }; - - tagRepositoryMock.findOneOrFail.mockRejectedValue( - new ServiceValidationException( - `Tag for with ${mockTagEntity.uuid} not found`, - ), - ); - - await expect( - service.update(mockTagEntity.uuid, payload), - ).rejects.toMatchObject( - new ServiceValidationException( - `Tag for with ${mockTagEntity.uuid} not found`, - ), - ); - expect(tagRepositoryMock.save).toBeCalledTimes(0); - }); - it('should call save when tag successfully create', async () => { const payload: TagDto = { name: mockTagEntity.name, @@ -116,23 +89,4 @@ describe('TagCategoryService', () => { expect(tagRepositoryMock.save).toBeCalledTimes(1); }); - - it('should fail on create if Tag Category does not exist', async () => { - const payload: TagDto = { - name: mockTagEntity.name, - isActive: mockTagEntity.isActive, - category: { - uuid: 'fakeuuid', - name: '', - }, - }; - - tagCategoryRepositoryMock.findOne.mockResolvedValue(null); - - await expect(service.create(payload)).rejects.toMatchObject( - new ServiceValidationException('Provided category does not exist'), - ); - - expect(tagRepositoryMock.save).toBeCalledTimes(0); - }); }); diff --git a/services/apps/alcs/src/alcs/tag/tag.service.ts b/services/apps/alcs/src/alcs/tag/tag.service.ts index d09028e0f..965fa8a25 100644 --- a/services/apps/alcs/src/alcs/tag/tag.service.ts +++ b/services/apps/alcs/src/alcs/tag/tag.service.ts @@ -4,7 +4,6 @@ import { InjectRepository } from '@nestjs/typeorm'; import { Tag } from './tag.entity'; import { TagDto } from './tag.dto'; import { TagCategory } from './tag-category/tag-category.entity'; -import { ServiceValidationException } from '@app/common/exceptions/base.exception'; @Injectable() export class TagService { @@ -38,20 +37,18 @@ export class TagService { } async create(dto: TagDto) { - const category = await this.categoryRepository.findOne({ - where: { - uuid: dto.category.uuid, - }, - }); - - if (!category) { - throw new ServiceValidationException('Provided category does not exist'); - } + const category = dto.category + ? await this.categoryRepository.findOne({ + where: { + uuid: dto.category.uuid, + }, + }) + : null; const newTag = new Tag(); newTag.name = dto.name; newTag.isActive = dto.isActive; - newTag.category = category; + newTag.category = category ? category : null; return this.repository.save(newTag); } @@ -62,25 +59,21 @@ export class TagService { } async update(uuid: string, updateDto: TagDto) { - const category = await this.categoryRepository.findOne({ - where: { - uuid: updateDto.category.uuid, - }, - }); - - if (!category) { - throw new ServiceValidationException('Provided category does not exist'); - } + const category = updateDto.category + ? await this.categoryRepository.findOne({ + where: { + uuid: updateDto.category.uuid, + }, + }) + : null; const tag = await this.getOneOrFail(uuid); tag.name = updateDto.name; tag.isActive = updateDto.isActive; - tag.category = category; + tag.category = category ? category : null; return await this.repository.save(tag); } async delete(uuid: string) { - const tag = await this.getOneOrFail(uuid); - - return await this.repository.remove(tag); + return await this.repository.softDelete(uuid); } } diff --git a/services/apps/alcs/src/providers/typeorm/migrations/1730239196619-nullable_tag_category.ts b/services/apps/alcs/src/providers/typeorm/migrations/1730239196619-nullable_tag_category.ts new file mode 100644 index 000000000..710bc4866 --- /dev/null +++ b/services/apps/alcs/src/providers/typeorm/migrations/1730239196619-nullable_tag_category.ts @@ -0,0 +1,13 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class NullableTagCategory1730239196619 implements MigrationInterface { + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "alcs"."tag" ALTER COLUMN "category_uuid" DROP NOT NULL`); + } + + public async down(queryRunner: QueryRunner): Promise { + // N/A + } + +} diff --git a/services/apps/alcs/src/providers/typeorm/migrations/1730244813395-seed-tag-categories.ts b/services/apps/alcs/src/providers/typeorm/migrations/1730244813395-seed-tag-categories.ts new file mode 100644 index 000000000..38329c0bc --- /dev/null +++ b/services/apps/alcs/src/providers/typeorm/migrations/1730244813395-seed-tag-categories.ts @@ -0,0 +1,22 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class SeedTagCategories1730244813395 implements MigrationInterface { + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(` + INSERT INTO "alcs"."tag_category" ("audit_deleted_date_at", "audit_created_at", "audit_updated_at", "audit_created_by", "audit_updated_by", "name") VALUES + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Residential'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Transportation'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Meat'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Energy Production'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Berries'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Alcohol'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Utilities'); + `); + } + + public async down(queryRunner: QueryRunner): Promise { + // N/A + } + +} diff --git a/services/apps/alcs/src/providers/typeorm/migrations/1730245198764-seed-tags.ts b/services/apps/alcs/src/providers/typeorm/migrations/1730245198764-seed-tags.ts new file mode 100644 index 000000000..26ac58b97 --- /dev/null +++ b/services/apps/alcs/src/providers/typeorm/migrations/1730245198764-seed-tags.ts @@ -0,0 +1,128 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class SeedTags1730245198764 implements MigrationInterface { + + public async up(queryRunner: QueryRunner): Promise { + // tags without categories + await queryRunner.query(` + INSERT INTO "alcs"."tag" ("audit_deleted_date_at", "audit_created_at", "audit_updated_at", "audit_created_by", "audit_updated_by", "name") VALUES + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Aggregate Extraction'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Animal Shelter'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Aquaculture'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Area-Wide Filling'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Auto Services'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Bamboo'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Boundary Adjustment'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Café / Bistro / Restaurant'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Camp'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Campground / RV Park'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Cannabis'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Care Facility'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Cement / Asphalt / Concrete Plant'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Cemetery'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Civic'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Commercial'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Compost'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Controlled Environment Structure'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Dairy'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Eggs'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Emergency Works'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Endorsement'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Equestrian'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Event'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Exhibition / Festival'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Farm Road'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Farm Structure'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Fill Placement'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Fire Services'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Flood / Erosion Mitigation'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Forage / Hay'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Forestry Product'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Golf Course'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Grain'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Greenhouse'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Hall'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Home Occupation'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Hospital / Healthcare'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Industrial'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Land Development Works'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Leasehold Subdivision'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Lodge / Resort'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Lounge'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Milk / Butter / Cheese'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Mining'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Mushroom / Truffle'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Nursery'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Other Structure'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Park'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Parking'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Pet Boarding'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Pet Services'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Placer Mining'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Processing'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Religious'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Research'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Retail Sales'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Retroactive'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'School / University'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Seafood'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Soil Blending'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Soil Removal'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Sports Facility'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Storage'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Tourism'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Tree Fruit'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Turf Farm'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Vegetable'), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Vineyard'); + `); + + // tags with categories + await queryRunner.query(` + INSERT INTO "alcs"."tag" ("audit_deleted_date_at", "audit_created_at", "audit_updated_at", "audit_created_by", "audit_updated_by", "name", "category_uuid") VALUES + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Accessory Structure', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Residential')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Additional Residence', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Residential')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Aviation', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Transportation')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Beef', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Meat')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Biogas', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Energy Production')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Blackberry', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Berries')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Blueberry', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Berries')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Brewery', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Alcohol')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Cranberry', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Berries')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Distillery', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Alcohol')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Driveway', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Residential')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Electric', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Utilities')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Geothermal', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Energy Production')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Goat / Sheep', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Meat')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Haskap Berry', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Berries')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Landscaping', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Residential')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Meadery', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Alcohol')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Mobile Home Park', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Residential')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Oil / Gas', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Energy Production')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Pigs / Hogs', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Meat')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Pool', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Residential')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Poultry', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Meat')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Principal Residence', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Residential')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Principal Residence > 500m2', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Residential')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Railway', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Transportation')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Raspberry', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Berries')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Reside & Replace', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Residential')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Road', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Transportation')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Sewage Infrastructure', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Utilities')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Solar', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Energy Production')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Stormwater Infrastructure', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Utilities')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Strawberry', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Berries')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Telecommunications', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Utilities')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Temporary Foreign Worker Housing', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Residential')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Trail', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Transportation')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Water Infrastructure', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Utilities')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Wind', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Energy Production')), + (NULL, NOW(), NULL, 'migration_seed', NULL, 'Winery', (SELECT "uuid" FROM "alcs"."tag_category" WHERE "name" = 'Alcohol')); + `); + } + + public async down(queryRunner: QueryRunner): Promise { + // N/A + } + +}