diff --git a/lib/model/response/ticketDetailsResponse.js b/lib/model/response/ticketDetailsResponse.js index 75c9fb3..6c2a6aa 100644 --- a/lib/model/response/ticketDetailsResponse.js +++ b/lib/model/response/ticketDetailsResponse.js @@ -1,16 +1,18 @@ var TicketDetailsResponse = function TicketDetailsResponse(id, - code, - purchaseOrderNumber, - amount, - date, - pointOfSale, - taxRegistrationNumber, - trade) { + code, + purchaseOrderNumber, + amount, + date, + special, + pointOfSale, + taxRegistrationNumber, + trade) { this.id = id; this.code = code; this.purchaseOrderNumber = purchaseOrderNumber; this.amount = amount; this.date = date; + this.special = special; this.pointOfSale = pointOfSale; this.taxRegistrationNumber = taxRegistrationNumber; this.trade = trade; @@ -22,6 +24,7 @@ var TicketDetailsResponseBuilder = function TicketDetailsResponseBuilder() { this.purchaseOrderNumber = null; this.amount = null; this.date = null; + this.special = null; this.pointOfSale = null; this.taxRegistrationNumber = null; this.trade = null; @@ -53,6 +56,11 @@ var TicketDetailsResponseBuilder = function TicketDetailsResponseBuilder() { return self; }; + this.withSpecial = function withSpecial(special) { + self.special = special; + return self; + }; + this.withPointOfSale = function withPointOfSale(pointOfSale) { self.pointOfSale = pointOfSale; return self; @@ -75,6 +83,7 @@ var TicketDetailsResponseBuilder = function TicketDetailsResponseBuilder() { self.purchaseOrderNumber, self.amount, self.date, + self.special, self.pointOfSale, self.taxRegistrationNumber, self.trade diff --git a/lib/model/response/ticketResponse.js b/lib/model/response/ticketResponse.js index 36fece8..4315fc3 100644 --- a/lib/model/response/ticketResponse.js +++ b/lib/model/response/ticketResponse.js @@ -1,9 +1,15 @@ -var TicketResponse = function TicketResponse(id, code, purchaseOrderNumber, amount, date) { +var TicketResponse = function TicketResponse(id, + code, + purchaseOrderNumber, + amount, + date, + special) { this.id = id; this.code = code; this.purchaseOrderNumber = purchaseOrderNumber; this.amount = amount; this.date = date; + this.special = special; }; var TicketResponseBuilder = function TicketResponseBuilder() { @@ -12,6 +18,7 @@ var TicketResponseBuilder = function TicketResponseBuilder() { this.purchaseOrderNumber = null; this.amount = null; this.date = null; + this.special = null; var self = this; @@ -40,14 +47,20 @@ var TicketResponseBuilder = function TicketResponseBuilder() { return self; }; + this.withSpecial = function withSpecial(special) { + self.special = special; + return self; + }; + this.build = function build() { return new TicketResponse( - self.id, - self.code, - self.purchaseOrderNumber, - self.amount, - self.date + self.id, + self.code, + self.purchaseOrderNumber, + self.amount, + self.date, + self.special ); }; diff --git a/package.json b/package.json index 64dfa28..e6f89f7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "receipts-model", - "version": "1.2.0", + "version": "1.3.0", "description": "Receipts model.", "main": "./index.js", "dependencies": { @@ -38,6 +38,6 @@ "node": ">=5.6.0" }, "readmeFilename": "README.md", - "_id": "receipts-model@1.2.0", - "_from": "receipts-model@^1.2.0" + "_id": "receipts-model@1.3.0", + "_from": "receipts-model@^1.3.0" } diff --git a/test/model/response/ticketDetailsResponseTest.js b/test/model/response/ticketDetailsResponseTest.js index 315a827..752059e 100644 --- a/test/model/response/ticketDetailsResponseTest.js +++ b/test/model/response/ticketDetailsResponseTest.js @@ -9,6 +9,7 @@ describe('ticketDetailsResponse model test', function () { var purchaseOrderNumber = 'purchaseOrderNumber'; var amount = 'amount'; var date = 'date'; + var special = 'special'; var pointOfSale = 'pointOfSale'; var taxRegistrationNumber = 'taxRegistrationNumber'; var trade = 'trade'; @@ -21,6 +22,7 @@ describe('ticketDetailsResponse model test', function () { purchaseOrderNumber, amount, date, + special, pointOfSale, taxRegistrationNumber, trade @@ -32,6 +34,7 @@ describe('ticketDetailsResponse model test', function () { ticketDetailsResponseModel.purchaseOrderNumber.should.be.equal(purchaseOrderNumber); ticketDetailsResponseModel.amount.should.be.equal(amount); ticketDetailsResponseModel.date.should.be.equal(date); + ticketDetailsResponseModel.special.should.be.equal(special); ticketDetailsResponseModel.pointOfSale.should.be.equal(pointOfSale); ticketDetailsResponseModel.taxRegistrationNumber.should.be.equal(taxRegistrationNumber); ticketDetailsResponseModel.trade.should.be.equal(trade); @@ -47,6 +50,7 @@ describe('ticketDetailsResponse model test', function () { .withPurchaseOrderNumber(purchaseOrderNumber) .withAmount(amount) .withDate(date) + .withSpecial(special) .withPointOfSale(pointOfSale) .withTaxRegistrationNumber(taxRegistrationNumber) .withTrade(trade) @@ -58,6 +62,7 @@ describe('ticketDetailsResponse model test', function () { ticketDetailsResponseModel.purchaseOrderNumber.should.be.equal(purchaseOrderNumber); ticketDetailsResponseModel.amount.should.be.equal(amount); ticketDetailsResponseModel.date.should.be.equal(date); + ticketDetailsResponseModel.special.should.be.equal(special); ticketDetailsResponseModel.pointOfSale.should.be.equal(pointOfSale); ticketDetailsResponseModel.taxRegistrationNumber.should.be.equal(taxRegistrationNumber); ticketDetailsResponseModel.trade.should.be.equal(trade); diff --git a/test/model/response/ticketResponseTest.js b/test/model/response/ticketResponseTest.js index 8cf807d..9ce041b 100644 --- a/test/model/response/ticketResponseTest.js +++ b/test/model/response/ticketResponseTest.js @@ -9,6 +9,7 @@ describe('ticketResponse model test', function () { var purchaseOrderNumber = 'purchaseOrderNumber'; var amount = 'amount'; var date = 'date'; + var special = 'special'; it('should create model', function (done) { @@ -17,7 +18,8 @@ describe('ticketResponse model test', function () { code, purchaseOrderNumber, amount, - date + date, + special ); should.exist(ticketResponseModel); @@ -26,6 +28,7 @@ describe('ticketResponse model test', function () { ticketResponseModel.purchaseOrderNumber.should.be.equal(purchaseOrderNumber); ticketResponseModel.amount.should.be.equal(amount); ticketResponseModel.date.should.be.equal(date); + ticketResponseModel.special.should.be.equal(special); done(); }); @@ -37,6 +40,7 @@ describe('ticketResponse model test', function () { .withPurchaseOrderNumber(purchaseOrderNumber) .withAmount(amount) .withDate(date) + .withSpecial(special) .build(); should.exist(ticketResponseModel); @@ -45,6 +49,7 @@ describe('ticketResponse model test', function () { ticketResponseModel.purchaseOrderNumber.should.be.equal(purchaseOrderNumber); ticketResponseModel.amount.should.be.equal(amount); ticketResponseModel.date.should.be.equal(date); + ticketResponseModel.special.should.be.equal(special); done(); });