{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "https://dashremix.com/spec/billing/1.1.0/billing@1.schema.json",
 "title": "billing@1 v1.1.0",
 "description": "One property per table (an array of rows). Generated from schema.sql by spec/build.py. Extension tables (x_<owner>_*) belong to forks and board-derived tables (d_*) to the board that rebuilds them; both are allowed as additional properties.",
 "type": "object",
 "properties": {
  "meta": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "key": {
      "type": [
       "string",
       "null"
      ]
     },
     "value": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [],
    "additionalProperties": false
   }
  },
  "customers": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "customer_id": {
      "type": "string"
     },
     "name": {
      "type": [
       "string",
       "null"
      ]
     },
     "created_at": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     },
     "country": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^[A-Z]{2}$"
     },
     "currency": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^[A-Z]{3}$"
     },
     "segment": {
      "type": [
       "string",
       "null"
      ]
     },
     "email_hash": {
      "type": [
       "string",
       "null"
      ]
     },
     "payment_terms_days": {
      "type": [
       "integer",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_ref": {
      "type": [
       "string",
       "null"
      ]
     },
     "imported_at": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     }
    },
    "required": [
     "customer_id"
    ],
    "additionalProperties": false
   }
  },
  "plans": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "price_id": {
      "type": "string"
     },
     "product": {
      "type": [
       "string",
       "null"
      ]
     },
     "product_name": {
      "type": [
       "string",
       "null"
      ]
     },
     "nickname": {
      "type": [
       "string",
       "null"
      ]
     },
     "interval": {
      "type": "string",
      "enum": [
       "month",
       "year",
       "week",
       "day"
      ]
     },
     "interval_count": {
      "type": "integer"
     },
     "unit_amount": {
      "type": [
       "number",
       "null"
      ]
     },
     "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$"
     },
     "usage_type": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "licensed",
       "metered",
       null
      ]
     },
     "active": {
      "type": [
       "integer",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_ref": {
      "type": [
       "string",
       "null"
      ]
     },
     "imported_at": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     }
    },
    "required": [
     "price_id",
     "interval",
     "interval_count",
     "currency"
    ],
    "additionalProperties": false
   }
  },
  "coupons": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "coupon_id": {
      "type": "string"
     },
     "name": {
      "type": [
       "string",
       "null"
      ]
     },
     "percent_off": {
      "type": [
       "number",
       "null"
      ]
     },
     "amount_off": {
      "type": [
       "number",
       "null"
      ]
     },
     "currency": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^[A-Z]{3}$"
     },
     "duration": {
      "type": "string",
      "enum": [
       "once",
       "repeating",
       "forever"
      ]
     },
     "duration_in_months": {
      "type": [
       "integer",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_ref": {
      "type": [
       "string",
       "null"
      ]
     },
     "imported_at": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     }
    },
    "required": [
     "coupon_id",
     "duration"
    ],
    "additionalProperties": false
   }
  },
  "subscriptions": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "subscription_id": {
      "type": "string"
     },
     "customer_id": {
      "type": "string"
     },
     "status": {
      "type": "string",
      "enum": [
       "trialing",
       "active",
       "past_due",
       "unpaid",
       "paused",
       "canceled",
       "incomplete",
       "incomplete_expired"
      ]
     },
     "created_at": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     },
     "started_at": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     },
     "trial_start": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     },
     "trial_end": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     },
     "trial_converted": {
      "type": [
       "integer",
       "null"
      ]
     },
     "cancel_at_period_end": {
      "type": [
       "integer",
       "null"
      ]
     },
     "canceled_at": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     },
     "ended_at": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     },
     "cancel_reason": {
      "type": [
       "string",
       "null"
      ]
     },
     "collection": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "auto",
       "invoice",
       null
      ]
     },
     "currency": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^[A-Z]{3}$"
     },
     "confidence": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "source",
       "detected",
       "manual",
       null
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_ref": {
      "type": [
       "string",
       "null"
      ]
     },
     "imported_at": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     }
    },
    "required": [
     "subscription_id",
     "customer_id",
     "status",
     "started_at"
    ],
    "additionalProperties": false
   }
  },
  "subscription_items": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "segment_id": {
      "type": "string"
     },
     "subscription_id": {
      "type": "string"
     },
     "item_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "price_id": {
      "type": "string"
     },
     "quantity": {
      "type": "number"
     },
     "unit_amount": {
      "type": [
       "number",
       "null"
      ]
     },
     "discount_pct": {
      "type": [
       "number",
       "null"
      ]
     },
     "discount_amount": {
      "type": [
       "number",
       "null"
      ]
     },
     "coupon_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "start": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "end": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "confidence": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "source",
       "detected",
       "manual",
       null
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_ref": {
      "type": [
       "string",
       "null"
      ]
     },
     "imported_at": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     }
    },
    "required": [
     "segment_id",
     "subscription_id",
     "price_id",
     "quantity",
     "start"
    ],
    "additionalProperties": false
   }
  },
  "subscription_pauses": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "pause_id": {
      "type": "string"
     },
     "subscription_id": {
      "type": "string"
     },
     "start": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "end": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "behavior": {
      "type": [
       "string",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_ref": {
      "type": [
       "string",
       "null"
      ]
     },
     "imported_at": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     }
    },
    "required": [
     "pause_id",
     "subscription_id",
     "start"
    ],
    "additionalProperties": false
   }
  },
  "subscription_events": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "event_id": {
      "type": "string"
     },
     "subscription_id": {
      "type": "string"
     },
     "customer_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "at": {
      "type": "string"
     },
     "kind": {
      "type": "string",
      "enum": [
       "started",
       "trial_ended",
       "item_changed",
       "discount_changed",
       "paused",
       "resumed",
       "cancel_scheduled",
       "canceled",
       "ended"
      ]
     },
     "price_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "quantity": {
      "type": [
       "number",
       "null"
      ]
     },
     "detail": {
      "type": [
       "string",
       "null"
      ]
     },
     "confidence": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "source",
       "detected",
       "manual",
       null
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_ref": {
      "type": [
       "string",
       "null"
      ]
     },
     "imported_at": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     }
    },
    "required": [
     "event_id",
     "subscription_id",
     "at",
     "kind"
    ],
    "additionalProperties": false
   }
  },
  "invoices": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "invoice_id": {
      "type": "string"
     },
     "number": {
      "type": [
       "string",
       "null"
      ]
     },
     "customer_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "subscription_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "created_at": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     },
     "period_start": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     },
     "period_end": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     },
     "billing_reason": {
      "type": [
       "string",
       "null"
      ]
     },
     "subtotal": {
      "type": [
       "number",
       "null"
      ]
     },
     "discount": {
      "type": [
       "number",
       "null"
      ]
     },
     "tax": {
      "type": [
       "number",
       "null"
      ]
     },
     "total": {
      "type": "number"
     },
     "amount_due": {
      "type": [
       "number",
       "null"
      ]
     },
     "amount_paid": {
      "type": [
       "number",
       "null"
      ]
     },
     "amount_remaining": {
      "type": [
       "number",
       "null"
      ]
     },
     "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$"
     },
     "status": {
      "type": "string",
      "enum": [
       "draft",
       "open",
       "paid",
       "uncollectible",
       "void"
      ]
     },
     "attempt_count": {
      "type": [
       "integer",
       "null"
      ]
     },
     "paid_at": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     },
     "due_date": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     },
     "issue_date": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "due_on": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "sent_on": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "paid_on": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "closed_on": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "written_off": {
      "type": [
       "number",
       "null"
      ]
     },
     "source_status": {
      "type": [
       "string",
       "null"
      ]
     },
     "reference": {
      "type": [
       "string",
       "null"
      ]
     },
     "tz": {
      "type": [
       "string",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_ref": {
      "type": [
       "string",
       "null"
      ]
     },
     "imported_at": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     }
    },
    "required": [
     "invoice_id",
     "created_at",
     "total",
     "currency",
     "status"
    ],
    "additionalProperties": false
   }
  },
  "invoice_lines": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "line_id": {
      "type": "string"
     },
     "invoice_id": {
      "type": "string"
     },
     "position": {
      "type": [
       "integer",
       "null"
      ]
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     },
     "kind": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "service",
       "time",
       "product",
       "expense",
       "discount",
       "other",
       null
      ]
     },
     "quantity": {
      "type": [
       "number",
       "null"
      ]
     },
     "unit_amount": {
      "type": [
       "number",
       "null"
      ]
     },
     "amount": {
      "type": "number"
     },
     "tax_rate": {
      "type": [
       "number",
       "null"
      ]
     },
     "tax_amount": {
      "type": [
       "number",
       "null"
      ]
     },
     "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$"
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_ref": {
      "type": [
       "string",
       "null"
      ]
     },
     "imported_at": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     }
    },
    "required": [
     "line_id",
     "invoice_id",
     "amount",
     "currency"
    ],
    "additionalProperties": false
   }
  },
  "payments": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "payment_id": {
      "type": "string"
     },
     "invoice_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "customer_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "created_at": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     },
     "amount": {
      "type": "number"
     },
     "amount_refunded": {
      "type": [
       "number",
       "null"
      ]
     },
     "fee": {
      "type": [
       "number",
       "null"
      ]
     },
     "net": {
      "type": [
       "number",
       "null"
      ]
     },
     "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$"
     },
     "status": {
      "type": "string",
      "enum": [
       "succeeded",
       "failed",
       "pending"
      ]
     },
     "failure_code": {
      "type": [
       "string",
       "null"
      ]
     },
     "refunded": {
      "type": [
       "integer",
       "null"
      ]
     },
     "paid_on": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "method": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "bank_transfer",
       "card",
       "cash",
       "check",
       "other",
       null
      ]
     },
     "confidence": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "source",
       "detected",
       "manual",
       null
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_ref": {
      "type": [
       "string",
       "null"
      ]
     },
     "imported_at": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     }
    },
    "required": [
     "payment_id",
     "created_at",
     "amount",
     "currency",
     "status"
    ],
    "additionalProperties": false
   }
  },
  "refunds": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "refund_id": {
      "type": "string"
     },
     "payment_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "customer_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "created_at": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     },
     "amount": {
      "type": "number"
     },
     "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$"
     },
     "reason": {
      "type": [
       "string",
       "null"
      ]
     },
     "status": {
      "type": [
       "string",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_ref": {
      "type": [
       "string",
       "null"
      ]
     },
     "imported_at": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     }
    },
    "required": [
     "refund_id",
     "created_at",
     "amount",
     "currency"
    ],
    "additionalProperties": false
   }
  },
  "credit_notes": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "credit_note_id": {
      "type": "string"
     },
     "invoice_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "customer_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "created_at": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     },
     "amount": {
      "type": "number"
     },
     "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$"
     },
     "reason": {
      "type": [
       "string",
       "null"
      ]
     },
     "status": {
      "type": [
       "string",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_ref": {
      "type": [
       "string",
       "null"
      ]
     },
     "imported_at": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z$"
     }
    },
    "required": [
     "credit_note_id",
     "created_at",
     "amount",
     "currency"
    ],
    "additionalProperties": false
   }
  },
  "fx_rates": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "date": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "ccy": {
      "type": "string",
      "pattern": "^[A-Z]{3}$"
     },
     "base_ccy": {
      "type": "string",
      "pattern": "^[A-Z]{3}$"
     },
     "base_per_unit": {
      "type": "number"
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "date",
     "ccy",
     "base_ccy",
     "base_per_unit"
    ],
    "additionalProperties": false
   }
  },
  "mrr_monthly": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "customer_id": {
      "type": "string"
     },
     "month": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}$"
     },
     "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$"
     },
     "snapshot": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "mrr_native": {
      "type": "number"
     },
     "paused_native": {
      "type": "number"
     },
     "fx_rate": {
      "type": "number"
     },
     "mrr": {
      "type": "number"
     },
     "n_subscriptions": {
      "type": "integer"
     },
     "price_ids": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "customer_id",
     "month",
     "currency",
     "snapshot",
     "mrr_native",
     "paused_native",
     "fx_rate",
     "mrr",
     "n_subscriptions"
    ],
    "additionalProperties": false
   }
  },
  "import_issues": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "issue_id": {
      "type": "string"
     },
     "severity": {
      "type": "string",
      "enum": [
       "info",
       "warn",
       "error"
      ]
     },
     "kind": {
      "type": "string"
     },
     "file": {
      "type": [
       "string",
       "null"
      ]
     },
     "line": {
      "type": [
       "integer",
       "null"
      ]
     },
     "detail": {
      "type": "string"
     },
     "handling": {
      "type": "string"
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "issue_id",
     "severity",
     "kind",
     "detail",
     "handling"
    ],
    "additionalProperties": false
   }
  },
  "overrides": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "override_id": {
      "type": "string"
     },
     "target": {
      "type": "string"
     },
     "field": {
      "type": [
       "string",
       "null"
      ]
     },
     "old_value": {
      "type": [
       "string",
       "null"
      ]
     },
     "new_value": {
      "type": [
       "string",
       "null"
      ]
     },
     "reason": {
      "type": "string"
     },
     "evidence": {
      "type": [
       "string",
       "null"
      ]
     },
     "author": {
      "type": [
       "string",
       "null"
      ]
     },
     "created_at": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "override_id",
     "target",
     "reason"
    ],
    "additionalProperties": false
   }
  },
  "annotations": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "annotation_id": {
      "type": "string"
     },
     "target": {
      "type": "string"
     },
     "kind": {
      "type": "string"
     },
     "body": {
      "type": "string"
     },
     "author": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_ref": {
      "type": [
       "string",
       "null"
      ]
     },
     "created_at": {
      "type": [
       "string",
       "null"
      ]
     },
     "data_hash": {
      "type": [
       "string",
       "null"
      ]
     },
     "status": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "annotation_id",
     "target",
     "kind",
     "body"
    ],
    "additionalProperties": false
   }
  },
  "metric_registry": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "metric_id": {
      "type": "string"
     },
     "version": {
      "type": [
       "integer",
       "null"
      ]
     },
     "unit": {
      "type": [
       "string",
       "null"
      ]
     },
     "params": {
      "type": [
       "string",
       "null"
      ]
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     },
     "sql": {
      "type": [
       "string",
       "null"
      ]
     },
     "test": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "required": [
     "metric_id"
    ],
    "additionalProperties": false
   }
  }
 },
 "required": [
  "meta",
  "customers",
  "plans",
  "subscriptions",
  "subscription_items"
 ],
 "patternProperties": {
  "^x_[a-z0-9_]+$": {
   "type": "array"
  },
  "^d_[a-z0-9_]+$": {
   "type": "array"
  }
 },
 "additionalProperties": false
}
