Skip to content

Commit 13d4bf2

Browse files
authored
Merge pull request #2053 from bcgov/hotfix/ALCS-2467-check-decision-on-conditions-retrieved
ALCS-2467 Check decisions
2 parents 4004153 + 23db0b9 commit 13d4bf2

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

alcs-frontend/src/app/features/admin/decision-condition-types/decision-condition-types-dialog/decision-condition-types-dialog.component.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -196,18 +196,18 @@ export class DecisionConditionTypesDialogComponent {
196196
hasAnyDates(
197197
conditions: Partial<ApplicationDecisionConditionDto>[] | Partial<NoticeOfIntentDecisionConditionDto>[],
198198
): boolean {
199-
return conditions.some((condition) => condition.dates && condition.dates.length > 0);
199+
return conditions.filter((c) => c.decision !== null).some((condition) => condition.dates && condition.dates.length > 0);
200200
}
201201

202202
hasAdminFee(
203203
conditions: Partial<ApplicationDecisionConditionDto>[] | Partial<NoticeOfIntentDecisionConditionDto>[],
204204
): boolean {
205-
return conditions.map((c) => c.administrativeFee).filter((f) => f !== null && f !== undefined && f > 0).length > 0;
205+
return conditions.filter((c) => c.decision !== null).map((c) => c.administrativeFee).filter((f) => f !== null && f !== undefined && f > 0).length > 0;
206206
}
207207

208208
hasSecurityAmount(
209209
conditions: Partial<ApplicationDecisionConditionDto>[] | Partial<NoticeOfIntentDecisionConditionDto>[],
210210
): boolean {
211-
return conditions.map((c) => c.securityAmount).filter((f) => f !== null && f !== undefined && f > 0).length > 0;
211+
return conditions.filter((c) => c.decision !== null).map((c) => c.securityAmount).filter((f) => f !== null && f !== undefined && f > 0).length > 0;
212212
}
213213
}

alcs-frontend/src/app/services/application/decision/application-decision-v2/application-decision-v2.dto.ts

+1
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ export interface ApplicationDecisionConditionDto {
253253
type?: ApplicationDecisionConditionTypeDto | null;
254254
components?: ApplicationDecisionComponentDto[] | null;
255255
dates?: ApplicationDecisionConditionDateDto[];
256+
decision: ApplicationDecisionDto | null;
256257
}
257258

258259
export interface UpdateApplicationDecisionConditionDto {

alcs-frontend/src/app/services/notice-of-intent/decision-v2/notice-of-intent-decision.dto.ts

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export interface NoticeOfIntentDecisionConditionDto {
9393
componentUuid: string | null;
9494
components?: NoticeOfIntentDecisionComponentDto[];
9595
dates?: NoticeOfIntentDecisionConditionDateDto[];
96+
decision: NoticeOfIntentDecisionDto | null;
9697
}
9798

9899
export interface ComponentToCondition {

services/apps/alcs/src/alcs/application-decision/application-decision-condition/application-decision-condition.service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class ApplicationDecisionConditionService {
3333
code: typeCode,
3434
},
3535
},
36-
relations: ['dates'],
36+
relations: ['dates', 'decision'],
3737
});
3838
}
3939

services/apps/alcs/src/alcs/notice-of-intent-decision/notice-of-intent-decision-condition/notice-of-intent-decision-condition.service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class NoticeOfIntentDecisionConditionService {
2727
code: typeCode,
2828
},
2929
},
30-
relations: ['dates'],
30+
relations: ['dates', 'decision'],
3131
});
3232
}
3333

0 commit comments

Comments
 (0)