-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
609 additions
and
125 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "portfolio", | ||
"version": "1.04", | ||
"version": "1.05", | ||
"scripts": { | ||
"ng": "ng", | ||
"start": "ng serve", | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
import { IDegreeHonorOpts, IDegreeOpts, IDegreeTypeOpts } from 'src/app/interfaces/education/Degree'; | ||
import { EducationalInstitution } from './EducationalInstitution'; | ||
import { Major } from './Major'; | ||
import { IEducationalField } from 'src/app/interfaces/education/EducationalField'; | ||
import { EducationalLevel } from './EducationalLevel'; | ||
|
||
export class DegreeHonor implements IDegreeHonorOpts { | ||
id!: number; | ||
|
||
label!: string; | ||
|
||
constructor(opts: IDegreeHonorOpts) { | ||
Object.assign(this, opts); | ||
} | ||
} | ||
export class DegreeType implements IDegreeTypeOpts { | ||
id!: number; | ||
|
||
prefix!: string; | ||
|
||
usesSuffixInline!: boolean; | ||
|
||
level!: EducationalLevel; | ||
|
||
label!: string; | ||
|
||
constructor(opts: IDegreeTypeOpts) { | ||
Object.assign(this, opts); | ||
} | ||
} | ||
|
||
export class Degree { | ||
id!: number; | ||
|
||
gpa?: number; | ||
|
||
startedOn!: Date; | ||
|
||
awardedOn?: Date; | ||
|
||
institution!: EducationalInstitution; | ||
|
||
major!: Major; | ||
|
||
field!: IEducationalField; | ||
|
||
type!: DegreeType; | ||
|
||
honor?: DegreeHonor; | ||
|
||
static Sort(a: Degree, b: Degree) { | ||
const degreeTimestamps = { | ||
a: { | ||
start: a.startedOn.getTime(), | ||
end: a.awardedOn?.getTime(), | ||
}, | ||
b: { | ||
start: b.startedOn.getTime(), | ||
end: b.awardedOn?.getTime(), | ||
}, | ||
}; | ||
|
||
if (degreeTimestamps.a.end === degreeTimestamps.b.end) { | ||
// award dates are the same | ||
|
||
// first try to differentiate by degree start dates. | ||
// Whichever was started more recently should be first. | ||
if (degreeTimestamps.a.start > degreeTimestamps.b.start) return -1; | ||
if (degreeTimestamps.a.start < degreeTimestamps.b.start) return 1; | ||
|
||
// award and start dates are identical, defer to educational level sort | ||
const educationalLevelSortResult = EducationalLevel.Sort(a.type.level, b.type.level); | ||
if (educationalLevelSortResult) return educationalLevelSortResult; | ||
|
||
// Educational levels are also the same. Defer to educational institution sort. | ||
return EducationalInstitution.Sort(a.institution, b.institution); | ||
} | ||
|
||
// award dates are different. | ||
// if one of the degrees is still in progress it should come first. | ||
|
||
if (!degreeTimestamps.a.end) return -1; | ||
if (!degreeTimestamps.b.end) return 1; | ||
|
||
// Both degrees are completed and were completed at different times. | ||
// The one that was completed more recently should appear first. | ||
if (degreeTimestamps.a.end > degreeTimestamps.b.end) return -1; | ||
return 1; | ||
} | ||
|
||
constructor(opts: IDegreeOpts) { | ||
this.id = opts.id; | ||
this.gpa = opts.gpa; | ||
this.startedOn = new Date(opts.startedOn); | ||
this.awardedOn = opts.awardedOn ? new Date(opts.awardedOn) : undefined; | ||
this.institution = opts.institution; | ||
this.major = opts.major; | ||
this.field = opts.field; | ||
this.type = opts.type; | ||
this.honor = opts.honor; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
export interface IEducationalInstitutionType { | ||
id: number; | ||
label: string; | ||
} | ||
|
||
export interface IEducationalInstitution { | ||
id: number; | ||
name: string; | ||
institutionType: IEducationalInstitutionType; | ||
} | ||
|
||
export class EducationalInstitution { | ||
id!: number; | ||
|
||
name!: string; | ||
|
||
type!: IEducationalInstitutionType; | ||
|
||
static Sort(a: EducationalInstitution, b: EducationalInstitution) { | ||
if (a.name !== b.name) return a.name.localeCompare(b.name); | ||
return a.type.label.localeCompare(b.type.label); | ||
} | ||
|
||
constructor(opts: IEducationalInstitution) { | ||
this.id = opts.id; | ||
this.name = opts.name; | ||
this.type = opts.institutionType; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { IEducationalLevelOpts } from 'src/app/interfaces/education/EducationLevel'; | ||
|
||
export class EducationalLevel implements IEducationalLevelOpts { | ||
id!: number; | ||
|
||
label!: string; | ||
|
||
priority!: number; | ||
|
||
static Sort(a: EducationalLevel, b: EducationalLevel) { | ||
if (a.priority < b.priority) return -1; | ||
if (a.priority === b.priority) return a.label.localeCompare(b.label); | ||
return 1; | ||
} | ||
|
||
constructor(opts: IEducationalLevelOpts) { | ||
Object.assign(this, opts); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { IMajorOpts } from 'src/app/interfaces/education/Major'; | ||
|
||
export class Major implements IMajorOpts { | ||
id!: number; | ||
|
||
label!: string; | ||
|
||
abbreviation!: string; | ||
|
||
constructor(opts: IMajorOpts) { | ||
Object.assign(this, opts); | ||
} | ||
} |
9 changes: 1 addition & 8 deletions
9
src/app/classes/Employer.ts → src/app/classes/employment/Employer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
export const EDUCATION_QUERIES = { | ||
GET_MAPPINGS: ` | ||
query getEducationalInfo { | ||
degreeTypes: portfolio_zlookup_degree_type(where: {Degrees_aggregate: {count: {filter: {started_on: {_lte: "now()"}}, predicate: {_neq: 0}}}}) { | ||
id | ||
prefix | ||
usesSuffixInline: uses_suffix_inline | ||
education_level_fk | ||
label | ||
} | ||
degreeHonors:portfolio_zlookup_degree_honors(where:{Degrees_aggregate:{count:{filter:{started_on:{_lte:"now()"}}, predicate:{_neq:0}}}}) { | ||
id | ||
label | ||
} | ||
educationLevels: portfolio_zlookup_education_level(where: {DegreeTypes_aggregate: {count: {filter: {Degrees_aggregate: {count: {filter: {started_on: {_lte: "now()"}}, predicate: {_neq: 0}}}}, predicate: {_neq: 0}}}}) { | ||
id | ||
label | ||
priority | ||
} | ||
institutionTypes: portfolio_zlookup_education_institution_type(where: {EducationInstitutions_aggregate: {count: {filter: {Degrees_aggregate: {count: {filter: {started_on: {_lte: "now()"}}, predicate: {_neq: 0}}}}, predicate: {_neq: 0}}}}) { | ||
id | ||
label | ||
} | ||
majors: portfolio_zlookup_degree_major(where: {Degrees_aggregate: {count: {filter: {started_on: {_lte: "now()"}}, predicate: {_neq: 0}}}}) { | ||
id | ||
label | ||
abbreviation | ||
} | ||
fields: portfolio_zlookup_degree_field(where: {Degrees_aggregate: {count: {filter: {started_on: {_lte: "now()"}}, predicate: {_neq: 0}}}}) { | ||
id | ||
suffix | ||
label: field_label | ||
} | ||
institutions: portfolio_EducationInstitution(where: {Degrees_aggregate: {count: {filter: {started_on: {_lte: "now()"}}, predicate: {_neq: 0}}}}) { | ||
id | ||
name | ||
type_id_fk: type_id | ||
} | ||
degrees: portfolio_Degree(where: {started_on: {_lte: "now()"}}) { | ||
id | ||
gpa | ||
startedOn: started_on | ||
awardedOn: awarded_on | ||
institution_fk | ||
major_fk | ||
degree_field_fk | ||
degree_type_fk | ||
honor_fk | ||
} | ||
} | ||
`, | ||
GET_DEGREES: `query GetDegrees { | ||
portfolio_Degree(order_by: {DegreeType: {EducationLevel: {priority: asc}}}) { | ||
institution_fk | ||
major_fk | ||
degree_field_fk | ||
degree_type_fk | ||
gpa | ||
awarded_on | ||
started_on | ||
} | ||
}`, | ||
}; |
2 changes: 1 addition & 1 deletion
2
src/app/classes/ColorTheme.ts → src/app/interfaces/ColorTheme.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { EducationalInstitution } from 'src/app/classes/education/EducationalInstitution'; | ||
import { Major } from 'src/app/classes/education/Major'; | ||
import { IEducationalField } from './EducationalField'; | ||
import { DegreeHonor, DegreeType } from 'src/app/classes/education/Degree'; | ||
import { EducationalLevel } from 'src/app/classes/education/EducationalLevel'; | ||
|
||
export interface IDegreeTypeOpts { | ||
id: number; | ||
prefix: string; | ||
usesSuffixInline: boolean; | ||
level: EducationalLevel; | ||
label: string; | ||
} | ||
|
||
export interface IDegreeHonorOpts { | ||
id: number; | ||
label: string; | ||
} | ||
|
||
export interface IDegreeTypeQryOpts { | ||
id: number; | ||
prefix: string; | ||
usesSuffixInline: boolean; | ||
education_level_fk: number; | ||
label: string; | ||
} | ||
|
||
export interface IDegreeQryOpts { | ||
id: number; | ||
gpa?: number; | ||
startedOn: string; | ||
awardedOn?: string; | ||
institution_fk: number; | ||
major_fk: number; | ||
degree_field_fk: number; | ||
degree_type_fk: number; | ||
honor_fk?: number; | ||
} | ||
|
||
export interface IDegreeOpts { | ||
id: number; | ||
gpa?: number; | ||
startedOn: string; | ||
awardedOn?: string; | ||
institution: EducationalInstitution; | ||
major: Major; | ||
field: IEducationalField; | ||
type: DegreeType; | ||
honor?: DegreeHonor; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface IEducationalLevelOpts { | ||
id: number; | ||
label: string; | ||
priority: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface IEducationalField { | ||
id: number; | ||
label: string; | ||
suffix: string; | ||
} |
Oops, something went wrong.