Skip to content

Instantly share code, notes, and snippets.

@raytiley
Created April 22, 2012 21:44
Show Gist options
  • Save raytiley/2467111 to your computer and use it in GitHub Desktop.
Save raytiley/2467111 to your computer and use it in GitHub Desktop.
Design Phase 4 - Report Validator Module
exports.createReport = function(report, callback(err, data)) {
//Persist the report object to database
//Update cost tables if needed
//Execute callback
}
exports.updateReport = function(report, callback(err, data)) {
//Update report object in database
//Update cost tables if needed
//Execute callback
}
exports.getReportByID = function(id, callback(err, data)) {
//Retrieve report from database
//Execute callback
}
exports.getReportsByLatLon = function(lat, lon, radiusInMeters, callback(err, data)) {
//Retrieve reports within the radius of the provided latitude and longitude
//Execute callback
}
exports.getRelatedReports = function(id, callback(err, data)) {
//Return reports that reference the report with provided ID
//Execute callback
}
exports.deleteReport = function(id, callback(err, data)) {
//Delete report with given id
//Execute callback
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment