Skip to content

Commit

Permalink
fix: add default value for is_posted_at_null (#674)
Browse files Browse the repository at this point in the history
* fix: add default value for is_posted_at_null

* fixtures
  • Loading branch information
anishfyle authored Nov 20, 2024
1 parent 3e83358 commit a2bb92a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions apps/fyle/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ def create_expense_objects(expenses: List[Dict], workspace_id, skip_update: bool
'file_ids': expense['file_ids'],
'spent_at': expense['spent_at'],
'posted_at': expense['posted_at'],
'is_posted_at_null': expense['is_posted_at_null'],
'fund_source': SOURCE_ACCOUNT_MAP[expense['source_account_type']],
'verified_at': expense['verified_at'],
'custom_properties': expense['custom_properties'],
Expand Down
1 change: 0 additions & 1 deletion tests/sql_fixtures/reset_db_fixtures/reset_db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11903,7 +11903,6 @@ SELECT pg_catalog.setval('public.django_content_type_id_seq', 47, true);
-- Name: django_migrations_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('public.django_migrations_id_seq', 201, true);
SELECT pg_catalog.setval('public.django_migrations_id_seq', 203, true);


Expand Down
16 changes: 13 additions & 3 deletions tests/test_fyle/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@
'Vehicle Type': '',
'Fyle Categories': '',
},
"is_posted_at_null": True
},
{
'id': '1235',
Expand Down Expand Up @@ -320,6 +321,7 @@
'Vehicle Type': '',
'Fyle Categories': '',
},
"is_posted_at_null": True
},
{
'id': '1236',
Expand Down Expand Up @@ -360,6 +362,7 @@
'Vehicle Type': '',
'Fyle Categories': '',
},
"is_posted_at_null": True
},
],
"skipped_expenses":{
Expand All @@ -379,14 +382,16 @@
'amount': 101.0,
'report_id': 'dummy_report_id',
'settlement_id': 'dummy_settlement_id',
'expense_id': 'dummy_expense_id'
'expense_id': 'dummy_expense_id',
"is_posted_at_null": True
},
{
'updated_at': '2021-12-03T11:26:58.702209Z',
'claim_number': ' C/2021/12/R/199',
'employee_email': '[email protected]',
'employee_name': None,
'fund_source': 'CCC'
'fund_source': 'CCC',
"is_posted_at_null": True
}
]
},
Expand Down Expand Up @@ -608,6 +613,7 @@
'Vehicle Type': '',
'Fyle Categories': '',
},
'is_posted_at_null': True
},
{
'id': 'tx6wOnBVaumklol',
Expand Down Expand Up @@ -649,6 +655,7 @@
'Vehicle Type': '',
'Fyle Categories': '',
},
'is_posted_at_null': True
},
],
"expenses": [
Expand Down Expand Up @@ -692,6 +699,7 @@
'Vehicle Type': '',
'Fyle Categories': '',
},
"is_posted_at_null": True
},
{
'id': 'tx6wOnBVaumk',
Expand Down Expand Up @@ -733,6 +741,7 @@
'Vehicle Type': '',
'Fyle Categories': '',
},
"is_posted_at_null": False
},
],
"expense_group_expenses": [
Expand Down Expand Up @@ -807,7 +816,8 @@
"amount": 6377.0,
"report_id": "rp0kaXoqkJle",
"settlement_id": "setPzkM7eyQFd",
"expense_id": "txyZ1zJDQfiK"
"expense_id": "txyZ1zJDQfiK",
"is_posted_at_null": True
}],
},
"expense_group_setting_response": {
Expand Down

0 comments on commit a2bb92a

Please sign in to comment.