Skip to content

Commit

Permalink
Change Controller Profile Certifications/Endorsements (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdconn00 authored Feb 28, 2024
1 parent e2ed52e commit c24131f
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 44 deletions.
8 changes: 4 additions & 4 deletions controllers/EventController.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,28 +316,28 @@ router.put('/:slug', getUser, auth(['atm', 'datm', 'ec']), upload.single('banner
computedPositions.push({
pos,
type: thePos[2],
code: 'zab',
code: 'enroute',
})
}
if(['APP', 'DEP'].includes(thePos[2])) {
computedPositions.push({
pos,
type: thePos[2],
code: (thePos[1] === "PHX") ? 'p50app' : 'app',
code: (thePos[1] === "PHX") ? 'p50' : 'app',
})
}
if(['TWR'].includes(thePos[2])) {
computedPositions.push({
pos,
type: thePos[2],
code: (thePos[1] === "PHX") ? 'p50twr' : 'twr',
code: (thePos[1] === "PHX") ? 'kphxtower' : 'twr',
})
}
if(['GND', 'DEL'].includes(thePos[2])) {
computedPositions.push({
pos,
type: thePos[2],
code: (thePos[1] === "PHX") ? 'p50gnd' : 'gnd',
code: (thePos[1] === "PHX") ? 'kphxground' : 'gnd',
})
}
}
Expand Down
6 changes: 4 additions & 2 deletions models/TrainingMilestone.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import m from 'mongoose';
const trainingMilestoneSchema = new m.Schema({
code: String,
name: String,
rating: Number,
certCode: String
rating: Number, // Legacy field, replaced by "availableAtRatings".
certCode: String, // Legacy field, replaced by "hiddenWhenControllerHasTierOne".
availableAtRatings: Array,
hiddenWhenControllerHasTierOne: Boolean
});

export default m.model('TrainingMilestone', trainingMilestoneSchema, 'trainingMilestones');
82 changes: 44 additions & 38 deletions seeds/certifications.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,49 @@
[{
"name": "Minor Ground",
"code": "gnd",
[
{
"name": "KPHX GND",
"code": "kphxground",
"order": 4,
"class": "tier-one"
},
{
"name": "KPHX TWR",
"code": "kphxtower",
"order": 3,
"class": "tier-one"
},
{
"name": "P50",
"code": "p50",
"order": 2,
"class": "tier-one"
},
{
"name": "Enroute",
"code": "enroute",
"order": 1,
"class": "tier-one"
},
{
"name": "KABQ",
"code": "kabq",
"order": 1,
"class": "minor",
"facility": "gnd"
},{
"name": "Major Ground",
"code": "p50gnd",
"class": "tier-two"
},
{
"name": "KFLG",
"code": "kflg",
"order": 2,
"class": "major",
"facility": "gnd"
},{
"name": "Minor Tower",
"code": "twr",
"class": "tier-two"
},
{
"name": "KLUF",
"code": "kluf",
"order": 3,
"class": "minor",
"facility": "twr"
},{
"name": "Major Tower",
"code": "p50twr",
"class": "tier-two"
},
{
"name": "KSAF",
"code": "ksaf",
"order": 4,
"class": "major",
"facility": "twr"
},{
"name": "Minor Approach",
"code": "app",
"order": 5,
"class": "minor",
"facility": "app"
},{
"name": "Major Approach",
"code": "p50app",
"order": 6,
"class": "major",
"facility": "app"
},{
"name": "Albuquerque Center",
"code": "zab",
"order": 7,
"class": "center",
"facility": "ctr"
"class": "tier-two"
}]

0 comments on commit c24131f

Please sign in to comment.