finnow/finnow-api/source/analytics/data.d

37 lines
790 B
D

module analytics.data;
import std.datetime;
import util.money;
import util.data;
import analytics.balances;
import account.model;
struct JournalEntryStub {
SysTime timestamp;
ulong accountId;
AccountType accountType;
ulong amount;
AccountJournalEntryType type;
}
struct BalanceRecordStub {
SysTime timestamp;
ulong accountId;
long value;
}
/**
* Repository that provides various functions for fetching data that's used in
* the calculation of analytics, separate from usual app functionality.
*/
interface AnalyticsRepository {
JournalEntryStub[] getJournalEntries(
in Currency currency,
in TimeRange timeRange
);
BalanceRecordStub[] getBalanceRecords(
in Currency currency,
in TimeRange timeRange
);
}