@ingenx-io/valets-schema-mcp-server 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/docs/enums/attention-status.md +1 -1
- package/data/docs/enums/booking-status.md +1 -1
- package/data/docs/enums/customer-payment-status.md +1 -1
- package/data/docs/enums/customer-payment-target-type.md +1 -1
- package/data/docs/enums/delivery-type.md +1 -1
- package/data/docs/enums/deployment-link-type.md +1 -1
- package/data/docs/enums/event-status.md +1 -1
- package/data/docs/enums/fulfillment-status.md +1 -1
- package/data/docs/enums/loyalty-transaction-type.md +1 -1
- package/data/docs/enums/order-status.md +1 -1
- package/data/docs/enums/payment-method.md +1 -1
- package/data/docs/enums/payment-proof-status.md +1 -1
- package/data/docs/enums/payment-status.md +1 -1
- package/data/docs/enums/pending-issue.md +1 -1
- package/data/docs/enums/return-status.md +1 -1
- package/data/docs/enums/session-status.md +1 -1
- package/data/docs/enums/site-status.md +1 -1
- package/data/docs/enums/stocktake-frequency.md +24 -0
- package/data/docs/enums/stocktake-item-status.md +24 -0
- package/data/docs/enums/stocktake-status.md +24 -0
- package/data/docs/enums/ticket-status.md +2 -2
- package/data/docs/index.md +7 -2
- package/data/docs/models/allowed-user.md +1 -1
- package/data/docs/models/analytics-backfill.md +1 -1
- package/data/docs/models/analytics-daily.md +1 -1
- package/data/docs/models/analytics-event.md +1 -1
- package/data/docs/models/analytics-hourly.md +1 -1
- package/data/docs/models/booking-version.md +1 -1
- package/data/docs/models/booking.md +1 -1
- package/data/docs/models/customer-payment-allocation.md +1 -1
- package/data/docs/models/customer-payment.md +1 -1
- package/data/docs/models/customer.md +1 -1
- package/data/docs/models/event.md +1 -1
- package/data/docs/models/loyalty-config.md +1 -1
- package/data/docs/models/loyalty-reward.md +1 -1
- package/data/docs/models/loyalty-status.md +1 -1
- package/data/docs/models/loyalty-transaction.md +1 -1
- package/data/docs/models/magic-link-request.md +1 -1
- package/data/docs/models/metrics-current.md +1 -1
- package/data/docs/models/metrics-daily.md +1 -1
- package/data/docs/models/metrics-monthly.md +1 -1
- package/data/docs/models/order-item.md +1 -1
- package/data/docs/models/order.md +1 -1
- package/data/docs/models/sale.md +1 -1
- package/data/docs/models/site-payment.md +1 -1
- package/data/docs/models/site.md +1 -1
- package/data/docs/models/stocktake-item.md +500 -0
- package/data/docs/models/stocktake.md +649 -0
- package/data/docs/models/ticket.md +2 -2
- package/data/static/llms.txt +111 -1
- package/data/static/openapi.yaml +355 -0
- package/data/static/schemas.json +455 -1
- package/package.json +1 -1
package/data/static/schemas.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"description": "@valets/schema \u2014 consolidated schema bundle",
|
|
4
|
-
"generated": "2026-
|
|
4
|
+
"generated": "2026-05-05T12:09:28.979656+00:00",
|
|
5
5
|
"schemas": {
|
|
6
6
|
"allowed-user": {
|
|
7
7
|
"type": "object",
|
|
@@ -4916,6 +4916,460 @@
|
|
|
4916
4916
|
},
|
|
4917
4917
|
"x-when": "Written by operators via dashboard or by server triggers (expiration). Clients filter by ACTIVE."
|
|
4918
4918
|
},
|
|
4919
|
+
"stocktake": {
|
|
4920
|
+
"type": "object",
|
|
4921
|
+
"properties": {
|
|
4922
|
+
"id": {
|
|
4923
|
+
"readOnly": true,
|
|
4924
|
+
"description": "(Read-only) Firestore document ID, auto-generated.",
|
|
4925
|
+
"type": [
|
|
4926
|
+
"string",
|
|
4927
|
+
"null"
|
|
4928
|
+
]
|
|
4929
|
+
},
|
|
4930
|
+
"companyId": {
|
|
4931
|
+
"type": "string",
|
|
4932
|
+
"x-immutable": true,
|
|
4933
|
+
"description": "(Immutable) FK \u2192 Company document ID. Tenant scope."
|
|
4934
|
+
},
|
|
4935
|
+
"stocktakeNumber": {
|
|
4936
|
+
"type": "string",
|
|
4937
|
+
"description": "Human-readable session number, e.g. \"STK-2026-001\". Embedded as `referenceNumber` on the StockMovement rows the session emits, so the ledger remains traceable to the originating stocktake."
|
|
4938
|
+
},
|
|
4939
|
+
"stocktakeDate": {
|
|
4940
|
+
"$ref": "#/definitions/firestore-timestamp",
|
|
4941
|
+
"description": "Effective date of the count. Distinct from createdAt; can be backdated.",
|
|
4942
|
+
"x-note": "The date the count is FOR. Can be backdated (stocktakeDate < createdAt) \u2014 analytics buckets by stocktakeDate for \"what period was counted\" and by completedAt for \"when adjustments hit the ledger\" (GH#29 Q24)."
|
|
4943
|
+
},
|
|
4944
|
+
"warehouseId": {
|
|
4945
|
+
"description": "FK \u2192 Warehouse document ID. Null = whole-company stocktake (no warehouse partition).",
|
|
4946
|
+
"anyOf": [
|
|
4947
|
+
{
|
|
4948
|
+
"type": "string"
|
|
4949
|
+
},
|
|
4950
|
+
{
|
|
4951
|
+
"type": "null"
|
|
4952
|
+
}
|
|
4953
|
+
]
|
|
4954
|
+
},
|
|
4955
|
+
"frequency": {
|
|
4956
|
+
"anyOf": [
|
|
4957
|
+
{
|
|
4958
|
+
"$ref": "#/definitions/stocktake-frequency"
|
|
4959
|
+
},
|
|
4960
|
+
{
|
|
4961
|
+
"type": "null"
|
|
4962
|
+
}
|
|
4963
|
+
],
|
|
4964
|
+
"description": "Recurrence cadence. Optional \u2014 leave unset for ad-hoc sessions, or set to indicate this stocktake is part of a recurring schedule.",
|
|
4965
|
+
"x-note": "Optional today (dashboard does not currently track recurrence). Frequency is a property of the record, not a separate type \u2014 a daily stocktake is a Stocktake with frequency=DAILY, not a distinct DailyStocktake model. If the session was emitted from a recurring schedule, set Stocktake.scheduledStocktakeId; ad-hoc sessions leave it null.",
|
|
4966
|
+
"x-see": {
|
|
4967
|
+
"issues": [
|
|
4968
|
+
"gh#29"
|
|
4969
|
+
]
|
|
4970
|
+
}
|
|
4971
|
+
},
|
|
4972
|
+
"scheduledStocktakeId": {
|
|
4973
|
+
"description": "FK to a recurring stocktake schedule, if this session was emitted from one. Null for ad-hoc sessions.",
|
|
4974
|
+
"anyOf": [
|
|
4975
|
+
{
|
|
4976
|
+
"type": "string"
|
|
4977
|
+
},
|
|
4978
|
+
{
|
|
4979
|
+
"type": "null"
|
|
4980
|
+
}
|
|
4981
|
+
]
|
|
4982
|
+
},
|
|
4983
|
+
"status": {
|
|
4984
|
+
"$ref": "#/definitions/stocktake-status",
|
|
4985
|
+
"description": "Lifecycle status. Transitions PENDING \u2192 IN_PROGRESS \u2192 COMPLETED are server-owned (GH#29 \u00a73 / Q25).",
|
|
4986
|
+
"x-note": "PENDING = session created, no items counted yet. IN_PROGRESS = at least one item has been counted. COMPLETED = all items counted and the session was closed; on this transition the server emits one StockMovement(type=INVENTORY) per non-zero delta. CANCELLED = session abandoned without applying adjustments. Status transitions PENDING \u2192 IN_PROGRESS \u2192 COMPLETED are server-owned (Q25) \u2014 clients PATCH item status; the server transitions session status to avoid the concurrent-edit race documented in stockService.ts:1671.",
|
|
4987
|
+
"x-see": {
|
|
4988
|
+
"issues": [
|
|
4989
|
+
"gh#29"
|
|
4990
|
+
]
|
|
4991
|
+
},
|
|
4992
|
+
"x-when": "Server-managed. Clients write item updates; the trigger transitions session status."
|
|
4993
|
+
},
|
|
4994
|
+
"adjustmentsApplied": {
|
|
4995
|
+
"type": "boolean",
|
|
4996
|
+
"x-note": "Records whether the COMPLETED transition actually mutated stock or was record-only. The dashboard's completeInventory(applyAdjustments) flag was not persisted; this field closes that gap (GH#29 audit Q22).",
|
|
4997
|
+
"description": "True if completing the session actually emitted StockMovement adjustments. False for record-only counts."
|
|
4998
|
+
},
|
|
4999
|
+
"notes": {
|
|
5000
|
+
"description": "Free-text session-level notes.",
|
|
5001
|
+
"anyOf": [
|
|
5002
|
+
{
|
|
5003
|
+
"type": "string"
|
|
5004
|
+
},
|
|
5005
|
+
{
|
|
5006
|
+
"type": "null"
|
|
5007
|
+
}
|
|
5008
|
+
]
|
|
5009
|
+
},
|
|
5010
|
+
"totalItemsCount": {
|
|
5011
|
+
"type": "integer",
|
|
5012
|
+
"minimum": -9007199254740991,
|
|
5013
|
+
"maximum": 9007199254740991,
|
|
5014
|
+
"readOnly": true,
|
|
5015
|
+
"x-note": "Server-derived. Recomputed by trigger on each StocktakeItem write; not safe to write client-side under concurrent edits (GH#29 audit Q23).",
|
|
5016
|
+
"description": "(Read-only) Total number of StocktakeItem rows under this session."
|
|
5017
|
+
},
|
|
5018
|
+
"totalDiscrepancies": {
|
|
5019
|
+
"type": "integer",
|
|
5020
|
+
"minimum": -9007199254740991,
|
|
5021
|
+
"maximum": 9007199254740991,
|
|
5022
|
+
"readOnly": true,
|
|
5023
|
+
"x-note": "Server-derived = sum of |item.delta| across COUNTED items. Updated by trigger.",
|
|
5024
|
+
"description": "(Read-only) Sum of absolute deltas across counted items."
|
|
5025
|
+
},
|
|
5026
|
+
"totalDeltaValue": {
|
|
5027
|
+
"type": "number",
|
|
5028
|
+
"readOnly": true,
|
|
5029
|
+
"x-note": "Server-derived = sum of (item.delta \u00d7 item.costPerUnit) across COUNTED items, in XOF integer minor units (D18). Updated by trigger.",
|
|
5030
|
+
"description": "(Read-only) Net valuation impact of the count, in XOF integer minor units."
|
|
5031
|
+
},
|
|
5032
|
+
"startedAt": {
|
|
5033
|
+
"$ref": "#/definitions/firestore-timestamp",
|
|
5034
|
+
"description": "When the counting session physically opened. Typically equal to createdAt for ad-hoc sessions."
|
|
5035
|
+
},
|
|
5036
|
+
"completedAt": {
|
|
5037
|
+
"anyOf": [
|
|
5038
|
+
{
|
|
5039
|
+
"$ref": "#/definitions/firestore-timestamp"
|
|
5040
|
+
},
|
|
5041
|
+
{
|
|
5042
|
+
"type": "null"
|
|
5043
|
+
}
|
|
5044
|
+
],
|
|
5045
|
+
"readOnly": true,
|
|
5046
|
+
"x-note": "Server-set on transition to COMPLETED. Distinct from stocktakeDate (the period counted) \u2014 analytics buckets by completedAt to answer \"when did the ledger hit?\".",
|
|
5047
|
+
"description": "(Read-only) When the session transitioned to COMPLETED."
|
|
5048
|
+
},
|
|
5049
|
+
"createdAt": {
|
|
5050
|
+
"anyOf": [
|
|
5051
|
+
{
|
|
5052
|
+
"$ref": "#/definitions/firestore-timestamp"
|
|
5053
|
+
},
|
|
5054
|
+
{
|
|
5055
|
+
"type": "null"
|
|
5056
|
+
}
|
|
5057
|
+
],
|
|
5058
|
+
"readOnly": true,
|
|
5059
|
+
"description": "(Read-only) Server-generated creation timestamp."
|
|
5060
|
+
},
|
|
5061
|
+
"createdBy": {
|
|
5062
|
+
"type": "string",
|
|
5063
|
+
"x-immutable": true,
|
|
5064
|
+
"description": "(Immutable) FK \u2192 User UID who created the session."
|
|
5065
|
+
},
|
|
5066
|
+
"createdByName": {
|
|
5067
|
+
"type": "string",
|
|
5068
|
+
"denormalized": true,
|
|
5069
|
+
"x-note": "Read-time hint snapshot of the creator's display name (GH#29 \u00a73 / Q10).",
|
|
5070
|
+
"description": "(Denormalized) Snapshot of the creator's display name at session creation."
|
|
5071
|
+
},
|
|
5072
|
+
"completedBy": {
|
|
5073
|
+
"readOnly": true,
|
|
5074
|
+
"description": "(Read-only) FK \u2192 User UID who completed the session, set by server on COMPLETED.",
|
|
5075
|
+
"anyOf": [
|
|
5076
|
+
{
|
|
5077
|
+
"type": "string"
|
|
5078
|
+
},
|
|
5079
|
+
{
|
|
5080
|
+
"type": "null"
|
|
5081
|
+
}
|
|
5082
|
+
]
|
|
5083
|
+
},
|
|
5084
|
+
"completedByName": {
|
|
5085
|
+
"denormalized": true,
|
|
5086
|
+
"x-note": "Read-time hint snapshot of the completer's display name (GH#29 \u00a73 / Q10).",
|
|
5087
|
+
"description": "(Denormalized) Snapshot of the completer's display name.",
|
|
5088
|
+
"anyOf": [
|
|
5089
|
+
{
|
|
5090
|
+
"type": "string"
|
|
5091
|
+
},
|
|
5092
|
+
{
|
|
5093
|
+
"type": "null"
|
|
5094
|
+
}
|
|
5095
|
+
]
|
|
5096
|
+
},
|
|
5097
|
+
"updatedAt": {
|
|
5098
|
+
"anyOf": [
|
|
5099
|
+
{
|
|
5100
|
+
"$ref": "#/definitions/firestore-timestamp"
|
|
5101
|
+
},
|
|
5102
|
+
{
|
|
5103
|
+
"type": "null"
|
|
5104
|
+
}
|
|
5105
|
+
],
|
|
5106
|
+
"readOnly": true,
|
|
5107
|
+
"description": "(Read-only) Server-generated update timestamp."
|
|
5108
|
+
}
|
|
5109
|
+
},
|
|
5110
|
+
"required": [
|
|
5111
|
+
"companyId",
|
|
5112
|
+
"stocktakeNumber",
|
|
5113
|
+
"stocktakeDate",
|
|
5114
|
+
"status",
|
|
5115
|
+
"adjustmentsApplied",
|
|
5116
|
+
"totalItemsCount",
|
|
5117
|
+
"totalDiscrepancies",
|
|
5118
|
+
"totalDeltaValue",
|
|
5119
|
+
"startedAt",
|
|
5120
|
+
"createdBy",
|
|
5121
|
+
"createdByName"
|
|
5122
|
+
],
|
|
5123
|
+
"additionalProperties": false,
|
|
5124
|
+
"description": "Stocktake (GH#29 \u00a74). Collection: companies/{companyId}/stocktakes/{stocktakeId}. A recorded session of physically counting all SKUs at a point in time. Replaces the dashboard's Inventory model; items live in a sub-collection (replaces InventoryItem[] embedded array); InventoryEvolution is dropped \u2014 derivable from the sub-collection. Status transitions and aggregate fields (totalItemsCount/Discrepancies/totalDeltaValue) are server-owned per GH#29 \u00a73.",
|
|
5125
|
+
"example": {
|
|
5126
|
+
"id": null,
|
|
5127
|
+
"companyId": "comp_xyz789",
|
|
5128
|
+
"stocktakeNumber": "stocktakeNumber",
|
|
5129
|
+
"stocktakeDate": "stocktakeDate",
|
|
5130
|
+
"warehouseId": "war_ref123",
|
|
5131
|
+
"frequency": "frequency",
|
|
5132
|
+
"scheduledStocktakeId": "sch_ref123",
|
|
5133
|
+
"status": "status",
|
|
5134
|
+
"adjustmentsApplied": true,
|
|
5135
|
+
"notes": "VIP customer, handle with care",
|
|
5136
|
+
"totalItemsCount": 2,
|
|
5137
|
+
"totalDiscrepancies": 0,
|
|
5138
|
+
"totalDeltaValue": 0,
|
|
5139
|
+
"startedAt": "startedAt",
|
|
5140
|
+
"completedAt": "completedAt",
|
|
5141
|
+
"createdAt": "createdAt",
|
|
5142
|
+
"createdBy": "staff_k0f1",
|
|
5143
|
+
"createdByName": "Kofi Mensah",
|
|
5144
|
+
"completedBy": "completedBy",
|
|
5145
|
+
"completedByName": "completedByName",
|
|
5146
|
+
"updatedAt": "updatedAt"
|
|
5147
|
+
}
|
|
5148
|
+
},
|
|
5149
|
+
"stocktake-frequency": {
|
|
5150
|
+
"type": "string",
|
|
5151
|
+
"enum": [
|
|
5152
|
+
"DAILY",
|
|
5153
|
+
"WEEKLY",
|
|
5154
|
+
"MONTHLY",
|
|
5155
|
+
"AD_HOC"
|
|
5156
|
+
],
|
|
5157
|
+
"description": "Recurrence cadence of a Stocktake session (GH#29 \u00a74).",
|
|
5158
|
+
"x-note": "Optional today (dashboard does not currently track recurrence). Frequency is a property of the record, not a separate type \u2014 a daily stocktake is a Stocktake with frequency=DAILY, not a distinct DailyStocktake model. If the session was emitted from a recurring schedule, set Stocktake.scheduledStocktakeId; ad-hoc sessions leave it null.",
|
|
5159
|
+
"x-see": {
|
|
5160
|
+
"issues": [
|
|
5161
|
+
"gh#29"
|
|
5162
|
+
]
|
|
5163
|
+
}
|
|
5164
|
+
},
|
|
5165
|
+
"stocktake-item": {
|
|
5166
|
+
"type": "object",
|
|
5167
|
+
"properties": {
|
|
5168
|
+
"stockItemId": {
|
|
5169
|
+
"type": "string",
|
|
5170
|
+
"description": "FK \u2192 StockItem document ID. Doubles as the item document ID."
|
|
5171
|
+
},
|
|
5172
|
+
"stockItemName": {
|
|
5173
|
+
"type": "string",
|
|
5174
|
+
"denormalized": true,
|
|
5175
|
+
"x-note": "Read-time hint snapshot of StockItem.name. Authoritative value lives at the StockItem record; do not refresh on rename \u2014 the historical name at session time is what the auditor wrote (GH#29 \u00a73 / Q10).",
|
|
5176
|
+
"description": "(Denormalized) Snapshot of StockItem.name at session time."
|
|
5177
|
+
},
|
|
5178
|
+
"theoreticalQuantity": {
|
|
5179
|
+
"type": "number",
|
|
5180
|
+
"x-immutable": true,
|
|
5181
|
+
"description": "(Immutable) System belief at session start, snapshotted when this item row was created."
|
|
5182
|
+
},
|
|
5183
|
+
"actualQuantity": {
|
|
5184
|
+
"description": "Physical count entered by the counter. Null until counted; set when the line moves to status COUNTED.",
|
|
5185
|
+
"anyOf": [
|
|
5186
|
+
{
|
|
5187
|
+
"type": "number"
|
|
5188
|
+
},
|
|
5189
|
+
{
|
|
5190
|
+
"type": "null"
|
|
5191
|
+
}
|
|
5192
|
+
]
|
|
5193
|
+
},
|
|
5194
|
+
"delta": {
|
|
5195
|
+
"type": "number",
|
|
5196
|
+
"readOnly": true,
|
|
5197
|
+
"x-note": "Server-derived = actualQuantity \u2212 theoreticalQuantity. Recomputed on every actualQuantity write; null/zero before counting.",
|
|
5198
|
+
"description": "(Read-only) Signed difference between actual and theoretical. Drives the StockMovement(type=INVENTORY) emitted on session COMPLETED."
|
|
5199
|
+
},
|
|
5200
|
+
"unit": {
|
|
5201
|
+
"type": "string",
|
|
5202
|
+
"x-immutable": true,
|
|
5203
|
+
"description": "(Immutable) Snapshot of StockItem.unit at session start. Locks the unit against later catalog changes."
|
|
5204
|
+
},
|
|
5205
|
+
"costPerUnit": {
|
|
5206
|
+
"type": "number",
|
|
5207
|
+
"x-immutable": true,
|
|
5208
|
+
"x-note": "Snapshot at session time \u2014 locks valuation against future cost changes. Lock to XOF integer minor units per D18 (GH#29 Q16).",
|
|
5209
|
+
"description": "(Immutable) Snapshot of StockItem.costPerUnit at session start, in XOF integer minor units."
|
|
5210
|
+
},
|
|
5211
|
+
"totalValue": {
|
|
5212
|
+
"type": "number",
|
|
5213
|
+
"readOnly": true,
|
|
5214
|
+
"x-note": "Server-derived = actualQuantity \u00d7 costPerUnit. Recomputed when actualQuantity is written.",
|
|
5215
|
+
"description": "(Read-only) Per-line valuation in XOF integer minor units."
|
|
5216
|
+
},
|
|
5217
|
+
"status": {
|
|
5218
|
+
"$ref": "#/definitions/stocktake-item-status",
|
|
5219
|
+
"description": "Per-line workflow status. Server transitions ADJUSTED on parent COMPLETED.",
|
|
5220
|
+
"x-note": "PENDING = line not yet counted. COUNTED = a counter recorded actualQuantity. VERIFIED = a second pair of eyes signed off (verifiedBy fields populated; Q21 \u2014 kept nullable until tenants opt into stricter QA via policy). ADJUSTED = the resulting StockMovement was emitted (server-set on Stocktake.status \u2192 COMPLETED).",
|
|
5221
|
+
"x-see": {
|
|
5222
|
+
"issues": [
|
|
5223
|
+
"gh#29"
|
|
5224
|
+
]
|
|
5225
|
+
}
|
|
5226
|
+
},
|
|
5227
|
+
"notes": {
|
|
5228
|
+
"description": "Optional per-line note from the counter (e.g. \"damaged carton, 3 unsellable\").",
|
|
5229
|
+
"anyOf": [
|
|
5230
|
+
{
|
|
5231
|
+
"type": "string"
|
|
5232
|
+
},
|
|
5233
|
+
{
|
|
5234
|
+
"type": "null"
|
|
5235
|
+
}
|
|
5236
|
+
]
|
|
5237
|
+
},
|
|
5238
|
+
"countedBy": {
|
|
5239
|
+
"description": "UID of the staff member who entered actualQuantity.",
|
|
5240
|
+
"anyOf": [
|
|
5241
|
+
{
|
|
5242
|
+
"type": "string"
|
|
5243
|
+
},
|
|
5244
|
+
{
|
|
5245
|
+
"type": "null"
|
|
5246
|
+
}
|
|
5247
|
+
]
|
|
5248
|
+
},
|
|
5249
|
+
"countedByName": {
|
|
5250
|
+
"denormalized": true,
|
|
5251
|
+
"x-note": "Read-time hint snapshot of the counter's display name (GH#29 \u00a73 / Q10).",
|
|
5252
|
+
"description": "(Denormalized) Snapshot of the counter's display name at count time.",
|
|
5253
|
+
"anyOf": [
|
|
5254
|
+
{
|
|
5255
|
+
"type": "string"
|
|
5256
|
+
},
|
|
5257
|
+
{
|
|
5258
|
+
"type": "null"
|
|
5259
|
+
}
|
|
5260
|
+
]
|
|
5261
|
+
},
|
|
5262
|
+
"countedAt": {
|
|
5263
|
+
"anyOf": [
|
|
5264
|
+
{
|
|
5265
|
+
"$ref": "#/definitions/firestore-timestamp"
|
|
5266
|
+
},
|
|
5267
|
+
{
|
|
5268
|
+
"type": "null"
|
|
5269
|
+
}
|
|
5270
|
+
],
|
|
5271
|
+
"description": "When the line was counted."
|
|
5272
|
+
},
|
|
5273
|
+
"verifiedBy": {
|
|
5274
|
+
"description": "UID of a second staff member who verified the count. Nullable per GH#29 Q21.",
|
|
5275
|
+
"anyOf": [
|
|
5276
|
+
{
|
|
5277
|
+
"type": "string"
|
|
5278
|
+
},
|
|
5279
|
+
{
|
|
5280
|
+
"type": "null"
|
|
5281
|
+
}
|
|
5282
|
+
]
|
|
5283
|
+
},
|
|
5284
|
+
"verifiedByName": {
|
|
5285
|
+
"denormalized": true,
|
|
5286
|
+
"x-note": "Read-time hint snapshot of the verifier's display name (GH#29 \u00a73 / Q10).",
|
|
5287
|
+
"description": "(Denormalized) Snapshot of the verifier's display name.",
|
|
5288
|
+
"anyOf": [
|
|
5289
|
+
{
|
|
5290
|
+
"type": "string"
|
|
5291
|
+
},
|
|
5292
|
+
{
|
|
5293
|
+
"type": "null"
|
|
5294
|
+
}
|
|
5295
|
+
]
|
|
5296
|
+
},
|
|
5297
|
+
"verifiedAt": {
|
|
5298
|
+
"anyOf": [
|
|
5299
|
+
{
|
|
5300
|
+
"$ref": "#/definitions/firestore-timestamp"
|
|
5301
|
+
},
|
|
5302
|
+
{
|
|
5303
|
+
"type": "null"
|
|
5304
|
+
}
|
|
5305
|
+
],
|
|
5306
|
+
"description": "When the line was verified, if a second-eye flow was used."
|
|
5307
|
+
}
|
|
5308
|
+
},
|
|
5309
|
+
"required": [
|
|
5310
|
+
"stockItemId",
|
|
5311
|
+
"stockItemName",
|
|
5312
|
+
"theoreticalQuantity",
|
|
5313
|
+
"delta",
|
|
5314
|
+
"unit",
|
|
5315
|
+
"costPerUnit",
|
|
5316
|
+
"totalValue",
|
|
5317
|
+
"status"
|
|
5318
|
+
],
|
|
5319
|
+
"additionalProperties": false,
|
|
5320
|
+
"description": "StocktakeItem (GH#29 \u00a74). Sub-collection path: companies/{companyId}/stocktakes/{stocktakeId}/items/{stockItemId}. Replaces the embedded `InventoryItem[]` array on the dashboard model. Server emits one StockMovement(type=INVENTORY) per non-zero delta when the parent Stocktake transitions to COMPLETED.",
|
|
5321
|
+
"example": {
|
|
5322
|
+
"stockItemId": "sto_ref123",
|
|
5323
|
+
"stockItemName": "stockItemName",
|
|
5324
|
+
"theoreticalQuantity": 2,
|
|
5325
|
+
"actualQuantity": "actualQuantity",
|
|
5326
|
+
"delta": 0,
|
|
5327
|
+
"unit": "unit",
|
|
5328
|
+
"costPerUnit": 15000,
|
|
5329
|
+
"totalValue": 0,
|
|
5330
|
+
"status": "status",
|
|
5331
|
+
"notes": "VIP customer, handle with care",
|
|
5332
|
+
"countedBy": "countedBy",
|
|
5333
|
+
"countedByName": "countedByName",
|
|
5334
|
+
"countedAt": "countedAt",
|
|
5335
|
+
"verifiedBy": "verifiedBy",
|
|
5336
|
+
"verifiedByName": "verifiedByName",
|
|
5337
|
+
"verifiedAt": "verifiedAt"
|
|
5338
|
+
}
|
|
5339
|
+
},
|
|
5340
|
+
"stocktake-item-status": {
|
|
5341
|
+
"type": "string",
|
|
5342
|
+
"enum": [
|
|
5343
|
+
"PENDING",
|
|
5344
|
+
"COUNTED",
|
|
5345
|
+
"VERIFIED",
|
|
5346
|
+
"ADJUSTED"
|
|
5347
|
+
],
|
|
5348
|
+
"description": "Per-line workflow status inside a Stocktake (GH#29 \u00a74, audit Q21).",
|
|
5349
|
+
"x-note": "PENDING = line not yet counted. COUNTED = a counter recorded actualQuantity. VERIFIED = a second pair of eyes signed off (verifiedBy fields populated; Q21 \u2014 kept nullable until tenants opt into stricter QA via policy). ADJUSTED = the resulting StockMovement was emitted (server-set on Stocktake.status \u2192 COMPLETED).",
|
|
5350
|
+
"x-see": {
|
|
5351
|
+
"issues": [
|
|
5352
|
+
"gh#29"
|
|
5353
|
+
]
|
|
5354
|
+
}
|
|
5355
|
+
},
|
|
5356
|
+
"stocktake-status": {
|
|
5357
|
+
"type": "string",
|
|
5358
|
+
"enum": [
|
|
5359
|
+
"PENDING",
|
|
5360
|
+
"IN_PROGRESS",
|
|
5361
|
+
"COMPLETED",
|
|
5362
|
+
"CANCELLED"
|
|
5363
|
+
],
|
|
5364
|
+
"description": "Lifecycle status of a Stocktake session (GH#29 \u00a73, \u00a74).",
|
|
5365
|
+
"x-note": "PENDING = session created, no items counted yet. IN_PROGRESS = at least one item has been counted. COMPLETED = all items counted and the session was closed; on this transition the server emits one StockMovement(type=INVENTORY) per non-zero delta. CANCELLED = session abandoned without applying adjustments. Status transitions PENDING \u2192 IN_PROGRESS \u2192 COMPLETED are server-owned (Q25) \u2014 clients PATCH item status; the server transitions session status to avoid the concurrent-edit race documented in stockService.ts:1671.",
|
|
5366
|
+
"x-see": {
|
|
5367
|
+
"issues": [
|
|
5368
|
+
"gh#29"
|
|
5369
|
+
]
|
|
5370
|
+
},
|
|
5371
|
+
"x-when": "Server-managed. Clients write item updates; the trigger transitions session status."
|
|
5372
|
+
},
|
|
4919
5373
|
"ticket": {
|
|
4920
5374
|
"type": "object",
|
|
4921
5375
|
"properties": {
|