Automated commit and PR created by Copilot per user request. Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #287
15 KiB
| description |
|---|
| Task list for feature implementation |
Tasks: Plans, Entitlements & Billing Readiness
Input: Design documents from /Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/247-plans-entitlements-billing-readiness/
Prerequisites: /Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/247-plans-entitlements-billing-readiness/plan.md (required), /Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/247-plans-entitlements-billing-readiness/spec.md (required), /Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/247-plans-entitlements-billing-readiness/checklists/requirements.md (required), /Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/247-plans-entitlements-billing-readiness/research.md, /Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/247-plans-entitlements-billing-readiness/data-model.md, /Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/247-plans-entitlements-billing-readiness/contracts/workspace-entitlements-foundation.logical.openapi.yaml, /Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/247-plans-entitlements-billing-readiness/quickstart.md
Tests: Required (Pest) for all runtime behavior changes. Keep proof in focused Unit and Feature lanes only, using the targeted Sail commands already captured in the feature spec, plan, and quickstart artifacts.
Phase 1: Setup (Shared Infrastructure)
Purpose: Align the bounded first slice, validation entry points, and repo guardrails before touching runtime code.
- T001 Review the bounded slice, explicit non-goals, and guardrail outcomes in
/Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/247-plans-entitlements-billing-readiness/spec.md,/Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/247-plans-entitlements-billing-readiness/plan.md, and/Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/247-plans-entitlements-billing-readiness/checklists/requirements.md - T002 [P] Review the logical route and action boundaries for workspace settings, onboarding completion, review-pack generation, and system-directory visibility in
/Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/247-plans-entitlements-billing-readiness/contracts/workspace-entitlements-foundation.logical.openapi.yaml - T003 [P] Start or confirm the focused validation environment through
apps/platform/vendor/bin/sailand keep the planned proof commands aligned with/Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/247-plans-entitlements-billing-readiness/quickstart.md
Phase 2: Foundational (Blocking Prerequisites)
Purpose: Add the shared entitlement primitives that every user story depends on.
⚠️ CRITICAL: No user story work should begin until this phase is complete.
- T004 [P] Add the first-slice entitlement setting keys, validation metadata, and operator-facing labels to
apps/platform/app/Support/Settings/SettingsRegistry.php - T005 [P] Add the bounded code-owned plan profile catalog for the two first-slice entitlement defaults in
apps/platform/app/Services/Entitlements/WorkspacePlanProfileCatalog.php - T006 Implement the shared effective entitlement decision shape, source vocabulary, rationale projection, and managed-tenant usage aggregation in
apps/platform/app/Services/Entitlements/WorkspaceEntitlementResolver.php - T007 Wire the new entitlement keys through the existing audited settings stack in
apps/platform/app/Services/Settings/SettingsResolver.phpandapps/platform/app/Services/Settings/SettingsWriter.php
Checkpoint: Foundation ready. User story work can now proceed independently.
Phase 3: User Story 1 - Configure Workspace Commercial Truth In One Place (Priority: P1) 🎯 MVP
Goal: Let a workspace manager set one plan profile and two bounded entitlement overrides with rationale from the existing workspace settings page.
Independent Test: Open /admin/settings/workspace, save a plan profile and one override with rationale, then confirm the page shows the resolved values, source, rationale, and current usage summary without touching onboarding or review-pack surfaces.
Tests for User Story 1
- T008 [P] [US1] Add plan-profile and resolver unit coverage for default fallback, override merge, source attribution, rationale, and over-limit calculation in
apps/platform/tests/Unit/Entitlements/WorkspacePlanProfileCatalogTest.phpandapps/platform/tests/Unit/Entitlements/WorkspaceEntitlementResolverTest.php - T009 [P] [US1] Add workspace-settings feature coverage for save, reset, rationale validation, source labels, and audit attribution in
apps/platform/tests/Feature/Filament/Settings/WorkspaceEntitlementsSettingsPageTest.php
Implementation for User Story 1
- T010 [US1] Extend the existing workspace settings section with a plan profile selector, two override inputs, and rationale inputs in
apps/platform/app/Filament/Pages/Settings/WorkspaceSettings.php - T011 [US1] Add confirmation-protected override reset actions that clear both override value and rationale on
apps/platform/app/Filament/Pages/Settings/WorkspaceSettings.php - T012 [US1] Persist plan-profile and override writes through the existing audited settings path in
apps/platform/app/Filament/Pages/Settings/WorkspaceSettings.phpandapps/platform/app/Services/Settings/SettingsWriter.php - T013 [US1] Render the shared resolver output back onto the settings page as effective source, rationale, and current usage summary in
apps/platform/app/Filament/Pages/Settings/WorkspaceSettings.phpandapps/platform/app/Services/Entitlements/WorkspaceEntitlementResolver.php
Checkpoint: User Story 1 is independently functional and ready for focused settings validation.
Phase 4: User Story 2 - Truthfully Gate Managed-Tenant Activation (Priority: P1)
Goal: Keep the onboarding completion action visible to authorized actors while blocking activation with a truthful entitlement reason whenever the workspace is at or over its managed-tenant limit.
Independent Test: Seed workspaces within limit, at limit, and over limit, open the existing onboarding completion step, and confirm the action is either allowed or blocked with the correct reason before any tenant activation mutation occurs.
Tests for User Story 2
- T014 [P] [US2] Add onboarding feature coverage for within-limit, at-limit, over-limit, override-source, and 404 versus 403 versus business-state semantics in
apps/platform/tests/Feature/Onboarding/ManagedTenantOnboardingEntitlementTest.php
Implementation for User Story 2
- T015 [US2] Project the shared managed-tenant entitlement decision onto the onboarding completion step in
apps/platform/app/Filament/Pages/Workspaces/ManagedTenantOnboardingWizard.php - T016 [US2] Enforce the managed-tenant activation entitlement before any onboarding completion mutation occurs in
apps/platform/app/Filament/Pages/Workspaces/ManagedTenantOnboardingWizard.php - T017 [US2] Keep the onboarding helper text, source labels, and business-state block logic sourced from
apps/platform/app/Services/Entitlements/WorkspaceEntitlementResolver.phpinsideapps/platform/app/Filament/Pages/Workspaces/ManagedTenantOnboardingWizard.php
Checkpoint: User Story 2 is independently functional and preserves truthful activation gating without retroactive tenant mutation.
Phase 5: User Story 3 - Truthfully Gate Review-Pack Generation And Expose The Reason To Support (Priority: P2)
Goal: Reuse one entitlement decision for all current Generate pack, Regenerate, and Export executive pack entry points, while exposing the same resolved truth read-only on the system workspace page.
Independent Test: Seed a workspace where review-pack generation is disabled, attempt Generate pack, Regenerate, and Export executive pack from the existing entry families, confirm no new ReviewPack or OperationRun is created, confirm existing View/Download access still works, and then confirm the same resolved reason on the system workspace detail page.
Tests for User Story 3
- T018 [P] [US3] Add review-pack and system-directory feature coverage for blocked
Generate pack,Regenerate, andExport executive packactions, preserved allowed flow, explicitView/Downloadno-regression behavior, no-run enforcement, and read-only entitlement visibility inapps/platform/tests/Feature/ReviewPacks/ReviewPackEntitlementEnforcementTest.phpandapps/platform/tests/Feature/System/Directory/ViewWorkspaceEntitlementsTest.php
Implementation for User Story 3
- T019 [US3] Enforce review-pack entitlement before
ReviewPackorOperationRuncreation forGenerate pack,Regenerate, andExport executive packflows while preserving existing queued-start UX and leavingView/Downloadbehavior unchanged inapps/platform/app/Services/ReviewPackService.php - T020 [P] [US3] Gate the tenant dashboard review-pack card and the Review Register
Export executive packentry point with resolver-backed allow-or-block messaging inapps/platform/app/Filament/Widgets/Tenant/TenantReviewPackCard.phpandapps/platform/app/Filament/Pages/Reviews/ReviewRegister.php - T021 [P] [US3] Gate only the in-scope
Generate pack,Regenerate, andExport executive packactions on tenant review and review-pack resource surfaces with the same shared decision projection, while leaving existingViewandDownloadaccess unchanged, inapps/platform/app/Filament/Resources/TenantReviewResource.php,apps/platform/app/Filament/Resources/TenantReviewResource/Pages/ViewTenantReview.php,apps/platform/app/Filament/Resources/ReviewPackResource.php,apps/platform/app/Filament/Resources/ReviewPackResource/Pages/ListReviewPacks.php, andapps/platform/app/Filament/Resources/ReviewPackResource/Pages/ViewReviewPack.php - T022 [P] [US3] Add the read-only resolved entitlement summary to the system workspace detail surface in
apps/platform/app/Filament/System/Pages/Directory/ViewWorkspace.phpandapps/platform/resources/views/filament/system/pages/directory/view-workspace.blade.php
Checkpoint: User Story 3 is independently functional and keeps review-pack gating and system visibility on the same decision truth.
Phase 6: Polish & Cross-Cutting Concerns
Purpose: Finish guardrail close-out, run the narrow validation commands, and format touched files without widening scope.
- T023 Record the final guardrail close-out, lane result, and any bounded
document-in-featurenote for shared entitlement wording or surface exceptions in/Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/247-plans-entitlements-billing-readiness/plan.mdand/Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/247-plans-entitlements-billing-readiness/checklists/requirements.md - T024 Run the targeted unit Sail/Pest command from
/Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/247-plans-entitlements-billing-readiness/plan.mdand/Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/247-plans-entitlements-billing-readiness/quickstart.mdagainstapps/platform/tests/Unit/Entitlements/WorkspaceEntitlementResolverTest.phpandapps/platform/tests/Unit/Entitlements/WorkspacePlanProfileCatalogTest.php - T025 Run the targeted settings and onboarding Sail/Pest command from
/Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/247-plans-entitlements-billing-readiness/plan.mdand/Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/247-plans-entitlements-billing-readiness/quickstart.mdagainstapps/platform/tests/Feature/Filament/Settings/WorkspaceEntitlementsSettingsPageTest.phpandapps/platform/tests/Feature/Onboarding/ManagedTenantOnboardingEntitlementTest.php - T026 Run the targeted review-pack and system-directory Sail/Pest command from
/Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/247-plans-entitlements-billing-readiness/plan.mdand/Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/247-plans-entitlements-billing-readiness/quickstart.mdagainstapps/platform/tests/Feature/ReviewPacks/ReviewPackEntitlementEnforcementTest.phpandapps/platform/tests/Feature/System/Directory/ViewWorkspaceEntitlementsTest.php - T027 Run dirty-only formatting for touched platform files through
apps/platform/vendor/bin/sailusing the Pint command recorded in/Users/ahmeddarrazi/Documents/projects/wt-plattform/specs/247-plans-entitlements-billing-readiness/quickstart.md
Dependencies & Execution Order
Phase Dependencies
- Phase 1 (Setup): no dependencies; start immediately.
- Phase 2 (Foundational): depends on Phase 1 and blocks all user stories.
- Phase 3 (US1), Phase 4 (US2), and Phase 5 (US3): each depends on Phase 2 and is independently testable after the shared settings and resolver primitives exist.
- Phase 6 (Polish): depends on all desired user stories being complete.
User Story Dependencies
- US1 (P1): starts after Phase 2 and does not depend on US2 or US3.
- US2 (P1): starts after Phase 2 and reuses the shared resolver, but does not require US1 UI work to be complete.
- US3 (P2): starts after Phase 2 and reuses the shared resolver plus settings keys, but does not require onboarding work to be complete.
Within Each User Story
- Write the listed Pest tests first and make them fail for the intended behavior gap.
- Complete shared service enforcement before wiring multiple entry points that depend on it.
- Keep each story shippable on its own before moving to the next story.
Parallel Execution Examples
User Story 1
- Run T008 and T009 in parallel.
- After T010 starts the settings section, keep T011 and T012 coordinated because both touch
WorkspaceSettings.php.
User Story 2
- Run T014 in parallel with any remaining US1 validation work after Phase 2 is complete.
- Keep T015, T016, and T017 sequential because they all tighten the same onboarding completion boundary.
User Story 3
- Run T018 first, then complete T019 before splitting T020, T021, and T022 across separate files.
- T020, T021, and T022 can proceed in parallel once the service-level gate in
ReviewPackService.phpis in place.
Implementation Strategy
Suggested MVP Scope
- MVP = User Story 1 only. It establishes the workspace-owned plan profile, two entitlement keys, explicit overrides with rationale, and the shared decision truth that every later gate depends on.
Incremental Delivery
- Complete Phase 1 and Phase 2.
- Deliver US1 and validate the settings-backed commercial truth.
- Deliver US2 and validate onboarding activation gating.
- Deliver US3 and validate review-pack gating plus read-only system visibility.
- Finish with the Phase 6 guardrail close-out, focused validation commands, and formatting.