arch-atlas

Service Models

services/services_model.dart + service_details_model.dart + add-prestation/model/*

domain

Overview

Three layers of model: SellerService (list-row slice), ServiceDetail (full detail with options/variants/policy/metadata), and the add-prestation form state (CreatePrestationState + ProvisionPriceTier + CancellationRule).

User Flow

  1. SellerService is constructed from Product (mapped down inside SellerServicesController.fetch).
  2. ServiceDetail bundles options, variants, BookingPolicy and product metadata for the seller-side detail screen.
  3. BookingPolicy (deposit %, maxCancellationDelayHours, rules[]) is loaded alongside the product in PrestationDetailController.
  4. Add-prestation form has its own state with parsed fields (parsedDepositPercentage, apiCancellationRules) for the submit payload.

Cases & Edge Cases

  • Older provisions may have no policy — getBookingPolicy can return null and ServiceDetail.bookingPolicy stays null.
  • Variants count is exposed at the list level so cards can show '4 prices configured' without hydrating each variant.
  • Member schedule is part of the model spec (see CLAUDE.md) but is not yet wired into ServiceDetail.

Code References

  • lib/src/features/seller/services/services_model.dart // SellerService
  • lib/src/features/seller/service_details/service_details_model.dart // ServiceDetail / BookingPolicy / CancellationRule
  • lib/src/features/seller/add-prestation/model/add_prestation_model.dart // CreatePrestationState
  • lib/src/features/seller/services/model/booking_policy.dart

API Calls

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

Notes

Two CLAUDE.md files in service_details/ and add-prestation/ document the missing-policy gap that has since been partially filled — keep them up to date as you finish the work.