@aptos-scp/scp-component-store-selling-features-domain-model 2.51.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -381,6 +381,58 @@ const coreStateModel = {
381
381
  ],
382
382
  uiBusinessEvents: [],
383
383
  },
384
+ {
385
+ /**
386
+ * State-agnostic catch-all for any TerminalControlTransaction
387
+ * in ctx. PEPS calls findLogicalStateName on every UI business event; if
388
+ * no matcher returns a name it throws SSC_PEPS_CANNOT_FIND_STATE_FOR_CONTEXT_ERROR_CODE
389
+ * which becomes UI_MODE_FATAL_ERROR -> FatalErrorScreen.
390
+ *
391
+ * During fresh-install boot DB sync, a redundant TerminalStateSync flow can leave
392
+ * a closed TerminalControlTransaction in ctx.transaction while a late
393
+ * LookupExchangeRatesEvent is still being processed. At the throw moment we
394
+ * captured: state="Closed", isOpen()=false, isWaitingToClose()=false,
395
+ * isClosing()=false, isClosed()=true. UserSession is also LoggedOff (pre-login).
396
+ *
397
+ * Unlike IN_TILL_CONTROL_TRANSACTION (which is a post-login operational state
398
+ * requiring loggedOn=true + isOpen=true), this matcher is purely a fallback to
399
+ * keep PEPS off the fatal path. fieldMatchers like isOpen=true or loggedOn=true
400
+ * would miss the actual race window. fieldMatchers:[] makes the matcher match
401
+ * any state of a TerminalControlTransaction in ctx.
402
+ *
403
+ * Pairs with a same IN_TERMINAL_CONTROL_TRANSACTION UIBE registration in scp-component-store-selling-features-user-employee
404
+ * that add AUTO_LOG_OFF_OR_LOCK_EVENT + LOCK_USER_SESSION_EVENT to satisfy the
405
+ * engine's "every logical state has at least one event" rule.
406
+ */
407
+ logicalName: exports.IN_TERMINAL_CONTROL_TRANSACTION,
408
+ stateMatchers: [
409
+ {
410
+ matcherType: scp_component_store_selling_core_1.StateMatcherDefinitionType.Transaction,
411
+ transactionType: domain_1.TERMINAL_CONTROL_TRANSACTION_TYPE,
412
+ fieldMatchers: [],
413
+ },
414
+ ],
415
+ uiBusinessEvents: [],
416
+ },
417
+ {
418
+ /**
419
+ * NOTE: this is kept as a no-op alias for the WAITING_TO_CLOSE name. The matcher
420
+ * above already wins because both share the same transactionType-only predicate
421
+ * (first match wins in findLogicalStateName). This entry exists so the constant
422
+ * IN_TERMINAL_CONTROL_TRANSACTION_WAITING_TO_CLOSE (apparently defined for symmetry
423
+ * with the IN_TILL family) still resolves to *some* matcher should a downstream
424
+ * dependency reference it; otherwise it would be unreachable.
425
+ */
426
+ logicalName: exports.IN_TERMINAL_CONTROL_TRANSACTION_WAITING_TO_CLOSE,
427
+ stateMatchers: [
428
+ {
429
+ matcherType: scp_component_store_selling_core_1.StateMatcherDefinitionType.Transaction,
430
+ transactionType: domain_1.TERMINAL_CONTROL_TRANSACTION_TYPE,
431
+ fieldMatchers: [],
432
+ },
433
+ ],
434
+ uiBusinessEvents: [],
435
+ },
384
436
  {
385
437
  logicalName: exports.IN_FISCAL_CONTROL_TRANSACTION,
386
438
  stateMatchers: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptos-scp/scp-component-store-selling-features-domain-model",
3
- "version": "2.51.0",
3
+ "version": "3.0.0",
4
4
  "description": "This component library provides the common components to handle the coordination of processing the business events from the UI.",
5
5
  "private": false,
6
6
  "license": "SEE LICENSE IN LICENSE.md",