From 4be7d29eb48ae7cd0573eda18ba7a9747ee776a8 Mon Sep 17 00:00:00 2001 From: Felipe Barreta Date: Thu, 19 Dec 2024 11:09:19 -0800 Subject: [PATCH 1/7] ALCS-2416 Include next year in dropdown list --- .../edit-boundary-amendment-dialog.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alcs-frontend/src/app/features/application/boundary-amendment/edit-boundary-amendment-dialog/edit-boundary-amendment-dialog.component.ts b/alcs-frontend/src/app/features/application/boundary-amendment/edit-boundary-amendment-dialog/edit-boundary-amendment-dialog.component.ts index d978067bcd..43737e1cb5 100644 --- a/alcs-frontend/src/app/features/application/boundary-amendment/edit-boundary-amendment-dialog/edit-boundary-amendment-dialog.component.ts +++ b/alcs-frontend/src/app/features/application/boundary-amendment/edit-boundary-amendment-dialog/edit-boundary-amendment-dialog.component.ts @@ -55,8 +55,8 @@ export class EditBoundaryAmendmentDialogComponent implements OnInit { this.loadComponents(); - const currentYear = moment().year(); - for (let i = currentYear; i >= 1974; i--) { + const nextYear = moment().year() + 1; + for (let i = nextYear; i >= 1974; i--) { this.years.push(i.toString(10)); } } From 331d29a6e1b79d59f314c2c17b04c97bbe224817 Mon Sep 17 00:00:00 2001 From: Felipe Barreta Date: Thu, 19 Dec 2024 11:48:40 -0800 Subject: [PATCH 2/7] ALCS-2416 Added preventDefault on dropdowns --- alcs-frontend/src/app/features/search/search.component.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/alcs-frontend/src/app/features/search/search.component.html b/alcs-frontend/src/app/features/search/search.component.html index de78eb202a..09ce1cb997 100644 --- a/alcs-frontend/src/app/features/search/search.component.html +++ b/alcs-frontend/src/app/features/search/search.component.html @@ -37,6 +37,7 @@

File Details

[fileTypeData]="portalStatusDataService" (fileTypeChange)="onPortalStatusChange($event)" [preExpanded]="['With ALC']" + onclick="event.preventDefault()" /> @@ -47,6 +48,7 @@

File Details

#fileTypeDropDown [fileTypeData]="fileTypeService" (fileTypeChange)="onFileTypeChange($event)" + onclick="event.preventDefault()" /> From 73c922bd564397f1739735cc878dbb76b14a5fd6 Mon Sep 17 00:00:00 2001 From: Felipe Barreta Date: Thu, 19 Dec 2024 12:08:36 -0800 Subject: [PATCH 3/7] ALCS-2422 Fix the controllers with the correct role --- services/apps/alcs/src/alcs/search/search.controller.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/apps/alcs/src/alcs/search/search.controller.ts b/services/apps/alcs/src/alcs/search/search.controller.ts index 475ff7cc19..17dc930f17 100644 --- a/services/apps/alcs/src/alcs/search/search.controller.ts +++ b/services/apps/alcs/src/alcs/search/search.controller.ts @@ -222,7 +222,7 @@ export class SearchController { } @Post('/advanced/application-status') - @UserRoles(...ROLES_ALLOWED_APPLICATIONS) + @UserRoles(...ROLES_ALLOWED_SEARCH) async advancedSearchApplicationStatus(@Body() fileNumbers: string[]): Promise { const queryRunner = this.dataSource.createQueryRunner('slave'); @@ -241,7 +241,7 @@ export class SearchController { } @Post('/advanced/noi-status') - @UserRoles(...ROLES_ALLOWED_APPLICATIONS) + @UserRoles(...ROLES_ALLOWED_SEARCH) async advancedSearchNoiStatus(@Body() fileNumbers: string[]): Promise { const queryRunner = this.dataSource.createQueryRunner('slave'); @@ -260,7 +260,7 @@ export class SearchController { } @Post('/advanced/notification-status') - @UserRoles(...ROLES_ALLOWED_APPLICATIONS) + @UserRoles(...ROLES_ALLOWED_SEARCH) async advancedSearchNotificationStatus(@Body() fileNumbers: string[]): Promise { const queryRunner = this.dataSource.createQueryRunner('slave'); From 9d2c60a8bf83c9a1fd4843b90e138a290f0621e7 Mon Sep 17 00:00:00 2001 From: Tristan Slater <1631008+trslater@users.noreply.github.com> Date: Thu, 19 Dec 2024 13:52:31 -0800 Subject: [PATCH 4/7] Add missing bond conditions --- ...49-create_bond_conditions_where_missing.ts | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 services/apps/alcs/src/providers/typeorm/migrations/1734644882049-create_bond_conditions_where_missing.ts diff --git a/services/apps/alcs/src/providers/typeorm/migrations/1734644882049-create_bond_conditions_where_missing.ts b/services/apps/alcs/src/providers/typeorm/migrations/1734644882049-create_bond_conditions_where_missing.ts new file mode 100644 index 0000000000..63a5c3d8e9 --- /dev/null +++ b/services/apps/alcs/src/providers/typeorm/migrations/1734644882049-create_bond_conditions_where_missing.ts @@ -0,0 +1,77 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; + +export class CreateBondConditionsWhereMissing1734644882049 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + // Applications + queryRunner.query(` + insert into + alcs.application_decision_condition ( + audit_created_by, + decision_uuid, + security_amount, + type_code + ) + select + distinct 'oats_etl' as audit_created_by, + ad."uuid" as decision_uuid, + oaad.security_amt as security_amount, + 'BOND' as type_code + from + alcs.application_decision ad + join alcs.application_decision_condition adc on ad.uuid = adc.decision_uuid + right join oats.oats_alr_appl_decisions oaad on oaad.alr_appl_decision_id = ad.oats_alr_appl_decision_id + where + ad."uuid" not in ( + select + adc.decision_uuid + from + alcs.application_decision_condition adc + where + adc.type_code = 'BOND' + ) + and adc.security_amount > 0 + and ad.audit_created_by = 'oats_etl' + and ( + oaad.security_amt = adc.security_amount + or adc.security_amount is null + ) on conflict ("uuid") do nothing; + `); + + // NOI's + queryRunner.query(` + insert into + alcs.notice_of_intent_decision_condition ( + audit_created_by, + decision_uuid, + security_amount, + type_code + ) + select + distinct 'oats_etl' as audit_created_by, + noid."uuid" as decision_uuid, + oaad.security_amt as security_amount, + 'BOND' as type_code + from + alcs.notice_of_intent_decision noid + join alcs.notice_of_intent_decision_condition noidc on noid.uuid = noidc.decision_uuid + right join oats.oats_alr_appl_decisions oaad on oaad.alr_appl_decision_id = noid.oats_alr_appl_decision_id + where + noid."uuid" not in ( + select + noidc.decision_uuid + from + alcs.notice_of_intent_decision_condition noidc + where + noidc.type_code = 'BOND' + ) + and noidc.security_amount > 0 + and noid.audit_created_by = 'oats_etl' + and ( + oaad.security_amt = noidc.security_amount + or noidc.security_amount is null + ) on conflict ("uuid") do nothing; + `); + } + + public async down(queryRunner: QueryRunner): Promise {} +} From 824658dea6192d010900e041e1bcae69c0168986 Mon Sep 17 00:00:00 2001 From: Tristan Slater <1631008+trslater@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:08:31 -0800 Subject: [PATCH 5/7] Clear all non-bond security amounts --- ...ecurity_amounts_for_non_bond_conditions.ts | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 services/apps/alcs/src/providers/typeorm/migrations/1734645250139-nullify_security_amounts_for_non_bond_conditions.ts diff --git a/services/apps/alcs/src/providers/typeorm/migrations/1734645250139-nullify_security_amounts_for_non_bond_conditions.ts b/services/apps/alcs/src/providers/typeorm/migrations/1734645250139-nullify_security_amounts_for_non_bond_conditions.ts new file mode 100644 index 0000000000..8c8e9dd885 --- /dev/null +++ b/services/apps/alcs/src/providers/typeorm/migrations/1734645250139-nullify_security_amounts_for_non_bond_conditions.ts @@ -0,0 +1,27 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; + +export class NullifySecurityAmountsForNonBondConditions1734645250139 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + // Apps + queryRunner.query(` + update + alcs.application_decision_condition + set + security_amount = null + where + type_code <> 'BOND'; + `); + + // NOI's + queryRunner.query(` + update + alcs.notice_of_intent_decision_condition + set + security_amount = null + where + type_code <> 'BOND'; + `); + } + + public async down(queryRunner: QueryRunner): Promise {} +} From fd4883f77d116838cf66cb4833c6882c520c765b Mon Sep 17 00:00:00 2001 From: Tristan Slater <1631008+trslater@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:13:27 -0800 Subject: [PATCH 6/7] Disable security amount for non-bond condition types --- ...amount_for_all_non_bond_condition_types.ts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 services/apps/alcs/src/providers/typeorm/migrations/1734646226612-disable_security_amount_for_all_non_bond_condition_types.ts diff --git a/services/apps/alcs/src/providers/typeorm/migrations/1734646226612-disable_security_amount_for_all_non_bond_condition_types.ts b/services/apps/alcs/src/providers/typeorm/migrations/1734646226612-disable_security_amount_for_all_non_bond_condition_types.ts new file mode 100644 index 0000000000..a02c023154 --- /dev/null +++ b/services/apps/alcs/src/providers/typeorm/migrations/1734646226612-disable_security_amount_for_all_non_bond_condition_types.ts @@ -0,0 +1,29 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; + +export class DisableSecurityAmountForAllNonBondConditionTypes1734646226612 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + // Apps + queryRunner.query(` + update + alcs.application_decision_condition_type + set + is_security_amount_checked = false, + is_security_amount_required = false + where + code <> 'BOND'; + `); + + // NOI's + queryRunner.query(` + update + alcs.notice_of_intent_decision_condition_type + set + is_security_amount_checked = false, + is_security_amount_required = false + where + code <> 'BOND'; + `); + } + + public async down(queryRunner: QueryRunner): Promise {} +} From 15c11c1ba2d551baf96f839d6d88fa27c2e83c8d Mon Sep 17 00:00:00 2001 From: Tristan Slater <1631008+trslater@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:17:42 -0800 Subject: [PATCH 7/7] Enable required security amount for bond condition type --- ..._secuity_amount_for_bond_condition_type.ts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 services/apps/alcs/src/providers/typeorm/migrations/1734646507149-enable_required_secuity_amount_for_bond_condition_type.ts diff --git a/services/apps/alcs/src/providers/typeorm/migrations/1734646507149-enable_required_secuity_amount_for_bond_condition_type.ts b/services/apps/alcs/src/providers/typeorm/migrations/1734646507149-enable_required_secuity_amount_for_bond_condition_type.ts new file mode 100644 index 0000000000..ab3df7dfc5 --- /dev/null +++ b/services/apps/alcs/src/providers/typeorm/migrations/1734646507149-enable_required_secuity_amount_for_bond_condition_type.ts @@ -0,0 +1,29 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; + +export class EnableRequiredSecuityAmountForBondConditionType1734646507149 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + // Apps + queryRunner.query(` + update + alcs.application_decision_condition_type + set + is_security_amount_checked = true, + is_security_amount_required = true + where + code = 'BOND'; + `); + + // NOI's + queryRunner.query(` + update + alcs.notice_of_intent_decision_condition_type + set + is_security_amount_checked = true, + is_security_amount_required = true + where + code = 'BOND'; + `); + } + + public async down(queryRunner: QueryRunner): Promise {} +}