Skip to content

Commit

Permalink
Merge pull request #13 from icefoganalytics/student-financial-aid--is…
Browse files Browse the repository at this point in the history
…sues-2/view-submitted-applications-and-their-current-status

View Submitted Applications and Their Current Status
  • Loading branch information
datajohnson authored Aug 11, 2023
2 parents a10a2d0 + b7e8d27 commit 4d7dec5
Show file tree
Hide file tree
Showing 37 changed files with 1,971 additions and 0 deletions.
Binary file added Design/Entity Relationship Diagrams.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
533 changes: 533 additions & 0 deletions Design/Entity Relationship Diagrams.wsd

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions docker-compose.development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ services:
- 8081:8080
- 8085:8085

# For easily generating large PlantUML diagrams
# Not relevant to production environment.
# Accessible at http://localhost:9999
plantuml:
image: plantuml/plantuml-server:jetty
ports:
- 9999:8080
environment:
PLANTUML_LIMIT_SIZE: 8192

volumes:
db_data:
s3storage:
17 changes: 17 additions & 0 deletions src/api/controllers/base-controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Request, Response, NextFunction } from "express"

export default class BaseController {
protected request: Request
protected response: Response
protected next: NextFunction

constructor(request: Request, response: Response, next: NextFunction) {
this.request = request
this.response = response
this.next = next
}

protected get params() {
return this.request.params
}
}
19 changes: 19 additions & 0 deletions src/api/controllers/helpers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Request, Response, NextFunction } from "express"

import BaseController from "@/controllers/base-controller"

export function routedTo<T extends typeof BaseController>(
controllerClass: T,
method: string & keyof InstanceType<T>
) {
return (req: Request, res: Response, next: NextFunction) => {
const controllerInstance = new controllerClass(req, res, next) as InstanceType<T>
const unboundControllerMethod = controllerInstance[method]

if (typeof unboundControllerMethod === "function") {
return unboundControllerMethod.call(controllerInstance)
} else {
throw new Error(`Method ${method} is not a function on the provided controller class`)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import BaseController from "@/controllers/base-controller"

import ApplicationDraftsSerializer from "@/serializers/application-drafts-serializer";
import StudentApplicationDraftsService from "@/services/portal/students/student-application-drafts-service";

export default class StudentApplicationDraftsController extends BaseController {
listStudentApplicationDrafts() {
const studentId = parseInt(this.params.studentId)

const applicationService = new StudentApplicationDraftsService({ studentId })
return applicationService
.getApplicationDrafts()
.then((applicationDrafts) => {
const applicationDraftsSerializer = new ApplicationDraftsSerializer(applicationDrafts);
const data = applicationDraftsSerializer.asListView()
this.response.json({ data })
})
.catch((error: { message: string }) => {
this.response.status(404).json({ error: error.message })
})
}

getStudentApplicationDraft() {
const studentId = parseInt(this.params.studentId)
const applicationDraftId = parseInt(this.params.applicationDraftId)

const applicationService = new StudentApplicationDraftsService({ studentId, applicationDraftId })
return applicationService
.getApplicationDraft()
.then((applicationDraft) => {
const applicationDraftsSerializer = new ApplicationDraftsSerializer(applicationDraft);
const data = applicationDraftsSerializer.asDetailedView()
this.response.json({ data })
})
.catch((error: { message: string }) => {
this.response.status(404).json({ error: error.message })
})
}

#getStudent(studentId: number) {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import BaseController from "@/controllers/base-controller"

import ApplicationsSerializer from "@/serializers/applications-serializer"
import StudentApplicationsService from "@/services/portal/students/student-applications-service"

export default class StudentApplicationsController extends BaseController {
listStudentApplications() {
const studentId = parseInt(this.params.studentId)

const applicationService = new StudentApplicationsService({ studentId })
return applicationService
.getApplications()
.then((applications) => {
const applicationSerializer = new ApplicationsSerializer(applications)
const data = applicationSerializer.asListView()
this.response.json({ data })
})
.catch((error: { message: string }) => {
this.response.status(404).json({ error: error.message })
})
}

getStudentApplication() {
const studentId = parseInt(this.params.studentId)
const applicationId = parseInt(this.params.applicationId)

const applicationService = new StudentApplicationsService({ studentId, applicationId })
return applicationService
.getApplication()
.then((application) => {
const applicationSerializer = new ApplicationsSerializer(application)
const data = applicationSerializer.asDetailedView()
this.response.json({ data })
})
.catch((error: { message: string }) => {
this.response.status(404).json({ error: error.message })
})
}

#getStudent(studentId: number) {}
}
31 changes: 31 additions & 0 deletions src/api/models/address-type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// TODO: question whether this should be in the database at all.
// And if so, why is it its own table?
enum AddressTypes {
HOME = 1,
MAILING = 2,
SCHOOL = 3,
PARENT = 4,
}

export default class AddressType {
id: number
description: string
isActive: boolean

constructor({
id,
description,
isActive,
}: {
id: number
description: string
isActive: boolean
}) {
this.id = id
this.description = description
this.isActive = isActive
}

// not in database
static readonly Types = AddressTypes
}
11 changes: 11 additions & 0 deletions src/api/models/application-draft.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export default interface ApplicationDraft {
id: number
studentId: number
academicYearId: number
createDate: Date
updateDate: Date
isActive?: boolean
applicationJson: string
submitDate?: Date
status?: string
}
167 changes: 167 additions & 0 deletions src/api/models/application.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,170 @@
import Attendance from "@/models/attendance"
import FundingRequest from "@/models/funding-request"
import Institution from "@/models/institution"
import PersonAddress from "@/models/person-address"
import Program from "@/models/program"
import Student from "@/models/student"

// Application with standard JS naming conventions
// trailing underscore to avoid conflicting with legacy Application format
export default interface Application_ {
id: number
studentId: number
academicYearId: number
institutionCampusId?: number
studyAreaId?: number
programId?: number
aboriginalStatusId?: number
maritalStatusId?: number
categoryId?: number
firstNationId?: number
spouseId?: number
parent1Id?: number
parent2Id?: number
primaryAddressId?: number
parent1RelationshipId?: number
parent2RelationshipId?: number
parent1Income?: number
parent1NetIncome?: number
parent1TaxPaid?: number
parent2Income?: number
parent2NetIncome?: number
parent2TaxPaid?: number
schoolEmail?: string
schoolTelephone?: string
spouseHsEndYear?: number
spouseHsEndMonth?: number
spousePrestudyEmpStatusId?: number
spousePstudySchoolFrom?: Date
spousePstudySchoolTo?: Date
spousePstudyIncomeComment?: string
spouseStudyEmpStatusId?: number
spouseStudySchoolFrom?: Date
spouseStudySchoolTo?: Date
isSpouseStudyCsl: boolean
isSpouseStudyBus: boolean
spouseStudyDistance?: number
spouseStudyIncomeComment?: string
classesStartDate?: Date
classesEndDate?: Date
isCorrespondence: boolean
isCoopPaid: boolean
citizenshipStatus?: number
isDisabled: boolean
isMinority: boolean
studentNumber?: string
programYearTotal?: number
programYear?: number
isTwoResidence: boolean
isMoving: boolean
cslClassification?: number
cslPreviousProvinceId?: number
programDivisionExplanation?: string
prestudyAccomCode?: number
prestudyOwnHome: boolean
prestudyBoardAmount?: number
prestudyCityId?: number
prestudyProvinceId?: number
prestudyBus: boolean
prestudyDistance?: number
prestudyEmployStatusId?: number
prestudyEmployedFromDate?: Date
prestudyEmployedToDate?: Date
prestudyEmployerName?: string
prestudyEmployerCityId?: number
prestudyEmployerProvinceId?: number
studyAccomCode?: number
studyOwnHome: boolean
studyBoardAmount?: number
studyCityId?: number
studyProvinceId?: number
studyBus: boolean
studyDistance?: number
statInfoComment?: string
booksSuppliesCost?: number
outstandingCslptAmount?: number
previousCsgPtAmount?: number
percentOfFullTime?: number
isPartOfFt: boolean
studyWeeksCount?: number
classHoursPerWeek?: number
parentResidenceComment?: string
studyLivingWSpouse: boolean
prestudyLivingWSpouse: boolean
tuitionEstimateAmount?: number
programDivision?: number
isPreviousCslft: boolean
isPreviousCslpt: boolean
coopStartYear?: number
coopStartMonth?: number
coopEndYear?: number
coopEndMonth?: number
excludeFromCount: boolean
isPermDisabled: boolean
disabledEquipment?: string
previousCsgDisabilityAmount?: number
previousCsgFemDocAmount?: number
creditChkReqdDate?: Date
creditChkFaxSentDate?: Date
creditChkPassedDate?: Date
creditChkPassed: boolean
creditChkAppealDate?: Date
creditChkAppCompDate?: Date
creditChkAppComp: boolean
creditChkCompDate?: Date
cslClearanceDate?: Date
prestudyCslClassification?: number
yeaTotReceiptAmount?: number
academicPercent?: number
cslRestrictionComment?: string
inProgressPage?: number
onlineStartDate?: Date
onlineSubmitDate?: Date
remTransitionGrantYears?: number
studentLn150Income?: number
spouseLn150Income?: number
taxes1FiledYear?: number
taxes2FiledYear?: number
taxes1FiledProvinceId?: number
taxes2FiledProvinceId?: number
taxes1NotFiled: boolean
taxes2NotFiled: boolean
taxes1Verified: boolean
taxes2Verified: boolean
appliedOtherFunding: boolean
cslRestrictionWarnId?: number
cslRestrictionReasonId?: number
coursesPerWeek?: number
prestudyStartDate?: Date
prestudyEndDate?: Date
validDriverLicense?: boolean
validDriverLicenseComment?: string
validYhcip?: boolean
validYhcipComment?: string
attendanceId?: number
hasConsentToShareData: boolean
permanentDisability: boolean
persOrProlongDisability: boolean
disabilityStartDate?: Date
requiresCreditCheck: boolean
lastCheckedOn?: Date
seen: boolean
updatedAt?: Date
lastJurisdictionId?: number
otherJurisdiction?: string
spouseLastJurisdictionId?: number
spouseOtherJurisdiction?: string
isPersistDisabled: boolean
persistDisabledStartDate?: Date
isChequesToInstitution: boolean
attendance?: Attendance
fundingRequests?: FundingRequest[]
institution?: Institution
primaryAddress?: PersonAddress
program?: Program
student?: Student
}

export interface Application {
id: number;
student_id: number;
Expand Down
Loading

0 comments on commit 4d7dec5

Please sign in to comment.