diff --git a/mod-orders-storage/examples/batch_tracking.sample b/mod-orders-storage/examples/batch_tracking.sample new file mode 100644 index 00000000..cf4644e0 --- /dev/null +++ b/mod-orders-storage/examples/batch_tracking.sample @@ -0,0 +1,7 @@ +{ + "id": "12345678-1234-1234-1234-123456789012", + "processedCount": 0, + "totalRecords": 100, + "createdDate": "2024-01-01T12:00:00.000Z" +} + diff --git a/mod-orders-storage/schemas/batch_tracking.json b/mod-orders-storage/schemas/batch_tracking.json new file mode 100644 index 00000000..917b7732 --- /dev/null +++ b/mod-orders-storage/schemas/batch_tracking.json @@ -0,0 +1,42 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Batch tracking record for aggregating item Kafka events", + "javaName": "BatchTracking", + "type": "object", + "properties": { + "id": { + "description": "Unique identifier for the batch", + "$ref": "../../common/schemas/uuid.json" + }, + "processedCount": { + "description": "Number of records processed so far", + "type": "integer", + "default": 0, + "minimum": 0 + }, + "totalRecords": { + "description": "Total number of records expected in this batch", + "type": "integer", + "minimum": 1 + }, + "createdDate": { + "description": "Date and time when the batch tracking record was created", + "type": "string", + "format": "date-time" + }, + "_version": { + "type": "integer", + "description": "Record version for optimistic locking" + }, + "metadata": { + "type": "object", + "$ref": "../../../raml-util/schemas/metadata.schema", + "readonly": true + } + }, + "additionalProperties": false, + "required": [ + "totalRecords" + ] +} +