Skip to content
Snippets Groups Projects

Auth

Merged Lucas Gabriel Lima requested to merge auth into development
2 files
+ 21
13
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -24,30 +24,38 @@ let SimulationSchema = new Schema({
goals_inclusion: Array,
});
SimulationSchema.methods.setTime = (t) => {
SimulationSchema.methods.setTime = function (t) {
t = parseInt(t, 10);
if(!t || t>MAX_SIMULATION_TIME){
if (!t || t > MAX_SIMULATION_TIME) {
// Throw an error?
return;
}
this.time = t;
};
SimulationSchema.methods.setLocation = (l) => {
SimulationSchema.methods.setLocation = function (l) {
// Should sanitize
if(!(l instanceof locations.location)){
// Throw an error?
return;
}
this.location = l;
};
SimulationSchema.methods.setCareGoals = (g) => {
SimulationSchema.methods.setFailureRate = function (fr) {
// Should sanitize
this.goals.care = g;
this.failure_rate = fr;
};
SimulationSchema.methods.setInclusionGoals = (g) => {
SimulationSchema.methods.setCareGoals = function (g) {
// Should sanitize
this.goals.inclusion = g;
this.goals_care = g;
};
SimulationSchema.methods.setInclusionGoals = function (g) {
// Should sanitize
this.goals_inclusion = g;
};
SimulationSchema.methods.update = function (property, value) {
if (property === "time") this.setTime(value);
if (property === "location") this.setLocation(value);
if (property === "failure_rate") this.setFailureRate(value);
if (property === "goals_care") this.setCareGoals(value);
if (property === "goals_inclusion") this.setInclusionGoals(value);
};
SimulationSchema.methods.run = () => {
/* Runs the Simulation with given parameters */
// if (!this.name || !this.location || !this.time) {
Loading