-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from LPSci-Web-Development-Team/develop
v1.00 (June 03, 2020)
- Loading branch information
Showing
33 changed files
with
3,875 additions
and
6 deletions.
There are no files selected for viewing
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 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# http://editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
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 @@ | ||
/client/ |
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,3 @@ | ||
{ | ||
"extends": "loopback" | ||
} |
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,3 @@ | ||
{ | ||
"generator-loopback": {} | ||
} |
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,3 @@ | ||
# My Application | ||
|
||
The project is generated by [LoopBack](http://loopback.io). |
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,3 @@ | ||
## Client | ||
|
||
This is the place for your application front-end files. |
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,23 @@ | ||
'use strict'; | ||
|
||
const CANDIDATE_POSITIONS = [ | ||
'President', | ||
'Vice President', | ||
'Secretary', | ||
'Treasurer', | ||
'Auditor', | ||
'PIO', | ||
'Peace Officer', | ||
'Level Rep. (8)', | ||
'Level Rep. (9)', | ||
'Level Rep. (10)', | ||
'Level Rep. (11)', | ||
'Level Rep. (12)', | ||
]; | ||
|
||
module.exports = function (Candidate) { | ||
Candidate.validatesInclusionOf('position', { | ||
in: CANDIDATE_POSITIONS, | ||
message: 'Invalid position for Candidate', | ||
}); | ||
}; |
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,55 @@ | ||
{ | ||
"name": "candidate", | ||
"plural": "candidates", | ||
"base": "PersistedModel", | ||
"idInjection": true, | ||
"options": { | ||
"validateUpsert": true | ||
}, | ||
"mixins": { | ||
"TimeStamp": { | ||
"required": false, | ||
"validateUpsert": true, | ||
"silenceWarnings": false | ||
} | ||
}, | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"id": true, | ||
"defaultFn": "uuidv4" | ||
}, | ||
"firstName": { | ||
"type": "string", | ||
"required": true | ||
}, | ||
"lastName": { | ||
"type": "string", | ||
"required": true | ||
}, | ||
"position": { | ||
"type": "string", | ||
"required": true | ||
}, | ||
"imgUrl": { | ||
"type": "string", | ||
"required": true | ||
} | ||
}, | ||
"validations": [], | ||
"relations": { | ||
"parties": { | ||
"type": "belongsTo", | ||
"model": "party", | ||
"foreignKey": "partyId" | ||
}, | ||
"voters": { | ||
"type": "hasMany", | ||
"model": "voter", | ||
"foreignKey": "candidateId", | ||
"through": "vote" | ||
} | ||
}, | ||
"acls": [], | ||
"methods": {} | ||
} |
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,8 @@ | ||
'use strict'; | ||
|
||
module.exports = function (Election) { | ||
Election.validatesInclusionOf('state', { | ||
in: ['register', 'vote', 'disable'], | ||
message: 'invalid state for Election', | ||
}); | ||
}; |
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,24 @@ | ||
{ | ||
"name": "election", | ||
"plural": "elections", | ||
"base": "PersistedModel", | ||
"idInjection": true, | ||
"options": { | ||
"validateUpsert": true | ||
}, | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"id": true, | ||
"defaultFn": "uuidv4" | ||
}, | ||
"state": { | ||
"type": "string", | ||
"required": true | ||
} | ||
}, | ||
"validations": [], | ||
"relations": {}, | ||
"acls": [], | ||
"methods": {} | ||
} |
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 @@ | ||
'use strict'; | ||
|
||
module.exports = function(Party) { | ||
|
||
}; |
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,35 @@ | ||
{ | ||
"name": "party", | ||
"plural": "parties", | ||
"base": "PersistedModel", | ||
"idInjection": true, | ||
"options": { | ||
"validateUpsert": true | ||
}, | ||
"mixins": { | ||
"TimeStamp": { | ||
"required": false, | ||
"validateUpsert": true, | ||
"silenceWarnings": false | ||
} | ||
}, | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"id": true, | ||
"defaultFn": "uuidv4" | ||
}, | ||
"name": { | ||
"type": "string", | ||
"required": true | ||
}, | ||
"hexColor": { | ||
"type": "string", | ||
"required": true | ||
} | ||
}, | ||
"validations": [], | ||
"relations": {}, | ||
"acls": [], | ||
"methods": {} | ||
} |
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,17 @@ | ||
'use strict'; | ||
|
||
const SECTION_GRADE_LEVELS = [ | ||
7, | ||
8, | ||
9, | ||
10, | ||
11, | ||
12, | ||
]; | ||
|
||
module.exports = function (Section) { | ||
Section.validatesInclusionOf('gradeLevel', { | ||
in: SECTION_GRADE_LEVELS, | ||
message: 'Invalid grade level', | ||
}); | ||
}; |
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,35 @@ | ||
{ | ||
"name": "section", | ||
"plural": "sections", | ||
"base": "PersistedModel", | ||
"idInjection": true, | ||
"options": { | ||
"validateUpsert": true | ||
}, | ||
"mixins": { | ||
"TimeStamp": { | ||
"required": false, | ||
"validateUpsert": true, | ||
"silenceWarnings": false | ||
} | ||
}, | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"id": true, | ||
"defaultFn": "uuidv4" | ||
}, | ||
"gradeLevel": { | ||
"type": "number", | ||
"required": true | ||
}, | ||
"name": { | ||
"type": "string", | ||
"required": true | ||
} | ||
}, | ||
"validations": [], | ||
"relations": {}, | ||
"acls": [], | ||
"methods": {} | ||
} |
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 @@ | ||
'use strict'; | ||
|
||
module.exports = function(Vote) { | ||
|
||
}; |
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,41 @@ | ||
{ | ||
"name": "vote", | ||
"plural": "votes", | ||
"base": "PersistedModel", | ||
"idInjection": true, | ||
"options": { | ||
"validateUpsert": true | ||
}, | ||
"mixins": { | ||
"TimeStamp": { | ||
"required": false, | ||
"validateUpsert": true, | ||
"silenceWarnings": false | ||
} | ||
}, | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"id": true, | ||
"defaultFn": "uuidv4" | ||
}, | ||
"position": { | ||
"type": "string" | ||
} | ||
}, | ||
"validations": [], | ||
"relations": { | ||
"voter": { | ||
"type": "belongsTo", | ||
"model": "voter", | ||
"foreignKey": "voterId" | ||
}, | ||
"candidate": { | ||
"type": "belongsTo", | ||
"model": "candidate", | ||
"foreignKey": "candidateId" | ||
} | ||
}, | ||
"acls": [], | ||
"methods": {} | ||
} |
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,7 @@ | ||
'use strict'; | ||
|
||
module.exports = function (Voter) { | ||
Voter.validatesUniquenessOf( | ||
'lrn', { message: 'It seems like you have already registered' }, | ||
); | ||
}; |
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,89 @@ | ||
{ | ||
"name": "voter", | ||
"plural": "voters", | ||
"base": "User", | ||
"idInjection": true, | ||
"options": { | ||
"validateUpsert": true | ||
}, | ||
"forceId": false, | ||
"restrictResetPasswordTokenScope": true, | ||
"emailVerificationRequired": false, | ||
"mixins": { | ||
"TimeStamp": { | ||
"required": false, | ||
"validateUpsert": true, | ||
"silenceWarnings": false | ||
} | ||
}, | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"id": true, | ||
"defaultFn": "uuidv4" | ||
}, | ||
"email": { | ||
"type": "string", | ||
"defaultFn": "" | ||
}, | ||
"lrn": { | ||
"type": "string", | ||
"required": true | ||
}, | ||
"firstName": { | ||
"type": "string", | ||
"required": true | ||
}, | ||
"lastName": { | ||
"type": "string", | ||
"required": true | ||
}, | ||
"isAdmin": { | ||
"type": "boolean", | ||
"required": true, | ||
"defaultFn": "false" | ||
} | ||
}, | ||
"validations": [], | ||
"relations": { | ||
"sections": { | ||
"type": "belongsTo", | ||
"model": "section", | ||
"foreignKey": "sectionId" | ||
}, | ||
"candidates": { | ||
"type": "hasMany", | ||
"model": "candidate", | ||
"foreignKey": "voterId", | ||
"through": "vote" | ||
}, | ||
"votes": { | ||
"type": "hasMany", | ||
"model": "vote", | ||
"foreignKey": "voterId" | ||
} | ||
}, | ||
"acls": [ | ||
{ | ||
"accessType": "*", | ||
"principalType": "ROLE", | ||
"principalId": "$authenticated", | ||
"permission": "ALLOW" | ||
}, | ||
{ | ||
"accessType": "READ", | ||
"principalType": "ROLE", | ||
"principalId": "$unauthenticated", | ||
"permission": "ALLOW", | ||
"property": "__get__votes" | ||
}, | ||
{ | ||
"accessType": "*", | ||
"principalType": "ROLE", | ||
"principalId": "$unauthenticated", | ||
"permission": "ALLOW", | ||
"property": "find" | ||
} | ||
], | ||
"methods": {} | ||
} |
Oops, something went wrong.