47 lines
2.3 KiB
Markdown
47 lines
2.3 KiB
Markdown
# Quickstart: Central Tenant Status Presentation
|
|
|
|
## Goal
|
|
|
|
Implement a shared tenant lifecycle presentation contract that keeps `draft`, `onboarding`, `active`, and `archived` explicit and consistent across tenant management surfaces and the tenantless operations viewer surface.
|
|
|
|
## Prerequisites
|
|
|
|
- Work on branch `146-central-tenant-status-presentation`
|
|
- Sail services available for running tests and formatting
|
|
- Review these existing code anchors before implementation:
|
|
- `app/Support/Tenants/TenantLifecycle.php`
|
|
- `app/Support/Badges/BadgeCatalog.php`
|
|
- `app/Support/Badges/Domains/TenantStatusBadge.php`
|
|
- `app/Services/Tenants/TenantOperabilityService.php`
|
|
- `app/Filament/Resources/TenantResource.php`
|
|
- `resources/views/filament/pages/choose-tenant.blade.php`
|
|
- `app/Filament/Pages/Operations/TenantlessOperationRunViewer.php`
|
|
- `app/Filament/Resources/OperationRunResource.php`
|
|
|
|
## Suggested Implementation Order
|
|
|
|
1. Add a central lifecycle presentation object or presenter in the tenant/support layer.
|
|
2. Refactor badge-only lifecycle rendering to source label, tone, and icon from that contract without breaking BADGE-001.
|
|
3. Add concise and detailed helper-text variants for surfaces that need more than a badge.
|
|
4. Update tenant list/detail surfaces to consume the new contract.
|
|
5. Update choose-tenant and onboarding-linked lifecycle wording to use the canonical lifecycle vocabulary.
|
|
6. Update the tenantless operations viewer referenced-tenant context, including the `OperationRunResource` enterprise-detail summary payload, to use the same contract.
|
|
7. Add focused unit and feature regression tests for all four lifecycle states and invalid fallback behavior.
|
|
8. Run formatting and focused tests through Sail.
|
|
|
|
## Focused Validation Commands
|
|
|
|
```bash
|
|
vendor/bin/sail artisan test --compact tests/Unit
|
|
vendor/bin/sail artisan test --compact tests/Feature/Filament
|
|
vendor/bin/sail artisan test --compact tests/Feature/Onboarding
|
|
vendor/bin/sail bin pint --dirty --format agent
|
|
```
|
|
|
|
## Expected Outcomes
|
|
|
|
- Canonical lifecycle states never render as Unknown.
|
|
- Tenant list/detail and tenantless operations viewer surfaces reuse one lifecycle vocabulary.
|
|
- Lifecycle remains visually and semantically separate from provider, RBAC, verification, and run status.
|
|
- Invalid-data fallback is explicit and test-covered.
|