Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4,151 changes: 4,150 additions & 1 deletion docs/api/api_data.js

Large diffs are not rendered by default.

4,151 changes: 4,150 additions & 1 deletion docs/api/api_data.json

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions middlewares/validators/hacker.validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ module.exports = {
100
),
VALIDATOR.mongoIdValidator("body", "application.team", true),
VALIDATOR.mongoIdValidator("body", "teamId", true)
VALIDATOR.stringValidator("body", "application.location.timeZone", true),
VALIDATOR.stringValidator("body", "application.location.country", true),
VALIDATOR.stringValidator("body", "application.location.city", true),
VALIDATOR.mongoIdValidator("body", "teamId", true),
],

updateConfirmationValidator: [
Expand Down Expand Up @@ -253,7 +256,10 @@ module.exports = {
0,
100
),
VALIDATOR.mongoIdValidator("body", "application.team", true)
VALIDATOR.mongoIdValidator("body", "application.team", true),
VALIDATOR.stringValidator("body", "application.location.timeZone", true),
VALIDATOR.stringValidator("body", "application.location.country", true),
VALIDATOR.stringValidator("body", "application.location.city", true),
],
updateStatusValidator: [
VALIDATOR.enumValidator(
Expand Down
16 changes: 15 additions & 1 deletion models/hacker.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,26 @@ const HackerSchema = new mongoose.Schema({
team: {
type: mongoose.Schema.Types.ObjectId,
ref: "Team"
},
location: {
timeZone: {
type: String,
default: ""
},
country: {
type: String,
default: ""
},
city: {
type: String,
default: ""
}
}
},
teamId: {
type: mongoose.Schema.Types.ObjectId,
ref: "Team"
}
},
});

HackerSchema.methods.toJSON = function() {
Expand Down
30 changes: 30 additions & 0 deletions routes/api/hacker.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ module.exports = {
"accomodation": {
"travel": 0
},
"location": {
"timeZone": "GMT-5",
"country": "Canada",
"city": "Montreal"
}
}

* }
Expand Down Expand Up @@ -171,6 +176,11 @@ module.exports = {
"accomodation": {
"travel": 0
},
"location": {
"timeZone": "GMT-5",
"country": "Canada",
"city": "Montreal"
}
}
* }

Expand Down Expand Up @@ -461,6 +471,11 @@ module.exports = {
"accomodation": {
"travel": 0
},
"location": {
"timeZone": "GMT-5",
"country": "Canada",
"city": "Montreal"
}
}
}
*
Expand Down Expand Up @@ -504,6 +519,11 @@ module.exports = {
"accomodation": {
"travel": 0
},
"location": {
"timeZone": "GMT-5",
"country": "Canada",
"city": "Montreal"
}
}
}
* }
Expand Down Expand Up @@ -576,6 +596,11 @@ module.exports = {
"accomodation": {
"travel": 0
},
"location": {
"timeZone": "GMT-5",
"country": "Canada",
"city": "Montreal"
}
}
}
}
Expand Down Expand Up @@ -644,6 +669,11 @@ module.exports = {
"accomodation": {
"travel": 0
},
"location": {
"timeZone": "GMT-5",
"country": "Canada",
"city": "Montreal"
}
}
}
}
Expand Down