dao-treasury 0.0.35__cp311-cp311-win_amd64.whl → 0.1.1__cp311-cp311-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of dao-treasury might be problematic. Click here for more details.

Files changed (49) hide show
  1. dao_treasury/.grafana/provisioning/dashboards/breakdowns/Expenses.json +567 -0
  2. dao_treasury/.grafana/provisioning/dashboards/breakdowns/Revenue.json +569 -0
  3. dao_treasury/.grafana/provisioning/dashboards/dashboards.yaml +7 -57
  4. dao_treasury/.grafana/provisioning/dashboards/streams/LlamaPay.json +15 -27
  5. dao_treasury/.grafana/provisioning/dashboards/summary/Monthly.json +286 -25
  6. dao_treasury/.grafana/provisioning/dashboards/transactions/Treasury Transactions.json +54 -71
  7. dao_treasury/.grafana/provisioning/dashboards/transactions/Unsorted Transactions.json +367 -0
  8. dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow (Including Unsorted).json +172 -209
  9. dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow.json +122 -142
  10. dao_treasury/.grafana/provisioning/dashboards/treasury/Current Treasury Assets.json +941 -0
  11. dao_treasury/.grafana/provisioning/dashboards/treasury/Historical Treasury Balances.json +3931 -0
  12. dao_treasury/.grafana/provisioning/dashboards/treasury/Operating Cashflow.json +89 -108
  13. dao_treasury/.grafana/provisioning/datasources/datasources.yaml +9 -4
  14. dao_treasury/ENVIRONMENT_VARIABLES.py +12 -0
  15. dao_treasury/__init__.py +14 -4
  16. dao_treasury/_docker.cp311-win_amd64.pyd +0 -0
  17. dao_treasury/_docker.py +44 -23
  18. dao_treasury/_nicknames.cp311-win_amd64.pyd +0 -0
  19. dao_treasury/_nicknames.py +18 -2
  20. dao_treasury/_wallet.cp311-win_amd64.pyd +0 -0
  21. dao_treasury/constants.cp311-win_amd64.pyd +0 -0
  22. dao_treasury/constants.py +24 -0
  23. dao_treasury/db.py +409 -119
  24. dao_treasury/docker-compose.yaml +19 -3
  25. dao_treasury/main.py +44 -3
  26. dao_treasury/sorting/__init__.cp311-win_amd64.pyd +0 -0
  27. dao_treasury/sorting/__init__.py +38 -21
  28. dao_treasury/sorting/_matchers.cp311-win_amd64.pyd +0 -0
  29. dao_treasury/sorting/_rules.cp311-win_amd64.pyd +0 -0
  30. dao_treasury/sorting/factory.cp311-win_amd64.pyd +0 -0
  31. dao_treasury/sorting/rule.cp311-win_amd64.pyd +0 -0
  32. dao_treasury/sorting/rule.py +8 -10
  33. dao_treasury/sorting/rules/__init__.cp311-win_amd64.pyd +0 -0
  34. dao_treasury/sorting/rules/ignore/__init__.cp311-win_amd64.pyd +0 -0
  35. dao_treasury/sorting/rules/ignore/llamapay.cp311-win_amd64.pyd +0 -0
  36. dao_treasury/streams/llamapay.py +14 -2
  37. dao_treasury/treasury.py +37 -16
  38. dao_treasury/types.cp311-win_amd64.pyd +0 -0
  39. {dao_treasury-0.0.35.dist-info → dao_treasury-0.1.1.dist-info}/METADATA +19 -3
  40. dao_treasury-0.1.1.dist-info/RECORD +53 -0
  41. dao_treasury-0.1.1.dist-info/top_level.txt +2 -0
  42. dao_treasury__mypyc.cp311-win_amd64.pyd +0 -0
  43. bf2b4fe1f86ad2ea158b__mypyc.cp311-win_amd64.pyd +0 -0
  44. dao_treasury/.grafana/provisioning/dashboards/treasury/Treasury.json +0 -2018
  45. dao_treasury/streams/__init__.cp311-win_amd64.pyd +0 -0
  46. dao_treasury/streams/llamapay.cp311-win_amd64.pyd +0 -0
  47. dao_treasury-0.0.35.dist-info/RECORD +0 -51
  48. dao_treasury-0.0.35.dist-info/top_level.txt +0 -2
  49. {dao_treasury-0.0.35.dist-info → dao_treasury-0.1.1.dist-info}/WHEEL +0 -0
@@ -18,11 +18,11 @@
18
18
  "editable": true,
19
19
  "fiscalYearStartMonth": 0,
20
20
  "graphTooltip": 1,
21
+ "id": 5,
21
22
  "links": [],
22
- "liveNow": false,
23
23
  "panels": [
24
24
  {
25
- "datasource": "SQLite",
25
+ "datasource": "PostgreSQL",
26
26
  "fieldConfig": {
27
27
  "defaults": {
28
28
  "color": {
@@ -34,14 +34,15 @@
34
34
  "steps": [
35
35
  {
36
36
  "color": "green",
37
- "value": null
37
+ "value": 0
38
38
  },
39
39
  {
40
40
  "color": "red",
41
41
  "value": 80
42
42
  }
43
43
  ]
44
- }
44
+ },
45
+ "unit": "currencyUSD"
45
46
  },
46
47
  "overrides": []
47
48
  },
@@ -57,34 +58,32 @@
57
58
  "graphMode": "area",
58
59
  "justifyMode": "auto",
59
60
  "orientation": "auto",
61
+ "percentChangeColorMode": "standard",
60
62
  "reduceOptions": {
61
- "calcs": [
62
- "lastNotNull"
63
- ],
63
+ "calcs": ["lastNotNull"],
64
64
  "fields": "",
65
65
  "values": false
66
66
  },
67
- "textMode": "auto"
67
+ "showPercentChange": false,
68
+ "textMode": "auto",
69
+ "wideLayout": true
68
70
  },
69
- "pluginVersion": "10.2.0",
71
+ "pluginVersion": "12.1.1",
70
72
  "targets": [
71
73
  {
72
- "datasource": "SQLite",
73
- "queryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
74
- "queryType": "table",
75
- "rawQueryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
74
+ "datasource": "PostgreSQL",
75
+ "format": "table",
76
+ "rawSql": "SELECT SUM(p.value_usd) AS total_revenue FROM usdvalue_presum p JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Revenue' AND p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000",
76
77
  "refId": "A",
77
- "timeColumns": [
78
- "time",
79
- "ts"
80
- ]
78
+ "timeColumns": ["time", "ts"]
81
79
  }
82
80
  ],
83
81
  "title": "Revenue",
84
- "type": "stat"
82
+ "type": "stat",
83
+ "description": "Displays the total value of all transactions sorted as Revenue for the selected period."
85
84
  },
86
85
  {
87
- "datasource": "SQLite",
86
+ "datasource": "PostgreSQL",
88
87
  "fieldConfig": {
89
88
  "defaults": {
90
89
  "color": {
@@ -96,14 +95,15 @@
96
95
  "steps": [
97
96
  {
98
97
  "color": "green",
99
- "value": null
98
+ "value": 0
100
99
  },
101
100
  {
102
101
  "color": "red",
103
102
  "value": 80
104
103
  }
105
104
  ]
106
- }
105
+ },
106
+ "unit": "currencyUSD"
107
107
  },
108
108
  "overrides": []
109
109
  },
@@ -119,34 +119,32 @@
119
119
  "graphMode": "area",
120
120
  "justifyMode": "auto",
121
121
  "orientation": "auto",
122
+ "percentChangeColorMode": "standard",
122
123
  "reduceOptions": {
123
- "calcs": [
124
- "lastNotNull"
125
- ],
124
+ "calcs": ["lastNotNull"],
126
125
  "fields": "",
127
126
  "values": false
128
127
  },
129
- "textMode": "auto"
128
+ "showPercentChange": false,
129
+ "textMode": "auto",
130
+ "wideLayout": true
130
131
  },
131
- "pluginVersion": "10.2.0",
132
+ "pluginVersion": "12.1.1",
132
133
  "targets": [
133
134
  {
134
- "datasource": "SQLite",
135
- "queryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Expenses' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
136
- "queryType": "table",
137
- "rawQueryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Expenses' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
135
+ "datasource": "PostgreSQL",
136
+ "format": "table",
137
+ "rawSql": "SELECT SUM(p.value_usd) AS total_revenue FROM usdvalue_presum p JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Expenses' AND p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000",
138
138
  "refId": "A",
139
- "timeColumns": [
140
- "time",
141
- "ts"
142
- ]
139
+ "timeColumns": ["time", "ts"]
143
140
  }
144
141
  ],
145
142
  "title": "Expenses",
146
- "type": "stat"
143
+ "type": "stat",
144
+ "description": "Displays the total value of all transactions sorted as Expenses for the selected period."
147
145
  },
148
146
  {
149
- "datasource": "SQLite",
147
+ "datasource": "PostgreSQL",
150
148
  "fieldConfig": {
151
149
  "defaults": {
152
150
  "color": {
@@ -158,14 +156,15 @@
158
156
  "steps": [
159
157
  {
160
158
  "color": "green",
161
- "value": null
159
+ "value": 0
162
160
  },
163
161
  {
164
162
  "color": "red",
165
163
  "value": 80
166
164
  }
167
165
  ]
168
- }
166
+ },
167
+ "unit": "currencyUSD"
169
168
  },
170
169
  "overrides": []
171
170
  },
@@ -181,34 +180,32 @@
181
180
  "graphMode": "area",
182
181
  "justifyMode": "auto",
183
182
  "orientation": "auto",
183
+ "percentChangeColorMode": "standard",
184
184
  "reduceOptions": {
185
- "calcs": [
186
- "lastNotNull"
187
- ],
185
+ "calcs": ["lastNotNull"],
188
186
  "fields": "",
189
187
  "values": false
190
188
  },
191
- "textMode": "auto"
189
+ "showPercentChange": false,
190
+ "textMode": "auto",
191
+ "wideLayout": true
192
192
  },
193
- "pluginVersion": "10.2.0",
193
+ "pluginVersion": "12.1.1",
194
194
  "targets": [
195
195
  {
196
- "datasource": "SQLite",
197
- "queryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Cost of Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
198
- "queryType": "table",
199
- "rawQueryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Cost of Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
196
+ "datasource": "PostgreSQL",
197
+ "format": "table",
198
+ "rawSql": "SELECT SUM(p.value_usd) AS total_revenue FROM usdvalue_presum p JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Cost of Revenue' AND p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000",
200
199
  "refId": "A",
201
- "timeColumns": [
202
- "time",
203
- "ts"
204
- ]
200
+ "timeColumns": ["time", "ts"]
205
201
  }
206
202
  ],
207
203
  "title": "Cost of Revenue",
208
- "type": "stat"
204
+ "type": "stat",
205
+ "description": "Displays the total value of all transactions sorted as Cost of Revenue for the selected period."
209
206
  },
210
207
  {
211
- "datasource": "SQLite",
208
+ "datasource": "PostgreSQL",
212
209
  "fieldConfig": {
213
210
  "defaults": {
214
211
  "color": {
@@ -220,14 +217,15 @@
220
217
  "steps": [
221
218
  {
222
219
  "color": "green",
223
- "value": null
220
+ "value": 0
224
221
  },
225
222
  {
226
223
  "color": "red",
227
224
  "value": 80
228
225
  }
229
226
  ]
230
- }
227
+ },
228
+ "unit": "currencyUSD"
231
229
  },
232
230
  "overrides": []
233
231
  },
@@ -243,34 +241,32 @@
243
241
  "graphMode": "area",
244
242
  "justifyMode": "auto",
245
243
  "orientation": "auto",
244
+ "percentChangeColorMode": "standard",
246
245
  "reduceOptions": {
247
- "calcs": [
248
- "lastNotNull"
249
- ],
246
+ "calcs": ["lastNotNull"],
250
247
  "fields": "",
251
248
  "values": false
252
249
  },
253
- "textMode": "auto"
250
+ "showPercentChange": false,
251
+ "textMode": "auto",
252
+ "wideLayout": true
254
253
  },
255
- "pluginVersion": "10.2.0",
254
+ "pluginVersion": "12.1.1",
256
255
  "targets": [
257
256
  {
258
- "datasource": "SQLite",
259
- "queryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Other Income' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
260
- "queryType": "table",
261
- "rawQueryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Other Income' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
257
+ "datasource": "PostgreSQL",
258
+ "format": "table",
259
+ "rawSql": "SELECT SUM(p.value_usd) AS total_revenue FROM usdvalue_presum p JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Other Income' AND p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000",
262
260
  "refId": "A",
263
- "timeColumns": [
264
- "time",
265
- "ts"
266
- ]
261
+ "timeColumns": ["time", "ts"]
267
262
  }
268
263
  ],
269
264
  "title": "Other Income",
270
- "type": "stat"
265
+ "type": "stat",
266
+ "description": "Displays the total value of all transactions sorted as Other Income for the selected period."
271
267
  },
272
268
  {
273
- "datasource": "SQLite",
269
+ "datasource": "PostgreSQL",
274
270
  "fieldConfig": {
275
271
  "defaults": {
276
272
  "color": {
@@ -282,14 +278,15 @@
282
278
  "steps": [
283
279
  {
284
280
  "color": "green",
285
- "value": null
281
+ "value": 0
286
282
  },
287
283
  {
288
284
  "color": "red",
289
285
  "value": 80
290
286
  }
291
287
  ]
292
- }
288
+ },
289
+ "unit": "currencyUSD"
293
290
  },
294
291
  "overrides": []
295
292
  },
@@ -305,35 +302,33 @@
305
302
  "graphMode": "area",
306
303
  "justifyMode": "auto",
307
304
  "orientation": "auto",
305
+ "percentChangeColorMode": "standard",
308
306
  "reduceOptions": {
309
- "calcs": [
310
- "lastNotNull"
311
- ],
307
+ "calcs": ["lastNotNull"],
312
308
  "fields": "",
313
309
  "values": false
314
310
  },
315
- "textMode": "auto"
311
+ "showPercentChange": false,
312
+ "textMode": "auto",
313
+ "wideLayout": true
316
314
  },
317
- "pluginVersion": "10.2.0",
315
+ "pluginVersion": "12.1.1",
318
316
  "targets": [
319
317
  {
320
- "datasource": "SQLite",
321
- "queryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Other Expenses' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
322
- "queryType": "table",
323
- "rawQueryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Other Expenses' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
318
+ "datasource": "PostgreSQL",
319
+ "format": "table",
320
+ "rawSql": "SELECT SUM(p.value_usd) AS total_revenue FROM usdvalue_presum p JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Other Expenses' AND p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000",
324
321
  "refId": "A",
325
- "timeColumns": [
326
- "time",
327
- "ts"
328
- ]
322
+ "timeColumns": ["time", "ts"]
329
323
  }
330
324
  ],
331
325
  "title": "Other Expenses",
332
- "type": "stat"
326
+ "type": "stat",
327
+ "description": "Displays the total value of all transactions sorted as Other Expenses for the selected period."
333
328
  },
334
329
  {
335
- "datasource": "SQLite",
336
- "description": "",
330
+ "datasource": "PostgreSQL",
331
+ "description": "Shows the net total cashflow (all Revenue and Other Income minus all Expenses, Cost of Revenue, and Other Expenses) for the selected period.",
337
332
  "fieldConfig": {
338
333
  "defaults": {
339
334
  "color": {
@@ -345,14 +340,15 @@
345
340
  "steps": [
346
341
  {
347
342
  "color": "green",
348
- "value": null
343
+ "value": 0
349
344
  },
350
345
  {
351
346
  "color": "red",
352
347
  "value": 80
353
348
  }
354
349
  ]
355
- }
350
+ },
351
+ "unit": "currencyUSD"
356
352
  },
357
353
  "overrides": []
358
354
  },
@@ -368,35 +364,32 @@
368
364
  "graphMode": "area",
369
365
  "justifyMode": "auto",
370
366
  "orientation": "auto",
367
+ "percentChangeColorMode": "standard",
371
368
  "reduceOptions": {
372
- "calcs": [
373
- "lastNotNull"
374
- ],
369
+ "calcs": ["lastNotNull"],
375
370
  "fields": "",
376
371
  "values": false
377
372
  },
378
- "textMode": "auto"
373
+ "showPercentChange": false,
374
+ "textMode": "auto",
375
+ "wideLayout": true
379
376
  },
380
- "pluginVersion": "10.2.0",
377
+ "pluginVersion": "12.1.1",
381
378
  "targets": [
382
379
  {
383
- "datasource": "SQLite",
384
- "queryText": "SELECT (\n SUM(CASE WHEN gh.top_category = 'Revenue' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Cost of Revenue' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Expenses' THEN t.value_usd ELSE 0 END)\n + SUM(CASE WHEN gh.top_category = 'Other Income' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Other Expenses' THEN t.value_usd ELSE 0 END)\n) AS total_net\nFROM general_ledger t\nJOIN txgroup_hierarchy gh USING (txgroup_id)\nWHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
385
- "queryType": "table",
386
- "rawQueryText": "SELECT (\n SUM(CASE WHEN gh.top_category = 'Revenue' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Cost of Revenue' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Expenses' THEN t.value_usd ELSE 0 END)\n + SUM(CASE WHEN gh.top_category = 'Other Income' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Other Expenses' THEN t.value_usd ELSE 0 END)\n) AS total_net\nFROM general_ledger t\nJOIN txgroup_hierarchy gh USING (txgroup_id)\nWHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
380
+ "datasource": "PostgreSQL",
381
+ "format": "table",
382
+ "rawSql": "SELECT (\n SUM(CASE WHEN gh.top_category = 'Revenue' THEN p.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Cost of Revenue' THEN p.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Expenses' THEN p.value_usd ELSE 0 END)\n + SUM(CASE WHEN gh.top_category = 'Other Income' THEN p.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Other Expenses' THEN p.value_usd ELSE 0 END)\n) AS total_net\nFROM usdvalue_presum p\nJOIN txgroup_hierarchy gh USING (txgroup_id)\nWHERE p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000",
387
383
  "refId": "A",
388
- "timeColumns": [
389
- "time",
390
- "ts"
391
- ]
384
+ "timeColumns": ["time", "ts"]
392
385
  }
393
386
  ],
394
387
  "title": "Sorted Total",
395
388
  "type": "stat"
396
389
  },
397
390
  {
398
- "datasource": "SQLite",
399
- "description": "",
391
+ "datasource": "PostgreSQL",
392
+ "description": "Time series chart of all sorted cashflows, grouped by category, for the selected period. Shows Total Revenue, Total Expenses, and Net for each week, helping to analyze trends in the DAO's financial flows over time.",
400
393
  "fieldConfig": {
401
394
  "defaults": {
402
395
  "color": {
@@ -409,6 +402,7 @@
409
402
  "axisLabel": "",
410
403
  "axisPlacement": "auto",
411
404
  "barAlignment": 0,
405
+ "barWidthFactor": 0.6,
412
406
  "drawStyle": "bars",
413
407
  "fillOpacity": 70,
414
408
  "gradientMode": "none",
@@ -440,14 +434,15 @@
440
434
  "steps": [
441
435
  {
442
436
  "color": "green",
443
- "value": null
437
+ "value": 0
444
438
  },
445
439
  {
446
440
  "color": "red",
447
441
  "value": 80
448
442
  }
449
443
  ]
450
- }
444
+ },
445
+ "unit": "currencyUSD"
451
446
  },
452
447
  "overrides": [
453
448
  {
@@ -490,20 +485,19 @@
490
485
  "showLegend": true
491
486
  },
492
487
  "tooltip": {
488
+ "hideZeros": false,
493
489
  "mode": "single",
494
490
  "sort": "none"
495
491
  }
496
492
  },
493
+ "pluginVersion": "12.1.1",
497
494
  "targets": [
498
495
  {
499
- "datasource": "SQLite",
500
- "queryText": "SELECT t.timestamp, SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income') THEN t.value_usd ELSE 0 END) AS \"Total Revenue\", SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses') THEN t.value_usd ELSE 0 END) * -1 AS \"Total Expenses\", SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income') THEN t.value_usd ELSE 0 END) - SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses') THEN t.value_usd ELSE 0 END) AS \"Net\" FROM general_ledger AS t JOIN txgroup_hierarchy gh ON t.txgroup_id = gh.txgroup_id WHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 GROUP BY timestamp ORDER BY timestamp;",
501
- "queryType": "table",
502
- "rawQueryText": "SELECT t.timestamp, SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income') THEN t.value_usd ELSE 0 END) AS \"Total Revenue\", SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses') THEN t.value_usd ELSE 0 END) * -1 AS \"Total Expenses\", SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income') THEN t.value_usd ELSE 0 END) - SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses') THEN t.value_usd ELSE 0 END) AS \"Net\" FROM general_ledger AS t JOIN txgroup_hierarchy gh ON t.txgroup_id = gh.txgroup_id WHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 GROUP BY timestamp ORDER BY timestamp;",
496
+ "datasource": "PostgreSQL",
497
+ "format": "table",
498
+ "rawSql": "SELECT to_timestamp(p.timestamp) AS \"timestamp\", SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income') THEN p.value_usd ELSE 0 END) AS \"Total Revenue\", SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses') THEN p.value_usd ELSE 0 END) * -1 AS \"Total Expenses\", SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income') THEN p.value_usd ELSE 0 END) - SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses') THEN p.value_usd ELSE 0 END) AS \"Net\" FROM usdvalue_presum AS p JOIN txgroup_hierarchy gh ON p.txgroup_id = gh.txgroup_id WHERE p.timestamp >= $__from/1000 AND p.timestamp <= $__to/1000 GROUP BY timestamp ORDER BY timestamp;",
503
499
  "refId": "A",
504
- "timeColumns": [
505
- "timestamp"
506
- ]
500
+ "timeColumns": ["timestamp"]
507
501
  }
508
502
  ],
509
503
  "title": "Weekly Cashflow",
@@ -522,6 +516,7 @@
522
516
  "options": {
523
517
  "conversions": [
524
518
  {
519
+ "dateFormat": "YYYY-WW",
525
520
  "destinationType": "time",
526
521
  "targetField": "timestamp"
527
522
  }
@@ -534,39 +529,27 @@
534
529
  "options": {
535
530
  "fields": {
536
531
  "Cost of Revenue": {
537
- "aggregations": [
538
- "sum"
539
- ],
532
+ "aggregations": ["sum"],
540
533
  "operation": "aggregate"
541
534
  },
542
535
  "Expenses": {
543
- "aggregations": [
544
- "sum"
545
- ],
536
+ "aggregations": ["sum"],
546
537
  "operation": "aggregate"
547
538
  },
548
539
  "Net": {
549
- "aggregations": [
550
- "sum"
551
- ],
540
+ "aggregations": ["sum"],
552
541
  "operation": "aggregate"
553
542
  },
554
543
  "Other Expenses": {
555
- "aggregations": [
556
- "sum"
557
- ],
544
+ "aggregations": ["sum"],
558
545
  "operation": "aggregate"
559
546
  },
560
547
  "Other Income": {
561
- "aggregations": [
562
- "sum"
563
- ],
548
+ "aggregations": ["sum"],
564
549
  "operation": "aggregate"
565
550
  },
566
551
  "Revenue": {
567
- "aggregations": [
568
- "sum"
569
- ],
552
+ "aggregations": ["sum"],
570
553
  "operation": "aggregate"
571
554
  },
572
555
  "Timestamp": {
@@ -574,15 +557,11 @@
574
557
  "operation": "groupby"
575
558
  },
576
559
  "Total Expenses": {
577
- "aggregations": [
578
- "sum"
579
- ],
560
+ "aggregations": ["sum"],
580
561
  "operation": "aggregate"
581
562
  },
582
563
  "Total Revenue": {
583
- "aggregations": [
584
- "sum"
585
- ],
564
+ "aggregations": ["sum"],
586
565
  "operation": "aggregate"
587
566
  },
588
567
  "timestamp": {
@@ -596,9 +575,10 @@
596
575
  "type": "timeseries"
597
576
  }
598
577
  ],
578
+ "preload": false,
599
579
  "refresh": "",
600
- "schemaVersion": 38,
601
- "tags": [],
580
+ "schemaVersion": 41,
581
+ "tags": ["cashflow"],
602
582
  "templating": {
603
583
  "list": []
604
584
  },
@@ -609,7 +589,7 @@
609
589
  "timepicker": {},
610
590
  "timezone": "",
611
591
  "title": "Total Cashflow Summary",
592
+ "description": "Shows all sorted cashflows, including Revenue, Cost of Revenue, Expenses, Other Income, and Other Expense, but omits transactions pending categorization. Useful for analyzing the DAO's complete sorted financial flows.",
612
593
  "uid": "7e2b1c8a-4e2d-4b7a-9c1a-2f8e6b7d9c3f",
613
- "version": 1,
614
- "weekStart": ""
594
+ "version": 105
615
595
  }