pub struct Transaction {
pub amount_cents: i64,
pub created_at: DateTime<Utc>,
pub description: Option<String>,
pub id: Uuid,
pub source: TransactionSource,
}Expand description
One append-only ledger entry — a credit (positive) or debit (negative).
JSON schema
{
"title": "Transaction",
"description": "One append-only ledger entry — a credit (positive) or
debit (negative).",
"type": "object",
"required": [
"amount_cents",
"created_at",
"id",
"source"
],
"properties": {
"amount_cents": {
"description": "Signed amount in cents: positive for credits,
negative for debits.",
"type": "integer"
},
"created_at": {
"description": "When the entry was recorded.",
"type": "string",
"format": "date-time"
},
"description": {
"description": "Optional human-readable note.",
"type": [
"string",
"null"
]
},
"id": {
"description": "The entry's id.",
"type": "string",
"format": "uuid"
},
"source": {
"description": "What produced the entry.",
"type": "string",
"enum": [
"stripe_topup",
"coupon_redemption",
"admin_grant",
"vm_lease_debit",
"refund"
]
}
}
}Fields§
§amount_cents: i64Signed amount in cents: positive for credits, negative for debits.
created_at: DateTime<Utc>When the entry was recorded.
description: Option<String>Optional human-readable note.
id: UuidThe entry’s id.
source: TransactionSourceWhat produced the entry.
Trait Implementations§
Source§impl Clone for Transaction
impl Clone for Transaction
Source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Transaction
impl Debug for Transaction
Source§impl<'de> Deserialize<'de> for Transaction
impl<'de> Deserialize<'de> for Transaction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Transaction
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnsafeUnpin for Transaction
impl UnwindSafe for Transaction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more