refactor(terminology): "deal" → "interest" sweep + route rename
Step 7 per PRE-DEPLOY-PLAN § 1.7. The canonical noun for an in-flight sales record is "interest" everywhere in the codebase — entity name, schema, kanban label, URL, etc. Customer-visible "deal" remnants are either a holdover from pre-refactor copy or hand-written admin descriptions that drifted. Sweeps applied: - /admin/qualification-criteria description: "before a deal moves out of the Enquiry stage" → "before an interest moves out…" - /admin/documenso descriptions (×3): "per-deal upload-and-place…" → "per-interest upload-and-place…"; "upload per deal" → "upload per interest"; "drafted per deal" → "drafted per interest". - bulk-archive-wizard.tsx placeholder: "late-stage deal" → "late-stage interest". - smart-archive-dialog.tsx title: "Late-stage deal" → "Late-stage interest". - /api/v1/berths/[id]/deal-documents → /api/v1/berths/[id]/interest-documents (route directory renamed; the single in-tree caller in berth-deal-documents-tab.tsx updated to match; React Query key also switched to "berth-interest-documents" for cache hygiene). The `BerthDealDocumentsTab` component name + `berth-deal-documents-tab.tsx` file path are intentionally left as-is — pure aliases, internal to the codebase, churn cost > readability win. Rename when next touched. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
26
src/app/api/v1/berths/[id]/interest-documents/route.ts
Normal file
26
src/app/api/v1/berths/[id]/interest-documents/route.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
|
||||
import { withAuth, withPermission } from '@/lib/api/helpers';
|
||||
import { errorResponse, NotFoundError } from '@/lib/errors';
|
||||
import { listDealDocumentsForBerth } from '@/lib/services/documents.service';
|
||||
|
||||
/**
|
||||
* GET /api/v1/berths/[id]/interest-documents (renamed from
|
||||
* `/deal-documents` in the 2026-05-14 terminology sweep — canonical
|
||||
* noun is "interest").
|
||||
*
|
||||
* Lists documents attached to interests currently linked to this berth.
|
||||
* Same permission gate as the berth page itself (berths.view).
|
||||
*/
|
||||
export const GET = withAuth(
|
||||
withPermission('berths', 'view', async (_req, ctx, params) => {
|
||||
try {
|
||||
const berthId = params.id;
|
||||
if (!berthId) throw new NotFoundError('Berth');
|
||||
const data = await listDealDocumentsForBerth(ctx.portId, berthId);
|
||||
return NextResponse.json({ data });
|
||||
} catch (error) {
|
||||
return errorResponse(error);
|
||||
}
|
||||
}),
|
||||
);
|
||||
Reference in New Issue
Block a user