10 internal static class KycTransitions
22 int Current = nav.CurrentPageIndex;
24 foreach (
int idx
in VisibleIndices)
26 if (idx > Current) { Next = idx;
break; }
31 return nav with { State = State.ApplicationSent ? KycFlowState.PendingSummary : KycFlowState.Summary };
33 return nav with { CurrentPageIndex = Next };
45 return Nav with { State =
KycFlowState.Form, CurrentPageIndex = Nav.AnchorPageIndex >= 0 ? Nav.AnchorPageIndex : Nav.CurrentPageIndex };
47 int Current = Nav.CurrentPageIndex;
49 for (
int i = visibleIndices.Count - 1; i >= 0; i--)
51 int idx = visibleIndices[i];
52 if (idx < Current) { Prev = idx;
break; }
56 return Nav with { CurrentPageIndex = Prev };
66 return Nav with { State = state.ApplicationSent ? KycFlowState.PendingSummary :
KycFlowState.Summary, AnchorPageIndex = Nav.CurrentPageIndex };
86 if (Nav.State !=
KycFlowState.EditingFromSummary)
return Nav;
88 return Nav with { State = KycFlowState.Form };
89 return Nav with { State =
KycFlowState.Summary, CurrentPageIndex = Nav.AnchorPageIndex >= 0 ? Nav.AnchorPageIndex : Nav.CurrentPageIndex };
sealed record KycProcessState(IReadOnlyList< KycPageState > Pages, KycNavigationSnapshot Navigation, bool ApplicationSent)
Root aggregate-like snapshot passed through pure functions.
KycFlowState
High-level flow states for the KYC process UI.
sealed record KycNavigationSnapshot(int CurrentPageIndex, int AnchorPageIndex, KycFlowState State)
Navigation snapshot capturing minimal mutable UI navigation state.