Commit Graph

11 Commits

Author SHA1 Message Date
Mike Kell 595d0b5a93 feat(stage-11b): custom order intake UI
Adds the operator-facing intake flow for made-to-order commissions on top of
the Stage 11A domain and data layers. The form, validation, and confirmation
receipt all live in feature_orders, so web and mobile host the same widget
rather than forking business logic per platform.

Stage 11C still covers the tracking page, the status-change timeline, and
inventory deduction on completion.

Application:

- CreateCustomOrder and RecordDeposit use cases wrapping the repository
  methods added in Stage 11A, so presentation never assembles a custom order
  aggregate by hand. RecordDeposit deliberately accepts no payment identifier.
- CustomOrderFormController with field-keyed validation, so each input renders
  its own error rather than a single form-level message. Clock and ID
  generator are injected, which keeps created-at stamps and order IDs
  deterministic under test.
- All money is typed as text and converted to integer cents by
  parseMoneyToCents before it reaches DepositInfo, consistent with
  PaymentResult.amountCents. Thousands separators, currency symbols, excess
  precision, and negatives are rejected or normalised at the boundary. The
  only double is the derived OrderItem.unitPrice, computed once from cents.
- Derived balance clamps at zero rather than reporting a credit when a deposit
  exceeds the quoted total, matching DepositInfo.balanceDueCents.

Presentation:

- CustomOrderFormPage — sectioned intake (customer, specification, pricing and
  deposit, reference images) over the shared design-system widgets.
- CustomOrderConfirmationPage — order summary, spec rendering, and a deposit
  receipt showing amount, method, date, and balance only.
- FulfillmentStatusChip over the design-system KcStatusChip, covering all
  seven pipeline values.
- showReferenceImageDialog() plus ReferenceImageDialogResult with URL
  validation and de-duplication.
- OrdersPage gains an optional onCreateCustomOrder callback. When null the
  "New Custom Order" action is not rendered, so the page stays usable in hosts
  that have no intake route.

Hosts:

- kell_web: new /orders/custom route rendering CustomOrderFormPage inside
  AppShell, with ordersToCustomOrder() and customOrderToOrders() handoffs on
  AppNavigation. Confirmation returns to Orders pre-selecting the new order.
- kell_mobile: new MobileCustomOrderPage, a full-screen SafeArea host for the
  shared form, reached from an extended FAB on the orders list. Market intake
  is the primary custom-order use case, so mobile gets a dedicated route
  rather than an inline panel. The list reloads on return.

Privacy:

- The deposit receipt renders amount, method, date, and balance only. The
  transaction ID stays on PaymentResult and is asserted absent from the
  rendered confirmation by test. The controller holds no payment identifier at
  any point.

Deferred to Stage 11C, recorded in the Stage 11B section:

- Product-base selection from the catalogue; the form captures a free-text
  specification instead.
- Platform camera and file-picker capture for reference images; the dialog
  accepts validated URLs only.

Validation:

- 146 new tests: 82 on CustomOrderFormController (money parsing, setters,
  derived balance and clamping, reference image add/remove/dedupe, the full
  validation matrix, buildSpec mapping, submission, quoted vs. collected
  deposit, repository failure, duplicate ID, reset), 26 on the form page, 24
  on the confirmation page including the no-payment-identifier assertion, 3 on
  the OrdersPage entry point, 6 on MobileCustomOrderPage, and 5 on the web
  route.
- 2,044/2,044 passing across all 11 packages and apps, up from the 1,898
  baseline at 0e3987b, with no regression.
- dart analyze --fatal-infos clean across all packages and apps.
- dart format --line-length 100 clean on every file touched by this slice.

Test-harness note: the intake form is taller than the default 800x600 test
view, so the submit-button tests resize tester.view rather than working around
a layout defect. The page scrolls normally on device.

Toolchain note: kell_web/pubspec.lock picked up SDK-pinned transitive bumps on
flutter pub get (matcher 0.12.19 to 0.12.20, meta 1.18.0 to 1.19.0, test_api
0.7.11 to 0.7.12, vector_math 2.2.0 to 2.4.3). Same accepted class as the
kell_mobile bumps recorded under chore/state-reconciliation-flutter-347;
committed so the lock file matches the toolchain in use.

Closes: P2.2 (intake UI portion)
2026-09-25 15:45:04 -04:00
Mike Kell 92d83e00e2 chore: revert unrelated Flutter tool churn to analysis_options.yaml and pubspec.lock 2026-08-29 15:20:35 -04:00
Mike Kell a2354ccd36 chore: update tracker - feat/custom-order-domain merged to main (Stage 11A complete) 2026-08-29 15:20:19 -04:00
Mike Kell bda93640e4 feat(auth): Stage 8C - authentication foundation
- Add KcUser/KcUserRole domain models with copyWith, equality, toString
- Add AuthState sealed hierarchy (unauthenticated, loading, authenticated, error)
- Add AuthService abstract contract (signIn, signOut, refreshSession, stream)
- Add AuthException with optional HTTP statusCode
- Add CredentialStore abstract contract with CredentialKeys constants
- Add InMemoryCredentialStore implementation
- Add FakeAuthService with role-based sign-in simulation
- Add KcAppEnvironment.square to core enum with SQ label
- Add KcBootstrap square case (falls back to fake until Stage 10A)
- Update kell_web and kell_mobile shell environment badges for square case
- Add integrations dependency to kell_web and kell_mobile pubspec.yaml
- Add auth to run_all_tests.sh TESTABLE and ANALYZABLE lists
- Add 42 auth tests (42/42 passing)
- Add 1 new core test for square bootstrap fallback (21/21 passing)
- Update master_development_brief.md: Stage 8C complete, Stage 8 complete
- Total: 764/764 tests passing, dart analyze clean

Stage 8 (infrastructure package activation) is now complete.
Next: feat/wc-orders-integration (Stage 9A)
2026-07-11 08:48:18 -04:00
Mike Kell d36c2d1e73 feat(inventory): Stage 5A — inventory domain expansion with write actions 2026-07-10 18:33:02 -04:00
Mike Kell 65466ba513 feat(mobile): Stage 5A — Android app shell and bootstrap
Validate Docs / validate-docs (push) Successful in 3m31s Details
Flutter Analyze / Dart Analyze (push) Has been cancelled Details
Flutter Test / Flutter Tests (push) Has been cancelled Details
Replace default Flutter counter template in kell_mobile with a fully
integrated mobile operations platform shell reusing shared packages.

Mobile app shell:
- MobileAppServices extending KcAppServices with fake()/wp() factories
- KellMobileApp with KcAppScope<MobileAppServices>, KcTheme, env badge
- MobileShell with 5-tab NavigationBar (Dashboard, Inventory, Orders,
  Publishing, More) using IndexedStack for state preservation
- KcBootstrap entry point with --dart-define environment variables

Dashboard:
- DashboardSummary value object with fromData()/empty() constructors
- GetDashboardSummary use case aggregating inventory, orders, publishing
- DashboardController (ChangeNotifier) with loading/error/summary state
- MobileDashboardPage with GridView summary cards using design system
  widgets (KcSectionHeader, KcSummaryCard, KcEmptyState)

Placeholder pages:
- FinancePlaceholderPage, IntegrationsPlaceholderPage for More tab
- Feature tab pages delegate to shared feature presentation layers

Infrastructure:
- pubspec.yaml references all shared packages (core, design_system,
  feature_inventory, feature_orders, feature_policy, feature_wordpress)
- SDK constraint corrected from ^3.11.4 to ^3.11.0 across all 14
  pubspec.yaml files to match installed Dart SDK 3.11.3

Tests:
- 6 new kell_mobile widget tests: shell loading, summary cards,
  environment badge, navigation bar destinations, tab switching, More menu
- All existing tests remain passing (24/24 kell_web, 294/294
  feature_wordpress)

Documentation:
- master_development_brief.md: Stage 5A marked complete, next branch
  updated to feat/android-publishing-surface (Stage 5B), kell_mobile
  platform description updated
- build_execution_tracker.md: Stage 5A entry added with full file list
2026-05-28 19:10:14 -04:00
Mike Kell 7ab526f083 feat(wordpress): add real WooCommerce read-only product repository
Validate Docs / validate-docs (push) Successful in 1m9s Details
2026-04-04 15:14:38 -04:00
Mike Kell c2049e2c46 feat(policy): add policy governance workspace vertical slice
Validate Docs / validate-docs (push) Successful in 1m17s Details
2026-04-04 14:21:49 -04:00
Mike Kell 3330ed23b3 feat(orders): add orders workspace vertical slice
Validate Docs / validate-docs (push) Successful in 52s Details
2026-04-04 13:57:27 -04:00
Mike Kell 226b21d22d feat(products): add product publishing workspace vertical slice
Validate Docs / validate-docs (push) Successful in 50s Details
2026-04-04 13:13:26 -04:00
Mike Kell 59548cedbd Add Flutter app and package monorepo scaffold
Publish Docs / publish-docs (push) Successful in 59s Details
2026-04-04 09:19:46 -04:00