arch-atlas

Sellers Data Source

DioHelper().get('/store/seller')

data

Overview

Direct DioHelper calls inside SellersNotifier — there is no dedicated SellersService class. /store/seller paginates by offset/limit and returns a count for pagination math.

User Flow

  1. DioHelper.get('/store/seller', queryParameters: { offset, limit })
  2. Response → SellersResponse.fromJson → state mutation.
  3. Each call carries authScope='customer'; clients can browse sellers, sellers can too.

Cases & Edge Cases

  • Backend counts include 'paused' / 'pending' sellers — the UI does not currently filter them out at fetch time.
  • Network errors surface as 'Something went wrong. Try again!' — generic message by design (no enumeration value).

Code References

  • lib/src/features/shared/search/providers/sellers_provider.dart:114 // DioHelper.get

API Calls

  • GET/store/seller?offset=:offset&limit=:limitno status

    Paginated list of sellers for the seller-handle search screen.

    Request
    Query: offset, limit
    Response
    { sellers: [{ id, name, handle, photo, store_status, trades: [...] }, ...], count }
    lib/src/features/shared/search/search.dart

    auth: customer. Called directly via DioHelper.get from SellersNotifier (no SellersService yet).

  • GET/store/seller/:handleno status

    Fetch a single seller's public detail page (profile + products + prestations + reviews).

    Response
    { seller: { id, name, handle, photo, ..., products, prestations, reviews } }
    lib/src/features/shared/search/screens/seller_detail_screen.dart

    auth: customer. Mapping may be by id depending on backend — sellerDetailProvider handles both.

Notes

Promoting these calls into a SellersService would let other features reuse them — today only the search screen consumes /store/seller.