{
"id": "app.starrysky.streak.inventory",
"defs": {
"main": {
"key": "tid",
"type": "record",
"record": {
"type": "object",
"required": [
"originService",
"policy",
"subject",
"action",
"balance",
"createdAt"
],
"properties": {
"prev": {
"type": "string",
"format": "cid",
"description": "Link to the previous inventory record in the ledger chain. Null if initializing."
},
"action": {
"type": "string",
"description": "The transaction type occurring in this ledger entry.",
"knownValues": [
"earn",
"spend",
"initialize",
"claim",
"spend_and_earn"
]
},
"policy": {
"type": "string",
"format": "at-uri",
"description": "The URI of the policy governing this streak's rules."
},
"balance": {
"type": "integer",
"description": "The total number of freezes available *after* this action is applied."
},
"subject": {
"type": "string",
"description": "The name of the habit this inventory ledger belongs to (e.g., 'Daily Coding')."
},
"createdAt": {
"type": "string",
"format": "datetime",
"description": "Timestamp of when this inventory ledger entry was created."
},
"originService": {
"type": "string",
"description": "The NSID of the service this inventory applies to."
},
"relatedCheckin": {
"type": "string",
"format": "cid",
"description": "The CID of the checkin record that earned or spent these freezes."
},
"relatedFreezeGrant": {
"type": "string",
"format": "cid",
"description": "The CID of the freezegrant record being claimed."
}
}
},
"description": "A ledger record tracking the accumulation and expenditure of streak freezes. Forms a linked chain via the 'prev' field."
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}