Kanban board, Project Management, Proposals/Quotes, Time Tracking, Custom Fields
Build & Auto-Repair / build (push) Has been cancelled

- Kanban board with drag-and-drop per stage, colour-coded cards, score bars
- Project Management with milestones, Gantt timeline, inline add milestone/task
- Proposal/Quote builder with line items, VAT, terms, e-signature capture
- Time Tracking with stopwatch, manual entry, hours-by-project chart
- Custom Fields system: admin-defined fields per entity (leads/customers/
  projects/opportunities) with drag-and-drop reordering in settings
- Reusable CustomFieldsSection component for entity detail pages
- Customers API endpoint
- All builds pass with zero errors
This commit is contained in:
2026-07-01 11:18:59 +02:00
parent 5d971dc749
commit 545065b527
38 changed files with 3770 additions and 4 deletions
+6
View File
@@ -28,6 +28,7 @@ export async function GET(request: NextRequest, { params }: { params: Promise<{
const result = await query(
`SELECT l.id, l.company_name, l.contact_name, l.email, l.phone, l.score,
l.assigned_to, l.created_at, l.updated_at, l.notes, l.source_id,
l.custom_fields,
ls.name AS stage_name,
u.id AS user_id, u.first_name, u.last_name, u.email AS user_email, u.avatar_url
FROM leads l
@@ -59,6 +60,7 @@ export async function GET(request: NextRequest, { params }: { params: Promise<{
email: r.user_email,
avatar: avatarSvgUrl(`${r.first_name} ${r.last_name}`),
} : null,
customFields: r.custom_fields || {},
createdAt: r.created_at,
updatedAt: r.updated_at,
}
@@ -135,6 +137,10 @@ export async function PATCH(request: NextRequest, { params }: { params: Promise<
fields.push(`score = $${idx++}`)
values.push(score)
}
if (body.customFields !== undefined) {
fields.push(`custom_fields = $${idx++}`)
values.push(JSON.stringify(body.customFields))
}
if (fields.length === 0) {
return NextResponse.json({ error: "No fields to update" }, { status: 400 })