{
"id": "am.noz.at.spl.expense",
"defs": {
"main": {
"key": "tid",
"type": "record",
"record": {
"type": "object",
"required": [
"schemaVersion",
"expenseId",
"revisionId",
"description",
"occurredAt",
"createdAt",
"currency",
"minorUnit",
"totalMinor",
"paidBy",
"itemCount",
"voided"
],
"properties": {
"base": {
"ref": "lex:am.noz.at.spl.expense#recordRef",
"type": "ref",
"description": "The effective revision this revision was based on."
},
"notes": {
"type": "string",
"maxLength": 4000,
"maxGraphemes": 1000
},
"paidBy": {
"type": "array",
"items": {
"ref": "lex:am.noz.at.spl.expense#moneyAllocation",
"type": "ref"
},
"maxLength": 250,
"minLength": 1
},
"voided": {
"type": "boolean",
"description": "A voiding revision replaces destructive deletion in normal application flows."
},
"receipt": {
"type": "blob",
"accept": [
"image/jpeg",
"image/png",
"image/webp",
"application/pdf"
],
"maxSize": 10000000
},
"category": {
"type": "string",
"maxLength": 64,
"knownValues": [
"food",
"transport",
"accommodation",
"entertainment",
"groceries",
"utilities",
"shopping",
"other"
]
},
"currency": {
"type": "string",
"maxLength": 3,
"minLength": 3,
"description": "Uppercase ISO 4217 currency code."
},
"merchant": {
"type": "string",
"maxLength": 500,
"maxGraphemes": 120
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"expenseId": {
"type": "string",
"maxLength": 64,
"minLength": 1,
"description": "Stable application identifier shared by every revision."
},
"itemCount": {
"type": "integer",
"maximum": 500,
"minimum": 1
},
"minorUnit": {
"type": "integer",
"maximum": 4,
"minimum": 0
},
"occurredAt": {
"type": "string",
"format": "datetime"
},
"receiptAlt": {
"type": "string",
"maxLength": 2000,
"maxGraphemes": 300
},
"revisionId": {
"type": "string",
"maxLength": 64,
"minLength": 1
},
"totalMinor": {
"type": "integer",
"minimum": 1,
"description": "Exact total in currency minor units; never a floating-point amount."
},
"description": {
"type": "string",
"maxLength": 1000,
"minLength": 1,
"maxGraphemes": 200
},
"schemaVersion": {
"type": "integer",
"const": 1
},
"recurringSource": {
"type": "string",
"format": "at-uri"
}
}
},
"description": "An immutable expense revision header. Items are stored in am.noz.at.spl.item records with the same expenseId and revisionId."
},
"recordRef": {
"type": "object",
"required": [
"uri",
"cid"
],
"properties": {
"cid": {
"type": "string",
"format": "cid"
},
"uri": {
"type": "string",
"format": "at-uri"
}
}
},
"moneyAllocation": {
"type": "object",
"required": [
"did",
"amountMinor"
],
"properties": {
"did": {
"type": "string",
"format": "did"
},
"amountMinor": {
"type": "integer",
"minimum": 0
}
}
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}