Skip to content
This repository has been archived by the owner on Oct 15, 2019. It is now read-only.

Commit

Permalink
Merge pull request #3 from receipts/special-tickets
Browse files Browse the repository at this point in the history
Handled special for ticket
  • Loading branch information
Zenedith committed Mar 6, 2016
2 parents c75d87a + e6ab0a9 commit 9971ff8
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
6 changes: 4 additions & 2 deletions lib/controller/tickets.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var parseUserAuth = function parseUserAuth(string, next) {
};
};

var buildTicektResponse = function buildTicektResponse(ticket, callback) {
var buildTicketResponse = function buildTicketResponse(ticket, callback) {

var amount = new AmountResponseBuilder()
.withCurrency(Currency.PLN)
Expand All @@ -59,6 +59,7 @@ var buildTicektResponse = function buildTicektResponse(ticket, callback) {
.withPurchaseOrderNumber(ticket.purchaseOrderNumber)
.withAmount(amount)
.withDate(ticket.date)
.withSpecial(ticket.special)
.build());
};

Expand All @@ -75,6 +76,7 @@ var buildTicketDetailsResponse = function buildTicketDetailsResponse(ticket, cal
.withPurchaseOrderNumber(ticket.purchaseOrderNumber)
.withAmount(amount)
.withDate(ticket.date)
.withSpecial(ticket.special)
.withPointOfSale(ticket.pointOfSale)
.withTaxRegistrationNumber(ticket.taxRegistrationNumber)
.withTrade(ticket.trade)
Expand Down Expand Up @@ -113,7 +115,7 @@ var getLotteryTicketsCollectionV1 = function getLotteryTicketsCollectionV1(req,

next.ifError(err);

async.map(data, buildTicektResponse, function (asyncErr, tickets) {
async.map(data, buildTicketResponse, function (asyncErr, tickets) {

next.ifError(asyncErr);

Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "receipts",
"version": "1.0.0",
"version": "1.1.0",
"description": "receipts",
"main": "./lib/receipts.js",
"dependencies": {
Expand All @@ -13,8 +13,8 @@
"moment": "2.11.2",
"my-restify-api": "0.5.13",
"newrelic": "1.25.4",
"receipts-lottery-client": "1.1.0",
"receipts-model": "1.2.0",
"receipts-lottery-client": "1.2.1",
"receipts-model": "1.3.0",
"winston": "2.2.0",
"winston-loggly": "1.3.1"
},
Expand Down Expand Up @@ -50,6 +50,6 @@
"node": ">=5.6.0"
},
"readmeFilename": "README.md",
"_id": "receipts@1.0.0",
"_from": "receipts@^1.0.0"
"_id": "receipts@1.1.0",
"_from": "receipts@^1.1.0"
}
12 changes: 11 additions & 1 deletion public/api-docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,10 @@
"type": "string",
"description": "ticket generate date"
},
"special": {
"type": "boolean",
"description": "is special ticket"
},
"pointOfSale": {
"type": "string",
"description": "ticket point of sale"
Expand All @@ -443,6 +447,7 @@
"purchaseOrderNumber",
"amount",
"date",
"special",
"pointOfSale",
"taxRegistrationNumber",
"trade"
Expand Down Expand Up @@ -511,13 +516,18 @@
"date": {
"type": "string",
"description": "ticket generate date"
},
"special": {
"type": "boolean",
"description": "is special ticket"
}
},
"required": [
"id",
"purchaseOrderNumber",
"amount",
"date"
"date",
"special"
]
},
"TicketRequest": {
Expand Down
8 changes: 8 additions & 0 deletions public/api-docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ definitions:
date:
type: string
description: ticket generate date
special:
type: boolean
description: is special ticket
pointOfSale:
type: string
description: ticket point of sale
Expand All @@ -296,6 +299,7 @@ definitions:
- purchaseOrderNumber
- amount
- date
- special
- pointOfSale
- taxRegistrationNumber
- trade
Expand Down Expand Up @@ -348,11 +352,15 @@ definitions:
date:
type: string
description: ticket generate date
special:
type: boolean
description: is special ticket
required:
- id
- purchaseOrderNumber
- amount
- date
- special
TicketRequest:
properties:
pointOfSale:
Expand Down

0 comments on commit 9971ff8

Please sign in to comment.