Skip to content

Commit efa2af2

Browse files
authored
Merge pull request #2035 from bcgov/develop
Deployment PR - 1446
2 parents 0097ba3 + 132faac commit efa2af2

7 files changed

+169
-5
lines changed

alcs-frontend/src/app/features/application/boundary-amendment/edit-boundary-amendment-dialog/edit-boundary-amendment-dialog.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ export class EditBoundaryAmendmentDialogComponent implements OnInit {
5555

5656
this.loadComponents();
5757

58-
const currentYear = moment().year();
59-
for (let i = currentYear; i >= 1974; i--) {
58+
const nextYear = moment().year() + 1;
59+
for (let i = nextYear; i >= 1974; i--) {
6060
this.years.push(i.toString(10));
6161
}
6262
}

alcs-frontend/src/app/features/search/search.component.html

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ <h4>File Details</h4>
3737
[fileTypeData]="portalStatusDataService"
3838
(fileTypeChange)="onPortalStatusChange($event)"
3939
[preExpanded]="['With ALC']"
40+
onclick="event.preventDefault()"
4041
/>
4142
</div>
4243

@@ -47,6 +48,7 @@ <h4>File Details</h4>
4748
#fileTypeDropDown
4849
[fileTypeData]="fileTypeService"
4950
(fileTypeChange)="onFileTypeChange($event)"
51+
onclick="event.preventDefault()"
5052
/>
5153
</div>
5254
</div>

services/apps/alcs/src/alcs/search/search.controller.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ export class SearchController {
222222
}
223223

224224
@Post('/advanced/application-status')
225-
@UserRoles(...ROLES_ALLOWED_APPLICATIONS)
225+
@UserRoles(...ROLES_ALLOWED_SEARCH)
226226
async advancedSearchApplicationStatus(@Body() fileNumbers: string[]): Promise<StatusUpdateSearchResultDto[]> {
227227
const queryRunner = this.dataSource.createQueryRunner('slave');
228228

@@ -241,7 +241,7 @@ export class SearchController {
241241
}
242242

243243
@Post('/advanced/noi-status')
244-
@UserRoles(...ROLES_ALLOWED_APPLICATIONS)
244+
@UserRoles(...ROLES_ALLOWED_SEARCH)
245245
async advancedSearchNoiStatus(@Body() fileNumbers: string[]): Promise<StatusUpdateSearchResultDto[]> {
246246
const queryRunner = this.dataSource.createQueryRunner('slave');
247247

@@ -260,7 +260,7 @@ export class SearchController {
260260
}
261261

262262
@Post('/advanced/notification-status')
263-
@UserRoles(...ROLES_ALLOWED_APPLICATIONS)
263+
@UserRoles(...ROLES_ALLOWED_SEARCH)
264264
async advancedSearchNotificationStatus(@Body() fileNumbers: string[]): Promise<StatusUpdateSearchResultDto[]> {
265265
const queryRunner = this.dataSource.createQueryRunner('slave');
266266

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import { MigrationInterface, QueryRunner } from 'typeorm';
2+
3+
export class CreateBondConditionsWhereMissing1734644882049 implements MigrationInterface {
4+
public async up(queryRunner: QueryRunner): Promise<void> {
5+
// Applications
6+
queryRunner.query(`
7+
insert into
8+
alcs.application_decision_condition (
9+
audit_created_by,
10+
decision_uuid,
11+
security_amount,
12+
type_code
13+
)
14+
select
15+
distinct 'oats_etl' as audit_created_by,
16+
ad."uuid" as decision_uuid,
17+
oaad.security_amt as security_amount,
18+
'BOND' as type_code
19+
from
20+
alcs.application_decision ad
21+
join alcs.application_decision_condition adc on ad.uuid = adc.decision_uuid
22+
right join oats.oats_alr_appl_decisions oaad on oaad.alr_appl_decision_id = ad.oats_alr_appl_decision_id
23+
where
24+
ad."uuid" not in (
25+
select
26+
adc.decision_uuid
27+
from
28+
alcs.application_decision_condition adc
29+
where
30+
adc.type_code = 'BOND'
31+
)
32+
and adc.security_amount > 0
33+
and ad.audit_created_by = 'oats_etl'
34+
and (
35+
oaad.security_amt = adc.security_amount
36+
or adc.security_amount is null
37+
) on conflict ("uuid") do nothing;
38+
`);
39+
40+
// NOI's
41+
queryRunner.query(`
42+
insert into
43+
alcs.notice_of_intent_decision_condition (
44+
audit_created_by,
45+
decision_uuid,
46+
security_amount,
47+
type_code
48+
)
49+
select
50+
distinct 'oats_etl' as audit_created_by,
51+
noid."uuid" as decision_uuid,
52+
oaad.security_amt as security_amount,
53+
'BOND' as type_code
54+
from
55+
alcs.notice_of_intent_decision noid
56+
join alcs.notice_of_intent_decision_condition noidc on noid.uuid = noidc.decision_uuid
57+
right join oats.oats_alr_appl_decisions oaad on oaad.alr_appl_decision_id = noid.oats_alr_appl_decision_id
58+
where
59+
noid."uuid" not in (
60+
select
61+
noidc.decision_uuid
62+
from
63+
alcs.notice_of_intent_decision_condition noidc
64+
where
65+
noidc.type_code = 'BOND'
66+
)
67+
and noidc.security_amount > 0
68+
and noid.audit_created_by = 'oats_etl'
69+
and (
70+
oaad.security_amt = noidc.security_amount
71+
or noidc.security_amount is null
72+
) on conflict ("uuid") do nothing;
73+
`);
74+
}
75+
76+
public async down(queryRunner: QueryRunner): Promise<void> {}
77+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { MigrationInterface, QueryRunner } from 'typeorm';
2+
3+
export class NullifySecurityAmountsForNonBondConditions1734645250139 implements MigrationInterface {
4+
public async up(queryRunner: QueryRunner): Promise<void> {
5+
// Apps
6+
queryRunner.query(`
7+
update
8+
alcs.application_decision_condition
9+
set
10+
security_amount = null
11+
where
12+
type_code <> 'BOND';
13+
`);
14+
15+
// NOI's
16+
queryRunner.query(`
17+
update
18+
alcs.notice_of_intent_decision_condition
19+
set
20+
security_amount = null
21+
where
22+
type_code <> 'BOND';
23+
`);
24+
}
25+
26+
public async down(queryRunner: QueryRunner): Promise<void> {}
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { MigrationInterface, QueryRunner } from 'typeorm';
2+
3+
export class DisableSecurityAmountForAllNonBondConditionTypes1734646226612 implements MigrationInterface {
4+
public async up(queryRunner: QueryRunner): Promise<void> {
5+
// Apps
6+
queryRunner.query(`
7+
update
8+
alcs.application_decision_condition_type
9+
set
10+
is_security_amount_checked = false,
11+
is_security_amount_required = false
12+
where
13+
code <> 'BOND';
14+
`);
15+
16+
// NOI's
17+
queryRunner.query(`
18+
update
19+
alcs.notice_of_intent_decision_condition_type
20+
set
21+
is_security_amount_checked = false,
22+
is_security_amount_required = false
23+
where
24+
code <> 'BOND';
25+
`);
26+
}
27+
28+
public async down(queryRunner: QueryRunner): Promise<void> {}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { MigrationInterface, QueryRunner } from 'typeorm';
2+
3+
export class EnableRequiredSecuityAmountForBondConditionType1734646507149 implements MigrationInterface {
4+
public async up(queryRunner: QueryRunner): Promise<void> {
5+
// Apps
6+
queryRunner.query(`
7+
update
8+
alcs.application_decision_condition_type
9+
set
10+
is_security_amount_checked = true,
11+
is_security_amount_required = true
12+
where
13+
code = 'BOND';
14+
`);
15+
16+
// NOI's
17+
queryRunner.query(`
18+
update
19+
alcs.notice_of_intent_decision_condition_type
20+
set
21+
is_security_amount_checked = true,
22+
is_security_amount_required = true
23+
where
24+
code = 'BOND';
25+
`);
26+
}
27+
28+
public async down(queryRunner: QueryRunner): Promise<void> {}
29+
}

0 commit comments

Comments
 (0)