Commit Graph

131 Commits

Author SHA1 Message Date
simone 86e1499e8f feat: Quiet Luxury design system + Pipeline (ex-Lead) redesign
- Design system foundations: Plus Jakarta Sans font, shadow-card/radius
  tokens in @theme, design-reference/DESIGN-SYSTEM.md with component inventory
- Collapsible admin shell (AdminShell): smooth w-64<->w-20 sidebar, new top
  header with "Admin" + avatar placeholder, localStorage-persisted state
- Rename route /admin/leads -> /admin/pipeline (redirect stubs preserved),
  nav label Lead -> Pipeline; DB table unchanged
- Reusable primitives: StatusBadge, SearchInput, SegmentedToggle (dual-theme)
- Luxury restyle of lead table, kanban (6 stages + @dnd-kit intact), PageHeader
- Tokenize editable-cell / option-multi-select for dark-mode legibility

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-10 16:16:44 +02:00
simone add2176a6b feat: tier names + per-tier prices on offer cards, unified admin UI
- offer editor: per-tier name input (mirrors public_name/internal_name)
- offer list cards: show 3-tier services total + manual public price
- shared PageHeader component, full-width layout across all admin pages
- UI-RULES.md design conventions doc

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 16:58:18 +02:00
simone 1824cb643f feat: wire offer→project phases/tasks, redo Offerte tab, cleanup project tabs
- importOfferIntoProject(): materializes project phases/tasks from the assigned
  tier's services grouped by services.fase (merge-by-title, dedup tasks)
- assignOfferToProject: optional import_phases flag triggers the import
- getProjectFullDetail: projectOffers/availableMicros now include macro name +
  tier_letter (dropdown shows "Offerta — Tier X"); availableMicros filters
  non-archived macros
- OffersTab redone: shows macro + tier badge, "Importa fasi e task" checkbox
- removed project "Preventivo" tab + deleted QuoteTab.tsx (legacy quote_items)
- sidebar: Lead before Clienti
- no DB migration (reuses existing tables)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 09:08:28 +02:00
simone ba3e824157 docs: create milestone v2.3 roadmap (3 phases, 9 requirements mapped)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 11:23:56 +02:00
simone 19a7ffb6a6 docs: define milestone v2.3 requirements (9 reqs — OTP gate + email send)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 11:01:28 +02:00
simone bc9051c899 docs: start milestone v2.3 Email & Accesso
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 10:54:14 +02:00
simone 55a2da5faf chore: remove REQUIREMENTS.md for v2.2 milestone — fresh for v2.3 2026-06-20 18:31:13 +02:00
simone fb1ef95c96 chore: archive v2.2 Sales Loop milestone
- ROADMAP.md: collassato a milestone summary, v2.2 in <details>
- PROJECT.md: full evolution review — What This Is, Validated v2.2, Active v2.3, Key Decisions aggiornate
- MILESTONES.md: entry v2.2 + entry v2.1 aggiunti
- milestones/v2.2-ROADMAP.md: archivio completo fasi 18-22
- milestones/v2.2-REQUIREMENTS.md: archivio requirements con outcomes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-20 18:31:08 +02:00
simone cbfd959c36 docs(v2.2): close planning docs — SUMMARY.md 21+22, req Complete
- 21-01-SUMMARY.md: agente AI Opus 4.8, schema Zod, proposals table
- 22-01-SUMMARY.md: deck 20+ slide 100vh, accept/reject, PUB-03 deferred
- REQUIREMENTS.md: PIPE/KB/AI-01/02 + PUB-01/02 → Complete; PUB-03 deferred
- ROADMAP.md: Phase 20/21/22 → [x] con date
- STATE.md: status complete, percent 100, 5/5 fasi

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-20 18:24:00 +02:00
simone fdcc938252 feat(21-22): agente AI generazione preventivo + pagina pubblica deck
- Migration 0010: tabella proposals (id, slug, lead_id, client_id,
  offer_macro_id, content jsonb, state, selected_tier, accepted_at)
  applicata a prod via SSH tunnel
- @anthropic-ai/sdk@0.105.0 installato; ANTHROPIC_API_KEY in .env.local
- src/lib/proposal/: schema Zod ProposalContent, agente Claude Opus 4.8,
  assemble (AI + offerta DB + config consulente), queries, profile.ts
- Admin: /admin/preventivi lista + /genera (pre-fill ?lead_id=X) + /[id] review
- Sidebar: voce Preventivi + CTA globale lime "Genera preventivo"
- LeadDetail: pulsante "Genera preventivo" → /admin/preventivi/genera?lead_id=X
- Pagina pubblica /preventivo/[slug]: deck 20+ slide light-mode iamcavalli,
  navigazione frecce + dot + keyboard, accept/reject con guard immutabilità
- STATE.md aggiornato (80%), 21-PLAN.md scritto nel formato GSD

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-20 14:37:05 +02:00
simone 86c86cd420 docs(21): capture phase context — AI preventivo struttura sezioni fisse, 3 tier 2026-06-20 12:24:52 +02:00
simone 009466ac18 docs(20): commit plan summaries 20-02 and 20-03
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-20 08:58:24 +02:00
simone a46e8b0bc8 docs(20-01): plan 20-01 complete — migration 0009 applied to prod
client_transcripts table verified in production: 7 columns (id, lead_id,
client_id, title, content, call_date, created_at). Applied via SSH tunnel.
Plans 20-02 and 20-03 unblocked.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-20 08:54:06 +02:00
simone dc934fb04a docs(20): create phase plan — Knowledge Base Cliente transcript
3 piani: 20-01 migration BLOCKING, 20-02 schema+actions, 20-03 UI.
KB-01 e KB-02 coperti. Wave 1→2→3 sequenziali per vincolo migration-prima-del-codice.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 18:52:16 +02:00
simone 3e10f97215 docs(20): capture phase context — Knowledge Base Cliente
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 18:26:02 +02:00
simone b7ff3fe430 docs(phase-19): verification passed — PIPE-01 PIPE-02 complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 18:10:42 +02:00
simone bac757a987 docs(phase-19): complete plan 19-01 — LeadsKanbanBoard + toggle PIPE-01/PIPE-02
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 18:07:44 +02:00
simone 5e4b2239cb docs(phase-19): create phase plan — LeadsKanbanBoard + view toggle (PIPE-01, PIPE-02)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 17:37:32 +02:00
simone 84c426e66c docs(phase-18): complete phase — all 3 plans done, state advanced to Phase 19
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 17:17:53 +02:00
simone 044a056480 docs(phase-18): plan 03 — mark CLEAN-01..04 complete, build verified
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 16:20:50 +02:00
simone afe4274de9 docs(18-02): complete plan — analytics consolidated into admin dashboard 2026-06-19 12:09:54 +02:00
simone c00ec25e48 docs(18-01): complete plan — remove forecast and manual quote builder routes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 12:09:17 +02:00
simone b3670d164b docs(phase-18): create phase plan — cleanup & consolidamento
3 piani in 2 wave: 18-01 (rimozioni Forecast+QuoteBuilder),
18-02 (fusione analytics→dashboard), 18-03 (CLEAN-04 verify + build check).
ROADMAP.md aggiornato con plan list Phase 18.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 11:51:03 +02:00
simone 10a390239a docs: reset milestone v2.2 "Sales Loop"
Strategic reset after articulating the real sales flow (piano in
.claude/plans/glittery-sprouting-pudding.md). v2.1 delivered Offer Studio
(Phase 11+12) + CRM Attio (Phase 14); residual phases re-scoped:

- Phase 13 (Servizi Attivi) → frozen (touches post-sale portal, kept as-is)
- Phase 15 (Dashboard Revenue) → dropped (analytics merges into dashboard)
- Phase 16/17 (Proposal AI) → re-scoped into v2.2 with transcripts added

New milestone v2.2 = sales loop, Phase 18→22 (R1→R5):
- R1 Cleanup: remove forecast + manual quote builder, merge analytics into dashboard
- R2 Pipeline CRM Kanban (Pipedrive-style)
- R3 Knowledge Base (dated call transcripts per lead/client)
- R4 AI agent (admin picks offer, Claude personalizes proposal from transcripts)
- R5 Public /preventivo/[slug] page + email

New requirements: CLEAN-01..04, PIPE-01/02, KB-01/02, AI-01/02, PUB-01/02/03.
Updated ROADMAP, REQUIREMENTS, STATE, PROJECT. No code changed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 11:37:08 +02:00
simone 56f9fd1d07 docs(phase-12): complete phase execution
Phase 12 (Offer Editor: Tier A/B/C, Tag & Prezzo Pubblico) fully executed
and verified. All 5 plans complete, build gate passed, 5/5 requirements
confirmed in codebase (OFFER-11, OFFER-15, OFFER-16, OFFER-17, OFFER-18).

- 12-REVIEW.md: 0 critical, 6 warnings, 4 info (advisory, non-blocking)
- 12-VERIFICATION.md: all requirements PASS
- REQUIREMENTS.md: OFFER-11/15/16/17/18 → Complete
- STATE.md: advanced to Phase 13 as next

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 17:24:19 +02:00
simone 9a74e5ccfa docs(phase-12): update tracking after wave 4
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 10:31:07 +02:00
simone 791a6e64b1 chore: merge executor worktree (worktree-agent-a44f854f45ac76582) 2026-06-15 10:28:07 +02:00
simone a486d27a2b docs(12-04): append self-check results to plan summary 2026-06-15 10:26:58 +02:00
simone ca3712612f docs(12-04): add plan summary for offer list page redesign 2026-06-15 10:26:38 +02:00
simone b7203c3da2 docs(12-05): complete offer editor detail page plan
- Add 12-05-SUMMARY.md documenting OfferEditorClient + edit route
2026-06-15 10:26:24 +02:00
simone e46607d217 docs(phase-12): update tracking after wave 3
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 10:19:52 +02:00
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