Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
import { NextRequest, NextResponse } from 'next/server';
|
|
|
|
|
import { createHash } from 'crypto';
|
|
|
|
|
|
|
|
|
|
import { db } from '@/lib/db';
|
2026-04-27 13:46:48 +02:00
|
|
|
import { verifyDocumensoSecret } from '@/lib/services/documenso-webhook';
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
import {
|
|
|
|
|
handleRecipientSigned,
|
|
|
|
|
handleDocumentCompleted,
|
2026-05-02 23:00:58 +02:00
|
|
|
handleDocumentExpired,
|
2026-04-27 13:46:48 +02:00
|
|
|
handleDocumentOpened,
|
|
|
|
|
handleDocumentRejected,
|
|
|
|
|
handleDocumentCancelled,
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
} from '@/lib/services/documents.service';
|
|
|
|
|
import { env } from '@/lib/env';
|
|
|
|
|
import { logger } from '@/lib/logger';
|
|
|
|
|
|
|
|
|
|
// BR-024: Dedup via signatureHash unique index on documentEvents
|
|
|
|
|
// Always return 200 from webhook (webhook best practice)
|
|
|
|
|
|
2026-04-27 13:46:48 +02:00
|
|
|
// Documenso emits Prisma enum names on the wire (e.g. "DOCUMENT_SIGNED").
|
|
|
|
|
// The UI displays them as lowercase-dotted ("document.signed") but the JSON
|
|
|
|
|
// body uses the enum value as-is. Normalize both forms in case 2.x ever flips.
|
|
|
|
|
function canonicalizeEvent(event: string): string {
|
|
|
|
|
return event.toUpperCase().replace(/\./g, '_');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type DocumensoRecipient = {
|
|
|
|
|
email: string;
|
|
|
|
|
signingStatus?: string;
|
|
|
|
|
readStatus?: string;
|
|
|
|
|
signedAt?: string | null;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
type DocumensoWebhookBody = {
|
|
|
|
|
event: string;
|
|
|
|
|
payload: {
|
|
|
|
|
id: number | string;
|
|
|
|
|
recipients?: DocumensoRecipient[];
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
export async function POST(req: NextRequest): Promise<NextResponse> {
|
2026-04-27 13:46:48 +02:00
|
|
|
let rawBody: string;
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
|
|
|
|
|
try {
|
2026-04-27 13:46:48 +02:00
|
|
|
rawBody = await req.text();
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
} catch {
|
|
|
|
|
return NextResponse.json({ ok: false }, { status: 200 });
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-27 13:46:48 +02:00
|
|
|
// Documenso v1.13 + 2.x send the secret in plaintext via X-Documenso-Secret.
|
|
|
|
|
const providedSecret = req.headers.get('x-documenso-secret') ?? '';
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
|
2026-04-27 13:46:48 +02:00
|
|
|
if (!verifyDocumensoSecret(providedSecret, env.DOCUMENSO_WEBHOOK_SECRET)) {
|
|
|
|
|
logger.warn({ providedLen: providedSecret.length }, 'Invalid Documenso webhook secret');
|
|
|
|
|
return NextResponse.json({ ok: false, error: 'Invalid secret' }, { status: 200 });
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Compute deduplication hash
|
2026-04-27 13:46:48 +02:00
|
|
|
const signatureHash = createHash('sha256').update(rawBody).digest('hex');
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
|
2026-04-27 13:46:48 +02:00
|
|
|
let parsed: DocumensoWebhookBody;
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
|
|
|
|
|
try {
|
2026-04-27 13:46:48 +02:00
|
|
|
parsed = JSON.parse(rawBody) as DocumensoWebhookBody;
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
} catch {
|
|
|
|
|
logger.warn('Failed to parse Documenso webhook payload');
|
|
|
|
|
return NextResponse.json({ ok: false }, { status: 200 });
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-27 13:46:48 +02:00
|
|
|
// Replay guard: if any event with this hash already exists, skip.
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
try {
|
|
|
|
|
const existing = await db.query.documentEvents.findFirst({
|
|
|
|
|
where: (de, { eq }) => eq(de.signatureHash, signatureHash),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (existing) {
|
2026-05-04 22:57:01 +02:00
|
|
|
logger.info({ signatureHash }, 'Duplicate Documenso webhook - skipping');
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
return NextResponse.json({ ok: true }, { status: 200 });
|
|
|
|
|
}
|
|
|
|
|
} catch (err) {
|
|
|
|
|
logger.error({ err }, 'Failed to check duplicate webhook');
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-27 13:46:48 +02:00
|
|
|
const event = canonicalizeEvent(parsed.event);
|
|
|
|
|
const documensoId = String(parsed.payload?.id ?? '');
|
|
|
|
|
const recipients = parsed.payload?.recipients ?? [];
|
|
|
|
|
|
|
|
|
|
if (!documensoId) {
|
|
|
|
|
logger.warn({ event }, 'Documenso webhook missing payload.id');
|
|
|
|
|
return NextResponse.json({ ok: true }, { status: 200 });
|
|
|
|
|
}
|
|
|
|
|
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
try {
|
2026-04-27 13:46:48 +02:00
|
|
|
switch (event) {
|
|
|
|
|
case 'DOCUMENT_SIGNED':
|
|
|
|
|
case 'DOCUMENT_RECIPIENT_COMPLETED': {
|
|
|
|
|
// v1.13 fires DOCUMENT_SIGNED per recipient sign;
|
|
|
|
|
// 2.x fires DOCUMENT_RECIPIENT_COMPLETED for the same semantics.
|
|
|
|
|
const signedRecipients = recipients.filter(
|
|
|
|
|
(r) => r.signingStatus === 'SIGNED' || Boolean(r.signedAt),
|
|
|
|
|
);
|
|
|
|
|
for (const r of signedRecipients) {
|
|
|
|
|
await handleRecipientSigned({
|
|
|
|
|
documentId: documensoId,
|
|
|
|
|
recipientEmail: r.email,
|
|
|
|
|
signatureHash: `${signatureHash}:signed:${r.email}`,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case 'DOCUMENT_OPENED': {
|
fix(audit-v2): platform-wide post-merge hardening across 5 domains
Five-domain audit (security, routes, DB, integrations, UI/UX) ran after
the cf37d09 merge. Critical + high-impact items landed here; deferred
medium/low items indexed in docs/audit-final-deferred.md (now organised
into a "Audit-final v2" section).
Security:
- Storage proxy tokens now bind to op (`'get'` vs `'put'`). A long-lived
download URL minted by `presignDownload` for an emailed brochure can no
longer be replayed against the proxy PUT to overwrite the original
storage object. `verifyProxyToken` requires `expectedOp` and rejects
mismatches; legacy tokens missing `op` fail-closed. Regression tests
added.
- Markdown email merge values are now markdown-escaped (`[`, `]`, `(`,
`)`, `*`, `_`, `\`, backticks, braces) before substitution into the
rep-authored body. A malicious value like `[click here](https://evil)`
stored in `client.fullName` no longer survives `escapeHtml` to render
as a real `<a href>` in the outbound email. Phishing-via-merge-field
closed; regression tests added.
- Middleware now performs an Origin/Referer check on
POST/PUT/PATCH/DELETE to `/api/v1/**`. Defense-in-depth on top of
better-auth's SameSite=Lax cookie. Webhooks/public/auth/portal routes
exempt as they don't carry the session cookie.
Routes:
- Template management routes were calling `withPermission('documents',
'manage', ...)` — but `documents` doesn't have a `manage` action. The
registry has `document_templates.manage`. Every non-superadmin was
getting 403'd on the seven template endpoints. Fixed across the
/admin/templates surface.
- Custom-fields permission resource is hardcoded to `clients` regardless
of which entity (yacht/company/etc.) the values belong to. Documented
as deferred (requires per-entity routes).
DB:
- documentSends: every parent FK (client_id, interest_id, berth_id,
brochure_id, brochure_version_id) now uses ON DELETE SET NULL so the
audit trail outlasts hard-deletes. The denormalized columns
(recipient_email, document_kind, body_markdown, from_address) were
added precisely for this. Migration 0035.
- Polymorphic discriminators on yachts.current_owner_type and
invoices.billing_entity_type now have CHECK constraints — typos like
`'clients'` vs `'client'` were silently inserting unreachable rows
before. Migration 0036.
Integrations:
- Email attachment resolution (`src/lib/email/index.ts`) was importing
MinIO directly instead of `getStorageBackend()`. Filesystem-backend
deployments would have broken every email-with-attachment send. Now
routes through the pluggable abstraction per CLAUDE.md.
- Documenso DOCUMENT_OPENED webhook filter relaxed: v2 may omit
`readStatus` or send lowercase, so an event that was the SIGNAL of an
open was being silently dropped. Now treats any recipient on a
DOCUMENT_OPENED event as opened.
UI/UX:
- Expense detail used to render `receiptFileIds` as opaque UUID badges —
reps couldn't view the receipt they uploaded. Now renders an image
thumbnail (via `/api/v1/files/[id]/preview`) plus a Download link for
PDFs. Closed the "where's my receipt?" loop in the expense flow.
- Expense detail Edit + Archive buttons now `<PermissionGate>` and the
archive mutation surfaces success/error toasts instead of silent 403s.
- Brochures admin: setDefault/archive/create mutations now have onError
toasts (only onSuccess existed before).
- Removed broken bulk-upload link in scan/page (route doesn't exist;
used a raw `<a>` triggering a full reload to a 404).
Test status: 1168/1168 vitest passing. tsc clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 05:51:39 +02:00
|
|
|
// Documenso v1 sends `readStatus: 'OPENED'`; v2 has used both
|
|
|
|
|
// upper and lower case across releases and may omit the field
|
|
|
|
|
// entirely (the event itself signals the open). Treat the event
|
|
|
|
|
// as the signal: dispatch a per-recipient open for every
|
|
|
|
|
// recipient on the document so v2 deployments stop silently
|
|
|
|
|
// dropping opens.
|
|
|
|
|
const openedRecipients = recipients.filter(
|
|
|
|
|
(r) => !r.readStatus || String(r.readStatus).toUpperCase() === 'OPENED',
|
|
|
|
|
);
|
2026-04-27 13:46:48 +02:00
|
|
|
for (const r of openedRecipients) {
|
|
|
|
|
await handleDocumentOpened({
|
|
|
|
|
documentId: documensoId,
|
|
|
|
|
recipientEmail: r.email,
|
|
|
|
|
signatureHash: `${signatureHash}:opened:${r.email}`,
|
|
|
|
|
});
|
|
|
|
|
}
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
break;
|
2026-04-27 13:46:48 +02:00
|
|
|
}
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
|
|
|
|
|
case 'DOCUMENT_COMPLETED':
|
2026-04-27 13:46:48 +02:00
|
|
|
await handleDocumentCompleted({ documentId: documensoId });
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
break;
|
|
|
|
|
|
2026-04-27 13:46:48 +02:00
|
|
|
case 'DOCUMENT_REJECTED': {
|
|
|
|
|
const rejecting = recipients.find((r) => r.signingStatus === 'REJECTED');
|
|
|
|
|
await handleDocumentRejected({
|
|
|
|
|
documentId: documensoId,
|
|
|
|
|
recipientEmail: rejecting?.email,
|
|
|
|
|
signatureHash,
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
});
|
|
|
|
|
break;
|
2026-04-27 13:46:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case 'DOCUMENT_CANCELLED':
|
|
|
|
|
await handleDocumentCancelled({ documentId: documensoId, signatureHash });
|
|
|
|
|
break;
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
|
2026-05-02 23:00:58 +02:00
|
|
|
case 'DOCUMENT_EXPIRED':
|
|
|
|
|
await handleDocumentExpired({ documentId: documensoId });
|
|
|
|
|
break;
|
|
|
|
|
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
default:
|
2026-04-27 13:46:48 +02:00
|
|
|
logger.info({ event }, 'Unhandled Documenso webhook event type');
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
}
|
|
|
|
|
} catch (err) {
|
2026-04-27 13:46:48 +02:00
|
|
|
logger.error({ err, event }, 'Error processing Documenso webhook');
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NextResponse.json({ ok: true }, { status: 200 });
|
|
|
|
|
}
|