init: add contract definitions and database schema with migrations skeleton

This commit is contained in:
2026-04-04 22:42:16 +03:00
parent 1681a694d3
commit 879418b5a9
14 changed files with 251 additions and 8 deletions

View File

@@ -0,0 +1,37 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "contract/ingest/common.schema.json",
"type": "object",
"required": ["v", "id", "type", "ts", "deviceId", "payload"],
"additionalProperties": false,
"properties": {
"v": {
"type": "integer",
"const": 1
},
"id": {
"type": "string",
"minLength": 1
},
"type": {
"type": "string",
"enum": ["telemetry", "event"]
},
"ts": {
"type": "integer",
"minimum": 1600000000000,
"description": "Unix time in milliseconds (UTC)"
},
"deviceId": {
"type": "string",
"minLength": 1
},
"payload": {
"type": "object"
},
"meta": {
"type": "object",
"additionalProperties": true
}
}
}