MoneyRecord class

One money record — a payment, an income, or a transfer — as returned by GET /v2/home/money.

Only records the user entered manually are ever returned. Rows that Zaim imported automatically from a linked bank or card are not exposed by the API at all.

Parameters

Required

  • id: The record id, used in the update and delete paths.
  • mode: Whether this is a payment, an income, or a transfer.
  • userId: The owning user's id.
  • date: The calendar date of the record.
  • categoryId: The category the record belongs to.
  • amount: The amount, an integer with no decimal point.
  • active: 1 while the record is live; see isActive.

Optional

  • genreId: Genre id, null when Zaim sent 0 (default: null).
  • toAccountId: Destination account, null when 0 (default: null).
  • fromAccountId: Source account, null when 0 (default: null).
  • receiptId: Receipt this record was grouped under, null when 0 (default: null).
  • comment: Free-text note (default: '').
  • name: Product name (default: '').
  • place: Place name (default: '').
  • currencyCode: Currency of amount (default: '').
  • created: When the record was created (default: null).

Example

final records = await client.money.list(mode: MoneyMode.payment);
for (final r in records) {
  print('${r.date}: ${r.amount} ${r.currencyCode} at ${r.place}');
}
Annotations
  • @immutable

Constructors

MoneyRecord({required int id, required MoneyMode mode, required int userId, required DateTime date, required int categoryId, required int amount, int? genreId, int? toAccountId, int? fromAccountId, int? receiptId, String comment = '', String name = '', String place = '', String currencyCode = '', int active = 1, DateTime? created})
Creates a money record.
const
MoneyRecord.fromJson(Map<String, dynamic> json)
Parses one element of the money array.
factory

Properties

active → int
The raw active flag: 1 for a live record. See isActive.
final
amount → int
The amount. Always an integer: Zaim never sends a decimal point.
final
categoryId → int
The category id.
final
comment → String
The user's free-text comment. Empty when unset.
final
created → DateTime?
When the record was created, in UTC. null when Zaim omitted it.
final
currencyCode → String
The currency of amount, for example JPY.
final
date → DateTime
The calendar date of the record, at local midnight.
final
fromAccountId → int?
The account money came out of, or null when the record has none.
final
genreId → int?
The genre id, or null when the record has none (Zaim's 0).
final
hashCode → int
The hash code for this object.
no setteroverride
id → int
The record id. Pass it to the update and delete endpoints.
final
isActive → bool
Whether the record is live, i.e. whether active is 1.
no setter
mode → MoneyMode
Whether this record is a payment, an income, or a transfer.
final
name → String
The product name. Empty when unset.
final
place → String
The place name. Empty when unset.
final
receiptId → int?
The receipt this record was grouped under, or null when it has none.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
toAccountId → int?
The account money went into, or null when the record has none.
final
userId → int
The id of the user the record belongs to.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serialises back to Zaim's wire format, restoring the 0 sentinels for the foreign keys that MoneyRecord.fromJson mapped to null.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override