Skip to content

Commit

Permalink
fix: fix posted_at_null migrations (#229)
Browse files Browse the repository at this point in the history
* fix: fix posted_at_null migrations

* fyle-integrations-platform-connector

* defaults

* 1.39.3

* update fixtures
  • Loading branch information
anishfyle authored Nov 26, 2024
1 parent b7efd2a commit 2e6fde4
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
18 changes: 18 additions & 0 deletions apps/fyle/migrations/0005_expense_is_posted_at_null.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.1.2 on 2024-11-26 06:36

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('fyle', '0004_remove_expense_settlement_id'),
]

operations = [
migrations.AddField(
model_name='expense',
name='is_posted_at_null',
field=models.BooleanField(default=False, help_text='Flag check if posted at is null or not'),
),
]
1 change: 1 addition & 0 deletions apps/fyle/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def create_expense_objects(expenses: List[Dict], workspace_id: int, skip_update:
'report_id': expense['report_id'],
'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
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fyle==0.37.0
# Reusable Fyle Packages
fyle-rest-auth==1.7.2
fyle-accounting-mappings==1.34.8
fyle-integrations-platform-connector==1.39.1
fyle-integrations-platform-connector==1.39.3


# Postgres Dependincies
Expand Down
7 changes: 7 additions & 0 deletions tests/test_fyle/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@
'spent_at': '2024-05-10 17:00:00',
'approved_at': '2024-05-10 07:53:25',
'posted_at': None,
'is_posted_at_null': True,
'is_skipped': False,
'expense_created_at': '2024-05-10 07:52:10',
'expense_updated_at': '2024-05-13 05:53:25',
Expand Down Expand Up @@ -700,6 +701,7 @@
'spent_at': '2021-12-22T07:30:26.289842+00:00',
'approved_at': '2021-12-22T07:30:26.289842+00:00',
'posted_at': '2021-12-22T07:30:26.289842+00:00',
'is_posted_at_null': False,
'expense_created_at': '2021-12-23T07:14:13.990650+00:00',
'expense_updated_at': '2021-12-27T05:26:43.954470+00:00',
'source_account_type': 'PERSONAL_CASH_ACCOUNT',
Expand Down Expand Up @@ -745,6 +747,7 @@
'spent_at': '2020-12-22T07:30:26.289842+00:00',
'approved_at': '2020-12-22T07:30:26.289842+00:00',
'posted_at': '2021-12-22T07:30:26.289842+00:00',
'is_posted_at_null': False,
'expense_created_at': '2020-12-23T07:14:13.990650+00:00',
'expense_updated_at': '2020-12-27T05:26:43.954470+00:00',
'source_account_type': 'PERSONAL_CASH_ACCOUNT',
Expand Down Expand Up @@ -788,6 +791,7 @@
'spent_at': '2021-12-22T07:30:26.289842+00:00',
'approved_at': '2021-12-22T07:30:26.289842+00:00',
'posted_at': '2021-12-22T07:30:26.289842+00:00',
'is_posted_at_null': False,
'expense_created_at': '2021-12-23T07:14:13.990650+00:00',
'expense_updated_at': '2021-12-27T05:26:43.954470+00:00',
'source_account_type': 'PERSONAL_CASH_ACCOUNT',
Expand Down Expand Up @@ -829,6 +833,7 @@
'spent_at': '2021-12-22T07:30:26.289842+00:00',
'approved_at': '2021-12-22T07:30:26.289842+00:00',
'posted_at': '2021-12-22T07:30:26.289842+00:00',
'is_posted_at_null': False,
'expense_created_at': '2021-12-23T07:14:13.990650+00:00',
'expense_updated_at': '2021-12-27T05:26:43.954470+00:00',
'source_account_type': 'PERSONAL_CASH_ACCOUNT',
Expand Down Expand Up @@ -872,6 +877,7 @@
'spent_at': '2021-12-22T07:30:26.289842+00:00',
'approved_at': '2021-12-22T07:30:26.289842+00:00',
'posted_at': '2021-12-22T07:30:26.289842+00:00',
'is_posted_at_null': False,
'expense_created_at': '2021-12-23T07:14:13.990650+00:00',
'expense_updated_at': '2021-12-27T05:26:43.954470+00:00',
'source_account_type': 'PERSONAL_CASH_ACCOUNT',
Expand Down Expand Up @@ -913,6 +919,7 @@
'spent_at': '2021-12-2T07:30:26.289842+00:00',
'approved_at': '2021-12-22T07:30:26.289842+00:00',
'posted_at': '2021-12-22T07:30:26.289842+00:00',
'is_posted_at_null': False,
'expense_created_at': '2021-12-23T07:14:13.990650+00:00',
'expense_updated_at': '2021-12-27T05:26:43.954470+00:00',
'source_account_type': 'PERSONAL_CASH_ACCOUNT',
Expand Down

0 comments on commit 2e6fde4

Please sign in to comment.