TenantAtlas/app/Support/Onboarding/OnboardingCheckpoint.php
ahmido d2f2c55ead feat: add onboarding lifecycle checkpoints and locking (#169)
## Summary
- add canonical onboarding lifecycle and checkpoint fields plus optimistic locking versioning for managed tenant onboarding drafts
- introduce centralized onboarding lifecycle and mutation services and route wizard mutations through version-checked writes
- convert Verify Access and Bootstrap into live checkpoint-driven wizard states with conditional polling and updated browser/feature/unit coverage
- add Spec Kit artifacts for feature 140, including spec, plan, tasks, research, data model, quickstart, checklist, and logical contract

## Validation
- branch was committed and pushed cleanly
- focused tests and formatting were updated during implementation work
- full validation was not re-run as part of this final git/PR step

## Notes
- base branch: `dev`
- feature branch: `140-onboarding-lifecycle-operation-checkpoints-concurrency-mvp`
- outstanding follow-up items, if any, remain tracked in `specs/140-onboarding-lifecycle-operation-checkpoints-concurrency-mvp/tasks.md`

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #169
2026-03-14 11:02:29 +00:00

60 lines
1.5 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Support\Onboarding;
enum OnboardingCheckpoint: string
{
case Identify = 'identify';
case ConnectProvider = 'connect_provider';
case VerifyAccess = 'verify_access';
case Bootstrap = 'bootstrap';
case CompleteActivate = 'complete_activate';
public function label(): string
{
return match ($this) {
self::Identify => 'Identify managed tenant',
self::ConnectProvider => 'Connect provider',
self::VerifyAccess => 'Verify access',
self::Bootstrap => 'Bootstrap',
self::CompleteActivate => 'Complete / Activate',
};
}
public function wizardStep(): int
{
return match ($this) {
self::Identify => 1,
self::ConnectProvider => 2,
self::VerifyAccess => 3,
self::Bootstrap => 4,
self::CompleteActivate => 5,
};
}
public static function fromCurrentStep(?string $step): ?self
{
return match ($step) {
'identify' => self::Identify,
'connection' => self::ConnectProvider,
'verify' => self::VerifyAccess,
'bootstrap' => self::Bootstrap,
'complete' => self::CompleteActivate,
default => null,
};
}
/**
* @return array<int, string>
*/
public static function values(): array
{
return array_map(
static fn (self $case): string => $case->value,
self::cases(),
);
}
}