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-27 15:35:08 +00:00
|
|
|
immutable ulong id;
|
|
|
|
immutable string name;
|
|
|
|
immutable string description;
|
2024-07-31 17:20:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct TransactionCategory {
|
2024-09-27 15:35:08 +00:00
|
|
|
immutable ulong id;
|
|
|
|
immutable Optional!ulong parentId;
|
|
|
|
immutable string name;
|
|
|
|
immutable string description;
|
|
|
|
immutable string color;
|
2024-07-31 17:20:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct TransactionTag {
|
2024-09-27 15:35:08 +00:00
|
|
|
immutable ulong id;
|
|
|
|
immutable string name;
|
2024-07-31 17:20:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct Transaction {
|
2024-09-27 15:35:08 +00:00
|
|
|
immutable ulong id;
|
2024-09-19 19:12:23 +00:00
|
|
|
/// The time at which the transaction happened.
|
2024-09-27 15:35:08 +00:00
|
|
|
immutable SysTime timestamp;
|
2024-09-19 19:12:23 +00:00
|
|
|
/// The time at which the transaction entity was saved.
|
2024-09-27 15:35:08 +00:00
|
|
|
immutable SysTime addedAt;
|
|
|
|
immutable ulong amount;
|
|
|
|
immutable Currency currency;
|
|
|
|
immutable string description;
|
|
|
|
immutable Optional!ulong vendorId;
|
|
|
|
immutable Optional!ulong categoryId;
|
2024-09-19 19:12:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct TransactionLineItem {
|
2024-09-27 15:35:08 +00:00
|
|
|
immutable ulong id;
|
|
|
|
immutable ulong transactionId;
|
|
|
|
immutable long valuePerItem;
|
|
|
|
immutable ulong quantity;
|
|
|
|
immutable uint idx;
|
|
|
|
immutable string description;
|
|
|
|
immutable Optional!ulong categoryId;
|
2024-09-19 19:12:23 +00:00
|
|
|
}
|