Homework

Homework — an order at the table

Homework — an order that belongs to a table.

  1. 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.
  2. Scan. Run the app on a real phone, open Scan, allow the camera, point it at table:7. TableSession should become "7", and the screen jumps to the menu.
  3. Order. Add pizzas, place the order. In Logcat (or the backend) check the POST /orders body — it must contain "table_number": "7".
  4. Change table. Scan table:3, order again — a new order with "3". Log out — TableSession clears (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, PaymentSheet confirms the payment, and only then is the order recorded. The client never even touches card data.