finnow/finnow-api/source/transaction/model.d

49 lines
1.0 KiB
D

module transaction.model;
import handy_httpd.components.optional;
import std.datetime;
import util.money;
struct TransactionVendor {
const ulong id;
const string name;
const string description;
}
struct TransactionCategory {
const ulong id;
const Optional!ulong parentId;
const string name;
const string description;
const string color;
}
struct TransactionTag {
const ulong id;
const string name;
}
struct Transaction {
const ulong id;
/// The time at which the transaction happened.
const SysTime timestamp;
/// The time at which the transaction entity was saved.
const SysTime addedAt;
const ulong amount;
const Currency currency;
const string description;
const Optional!ulong vendorId;
const Optional!ulong categoryId;
}
struct TransactionLineItem {
const ulong id;
const ulong transactionId;
const long valuePerItem;
const ulong quantity;
const uint idx;
const string description;
const Optional!ulong categoryId;
}