Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix posted_at_null migrations #229

Merged
merged 5 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'),
),
]
anishfyle marked this conversation as resolved.
Show resolved Hide resolved
anishfyle marked this conversation as resolved.
Show resolved Hide resolved
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'],
anishfyle marked this conversation as resolved.
Show resolved Hide resolved
'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
Loading