MCP Control
Финансы · Чувствительное действие

Касса · Касса · Сессии · Закрытие

pos_cash_session_close
Кассовый чек, калькулятор и монеты

Попробуйте три запроса

Подготовить
  1. Вы указываетеShiftid
  2. ПомощникПодготовка
  3. Вы получаетеПредпросмотр
Запрос в чат
Подготовь «Касса / Касса / Сессии / Закрытие». Для изменения нужны shiftId, countedCash. Покажи объект и ожидаемый эффект до выполнения.
Что входит в подготовку
shiftId
Параметр
countedCash
Параметр
comment
Комментарий
Применить
  1. Вы указываетеСогласованные значения
  2. ПомощникОдин вызов
  3. Вы получаетеОтвет операции
Запрос в чат
На учебной записи подготовь «Касса / Касса / Сессии / Закрытие» с параметром shiftId = DEMO-101. Покажи остальные обязательные значения и выполни действие, когда согласованы все поля.
Фрагмент учебных параметров
shiftId
DEMO-101
comment
Проверено на учебной записи
Проверить итог
  1. Вы указываетеИсходный ответ
  2. ПомощникСверка результата
  3. Вы получаетеПодтверждение
Запрос в чат
Проверь результат «Касса / Касса / Сессии / Закрытие» по исходному ответу. Покажи shiftId, филиал. Объясни, чем подтвердить эффект для выбранного объекта.
Как сверить изменение
  1. До измененияПрочитать версию
  2. При записиПередать выбранную версию
  3. После ответаПеречитать объект
Как работает действие

Этот вызов может изменить рабочие данные. Согласуйте точный объект, новые значения и ожидаемый результат. Присвойте операции стабильный requestId. При повторе той же операции используйте прежний ключ и те же значения. Прочитайте актуальную версию записи перед подготовкой запроса.

Описание разработчика

Close one active native POS shift through closePosShift: freeze the exact source, atomically archive eligible Orders, post stock, reconcile cash/tax/commissions, retain and detach deferred Orders, then clean up matching Firestore versions. Requires company-wide finance, Orders and inventory authority. No provider payment or cash transfer. A queued or SQL-only commit is not success. Read pos_cash_session_get_close_operation after uncertainty; retry the exact request to resume the native workflow. Does not execute a separate Flow webhook.

Параметры запроса
shiftId
Active Firestore POS shift ID from pos_cash_sessions_list. обязательно по схеме · string
expectedRevision
Версия, прочитанная перед изменением. обязательно по схеме · string
countedCash
Cash physically counted at closure, in the establishment cash account currency. Native backend computes and posts the difference. обязательно по схеме · number · минимум 0 · максимум 1000000000000
comment
Closing note recorded by the native shift backend. обязательно по схеме · string · по умолчанию "" · до символов 1000
requestId
Ключ этой операции. Для повтора с теми же аргументами сохраните исходное значение. обязательно по схеме · string
Что вернёт команда
shiftId
Closed native POS shift ID. обязательно по схеме · string
locationId
Server-resolved establishment. обязательно по схеме · string
closedAt
Native immutable closure time. обязательно по схеме · string
archivedOrderCount
Orders atomically archived in Supabase and removed at matching source versions. обязательно по схеме · integer · минимум 0 · максимум 9007199254740991
deferredOrderCount
Future orders retained in Firestore and detached from this shift. обязательно по схеме · integer · минимум 0 · максимум 9007199254740991
transactionCount
Native deterministic financial postings committed with the archive and stock. обязательно по схеме · integer · минимум 0 · максимум 9007199254740991
totals
Native cash reconciliation, tax and commission totals. обязательно по схеме · object
receiptHash
Digest of the complete native SQL closure result, including all affected identifiers. обязательно по схеме · string
Поля и технические схемы
Входные поля и поля ответа pos_cash_session_close
Вход · JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "shiftId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
      "description": "Active Firestore POS shift ID from pos_cash_sessions_list."
    },
    "expectedRevision": {
      "type": "string",
      "pattern": "^fsv1:\\d{1,12}:\\d{1,9}$",
      "description": "Exact source revision from pos_cash_sessions_list or pos_cash_session_context."
    },
    "countedCash": {
      "type": "number",
      "minimum": 0,
      "maximum": 1000000000000,
      "description": "Cash physically counted at closure, in the establishment cash account currency. Native backend computes and posts the difference."
    },
    "comment": {
      "default": "",
      "description": "Closing note recorded by the native shift backend.",
      "type": "string",
      "maxLength": 1000
    },
    "requestId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{8,128}$",
      "description": "Stable ID for this exact closure. Reuse every original argument after uncertainty."
    }
  },
  "required": [
    "shiftId",
    "expectedRevision",
    "countedCash",
    "comment",
    "requestId"
  ],
  "additionalProperties": false
}
Выход · JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "shiftId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
      "description": "Closed native POS shift ID."
    },
    "locationId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
      "description": "Server-resolved establishment."
    },
    "closedAt": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
      "description": "Native immutable closure time."
    },
    "archivedOrderCount": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991,
      "description": "Orders atomically archived in Supabase and removed at matching source versions."
    },
    "deferredOrderCount": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991,
      "description": "Future orders retained in Firestore and detached from this shift."
    },
    "transactionCount": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991,
      "description": "Native deterministic financial postings committed with the archive and stock."
    },
    "totals": {
      "type": "object",
      "properties": {
        "expectedCash": {
          "type": "number",
          "description": "Native expectedCash at this committed closure."
        },
        "countedCash": {
          "type": "number",
          "description": "Native countedCash at this committed closure."
        },
        "difference": {
          "type": "number",
          "description": "Native difference at this committed closure."
        },
        "tax": {
          "type": "number",
          "description": "Native tax at this committed closure."
        },
        "commission": {
          "type": "number",
          "description": "Native commission at this committed closure."
        },
        "deliveryCommission": {
          "type": "number",
          "description": "Native deliveryCommission at this committed closure."
        }
      },
      "required": [
        "expectedCash",
        "countedCash",
        "difference",
        "tax",
        "commission",
        "deliveryCommission"
      ],
      "additionalProperties": false,
      "description": "Native cash reconciliation, tax and commission totals."
    },
    "receiptHash": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$",
      "description": "Digest of the complete native SQL closure result, including all affected identifiers."
    }
  },
  "required": [
    "shiftId",
    "locationId",
    "closedAt",
    "archivedOrderCount",
    "deferredOrderCount",
    "transactionCount",
    "totals",
    "receiptHash"
  ],
  "additionalProperties": false
}