arch-atlas

Prestation Detail Controller

service_details/service_details_provider.dart · family

domain

Overview

StateNotifier family keyed by serviceId. Fetches /vendor/products/{id}, parses options and variants, then attempts to load the matching booking policy from VendorService.

User Flow

  1. Constructor invokes fetch() immediately.
  2. fetch() GETs /vendor/products/{id}, parses options/variants, builds ServiceDetail.
  3. Then calls VendorService.getBookingPolicy(serviceId) and merges BookingPolicy if present.
  4. Errors during policy load are silently swallowed — policy is optional.

Cases & Edge Cases

  • Older provisions without a policy: getBookingPolicy can 404 — caught and treated as 'no policy yet'.
  • Per-key auto-dispose means visiting another service's detail does NOT invalidate the previous family entry — back/forward is instant up to the autoDispose timeout.
  • Parsing helpers (_parseOption, _parseVariant) tolerate missing fields — bad data renders an empty option/variant rather than crashing.

Code References

  • lib/src/features/seller/service_details/service_details_provider.dart:8 // prestationDetailProvider family
  • lib/src/features/seller/service_details/service_details_provider.dart:13 // PrestationDetailController
  • lib/src/features/seller/service_details/service_details_provider.dart:24 // DioHelper GET /vendor/products/{id}
  • lib/src/features/seller/service_details/service_details_provider.dart:49 // VendorService.getBookingPolicy

API Calls

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

Notes

Currently uses DioHelper directly for the product fetch and VendorService only for the policy — see service_details/CLAUDE.md for the migration plan.