Phase 4 §4: payment-before-pair for returning users + Maestro suite
Stages 5.1, 5.3, 5.4 of the returning-user flow rework. All three §4 entry paths now require payment BEFORE pairing, matching the updated mermaid spec. * Spec (requirement/flow_customer.mermaid.md §4): payment block converges three call-sites (bestie-yang-udah-kenal-online, bestie-baru, offline-popup → cari bestie lain). PairRoute dispatches lama → targeted pair, baru/cari-lain → §3 blast. §3 retains its post-payment-shared contract. * Stage 5.1 (client_app): PaymentDraft carries targetedMitraId + topicSensitivity. bestie_history_list seeds the draft + pushes /payment/entry (was legacy /payment). searching_screen branches on draft.targetedMitraId for blast-vs-targeted dispatch. payment_entry uses resetExceptTarget(); bestie_choice_sheet + home _onCurhatBestieBaruPressed call explicit reset() before push so the keepAlive draft can't leak stale targeting into a blast. * Stage 5.3 (client_app): new BestieOfflineVariant.prePayReturning. Bestie-history-list _BestieRow splits tappable from dim so offline rows render dimmed but route taps into the popup. CTA "cari bestie lain" resets the draft + pushes /payment/entry. * Stage 5.4 (client_app): deleted legacy /payment route, payment_screen.dart, payment_notifier.dart(+.g.dart). router cleaned. * Tests (requirement/phase4-customer-flow.md + client_app/.maestro/): six Maestro flows TS-01..TS-06 covering every §4 branching point, all passing end-to-end. Shared onboarding prelude under .maestro/subflows/. New helper scripts: accept_latest_pending, force_mitra_offline, force_other_mitra_online, reset_all_mitras_online, mitra_accept_latest_internal. New backend _test endpoints to match. /reset-phone now cascade-deletes customer_transactions (FK was blocking). /force-pairing-timeout branches targeted (RETURNING_CHAT_TIMEOUT via expireTargetedPairingRequest, now exported) vs blast (PAIRING_FAILED). seed_history_session also outputs MITRA_NAME_RE (regex-escaped) for reliable selectors against display names containing regex specials. * mitra_app: dispose-during-deactivate guardrail for back-press on the mitra chat screen after the customer's goodbye message. Pending real emulator repro verification (carried over from 2026-05-15). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -14,7 +14,6 @@ import 'features/splash/splash_screen.dart';
|
||||
import 'features/home/home_screen.dart';
|
||||
import 'features/home/screens/bestie_history_list_screen.dart';
|
||||
import 'features/profile/profile_screen.dart';
|
||||
import 'core/constants.dart';
|
||||
import 'features/chat/screens/searching_screen.dart';
|
||||
import 'features/chat/screens/bestie_found_screen.dart';
|
||||
import 'features/chat/screens/no_bestie_screen.dart';
|
||||
@@ -26,7 +25,6 @@ import 'features/chat_tab/screens/pembayaran_view.dart';
|
||||
import 'features/chat_tab/screens/selesai_view.dart';
|
||||
import 'features/chat/screens/targeted_waiting_screen.dart';
|
||||
import 'features/chat/screens/thank_you_screen.dart';
|
||||
import 'features/payment/screens/payment_screen.dart';
|
||||
import 'features/payment/screens/payment_entry_screen.dart';
|
||||
import 'features/payment/screens/discount_paywall_screen.dart';
|
||||
import 'features/payment/screens/method_pick_screen.dart';
|
||||
@@ -166,25 +164,6 @@ GoRouter buildRouter(Ref ref) {
|
||||
),
|
||||
GoRoute(path: '/home', builder: (_, __) => const HomeScreen()),
|
||||
GoRoute(path: '/profile', builder: (_, __) => const ProfileScreen()),
|
||||
GoRoute(path: '/payment', builder: (context, state) {
|
||||
// Legacy Phase 3.7 single-screen payment. Still reachable from
|
||||
// - Home "Mulai Curhat" CTA → no extras (general blast follows confirm)
|
||||
// - Chat history "Curhat lagi" CTA → extras carry targetedMitraId/mitraName
|
||||
// for the returning-chat flow, plus optional topicSensitivity.
|
||||
// Phase 4 Stage 3 introduces sibling routes under `/payment/*`; the new
|
||||
// entry point is `/payment/entry`. This route is preserved until Stage 5
|
||||
// migrates the chat-history "Curhat lagi" flow.
|
||||
final extra = state.extra;
|
||||
if (extra is Map<String, dynamic>) {
|
||||
final topic = extra['topicSensitivity'];
|
||||
return PaymentScreen(
|
||||
targetedMitraId: extra['targetedMitraId'] as String?,
|
||||
mitraName: extra['mitraName'] as String?,
|
||||
topicSensitivity: topic is TopicSensitivity ? topic : TopicSensitivity.regular,
|
||||
);
|
||||
}
|
||||
return const PaymentScreen();
|
||||
}),
|
||||
// Phase 4 Stage 3 — multi-screen payment shell.
|
||||
GoRoute(path: '/payment/entry', builder: (_, __) => const PaymentEntryScreen()),
|
||||
GoRoute(path: '/payment/discount-paywall', builder: (_, __) => const DiscountPaywallScreen()),
|
||||
|
||||
Reference in New Issue
Block a user