Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/AndrewwCO/Panahashi/llms.txt

Use this file to discover all available pages before exploring further.

The cart in Panahashi is not local — it lives on the backend and is fetched fresh each time the user opens the app or logs in. This means the cart persists across devices and sessions. From the cart, users schedule a pickup time, choose a payment method, and place an order. On success, they receive a QR code to present at the bakery counter.

Your cart

CartScreen displays the current cart fetched from GET /cart. Each line item shows the product name, emoji, unit price, quantity controls, and line total. A floating footer shows the running total and the primary action button. The bottom navigation tab displays an itemCount badge so users always know how many items are waiting. Cart state is managed globally by CartContext, which exposes:
ValueTypeDescription
cartobject | nullFull cart object from the backend, including items, bakeryId, and bakeryName
addToCartfunctionAdds or increments a product in the cart
updateQtyfunctionUpdates item quantity; passing qty = 0 removes the item
clearCartfunctionEmpties the cart on the backend and resets local state
toApiItemsfunctionConverts cart items to the shape expected by createOrder
itemCountnumberTotal number of individual units across all items
totalstringCart total in COP, as a string with no decimals
The toApiItems() function used when placing an order:
const toApiItems = () =>
  (cart?.items || []).map(item => ({
    productId: item.productId,
    name:      item.name,
    price:     item.price,
    emoji:     item.emoji,
    qty:       item.qty,
  }));

Placing an order

1

Review cart

The user reviews items in CartScreen, selects a pickup time slot (09:00–13:00), chooses a payment method, and optionally adds special notes.
2

Confirm order

Tapping the confirm button calls createOrder(), which posts to POST /orders:
createOrder({ bakeryId, items, pickupTime, notes, paymentMethod, promotionId })
FieldTypeDescription
bakeryIdstringID of the bakery being ordered from
itemsarrayCart items from toApiItems()
pickupTimestringSelected pickup time in HH:mm format
notesstringOptional special instructions (e.g. allergen notes)
paymentMethodstringOne of CASH_ON_PICKUP, CREDIT_CARD, DEBIT_CARD, PSE
promotionIdstringOptional — ID of a promotion to apply to the order
3

Payment (card/PSE)

If the selected method is not CASH_ON_PICKUP, the user is sent to PaymentScreen to enter card details or confirm PSE. Cash orders skip this step entirely.
4

Confirmation

On success, OrderConfirmationScreen is shown with the order QR code and pickup time.

Viewing your orders

OrdersScreen fetches the user’s full order history via GET /orders/me with pagination. Orders are filterable by status:
  • In progress — orders with status PENDING, CONFIRMED, BAKING, or READY
  • All — the complete history including COMPLETED and CANCELLED
Each order card shows the order ID, bakery name, item list (up to 3 items shown inline), status badge, estimated ready time (if available), pickup time, and total. Tapping a card navigates to OrderDetailScreen, which fetches the full order from GET /orders/:id and also shows the QR code when the order status is CONFIRMED or READY.
Use the refresh control (pull down) on the Orders screen to sync the latest order status from the backend.

QR code confirmation

After a successful order, OrderConfirmationScreen renders a QR code using react-native-qrcode-svg. The QR value is the qrCode string returned by the backend in the order response. The QR code is presented at the bakery counter to verify and complete the pickup. The screen also displays:
  • Pickup time
  • Order total
  • A share button to send order details via native share sheet
  • Links to the Orders tab and Home screen

Build docs developers (and LLMs) love