Commit Graph

11 Commits

Author SHA1 Message Date
sharang 800e0a4868 feat(portal): M11.1 catalog flow + M12.1 self-serve trial
M11.1 — /[slug]/catalog page renders the live catalog from tenant-registry,
gates already-owned products with an 'Active' chip, and exposes two
server actions per remaining card:
  - Request → POST /v1/catalog/request (emits an audit event; sales
    follow-up flow will pick this up when M8.x lands ERPNext + the
    Lead webhook)
  - Start 14-day trial → POST /v1/catalog/trial-request (provisions
    the entitlement immediately; 14-day expiry per M4.2)
Flash banner on success/error (?ok= / ?err= query params).

M12.1 — Public /start route. Server action calls
createTenant({slug, name, plan, admin_email}) → tenant-registry's
KC-aware POST /v1/tenants → user lands at /<slug>/dashboard. The
dashboard now renders a trial-days-left banner when status=trial
and trial_ends_at is set (urgent styling when ≤3 days remain).

Library:
  src/lib/tenant-registry.ts widened from one-call client to the
  full read+mutate surface (fetchCatalog, fetchEntitlements,
  requestProduct, startTrial, createTenant). Returns typed
  {ok: true, ...} | {ok: false, error: '...'} so server actions
  branch cleanly. 22 vitest cases, 100% line+branch+function
  coverage of src/lib/.

Catalog tests rely on the mock-fetch pattern; the user-visible
flow is exercised by Playwright when the dev stack is up.

Refs: M11.1 + M12.1
2026-05-19 18:24:42 +02:00
sharang 8ab82c8b37 docs(dev): pin AUTH_URL to the tenant subdomain
ci / test (push) Successful in 28s
ci / e2e (push) Has been skipped
ci / image (push) Has been skipped
ci / shared (push) Successful in 4s
Capture the redirect_uri gotcha from the live-stack smoke. .env.example pins AUTH_URL to acme.localhost:3000 with a long-form comment; README gets an 'AUTH_URL gotcha' callout.

Refs: M5.1 follow-up
2026-05-19 16:05:45 +00:00
sharang 3310a942f2 fix(test): assert real shipped behaviour for signed-out /products
ci / shared (push) Successful in 5s
ci / test (push) Successful in 33s
ci / e2e (push) Has been skipped
ci / image (push) Has been skipped
Caught during live local-smoke run.

Refs: M4.2/M5.3
2026-05-19 15:09:01 +00:00
sharang 99fe3b55b2 feat(test): M5.3 — Playwright e2e harness for the dev stack
ci / shared (push) Successful in 4s
ci / test (push) Successful in 23s
ci / e2e (push) Has been skipped
ci / image (push) Has been skipped
playwright.config.ts + tests/e2e/{apex,tenant,health}.spec.ts. make e2e for local. CI e2e job opt-in via RUN_E2E repo variable. OIDC click-through deferred to when stage is up.

Refs: M5.3
2026-05-19 14:53:18 +00:00
sharang fe139332ee feat(app): M5.2 — customer-area route shells + role-gated nav
ci / shared (push) Successful in 4s
ci / test (push) Successful in 29s
ci / e2e (push) Has been skipped
ci / image (push) Has been skipped
10 route shells under /[slug]/, role-filtered Nav, backstage stub at /__backstage__, dashboard reads session.products to render tiles. src/lib/session.ts is the canonical role × surface matrix; canSee() is the only RBAC primitive in the portal (real enforcement remains at the API layer). 24 vitest tests; 100% src/lib coverage.

Refs: M5.2
2026-05-19 14:47:15 +00:00
sharang 2961f36cca fix(dev): point TENANT_REGISTRY_URL at :8090
ci / shared (push) Successful in 6s
ci / test (push) Successful in 29s
ci / e2e (push) Has been skipped
ci / image (push) Has been skipped
Unblock local dev: Keycloak owns :8080, so tenant-registry shifts to :8090. Prod is functionally unchanged.

Refs: M5.1
2026-05-19 09:47:38 +00:00
sharang e7a1290246 feat(app): Next.js 16 + Auth.js v5 portal skeleton
ci / shared (push) Successful in 4s
ci / test (push) Successful in 26s
ci / e2e (push) Has been skipped
ci / image (push) Has been skipped
Next.js 16 + Auth.js v5 skeleton: host→slug middleware, tenant-context layout, OIDC sign-in flow against breakpilot-dev realm. 100% coverage on src/lib. Bumps next to 16.2.6 to clear trivy CVEs in 15.0.3.
2026-05-19 09:35:05 +00:00
sharang 3c7409ee9e chore(domain): yourplatform.com → breakpilot.com
ci / shared (push) Successful in 5s
ci / test (push) Has been skipped
ci / e2e (push) Has been skipped
ci / image (push) Has been skipped
Apply platform-domain decision (2026-05-18). No services touched; docs/config only.

Refs: M1.1
2026-05-18 20:28:44 +00:00
sharang dd4764fbb2 ci: rework workflow for Gitea Actions (M0.2)
ci / e2e (push) Has been skipped
ci / image (push) Has been skipped
ci / shared (push) Successful in 5s
ci / test (push) Has been skipped
Switches commitlint to bash regex, gitleaks to inline binary, trivy to inline binary (v0.70.0). Per-stack jobs gated on hashFiles.

Refs: M0.2
2026-05-18 19:42:30 +00:00
sharang 21f6d70a32 chore: bootstrap repo scaffolding (M0.1)
ci / shared (push) Failing after 6s
ci / test (push) Failing after 3s
ci / e2e (push) Has been skipped
ci / image (push) Has been skipped
Bootstraps §1.2 scaffolding (README, CONTRIBUTING, CODEOWNERS, CHANGELOG, PR + issue templates, LICENSE, CI workflow, release workflow, commitlint, cliff, .editorconfig, .gitignore, .env.example) and ships a proprietary all-rights-reserved LICENSE naming both founders.

Refs: M0.1
2026-05-18 19:15:34 +00:00
sharang ae9f68d6b6 Initial commit 2026-05-18 19:05:35 +00:00