arch-atlas

Edit Provision Screen

service_details/edit_provision_screen.dart

presentation

Overview

Editable form for title, description, option label, and variant price tiers. Currently uses DioHelper directly for the product update; policy edit lives here too (POST upsertBookingPolicy).

User Flow

  1. Loads the existing ServiceDetail via prestationDetailProvider.
  2. Form fields preload from state; submit fires a PATCH-style POST to /vendor/products/{id}.
  3. Policy editor (deposit %, delay, rules list) submits via VendorService.upsertBookingPolicy after the product update succeeds.
  4. Falls back from /vendor/provisions/{id} to /vendor/products/{id} on 404 (older API path).

Cases & Edge Cases

  • Editing options that already have variants is risky — backend may reject if variant.value strings no longer match options.values.
  • Currency change is disabled in edit mode to prevent price-amount drift.
  • Photo upload reuses the same VendorService.uploadPublicFile helper as add-prestation.

Code References

  • lib/src/features/seller/service_details/edit_provision_screen.dart
  • lib/src/features/seller/service_details/widgets/edit_provision_widgets.dart

API Calls

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

Notes

Migrating the product update from DioHelper to VendorService is on the TODO list in service_details/CLAUDE.md.