From 1578637f2cf440cc3d8634c09f17031ce9ea779d Mon Sep 17 00:00:00 2001 From: Tristan Slater <1631008+trslater@users.noreply.github.com> Date: Wed, 16 Oct 2024 11:27:47 -0700 Subject: [PATCH 01/45] Move structure type options to module constant for use by other modules --- .../additional-information.component.html | 2 +- .../additional-information.component.ts | 81 ++++++++++--------- 2 files changed, 45 insertions(+), 38 deletions(-) diff --git a/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/additional-information.component.html b/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/additional-information.component.html index 507d047da..610d6063a 100644 --- a/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/additional-information.component.html +++ b/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/additional-information.component.html @@ -95,7 +95,7 @@

Additional Proposal Information

[formControlName]="element.id + '-type'" (valueChange)="onChangeStructureType(element.id, $event)" > - + {{ type.label }} diff --git a/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/additional-information.component.ts b/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/additional-information.component.ts index eba7275be..03b015104 100644 --- a/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/additional-information.component.ts +++ b/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/additional-information.component.ts @@ -33,9 +33,14 @@ export enum STRUCTURE_TYPES { OTHER_STRUCTURE = 'Other Structure', } -export type FormProposedStructure = { type: STRUCTURE_TYPES | null; area: string | null; id: string, typeLabel?: string | null }; +export type FormProposedStructure = { + type: STRUCTURE_TYPES | null; + area: string | null; + id: string; + typeLabel?: string | null; +}; -export type TypeOption = { label: string, value: string }; +export type TypeOption = { label: string; value: string }; export const RESIDENTIAL_STRUCTURE_TYPES = [ STRUCTURE_TYPES.ACCESSORY_STRUCTURE, @@ -51,6 +56,29 @@ export const NOI_STRUCTURE_TYPE_LABEL_MAP: Record = { [STRUCTURE_TYPES.OTHER_STRUCTURE]: STRUCTURE_TYPES.OTHER_STRUCTURE, }; +export const STRUCTURE_TYPE_OPTIONS = [ + { + label: STRUCTURE_TYPES.FARM_STRUCTURE, + value: STRUCTURE_TYPES.FARM_STRUCTURE, + }, + { + label: NOI_STRUCTURE_TYPE_LABEL_MAP[STRUCTURE_TYPES.PRINCIPAL_RESIDENCE], + value: STRUCTURE_TYPES.PRINCIPAL_RESIDENCE, + }, + { + label: NOI_STRUCTURE_TYPE_LABEL_MAP[STRUCTURE_TYPES.ADDITIONAL_RESIDENCE], + value: STRUCTURE_TYPES.ADDITIONAL_RESIDENCE, + }, + { + label: NOI_STRUCTURE_TYPE_LABEL_MAP[STRUCTURE_TYPES.ACCESSORY_STRUCTURE], + value: STRUCTURE_TYPES.ACCESSORY_STRUCTURE, + }, + { + label: STRUCTURE_TYPES.OTHER_STRUCTURE, + value: STRUCTURE_TYPES.OTHER_STRUCTURE, + }, +]; + @Component({ selector: 'app-additional-information', templateUrl: './additional-information.component.html', @@ -60,31 +88,10 @@ export class AdditionalInformationComponent extends FilesStepComponent implement currentStep = EditNoiSteps.ExtraInfo; isMobile = window.innerWidth <= MOBILE_BREAKPOINT; - STRUCTURE_TYPE_OPTIONS: TypeOption[] = [ - { - label: STRUCTURE_TYPES.FARM_STRUCTURE, - value: STRUCTURE_TYPES.FARM_STRUCTURE, - }, - { - label: NOI_STRUCTURE_TYPE_LABEL_MAP[STRUCTURE_TYPES.PRINCIPAL_RESIDENCE], - value: STRUCTURE_TYPES.PRINCIPAL_RESIDENCE, - }, - { - label: NOI_STRUCTURE_TYPE_LABEL_MAP[STRUCTURE_TYPES.ADDITIONAL_RESIDENCE], - value: STRUCTURE_TYPES.ADDITIONAL_RESIDENCE, - }, - { - label: NOI_STRUCTURE_TYPE_LABEL_MAP[STRUCTURE_TYPES.ACCESSORY_STRUCTURE], - value: STRUCTURE_TYPES.ACCESSORY_STRUCTURE, - }, - { - label: STRUCTURE_TYPES.OTHER_STRUCTURE, - value: STRUCTURE_TYPES.OTHER_STRUCTURE, - }, - ]; + structureTypeOptions = STRUCTURE_TYPE_OPTIONS; DOCUMENT = DOCUMENT_TYPE; - + private submissionUuid = ''; typeCode: string = ''; @@ -168,7 +175,7 @@ export class AdditionalInformationComponent extends FilesStepComponent implement ...structure, id: v4(), area: structure.area ? structure.area.toString(10) : null, - typeLabel: this.STRUCTURE_TYPE_OPTIONS.find((x) => x.value === structure.type)?.label, + typeLabel: this.structureTypeOptions.find((x) => x.value === structure.type)?.label, })); const newForm = new FormGroup({}); @@ -406,9 +413,9 @@ export class AdditionalInformationComponent extends FilesStepComponent implement structureData: { area: structureToEdit?.area, type: structureToEdit?.type, - options: this.STRUCTURE_TYPE_OPTIONS, - } - } + options: this.structureTypeOptions, + }, + }, }); dialog.afterClosed().subscribe(async (result) => { if (!result) return; @@ -464,9 +471,9 @@ export class AdditionalInformationComponent extends FilesStepComponent implement width: '70%', data: { structureData: { - options: this.STRUCTURE_TYPE_OPTIONS, - } - } + options: this.structureTypeOptions, + }, + }, }); dialog.beforeClosed().subscribe(async (result) => { if (!result) return; @@ -485,11 +492,11 @@ export class AdditionalInformationComponent extends FilesStepComponent implement const typeValue = type ? type.value : ''; const typeLabel = type ? type.label : ''; const newStructure = { - type: typeValue, - area: area ? area : '', - id: v4(), - typeLabel: typeLabel, - }; + type: typeValue, + area: area ? area : '', + id: v4(), + typeLabel: typeLabel, + }; this.proposedStructures.push(newStructure); this.structuresSource = new MatTableDataSource(this.proposedStructures); From 0a7812f3d584b20f5f50f5b21f9fb5611960dc9c Mon Sep 17 00:00:00 2001 From: Tristan Slater <1631008+trslater@users.noreply.github.com> Date: Wed, 16 Oct 2024 11:36:39 -0700 Subject: [PATCH 02/45] Rename NOI structure label map to make general for all soil --- .../additional-information.component.ts | 4 ++-- .../additional-information.component.ts | 8 ++++---- .../additional-information.component.ts | 4 ++-- .../additional-information.component.ts | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/alcs-frontend/src/app/features/notice-of-intent/applicant-info/notice-of-intent-details/additional-information/additional-information.component.ts b/alcs-frontend/src/app/features/notice-of-intent/applicant-info/notice-of-intent-details/additional-information/additional-information.component.ts index fba6a14e3..d82ee4630 100644 --- a/alcs-frontend/src/app/features/notice-of-intent/applicant-info/notice-of-intent-details/additional-information/additional-information.component.ts +++ b/alcs-frontend/src/app/features/notice-of-intent/applicant-info/notice-of-intent-details/additional-information/additional-information.component.ts @@ -9,7 +9,7 @@ import { } from '../../../../../services/notice-of-intent/notice-of-intent.dto'; import { DOCUMENT_TYPE } from '../../../../../shared/document/document.dto'; -const NOI_STRUCTURE_TYPE_LABEL_MAP: Record = { +const STRUCTURE_TYPE_LABEL_MAP: Record = { [STRUCTURE_TYPES.FARM_STRUCTURE]: STRUCTURE_TYPES.FARM_STRUCTURE, [STRUCTURE_TYPES.PRINCIPAL_RESIDENCE]: 'Principal Residence', [STRUCTURE_TYPES.ADDITIONAL_RESIDENCE]: 'Additional Residence', @@ -96,6 +96,6 @@ export class AdditionalInformationComponent { return null; } - return NOI_STRUCTURE_TYPE_LABEL_MAP[value]; + return STRUCTURE_TYPE_LABEL_MAP[value]; } } diff --git a/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/additional-information.component.ts b/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/additional-information.component.ts index 03b015104..2ba17f151 100644 --- a/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/additional-information.component.ts +++ b/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/additional-information.component.ts @@ -48,7 +48,7 @@ export const RESIDENTIAL_STRUCTURE_TYPES = [ STRUCTURE_TYPES.PRINCIPAL_RESIDENCE, ]; -export const NOI_STRUCTURE_TYPE_LABEL_MAP: Record = { +export const STRUCTURE_TYPE_LABEL_MAP: Record = { [STRUCTURE_TYPES.FARM_STRUCTURE]: STRUCTURE_TYPES.FARM_STRUCTURE, [STRUCTURE_TYPES.PRINCIPAL_RESIDENCE]: 'Principal Residence', [STRUCTURE_TYPES.ADDITIONAL_RESIDENCE]: 'Additional Residence', @@ -62,15 +62,15 @@ export const STRUCTURE_TYPE_OPTIONS = [ value: STRUCTURE_TYPES.FARM_STRUCTURE, }, { - label: NOI_STRUCTURE_TYPE_LABEL_MAP[STRUCTURE_TYPES.PRINCIPAL_RESIDENCE], + label: STRUCTURE_TYPE_LABEL_MAP[STRUCTURE_TYPES.PRINCIPAL_RESIDENCE], value: STRUCTURE_TYPES.PRINCIPAL_RESIDENCE, }, { - label: NOI_STRUCTURE_TYPE_LABEL_MAP[STRUCTURE_TYPES.ADDITIONAL_RESIDENCE], + label: STRUCTURE_TYPE_LABEL_MAP[STRUCTURE_TYPES.ADDITIONAL_RESIDENCE], value: STRUCTURE_TYPES.ADDITIONAL_RESIDENCE, }, { - label: NOI_STRUCTURE_TYPE_LABEL_MAP[STRUCTURE_TYPES.ACCESSORY_STRUCTURE], + label: STRUCTURE_TYPE_LABEL_MAP[STRUCTURE_TYPES.ACCESSORY_STRUCTURE], value: STRUCTURE_TYPES.ACCESSORY_STRUCTURE, }, { diff --git a/portal-frontend/src/app/features/notice-of-intents/notice-of-intent-details/additional-information/additional-information.component.ts b/portal-frontend/src/app/features/notice-of-intents/notice-of-intent-details/additional-information/additional-information.component.ts index 3ab468c8a..a02a6f980 100644 --- a/portal-frontend/src/app/features/notice-of-intents/notice-of-intent-details/additional-information/additional-information.component.ts +++ b/portal-frontend/src/app/features/notice-of-intents/notice-of-intent-details/additional-information/additional-information.component.ts @@ -7,7 +7,7 @@ import { DOCUMENT_TYPE } from '../../../../shared/dto/document.dto'; import { RESIDENTIAL_STRUCTURE_TYPES, STRUCTURE_TYPES, - NOI_STRUCTURE_TYPE_LABEL_MAP, + STRUCTURE_TYPE_LABEL_MAP, } from '../../edit-submission/additional-information/additional-information.component'; import { openFileInline } from '../../../../shared/utils/file'; import { MOBILE_BREAKPOINT } from '../../../../shared/utils/breakpoints'; @@ -116,6 +116,6 @@ export class AdditionalInformationComponent { return null; } - return NOI_STRUCTURE_TYPE_LABEL_MAP[value]; + return STRUCTURE_TYPE_LABEL_MAP[value]; } } diff --git a/portal-frontend/src/app/features/public/notice-of-intent/submission/additional-information/additional-information.component.ts b/portal-frontend/src/app/features/public/notice-of-intent/submission/additional-information/additional-information.component.ts index 05b32d901..0a94f052d 100644 --- a/portal-frontend/src/app/features/public/notice-of-intent/submission/additional-information/additional-information.component.ts +++ b/portal-frontend/src/app/features/public/notice-of-intent/submission/additional-information/additional-information.component.ts @@ -7,7 +7,7 @@ import { openFileInline } from '../../../../../shared/utils/file'; import { RESIDENTIAL_STRUCTURE_TYPES, STRUCTURE_TYPES, - NOI_STRUCTURE_TYPE_LABEL_MAP, + STRUCTURE_TYPE_LABEL_MAP, } from '../../../../notice-of-intents/edit-submission/additional-information/additional-information.component'; import { MOBILE_BREAKPOINT } from '../../../../../shared/utils/breakpoints'; @@ -97,6 +97,6 @@ export class AdditionalInformationComponent implements OnInit { return null; } - return NOI_STRUCTURE_TYPE_LABEL_MAP[value]; + return STRUCTURE_TYPE_LABEL_MAP[value]; } } From cf945f2d5a4b01e5ea644ee4abf9c9e383a860f8 Mon Sep 17 00:00:00 2001 From: Tristan Slater <1631008+trslater@users.noreply.github.com> Date: Wed, 16 Oct 2024 12:33:56 -0700 Subject: [PATCH 03/45] Add new structures question to DB --- .../application-submission.entity.ts | 4 ++++ ...07161963-add_app_soil_new_structure_question.ts | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 services/apps/alcs/src/providers/typeorm/migrations/1729107161963-add_app_soil_new_structure_question.ts diff --git a/services/apps/alcs/src/portal/application-submission/application-submission.entity.ts b/services/apps/alcs/src/portal/application-submission/application-submission.entity.ts index e887c6f4f..9e18ff570 100644 --- a/services/apps/alcs/src/portal/application-submission/application-submission.entity.ts +++ b/services/apps/alcs/src/portal/application-submission/application-submission.entity.ts @@ -367,6 +367,10 @@ export class ApplicationSubmission extends Base { subdProposedLots: ProposedLot[]; //Soil & Fill + @AutoMap(() => Boolean) + @Column({ type: 'boolean', nullable: true }) + soilIsNewStructure: boolean | null; + @AutoMap(() => Boolean) @Column({ type: 'boolean', nullable: true }) soilIsFollowUp: boolean | null; diff --git a/services/apps/alcs/src/providers/typeorm/migrations/1729107161963-add_app_soil_new_structure_question.ts b/services/apps/alcs/src/providers/typeorm/migrations/1729107161963-add_app_soil_new_structure_question.ts new file mode 100644 index 000000000..326927e87 --- /dev/null +++ b/services/apps/alcs/src/providers/typeorm/migrations/1729107161963-add_app_soil_new_structure_question.ts @@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class AddAppSoilNewStructureQuestion1729107161963 implements MigrationInterface { + name = 'AddAppSoilNewStructureQuestion1729107161963' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "alcs"."application_submission" ADD "soil_is_new_structure" boolean`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "alcs"."application_submission" DROP COLUMN "soil_is_new_structure"`); + } + +} From 4ecbaa0a6dd817a688177c2917fe6de1fec4d137 Mon Sep 17 00:00:00 2001 From: Tristan Slater <1631008+trslater@users.noreply.github.com> Date: Wed, 16 Oct 2024 12:39:28 -0700 Subject: [PATCH 04/45] Git add new structure question to all services and DTO's --- .../src/app/services/application/application.dto.ts | 1 + .../application-submission/application-submission.dto.ts | 1 + .../src/app/services/public/public-application.dto.ts | 1 + .../application-submission-validator.service.ts | 1 + .../application-submission/application-submission.dto.ts | 7 +++++++ .../application-submission.service.ts | 4 ++++ .../portal/public/application/public-application.dto.ts | 3 +++ 7 files changed, 18 insertions(+) diff --git a/alcs-frontend/src/app/services/application/application.dto.ts b/alcs-frontend/src/app/services/application/application.dto.ts index 9fe3f94b7..47007b877 100644 --- a/alcs-frontend/src/app/services/application/application.dto.ts +++ b/alcs-frontend/src/app/services/application/application.dto.ts @@ -171,6 +171,7 @@ export interface ApplicationSubmissionDto { subdProposedLots: ProposedLot[]; //Soil Fields + soilIsNewStructure: boolean | null; soilIsFollowUp: boolean | null; soilFollowUpIDs: string | null; soilTypeRemoved: string | null; diff --git a/portal-frontend/src/app/services/application-submission/application-submission.dto.ts b/portal-frontend/src/app/services/application-submission/application-submission.dto.ts index ad02ffb28..9fda0e0ff 100644 --- a/portal-frontend/src/app/services/application-submission/application-submission.dto.ts +++ b/portal-frontend/src/app/services/application-submission/application-submission.dto.ts @@ -113,6 +113,7 @@ export interface ApplicationSubmissionDetailedDto extends ApplicationSubmissionD subdProposedLots: ProposedLot[]; //Soil Fields + soilIsNewStructure: boolean | null; soilIsFollowUp: boolean | null; soilFollowUpIDs: string | null; soilTypeRemoved: string | null; diff --git a/portal-frontend/src/app/services/public/public-application.dto.ts b/portal-frontend/src/app/services/public/public-application.dto.ts index 111381bac..fba76b98d 100644 --- a/portal-frontend/src/app/services/public/public-application.dto.ts +++ b/portal-frontend/src/app/services/public/public-application.dto.ts @@ -78,6 +78,7 @@ export interface PublicApplicationSubmissionDto { subdProposedLots: ProposedLot[]; //Soil Fields + soilIsNewStructure: boolean | null; soilIsFollowUp: boolean | null; soilFollowUpIDs: string | null; soilTypeRemoved: string | null; diff --git a/services/apps/alcs/src/portal/application-submission/application-submission-validator.service.ts b/services/apps/alcs/src/portal/application-submission/application-submission-validator.service.ts index 8d4357884..cc6820f71 100644 --- a/services/apps/alcs/src/portal/application-submission/application-submission-validator.service.ts +++ b/services/apps/alcs/src/portal/application-submission/application-submission-validator.service.ts @@ -621,6 +621,7 @@ export class ApplicationSubmissionValidatorService { applicantDocuments: ApplicationDocument[], ) { if ( + applicationSubmission.soilIsNewStructure === null || applicationSubmission.soilIsFollowUp === null || applicationSubmission.soilReduceNegativeImpacts === null ) { diff --git a/services/apps/alcs/src/portal/application-submission/application-submission.dto.ts b/services/apps/alcs/src/portal/application-submission/application-submission.dto.ts index 9023fb215..50b6aa116 100644 --- a/services/apps/alcs/src/portal/application-submission/application-submission.dto.ts +++ b/services/apps/alcs/src/portal/application-submission/application-submission.dto.ts @@ -164,6 +164,9 @@ export class ApplicationSubmissionDetailedDto extends ApplicationSubmissionDto { subdProposedLots?: ProposedLot[]; //Soil Fields + @AutoMap(() => Boolean) + soilIsNewStructure: boolean | null; + @AutoMap(() => Boolean) soilIsFollowUp: boolean | null; @@ -545,6 +548,10 @@ export class ApplicationSubmissionUpdateDto { subdProposedLots?: ProposedLot[]; //Soil Fields + @IsBoolean() + @IsOptional() + soilIsNewStructure?: boolean | null; + @IsBoolean() @IsOptional() soilIsFollowUp?: boolean | null; diff --git a/services/apps/alcs/src/portal/application-submission/application-submission.service.ts b/services/apps/alcs/src/portal/application-submission/application-submission.service.ts index 8b64f9195..946698d80 100644 --- a/services/apps/alcs/src/portal/application-submission/application-submission.service.ts +++ b/services/apps/alcs/src/portal/application-submission/application-submission.service.ts @@ -813,6 +813,10 @@ export class ApplicationSubmissionService { applicationSubmission: ApplicationSubmission, updateDto: ApplicationSubmissionUpdateDto, ) { + applicationSubmission.soilIsNewStructure = filterUndefined( + updateDto.soilIsNewStructure, + applicationSubmission.soilIsNewStructure, + ); applicationSubmission.soilIsFollowUp = filterUndefined( updateDto.soilIsFollowUp, applicationSubmission.soilIsFollowUp, diff --git a/services/apps/alcs/src/portal/public/application/public-application.dto.ts b/services/apps/alcs/src/portal/public/application/public-application.dto.ts index d295a3180..fb25711f4 100644 --- a/services/apps/alcs/src/portal/public/application/public-application.dto.ts +++ b/services/apps/alcs/src/portal/public/application/public-application.dto.ts @@ -145,6 +145,9 @@ export class PublicApplicationSubmissionDto { subdProposedLots?: ProposedLot[]; //Soil Fields + @AutoMap(() => Boolean) + soilIsNewStructure: boolean | null; + @AutoMap(() => Boolean) soilIsFollowUp: boolean | null; From 6c50f45ecc6975e9c30a6cbf0126e2d426f8be42 Mon Sep 17 00:00:00 2001 From: Tristan Slater <1631008+trslater@users.noreply.github.com> Date: Wed, 16 Oct 2024 12:45:39 -0700 Subject: [PATCH 05/45] Add new structure question to UI --- .../pfrs-proposal.component.html | 30 +++++++++++++++++++ .../pfrs-proposal/pfrs-proposal.component.ts | 2 ++ 2 files changed, 32 insertions(+) diff --git a/portal-frontend/src/app/features/applications/edit-submission/proposal/pfrs-proposal/pfrs-proposal.component.html b/portal-frontend/src/app/features/applications/edit-submission/proposal/pfrs-proposal/pfrs-proposal.component.html index a7d5aea6f..b6961bbf0 100644 --- a/portal-frontend/src/app/features/applications/edit-submission/proposal/pfrs-proposal/pfrs-proposal.component.html +++ b/portal-frontend/src/app/features/applications/edit-submission/proposal/pfrs-proposal/pfrs-proposal.component.html @@ -25,6 +25,36 @@

Proposal

+
+ + Are you removing soil and placing fill in order to build a structure? + +
This can include farm buildings, residences, or accessory buildings.
+
+ + Yes + + No + + +
+ Note: The form will be updated with additional required questions if you are building a structure + +
+
Has the ALC previously received an application or Notice of Intent for this proposal? diff --git a/portal-frontend/src/app/features/applications/edit-submission/proposal/pfrs-proposal/pfrs-proposal.component.ts b/portal-frontend/src/app/features/applications/edit-submission/proposal/pfrs-proposal/pfrs-proposal.component.ts index 90860ec51..165a70c02 100644 --- a/portal-frontend/src/app/features/applications/edit-submission/proposal/pfrs-proposal/pfrs-proposal.component.ts +++ b/portal-frontend/src/app/features/applications/edit-submission/proposal/pfrs-proposal/pfrs-proposal.component.ts @@ -43,6 +43,7 @@ export class PfrsProposalComponent extends FilesStepComponent implements OnInit, showReclamationPlanVirus = false; showNoticeOfWorkVirus = false; + isNewStructure = new FormControl(null, [Validators.required]); isFollowUp = new FormControl(null, [Validators.required]); followUpIDs = new FormControl({ value: null, disabled: true }, [Validators.required]); purpose = new FormControl(null, [Validators.required]); @@ -56,6 +57,7 @@ export class PfrsProposalComponent extends FilesStepComponent implements OnInit, hasSubmittedNotice = new FormControl({ value: null, disabled: true }, [Validators.required]); form = new FormGroup({ + isNewStructure: this.isNewStructure, isFollowUp: this.isFollowUp, followUpIDs: this.followUpIDs, purpose: this.purpose, From 8e26b881fa4762f9fc7523e1b0fb0d3a7910c118 Mon Sep 17 00:00:00 2001 From: Tristan Slater <1631008+trslater@users.noreply.github.com> Date: Wed, 16 Oct 2024 12:51:48 -0700 Subject: [PATCH 06/45] Show/hide old questions based on answer to new structure question --- .../pfrs-proposal.component.html | 409 +++++++++--------- 1 file changed, 210 insertions(+), 199 deletions(-) diff --git a/portal-frontend/src/app/features/applications/edit-submission/proposal/pfrs-proposal/pfrs-proposal.component.html b/portal-frontend/src/app/features/applications/edit-submission/proposal/pfrs-proposal/pfrs-proposal.component.html index b6961bbf0..36d2a6484 100644 --- a/portal-frontend/src/app/features/applications/edit-submission/proposal/pfrs-proposal/pfrs-proposal.component.html +++ b/portal-frontend/src/app/features/applications/edit-submission/proposal/pfrs-proposal/pfrs-proposal.component.html @@ -23,6 +23,7 @@

Proposal

+
@@ -86,6 +87,7 @@

Proposal

+
If you have multiple IDs, please separate with a comma.
@@ -98,6 +100,7 @@

Proposal

This field is required
+
@@ -210,6 +213,7 @@

Proposal

(dataChange)="markDirty()" >
+
Of the proposed totals provided above, please input the dimensions of soil that has already been removed or @@ -285,63 +289,66 @@

Proposal

Characters left: {{ 4000 - soilTypeRemovedText.textLength }}
-
- -
- Applicants should provide evidence demonstrating that normal farm practices have been attempted prior to the - submission of this application to place fill. -
- - - -
- warning -
This field is required
+ +
+ +
+ Applicants should provide evidence demonstrating that normal farm practices have been attempted prior to the + submission of this application to place fill. +
+ + + +
+ warning +
This field is required
+
+ Example: Aggregate, Extraction, Placer Mining, Peat Extraction, Soil etc. +
Characters left: {{ 4000 - soilAlternativeMeasuresText.textLength }}
- Example: Aggregate, Extraction, Placer Mining, Peat Extraction, Soil etc. -
Characters left: {{ 4000 - soilAlternativeMeasuresText.textLength }}
-
-
- - - - -
- warning -
This field is required
+
+ + + + +
+ warning +
This field is required
+
+ + Example: Project phasing, providing landscape screening, fencing, buffering, erosion and sediment control, + temporary or permanent drainage, etc. + +
Characters left: {{ 4000 - reduceNegativeImpactsText.textLength }}
- - Example: Project phasing, providing landscape screening, fencing, buffering, erosion and sediment control, - temporary or permanent drainage, etc. - -
Characters left: {{ 4000 - reduceNegativeImpactsText.textLength }}
-
+ +
Proposal Map / Site Plan
A visual representation of your proposal.
@@ -356,159 +363,163 @@

Proposal

[showVirusError]="showProposalMapVirus" >
-
- Cross Sections -
Include North-South and East-West cross sections
- - Please refer to - Removal of Soil & Placement of Fill - on the ALC website for more information - - -
-
- Reclamation Plan -
- The Reclamation Plan should be completed by a qualified Professional Agrologist and contain the area's - agricultural capability assessment. -
- - Please refer to - Removal of Soil & Placement of Fill - on the ALC website for more information - - -
-
- Is your proposal for aggregate extraction or placer mining? -
- - Yes - - No - - + +
+ Cross Sections +
Include North-South and East-West cross sections
+ + Please refer to + Removal of Soil & Placement of Fill + on the ALC website for more information + +
-
- warning -
This field is required
+ +
+ Reclamation Plan +
+ The Reclamation Plan should be completed by a qualified Professional Agrologist and contain the area's + agricultural capability assessment. +
+ + Please refer to + Removal of Soil & Placement of Fill + on the ALC website for more information + +
-
-
- - Have you submitted a Notice of Work to the Ministry of Energy, Mines and Low Carbon Innovation (EMLI)? - -
If yes, please attach the Notice of Work in the section below.
-
- + Is your proposal for aggregate extraction or placer mining? +
+ + Yes + + No + + +
+
- Yes - - No - - -
-
- warning -
This field is required
+ warning +
This field is required
+
-
-
- Notice of Work - - Please refer to - Removal of Soil & Placement of Fill + + Have you submitted a Notice of Work to the Ministry of Energy, Mines and Low Carbon Innovation (EMLI)? + +
If yes, please attach the Notice of Work in the section below.
+
+ + Yes + + No + + +
+
- on the ALC website for more information - - -
+ warning +
This field is required
+
+
+ +
+ Notice of Work + + Please refer to + Removal of Soil & Placement of Fill + on the ALC website for more information + + +
+
From 981e73c4e37362bec32f539b18000ea37af1dba8 Mon Sep 17 00:00:00 2001 From: Tristan Slater <1631008+trslater@users.noreply.github.com> Date: Wed, 16 Oct 2024 13:17:16 -0700 Subject: [PATCH 07/45] Add all new questions to DB --- .../application-submission.entity.ts | 30 +++++++++++++++++++ ...-add_new_app_soil_conditional_questions.ts | 26 ++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 services/apps/alcs/src/providers/typeorm/migrations/1729108829555-add_new_app_soil_conditional_questions.ts diff --git a/services/apps/alcs/src/portal/application-submission/application-submission.entity.ts b/services/apps/alcs/src/portal/application-submission/application-submission.entity.ts index 9e18ff570..fa03e56b8 100644 --- a/services/apps/alcs/src/portal/application-submission/application-submission.entity.ts +++ b/services/apps/alcs/src/portal/application-submission/application-submission.entity.ts @@ -17,6 +17,7 @@ import { ColumnNumericTransformer } from '../../utils/column-numeric-transform'; import { ApplicationOwner } from './application-owner/application-owner.entity'; import { ApplicationParcel } from './application-parcel/application-parcel.entity'; import { NaruSubtype } from './naru-subtype/naru-subtype.entity'; +import { ProposedStructure } from '../notice-of-intent-submission/notice-of-intent-submission.entity'; export class ProposedLot { type: 'Lot' | 'Road Dedication' | null; @@ -571,6 +572,35 @@ export class ApplicationSubmission extends Base { @Column({ type: 'boolean', nullable: true }) soilHasSubmittedNotice: boolean | null; + @AutoMap(() => String) + @Column({ type: 'text', nullable: true }) + soilStructureFarmUseReason: string | null; + + @AutoMap(() => String) + @Column({ type: 'text', nullable: true }) + soilStructureResidentialUseReason: string | null; + + @AutoMap(() => String) + @Column({ type: 'text', nullable: true }) + soilAgriParcelActivity: string | null; + + @AutoMap(() => String) + @Column({ type: 'text', nullable: true }) + soilStructureResidentialAccessoryUseReason: string | null; + + @AutoMap(() => String) + @Column({ type: 'text', nullable: true }) + soilStructureOtherUseReason: string | null; + + @AutoMap(() => ProposedStructure) + @Column({ + comment: 'JSONB Column containing the proposed structures', + type: 'jsonb', + array: false, + default: () => `'[]'`, + }) + soilProposedStructures: ProposedStructure[]; + @AutoMap(() => Boolean) @Column({ type: 'boolean', nullable: true }) naruWillBeOverFiveHundredM2: boolean | null; diff --git a/services/apps/alcs/src/providers/typeorm/migrations/1729108829555-add_new_app_soil_conditional_questions.ts b/services/apps/alcs/src/providers/typeorm/migrations/1729108829555-add_new_app_soil_conditional_questions.ts new file mode 100644 index 000000000..6f64eebfd --- /dev/null +++ b/services/apps/alcs/src/providers/typeorm/migrations/1729108829555-add_new_app_soil_conditional_questions.ts @@ -0,0 +1,26 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class AddNewAppSoilConditionalQuestions1729108829555 implements MigrationInterface { + name = 'AddNewAppSoilConditionalQuestions1729108829555' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "alcs"."application_submission" ADD "soil_structure_farm_use_reason" text`); + await queryRunner.query(`ALTER TABLE "alcs"."application_submission" ADD "soil_structure_residential_use_reason" text`); + await queryRunner.query(`ALTER TABLE "alcs"."application_submission" ADD "soil_agri_parcel_activity" text`); + await queryRunner.query(`ALTER TABLE "alcs"."application_submission" ADD "soil_structure_residential_accessory_use_reason" text`); + await queryRunner.query(`ALTER TABLE "alcs"."application_submission" ADD "soil_structure_other_use_reason" text`); + await queryRunner.query(`ALTER TABLE "alcs"."application_submission" ADD "soil_proposed_structures" jsonb NOT NULL DEFAULT '[]'`); + await queryRunner.query(`COMMENT ON COLUMN "alcs"."application_submission"."soil_proposed_structures" IS 'JSONB Column containing the proposed structures'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`COMMENT ON COLUMN "alcs"."application_submission"."soil_proposed_structures" IS 'JSONB Column containing the proposed structures'`); + await queryRunner.query(`ALTER TABLE "alcs"."application_submission" DROP COLUMN "soil_proposed_structures"`); + await queryRunner.query(`ALTER TABLE "alcs"."application_submission" DROP COLUMN "soil_structure_other_use_reason"`); + await queryRunner.query(`ALTER TABLE "alcs"."application_submission" DROP COLUMN "soil_structure_residential_accessory_use_reason"`); + await queryRunner.query(`ALTER TABLE "alcs"."application_submission" DROP COLUMN "soil_agri_parcel_activity"`); + await queryRunner.query(`ALTER TABLE "alcs"."application_submission" DROP COLUMN "soil_structure_residential_use_reason"`); + await queryRunner.query(`ALTER TABLE "alcs"."application_submission" DROP COLUMN "soil_structure_farm_use_reason"`); + } + +} From 52888edd2289c9889ba87bb06415e90ce511bf8e Mon Sep 17 00:00:00 2001 From: Tristan Slater <1631008+trslater@users.noreply.github.com> Date: Wed, 16 Oct 2024 13:44:42 -0700 Subject: [PATCH 08/45] Add new conditional structure questions to all services and DTO's --- .../services/application/application.dto.ts | 5 +++ .../application-submission.dto.ts | 10 ++++++ .../services/public/public-application.dto.ts | 5 +++ .../application-submission.dto.ts | 35 +++++++++++++++++++ .../application-submission.service.ts | 26 ++++++++++++++ .../application/public-application.dto.ts | 15 ++++++++ 6 files changed, 96 insertions(+) diff --git a/alcs-frontend/src/app/services/application/application.dto.ts b/alcs-frontend/src/app/services/application/application.dto.ts index 47007b877..77a1662cf 100644 --- a/alcs-frontend/src/app/services/application/application.dto.ts +++ b/alcs-frontend/src/app/services/application/application.dto.ts @@ -198,6 +198,11 @@ export interface ApplicationSubmissionDto { soilAlternativeMeasures: string | null; soilIsExtractionOrMining: boolean | null; soilHasSubmittedNotice: boolean | null; + soilStructureFarmUseReason: string | null; + soilStructureResidentialUseReason: string | null; + soilAgriParcelActivity: string | null; + soilStructureResidentialAccessoryUseReason: string | null; + soilStructureOtherUseReason: string | null; //NARU Fields naruWillBeOverFiveHundredM2: boolean | null; diff --git a/portal-frontend/src/app/services/application-submission/application-submission.dto.ts b/portal-frontend/src/app/services/application-submission/application-submission.dto.ts index 9fda0e0ff..e956e48b9 100644 --- a/portal-frontend/src/app/services/application-submission/application-submission.dto.ts +++ b/portal-frontend/src/app/services/application-submission/application-submission.dto.ts @@ -140,6 +140,11 @@ export interface ApplicationSubmissionDetailedDto extends ApplicationSubmissionD soilAlternativeMeasures: string | null; soilIsExtractionOrMining: boolean; soilHasSubmittedNotice: boolean; + soilStructureFarmUseReason: string | null; + soilStructureResidentialUseReason: string | null; + soilAgriParcelActivity: string | null; + soilStructureResidentialAccessoryUseReason: string | null; + soilStructureOtherUseReason: string | null; //NARU Fields naruWillBeOverFiveHundredM2: boolean | null; @@ -260,6 +265,11 @@ export interface ApplicationSubmissionUpdateDto { soilAlternativeMeasures?: string | null; soilIsExtractionOrMining?: boolean | null; soilHasSubmittedNotice?: boolean | null; + soilStructureFarmUseReason?: string | null; + soilStructureResidentialUseReason?: string | null; + soilAgriParcelActivity?: string | null; + soilStructureResidentialAccessoryUseReason?: string | null; + soilStructureOtherUseReason?: string | null; //NARU Fields naruWillBeOverFiveHundredM2?: boolean | null; diff --git a/portal-frontend/src/app/services/public/public-application.dto.ts b/portal-frontend/src/app/services/public/public-application.dto.ts index fba76b98d..967b49111 100644 --- a/portal-frontend/src/app/services/public/public-application.dto.ts +++ b/portal-frontend/src/app/services/public/public-application.dto.ts @@ -105,6 +105,11 @@ export interface PublicApplicationSubmissionDto { soilAlternativeMeasures?: string | null; soilIsExtractionOrMining?: boolean; soilHasSubmittedNotice?: boolean; + soilStructureFarmUseReason?: string | null; + soilStructureResidentialUseReason?: string | null; + soilAgriParcelActivity?: string | null; + soilStructureResidentialAccessoryUseReason?: string | null; + soilStructureOtherUseReason?: string | null; //NARU Fields naruWillBeOverFiveHundredM2: boolean | null; diff --git a/services/apps/alcs/src/portal/application-submission/application-submission.dto.ts b/services/apps/alcs/src/portal/application-submission/application-submission.dto.ts index 50b6aa116..1b4b09a39 100644 --- a/services/apps/alcs/src/portal/application-submission/application-submission.dto.ts +++ b/services/apps/alcs/src/portal/application-submission/application-submission.dto.ts @@ -245,6 +245,21 @@ export class ApplicationSubmissionDetailedDto extends ApplicationSubmissionDto { @AutoMap(() => Boolean) soilHasSubmittedNotice?: boolean; + @AutoMap(() => String) + soilStructureFarmUseReason?: string | null; + + @AutoMap(() => String) + soilStructureResidentialUseReason?: string | null; + + @AutoMap(() => String) + soilAgriParcelActivity?: string | null; + + @AutoMap(() => String) + soilStructureResidentialAccessoryUseReason?: string | null; + + @AutoMap(() => String) + soilStructureOtherUseReason?: string | null; + @AutoMap(() => Boolean) naruWillBeOverFiveHundredM2: boolean | null; @@ -661,6 +676,26 @@ export class ApplicationSubmissionUpdateDto { @IsOptional() soilHasSubmittedNotice?: boolean; + @IsString() + @IsOptional() + soilStructureFarmUseReason?: string | null; + + @IsString() + @IsOptional() + soilStructureResidentialUseReason?: string | null; + + @IsString() + @IsOptional() + soilAgriParcelActivity?: string | null; + + @IsString() + @IsOptional() + soilStructureResidentialAccessoryUseReason?: string | null; + + @IsString() + @IsOptional() + soilStructureOtherUseReason?: string | null; + //NARU Fields @IsBoolean() @IsOptional() diff --git a/services/apps/alcs/src/portal/application-submission/application-submission.service.ts b/services/apps/alcs/src/portal/application-submission/application-submission.service.ts index 946698d80..2cb64f663 100644 --- a/services/apps/alcs/src/portal/application-submission/application-submission.service.ts +++ b/services/apps/alcs/src/portal/application-submission/application-submission.service.ts @@ -924,6 +924,32 @@ export class ApplicationSubmissionService { applicationSubmission.soilHasSubmittedNotice, ); + applicationSubmission.soilStructureFarmUseReason = filterUndefined( + updateDto.soilStructureFarmUseReason, + applicationSubmission.soilStructureFarmUseReason, + ); + + applicationSubmission.soilStructureResidentialUseReason = filterUndefined( + updateDto.soilStructureResidentialUseReason, + applicationSubmission.soilStructureResidentialUseReason, + ); + + applicationSubmission.soilAgriParcelActivity = filterUndefined( + updateDto.soilAgriParcelActivity, + applicationSubmission.soilAgriParcelActivity, + ); + + applicationSubmission.soilStructureResidentialAccessoryUseReason = + filterUndefined( + updateDto.soilStructureResidentialAccessoryUseReason, + applicationSubmission.soilStructureResidentialAccessoryUseReason, + ); + + applicationSubmission.soilStructureOtherUseReason = filterUndefined( + updateDto.soilStructureOtherUseReason, + applicationSubmission.soilStructureOtherUseReason, + ); + if ( updateDto.soilHasSubmittedNotice === false || updateDto.soilIsExtractionOrMining === false diff --git a/services/apps/alcs/src/portal/public/application/public-application.dto.ts b/services/apps/alcs/src/portal/public/application/public-application.dto.ts index fb25711f4..2e10da26f 100644 --- a/services/apps/alcs/src/portal/public/application/public-application.dto.ts +++ b/services/apps/alcs/src/portal/public/application/public-application.dto.ts @@ -226,6 +226,21 @@ export class PublicApplicationSubmissionDto { @AutoMap(() => Boolean) soilHasSubmittedNotice?: boolean; + @AutoMap(() => String) + soilStructureFarmUseReason?: string | null; + + @AutoMap(() => String) + soilStructureResidentialUseReason?: string | null; + + @AutoMap(() => String) + soilAgriParcelActivity?: string | null; + + @AutoMap(() => String) + soilStructureResidentialAccessoryUseReason?: string | null; + + @AutoMap(() => String) + soilStructureOtherUseReason?: string | null; + //NARU Fields @AutoMap(() => Boolean) naruWillBeOverFiveHundredM2: boolean | null; From c5600ab4a5eb0d43d8ea4e1da3d00e538d695bc5 Mon Sep 17 00:00:00 2001 From: Tristan Slater <1631008+trslater@users.noreply.github.com> Date: Wed, 16 Oct 2024 13:54:39 -0700 Subject: [PATCH 09/45] Add missed DTO field --- .../application-submission/application-submission.dto.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/portal-frontend/src/app/services/application-submission/application-submission.dto.ts b/portal-frontend/src/app/services/application-submission/application-submission.dto.ts index e956e48b9..6005d9cbb 100644 --- a/portal-frontend/src/app/services/application-submission/application-submission.dto.ts +++ b/portal-frontend/src/app/services/application-submission/application-submission.dto.ts @@ -239,6 +239,7 @@ export interface ApplicationSubmissionUpdateDto { subdProposedLots?: ProposedLot[]; //Soil Fields + soilIsNewStructure?: boolean | null; soilIsFollowUp?: boolean | null; soilFollowUpIDs?: string | null; soilTypeRemoved?: string | null; From 7c12b6730607c654c8ee35b0f5287780ae687dc2 Mon Sep 17 00:00:00 2001 From: Tristan Slater <1631008+trslater@users.noreply.github.com> Date: Wed, 16 Oct 2024 17:13:37 -0700 Subject: [PATCH 10/45] Add structures to all DTO's and services --- .../src/app/services/application/application.dto.ts | 1 + .../application-submission/application-submission.dto.ts | 3 +++ .../src/app/services/public/public-application.dto.ts | 2 ++ .../application-submission/application-submission.dto.ts | 8 ++++++++ .../application-submission.service.ts | 5 +++++ .../portal/public/application/public-application.dto.ts | 4 ++++ 6 files changed, 23 insertions(+) diff --git a/alcs-frontend/src/app/services/application/application.dto.ts b/alcs-frontend/src/app/services/application/application.dto.ts index 77a1662cf..b26abcdc6 100644 --- a/alcs-frontend/src/app/services/application/application.dto.ts +++ b/alcs-frontend/src/app/services/application/application.dto.ts @@ -203,6 +203,7 @@ export interface ApplicationSubmissionDto { soilAgriParcelActivity: string | null; soilStructureResidentialAccessoryUseReason: string | null; soilStructureOtherUseReason: string | null; + soilProposedStructures: string | null; //NARU Fields naruWillBeOverFiveHundredM2: boolean | null; diff --git a/portal-frontend/src/app/services/application-submission/application-submission.dto.ts b/portal-frontend/src/app/services/application-submission/application-submission.dto.ts index 6005d9cbb..fc3cd2e53 100644 --- a/portal-frontend/src/app/services/application-submission/application-submission.dto.ts +++ b/portal-frontend/src/app/services/application-submission/application-submission.dto.ts @@ -1,5 +1,6 @@ import { BaseCodeDto } from '../../shared/dto/base.dto'; import { ApplicationOwnerDetailedDto } from '../application-owner/application-owner.dto'; +import { ProposedStructure } from '../notice-of-intent-submission/notice-of-intent-submission.dto'; export enum SUBMISSION_STATUS { IN_PROGRESS = 'PROG', @@ -145,6 +146,7 @@ export interface ApplicationSubmissionDetailedDto extends ApplicationSubmissionD soilAgriParcelActivity: string | null; soilStructureResidentialAccessoryUseReason: string | null; soilStructureOtherUseReason: string | null; + soilProposedStructures: ProposedStructure[]; //NARU Fields naruWillBeOverFiveHundredM2: boolean | null; @@ -271,6 +273,7 @@ export interface ApplicationSubmissionUpdateDto { soilAgriParcelActivity?: string | null; soilStructureResidentialAccessoryUseReason?: string | null; soilStructureOtherUseReason?: string | null; + soilProposedStructures?: ProposedStructure[]; //NARU Fields naruWillBeOverFiveHundredM2?: boolean | null; diff --git a/portal-frontend/src/app/services/public/public-application.dto.ts b/portal-frontend/src/app/services/public/public-application.dto.ts index 967b49111..744878fb9 100644 --- a/portal-frontend/src/app/services/public/public-application.dto.ts +++ b/portal-frontend/src/app/services/public/public-application.dto.ts @@ -4,6 +4,7 @@ import { NaruSubtypeDto, ProposedLot, } from '../application-submission/application-submission.dto'; +import { ProposedStructure } from '../notice-of-intent-submission/notice-of-intent-submission.dto'; import { PublicDocumentDto, PublicOwnerDto, PublicParcelDto } from './public.dto'; export interface ExistingResidence { @@ -110,6 +111,7 @@ export interface PublicApplicationSubmissionDto { soilAgriParcelActivity?: string | null; soilStructureResidentialAccessoryUseReason?: string | null; soilStructureOtherUseReason?: string | null; + soilProposedStructures?: ProposedStructure[]; //NARU Fields naruWillBeOverFiveHundredM2: boolean | null; diff --git a/services/apps/alcs/src/portal/application-submission/application-submission.dto.ts b/services/apps/alcs/src/portal/application-submission/application-submission.dto.ts index 1b4b09a39..33d131c02 100644 --- a/services/apps/alcs/src/portal/application-submission/application-submission.dto.ts +++ b/services/apps/alcs/src/portal/application-submission/application-submission.dto.ts @@ -20,6 +20,7 @@ import { ProposedLot, ProposedResidence, } from './application-submission.entity'; +import { ProposedStructure } from '../notice-of-intent-submission/notice-of-intent-submission.entity'; export const MAX_DESCRIPTION_FIELD_LENGTH = 4000; export const MAX_LANDUSE_FIELD_LENGTH = 500; @@ -260,6 +261,9 @@ export class ApplicationSubmissionDetailedDto extends ApplicationSubmissionDto { @AutoMap(() => String) soilStructureOtherUseReason?: string | null; + @AutoMap(() => [ProposedStructure]) + soilProposedStructures: ProposedStructure[]; + @AutoMap(() => Boolean) naruWillBeOverFiveHundredM2: boolean | null; @@ -696,6 +700,10 @@ export class ApplicationSubmissionUpdateDto { @IsOptional() soilStructureOtherUseReason?: string | null; + @IsArray() + @IsOptional() + soilProposedStructures?: ProposedStructure[]; + //NARU Fields @IsBoolean() @IsOptional() diff --git a/services/apps/alcs/src/portal/application-submission/application-submission.service.ts b/services/apps/alcs/src/portal/application-submission/application-submission.service.ts index 2cb64f663..c08061172 100644 --- a/services/apps/alcs/src/portal/application-submission/application-submission.service.ts +++ b/services/apps/alcs/src/portal/application-submission/application-submission.service.ts @@ -950,6 +950,11 @@ export class ApplicationSubmissionService { applicationSubmission.soilStructureOtherUseReason, ); + applicationSubmission.soilProposedStructures = filterUndefined( + updateDto.soilProposedStructures, + applicationSubmission.soilProposedStructures, + ); + if ( updateDto.soilHasSubmittedNotice === false || updateDto.soilIsExtractionOrMining === false diff --git a/services/apps/alcs/src/portal/public/application/public-application.dto.ts b/services/apps/alcs/src/portal/public/application/public-application.dto.ts index 2e10da26f..b76817ba3 100644 --- a/services/apps/alcs/src/portal/public/application/public-application.dto.ts +++ b/services/apps/alcs/src/portal/public/application/public-application.dto.ts @@ -7,6 +7,7 @@ import { ProposedResidence, } from '../../application-submission/application-submission.entity'; import { PublicOwnerDto } from '../public.dto'; +import { ProposedStructure } from '../../notice-of-intent-submission/notice-of-intent-submission.entity'; export class PublicApplicationSubmissionDto { @AutoMap() @@ -241,6 +242,9 @@ export class PublicApplicationSubmissionDto { @AutoMap(() => String) soilStructureOtherUseReason?: string | null; + @AutoMap(() => [ProposedStructure]) + soilProposedStructures: ProposedStructure[]; + //NARU Fields @AutoMap(() => Boolean) naruWillBeOverFiveHundredM2: boolean | null; From d46bfab079721462bc58852f78323f99977c7c5d Mon Sep 17 00:00:00 2001 From: Tristan Slater <1631008+trslater@users.noreply.github.com> Date: Wed, 16 Oct 2024 17:18:21 -0700 Subject: [PATCH 11/45] Expose structure form type for use by other modules --- .../structure-mobile-card/structure-mobile-card.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/portal-frontend/src/app/shared/mobile/structure-mobile-card/structure-mobile-card.component.ts b/portal-frontend/src/app/shared/mobile/structure-mobile-card/structure-mobile-card.component.ts index 43765d936..a0c616a73 100644 --- a/portal-frontend/src/app/shared/mobile/structure-mobile-card/structure-mobile-card.component.ts +++ b/portal-frontend/src/app/shared/mobile/structure-mobile-card/structure-mobile-card.component.ts @@ -1,7 +1,7 @@ import { Component, EventEmitter, Input, Output, type OnInit } from '@angular/core'; import { FormProposedStructure, - NOI_STRUCTURE_TYPE_LABEL_MAP, + STRUCTURE_TYPE_LABEL_MAP, STRUCTURE_TYPES, } from '../../../features/notice-of-intents/edit-submission/additional-information/additional-information.component'; import { ProposedStructure } from '../../../services/notice-of-intent-submission/notice-of-intent-submission.dto'; @@ -39,7 +39,7 @@ export class StructureMobileCardComponent implements OnInit { return null; } - return NOI_STRUCTURE_TYPE_LABEL_MAP[value]; + return STRUCTURE_TYPE_LABEL_MAP[value]; } isResidential(type: STRUCTURE_TYPES | null): boolean { From 736d832b127cc67eee17e2e321e1d48d1cf1bebc Mon Sep 17 00:00:00 2001 From: Tristan Slater <1631008+trslater@users.noreply.github.com> Date: Wed, 16 Oct 2024 17:21:02 -0700 Subject: [PATCH 12/45] Add structures table and conditional questions to UI --- .../pfrs-proposal.component.html | 291 ++++++++++++++++++ .../pfrs-proposal/pfrs-proposal.component.ts | 192 +++++++++++- 2 files changed, 482 insertions(+), 1 deletion(-) diff --git a/portal-frontend/src/app/features/applications/edit-submission/proposal/pfrs-proposal/pfrs-proposal.component.html b/portal-frontend/src/app/features/applications/edit-submission/proposal/pfrs-proposal/pfrs-proposal.component.html index 36d2a6484..7fbf77592 100644 --- a/portal-frontend/src/app/features/applications/edit-submission/proposal/pfrs-proposal/pfrs-proposal.component.html +++ b/portal-frontend/src/app/features/applications/edit-submission/proposal/pfrs-proposal/pfrs-proposal.component.html @@ -289,6 +289,297 @@

Proposal

Characters left: {{ 4000 - soilTypeRemovedText.textLength }}
+ +
+ Provide the total floor area (m2) of the proposed structure(s) +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
#{{ i + 1 }}Type + + + + {{ type.label }} + + + +
+ warning +
+ This field is required +
+
+
Total Floor Area + + + m2 + +
+ warning +
+ This field is required +
+
+
Action + +
+ No Proposed Structures Entered. Use the button below to add your first structure. +
+
+
+ +
+ + + At least one structure is required + +
+ +
+ + Selected proposed structure type(s) will determine the proposal questions below + +
+
+ + +
+ +
+ Please refer to + Farm Structures in the ALR + on the ALC website for more detail. +
+ + + +
+ warning +
This field is required
+
+
Characters left: {{ 4000 - soilStructureFarmUseReasonText.textLength }}
+
+ +
+ +
Include the area, yields, crop types, and farm equipment size and attachments
+ + + +
+ warning +
This field is required
+
+
Characters left: {{ 4000 - soilAgriParcelActivityText.textLength }}
+
+
+ + +
+ +
+ Please refer to + Housing in the ALR + on the ALC website for more detail. +
+ + + +
+ warning +
This field is required
+
+
Characters left: {{ 4000 - soilStructureResidentialUseReasonText.textLength }}
+
+
+ + +
+ +
+ Please refer to + Housing in the ALR + on the ALC website for more detail. +
+ + + +
+ warning +
This field is required
+
+
Characters left: {{ 4000 - structureResidentialAccessoryUseReasonText.textLength }}
+
+
+ + +
+ + + + +
+ warning +
This field is required
+
+
Characters left: {{ 4000 - soilStructureOtherUseReasonText.textLength }}
+
+
+