Skip to content

Commit

Permalink
Merge pull request #261 from icefoganalytics/test
Browse files Browse the repository at this point in the history
More doc conditions
  • Loading branch information
datajohnson authored Jun 20, 2024
2 parents 13776a4 + 07372c3 commit 19f8bb7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/api/models/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,14 @@ export function ApplicationFromDraft(draft: any): Application {
? ensureInteger(draft.residency.last_return_date.split("/")[1])
: null,

is_two_residence: false,

//prestudy_start_date: undefined,
//prestudy_end_date: undefined,
} as Application;

if (draft.funding_sources && draft.funding_sources.second_residence == true) app.is_two_residence = true;

if (
draft.csfa_accomodation &&
draft.csfa_accomodation.accomodations &&
Expand Down
13 changes: 13 additions & 0 deletions src/api/services/shared/documentation-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ export class DocumentationService {
case "Spouse as Dependent":
// I don't currently know how to handle this...
break;
case "Permanent Resident":
if (appDetail.citizenship_status != "3") doc.meets_conditions = false;
break;
case "Second Residence":
if (appDetail.is_two_residence != 1) doc.meets_conditions = false;
break;
case "Has Income":
//if (app.csfa_income.has_income != true) doc.meets_conditions = false;
break;
case "Yukon and Previous CSL":
// I don't currently know how to handle this...
// But I belive it's handled by not having the requirement
Expand Down Expand Up @@ -181,6 +190,7 @@ export class DocumentationService {
break;
case "Has Dependant":
if (app.student_dependants.has_dependants == false) doc.meets_conditions = false;
if (app.student_dependants.has_dependants != true) doc.meets_conditions = false;
break;
case "Married/Common Law":
if (app.personal_details.category != 2) doc.meets_conditions = false;
Expand All @@ -207,6 +217,9 @@ export class DocumentationService {
case "Second Residence":
if (app.funding_sources.second_residence != true) doc.meets_conditions = false;
break;
case "Has Income":
if (app.csfa_income.has_income != true) doc.meets_conditions = false;
break;
case "Yukon and Previous CSL":
// I don't currently know how to handle this...
// But I belive it's handled by not having the requirement
Expand Down

0 comments on commit 19f8bb7

Please sign in to comment.