diff --git a/index.js b/index.js index 14f217d..42ab520 100644 --- a/index.js +++ b/index.js @@ -8,6 +8,7 @@ module.exports = { AlreadyExistsError: require('./lib/error/alreadyExistsError').AlreadyExistsError, UnknownValidateError: require('./lib/error/unknownValidateError').UnknownValidateError, InvalidPointOfSaleError: require('./lib/error/invalidPointOfSaleError').InvalidPointOfSaleError, + InvalidPurchaseOrderNumberError: require('./lib/error/invalidPurchaseOrderNumberError').InvalidPurchaseOrderNumberError, InvalidDateError: require('./lib/error/invalidDateError').InvalidDateError, InvalidAmountError: require('./lib/error/invalidAmountError').InvalidAmountError, InvalidTaxRegistrationNumberError: require('./lib/error/invalidTaxRegistrationNumberError').InvalidTaxRegistrationNumberError diff --git a/lib/error/invalidPurchaseOrderNumberError.js b/lib/error/invalidPurchaseOrderNumberError.js new file mode 100644 index 0000000..17b83be --- /dev/null +++ b/lib/error/invalidPurchaseOrderNumberError.js @@ -0,0 +1,13 @@ +var util = require('util'); + +var InvalidPurchaseOrderNumberError = function InvalidPurchaseOrderNumberError(message, userMessage, field) { + Error.call(this); + this.name = 'InvalidPurchaseOrderNumberError'; + this.message = message; + this.userMessage = userMessage; + this.field = field; +}; + +util.inherits(InvalidPurchaseOrderNumberError, Error); + +module.exports.InvalidPurchaseOrderNumberError = InvalidPurchaseOrderNumberError; \ No newline at end of file diff --git a/package.json b/package.json index e7eda05..0064bbc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "receipts-model", - "version": "0.5.5", + "version": "0.5.6", "description": "Receipts model.", "main": "./index.js", "dependencies": { @@ -42,6 +42,6 @@ "node": ">=0.10.0" }, "readmeFilename": "README.md", - "_id": "receipts-model@0.5.5", - "_from": "receipts-model@^0.5.5" + "_id": "receipts-model@0.5.6", + "_from": "receipts-model@^0.5.6" } diff --git a/test/indexTest.js b/test/indexTest.js index 1e64452..6d183ec 100644 --- a/test/indexTest.js +++ b/test/indexTest.js @@ -39,6 +39,13 @@ describe('index test', function () { done(); }); + it('should export InvalidPurchaseOrderNumberError', function (done) { + + var InvalidPurchaseOrderNumberError = index.error.InvalidPurchaseOrderNumberError; + should.exist(InvalidPurchaseOrderNumberError); + done(); + }); + it('should export InvalidDateError', function (done) { var InvalidDateError = index.error.InvalidDateError;