Add more reports

This commit is contained in:
2017-01-08 09:47:30 -05:00
parent 908e10736a
commit 4e547fe4fd
16 changed files with 357 additions and 97 deletions

View File

@ -218,6 +218,37 @@ Error.prototype.isError = function() {
this.ErrorString != empty_error.ErrorString;
}
function Report() {
this.ReportId = "invalid";
this.Title = "";
this.Data = [];
}
Report.prototype.toJSON = function() {
var json_obj = {};
json_obj.ReportId = this.ReportId;
json_obj.Title = this.Title;
json_obj.Data = this.Data;
return JSON.stringify(json_obj);
}
Report.prototype.fromJSON = function(json_input) {
var json_obj = getJSONObj(json_input);
if (json_obj.hasOwnProperty("ReportId"))
this.ReportId = json_obj.ReportId;
if (json_obj.hasOwnProperty("Title"))
this.Title = json_obj.Title;
if (json_obj.hasOwnProperty("Data"))
this.Data = json_obj.Data;
}
Report.prototype.isReport = function() {
var empty_report = new Report();
return this.ReportId != empty_report.ReportId ||
this.Title != empty_report.Title;
}
module.exports = models = {
// Classes
@ -228,6 +259,7 @@ module.exports = models = {
PopularAttendee: PopularAttendee,
Suggestion: Suggestion,
PopularSuggestion: PopularSuggestion,
Report: Report,
// Constants
BogusPassword: "password"