Tangram FOOD services, version: 1.09

Datove typy:
--------------------------------------------------------
String		dlzka moze byt <0,2147483647>
Boolean		hodnoty su true alebo false
Integer 	cele cislo, <-2147483648,2147483647>
Long		cele cislo, <-2^63,2^63-1>
Decimal		desatinne cislo, desatinna ciarka je znak '.'
Date		datum formatu yyyy-MM-dd
Time		datum a cas formatu yyyy-MM-dd HH:mm:ss
List		viacnasobne opakovanie struktur, CAN NULL znamena ze nemusi byt ziadna, NOT NULL znamena ze vzdy aspon jedna


Poziadavky:
--------------------------------------------------------
info
canteens?client={string}&pswd={string}
meals.actual?client={string}&pswd={string}&canteen={string}
meals.delivery?client={string}&pswd={string}&canteen={string}
meals.exchange?client={string}&pswd={string}&canteen={string}
meals.menu?client={string}&pswd={string}&canteen={string}
menu?client={string}&pswd={string}&date={yyyy-mm-dd}&canteen={string}&meal={string}[&pid={string}]
customer?client={string}&pswd={string}&(pid={string}|card={string})
customer.sale?client={string}&pswd={string}&(pid={string}|card={string})&[dateForLimits={yyyy-mm-dd}]
cards.lock?client={string}&pswd={string}&pid={string}&notice={string}
orders.all?client={string}&pswd={string}&pid={string}[&date={yyyy-mm-dd}][&canteen={string}][&meal={string}]
orders.actual?client={string}&pswd={string}&pid={string}
orders.delivery?client={string}&pswd={string}&pid={string}&date={yyyy-mm-dd}&canteen={string}&meal={string}
orders.exchange?client={string}&pswd={string}&pid={string}&date={yyyy-mm-dd}&canteen={string}&meal={string}
order.new?client={string}&pswd={string}&date={yyyy-mm-dd}&pid={string}[&card={string}]&canteen={string}&meal={string}&price={decimal}[&pa={int}][&pb={int}][&pc={int}][&pd={int}][&pe={int}][&pf={int}][&delivered={boolean}]
order.storno?client={string}&pswd={string}&id={string}
order.exchange.on?client={string}&pswd={string}&id={string}
order.exchange.off?client={string}&pswd={string}&id={string}
order.exchange?client={string}&pswd={string}&id={string}&pid={string}&price={decimal}[&card={string}]
order.deliver?client={string}&pswd={string}&id={string}
account?client={string}&pswd={string}&pid={string}?year={int}?month={int}
remains?client={string}&pswd={string}&date={yyyy-mm-dd}&canteen={string}&meal={string}
credit?client={string}&pswd={string}&device={string}&date={yyyy-mm-dd}[&time={hh:mm}]&pid={string}[&card={string}][&department={string}][&docid={string}]&amount={number}
payment?client={string}&pswd={string}&device={string}&date={yyyy-mm-dd}[&time={hh:mm}]&pid={string}[&card={string}][&department={string}][&docid={string}]&amount={number}&amountFull={number}&amountSubvence={number}&sa={int}&sb={int}&sc={int}&sd={int}&se={int}&sf={int}
survey.questions?client={string}&pswd={string}
survey.reply?client={string}&pswd={string}&code={string}&reply={string}&pid={string}


Struktury:
--------------------------------------------------------
<info>
Decimal	version		NOT NULL verzia REST rozhrania
Time	time		NOT NULL aktualny datum a cas
Boolean	exchangeEnabled	NOT NULL true ak je povolená burza



<canteen>
String	code		NOT NULL kod jedalne
String	name		CAN NULL nazov jedalne
Boolean	mandatory	NOT NULL true ak su zavazne objednavky



<meal>
String	code		NOT NULL kod druhu vydaja
String	name		CAN NULL nazov druhu vydaja
String	notice		CAN NULL popis z jedalneho listka
Date	date		NOT NULL datum jedalneho listka
Boolean actual		NOT NULL true ak je vydaj aktualny
Boolean	closed		NOT NULL true ak je po uzavierke
Boolean	finished	NOT NULL true ak je ukoncene vydavanie
Integer	minutesStart	NOT NULL o ktorej zacina vydaj jedla
Integer	minutesEnd	NOT NULL o ktorej konci vydaj jedla
Integer	minutesClose	NOT NULL o ktorej zacina uzavierka
Integer	dayClose	NOT NULL kolko dni dopredu je uzavierka



<menu>
String	notice		CAN NULL popis z jedalneho listka, to iste co Meal.notice
Limits	limits		CAN NULL limity pre zadane osobne cislo, NULL ak pri nacitavani jedalneho listka nebolo zadane PID
List	Row		NOT NULL polozky menu

<menu><row>
String	pxCode		NOT NULL PX kod, jeden zo znakov A,B,C,D,E,F
String	pxName		CAN NULL nazov pre dany PX kod
Boolean	pxRequired	NOT NULL true ak je jedlo povinne
Integer	number		NOT NULL cislo menu
String	code		CAN NULL kod polozky, podla tohto kodu je mozne vyhladat obrazok
String	name		CAN NULL nazov polozky
String	description	CAN NULL popis polozky
String	allergens	CAN NULL alergeny polozky
Decimal	priceFull	CAN NULL nedotovana cena, NULL nenajdena cena v cenovej skupine pre nedototovane jedla
Decimal	priceSubvenced	CAN NULL dotovana cena, ak dotovana cena neexistuje, tak null, polozka sa nemoze predat ako dotovana
Integer	remains		NOT NULL 0:nie je mozne objednat, -1:neobmedzene, 1....N:zostavajuce porcie



<customer> sluzba customer
NOT NULL plati len ak karta nie je UNATTACHED, ak je UNATTACHED, tak je nastavene len PID a vsetky polozky su NULL
string	card	 	 	CAN NULL kod karty ak sa hladalo podla karty
String	pid		 	NOT NULL osobne cislo, ak je karta nepridelena tak obsahuje UNATTACHED
String	name		 	CAN NULL meno
String	department	 	CAN NULL kod strediska
String	departmentName	 	CAN NULL nazov strediska
String	canteen		 	CAN NULL predvolená jedáleň
String	publicMsg	 	CAN NULL verejna poznamka
String	accountType	 	NOT NULL typ uctu, K:kredit, D:debet, C:cash (zatial nepodporovane)
Boolean	orderingSelf	 	NOT NULL true ak je povolene objednavanie pre seba
Boolean	orderingOthers	 	NOT NULL true ak je povolene objednavanie pre druhych
Date	validFrom	 	CAN NULL datum od kedy je ucet platny, ak je NULL tak ucet nie je platny
Date	validTo		 	CAN NULL datum od kedy je ucet platny, ak je NULL tak je platnost neobmedzena
string	censkupFull	 	CAN NULL cenova skupina pre nedotovane jedla
string	censkupSubvence	 	CAN NULL cenova skupina pre dotovane jedla
string	censkupSale	 	CAN NULL cenova skupina pre predaj tovarov, pridane 14.01.2019 pre PCKASU
Decimal	limitAmountDay	 	NOT NULL nastaveny limit na ucte
Decimal	limitAmountMonth 	NOT NULL nastaveny limit na ucte
Integer	limitCountSubvenceDay	NOT NULL nastaveny limit na ucte
Integer	limitCountSubvenceMonth	NOT NULL nastaveny limit na ucte



<customer> sluzba customer.sale
NOT NULL plati len ak invalid je NULL, ak nie je NULL, tak je nastavene len card, ak bolo hladanie podla karty a pid ak bolo hladanie podla PID
string	invalid	 		CAN NULL moze obsahovat string "CARD UNKNOWN"|"CARD UNATTACHED"|"CARD LOCKED"|"PID UNKNOWN"
string	card	 		CAN NULL kod karty ak sa hladalo podla karty
String	pid			NOT NULL osobne cislo
String	name			CAN NULL meno
String	department		CAN NULL kod strediska
String	departmentName		CAN NULL nazov strediska
String	canteen			CAN NULL predvolená jedáleň
String	publicMsg		CAN NULL verejna poznamka
String	accountType		NOT NULL typ uctu, K:kredit, D:debet, C:cash (zatial nepodporovane)
Boolean	orderingSelf		NOT NULL true ak je povolene objednavanie pre seba
Boolean	orderingOthers		NOT NULL true ak je povolene objednavanie pre druhych
Date	validFrom		CAN NULL datum od kedy je ucet platny, ak je NULL tak ucet nie je platny
Date	validTo			CAN NULL datum od kedy je ucet platny, ak je NULL tak je platnost neobmedzena
string	censkupFull		CAN NULL cenova skupina pre nedotovane jedla
string	censkupSubvence		CAN NULL cenova skupina pre dotovane jedla
string	censkupSale		CAN NULL cenova skupina pre predaj tovarov, pridane 14.01.2019 pre PCKASU
Decimal	limitAmountDay		NOT NULL nastaveny limit na ucte
Decimal	limitAmountMonth	NOT NULL nastaveny limit na ucte
Integer	limitCountSubvenceDay	NOT NULL nastaveny limit na ucte
Integer	limitCountSubvenceMonth	NOT NULL nastaveny limit na ucte
Limits	limits			CAN NULL limity pre zadane osobne cislo a zadany den, ak sa pozadovalo nacitanie limitov



<limits>
Time	lastTransactionMonth	CAN NULL datum a cas poslednej transakcie v mesiaci
Decimal amountMonth		NOT NULL cerpanie za dany mesiac
Decimal	limitAmountDay		NOT NULL zostavajuci denny financny limit
Decimal	limitAmountMonth	NOT NULL zostavajuci mesacny financny limit
Integer	drawingMonthA		NOT NULL cerpanie jedla A za dany mesiac
Integer	limitA			NOT NULL pocet jedal ktore je este mozne kupit za dotovanu cenu pre px A
Integer	limitB			NOT NULL pocet jedal ktore je este mozne kupit za dotovanu cenu pre px B
Integer	limitC			NOT NULL pocet jedal ktore je este mozne kupit za dotovanu cenu pre px C
Integer	limitD			NOT NULL pocet jedal ktore je este mozne kupit za dotovanu cenu pre px D
Integer	limitE			NOT NULL pocet jedal ktore je este mozne kupit za dotovanu cenu pre px E
Integer	limitF			NOT NULL pocet jedal ktore je este mozne kupit za dotovanu cenu pre px F
Integer claimTransfer		CAN NULL prenos narokov z tabulky SU_NAROKY


<order>
NOT NULL plati len pre vytvorenu objednavku, ak sa nacitava zoznam objednavok, tak to nemusi platit, sql tabulka nema nastavene NOT NULL
String	id		CAN NULL identifikator objednavky, NULL je len pre poziadavku order.exchange.get
Date	date		NOT NULL datum objednavky
String	pid		NOT NULL PID objednavky
String	name		CAN NULL meno
String	canteenCode	NOT NULL kod jedalne
String	canteenName	CAN NULL nazov jedalne
String	mealCode	NOT NULL kod druhu vydaja
String	mealName	CAN NULL nazov druhu vydaja
Decimal	price		NOT NULL suma objednavky
String	transaction	CAN NULL null ak nebola zaplatena kartou
Boolean	storno		NOT NULL true ak stornovana
Boolean	exchange	NOT NULL true ak v burze
Boolean	delivered	NOT NULL true ak vydana
Boolean	ordering	NOT NULL true ak je povolene objednavanie pre pouzity druh vydaja a datum
List	Row		NOT NULL riadky objednavky

<order><row>
NOT NULL plati len pre vytvorenu objednavku, ak sa nacitava zoznam objednavok, tak to nemusi platit, sql tabulka nema nastavene NOT NULL
String	pxCode		NOT NULL PX kod, jeden zo znakov A,B,C,D,E,F
String	pxName		CAN NULL nazov pre dany PX kod
Integer	number		NOT NULL cislo menu
String	code		CAN NULL kod polozky, podla tohto kodu je mozne vyhladat obrazok
String	name		CAN NULL nazov polozky
String	description	CAN NULL popis polozky
String	allergens	CAN NULL alergeny polozky
Decimal	price		NOT NULL cena polozky



<account>
Decimal	begin		NOT NULL pociatocny stav
Decimal	credit		NOT NULL suma dobita kreditov
Decimal	payment		NOT NULL suma platieb
Decimal	end		NOT NULL koncovy stav
List	Subtotal	CAN NULL medzisucty za druh transakcie, len tie druhy ktore maju pohyb
List	Transaction	CAN NULL pohyby na ucte

<account><subtotal>
String	kindCode	NOT NULL druh transakcie P:PC Kasa, O:objednavka, R:prenos, K:dobitie, V:vending
String	kindName	NOT NULL nazov druhu transakcie
Decimal	amount		NOT NULL suma

<account><transaction>
Time	time		NOT NULL datum a cas vykonania transakcie
String	card		CAN NULL kod karty ak bol transakcia vykonana kartou
String	kindCode	NOT NULL druh transakcie P:PC Kasa, O:objednavka, R:prenos, K:dobitie, V:vending
String	kindName	NOT NULL nazov druhu transakcie
String	canteenCode	CAN NULL kod jedalne
String	canteenName	CAN NULL nazov jedalne
String	mealCode	CAN NULL kod druhu vydaja
String	mealName	CAN NULL nazov druhu vydaja
Decimal	price		NOT NULL suma
Boolean	storno		NOT NULL true ak stornovana



<remain>
String	pxCode		NOT NULL PX kod, jeden zo znakov A,B,C,D,E,F
Integer	number		NOT NULL cislo menu
String	name		CAN NULL nazov polozky
Integer	orderCount	NOT NULL celkovy pocet objednavok
Integer	orderRemain	NOT NULL pocet nevydanych objednavok
Integer	freeCount	NOT NULL celkovy pocet volnych jedal
Integer	freeRemain	NOT NULL pocet zostavajucich volnych jedal



<question>
String code		NOT NULL kod otazky
String title		CAN NULL skrateny interny nazov
String text		NOT NULL text otazky
String type		NOT NULL jeden z definovanych typov moznosti odpovede




Priklady:
--------------------------------------------------------
http://localhost:8080/tangram/food/info

http://localhost:8080/tangram/food/canteens?client=TEST&pswd=***

http://localhost:8080/tangram/food/meals.menu?client=TEST&pswd=***&canteen=HLAVNA
http://localhost:8080/tangram/food/meals.exchange?client=TEST&pswd=***&canteen=HLAVNA

http://localhost:8080/tangram/food/menu?client=TEST&pswd=***&date=2017-04-12&canteen=HLAVNA&meal=OBED
http://localhost:8080/tangram/food/menu?client=TEST&pswd=***&date=2017-04-12&canteen=HLAVNA&meal=OBED&pid=127

http://localhost:8080/tangram/food/customer?client=TEST&pswd=***&pid=001
http://localhost:8080/tangram/food/customer?client=TEST&pswd=***&card=123456

http://localhost:8080/tangram/food/orders.actual?client=TEST&pswd=***&pid=001
http://localhost:8080/tangram/food/orders.exchange?client=TEST&pswd=***&date=2017-04-12&canteen=HLAVNA&meal=OBED

http://localhost:8080/tangram/food/order.new?client=TEST&pswd=***&date=2017-04-12&pid=001&canteen=HLAVNA&meal=RAN&price=2.3&pa=1
http://localhost:8080/tangram/food/order.new?client=TEST&pswd=***&date=2017-04-12&pid=001&canteen=HLAVNA&meal=OBED&price=2.3&pa=1&pb=2&pf=3
http://localhost:8080/tangram/food/order.new?client=TEST&pswd=***&date=2017-04-12&pid=001&card=ABCDEF&canteen=HLAVNA&meal=OBED&price=2.3&pa=1&pb=2&pf=3
http://localhost:8080/tangram/food/order.new?client=TEST&pswd=***&date=2017-04-12&pid=001&canteen=TERASA&meal=VECERA&price=2.3&pa=1&pc=3

http://localhost:8080/tangram/food/order.storno?client=TEST&pswd=***&id=123456789

http://localhost:8080/tangram/food/order.exchange.on?client=TEST&pswd=***&id=123456789
http://localhost:8080/tangram/food/order.exchange.off?client=TEST&pswd=***&id=123456789
http://localhost:8080/tangram/food/order.exchange.get?client=TEST&pswd=***&id=123456789&pid=002
http://localhost:8080/tangram/food/order.exchange?client=TEST&pswd=***&id=123456789&pid=002&price=2.3
http://localhost:8080/tangram/food/order.exchange?client=TEST&pswd=***&id=123456789&pid=002&price=2.3&card=ABCDEF

http://localhost:8080/tangram/food/order.deliver?client=TEST&pswd=***&id=123456789

http://localhost:8080/tangram/food/account?client=TEST&pswd=***&pid=001&year=2017&month=3

http://localhost:8080/tangram/food/survey.questions?client=TEST&pswd=***
http://localhost:8080/tangram/food/survey.reply?client=TEST&pswd=***&code=123456&reply=1&pid=001