Digital Cards
List of all routes:
- Creates Digital Card
- Connect digital card
- Insert Guest Code
- Add product in digital card
- Change state
- Change State to Locked
- Change Payment State
- Get Digital Card info
- Calculate Total
Creates Digital Card
- POST https://nite-apigateway.herokuapp.com/nightClub/digitalCards - Creates one digital card and connect it with phisical card.
Requires token in header (Bearer token) from employee.
req.body = {
idfcard : String,
sex: String (optional)
}
Connect digital card
- POST https://nite-apigateway.herokuapp.com/nightClub/digitalCards/connect - Creates a connection between user and digital card.
Requires token in header (Bearer token) from consumer.
req.body = {
idfcard : String,
}
Insert Guest Code
- POST https://nite-apigateway.herokuapp.com/nightClub/digitalCards/guestCode - Insert guest code in one digital card.
Requires token in header (Bearer token) from consumer.
req.body = {
idDcard : String,
idEstablishment: String,
guest_code: String
}
Add product in digital card
- POST https://nite-apigateway.herokuapp.com/nightClub/digitalCards/product - Add product in digital card.
Requires token in header (Bearer token) from employee.
req.body = {
idDcard: String,
idProduto: String,
nome: String,
preço: Number,
categoria: String
}
Change State
- PUT localhost:3000/nightClub/digitalCards/cardState - Change digital card status
Requires token.
req.body = {
idEstablishment: String
idDcard : String
}
Change State to Locked
- PUT localhost:3000/nightClub/digitalCards/cardState/Locked - Change digital card status to Locked
Requires token from employee.
req.body = {
idDcard : String
}
Change Payment State
- PUT localhost:3000/nightClub/digitalCards/cardPayment - Change Digital Card Payment Status
Requires token from employee (or manager)
req.body = {
idDcard: String
}
Get Digital Card info
GET https://nite-apigateway.herokuapp.com/nightClub/digitalCards - Get digital card info.
FOR CONSUMER:
Requires token in header (Bearer token) from consumer. Sends info in query.params (iddcard and idNightClub):
/digitalCards?iddcard=XXXX&idNightClub=YYYY
FOR EMPLOYEE
Requires token in header (Bearer token) from employee. Sends info in query.params (iddcard):
/digitalCards?iddcard=XXXX
Calculate total
- GET https://nite-apigateway.herokuapp.com/nightClub/digitalCards/total - Calculate total.
Requires token from consumer.
Sends info in query.params (iddcard and idNightClub): /digitalCards/total?idNightClub=XXXX&iddcard=YYYY