Homework
Homework — an order at the table
Homework — an order that belongs to a table.
- Make a QR. With any generator, create a QR with the text
table:7(and another —table:3). Print it or show it on a screen. - Scan. Run the app on a real phone, open Scan, allow the camera, point it at
table:7.TableSessionshould become"7", and the screen jumps to the menu. - Order. Add pizzas, place the order. In Logcat (or the backend) check the
POST /ordersbody — it must contain"table_number": "7". - Change table. Scan
table:3, order again — a new order with"3". Log out —TableSessionclears (null).
Required tests:
- Permission test: the first time you open Scan, the camera dialog appears; if you deny, you see a message, not a black screen with no explanation.
- Context test: two different QRs → two orders with different
table_number.
To submit: screenshots: (1) the scan screen with the camera preview, (2) the POST /orders body with table_number.
Next. The order now has a table, but it's still unpaid. In lesson 11 we add Stripe payment (test mode): the server creates a
PaymentIntent,PaymentSheetconfirms the payment, and only then is the order recorded. The client never even touches card data.