Финансы · Чтение
Касса · Касса · Сессии · Просмотр · Закрытие · Операция
pos_cash_session_get_close_operation
Попробуйте три запроса
Получить данные
- Вы указываетеShiftid
- ПомощникЧтение
- Вы получаетеПоля ответа
Запрос в чат
Для задачи «Касса / Касса / Сессии / Просмотр / Закрытие / Операция» выполни чтение по выбранной записи (shiftId). Выведи кратко: состояние, результат.
- state
- Состояние
- result
- Результат
- failureReason
- Поле ответа
Задать параметры
- Вы указываетеShiftid
- ПомощникСверка выбора
- Вы получаетеТочный объект
Запрос в чат
Покажи, как получить «Касса / Касса / Сессии / Просмотр / Закрытие / Операция» на учебном примере с shiftId = DEMO-101. Объясни, какие ещё данные нужны и как будет выглядеть ответ.
- shiftId
- DEMO-101
- comment
- Проверено на учебной записи
Разобрать ответ
- Вы указываетеПолученный ответ
- ПомощникРазбор значений
- Вы получаетеКраткое пояснение
Запрос в чат
На основании уже полученного ответа «Касса / Касса / Сессии / Просмотр / Закрытие / Операция» объясни состояние, результат. Отметь отсутствующие значения.
- state
- Состояние
- result
- Результат
- failureReason
- Поле ответа
Как работает действие
Это чтение. Выберите запись или задайте фильтры в доступной компании. Прочитайте актуальную версию записи перед подготовкой запроса.
Описание разработчика
Read the exact native POS closure workflow without repeating writes. Completion requires matching Supabase receipt and completed Firestore cleanup job. pending/processing/committed/failed states are not successful closure.
Параметры запроса
- 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
Что вернёт команда
- state
- Native durable workflow state; committed means SQL committed but Firestore cleanup is not yet complete. обязательно по схеме · string · варианты not_started, pending, processing, committed, failed, completed
- result
- Verified final result only after both SQL commit and Firestore cleanup complete. обязательно по схеме · object / null
- failureReason
- Safe native failure category when present. PAYMENT_RECONCILIATION_REQUIRED needs unresolved Order Checkout reconciled or expired before retrying the exact closure. Inspect the affected shift Orders/catalog before retrying invalid stock or recipe data. SOURCE_CHANGED requires resolving the newer source version; never delete it to force completion. COMMIT_UNCONFIRMED retains the original request. Raw backend messages are not exposed. необязательно · string · варианты PAYMENT_RECONCILIATION_REQUIRED, INVALID_STOCK_SNAPSHOT, MISSING_RECIPE_PRODUCT, RECIPE_CYCLE, SOURCE_CHANGED, SOURCE_MISSING, LOCATION_MISSING, INVALID_NATIVE_DATA, COMMIT_UNCONFIRMED, NATIVE_FAILURE
Поля и технические схемы

Вход · 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": {
"state": {
"type": "string",
"enum": [
"not_started",
"pending",
"processing",
"committed",
"failed",
"completed"
],
"description": "Native durable workflow state; committed means SQL committed but Firestore cleanup is not yet complete."
},
"result": {
"anyOf": [
{
"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
},
{
"type": "null"
}
],
"description": "Verified final result only after both SQL commit and Firestore cleanup complete."
},
"failureReason": {
"description": "Safe native failure category when present. PAYMENT_RECONCILIATION_REQUIRED needs unresolved Order Checkout reconciled or expired before retrying the exact closure. Inspect the affected shift Orders/catalog before retrying invalid stock or recipe data. SOURCE_CHANGED requires resolving the newer source version; never delete it to force completion. COMMIT_UNCONFIRMED retains the original request. Raw backend messages are not exposed.",
"type": "string",
"enum": [
"PAYMENT_RECONCILIATION_REQUIRED",
"INVALID_STOCK_SNAPSHOT",
"MISSING_RECIPE_PRODUCT",
"RECIPE_CYCLE",
"SOURCE_CHANGED",
"SOURCE_MISSING",
"LOCATION_MISSING",
"INVALID_NATIVE_DATA",
"COMMIT_UNCONFIRMED",
"NATIVE_FAILURE"
]
}
},
"required": [
"state",
"result"
],
"additionalProperties": false
}