-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcocoon.yml
104 lines (104 loc) · 2.31 KB
/
cocoon.yml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
nodes:
Annotate:
editor:
col: 5
row: 0
in:
account: "cocoon://ReadYNAB/out/account"
budget: "cocoon://ReadYNAB/out/budget"
categories: "cocoon://ReadYNAB/out/categories"
config: "cocoon://ReadConfig/out/data"
data: "cocoon://SimilarPayees/out/data"
type: CreateTransactions
view: Transaction
DateToTimestamp:
editor:
col: 2
row: 1
in:
data: "cocoon://ReadYNAB/out/transactions"
map: |
x => ({
...x,
date_ts: new Date(x.date).getTime()
})
type: Map
MapN26Data:
"?": >-
YNAB uses "milliunits", so we use that inernally everywhere as well. See:
https://api.youneedabudget.com/#data_formats
editor:
col: 2
row: 2
in:
data: "cocoon://ReadN26/out/data"
map: |
x => ({
...x,
amount: Math.round(x.amount * 1000),
originalAmount: x.originalAmount
? Math.round(x.originalAmount * 1000)
: x.originalAmount,
payee: x.merchantName || x.partnerName
})
type: Map
ReadConfig:
editor:
col: 0
row: 0
in:
uri: n26.yml
type: ReadYAML
ReadN26:
editor:
col: 1
row: 2
in:
command: n26 -json transactions --limit 100
deserialise: JSON.parse
type: Pipe
ReadYNAB:
editor:
col: 1
row: 1
in:
budget: TeamTurtle
config: "cocoon://ReadConfig/out/data"
persist: true
type: ReadYNAB
SimilarPayees:
editor:
col: 4
row: 1
in:
affluent: "cocoon://ReadYNAB/out/payees"
attribute: similarPayees
data: "cocoon://SimilarTransactions/out/data"
metrics:
payee:
affluentAttribute: name
attribute: payee
type: String
precision: 2
type: Distance
SimilarTransactions:
editor:
col: 3
row: 2
in:
affluent: "cocoon://DateToTimestamp/out/data"
attribute: similarTransactions
data: "cocoon://MapN26Data/out/data"
metrics:
amount:
absolute: true
type: Percent
weight: 10
date:
absolute: true
affluentAttribute: date_ts
attribute: visibleTS
type: Percent
weight: 100
precision: 2
type: Distance