-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.txt
48 lines (42 loc) · 1.31 KB
/
models.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Budget: {
id: integer
name: string
active: boolean
}
Evolution:
-> arch-general:
-> flat models versus hierarchical
-> builders
-> make interfaces for models?
-> versioning: does same budget have versioned items and/or recurrence schedules?
-> should budgets have lifecycles even though from year to year they would be nearly
the same? copy into new and restire the old?
-> scope: would budgets be partitioned/scoped to focus on certain parts of a user's
finances such that user would need multiple, active budgets to complete the picture?
BudgetItem: {
id: integer
code: string
description: string
amount: double
transactsOn: RecurrenceSchedule
merchant: string
}
RecurrenceSchedule: {
start: datetime
end: datetime
recurrence: Recurrence
}
Recurrence: <{
type: function() returns string default { return getClass().getSimpleName() }
next: function(datetime) returns datetime
}>
FixedIntervalRecurrence: extends Recurrence {
magnitude: integer
unit: chronoUnit
next: function(datetime x) { x.plus(magnitude, unit) }
}
CustomDatesRecurrence: extends Recurrence {
fullSchedule: boolean // does model currently have the full schedule loaded?
customSchedule: list<datetime>
next: function(datetime x) { customSchedule.get(customSchedule.indexOf(x) + 1) }
}