{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "A recurring expense template. Occurrences are materialized as ordinary immutable expenses.",
      "key": "tid",
      "record": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "category": {
            "maxLength": 64,
            "type": "string"
          },
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "currency": {
            "maxLength": 3,
            "minLength": 3,
            "type": "string"
          },
          "defaultSplit": {
            "format": "at-uri",
            "type": "string"
          },
          "description": {
            "maxGraphemes": 200,
            "maxLength": 1000,
            "minLength": 1,
            "type": "string"
          },
          "endsAt": {
            "format": "datetime",
            "type": "string"
          },
          "minorUnit": {
            "maximum": 4,
            "minimum": 0,
            "type": "integer"
          },
          "nextAt": {
            "format": "datetime",
            "type": "string"
          },
          "paidBy": {
            "items": {
              "ref": "lex:am.noz.at.spl.recurring#moneyAllocation",
              "type": "ref"
            },
            "maxLength": 250,
            "minLength": 1,
            "type": "array"
          },
          "rrule": {
            "description": "RFC 5545 recurrence rule without embedded secrets or user prose.",
            "maxLength": 512,
            "minLength": 1,
            "type": "string"
          },
          "schemaVersion": {
            "const": 1,
            "type": "integer"
          },
          "startsAt": {
            "format": "datetime",
            "type": "string"
          },
          "templateId": {
            "maxLength": 64,
            "minLength": 1,
            "type": "string"
          },
          "timezone": {
            "maxLength": 64,
            "minLength": 1,
            "type": "string"
          },
          "totalMinor": {
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "schemaVersion",
          "templateId",
          "description",
          "currency",
          "minorUnit",
          "totalMinor",
          "paidBy",
          "defaultSplit",
          "rrule",
          "timezone",
          "startsAt",
          "nextAt",
          "active",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "moneyAllocation": {
      "properties": {
        "amountMinor": {
          "minimum": 0,
          "type": "integer"
        },
        "did": {
          "format": "did",
          "type": "string"
        }
      },
      "required": [
        "did",
        "amountMinor"
      ],
      "type": "object"
    }
  },
  "id": "am.noz.at.spl.recurring",
  "lexicon": 1
}
