2024-08-01 17:01:50 +00:00
|
|
|
module transaction.model;
|
2024-07-31 17:20:17 +00:00
|
|
|
|
2024-09-19 19:12:23 +00:00
|
|
|
import handy_httpd.components.optional;
|
2024-07-31 17:20:17 +00:00
|
|
|
import std.datetime;
|
2024-08-01 17:01:50 +00:00
|
|
|
|
2024-09-19 19:12:23 +00:00
|
|
|
import util.money;
|
2024-07-31 17:20:17 +00:00
|
|
|
|
|
|
|
struct TransactionVendor {
|
2024-09-19 19:12:23 +00:00
|
|
|
const ulong id;
|
|
|
|
const string name;
|
|
|
|
const string description;
|
2024-07-31 17:20:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct TransactionCategory {
|
2024-09-19 19:12:23 +00:00
|
|
|
const ulong id;
|
|
|
|
const Optional!ulong parentId;
|
|
|
|
const string name;
|
|
|
|
const string description;
|
|
|
|
const string color;
|
2024-07-31 17:20:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct TransactionTag {
|
2024-09-19 19:12:23 +00:00
|
|
|
const ulong id;
|
|
|
|
const string name;
|
2024-07-31 17:20:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct Transaction {
|
2024-09-19 19:12:23 +00:00
|
|
|
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;
|
|
|
|
}
|