- Add‑on Checkout auf Transactions + Transaction‑ID speichern: app/Services/Addons/EventAddonCheckoutService.php
- Paket/Marketing Checkout auf Transactions: app/Services/Paddle/PaddleCheckoutService.php
- Gift‑Voucher Checkout: Customer anlegen/finden + Transactions: app/Services/GiftVouchers/
GiftVoucherCheckoutService.php
- Tests aktualisiert: tests/Feature/Tenant/EventAddonCheckoutTest.php, tests/Unit/PaddleCheckoutServiceTest.php,
tests/Unit/GiftVoucherCheckoutServiceTest.php
53 lines
1.1 KiB
TypeScript
53 lines
1.1 KiB
TypeScript
import {
|
|
ADMIN_WELCOME_BASE_PATH,
|
|
ADMIN_WELCOME_EVENT_PATH,
|
|
ADMIN_WELCOME_SUMMARY_PATH,
|
|
} from '../../constants';
|
|
|
|
type OnboardingRedirectInput = {
|
|
hasEvents: boolean;
|
|
hasActivePackage: boolean;
|
|
selectedPackageId?: number | null;
|
|
pathname: string;
|
|
isWelcomePath: boolean;
|
|
isBillingPath: boolean;
|
|
isOnboardingDismissed?: boolean;
|
|
isOnboardingCompleted?: boolean;
|
|
};
|
|
|
|
export function resolveOnboardingRedirect({
|
|
hasEvents,
|
|
hasActivePackage,
|
|
selectedPackageId,
|
|
pathname,
|
|
isWelcomePath,
|
|
isBillingPath,
|
|
isOnboardingDismissed,
|
|
isOnboardingCompleted,
|
|
}: OnboardingRedirectInput): string | null {
|
|
if (hasEvents) {
|
|
return null;
|
|
}
|
|
|
|
if (isOnboardingDismissed || isOnboardingCompleted) {
|
|
return null;
|
|
}
|
|
|
|
if (isWelcomePath || isBillingPath) {
|
|
return null;
|
|
}
|
|
|
|
const shouldContinueSummary = Boolean(selectedPackageId && selectedPackageId > 0);
|
|
const target = hasActivePackage
|
|
? ADMIN_WELCOME_EVENT_PATH
|
|
: shouldContinueSummary
|
|
? ADMIN_WELCOME_SUMMARY_PATH
|
|
: ADMIN_WELCOME_BASE_PATH;
|
|
|
|
if (pathname === target) {
|
|
return null;
|
|
}
|
|
|
|
return target;
|
|
}
|