{
"id": "am.noz.at.spl.item",
"defs": {
"main": {
"key": "tid",
"type": "record",
"record": {
"type": "object",
"required": [
"schemaVersion",
"expenseId",
"revisionId",
"itemId",
"label",
"amountMinor",
"splitRule",
"owed",
"createdAt"
],
"properties": {
"owed": {
"type": "array",
"items": {
"ref": "lex:am.noz.at.spl.item#moneyAllocation",
"type": "ref"
},
"maxLength": 250,
"minLength": 1,
"description": "Canonical rounded minor-unit allocations. These, rather than recomputed percentages, drive balances."
},
"label": {
"type": "string",
"maxLength": 1000,
"minLength": 1,
"maxGraphemes": 200
},
"itemId": {
"type": "string",
"maxLength": 64,
"minLength": 1
},
"category": {
"type": "string",
"maxLength": 64,
"knownValues": [
"food",
"transport",
"accommodation",
"entertainment",
"groceries",
"utilities",
"shopping",
"tax",
"tip",
"discount",
"other"
]
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"expenseId": {
"type": "string",
"maxLength": 64,
"minLength": 1
},
"splitRule": {
"refs": [
"lex:am.noz.at.spl.item#equalSplit",
"lex:am.noz.at.spl.item#exactSplit",
"lex:am.noz.at.spl.item#percentSplit",
"lex:am.noz.at.spl.item#sharesSplit"
],
"type": "union",
"closed": true
},
"revisionId": {
"type": "string",
"maxLength": 64,
"minLength": 1
},
"amountMinor": {
"type": "integer",
"description": "Exact signed amount in the parent expense's currency minor units. Negative values represent discounts."
},
"quantityMilli": {
"type": "integer",
"minimum": 1,
"description": "Optional quantity in thousandths, avoiding floating-point values."
},
"schemaVersion": {
"type": "integer",
"const": 1
}
}
},
"description": "A line item belonging to one immutable expense revision."
},
"equalSplit": {
"type": "object",
"required": [
"participants"
],
"properties": {
"participants": {
"type": "array",
"items": {
"type": "string",
"format": "did"
},
"maxLength": 250,
"minLength": 1
}
}
},
"exactSplit": {
"type": "object",
"required": [
"allocations"
],
"properties": {
"allocations": {
"type": "array",
"items": {
"ref": "lex:am.noz.at.spl.item#moneyAllocation",
"type": "ref"
},
"maxLength": 250,
"minLength": 1
}
}
},
"sharesSplit": {
"type": "object",
"required": [
"allocations"
],
"properties": {
"allocations": {
"type": "array",
"items": {
"ref": "lex:am.noz.at.spl.item#shareAllocation",
"type": "ref"
},
"maxLength": 250,
"minLength": 1
}
}
},
"percentSplit": {
"type": "object",
"required": [
"allocations"
],
"properties": {
"allocations": {
"type": "array",
"items": {
"ref": "lex:am.noz.at.spl.item#percentAllocation",
"type": "ref"
},
"maxLength": 250,
"minLength": 1
}
}
},
"moneyAllocation": {
"type": "object",
"required": [
"did",
"amountMinor"
],
"properties": {
"did": {
"type": "string",
"format": "did"
},
"amountMinor": {
"type": "integer"
}
}
},
"shareAllocation": {
"type": "object",
"required": [
"did",
"shares"
],
"properties": {
"did": {
"type": "string",
"format": "did"
},
"shares": {
"type": "integer",
"maximum": 1000000,
"minimum": 1
}
}
},
"percentAllocation": {
"type": "object",
"required": [
"did",
"partsPerMillion"
],
"properties": {
"did": {
"type": "string",
"format": "did"
},
"partsPerMillion": {
"type": "integer",
"maximum": 1000000,
"minimum": 0
}
}
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}