docs(20): commit plan summaries 20-02 and 20-03
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
phase: 20-knowledge-base-cliente
|
||||||
|
plan: "02"
|
||||||
|
status: complete
|
||||||
|
completed_at: "2026-06-20"
|
||||||
|
---
|
||||||
|
|
||||||
|
# Plan 20-02 Summary: Data Layer client_transcripts
|
||||||
|
|
||||||
|
## What Was Built
|
||||||
|
|
||||||
|
Drizzle schema, query layer e server actions per i transcript delle call.
|
||||||
|
|
||||||
|
## Key Files Modified
|
||||||
|
|
||||||
|
- `src/db/schema.ts` — tabella `clientTranscripts` + relazioni bidirezionali + TypeScript types
|
||||||
|
- `src/lib/lead-service.ts` — `getTranscripts(leadId)` con orderBy call_date DESC
|
||||||
|
- `src/app/admin/leads/actions.ts` — `addTranscript` + `deleteTranscript` con requireAdmin
|
||||||
|
|
||||||
|
## Self-Check: PASSED
|
||||||
|
|
||||||
|
- ✓ `export const clientTranscripts = pgTable("client_transcripts", ...)` in schema.ts
|
||||||
|
- ✓ `leadsRelations` aggiornato con `transcripts: many(clientTranscripts)`
|
||||||
|
- ✓ `clientsRelations` aggiornato con `transcripts: many(clientTranscripts)`
|
||||||
|
- ✓ `clientTranscriptsRelations` con one(leads) + one(clients)
|
||||||
|
- ✓ `export type ClientTranscript` e `NewClientTranscript` esportati
|
||||||
|
- ✓ `getTranscripts(leadId)` ordinato per `call_date DESC`
|
||||||
|
- ✓ `addTranscript` con requireAdmin + Zod + revalidatePath
|
||||||
|
- ✓ `deleteTranscript` con requireAdmin + revalidatePath
|
||||||
|
- ✓ `npx tsc --noEmit` → no errors
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
---
|
||||||
|
phase: 20-knowledge-base-cliente
|
||||||
|
plan: "03"
|
||||||
|
status: complete
|
||||||
|
completed_at: "2026-06-20"
|
||||||
|
---
|
||||||
|
|
||||||
|
# Plan 20-03 Summary: UI Transcript Call
|
||||||
|
|
||||||
|
## What Was Built
|
||||||
|
|
||||||
|
UI completa per aggiungere, visualizzare ed eliminare i transcript delle call nel profilo lead.
|
||||||
|
|
||||||
|
## Key Files
|
||||||
|
|
||||||
|
### Created
|
||||||
|
- `src/components/admin/leads/TranscriptModal.tsx` — modal form (call_date + title + content textarea min-h-48)
|
||||||
|
|
||||||
|
### Modified
|
||||||
|
- `src/components/admin/leads/LeadDetail.tsx` — prop `transcripts: ClientTranscript[]`, sezione "Transcript Call" con expand/collapse e Elimina, TranscriptModal nel header
|
||||||
|
- `src/app/admin/leads/[id]/page.tsx` — `getTranscripts(id)` nel Promise.all, prop `transcripts` passato a LeadDetail
|
||||||
|
|
||||||
|
## Self-Check: PASSED
|
||||||
|
|
||||||
|
- ✓ `TranscriptModal.tsx` esiste con form call_date/title/content (min-h-48)
|
||||||
|
- ✓ `LeadDetail.tsx` ha prop `transcripts: ClientTranscript[]`
|
||||||
|
- ✓ Sezione "Transcript Call" appare dopo "Storico Attività"
|
||||||
|
- ✓ Data formattata in italiano con `new Date(t.call_date + "T00:00:00")` (fix TZ shift)
|
||||||
|
- ✓ Preview 3 righe/200 caratteri con toggle "Mostra tutto / Mostra meno"
|
||||||
|
- ✓ Bottone "Elimina" via `deleteTranscript` server action
|
||||||
|
- ✓ `border-l-4 border-purple-300` — stile distinto dal blu delle attività
|
||||||
|
- ✓ `getTranscripts(id)` nel Promise.all di page.tsx
|
||||||
|
- ✓ `npx tsc --noEmit` → no errors
|
||||||
|
- ✓ `npm run build` → clean
|
||||||
Reference in New Issue
Block a user