Skip to content

feat(orders): order history and receipts - #76

Merged
roncodes merged 1 commit into
release/v0.1.0from
feat/order-history
Oct 7, 2026
Merged

roncodes merged 1 commit into
release/v0.1.0from
feat/order-history

Conversation

@roncodes

@roncodes roncodes commented Oct 6, 2026

Copy link
Copy Markdown
Member

Stacked on #75. Redesigns order history and the receipt.

Order history

  • Orders in progress are pinned on top. Each shows the store, its status, what was ordered, and a Track order button (View pickup details for pickup orders).
  • Past orders are listed newest first. Each row shows:
    • the store, an item preview ("Bananas, 2× Milk 1L and 2 more"), date, item count and total;
    • a receipt shortcut;
    • a Canceled badge on cancelled orders.
  • More orders load as you scroll, 20 at a time via offset, which the customer orders endpoint already supports. Pull to refresh works too.
  • The first page is still cached on the device (same key as before), so the list and the account screen's active order show instantly. The list refetches after a new order is placed, as before.
  • It has a loading skeleton, an empty state with Start shopping, and error states with retry for both the first page and later pages.

Receipt

  • Every order now has a receipt. Before, only QPay orders did. It shows:
    • store, order number, date and status;
    • items with their variants, add-ons and booking times;
    • subtotal, delivery fee, tips, each applied promotion code and the total;
    • how it was paid, and the delivery or pickup address with notes.
  • It can be shared as plain text. The share button is hidden on web browsers without the Web Share API.
  • QPay orders keep the e-barimt tax receipt (QR code, lottery number, tax amounts, merchant details) as a section of the receipt. It uses the recorded receipt when there is one, and otherwise requests it as before.
  • It opens from a full order or just an orderId, loading the order when needed.
  • Tracking's View receipt now appears for every order.

Other

  • src/commerce/order-summary.ts is a pure module that turns the order resource into what these screens need. It is fully covered by tests, including the shared receipt text.
  • Fix from feat(account): phone sign-in, code verification and the account screen #75: the account screen treated cancelled orders as active, because orderProgress().finished is false for cancelled orders. It now uses the summary's active flag.
  • The old order history and receipt screens are removed. Route names and screen ids are unchanged.
  • Orders and Receipt strings added in English, Mongolian and Ukrainian.

Checks

  • yarn jest: 208 passing.
  • yarn typecheck:strict and yarn lint:strict pass with no errors.
  • Checked on web at phone width, using a test customer and a mocked history response:
    • history with an in-progress order, a cancelled order and past orders;
    • the empty state;
    • a delivered card receipt with a promotion and notes;
    • a QPay pickup receipt with the e-barimt section and its QR code.
  • Two web problems found and fixed along the way:
    • the in-progress card nested a button inside a button;
    • the list's empty-state slot crashed on web when given a Tamagui stack, so it now uses a plain view, as the notifications screen already does.

- Order history pins orders in progress (with a track button) above past
  orders, shows what was ordered, the date, item count and total, and
  marks canceled orders. Pages load as you scroll; the first page is kept
  on the device so the list opens instantly. Loading, empty and error
  states included.
- Every order now has a receipt, not just QPay ones: store, reference,
  items with their options and bookings, each charge, promotions, total,
  how it was paid and where it went. It can be shared as text. QPay
  orders keep the e-barimt tax receipt as a section.
- Tracking links to the receipt for every order.
- Account: canceled orders no longer show as the active order.
Base automatically changed from feat/account to release/v0.1.0 October 7, 2026 05:45
@roncodes
roncodes merged commit 47aafb3 into release/v0.1.0 Oct 7, 2026
@roncodes
roncodes deleted the feat/order-history branch October 7, 2026 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant