Visit Reasons
Optical / commercial visit motives (MotivoVisita).
📄️ Get visit reason by ID
Returns a single visit reason by its primary key.
📄️ Update visit reason
Full replacement of an existing visit reason.
📄️ Delete visit reason
Deletes a visit reason.
📄️ Merge-patch visit reason
RFC 7396 merge-patch over `application/merge-patch+json`. Send only the fields you want to change; include a field with value `null` to remove it. Use the `If-Match` header for optimistic concurrency control.
📄️ List visit reasons
Returns a paginated list of visit reasons with envelope `{data, totalCount, skip, limit, hasMore}`. Supports optional RSQL `filter`, `sort` (default `lastModifiedAt:desc`), `skip`/`limit` pagination and `modifiedAfter`/`modifiedBefore` bookends.
📄️ Create visit reason
Creates a new visit reason. Business logic runs in the legacy WAR. `code` is optional: when omitted the WAR assigns the next sequential company-scoped code (same rule as `POST /visit-reasons/new`).
📄️ Bulk delete visit reasons
Removes every id in `ids` as a single all-or-nothing transaction.
📄️ Bulk patch visit reasons
Applies the same `patch` to every id in `ids` as a single all-or-nothing transaction. Editable fields: `enabled`, `description`.
📄️ Prototype visit reason for a creation form
Returns a non-persisted visit reason pre-populated with backend defaults (current company, next sequential `code`, `enabled=true`). Optional JSON hints: `companyId`, `copyFromId`. Call `POST /api/v2/visit-reasons` to persist.