Skip to content

Commit

Permalink
Merge pull request #295 from icefoganalytics/test
Browse files Browse the repository at this point in the history
Vendor Prov, Uncapped, fixes
  • Loading branch information
datajohnson authored Aug 5, 2024
2 parents a0ce456 + 8c77702 commit 3d0cb31
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 28 deletions.
39 changes: 13 additions & 26 deletions src/api/repositories/assessment/assessment-cslft-repository-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ export class AssessmentCslftRepositoryV2 {
return { category: u.categoryName, description: u.description, amount: u.amount };
});

input.uncapped_expenses = uncapped_expenses;

input.total_costs =
input.cslft_scholastic_total +
input.shelter_total +
Expand Down Expand Up @@ -617,6 +619,16 @@ export class AssessmentCslftRepositoryV2 {
student_category_id: this.application.category_id,
})
.first();

if (!this.childcareCeiling) {
console.log("Using empty childcareCeiling");
this.childcareCeiling = { max_amount: 0 };
}

if (!this.livingAllowance) {
console.log("Using empty livingAllowance");
this.livingAllowance = { shelter_amount: 0, food_amount: 0, misc_amount: 0, public_tranport_amount: 0 };
}
}

async calculateBase(): Promise<CSLFTAssessmentBase> {
Expand Down Expand Up @@ -730,22 +742,7 @@ export class AssessmentCslftRepositoryV2 {
assess.shelter_month =
this.livingAllowance.shelter_amount + this.livingAllowance.food_amount + this.livingAllowance.misc_amount;

/* costsCapped.push({
name: "shelter",
allowable: cleanDollars(
this.livingAllowance.shelter_amount + this.livingAllowance.food_amount + this.livingAllowance.misc_amount
),
actual: 0,
total: assess.shelter_total,
}); */

assess.p_trans_month = this.application.study_bus ? this.livingAllowance.public_tranport_amount : 0;
/* costsCapped.push({
name: "publicTrans",
allowable: cleanDollars(this.application.study_bus ? this.livingAllowance.public_tranport_amount : 0),
actual: 0,
total: assess.p_trans_total,
}); */

let extTransTot = 0;

Expand Down Expand Up @@ -791,16 +788,6 @@ export class AssessmentCslftRepositoryV2 {

depPTrans =
assess.dependent_count * (this.application.study_bus ? this.dependentAllowance.public_tranport_amount : 0);

/* this.assessment.depend_food_allowable =
(
this.livingAllowance.shel
await this.studentLivingAllowanceRepo.getShelterFoodMisc(
this.application.academic_year_id,
study_prov,
studyCodes.DEP
)) * assess.dependent_count; */
}

assess.day_care_allowable = dayCareAllowable;
Expand Down Expand Up @@ -1419,7 +1406,7 @@ interface CSLFTAssessmentFull extends CSLFTAssessmentBase {
depend_food_total: number;
depend_tran_total: number;
discretionary_cost_total: number;
uncapped_expenses: number;
uncapped_expenses: any[];
total_costs: number;
parent_msol: number;
parent_discretionary_income: number;
Expand Down
3 changes: 1 addition & 2 deletions src/api/routes/admin/student-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1118,8 +1118,7 @@ studentRouter.get(
const update = await db("sfa.vendor_update")
.where({ "vendor_update.id": id, student_id })
.leftOuterJoin("sfa.city", "city.id", "vendor_update.city_id")
.leftOuterJoin("sfa.province", "province.id", "vendor_update.city_id")

.leftOuterJoin("sfa.province", "province.id", "vendor_update.province_id")
.select("vendor_update.*", "city.description as city", "province.description as province")
.first();
const student = await db("sfa.student")
Expand Down

0 comments on commit 3d0cb31

Please sign in to comment.