{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "./job-schema.json",
  "title": "Loom private paid job record",
  "type": "object",
  "additionalProperties": false,
  "required": ["id", "type", "buyerWallet", "paymentSignature", "paymentLamports", "paymentSlot", "status", "createdAt"],
  "properties": {
    "id": { "type": "string", "pattern": "^JOB-[A-F0-9]{12}$" },
    "type": { "enum": ["inference", "render"] },
    "buyerWallet": { "type": "string", "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$" },
    "paymentSignature": { "type": "string", "pattern": "^[1-9A-HJ-NP-Za-km-z]{64,100}$" },
    "paymentLamports": { "type": "integer", "minimum": 1 },
    "paymentSlot": { "type": "integer", "minimum": 1 },
    "paymentBlockTime": { "type": ["integer", "null"] },
    "model": { "type": ["string", "null"], "maxLength": 64 },
    "prompt": { "type": ["string", "null"], "maxLength": 4000 },
    "promptHash": { "type": ["string", "null"], "pattern": "^[a-f0-9]{64}$" },
    "sceneSeed": { "type": ["string", "null"], "maxLength": 128 },
    "frames": { "type": ["integer", "null"], "minimum": 1 },
    "credits": { "type": ["integer", "null"], "minimum": 1 },
    "assignedLeaseId": { "type": ["string", "null"] },
    "resultDigest": { "type": ["string", "null"] },
    "status": { "enum": ["queued", "leased", "running", "verifying", "complete", "failed", "refunded"] },
    "createdAt": { "type": "string", "format": "date-time" },
    "completedAt": { "type": ["string", "null"], "format": "date-time" }
  }
}
