Skip to content

Commit 35dbb20

Browse files
authored
Add scheduled_flat_transactions.frequency (#115)
1 parent c4a4505 commit 35dbb20

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

sqlite_export_for_ynab/ddl/create-relations.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ SELECT
248248
, t.date_next
249249
, t.flag_color
250250
, t.flag_name
251+
, t.frequency
251252
, COALESCE(st.payee_name, t.payee_name) AS payee_name
252253
, COALESCE(st.id, t.id) AS id
253254
, COALESCE(st.amount, t.amount) AS amount

testing/fixtures.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@
196196
{
197197
"id": SCHEDULED_TRANSACTION_ID_1,
198198
"amount": -12000,
199+
"frequency": "monthly",
199200
"deleted": False,
200201
"subtransactions": [
201202
{
@@ -215,12 +216,14 @@
215216
{
216217
"id": SCHEDULED_TRANSACTION_ID_2,
217218
"amount": -11000,
219+
"frequency": "yearly",
218220
"deleted": True,
219221
"subtransactions": [],
220222
},
221223
{
222224
"id": SCHEDULED_TRANSACTION_ID_3,
223225
"amount": -9000,
226+
"frequency": "everyOtherMonth",
224227
"deleted": False,
225228
"subtransactions": [],
226229
},

tests/_main_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,18 +337,21 @@ def test_insert_scheduled_transactions(cur):
337337
{
338338
"id": SCHEDULED_TRANSACTION_ID_1,
339339
"budget_id": BUDGET_ID_1,
340+
"frequency": "monthly",
340341
"amount": -12000,
341342
"deleted": False,
342343
},
343344
{
344345
"id": SCHEDULED_TRANSACTION_ID_2,
345346
"budget_id": BUDGET_ID_1,
347+
"frequency": "yearly",
346348
"amount": -11000,
347349
"deleted": True,
348350
},
349351
{
350352
"id": SCHEDULED_TRANSACTION_ID_3,
351353
"budget_id": BUDGET_ID_1,
354+
"frequency": "everyOtherMonth",
352355
"amount": -9000,
353356
"deleted": False,
354357
},
@@ -378,6 +381,7 @@ def test_insert_scheduled_transactions(cur):
378381
"transaction_id": SCHEDULED_TRANSACTION_ID_3,
379382
"budget_id": BUDGET_ID_1,
380383
"id": SCHEDULED_TRANSACTION_ID_3,
384+
"frequency": "everyOtherMonth",
381385
"amount": -9000,
382386
"amount_major": pytest.approx(9),
383387
},
@@ -386,6 +390,7 @@ def test_insert_scheduled_transactions(cur):
386390
"subtransaction_id": SCHEDULED_SUBTRANSACTION_ID_1,
387391
"budget_id": BUDGET_ID_1,
388392
"id": SCHEDULED_SUBTRANSACTION_ID_1,
393+
"frequency": "monthly",
389394
"amount": -8040,
390395
"amount_major": pytest.approx(8.04),
391396
},
@@ -394,6 +399,7 @@ def test_insert_scheduled_transactions(cur):
394399
"subtransaction_id": SCHEDULED_SUBTRANSACTION_ID_2,
395400
"budget_id": BUDGET_ID_1,
396401
"id": SCHEDULED_SUBTRANSACTION_ID_2,
402+
"frequency": "monthly",
397403
"amount": -2960,
398404
"amount_major": pytest.approx(2.96),
399405
},

0 commit comments

Comments
 (0)