arch-atlas

Order Model + Sub-entities

models/order.dart · Order, OrderItem, OrderAddress, OrderCustomer, SplitOrderPayment

domain

Overview

Unified Order shape that absorbs both the Medusa /store/orders response and the seller /vendor/orders response. Customer-facing fields (sellerName/Phone/Photo, startTime/endTime, shipping methods) sit alongside seller-facing fields (customer block, splitOrderPayment).

User Flow

  1. Order.fromJson reads the Medusa payload and conditionally populates customer + splitOrderPayment when those keys exist (seller response).
  2. OrderItem nests variant info needed by OrderCard.
  3. OrderAddress carries shipping + billing addresses.
  4. SplitOrderPayment surfaces status / authorized / captured / refunded for seller-side UIs.
  5. displayIdFormatted formats the human-readable id used in logs and the receipt.

Cases & Edge Cases

  • fromJson is intentionally lenient — parse errors on a single order are caught upstream (in OrderService) and that order is dropped from the list rather than aborting the whole load.
  • Seller payload includes product_type='provision' on items which the UI can use to differentiate physical vs booking orders.
  • Some customer-side fields (seller info, startTime/endTime) are derived from order metadata.slot — null is normal for non-booking orders.

Code References

  • lib/src/features/shared/orders/models/order.dart:3 // Order
  • lib/src/features/shared/orders/models/order.dart // OrderItem / OrderAddress / OrderCustomer / SplitOrderPayment

API Calls

Empty — fill this in later. Open the manifest and add content here.

Notes

The CLAUDE.md inside this feature folder documents the seller-orders rollout plan — keep new fields in fromJson tolerant of both response shapes.