Skip to content

CreateCustomerContactRequest only carries customerId — can't set caseRef, type, or plannedTime #44

Description

@yusufaltunbicak

Summary

CreateCustomerContactRequest exposes only customerId, so a client can create a contact but can't attach anything to it — no caseRef (to scope it to a case), no type (ContactType), no plannedTime/state (to schedule an appointment), no note/representative. The read side already supports caseRef, so create/read are asymmetric.

Verified (@insurup/contracts@0.1.26, dist/customers.d.ts)

  • CreateCustomerContactRequest L601–603 → { customerId: string } — nothing else.
  • Read requests carry caseRef: GetCustomerContactsRequest L621–624 and GetCustomerContactFlowsRequest L614–617 (both { customerId, caseRef?: string | null }).
  • The read model is rich (GetCustomerContactsResultItem ~L773+): type, state, plannedTime, attemptTime, …
  • ContactType L95–97 has only PhoneCall; ContactState L103–109 = Planned | Occurred | NotOccurred. So an "appointment/randevu" is modelled as a Planned contact with a plannedTime — but the create request can set none of these.

Impact

Blocks creating a case-scoped contact and scheduling an appointment from the client. In agent-panel this left the case-detail Communications tab's "Add contact" / "Add appointment" actions unbuildable.

Proposed fix

Extend CreateCustomerContactRequest (and the endpoint contract) to accept at least caseRef?, type (ContactType), state/plannedTime (scheduled contacts), and optional note/representative — matching the fields the read model already returns. Please confirm the authoritative field list against the Core create-contact command.


Context: surfaced during the agent-panel Cases (Talepler) module migration (InsurUp/agent-panel#8).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions