Déclassé Événements d'instantané de l'inventaire
Les événements d'instantané d'inventaire sont déclenchés lorsqu'un instantané d'inventaire est capturé dans la gestion de l'inventaire du magasin. Ces instantanés représentent l'état des stocks à un moment précis et indiquent les quantités de produits disponibles dans différents lieux. L'événement est déclenché lors des appels API sans l'attribut repeatPeriod ou dans le cadre des opérations d'instantané programmées.
Lorsqu'un instantané d'inventaire est capturé, l'application déclenche l'événement inventorySnapshot , qui capture les données d'inventaire ponctuelles d'un magasin. L'événement fournit des détails tels que les identifiants des produits, les quantités, les lieux et d'autres données pertinentes. Le site code pour cet événement est inventorySnapshot.
L'exemple JSON suivant montre un événement publié qui est généré lorsqu'un instantané d'inventaire est capturé. L'application encode et ajoute les données de l'événement à l'adresse messages[].data JSON path.
{
"messages": [
{
"data": [
{
"productId": "100001",
"unitOfMeasure": "EACH",
"inventoryStatus": "GOOD",
"productClass": "",
"segmentType": "",
"segment": "",
"tagNo": "",
"batchNo": "",
"lotNo": "",
"manufacturedDate": "",
"locationId": "Bin1",
"quantity": 9.0
},
{
"productId": "100002",
"unitOfMeasure": "EACH",
"inventoryStatus": "GOOD",
"productClass": "",
"segmentType": "",
"segment": "",
"tagNo": "",
"batchNo": "",
"lotNo": "",
"manufacturedDate": "",
"locationId": "FoH",
"quantity": -1.0
}
],
"attributes": {
"code": "inventorySnapshot",
"timestamp": "2024-10-10T08:00Z[Etc/UTC]",
"messageId": "17d03402-7176-49df-9dc5-b0c25c22f310",
"batchId": "1692ae82-25f9-4943-b4d6-79458077925e",
"totalMessages": "1",
"messageSequence": "1",
"storeId": "Store1",
"groupBy": ""
}
}
]
}
L'exemple suivant montre la spécification du schéma JSON qui définit la structure des données JSON publiées dans l'événement " inventorySnapshot. Pour demander la fonctionnalité Événements d'instantané d'inventaire V2 pour un magasin, utilisez l'API Créer un instantané d'inventaire programmé pour les magasins associés.
{
"properties": {
"messages": {
"type": "array",
"description": "Array containing the message details",
"items": {
"type": "object",
"properties": {
"data": {
"type": "array",
"description": "Array containing the inventory details",
"items": {
"type": "object",
"properties": {
"productId": {
"type": "string",
"description": "Unique identifier of the product"
},
"unitOfMeasure": {
"type": "string",
"description": "Unit of measure for the product"
},
"inventoryStatus": {
"type": "string",
"description": "Status of the inventory (e.g., GOOD)"
},
"productClass": {
"type": "string",
"description": "Classification of the product"
},
"segmentType": {
"type": "string",
"description": "Type of segment for the product"
},
"segment": {
"type": "string",
"description": "Segment details of the product"
},
"tagNo": {
"type": "string",
"description": "Tag number for the product"
},
"batchNo": {
"type": "string",
"description": "Batch number for the product"
},
"lotNo": {
"type": "string",
"description": "Lot number for the product"
},
"manufacturedDate": {
"type": "string",
"description": "Manufacturing date of the product"
},
"locationId": {
"type": "string",
"description": "Location identifier where the product is stored"
},
"quantity": {
"type": "number",
"description": "Quantity of the product in stock"
}
}
}
},
"attributes": {
"type": "object",
"description": "Object containing the event attributes",
"properties": {
"code": {
"type": "string",
"description": "Code representing the event"
},
"timestamp": {
"type": "string",
"description": "The exact time when the snapshot was taken"
},
"messageId": {
"type": "string",
"format": "uuid",
"description": "A unique identifier for the event message"
},
"batchId": {
"type": "string",
"format": "uuid",
"description": "Unique identifier of a store batch"
},
"totalMessages": {
"type": "string",
"description": "The total number of messages for this store (for pagination)"
},
"messageSequence": {
"type": "string",
"description": "Page number of the current message"
},
"storeId": {
"type": "string",
"description": "Unique identifier of the store"
},
"groupBy": {
"type": "string",
"description": "Attribute used for grouping the data"
}
}
}
}
}
}
}
}