-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added support for retrieving invoice reminder settings
- Loading branch information
Jordan Walsh
committed
Mar 16, 2017
1 parent
1bd4eb9
commit d1868e5
Showing
4 changed files
with
59 additions
and
1 deletion.
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
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,18 @@ | ||
var _ = require('lodash'), | ||
Entity = require('../entity'), | ||
logger = require('../../logger'); | ||
|
||
var InvoiceReminderSchema = new Entity.SchemaObject({ | ||
Enabled: { type: Boolean } | ||
}); | ||
|
||
var InvoiceReminder = Entity.extend(InvoiceReminderSchema, { | ||
constructor: function(application, data, options) { | ||
logger.debug('InvoiceReminder::constructor'); | ||
this.Entity.apply(this, arguments); | ||
}, | ||
initialize: function(data, options) {} | ||
}); | ||
|
||
|
||
module.exports = InvoiceReminder; |
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,21 @@ | ||
var _ = require('lodash'), | ||
logger = require('../../logger'), | ||
EntityHelper = require('../entity_helper'), | ||
InvoiceReminder = require('../../entities/accounting/invoicereminder'), | ||
util = require('util') | ||
|
||
var InvoiceReminders = EntityHelper.extend({ | ||
constructor: function(application, options) { | ||
EntityHelper.call(this, application, Object.assign({ entityName: 'InvoiceReminder', entityPlural: 'InvoiceReminders' }, options)); | ||
}, | ||
getInvoiceReminders: function(options, callback) { | ||
var self = this; | ||
var clonedOptions = _.clone(options || {}); | ||
//This has been hardcoded as the URL is /InvoiceReminders/Settings | ||
clonedOptions.id = "Settings"; | ||
clonedOptions.entityConstructor = function(data) { return new InvoiceReminder(data) }; | ||
return this.getEntities(clonedOptions) | ||
} | ||
}) | ||
|
||
module.exports = InvoiceReminders; |
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