@@ -41,8 +41,8 @@
-
+ (openFileClicked)="onOpenFile(owner.corporateSummary)"
+ >
See more owners
diff --git a/portal-frontend/src/app/shared/owner-dialogs/parcel-owners/parcel-owners.component.ts b/portal-frontend/src/app/shared/owner-dialogs/parcel-owners/parcel-owners.component.ts
index 1185a60f79..b17993c393 100644
--- a/portal-frontend/src/app/shared/owner-dialogs/parcel-owners/parcel-owners.component.ts
+++ b/portal-frontend/src/app/shared/owner-dialogs/parcel-owners/parcel-owners.component.ts
@@ -15,6 +15,7 @@ import { openFileInline } from '../../utils/file';
import { ApplicationDocumentDto } from '../../../services/application-document/application-document.dto';
import { NoticeOfIntentDocumentDto } from '../../../services/notice-of-intent-document/notice-of-intent-document.dto';
import { MOBILE_BREAKPOINT } from '../../utils/breakpoints';
+import { ConfirmationDialogService } from '../../../shared/confirmation-dialog/confirmation-dialog.service';
@Component({
selector: 'app-parcel-owners[owners][fileId][submissionUuid][ownerService]',
@@ -70,7 +71,7 @@ export class ParcelOwnersComponent implements OnInit{
VISIBLE_COUNT = 5;
visibleCount = this.VISIBLE_COUNT;
- constructor(private dialog: MatDialog) {}
+ constructor(private dialog: MatDialog, private confirmationDialogService: ConfirmationDialogService) {}
ngOnInit(): void {
this.isMobile = window.innerWidth <= MOBILE_BREAKPOINT;
@@ -114,7 +115,16 @@ export class ParcelOwnersComponent implements OnInit{
}
async onRemove(uuid: string) {
- this.onOwnerRemoved.emit(uuid);
+ this.confirmationDialogService
+ .openDialog({
+ body: `Warning: Do you want to continue?`,
+ title: 'Remove Parcel Owner',
+ })
+ .subscribe(async (answer) => {
+ if (answer) {
+ this.onOwnerRemoved.emit(uuid);
+ }
+ });
}
async onOpenFile(file: ApplicationDocumentDto | NoticeOfIntentDocumentDto) {
diff --git a/portal-frontend/src/app/shared/shared.module.ts b/portal-frontend/src/app/shared/shared.module.ts
index 1228fea16d..a6c6f7e54e 100644
--- a/portal-frontend/src/app/shared/shared.module.ts
+++ b/portal-frontend/src/app/shared/shared.module.ts
@@ -53,6 +53,7 @@ import { OptionalAttachmentsMobileCardComponent } from './optional-attachments-m
import { OtherAttachmentMobileCardComponent } from './other-attachment-mobile-card/other-attachment-mobile-card.component';
import { ParcelOwnerMobileCardComponent } from './mobile/parcel-owner-mobile-card/parcel-owner-mobile-card.component';
import { TransfereeMobileCardComponent } from './mobile/transferee-mobile-card/transferee-mobile-card.component';
+import { NaruResidenceMobileCardComponent } from './mobile/naru-residence-mobile-card/naru-residence-mobile-card.component';
@NgModule({
providers: [
@@ -113,6 +114,7 @@ import { TransfereeMobileCardComponent } from './mobile/transferee-mobile-card/t
OtherAttachmentMobileCardComponent,
ParcelOwnerMobileCardComponent,
TransfereeMobileCardComponent,
+ NaruResidenceMobileCardComponent,
],
exports: [
CommonModule,
@@ -165,6 +167,7 @@ import { TransfereeMobileCardComponent } from './mobile/transferee-mobile-card/t
OtherAttachmentMobileCardComponent,
ParcelOwnerMobileCardComponent,
TransfereeMobileCardComponent,
+ NaruResidenceMobileCardComponent,
],
})
export class SharedModule {
diff --git a/portal-frontend/src/app/shared/soil-table/soil-table.component.html b/portal-frontend/src/app/shared/soil-table/soil-table.component.html
index 56ba63f4b4..f8bb602769 100644
--- a/portal-frontend/src/app/shared/soil-table/soil-table.component.html
+++ b/portal-frontend/src/app/shared/soil-table/soil-table.component.html
@@ -19,48 +19,50 @@
{{ tableHeader2 }}
-
- Volume
-
-
-
-
- m3
-
-
-
warning
-
This field is required
+
+
+ Volume
-
-
-
-
- m3
-
-
-
warning
-
This field is required
+
+
+
+ m3
+
+
+
warning
+
This field is required
+
-
+
+
+
+ m3
+
+
+
warning
+
This field is required
+
+
+
Area
diff --git a/portal-frontend/src/app/shared/soil-table/soil-table.component.ts b/portal-frontend/src/app/shared/soil-table/soil-table.component.ts
index cc6895e9dd..cfe91bef05 100644
--- a/portal-frontend/src/app/shared/soil-table/soil-table.component.ts
+++ b/portal-frontend/src/app/shared/soil-table/soil-table.component.ts
@@ -20,6 +20,7 @@ export class SoilTableComponent implements OnInit, OnChanges {
@Input() data2?: SoilTableData;
@Input() disabled = false;
@Input() touchAll = false;
+ @Input() showVolumeField = true;
@Output() dataChange = new EventEmitter
();
@Output() data2Change = new EventEmitter();
@@ -27,12 +28,12 @@ export class SoilTableComponent implements OnInit, OnChanges {
idSuffix?: string;
idSuffix2?: string | undefined;
- volume = new FormControl(null, [Validators.required]);
+ volume = new FormControl(null);
area = new FormControl(null, [Validators.required]);
maximumDepth = new FormControl(null, [Validators.required]);
averageDepth = new FormControl(null, [Validators.required]);
- volume2 = new FormControl(null, [Validators.required]);
+ volume2 = new FormControl(null);
area2 = new FormControl(null, [Validators.required]);
maximumDepth2 = new FormControl(null, [Validators.required]);
averageDepth2 = new FormControl(null, [Validators.required]);
@@ -49,6 +50,11 @@ export class SoilTableComponent implements OnInit, OnChanges {
});
ngOnInit(): void {
+ if (this.showVolumeField) {
+ this.volume.setValidators([Validators.required]);
+ this.volume2.setValidators([Validators.required]);
+ }
+
if (this.data) {
this.volume.setValue(this.data.volume?.toString(10) ?? null);
this.area.setValue(this.data.area?.toString(10) ?? null);
diff --git a/portal-frontend/src/app/shared/utils/string-helper.ts b/portal-frontend/src/app/shared/utils/string-helper.ts
index d70405abe1..17d1814874 100644
--- a/portal-frontend/src/app/shared/utils/string-helper.ts
+++ b/portal-frontend/src/app/shared/utils/string-helper.ts
@@ -10,3 +10,11 @@ export const parseStringToBoolean = (val?: string | null) => {
return undefined;
}
};
+
+export function truncate(text: string, limit: number): string {
+ return text.length > limit ? text.substring(0, limit) + '...' : text;
+}
+
+export function isTruncated(text: string, limit: number): boolean {
+ return text.length > limit;
+}
diff --git a/portal-frontend/src/assets/siting-figures/clustered.svg b/portal-frontend/src/assets/siting-figures/clustered.svg
new file mode 100644
index 0000000000..648e54ffbd
--- /dev/null
+++ b/portal-frontend/src/assets/siting-figures/clustered.svg
@@ -0,0 +1,4358 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/portal-frontend/src/assets/siting-figures/setback.svg b/portal-frontend/src/assets/siting-figures/setback.svg
new file mode 100644
index 0000000000..c0e90cf3c8
--- /dev/null
+++ b/portal-frontend/src/assets/siting-figures/setback.svg
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/portal-frontend/src/assets/siting-figures/unclustered.svg b/portal-frontend/src/assets/siting-figures/unclustered.svg
new file mode 100644
index 0000000000..13983d6386
--- /dev/null
+++ b/portal-frontend/src/assets/siting-figures/unclustered.svg
@@ -0,0 +1,2704 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/services/apps/alcs/src/alcs/application-decision/application-decision-v2/application-decision/component/application-decision-component.service.ts b/services/apps/alcs/src/alcs/application-decision/application-decision-v2/application-decision/component/application-decision-component.service.ts
index bafe559735..a665505c42 100644
--- a/services/apps/alcs/src/alcs/application-decision/application-decision-v2/application-decision/component/application-decision-component.service.ts
+++ b/services/apps/alcs/src/alcs/application-decision/application-decision-v2/application-decision/component/application-decision-component.service.ts
@@ -46,29 +46,23 @@ export class ApplicationDecisionComponentService {
updateDto.applicationDecisionComponentTypeCode;
}
- component.alrArea = filterUndefined(
- updateDto.alrArea,
- component.alrArea
- );
- component.agCap = filterUndefined(
- updateDto.agCap,
- component.agCap
- );
+ component.alrArea = filterUndefined(updateDto.alrArea, component.alrArea);
+ component.agCap = filterUndefined(updateDto.agCap, component.agCap);
component.agCapSource = filterUndefined(
updateDto.agCapSource,
- component.agCapSource
+ component.agCapSource,
);
component.agCapMap = filterUndefined(
updateDto.agCapMap,
- component.agCapMap
+ component.agCapMap,
);
component.agCapConsultant = filterUndefined(
updateDto.agCapConsultant,
- component.agCapConsultant
+ component.agCapConsultant,
);
component.endDate2 = filterUndefined(
formatIncomingDate(updateDto.endDate2),
- component.endDate2
+ component.endDate2,
);
this.patchNfuFields(component, updateDto);
@@ -85,7 +79,7 @@ export class ApplicationDecisionComponentService {
component.inclExclApplicantType = updateDto.inclExclApplicantType;
component.expiryDate = filterUndefined(
formatIncomingDate(updateDto.expiryDate),
- component.expiryDate
+ component.expiryDate,
);
}
@@ -159,16 +153,13 @@ export class ApplicationDecisionComponentService {
) {
component.endDate = filterUndefined(
formatIncomingDate(updateDto.endDate),
- component.endDate
+ component.endDate,
);
component.nfuSubType = filterUndefined(
updateDto.nfuSubType,
- component.nfuSubType
- );
- component.nfuType = filterUndefined(
- updateDto.nfuType,
- component.nfuType
+ component.nfuSubType,
);
+ component.nfuType = filterUndefined(updateDto.nfuType, component.nfuType);
}
private patchTurpFields(
@@ -177,7 +168,7 @@ export class ApplicationDecisionComponentService {
) {
component.expiryDate = filterUndefined(
formatIncomingDate(updateDto.expiryDate),
- component.expiryDate
+ component.expiryDate,
);
}
@@ -187,27 +178,27 @@ export class ApplicationDecisionComponentService {
) {
component.endDate = filterUndefined(
formatIncomingDate(updateDto.endDate),
- component.endDate
+ component.endDate,
);
component.soilFillTypeToPlace = filterUndefined(
updateDto.soilFillTypeToPlace,
- component.soilFillTypeToPlace
+ component.soilFillTypeToPlace,
);
component.soilToPlaceArea = filterUndefined(
updateDto.soilToPlaceArea,
- component.soilToPlaceArea
+ component.soilToPlaceArea,
);
component.soilToPlaceVolume = filterUndefined(
updateDto.soilToPlaceVolume,
- component.soilToPlaceVolume
+ component.soilToPlaceVolume,
);
component.soilToPlaceMaximumDepth = filterUndefined(
updateDto.soilToPlaceMaximumDepth,
- component.soilToPlaceMaximumDepth
+ component.soilToPlaceMaximumDepth,
);
component.soilToPlaceAverageDepth = filterUndefined(
updateDto.soilToPlaceAverageDepth,
- component.soilToPlaceAverageDepth
+ component.soilToPlaceAverageDepth,
);
}
@@ -217,27 +208,27 @@ export class ApplicationDecisionComponentService {
) {
component.endDate = filterUndefined(
formatIncomingDate(updateDto.endDate),
- component.endDate
+ component.endDate,
);
component.soilTypeRemoved = filterUndefined(
updateDto.soilTypeRemoved,
- component.soilTypeRemoved
+ component.soilTypeRemoved,
);
component.soilToRemoveVolume = filterUndefined(
updateDto.soilToRemoveVolume,
- component.soilToRemoveVolume
+ component.soilToRemoveVolume,
);
component.soilToRemoveArea = filterUndefined(
updateDto.soilToRemoveArea,
- component.soilToRemoveArea
+ component.soilToRemoveArea,
);
component.soilToRemoveMaximumDepth = filterUndefined(
updateDto.soilToRemoveMaximumDepth,
- component.soilToRemoveMaximumDepth
+ component.soilToRemoveMaximumDepth,
);
component.soilToRemoveAverageDepth = filterUndefined(
updateDto.soilToRemoveAverageDepth,
- component.soilToRemoveAverageDepth
+ component.soilToRemoveAverageDepth,
);
}
@@ -247,11 +238,11 @@ export class ApplicationDecisionComponentService {
) {
component.endDate = filterUndefined(
formatIncomingDate(updateDto.endDate),
- component.endDate
+ component.endDate,
);
component.expiryDate = filterUndefined(
formatIncomingDate(updateDto.expiryDate),
- component.expiryDate
+ component.expiryDate,
);
component.naruSubtypeCode = updateDto.naruSubtypeCode;
}
@@ -354,13 +345,6 @@ export class ApplicationDecisionComponentService {
this.validatePofoDecisionComponentFields(component, errors);
this.validateRosoDecisionComponentFields(component, errors);
}
-
- if (
- component.applicationDecisionComponentTypeCode ===
- APPLICATION_DECISION_COMPONENT_TYPE.NARU
- ) {
- this.validateNaruDecisionComponentFields(component, errors);
- }
}
if (errors.length > 0) {
@@ -389,9 +373,6 @@ export class ApplicationDecisionComponentService {
'Type, origin and quality of fill approved to be placed is required',
);
}
- if (!component.soilToPlaceVolume) {
- errors.push('Volume To Place is required');
- }
if (!component.soilToPlaceArea) {
errors.push('Area To Place is required');
}
@@ -410,9 +391,6 @@ export class ApplicationDecisionComponentService {
if (!component.soilTypeRemoved) {
errors.push('Type of soil approved to be removed is required');
}
- if (!component.soilToRemoveVolume) {
- errors.push('Volume To Remove is required');
- }
if (!component.soilToRemoveArea) {
errors.push('Area To Remove is required');
}
@@ -423,13 +401,4 @@ export class ApplicationDecisionComponentService {
errors.push('Average Depth To Remove is required');
}
}
-
- private validateNaruDecisionComponentFields(
- component: CreateApplicationDecisionComponentDto,
- errors: string[],
- ) {
- if (!component.naruSubtypeCode) {
- errors.push('Residential Use Type is required');
- }
- }
}
diff --git a/services/apps/alcs/src/alcs/application/application.service.ts b/services/apps/alcs/src/alcs/application/application.service.ts
index 095e42a1cc..ac8aac6a1f 100644
--- a/services/apps/alcs/src/alcs/application/application.service.ts
+++ b/services/apps/alcs/src/alcs/application/application.service.ts
@@ -545,8 +545,9 @@ export class ApplicationService {
SELECT *
FROM alcs.calculate_active_days(ARRAY(SELECT fa."application_uuid" FROM filtered_applications fa))
)
- SELECT a.file_number, a.applicant, board.code, u.name, u.given_name, u.family_name, c.high_priority, calc.active_days FROM alcs.application a
- INNER JOIN alcs.card c ON c."uuid" = a.card_uuid
+ SELECT a.file_number, a.applicant, board.code, u.name, u.given_name, u.family_name, c.high_priority, calc.active_days FROM alcs.application a
+ INNER JOIN alcs.application_reconsideration ar on ar.application_uuid = a.uuid
+ INNER JOIN alcs.card c ON c."uuid" = ar.card_uuid
INNER JOIN calculated calc ON a."uuid" = calc.application_uuid
INNER JOIN alcs.board board on c.board_uuid = board.uuid
LEFT JOIN alcs.user u on u.uuid = c.assignee_uuid
diff --git a/services/apps/alcs/src/portal/application-submission/application-submission-validator.service.spec.ts b/services/apps/alcs/src/portal/application-submission/application-submission-validator.service.spec.ts
index dffa1ebb44..69e8d168cb 100644
--- a/services/apps/alcs/src/portal/application-submission/application-submission-validator.service.spec.ts
+++ b/services/apps/alcs/src/portal/application-submission/application-submission-validator.service.spec.ts
@@ -520,12 +520,9 @@ describe('ApplicationSubmissionValidatorService', () => {
nfuAgricultureSupport: 'VALID',
nfuWillImportFill: true,
nfuFillTypeDescription: 'VALID',
- nfuFillOriginDescription: 'VALID',
nfuTotalFillArea: 0.0,
nfuMaxFillDepth: 1.5125,
nfuAverageFillDepth: 1261.21,
- nfuFillVolume: 742.1,
- nfuProjectDuration: '1 day',
});
const res = await service.validateSubmission(application);
@@ -567,13 +564,9 @@ describe('ApplicationSubmissionValidatorService', () => {
nfuOutsideLands: 'VALID',
nfuAgricultureSupport: 'VALID',
nfuWillImportFill: true,
- nfuFillTypeDescription: 'VALID',
- nfuFillOriginDescription: null,
nfuTotalFillArea: 0.0,
nfuMaxFillDepth: 1.5125,
nfuAverageFillDepth: 121,
- nfuFillVolume: 742.1,
- nfuProjectDuration: '1 day',
typeCode: 'NFUP',
});
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 8b91a901b2..8d43578847 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
@@ -425,12 +425,9 @@ export class ApplicationSubmissionValidatorService {
if (applicationSubmission.nfuWillImportFill) {
if (
!applicationSubmission.nfuFillTypeDescription ||
- !applicationSubmission.nfuFillOriginDescription ||
applicationSubmission.nfuTotalFillArea === null ||
applicationSubmission.nfuMaxFillDepth === null ||
- applicationSubmission.nfuAverageFillDepth === null ||
- applicationSubmission.nfuFillVolume === null ||
- !applicationSubmission.nfuProjectDuration
+ applicationSubmission.nfuAverageFillDepth === null
) {
errors.push(
new ServiceValidationException(`NFU Fill Section incomplete`),
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 dc5abea643..9023fb215f 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
@@ -15,7 +15,11 @@ import {
} from '../../alcs/application/application-submission-status/submission-status.dto';
import { BaseCodeDto } from '../../common/dtos/base.dto';
import { ApplicationOwnerDto } from './application-owner/application-owner.dto';
-import { ProposedLot } from './application-submission.entity';
+import {
+ ExistingResidence,
+ ProposedLot,
+ ProposedResidence,
+} from './application-submission.entity';
export const MAX_DESCRIPTION_FIELD_LENGTH = 4000;
export const MAX_LANDUSE_FIELD_LENGTH = 500;
@@ -238,6 +242,36 @@ export class ApplicationSubmissionDetailedDto extends ApplicationSubmissionDto {
@AutoMap(() => Boolean)
soilHasSubmittedNotice?: boolean;
+ @AutoMap(() => Boolean)
+ naruWillBeOverFiveHundredM2: boolean | null;
+
+ @AutoMap(() => Boolean)
+ naruWillRetainResidence: boolean | null;
+
+ @AutoMap(() => Boolean)
+ naruWillHaveAdditionalResidence: boolean | null;
+
+ @AutoMap(() => Boolean)
+ naruWillHaveTemporaryForeignWorkerHousing: boolean | null;
+
+ @AutoMap(() => Boolean)
+ naruWillImportFill: boolean | null;
+
+ @AutoMap(() => String)
+ tfwhCount: string | null;
+
+ @AutoMap(() => Boolean)
+ tfwhDesign: boolean | null;
+
+ @AutoMap(() => String)
+ tfwhFarmSize: string | null;
+
+ @AutoMap(() => String)
+ naruClustered: string | null;
+
+ @AutoMap(() => String)
+ naruSetback: string | null;
+
//NARU Fields
@AutoMap(() => [NaruSubtypeDto])
naruSubtype: NaruSubtypeDto | null;
@@ -257,9 +291,6 @@ export class ApplicationSubmissionDetailedDto extends ApplicationSubmissionDto {
@AutoMap(() => String)
naruExistingStructures: string | null;
- @AutoMap(() => Boolean)
- naruWillImportFill: boolean | null;
-
@AutoMap(() => String)
naruFillType: string | null;
@@ -287,6 +318,12 @@ export class ApplicationSubmissionDetailedDto extends ApplicationSubmissionDto {
@AutoMap(() => String)
naruAgriTourism: string | null;
+ @AutoMap(() => ExistingResidence)
+ naruExistingResidences?: ExistingResidence[];
+
+ @AutoMap(() => ProposedResidence)
+ naruProposedResidences?: ProposedResidence[];
+
@AutoMap(() => ApplicationSubmissionToSubmissionStatusDto)
submissionStatuses: ApplicationSubmissionToSubmissionStatusDto[];
@@ -618,6 +655,46 @@ export class ApplicationSubmissionUpdateDto {
soilHasSubmittedNotice?: boolean;
//NARU Fields
+ @IsBoolean()
+ @IsOptional()
+ naruWillBeOverFiveHundredM2?: boolean | null;
+
+ @IsBoolean()
+ @IsOptional()
+ naruWillRetainResidence?: boolean | null;
+
+ @IsBoolean()
+ @IsOptional()
+ naruWillHaveAdditionalResidence?: boolean | null;
+
+ @IsBoolean()
+ @IsOptional()
+ naruWillHaveTemporaryForeignWorkerHousing?: boolean | null;
+
+ @IsBoolean()
+ @IsOptional()
+ naruWillImportFill?: boolean | null;
+
+ @IsString()
+ @IsOptional()
+ tfwhCount?: string | null;
+
+ @IsBoolean()
+ @IsOptional()
+ tfwhDesign?: boolean | null;
+
+ @IsString()
+ @IsOptional()
+ tfwhFarmSize?: string | null;
+
+ @IsString()
+ @IsOptional()
+ naruClustered?: string | null;
+
+ @IsString()
+ @IsOptional()
+ naruSetback?: string | null;
+
@IsString()
@IsOptional()
naruSubtypeCode?: string | null;
@@ -642,10 +719,6 @@ export class ApplicationSubmissionUpdateDto {
@IsOptional()
naruExistingStructures?: string | null;
- @IsBoolean()
- @IsOptional()
- naruWillImportFill?: boolean | null;
-
@IsString()
@IsOptional()
naruFillType?: string | null;
@@ -683,6 +756,14 @@ export class ApplicationSubmissionUpdateDto {
@IsOptional()
naruAgriTourism?: string | null;
+ @IsArray()
+ @IsOptional()
+ naruExistingResidences?: ExistingResidence[];
+
+ @IsArray()
+ @IsOptional()
+ naruProposedResidences?: ProposedResidence[];
+
//Inclusion / Exclusion Fields
@IsString()
@IsOptional()
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 59db1d3596..e887c6f4fe 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
@@ -25,6 +25,16 @@ export class ProposedLot {
planNumbers: string | null;
}
+export class ExistingResidence {
+ floorArea: number;
+ description: string;
+}
+
+export class ProposedResidence {
+ floorArea: number;
+ description: string;
+}
+
@Entity({
comment: 'Portal intake form fields for applications',
})
@@ -557,6 +567,42 @@ export class ApplicationSubmission extends Base {
@Column({ type: 'boolean', nullable: true })
soilHasSubmittedNotice: boolean | null;
+ @AutoMap(() => Boolean)
+ @Column({ type: 'boolean', nullable: true })
+ naruWillBeOverFiveHundredM2: boolean | null;
+
+ @AutoMap(() => Boolean)
+ @Column({ type: 'boolean', nullable: true })
+ naruWillRetainResidence: boolean | null;
+
+ @AutoMap(() => Boolean)
+ @Column({ type: 'boolean', nullable: true })
+ naruWillHaveAdditionalResidence: boolean | null;
+
+ @AutoMap(() => Boolean)
+ @Column({ type: 'boolean', nullable: true })
+ naruWillHaveTemporaryForeignWorkerHousing: boolean | null;
+
+ @AutoMap(() => String)
+ @Column({ type: 'text', nullable: true })
+ tfwhCount: string | null;
+
+ @AutoMap(() => Boolean)
+ @Column({ type: 'boolean', nullable: true })
+ tfwhDesign: boolean | null;
+
+ @AutoMap(() => String)
+ @Column({ type: 'text', nullable: true })
+ tfwhFarmSize: string | null;
+
+ @AutoMap(() => String)
+ @Column({ type: 'text', nullable: true })
+ naruClustered: string | null;
+
+ @AutoMap(() => String)
+ @Column({ type: 'text', nullable: true })
+ naruSetback: string | null;
+
//NARU
@AutoMap(() => NaruSubtype)
@ManyToOne(() => NaruSubtype)
@@ -662,6 +708,24 @@ export class ApplicationSubmission extends Base {
@Column({ type: 'text', nullable: true })
naruAgriTourism: string | null;
+ @AutoMap(() => [ExistingResidence])
+ @Column({
+ comment: 'JSONB column containing NARU existing residences',
+ type: 'jsonb',
+ array: false,
+ default: () => `'[]'`,
+ })
+ naruExistingResidences: ExistingResidence[];
+
+ @AutoMap(() => [ProposedResidence])
+ @Column({
+ comment: 'JSONB column containing NARU proposed residences',
+ type: 'jsonb',
+ array: false,
+ default: () => `'[]'`,
+ })
+ naruProposedResidences: ProposedResidence[];
+
//Inclusion / Exclusion Fields
@AutoMap(() => String)
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 e6baa3ba92..8b64f91950 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
@@ -743,22 +743,10 @@ export class ApplicationSubmissionService {
updateDto.nfuAverageFillDepth,
application.nfuAverageFillDepth,
);
- application.nfuFillVolume = filterUndefined(
- updateDto.nfuFillVolume,
- application.nfuFillVolume,
- );
- application.nfuProjectDuration = filterUndefined(
- updateDto.nfuProjectDuration,
- application.nfuProjectDuration,
- );
application.nfuFillTypeDescription = filterUndefined(
updateDto.nfuFillTypeDescription,
application.nfuFillTypeDescription,
);
- application.nfuFillOriginDescription = filterUndefined(
- updateDto.nfuFillOriginDescription,
- application.nfuFillOriginDescription,
- );
return application;
}
@@ -950,6 +938,47 @@ export class ApplicationSubmissionService {
applicationSubmission: ApplicationSubmission,
updateDto: ApplicationSubmissionUpdateDto,
) {
+ applicationSubmission.naruWillBeOverFiveHundredM2 = filterUndefined(
+ updateDto.naruWillBeOverFiveHundredM2,
+ applicationSubmission.naruWillBeOverFiveHundredM2,
+ );
+ applicationSubmission.naruWillRetainResidence = filterUndefined(
+ updateDto.naruWillRetainResidence,
+ applicationSubmission.naruWillRetainResidence,
+ );
+ applicationSubmission.naruWillHaveAdditionalResidence = filterUndefined(
+ updateDto.naruWillHaveAdditionalResidence,
+ applicationSubmission.naruWillHaveAdditionalResidence,
+ );
+ applicationSubmission.naruWillHaveTemporaryForeignWorkerHousing =
+ filterUndefined(
+ updateDto.naruWillHaveTemporaryForeignWorkerHousing,
+ applicationSubmission.naruWillHaveTemporaryForeignWorkerHousing,
+ );
+ applicationSubmission.naruWillImportFill = filterUndefined(
+ updateDto.naruWillImportFill,
+ applicationSubmission.naruWillImportFill,
+ );
+ applicationSubmission.tfwhCount = filterUndefined(
+ updateDto.tfwhCount,
+ applicationSubmission.tfwhCount,
+ );
+ applicationSubmission.tfwhDesign = filterUndefined(
+ updateDto.tfwhDesign,
+ applicationSubmission.tfwhDesign,
+ );
+ applicationSubmission.tfwhFarmSize = filterUndefined(
+ updateDto.tfwhFarmSize,
+ applicationSubmission.tfwhFarmSize,
+ );
+ applicationSubmission.naruClustered = filterUndefined(
+ updateDto.naruClustered,
+ applicationSubmission.naruClustered,
+ );
+ applicationSubmission.naruSetback = filterUndefined(
+ updateDto.naruSetback,
+ applicationSubmission.naruSetback,
+ );
applicationSubmission.naruSubtype = undefined;
applicationSubmission.naruSubtypeCode = filterUndefined(
updateDto.naruSubtypeCode,
@@ -975,26 +1004,10 @@ export class ApplicationSubmissionService {
updateDto.naruExistingStructures,
applicationSubmission.naruExistingStructures,
);
- applicationSubmission.naruWillImportFill = filterUndefined(
- updateDto.naruWillImportFill,
- applicationSubmission.naruWillImportFill,
- );
applicationSubmission.naruFillType = filterUndefined(
updateDto.naruFillType,
applicationSubmission.naruFillType,
);
- applicationSubmission.naruFillOrigin = filterUndefined(
- updateDto.naruFillOrigin,
- applicationSubmission.naruFillOrigin,
- );
- applicationSubmission.naruProjectDuration = filterUndefined(
- updateDto.naruProjectDuration,
- applicationSubmission.naruProjectDuration,
- );
- applicationSubmission.naruToPlaceVolume = filterUndefined(
- updateDto.naruToPlaceVolume,
- applicationSubmission.naruToPlaceVolume,
- );
applicationSubmission.naruToPlaceArea = filterUndefined(
updateDto.naruToPlaceArea,
applicationSubmission.naruToPlaceArea,
@@ -1015,6 +1028,15 @@ export class ApplicationSubmissionService {
updateDto.naruAgriTourism,
applicationSubmission.naruAgriTourism,
);
+ applicationSubmission.naruExistingResidences = filterUndefined(
+ updateDto.naruExistingResidences,
+ applicationSubmission.naruExistingResidences,
+ );
+
+ applicationSubmission.naruProposedResidences = filterUndefined(
+ updateDto.naruProposedResidences,
+ applicationSubmission.naruProposedResidences,
+ );
}
private setInclusionExclusionFields(
diff --git a/services/apps/alcs/src/portal/inbox/notification/inbox-notification.service.ts b/services/apps/alcs/src/portal/inbox/notification/inbox-notification.service.ts
index 87899e710d..933389891a 100644
--- a/services/apps/alcs/src/portal/inbox/notification/inbox-notification.service.ts
+++ b/services/apps/alcs/src/portal/inbox/notification/inbox-notification.service.ts
@@ -42,6 +42,7 @@ export class InboxNotificationService {
if (cachedSearch) {
const cachedNumbers = JSON.parse(cachedSearch) as string[];
fileNumbers = new Set(cachedNumbers);
+ didSearch = true;
} else {
const res = await this.searchForFileNumbers(searchDto);
fileNumbers = res.finalResult;
@@ -155,6 +156,7 @@ export class InboxNotificationService {
}
if (searchDto.fileTypes.includes('SRW')) {
+ didSearch = true;
const promise = NOTIFICATION_SEARCH_FILTERS.addFileTypeResults(
searchDto,
this.notificationRepository,
diff --git a/services/apps/alcs/src/portal/pdf-generation/generate-submission-document.service.ts b/services/apps/alcs/src/portal/pdf-generation/generate-submission-document.service.ts
index 5a6510448e..682eef4416 100644
--- a/services/apps/alcs/src/portal/pdf-generation/generate-submission-document.service.ts
+++ b/services/apps/alcs/src/portal/pdf-generation/generate-submission-document.service.ts
@@ -180,7 +180,7 @@ export class GenerateSubmissionDocumentService {
payload = this.populateNfuData(payload, submission);
return { payload, templateName: 'nfu-submission-template.docx' };
case APPLICATION_SUBMISSION_TYPES.NARU:
- payload = this.populateNaruData(payload, submission);
+ payload = this.populateNaruData(payload, submission, documents);
return { payload, templateName: 'naru-submission-template.docx' };
case APPLICATION_SUBMISSION_TYPES.TURP:
payload = this.populateTurData(payload, submission, documents);
@@ -254,11 +254,11 @@ export class GenerateSubmissionDocumentService {
const otherDocuments = documents.filter(
(e) =>
(!e.typeCode ||
- [
- DOCUMENT_TYPE.PHOTOGRAPH,
- DOCUMENT_TYPE.PROFESSIONAL_REPORT,
- DOCUMENT_TYPE.OTHER,
- ].includes((e.typeCode ?? 'undefined') as DOCUMENT_TYPE)) &&
+ [
+ DOCUMENT_TYPE.PHOTOGRAPH,
+ DOCUMENT_TYPE.PROFESSIONAL_REPORT,
+ DOCUMENT_TYPE.OTHER,
+ ].includes((e.typeCode ?? 'undefined') as DOCUMENT_TYPE)) &&
e.document.source === DOCUMENT_SOURCE.APPLICANT,
);
@@ -369,23 +369,58 @@ export class GenerateSubmissionDocumentService {
};
}
- private populateNaruData(pdfData: any, submission: ApplicationSubmission) {
+ private populateNaruData(
+ pdfData: any,
+ submission: ApplicationSubmission,
+ documents: ApplicationDocument[],
+ ) {
+ const naruExistingResidences = submission.naruExistingResidences.map(
+ (item, index) => {
+ return { ...item, cnt: index + 1 };
+ },
+ );
+
+ const naruProposedResidences = submission.naruProposedResidences.map(
+ (item, index) => {
+ return { ...item, cnt: index + 1 };
+ },
+ );
+
return {
...pdfData,
- naruSubtypeLabel: submission.naruSubtype?.label,
- naruSubtypeCode: submission.naruSubtypeCode,
- naruFloorArea: submission.naruFloorArea,
- naruResidenceNecessity: submission.naruResidenceNecessity,
- naruLocationRationale: submission.naruLocationRationale,
- naruInfrastructure: submission.naruInfrastructure,
- naruExistingStructures: submission.naruExistingStructures,
- naruSleepingUnits: submission.naruSleepingUnits,
- naruAgriTourism: submission.naruAgriTourism,
- showImportFill: submission.naruWillImportFill,
+ naruWillBeOverFiveHundredM2: formatBooleanToYesNoString(
+ submission.naruWillBeOverFiveHundredM2,
+ ),
+ naruWillRetainResidence: formatBooleanToYesNoString(
+ submission.naruWillRetainResidence,
+ ),
+ naruWillHaveAdditionalResidence: formatBooleanToYesNoString(
+ submission.naruWillHaveAdditionalResidence,
+ ),
+ naruWillHaveTemporaryForeignWorkerHousing: formatBooleanToYesNoString(
+ submission.naruWillHaveTemporaryForeignWorkerHousing,
+ ),
naruWillImportFill: formatBooleanToYesNoString(
submission.naruWillImportFill,
),
+ naruResidenceNecessity: submission.naruResidenceNecessity,
+ tfwhCount: submission.tfwhCount,
+ tfwhDesign: formatBooleanToYesNoString(submission.tfwhDesign),
+ tfwhFarmSize: submission.tfwhFarmSize,
+ naruClustered: submission.naruClustered,
+ naruSetback: submission.naruSetback,
+ naruLocationRationale: submission.naruLocationRationale,
+ naruInfrastructure: submission.naruInfrastructure,
+ naruExistingResidences: naruExistingResidences,
+ naruProposedResidences: naruProposedResidences,
+ buildingPlans: documents
+ .filter(
+ (document) => document.type?.code === DOCUMENT_TYPE.BUILDING_PLAN,
+ )
+ .find((d) => d)?.document.fileName,
+
+ showImportFill: submission.naruWillImportFill,
// NFU Proposal => Soil and Fill
naruFillType: submission.naruFillType,
naruFillOrigin: submission.naruFillOrigin,
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 1e0648d59c..d295a31809 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
@@ -1,7 +1,11 @@
import { AutoMap } from 'automapper-classes';
import { ApplicationStatusDto } from '../../../alcs/application/application-submission-status/submission-status.dto';
import { NaruSubtypeDto } from '../../application-submission/application-submission.dto';
-import { ProposedLot } from '../../application-submission/application-submission.entity';
+import {
+ ExistingResidence,
+ ProposedLot,
+ ProposedResidence,
+} from '../../application-submission/application-submission.entity';
import { PublicOwnerDto } from '../public.dto';
export class PublicApplicationSubmissionDto {
@@ -220,6 +224,36 @@ export class PublicApplicationSubmissionDto {
soilHasSubmittedNotice?: boolean;
//NARU Fields
+ @AutoMap(() => Boolean)
+ naruWillBeOverFiveHundredM2: boolean | null;
+
+ @AutoMap(() => Boolean)
+ naruWillRetainResidence: boolean | null;
+
+ @AutoMap(() => Boolean)
+ naruWillHaveAdditionalResidence: boolean | null;
+
+ @AutoMap(() => Boolean)
+ naruWillHaveTemporaryForeignWorkerHousing: boolean | null;
+
+ @AutoMap(() => Boolean)
+ naruWillImportFill: boolean | null;
+
+ @AutoMap(() => String)
+ tfwhCount: string | null;
+
+ @AutoMap(() => Boolean)
+ tfwhDesign: boolean | null;
+
+ @AutoMap(() => String)
+ tfwhFarmSize: string | null;
+
+ @AutoMap(() => String)
+ naruClustered: string | null;
+
+ @AutoMap(() => String)
+ naruSetback: string | null;
+
@AutoMap(() => [NaruSubtypeDto])
naruSubtype: NaruSubtypeDto | null;
@@ -238,9 +272,6 @@ export class PublicApplicationSubmissionDto {
@AutoMap(() => String)
naruExistingStructures: string | null;
- @AutoMap(() => Boolean)
- naruWillImportFill: boolean | null;
-
@AutoMap(() => String)
naruFillType: string | null;
@@ -268,6 +299,12 @@ export class PublicApplicationSubmissionDto {
@AutoMap(() => String)
naruAgriTourism: string | null;
+ @AutoMap(() => ExistingResidence)
+ naruExistingResidences?: ExistingResidence[];
+
+ @AutoMap(() => ProposedResidence)
+ naruProposedResidences: ProposedResidence[] | null;
+
//Inclusion / Exclusion Fields
@AutoMap(() => String)
prescribedBody: string | null;
diff --git a/services/apps/alcs/src/providers/typeorm/migrations/1726098613152-update_naru_subtypes.ts b/services/apps/alcs/src/providers/typeorm/migrations/1726098613152-update_naru_subtypes.ts
new file mode 100644
index 0000000000..33291371fc
--- /dev/null
+++ b/services/apps/alcs/src/providers/typeorm/migrations/1726098613152-update_naru_subtypes.ts
@@ -0,0 +1,38 @@
+import { MigrationInterface, QueryRunner } from 'typeorm';
+
+export class UpdateNaruSubtypes1726098613152 implements MigrationInterface {
+ public async up(queryRunner: QueryRunner): Promise {
+ queryRunner.query(`
+ update alcs.application_type at
+ set html_description = 'Choose this option if you are proposing to conduct a non-adhering residential use within the Agricultural Land Reserve under
+ Section 20.1(2) of the Agricultural Land Commission Act.
+
+ Non-adhering residential uses include:
+
+ An additional residence(s)
+ A residential structure larger than 500 m²
+ Retain an existing residence while building a new residence
+ Temporary foreign worker housing
+
+ '
+ where at.code = 'NARU';
+ `);
+ }
+
+ public async down(queryRunner: QueryRunner): Promise {
+ queryRunner.query(`
+ update alcs.application_type at
+ set html_description = 'Choose this option if you are proposing to conduct a non-adhering residential use within the Agricultural Land Reserve under
+ Section 20.1(2) of the Agricultural Land Commission Act.
+
+ Non-adhering residential uses include:
+
+ An additional residence for farm use;
+ A residential structure larger than 500 m²; or,
+ A non-adhering tourism accommodation.
+
+ '
+ where at.code = 'NARU';
+ `);
+ }
+}
diff --git a/services/apps/alcs/src/providers/typeorm/migrations/1726156915372-fix_new_naru_text.ts b/services/apps/alcs/src/providers/typeorm/migrations/1726156915372-fix_new_naru_text.ts
new file mode 100644
index 0000000000..ce0fea50af
--- /dev/null
+++ b/services/apps/alcs/src/providers/typeorm/migrations/1726156915372-fix_new_naru_text.ts
@@ -0,0 +1,39 @@
+import { MigrationInterface, QueryRunner } from 'typeorm';
+
+export class FixNewNaruText1726156915372 implements MigrationInterface {
+ public async up(queryRunner: QueryRunner): Promise {
+ queryRunner.query(`
+ update alcs.application_type at
+ set html_description = 'Choose this option if you are proposing to conduct a non-adhering residential use within the Agricultural Land Reserve under
+ Section 20.1(2) of the Agricultural Land Commission Act.
+
+ Non-adhering residential uses include:
+
+ Additional residence(s)
+ Residence(s) with Total Floor Area greater than 500 m²
+ Retain an existing residence while building a new residence
+ Temporary foreign worker housing
+
+ '
+ where at.code = 'NARU';
+ `);
+ }
+
+ public async down(queryRunner: QueryRunner): Promise {
+ queryRunner.query(`
+ update alcs.application_type at
+ set html_description = 'Choose this option if you are proposing to conduct a non-adhering residential use within the Agricultural Land Reserve under
+ Section 20.1(2) of the Agricultural Land Commission Act.
+
+ Non-adhering residential uses include:
+
+ An additional residence(s)
+ A residential structure larger than 500 m²
+ Retain an existing residence while building a new residence
+ Temporary foreign worker housing
+
+ '
+ where at.code = 'NARU';
+ `);
+ }
+}
diff --git a/services/apps/alcs/src/providers/typeorm/migrations/1726271415863-new_naru_fields.ts b/services/apps/alcs/src/providers/typeorm/migrations/1726271415863-new_naru_fields.ts
new file mode 100644
index 0000000000..3b03fb9c4e
--- /dev/null
+++ b/services/apps/alcs/src/providers/typeorm/migrations/1726271415863-new_naru_fields.ts
@@ -0,0 +1,47 @@
+import { MigrationInterface, QueryRunner } from 'typeorm';
+
+export class NewNaruFiels1726271415863 implements MigrationInterface {
+ name = 'NewNaruFiels1726271415863';
+
+ public async up(queryRunner: QueryRunner): Promise {
+ await queryRunner.query(
+ `ALTER TABLE "alcs"."application_submission" ADD "naru_will_be_over_five_hundred_m2" boolean`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "alcs"."application_submission" ADD "naru_will_retain_residence" boolean`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "alcs"."application_submission" ADD "naru_will_have_additional_residence" boolean`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "alcs"."application_submission" ADD "naru_will_have_temporary_foreign_worker_housing" boolean`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "alcs"."application_submission" ADD "naru_clustered" text`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "alcs"."application_submission" ADD "naru_setback" text`,
+ );
+ }
+
+ public async down(queryRunner: QueryRunner): Promise {
+ await queryRunner.query(
+ `ALTER TABLE "alcs"."application_submission" DROP COLUMN "naru_setback"`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "alcs"."application_submission" DROP COLUMN "naru_clustered"`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "alcs"."application_submission" DROP COLUMN "naru_will_have_temporary_foreign_worker_housing"`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "alcs"."application_submission" DROP COLUMN "naru_will_have_additional_residence"`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "alcs"."application_submission" DROP COLUMN "naru_will_retain_residence"`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "alcs"."application_submission" DROP COLUMN "naru_will_be_over_five_hundred_m2"`,
+ );
+ }
+}
diff --git a/services/apps/alcs/src/providers/typeorm/migrations/1727199312985-add-naru-existing-residences.ts b/services/apps/alcs/src/providers/typeorm/migrations/1727199312985-add-naru-existing-residences.ts
new file mode 100644
index 0000000000..10f5fddf7f
--- /dev/null
+++ b/services/apps/alcs/src/providers/typeorm/migrations/1727199312985-add-naru-existing-residences.ts
@@ -0,0 +1,16 @@
+import { MigrationInterface, QueryRunner } from "typeorm";
+
+export class AddNaruExistingResidences1727199312985 implements MigrationInterface {
+ name = 'AddNaruExistingResidences1727199312985'
+
+ public async up(queryRunner: QueryRunner): Promise {
+ await queryRunner.query(`ALTER TABLE "alcs"."application_submission" ADD "naru_existing_residences" jsonb NOT NULL DEFAULT '[]'`);
+ await queryRunner.query(`COMMENT ON COLUMN "alcs"."application_submission"."naru_existing_residences" IS 'JSONB column containing NARU existing residence'`);
+ }
+
+ public async down(queryRunner: QueryRunner): Promise {
+ await queryRunner.query(`COMMENT ON COLUMN "alcs"."application_submission"."naru_existing_residences" IS 'JSONB column containing NARU existing residence'`);
+ await queryRunner.query(`ALTER TABLE "alcs"."application_submission" DROP COLUMN "naru_existing_residences"`);
+ }
+
+}
diff --git a/services/apps/alcs/src/providers/typeorm/migrations/1727304004390-convert_naru_subtype_to_answers.ts b/services/apps/alcs/src/providers/typeorm/migrations/1727304004390-convert_naru_subtype_to_answers.ts
new file mode 100644
index 0000000000..62f31cf767
--- /dev/null
+++ b/services/apps/alcs/src/providers/typeorm/migrations/1727304004390-convert_naru_subtype_to_answers.ts
@@ -0,0 +1,22 @@
+import { MigrationInterface, QueryRunner } from 'typeorm';
+
+export class ConvertNaruSubtypeToAnswers1727304004390
+ implements MigrationInterface
+{
+ public async up(queryRunner: QueryRunner): Promise {
+ queryRunner.query(`
+ update alcs.application_submission as2
+ set
+ naru_will_have_additional_residence = case
+ when as2.naru_subtype_code = 'ARFU' then true
+ end,
+ naru_will_be_over_five_hundred_m2 = case
+ when as2.naru_subtype_code = 'PRIN' then true
+ end
+ where as2.naru_subtype_code is not null
+ and as2.naru_subtype_code <> 'TOUR';
+ `);
+ }
+
+ public async down(queryRunner: QueryRunner): Promise {}
+}
diff --git a/services/apps/alcs/src/providers/typeorm/migrations/1727382304979-add_naru_proposed_residences.ts b/services/apps/alcs/src/providers/typeorm/migrations/1727382304979-add_naru_proposed_residences.ts
new file mode 100644
index 0000000000..7ed3e8f869
--- /dev/null
+++ b/services/apps/alcs/src/providers/typeorm/migrations/1727382304979-add_naru_proposed_residences.ts
@@ -0,0 +1,18 @@
+import { MigrationInterface, QueryRunner } from "typeorm";
+
+export class AddNaruProposedResidences1727382304979 implements MigrationInterface {
+ name = 'AddNaruProposedResidences1727382304979'
+
+ public async up(queryRunner: QueryRunner): Promise {
+ await queryRunner.query(`ALTER TABLE "alcs"."application_submission" ADD "naru_proposed_residences" jsonb NOT NULL DEFAULT '[]'`);
+ await queryRunner.query(`COMMENT ON COLUMN "alcs"."application_submission"."naru_proposed_residences" IS 'JSONB column containing NARU proposed residences'`);
+ await queryRunner.query(`COMMENT ON COLUMN "alcs"."application_submission"."naru_existing_residences" IS 'JSONB column containing NARU existing residences'`);
+ }
+
+ public async down(queryRunner: QueryRunner): Promise {
+ await queryRunner.query(`COMMENT ON COLUMN "alcs"."application_submission"."naru_existing_residences" IS 'JSONB column containing NARU existing residence'`);
+ await queryRunner.query(`COMMENT ON COLUMN "alcs"."application_submission"."naru_proposed_residences" IS 'JSONB column containing NARU proposed residences'`);
+ await queryRunner.query(`ALTER TABLE "alcs"."application_submission" DROP COLUMN "naru_proposed_residences"`);
+ }
+
+}
diff --git a/services/apps/alcs/src/providers/typeorm/migrations/1727382390880-make_tfwh_columns.ts b/services/apps/alcs/src/providers/typeorm/migrations/1727382390880-make_tfwh_columns.ts
new file mode 100644
index 0000000000..7dae3dee9a
--- /dev/null
+++ b/services/apps/alcs/src/providers/typeorm/migrations/1727382390880-make_tfwh_columns.ts
@@ -0,0 +1,29 @@
+import { MigrationInterface, QueryRunner } from 'typeorm';
+
+export class MakeTfwhColumns1727382390880 implements MigrationInterface {
+ name = 'MakeTfwhColumns1727382390880';
+
+ public async up(queryRunner: QueryRunner): Promise {
+ await queryRunner.query(
+ `ALTER TABLE "alcs"."application_submission" ADD "tfwh_count" text`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "alcs"."application_submission" ADD "tfwh_design" boolean`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "alcs"."application_submission" ADD "tfwh_farm_size" text`,
+ );
+ }
+
+ public async down(queryRunner: QueryRunner): Promise {
+ await queryRunner.query(
+ `ALTER TABLE "alcs"."application_submission" DROP COLUMN "tfwh_farm_size"`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "alcs"."application_submission" DROP COLUMN "tfwh_design"`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "alcs"."application_submission" DROP COLUMN "tfwh_count"`,
+ );
+ }
+}
diff --git a/services/apps/alcs/src/providers/typeorm/migrations/1727461542081-change_app_type_html.ts b/services/apps/alcs/src/providers/typeorm/migrations/1727461542081-change_app_type_html.ts
new file mode 100644
index 0000000000..8b98ce2b29
--- /dev/null
+++ b/services/apps/alcs/src/providers/typeorm/migrations/1727461542081-change_app_type_html.ts
@@ -0,0 +1,15 @@
+import { MigrationInterface, QueryRunner } from 'typeorm';
+
+export class ChangeAppTypeHtml1727461542081 implements MigrationInterface {
+ public async up(queryRunner: QueryRunner): Promise {
+ await queryRunner.query(
+ `UPDATE "alcs"."application_type" SET
+ "html_description"=CONCAT(html_description, 'If you need help selecting an application type, please Contact Us .
')
+ WHERE "html_description" is not null`,
+ );
+ }
+
+ public async down(queryRunner: QueryRunner): Promise {
+ // N/A
+ }
+}
diff --git a/services/templates/pdf/submissions/naru-submission-template.docx b/services/templates/pdf/submissions/naru-submission-template.docx
index 9c2e0866a6..14867314fe 100644
Binary files a/services/templates/pdf/submissions/naru-submission-template.docx and b/services/templates/pdf/submissions/naru-submission-template.docx differ
diff --git a/services/templates/pdf/submissions/nfu-submission-template.docx b/services/templates/pdf/submissions/nfu-submission-template.docx
index 429af6871b..43171f6a0d 100644
Binary files a/services/templates/pdf/submissions/nfu-submission-template.docx and b/services/templates/pdf/submissions/nfu-submission-template.docx differ