arch-atlas

Seller Order Controller

SellerOrderController + cancelSellerOrderProvider

domain

Overview

Mirror of the customer controller but hitting /vendor/orders with the seller token. cancelSellerOrderProvider (FutureProvider.family<Order, String>) cancels an order then ref.invalidates the seller list to force a refresh.

User Flow

  1. build() returns OrderService.getSellerOrders() (no status filter by default).
  2. refreshOrders is the same loading→guard pattern as the customer controller.
  3. cancelSellerOrderProvider(orderId) → OrderService.cancelSellerOrder + ref.invalidate(sellerOrderControllerProvider).

Cases & Edge Cases

  • Cancellation is always allowed server-side (no policy gate) — UI must own the confirmation dialog.
  • After cancel, splitOrderPayment.status flips to 'refunded' — the screen should re-fetch the detail to reflect this.
  • Status query param is supported (getSellerOrders({status: 'pending'})) but the controller doesn't expose it yet — UI filters client-side.

Code References

  • lib/src/features/shared/orders/controllers/order_controller.dart:43 // SellerOrderController
  • lib/src/features/shared/orders/controllers/order_controller.dart:59 // sellerOrderControllerProvider
  • lib/src/features/shared/orders/controllers/order_controller.dart:65 // cancelSellerOrderProvider

API Calls

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

Notes

Seller endpoints are documented in lib/src/features/shared/orders/CLAUDE.md including the response shapes — keep that doc up to date when you add filters or actions.