feat(crm): client-meeting batch — contact-pill cleanup, assignment toggle, receipt manual mode
CM-4: remove Email/Call/WhatsApp deep-link pills from the client + interest detail headers; relocate GDPR export into the client-header action cluster as a compact icon. Keeps the interest "Log contact" quick action. CM-5: gate the interest assignment feature behind a per-port `assignment_enabled` setting (default OFF for single-rep ports). Hides the AssignedToChip + residential assigned-to row and skips tier-2/3 auto-assign on create; the column + data are preserved and reversible. Tests cover the auto-assign guard. CM-6: add a per-port `manualEntry` receipt mode (skip all parsing → empty form). Threaded through ocr-config.service, the admin OCR form, the scan-receipt route, and the scanner shell (skips Tesseract + the server call). Tests cover the save/resolve round-trip. Verified: tsc clean, lint 0 errors, 1631 vitest pass, prod build green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import { InlineEditableField } from '@/components/shared/inline-editable-field';
|
||||
import { NotesList } from '@/components/shared/notes-list';
|
||||
import { EntityActivityFeed } from '@/components/shared/entity-activity-feed';
|
||||
import { apiFetch } from '@/lib/api/client';
|
||||
import { useFeatureFlag } from '@/hooks/use-feature-flag';
|
||||
import { SOURCES } from '@/lib/constants';
|
||||
|
||||
interface ResidentialInterest {
|
||||
@@ -95,6 +96,8 @@ function OverviewTab({
|
||||
stageOptions: Array<{ value: string; label: string }>;
|
||||
}) {
|
||||
const update = useInterestPatch(interestId);
|
||||
// CM-5: residential assignment row hidden when the per-port toggle is off.
|
||||
const assignmentEnabled = useFeatureFlag('assignment_enabled', false);
|
||||
const save = (field: string) => async (next: string | null) => {
|
||||
await update.mutateAsync({ [field]: next });
|
||||
};
|
||||
@@ -105,6 +108,7 @@ function OverviewTab({
|
||||
}>({
|
||||
queryKey: ['residential-assignable-users'],
|
||||
queryFn: () => apiFetch('/api/v1/residential/assignable-users'),
|
||||
enabled: assignmentEnabled,
|
||||
});
|
||||
const assigneeOptions = (assignableUsers?.data ?? []).map((u) => ({
|
||||
value: u.id,
|
||||
@@ -132,15 +136,17 @@ function OverviewTab({
|
||||
onSave={save('source')}
|
||||
/>
|
||||
</Row>
|
||||
<Row label="Assigned to">
|
||||
<InlineEditableField
|
||||
variant="select"
|
||||
options={assigneeOptions}
|
||||
value={interest.assignedTo}
|
||||
onSave={save('assignedTo')}
|
||||
placeholder="Unassigned"
|
||||
/>
|
||||
</Row>
|
||||
{assignmentEnabled ? (
|
||||
<Row label="Assigned to">
|
||||
<InlineEditableField
|
||||
variant="select"
|
||||
options={assigneeOptions}
|
||||
value={interest.assignedTo}
|
||||
onSave={save('assignedTo')}
|
||||
placeholder="Unassigned"
|
||||
/>
|
||||
</Row>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
<div className="space-y-1">
|
||||
|
||||
Reference in New Issue
Block a user