Commit Graph

72 Commits

Author SHA1 Message Date
simone a447494dde docs(11-01): complete plan 1 — tags schema + consolidation scripts, DB-execution gated
- Advance STATE.md to plan 2/4, record metrics/decisions/blocker for 11-01
- Fix Status/Progress fields regressed by state advance-plan (status was
  reset to "Ready to execute" / 0% despite phase being mid-execution)
- Note .planning/ROADMAP.md is an empty PLACEHOLDER (pre-existing v2.1
  planning gap) — roadmap update-plan-progress is a no-op until populated
2026-06-13 15:35:18 +02:00
simone afe789c415 docs(11-01): add execution summary and deferred items log
Documents Phase 11 Plan 1 outcome: tags table schema + migration scripts
complete and committed; DB-execution steps (push migration, run legacy
consolidation, run tag-assignment + validators) blocked by network/SSH
access gate to 178.104.27.55:54321 (firewalled, SSH-only per project
memory). Logs pre-existing drizzle-kit migration tooling drift and the
stale quote_items<->service_catalog JOIN as deferred non-blocking items.
2026-06-13 15:30:03 +02:00
simone d1b1047368 docs(11): create phase plan — 4 plans, 4 waves
Catalog Database-View UX & Legacy Consolidation (OFFER-07/08/09/10/13)
- 11-01: tags table + polymorphic junction + additive legacy migration
- 11-02: getAllServices tag join + inline-edit/tag/quick-add server actions
- 11-03: EditableCell + TagMultiSelect components
- 11-04: database-view ServiceTable + client-side search

Verified by gsd-plan-checker (VERIFICATION PASSED).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 15:07:17 +02:00
simone 03898f2a59 docs(planning): v2.1 milestone setup + Phase 11 context/patterns
- Archive v2.0 phases (07-10) under .planning/milestones/
- v2.1 REQUIREMENTS/ROADMAP (Phases 11-17: Offer Studio + Proposal AI)
- DESIGN-SYSTEM.md (database-view UI contract for Phases 11-14)
- Phase 11 CONTEXT, DISCUSSION-LOG, PATTERNS

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 15:07:06 +02:00
simone 857af5c182 docs(handoff): triage user feedback — lead detail bug fixed, tab restructuring decisions, Attio as CRM UX benchmark
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 22:14:31 +02:00
simone 810a53816d docs(handoff): new direction — Offer Studio + Proposal AI, decisions and next-session plan
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 21:20:51 +02:00
simone feff48e5e1 docs(handoff): CRM pages live-verified; next session = fix design/functional/structural issues before Phase 11
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 21:57:34 +02:00
simone 0a4dd932bc docs(state): Phase 10 redo complete — root cause was unapplied prod migrations 0001-0005
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 21:00:28 +02:00
simone 008a43469d feat(10-redo-C): CRM leads module — schema, services, UI (Phase 10 redo)
Stage C of staged Phase 10 redo. Restores dangling phase10-wip work:
- schema.ts: leads expansion + activities/reminders tables + relations
- lead-service.ts / lead-validators.ts service layer
- /admin/leads list + detail + actions, LeadTable/LeadDetail/LeadForm
- LogActivityModal, SendQuoteModal, FollowUpWidget on dashboard
- migration 0005 (applied to prod DB in Stage B, along with
  previously-missing 0001/0003/0004 — root cause of all post-deploy
  500s: prod DB had no migrations applied since 0000)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 20:58:14 +02:00
simone 0bca8a6c4d docs(state): Phase 9 Plan 3 execution complete — public quote page live
State changes:
- Progress: 5/8 plans complete (62.5%)
- Phase 09 Plan 03: DONE (30 minutes)
- Multistep wizard, rate limiting, immutable acceptance all implemented

Roadmap changes:
- Phase 9 execution summary: 3/3 plans complete
- Phase 7-9 now 6/11 total v2.0 plans DONE
- Ready for Phase 10 (CRM) and Phase 11 (Auto-provisioning)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-11 07:41:06 +02:00
simone bf0695901f docs(09-03): phase 9 plan 3 execution summary — public quote page complete
- 3 tasks completed (rate limiting, components, page/actions)
- 9 files created, 1 file modified
- Public /quote/[token] route with multistep wizard (3 steps)
- Rate limiting: 3 views/min per IP via proxy middleware
- Immutable quote acceptance with optional email/notes capture
- quote_items never exposed; only accepted_total and phase summary visible
- All threat model mitigations in place
- npm run build: PASS (0 TypeScript errors)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-11 07:40:02 +02:00
simone 5d1736922f docs(09-02): complete Phase 9 Plan 2 execution — admin quote builder UI 2026-06-11 07:35:20 +02:00
simone 5fb34c57a3 docs(09-01): complete Phase 9 Plan 1 execution summary
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-11 07:31:03 +02:00
simone 9ea905cb45 docs(10): phase 10 planning complete — 3 plans (CRM leads + activity logging + follow-ups) 2026-06-11 07:20:37 +02:00
simone 1898dc5ccc docs(state): Phase 8 execution complete — schema foundation ready
- Update progress: 3/8 plans complete (37.5%)
- Update current position: Phase 8 executed, Phase 9 ready for execution
- Add Phase 8 build summary (4 new tables, 7 columns, 5 query functions)
- Update session info with Phase 8 completion
- Update operator next steps: Phase 8 database migration when Postgres ready

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-11 07:17:26 +02:00
simone 7d1006594b docs(08): complete Phase 8 execution summary
Phase 8 (Offer Phases & Quote Builder Schema) — COMPLETE

Tasks executed:
- Task 1: Schema definitions (4 new tables, 7 columns, 6 relations, 10 types)
- Task 2: Migration script (89 lines, additive-only, zero data loss)
- Task 3: Query layer (5 async functions for builder UI)

Deliverables:
- src/db/schema.ts: offer_phases, offer_phase_services, quotes, leads tables
- src/types/offer.ts: Type re-exports (11 types)
- src/db/migrations/0003_offer_phases_quote_templates.sql: Migration ready for Postgres
- scripts/validate-phase8-migration.ts: 10-check validation suite
- src/lib/admin-queries.ts: Query functions (getOfferPhases, getOfferPhaseServices, getQuoteById, getQuoteByToken, getQuotesByClient)

Status: Build verified, all TypeScript checks passed, ready for Phase 9.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-11 07:16:43 +02:00
simone 645f33cdd4 docs(state): phase 8-9 planning complete — 6 plans total ready for execution 2026-06-11 07:08:13 +02:00
simone a98fe7a9f3 docs(09): phase 9 planning complete — 3 plans in 2 waves (schema + admin builder + public quote page)
Phase 9 breaks into two parts:
- Wave 0: Schema foundation (Phase 8) — offer_phases, quotes, quote_items tables + type system
- Wave 1: Admin Quote Builder (/admin/quotes/new) — form, server action, price validation
- Wave 2: Public Quote Page (/quote/[token]) — multistep form, acceptance, rate limiting

Plans:
- 09-01: Database schema (offer_phases, quotes, quote_items) + Drizzle migration + query layer types
- 09-02: Admin builder UI (two-column form, client/offer selection, live preview) + createQuote action
- 09-03: Public quote page (token-gated route, middleware rate limit 3/min, multistep wizard, acceptQuote action)

Key constraints per CLAUDE.md:
- quote_items NEVER exposed to client API (public query layer enforces PublicQuoteView type)
- Server-side price recalculation prevents tampering (client-side total validated against item sum)
- Immutability enforced: accepted_at timestamp immutable once set (DB constraint + app check)
- Token: nanoid 21-char (~122-bit entropy), unique, rate-limited at middleware

Estimated execution: 4-5 days. Wave 0 can run in parallel with Wave 1 (no blocking).

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-11 07:06:47 +02:00
simone 329ccd49b4 docs(09): research phase 9 — quote builder & public routes architecture 2026-06-11 07:01:09 +02:00
simone 06660c3fe6 docs(08): phase 8 planning complete — 1 plan (offer phases + quote templates schema) 2026-06-11 06:54:39 +02:00
simone 243f20f1ad docs(state): phase 7 execution complete — both plans finished (schema migration + admin crud rewire) 2026-06-11 06:29:24 +02:00
simone 02d51179b3 docs(07-unified-service-catalog): complete phase 7 plan 2 execution summary
Phase 7 Plan 2 (Unified Service Catalog - Admin CRUD + Quote Builder) execution complete:
- Task 1: Query layer refactored to read from services table (3 queries updated)
- Task 2: Admin catalog CRUD + UI components rewired to services table with category field
- Task 3: Validation script enhanced with net-new services check

All must-haves satisfied:
- /admin/catalog list/add/edit/soft-delete fully functional on services table
- New services created post-migration have migrated_from=null
- Quote builder service picker reads from services via activeServices
- Historical quote_items.service_id FK to service_catalog remains untouched

Build status: TypeScript OK, npm run build passes
ROADMAP success criteria 3-4 satisfied for CAT-U-02 (admin catalog unification)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-11 06:27:38 +02:00
simone bbc89136f5 docs(state): record phase 7 plan 1 execution completion
Phase 7 Plan 1 (Unified Service Catalog) complete:
- Status: executing (was: planning)
- Progress: 1/5 phases, 1/8 plans completed (12%)
- Current position: Phase 07-unified-service-catalog, Plan 07-01 complete → 07-02 planning
- Last activity: 2026-06-11T04:21:50Z

Phase 7 Plan 1 summary:
- Schema definition with audit trail (migrated_from/migrated_id)
- Idempotent backfill script (56 rows: 21 from service_catalog + 35 from offer_services)
- Zero-data-loss validation suite (5-check verification)
- Database migration pending external connectivity

Next steps: Apply migration when DB reachable, or plan Phase 7-02.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-11 06:23:12 +02:00
simone 02dcc688c8 docs(07-01): complete phase 7 plan 1 summary — unified service catalog expand phase
Phase 7 Plan 1 execution complete:
- Task 1: services table schema with audit trail (migrated_from/migrated_id)
- Task 2: Idempotent backfill script (21 service_catalog + 35 offer_services rows)
- Task 3: Zero-data-loss validation suite (5-check verification)

All code ready to run; database migration pending external DB connectivity.
Schema changes are additive-only, Data Safety LOCKED constraints honored.
No data deleted, no tables dropped, legacy compatibility preserved.

Commits: e4ddb87 (schema), de0888b (scripts)
Duration: 3m 14s
Status: Ready for database migration

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-11 06:22:33 +02:00
simone 23cb057f0b docs(07): phase 7 planning complete — 2 plans (schema migration + admin crud)
Wave 1: 07-01-PLAN.md — Unified services table (audit trail, backfill, validation)
Wave 2: 07-02-PLAN.md — Admin catalog CRUD rewire (preserve historical references)

Ready for execution: /gsd-execute-phase 7

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-11 06:17:29 +02:00
simone bdcdd26f17 docs(07): create phase plan for Unified Service Catalog
Two-plan, two-wave migration: schema + backfill (07-01) then admin
catalog CRUD rewire (07-02), per CAT-U-01/CAT-U-02 and the
expand-contract pattern from PITFALLS_V2 Pitfall 1.
2026-06-11 06:14:05 +02:00
simone 3b1f49d059 docs(v2.0): finalize roadmap + requirements — phases 7-11 approved for planning
- Upgrade PROJECT.md: v2.0 Business Operations Suite (unified catalog, offers with phases, public quotes, CRM pipeline, auto-provisioning)
- Create REQUIREMENTS.md sections: CAT-U, OFFER-B, QUOTE, CRM, WIN requirements for phases 7-11
- Extend ROADMAP.md: 5-phase structure (7-11), 14-19 days total, risk/flag registry
- Archive v1.0 milestone (phases 1-6, complete)
- Switch STATE.md to v2.0, status=planning
- Create research documents: STACK.md, FEATURES_v2.0.md, ARCHITECTURE.md, PITFALLS.md, SUMMARY.md

Ready for: /gsd-plan-phase 7

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-11 06:01:59 +02:00
simone 6239eed6e6 docs(research): complete v2.0 stack, features, architecture, and pitfalls analysis
Synthesized research outputs from 4 parallel researcher agents:
- STACK.md: 7 new npm packages (dnd-kit, TanStack Table, RHF, BullMQ), React 19 compat verified
- FEATURES_v2.0.md: Feature landscape (table stakes, differentiators, anti-features), MVP breakdown
- ARCHITECTURE.md: Schema additions (services, offer_phases, leads, quotes), 5-phase build order
- PITFALLS.md: Critical/moderate/minor pitfalls + prevention strategies

Ready for roadmap planning and phase-by-phase execution.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-11 05:56:55 +02:00
simone 6e97a53b73 docs(06-02): complete dashboard KPI + activity feed plan
- getDashboardStats() in dashboard-queries.ts
- RSC dashboard at /admin with 4 KPI cards + activity feed
- npm run build passes
2026-05-31 20:12:54 +02:00
simone d1d83011aa docs(06-01): complete sidebar layout plan — AdminSidebar + AppShell + /admin/clients 2026-05-31 20:10:13 +02:00
simone 26a688cec8 docs(06): create Phase 6 UX Overhaul plans — sidebar + dashboard (2 plans, 2 waves) 2026-05-31 20:06:53 +02:00
simone 280e177a67 docs(05): add phase 5 verification report 2026-05-30 16:59:01 +02:00
simone 2a5a6fc526 docs(phase-5): complete phase execution — Offer System done 2026-05-30 16:56:33 +02:00
simone fadf72dc35 test(05): persist human verification items as UAT 2026-05-30 16:49:00 +02:00
simone 00783c4c15 docs(05-04): complete client dashboard offer card + admin forecast plan
- SUMMARY.md: 2 tasks, 6 files, commits c398d6d and 745f8a7
- activeOffers in ProjectView/ClientView (public_name only, T-05-09/10 mitigated)
- /admin/forecast 12-month RSC table complete
2026-05-30 16:44:25 +02:00
simone 1001320b36 docs(05-03): complete plan 3 — OffersTab + project offer assignment + client active offers 2026-05-30 16:39:21 +02:00
simone 2faf2fedf1 docs(05-02): complete offer catalog admin CRUD plan — SUMMARY.md
- RSC page at /admin/offers with macro/micro/service CRUD fully functional
- ServiceCheckboxList for many-to-many service assignment
- NavBar updated with Forecast and Offerte links
2026-05-30 16:23:15 +02:00
simone d670d49048 docs(05-01): create SUMMARY.md for Phase 5 Plan 1 — offer schema migration
- Documents schema.ts changes (5 new tables, relations, TypeScript types)
- Documents Phase 4+5 DB migration applied via SSH due to drizzle-kit TTY limitation
- Confirms zero data loss; all 5 clients and related data preserved
2026-05-30 15:33:42 +02:00
simone c83e5e5a7e fix(05): apply checker revisions — OFFER-04 client coverage, RESOLVED questions, wave fix, verify fix
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 15:14:00 +02:00
simone cd55cba56c docs(05): create Phase 5 Offer System plans — 4 plans in 3 waves
Wave 1: 05-01 schema migration (5 new tables, additive only)
Wave 2: 05-02 offer catalog CRUD (/admin/offers + NavBar)
Wave 3: 05-03 project offer assignment (OffersTab) + 05-04 client dashboard offers + /admin/forecast

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 15:07:52 +02:00
simone 4d8678b1a3 docs(04-04): capture phase summary — slug resolution + multi-project dashboard
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 11:37:37 +02:00
simone 5d785a1c1c feat(04-04): slug resolution + multi-project client dashboard + slug edit
- validate-slug API route: resolves clients.slug for Edge middleware
- proxy.ts: slug-first resolution (D-06) — tries slug then falls back to token
- client-view.ts: complete rewrite — getClientWithProjectsByToken + getProjectView
  - No quote_items, no payment amounts in client API (CLAUDE.md security invariants)
- client/[token]/page.tsx: multi-project dashboard — 1 project = direct view,
  2+ projects = shadcn Tabs with project names (D-09/D-10)
- edit/page.tsx: slug field with link preview + unique constraint error handling
- actions.ts: updateClient now persists slug, redirects on success/slug_taken

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 11:31:32 +02:00
simone 5bf5dfce71 infra(04-00): route /c/ → /client/, Dockerfile, Gitea deploy
- Rename src/app/c/[token] → src/app/client/[token]
- Update proxy.ts, ClientRow, admin client detail with /client/ path
- Add output: "standalone" to next.config.ts for Docker build
- Add Dockerfile (multi-stage, node:20-alpine) and .dockerignore
- Push schema to Coolify Postgres via SSH tunnel (drizzle-kit push ✓)
- Update CLAUDE.md constraint 4 to reflect /client/ route
- Add Phase 4 planning artifacts (04-00, 04-RESEARCH, 04-PATTERNS)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 16:12:05 +02:00
simone 49ef45da83 fix(04): revision 1 — depends_on format + D-12 client list coverage
- 04-02/03/04: change depends_on from filename format to plan ID format
  ('04-01-PLAN.md' → '04-01') to match orchestrator expectations and
  Phase 3 precedent
- 04-02: add Task 3 implementing D-12 — /admin/clients list shows brand
  names below client name and LTV as sum of project accepted_totals;
  update getAllClientsWithPayments query and ClientRow component;
  add src/app/admin/page.tsx, src/lib/admin-queries.ts,
  src/components/admin/ClientRow.tsx to files_modified

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 11:10:25 +02:00
simone d210cf6202 docs(04): create phase plan — 4 plans in 2 waves for multi-project architecture
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 11:02:56 +02:00
simone 3e3b34bbe2 docs(04): capture phase context — Progetti multi-project per cliente 2026-05-20 19:16:08 +02:00
Simone Cavalli 67e4483b48 docs(phase-03): complete phase execution — service catalog + quote builder verified 2026-05-19 23:12:59 +02:00
Simone Cavalli fe0a65ebeb docs(03-04): complete E2E verification — all tests approved, phase 3 verified 2026-05-19 23:06:26 +02:00
Simone Cavalli 511c7d1d43 fix: resolve merge conflict in admin-queries.ts — keep both quote_items and service_catalog imports 2026-05-17 11:50:38 +02:00
Simone Cavalli 8641253e85 docs(03-03): complete quote builder plan summary
- SUMMARY.md for plan 03-03 (2/2 tasks complete)
- Covers quote-actions.ts, QuoteTab.tsx, admin-queries extension, page.tsx wiring
- Security verification: requireAdmin on all actions, 0 quote_items in client-view
2026-05-17 11:46:11 +02:00