Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View Submitted Applications and Their Current Status #13

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
ac6fd22
:construction: Add application and application draft routing concepts.
klondikemarlen Jul 31, 2023
6bc6289
:construction: Begin fleshing out application controller and services.
klondikemarlen Aug 1, 2023
c0744f6
:construction: Flesh out application controller and backing service a…
klondikemarlen Aug 1, 2023
4d9dccf
:truck: Require a little to make space for other components.
klondikemarlen Aug 1, 2023
c260b1e
:rewind: Avoid mutating application service as I'm no longer using it.
klondikemarlen Aug 1, 2023
9cda4e1
:recycle: Make class the default export.
klondikemarlen Aug 1, 2023
987c412
:construction: Add basic student application drafts wiring.
klondikemarlen Aug 1, 2023
0d66972
:sparkles: Add data serialization to student applications controller.
klondikemarlen Aug 2, 2023
50a2992
:construction: Add minimal serialization to application drafts endpoint.
klondikemarlen Aug 2, 2023
99004bf
:recycle: Implemented controller instance per request usage.
klondikemarlen Aug 2, 2023
92bf435
:art: Add better type checking to "routedTo" helper.
klondikemarlen Aug 2, 2023
7920079
:beetle: Return functions from controllers or external dependencies c…
klondikemarlen Aug 3, 2023
9b2f1a7
:white_check_mark: Ugly and hacky test example for controller.
klondikemarlen Aug 3, 2023
acda40a
:beetle: Fix binding of this in controller routing instantiator.
klondikemarlen Aug 3, 2023
fc33308
:art: Standardize naming convention of application draft model file.
klondikemarlen Aug 3, 2023
064366f
:sparkles: Standardize application list view with as much info as I h…
klondikemarlen Aug 3, 2023
11d0cdf
:construction: Begin serializing a detailed application view.
klondikemarlen Aug 3, 2023
c31d80e
:sparkles: Add institution model.
klondikemarlen Aug 3, 2023
1e61866
:sparkles: Support returning the application institution if it exists.
klondikemarlen Aug 3, 2023
bf55f7f
:construction: Return institution info in serializer.
klondikemarlen Aug 3, 2023
ea67cc4
:sparkles: Add program modeling to application.
klondikemarlen Aug 3, 2023
a89f334
:art: Match application_draft interface with null constraint in datab…
klondikemarlen Aug 3, 2023
11cc1be
:art: Match application interface with database null constraints.
klondikemarlen Aug 3, 2023
8bb13c3
:construction: Add program details to program details hash.
klondikemarlen Aug 3, 2023
51c2366
:recycle: Drop program hash and just return details as name.
klondikemarlen Aug 3, 2023
3277c0a
:construction: Add attendance files to application serializer.
klondikemarlen Aug 3, 2023
3ae7379
:art: Fix some casing in model interfaces.
klondikemarlen Aug 3, 2023
1578c76
:tophat: Begin modeling database.
klondikemarlen Aug 3, 2023
a9bbfd9
:pencil: Update comment about legacy application.
klondikemarlen Aug 3, 2023
c727c25
:sparkles: Add funding request modeling.
klondikemarlen Aug 3, 2023
46f07f3
:tophat: Add request type modelling.
klondikemarlen Aug 3, 2023
96bc8f3
:sparkles: Add helper service to load application funding requests.
klondikemarlen Aug 3, 2023
247a0cf
:sparkles: Add funding sources (funding_requests) serialization.
klondikemarlen Aug 3, 2023
3c5e8fa
:construction: Building out funding sources csfaAmounts.
klondikemarlen Aug 7, 2023
f383e43
:recycle: Use singular name for model.
klondikemarlen Aug 8, 2023
791d27d
:recycle: Use shared constant for CSFA amounts.
klondikemarlen Aug 8, 2023
8982ce6
:abc: Alphabetize imports.
klondikemarlen Aug 8, 2023
e488a31
:tophat: Model funding source and csfa amount constants.
klondikemarlen Aug 8, 2023
7eefb5f
:abc: Alphabetize relationships.
klondikemarlen Aug 8, 2023
1836260
:sparkles: Add student model linked to application.
klondikemarlen Aug 8, 2023
874aec5
:art: Prettify erd code.
klondikemarlen Aug 8, 2023
f9b43f8
:tophat: Add student modeling info.
klondikemarlen Aug 8, 2023
ccd9608
:construction: Add placeholder wiring for personal details in applica…
klondikemarlen Aug 8, 2023
58beb5c
:fire: Drop now redundant manual reference to schema.
klondikemarlen Aug 8, 2023
a58f2e5
:sparkles: Add person model linked to student.
klondikemarlen Aug 8, 2023
3eb8fe4
:tophat: Diagram person model.
klondikemarlen Aug 8, 2023
9e9b17d
:sparkles: Load student and person data; serialize to personal details.
klondikemarlen Aug 8, 2023
f73c303
:construction: Add mock of addresses section.
klondikemarlen Aug 8, 2023
aa3536f
:sparkles: Add person address model.
klondikemarlen Aug 8, 2023
1a672ef
:tophat: Add person address modeling to erd.
klondikemarlen Aug 8, 2023
257a312
:sparkles: Add address serialization to application serializer.
klondikemarlen Aug 8, 2023
f4ba4a7
:tophat: Add erd info about address types.
klondikemarlen Aug 8, 2023
0a57038
:recycle: Simply person details generation.
klondikemarlen Aug 8, 2023
4f3f4a9
:construction: begin building out statistical section of application …
klondikemarlen Aug 8, 2023
c3a82ae
:beetle: Fix bug in student retrieval.
klondikemarlen Aug 8, 2023
410bee0
:construction: Add citizenship to application data.
klondikemarlen Aug 9, 2023
28928c5
:fire: Drop now unused language import.
klondikemarlen Aug 9, 2023
02ff14d
:pencil: Add note about serializer future patterns.
klondikemarlen Aug 9, 2023
34efd59
:ok_hand: Add missing program details section field.
klondikemarlen Aug 9, 2023
55ccba3
:pencil: Add note about possibility of needing a "parents" field.
klondikemarlen Aug 9, 2023
1be35a0
:sparkles: Add statistical section to application serializer.
klondikemarlen Aug 9, 2023
ca0f116
:sparkles: Add student consent model.
klondikemarlen Aug 9, 2023
49c4f7d
:tophat: Add disability, language, sex and student consent modeling.
klondikemarlen Aug 9, 2023
4f6c46f
:beetle: Fix join condition between person and sex and language.
klondikemarlen Aug 9, 2023
f31afff
:recycle: Rename addresses assocation on person to personAddresses.
klondikemarlen Aug 9, 2023
9233e9a
:sparkles: Add student consents section.
klondikemarlen Aug 9, 2023
3578ffb
:sparkles: Return residency info in student application endpoint.
klondikemarlen Aug 9, 2023
63cbee0
:tophat: Add residency to ERD.
klondikemarlen Aug 9, 2023
633f24f
:construction: Begin work on returning education info.
klondikemarlen Aug 9, 2023
9323798
:truck: Rename funding request to funding sources.
klondikemarlen Aug 10, 2023
58ca6e1
:recycle: Switch to return full funding request and request type obje…
klondikemarlen Aug 10, 2023
4543c69
:sparkles: Return assessments from funding request service.
klondikemarlen Aug 10, 2023
59a4ab2
:sparkles: Add disbursements to assessments payload.
klondikemarlen Aug 10, 2023
4572fd1
:hammer: Add plantuml server to development environment.
klondikemarlen Aug 10, 2023
a398620
:tophat: Add assessement to funding request modeling.
klondikemarlen Aug 10, 2023
b7e8d27
:tophat: Add data modeling for disbursement model.
klondikemarlen Aug 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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