Hermes 284313f908
Some checks are pending
Bidi Control Character Guard / bidi-control-guard (push) Waiting to run
Circular Dependency Check / Check for new circular dependencies (push) Waiting to run
Citus Migration Smoke / Combined migrations on single-node Citus (push) Waiting to run
E2E Fresh Install Tests / fresh-install-e2e (push) Waiting to run
ext-v2 guardrails / Run ext-v2 guard and ESLint (push) Waiting to run
Integration Tests / Check for relevant changes (push) Waiting to run
Integration Tests / ${{ (github.event_name == 'schedule' || github.event.inputs.suite == 'full') && 'Full integration suite' || 'Tier-1 integration subset' }} (push) Blocked by required conditions
Mobile checks / Mobile lint + typecheck (push) Waiting to run
Mobile checks / Mobile unit tests (push) Waiting to run
Mobile checks / Mobile dependency audit (report) (push) Waiting to run
Mobile checks / Mobile reproducibility checks (push) Waiting to run
Secrets guard (env backups) / Ensure no tracked env backup files (push) Waiting to run
Temporal Readiness / fast-readiness (push) Waiting to run
Temporal Readiness / docker-parity (push) Waiting to run
TypeScript Type Check / Nx affected typecheck (push) Waiting to run
Unit Tests / Skipped-test budget (push) Waiting to run
Unit Tests / Nx affected unit tests (push) Waiting to run
Unit Tests / Server unit coverage (informational) (push) Waiting to run
Validate Tenant Management Schema / Check for relevant changes (push) Waiting to run
Validate Tenant Management Schema / Validate Tenant Management Schema (push) Blocked by required conditions
EE Workflows Build Guard / ee-workflows-build-guard (push) Waiting to run
Initial import of AlgaPSA codebase from PSA server
Excluded: .git, node_modules, secrets/, compose.env, assemblyscript tgz

Source: /opt/alga-psa on psa.joliet.tech
2026-06-22 16:12:17 -05:00

46 lines
2.8 KiB
Markdown

# Scratchpad — AlgaDesk Onboarding Wizard
## Decisions
- AlgaDesk onboarding should not create PSA-only billing/service/contract setup data.
- A future AlgaDesk-to-PSA upgrade should run a separate PSA initializer when the product changes to `psa`.
- Use the existing `/msp/onboarding` route and shared wizard, made product-aware.
- Keep help-desk-relevant optional setup in AlgaDesk; remove Billing.
## Discoveries
- `server/src/app/msp/layout.tsx` already resolves `productCode` and wraps MSP pages in `MspLayoutClient`.
- `MspLayoutClient` wraps onboarding children in `AppSessionProvider` and `ProductProvider`, so the client onboarding page can read product context.
- `packages/onboarding/src/components/OnboardingWizard.tsx` currently uses numeric step indexes directly for rendering, validation, and server action dispatch.
- Billing setup is only invoked from step index 4 in `saveStepData`.
- Ticketing defaults are handled through `configureTicketing` and `validateOnboardingDefaults` on step index 5.
- AlgaDesk dashboard currently returns `AlgaDeskDashboard` directly and does not render the PSA dashboard onboarding checklist slot.
## Implementation Notes
- Introduce product-aware active step index helpers in `OnboardingWizard.tsx`.
- Keep `currentStep` and `completedSteps` as displayed positions, then map to original indexes for action/render/validation logic.
- Add focused tests under `server/src/test/unit/onboarding`.
## Validation
- `cd server && npx vitest run src/test/unit/onboarding/algadeskOnboardingWizard.productSteps.test.ts src/test/unit/onboarding/onboardingWizardDataSeparation.test.tsx src/test/unit/onboarding/clientInfoStepRendering.test.tsx`
- `cd server && npm run typecheck`
## Implementation Summary
- Added `packages/onboarding/src/lib/onboardingWizardSteps.ts` for product-specific wizard step derivation.
- Wired `server/src/app/msp/onboarding/page.tsx` to read `productCode` from `ProductProvider` and pass it to `OnboardingWizard`.
- Updated `OnboardingWizard` to keep displayed step positions separate from original server-action step indexes.
- AlgaDesk active steps are Client Info/Workspace, Team Members, Add Client, Client Contact, and Ticketing. Billing remains PSA-only.
- Added source/contract and helper tests for product-specific behavior.
- Updated existing ClientInfoStep tests to mock `useI18n` and tolerate locale seeding updates while preserving tenantName/clientName separation assertions.
## Review Follow-up
- Ran builtin reviewer on the uncommitted diff.
- Added AlgaDesk onboarding translation keys to all `server/public/locales/*/msp/onboarding.json` files.
- Restored the stricter tenantName/clientName test assertion by clearing the locale-seeding update before typing.
- Aligned `handleSkip` with displayed required step positions.
- Added locale-key coverage to the AlgaDesk onboarding contract test.