# am.noz.at.spl.item

> Published by [noz.am](https://lexicon.garden/identity/did:plc:lmkzmvv6sdxntwtyxpg7fqqq)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:lmkzmvv6sdxntwtyxpg7fqqq/am.noz.at.spl.item)
- [Documentation](https://lexicon.garden/lexicon/did:plc:lmkzmvv6sdxntwtyxpg7fqqq/am.noz.at.spl.item/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:lmkzmvv6sdxntwtyxpg7fqqq/am.noz.at.spl.item/examples)

## Definitions

### `am.noz.at.spl.item`

**Type**: `record`

A line item belonging to one immutable expense revision.

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `owed` | `array` | Yes | Canonical rounded minor-unit allocations. These, rather than recomputed percentages, drive balances. |
| `label` | `string` | Yes |  |
| `itemId` | `string` | Yes |  |
| `category` | `string` | No |  |
| `createdAt` | `string` (datetime) | Yes |  |
| `expenseId` | `string` | Yes |  |
| `splitRule` | `union` | Yes |  |
| `revisionId` | `string` | Yes |  |
| `amountMinor` | `integer` | Yes | Exact signed amount in the parent expense's currency minor units. Negative values represent discounts. |
| `quantityMilli` | `integer` | No | Optional quantity in thousandths, avoiding floating-point values. |
| `schemaVersion` | `integer` | Yes |  |

### `am.noz.at.spl.item#equalSplit`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `participants` | `array` | Yes |  |

### `am.noz.at.spl.item#exactSplit`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `allocations` | `array` | Yes |  |

### `am.noz.at.spl.item#sharesSplit`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `allocations` | `array` | Yes |  |

### `am.noz.at.spl.item#percentSplit`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `allocations` | `array` | Yes |  |

### `am.noz.at.spl.item#moneyAllocation`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |
| `amountMinor` | `integer` | Yes |  |

### `am.noz.at.spl.item#shareAllocation`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |
| `shares` | `integer` | Yes |  |

### `am.noz.at.spl.item#percentAllocation`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |
| `partsPerMillion` | `integer` | Yes |  |

## Raw Schema

```json
{
  "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
}
```
