Commit Graph

100 Commits

Author SHA1 Message Date
simone 8bdc854a6a docs(12-03): complete offer editor query layer & server actions plan
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-15 10:18:46 +02:00
simone e2d6e97168 docs(phase-12): update tracking after wave 2 checkpoint
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 09:50:23 +02:00
simone d4c89b4170 docs(12-02): apply migration 0008 to production (blocking checkpoint complete)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 09:50:23 +02:00
simone b8f14fad4d docs(phase-12): update tracking after wave 1
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 21:22:37 +02:00
simone b80f0563b8 docs(12-01): fix markdown lint formatting in summary
- Add blank lines around headings and lists per MD022/MD032
2026-06-14 21:21:37 +02:00
simone bfc99329c5 docs(12-01): complete offer tier schema foundation plan
- Add 12-01-SUMMARY.md documenting additive schema extension, migration 0008, and push script
2026-06-14 21:20:28 +02:00
simone 1414c3e95c docs(12): finalize wave resequencing in plans and tracking
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 21:15:09 +02:00
simone 640f986967 docs(12): create phase plan
Re-scoped Offer Editor (Tier A/B/C, Tag & Prezzo Pubblico) per 2026-06-14
user decision: 5-plan wave structure (schema migration -> prod apply
checkpoint -> query/action layer -> list + detail editor UI), OFFER-12
CSV/Notion import deferred.
2026-06-14 21:00:32 +02:00
simone 9bff7623da docs: move CRM Attio-style requirements to Validated (Phase 14)
PROJECT.md: CRM-08..12 moved from Active to Validated in v2.1,
referencing Phase 14 completion.
2026-06-14 15:27:07 +02:00
simone fa5672025f docs(14): mark phase complete, advance roadmap to Phase 15
phase complete 14: ROADMAP plans/progress, STATE position (Phase 15
next, blocked on user mockup), REQUIREMENTS CRM-08..12 -> Complete.
2026-06-14 15:22:40 +02:00
simone 2c227f4ef1 docs(14): add code review report and phase verification (passed)
14-REVIEW.md: 0 critical, 6 warnings, 3 info (standard depth, 11 files).
14-VERIFICATION.md: 5/5 success criteria verified after closing the
SC5/CRM-12 generate_new dead-branch gap.
2026-06-14 15:20:08 +02:00
simone 2a02ca8fbf docs(14-02): add plan summary for LeadTable Attio rewrite 2026-06-14 13:24:47 +02:00
simone 39bd1ce2eb chore: merge executor worktree (worktree-agent-aaf61d7161f7818a0)
# Conflicts:
#	.planning/phases/14-crm-attio-style-fix/deferred-items.md
2026-06-14 12:51:37 +02:00
simone 3c53672754 docs(14-03): append self-check results to plan summary 2026-06-14 12:49:41 +02:00
simone 6b51403404 docs(14-03): complete CRM residual bug fixes plan
Summary for 14-03: FollowUpWidget Italian translation (CRM-10), LeadForm typed useForm (CRM-11) + shared FormField generic fix, SendQuoteModal dead branch removal (CRM-12)
2026-06-14 12:48:53 +02:00
simone a495d84511 fix(14-03): remove dead onSubmit branch in SendQuoteModal (CRM-12)
- Remove unreachable if (tab === "new") branch in onSubmit - the new-tab button has its own onClick navigation and never triggers form submit
- Escape unescaped double quotes in JSX text (react/no-unescaped-entities)
- generate_new field left as-is per plan (optional cleanup, out of scope)
- Log pre-existing useForm<any>/onSubmit(data: any) no-explicit-any lint errors to deferred-items.md (out of scope: fixing requires resolving a zodResolver/Resolver generic incompatibility with assignQuoteSchema's optional/default fields)
2026-06-14 12:46:55 +02:00
simone f21f13909d docs(14-01): append self-check results to SUMMARY
- Verified created/modified files exist and task commits are present
  in git history
2026-06-14 12:44:19 +02:00
simone d1acfe9127 docs(14-01): complete lead data-layer foundation plan
- SUMMARY documents getLeadsWithTags/getLeadFieldOptions and
  updateLeadField/addLeadTag/removeLeadTag/renameLeadTag additions
- Logs 2 pre-existing lint issues (deferred-items.md) unrelated to
  this plan's changes
2026-06-14 12:43:21 +02:00
simone 7d98b27e75 feat(14-01): add updateLeadField and lead tag CRUD server actions
- requireAdmin() guard (mirrors catalog/actions.ts pattern), throws
  "Non autorizzato" before any DB access
- updateLeadField: EDITABLE_FIELDS allowlist, name/status validated
  server-side (LEAD_STAGES.includes), nullable fields cleared on empty
- addLeadTag/removeLeadTag/renameLeadTag: polymorphic tags table scoped
  to entity_type="leads" (LEADS_TAG_ENTITY), never touches
  entity_type="services" rows
- All four actions call revalidatePath for /admin/leads (+ detail page
  where a single leadId applies)
- Log pre-existing lint issues (unrelated to this task) to
  deferred-items.md per scope-boundary rule
2026-06-14 12:41:36 +02:00
simone f5309345b9 docs(14): annotate plan waves and update milestone progress
Wave-dependency annotations for Phase 14 (14-01/14-03 wave 1, 14-02 wave 2)
and corrected v2.1 progress tracking (4/7 plans, current focus → Phase 14).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 12:30:38 +02:00
simone d115465240 docs(14): create phase plan
Plan Phase 14 (CRM Attio-style & Fix) into 3 waves: data-layer
foundation (query helpers + server actions), LeadTable raw-table
rewrite with inline edit/tags, and isolated bug fixes for CRM-10/11/12.
2026-06-14 12:09:45 +02:00
simone 89adf7a1d4 docs(14): UI design contract for CRM Attio-style redesign
UI-SPEC approved (5/6 PASS, 1 non-blocking flag on focal point).
Locks reuse of Phase 11 primitives (EditableCell, OptionSelect,
OptionMultiSelect) for the leads table, plus scope for the four
CRM bug fixes (i18n, type-safety, dead code).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 11:23:28 +02:00
simone 8d62207ccb docs(phase-11): complete phase — OFFER-13 migration applied to prod DB, all validators passed
Tags table + legacy consolidation applied via SSH tunnel to Coolify Postgres.
Both validators: ALL CHECKS PASSED. Protected tables (clients/projects/payments/phases) unchanged.
Phase 11 verification: passed (OFFER-07/08/09/10/13 all Complete).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 20:31:20 +02:00
simone 1e4f917b51 docs(phase-11): add code review + verification (code-complete, DB migration pending)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 16:35:02 +02:00
simone 0387805041 docs(11-04): complete catalog database-view plan
- Mark OFFER-10 complete (REQUIREMENTS.md) — client-side search delivered
- STATE.md: position advanced to Phase 11 plans 1-4 all executed (92%), session/decisions/metrics updated
- 11-04-SUMMARY.md: append self-check results
2026-06-13 16:05:13 +02:00
simone 9bc1e43738 docs(11-04): add plan summary and log unused createService action
- 11-04-SUMMARY.md documents ServiceTable database-view rewrite + CatalogSearch
- deferred-items.md: log now-unused createService/serviceSchema in actions.ts (item 6)
2026-06-13 16:03:10 +02:00
simone e424653ece docs(11-03): complete EditableCell + TagMultiSelect plan
- add 11-03-SUMMARY.md documenting EditableCell/TagMultiSelect delivery
  and the react-hooks lint-rule fix (Rule 1 deviation)
- update STATE.md position (3 of 4 -> 4 of 4), progress 86% -> 89%,
  performance metrics, and decisions log
- log gsd-sdk unavailability and OFFER-07/08 status timing as deferred
  items for Phase 11
2026-06-13 15:56:06 +02:00
simone 62d5e97f39 docs(11-02): complete catalog query layer + server actions plan
- SUMMARY.md for Plan 02 (ServiceWithTags + 4 new server actions)
- STATE.md: advance to Plan 3/4, record metrics and decision
- REQUIREMENTS.md: mark OFFER-07/08/09 backend foundation complete
2026-06-13 15:47:07 +02:00
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