From 41a967facddbc89888fad6b2cd57e02ee4f0aa06 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 15 Oct 2026 03:14:27 +0000 Subject: [PATCH] fix(case): stop requiring an account on the case form, so a web case can be claimed A web-to-case submission carries no account, and crm_case.crm_account is optional on the object, but the case form marked it required. That form is also the edit form an agent claims a case through (a move to In Progress), so the console refused the claim client-side with "Please check the highlighted fields: Account" while the server accepted the same save. The form keeps Account, without the required flag, and the narrowing suite pins that. Claude-Session: https://claude.ai/code/session_01P8mZuzuyZAHSrgQKmv6ASv Co-authored-by: Claude --- .changeset/2060-item-4-claim-web-case.md | 5 +++++ src/service/views/case.view.ts | 9 ++++++++- test/case-create-form-narrowing.test.ts | 13 +++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .changeset/2060-item-4-claim-web-case.md diff --git a/.changeset/2060-item-4-claim-web-case.md b/.changeset/2060-item-4-claim-web-case.md new file mode 100644 index 00000000..6644212b --- /dev/null +++ b/.changeset/2060-item-4-claim-web-case.md @@ -0,0 +1,5 @@ +--- +'hotcrm': patch +--- + +A service agent can now pick up a case that came in through the web support form. Such a case has no **Account** (the public form does not ask for one), and the case form marked **Account** as required, so moving the case to **In Progress** to claim it stopped at *"Please check the highlighted fields: Account"* and nothing was saved. The form no longer requires **Account**: the claim saves and the case becomes the agent's, as the Cases guide describes. **Account** stays on the form. A case raised in the console may now also be saved without one; its SLA target is the one for an **SMB** customer, the same as a web case's, and escalating it opens no account follow-up task. diff --git a/src/service/views/case.view.ts b/src/service/views/case.view.ts index 6dc82d98..8aa274c3 100644 --- a/src/service/views/case.view.ts +++ b/src/service/views/case.view.ts @@ -429,7 +429,14 @@ export const CaseViews = defineView({ fields: [ 'case_number', { field: 'subject', required: true, span: 'full' }, - { field: 'crm_account', required: true }, + // Offered, ⛔ not `required` (#2060 item 4): `crm_case.crm_account` + // is optional on the object and a web-to-case submission carries + // none. This form is also the one an agent claims such a case + // through (a move to In Progress), so `required` here refused that + // save client-side ("Please check the highlighted fields: Account") + // while the server took it. A case with no account takes the `smb` + // SLA column, and the escalation task and resolution bump skip it. + 'crm_account', 'crm_contact', { field: 'status', required: true }, 'priority', diff --git a/test/case-create-form-narrowing.test.ts b/test/case-create-form-narrowing.test.ts index c8f9fe2e..501165e8 100644 --- a/test/case-create-form-narrowing.test.ts +++ b/test/case-create-form-narrowing.test.ts @@ -218,6 +218,19 @@ describe('crm_case create form — removal direction', () => { expect(new Set(authorable)).toEqual(CREATOR_AUTHORABLE); }); + it('offers `crm_account` without requiring it — a web case carries none (#2060 item 4)', () => { + // This is the edit form too, and an agent claims a web case through it (a + // move to In Progress). Measured on 18.0.0-next.1: with `required` here the + // console refused that save ("Please check the highlighted fields: Account") + // with nothing sent, while the server took the same PATCH. + const entries: unknown[] = ((CaseViews as AnyRec).form?.sections ?? []).flatMap( + (s: AnyRec) => s.fields ?? [], + ); + const account = entries.find((f) => (typeof f === 'string' ? f : (f as AnyRec)?.field) === 'crm_account'); + expect(account, 'crm_account left the case form — this pin would judge nothing').toBeDefined(); + expect((account as AnyRec)?.required === true, 'the case form demands an account again').toBe(false); + }); + it('the public web-to-case form stays narrower still', () => { const wtc = (CaseViews as AnyRec).formViews?.web_to_case; const fields = (wtc?.sections ?? []).flatMap(fieldNamesOf);