SharpRestoVRII: Difference between revisions
Line 24: | Line 24: | ||
== API == | == API == | ||
'''Menüü teenus'''<br> | |||
'''''GET api/menu'''''<br> | |||
Tagastab kõik menuitemid menüü vaate jaoks<br> | |||
Parameetrid: | |||
<source> | |||
id (valikuline) | |||
</source> | |||
Väljund: | |||
<source> | |||
{ | |||
"MenuItem": | |||
[{ | |||
"Id": 3, | |||
"Name": "Pelmeenid", | |||
"Description": "Venepärased isetehtud pelmeenid", | |||
"Available": 1, | |||
"Spice": 1, | |||
"ItemType": [{ | |||
"id": 4, | |||
"Type": "Starter" | |||
}], | |||
"ItemPrices": [{ | |||
"Id": 8, | |||
"Price": 6.5, | |||
"Active": 1, | |||
"StartDate": "2018-01-05 14:03:07", | |||
"EndDate": null | |||
}], | |||
"ItemIngredients": [{ | |||
"id": 2, | |||
"Name": "Jahu" | |||
}, | |||
{ | |||
"id": 5, | |||
"Name": "Hakkliha" | |||
}] | |||
}, | |||
{ //menuitem 2 }, | |||
{ //menuitem 3 } | |||
]} | |||
</source> | |||
'''''POST api/menu/'''''<br> | |||
Loob uue menuItem’i<br> | |||
Body: | |||
<source> | |||
{ | |||
//new MenuItem object | |||
} | |||
</source> | |||
Väljund: | |||
<source> | |||
{ | |||
“Success”: true, | |||
“Message”: null, | |||
“Data”: null | |||
} | |||
</source> | |||
'''''PUT api/menu/{id}'''''<br> | |||
Muudab olemasolevat menuItem’it<br> | |||
Body: | |||
<source> | |||
{ | |||
// changed MenuItem object | |||
} | |||
</source> | |||
Väljund: | |||
<source> | |||
{ | |||
“Success”: true, | |||
“Message”: null, | |||
“Data”: null | |||
} | |||
</source> | |||
'''Tellimuste teenus'''<br> | |||
'''''GET api/orders'''''<br> | |||
Tagastab kõik tellimused, vaikimisi filter on otsustamisel<br> | |||
Parameetrid: | |||
<source> | |||
status (valikuline) | |||
table (valikuline) | |||
startDate (valikuline) | |||
endDate (valikuline) | |||
</source> | |||
Väljund: | |||
<source> | |||
{ | |||
[{order1 object}, {order2 object}] | |||
} | |||
</source> | |||
'''''GET api/orders/{id}'''''<br> | |||
Tagastab valitud tellimuse<br> | |||
Väljund: | |||
<source> | |||
{ | |||
Id: <id>, | |||
MenuItem: {menuItem object}, | |||
Status: <new|ready|served|complete> | |||
Table: <table> | |||
} | |||
</source> | |||
'''''POST api/orders'''''<br> | |||
Loob uue tellimuse<br> | |||
Body: | |||
<source> | |||
{ | |||
menuItemId: <menuitem_id>, | |||
tableId: <table_id>, | |||
course: <?>, | |||
clientComment: <comment> | |||
} | |||
</source> | |||
Väljund: | |||
<source> | |||
{ | |||
success: <true|false> | |||
message: <info> | |||
result: {orderItem object} | |||
} | |||
</source> | |||
'''''PUT api/orders/{id}'''''<br> | |||
Muudab tellimust (üldine)<br> | |||
Body: | |||
<source> | |||
{ | |||
menuItemId: <menuitem_id>, | |||
tableId: <table_id>, | |||
course: <?>, | |||
status: <status>, | |||
clientComment: <comment> | |||
} | |||
</source> | |||
Väljund: | |||
<source> | |||
{ | |||
success: <true|false> | |||
message: <info> | |||
result: {orderItem object} | |||
} | |||
</source> | |||
'''''PUT api/orders/setStatus/{id}'''''<br> | |||
Muudab vaid tellimuse staatust<br> | |||
Body: | |||
<source> | |||
{status: <status>} | |||
</source> | |||
Väljund: | |||
<source> | |||
{ | |||
success: <true|false> | |||
message: <info> | |||
result: {orderItem object} | |||
} | |||
</source> | |||
'''Arvete teenus'''<br> | |||
Lõpetatud/serveeritud tellimuste salvestamine arveteks.<br> | |||
Hilisem arvete küsimine.<br> | |||
'''''GET api/bills'''''<br> | |||
Parameetrid: | |||
<source> | |||
status (valikuline) | |||
table (valikuline) | |||
startDate (valikuline) | |||
endDate (valikuline) | |||
waiter (valikuline) | |||
</source> | |||
'''''GET api/bills/{id}'''''<br> | |||
Tagastab ühe arve id alusel. | |||
== Ajalogi == | == Ajalogi == | ||
TBD | TBD |
Revision as of 17:29, 1 April 2018
Meeskond
- Andres Aava
- Henri Annilo
- Jaan Koolmeister
- Lauri Üksti
Lähtekood
TBD
Tehnoloogia
Server: ASP.NET Core 2.0
Klient: WPF
DB: SQL Server (Azure)
Ülevaade
Tegemist on SharpResto jätkuprojektiga.
Eesmärk on luua restoranihalduse teenus
- kasutaja saab pärida, lisada ja muuta menüü komponente
- kasutaja saab pärida, lisada ja muuta esitatud tellimusi
- kasutaja saab pärida statistikat tellimuste kohta
- eri teenuste ligipääs on piiratav kasutaja- ning grupipõhiselt
- staatiline informatsioon hoitakse serveri vahemälus
API
Menüü teenus
GET api/menu
Tagastab kõik menuitemid menüü vaate jaoks
Parameetrid:
id (valikuline)
Väljund:
{
"MenuItem":
[{
"Id": 3,
"Name": "Pelmeenid",
"Description": "Venepärased isetehtud pelmeenid",
"Available": 1,
"Spice": 1,
"ItemType": [{
"id": 4,
"Type": "Starter"
}],
"ItemPrices": [{
"Id": 8,
"Price": 6.5,
"Active": 1,
"StartDate": "2018-01-05 14:03:07",
"EndDate": null
}],
"ItemIngredients": [{
"id": 2,
"Name": "Jahu"
},
{
"id": 5,
"Name": "Hakkliha"
}]
},
{ //menuitem 2 },
{ //menuitem 3 }
]}
POST api/menu/
Loob uue menuItem’i
Body:
{
//new MenuItem object
}
Väljund:
{
“Success”: true,
“Message”: null,
“Data”: null
}
PUT api/menu/{id}
Muudab olemasolevat menuItem’it
Body:
{
// changed MenuItem object
}
Väljund:
{
“Success”: true,
“Message”: null,
“Data”: null
}
Tellimuste teenus
GET api/orders
Tagastab kõik tellimused, vaikimisi filter on otsustamisel
Parameetrid:
status (valikuline)
table (valikuline)
startDate (valikuline)
endDate (valikuline)
Väljund:
{
[{order1 object}, {order2 object}]
}
GET api/orders/{id}
Tagastab valitud tellimuse
Väljund:
{
Id: <id>,
MenuItem: {menuItem object},
Status: <new|ready|served|complete>
Table: <table>
}
POST api/orders
Loob uue tellimuse
Body:
{
menuItemId: <menuitem_id>,
tableId: <table_id>,
course: <?>,
clientComment: <comment>
}
Väljund:
{
success: <true|false>
message: <info>
result: {orderItem object}
}
PUT api/orders/{id}
Muudab tellimust (üldine)
Body:
{
menuItemId: <menuitem_id>,
tableId: <table_id>,
course: <?>,
status: <status>,
clientComment: <comment>
}
Väljund:
{
success: <true|false>
message: <info>
result: {orderItem object}
}
PUT api/orders/setStatus/{id}
Muudab vaid tellimuse staatust
Body:
{status: <status>}
Väljund:
{
success: <true|false>
message: <info>
result: {orderItem object}
}
Arvete teenus
Lõpetatud/serveeritud tellimuste salvestamine arveteks.
Hilisem arvete küsimine.
GET api/bills
Parameetrid:
status (valikuline)
table (valikuline)
startDate (valikuline)
endDate (valikuline)
waiter (valikuline)
GET api/bills/{id}
Tagastab ühe arve id alusel.
Ajalogi
TBD