Skip to content

Commit

Permalink
fix: fix posted at null (#412)
Browse files Browse the repository at this point in the history
* fix: fix posted at null

* fixtures

* fixtures
  • Loading branch information
anishfyle authored Nov 20, 2024
1 parent 86effd4 commit 04d6d88
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions apps/fyle/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ def create_expense_objects(expenses: List[Dict], workspace_id: int, skip_update:
"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"]
],
Expand Down
4 changes: 2 additions & 2 deletions tests/sql_fixtures/reset_db_fixtures/reset_db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
-- PostgreSQL database dump
--

-- Dumped from database version 15.7 (Debian 15.7-1.pgdg120+1)
-- Dumped by pg_dump version 15.9 (Debian 15.9-1.pgdg120+1)
-- Dumped from database version 15.9 (Debian 15.9-1.pgdg120+1)
-- Dumped by pg_dump version 15.8 (Debian 15.8-1.pgdg120+1)

SET statement_timeout = 0;
SET lock_timeout = 0;
Expand Down
16 changes: 12 additions & 4 deletions tests/test_fyle/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@
"Fyle Categories": "",
},
"bank_transaction_id": None,
"is_posted_at_null": False
},
],

Expand Down Expand Up @@ -326,7 +327,8 @@
"previous_export_state": None,
"workspace_id": 399,
"source_account_type": "PERSONAL_CORPORATE_CREDIT_CARD_ACCOUNT",
"bank_transaction_id": "btxnQe02cfpD9n"
"bank_transaction_id": "btxnQe02cfpD9n",
"is_posted_at_null": False
},
{
"id": 15134,
Expand Down Expand Up @@ -370,7 +372,8 @@
"previous_export_state": None,
"workspace_id": 399,
"source_account_type": "PERSONAL_CORPORATE_CREDIT_CARD_ACCOUNT",
"bank_transaction_id": "btxnQe02cfpD9n"
"bank_transaction_id": "btxnQe02cfpD9n",
"is_posted_at_null": False
},
{
"id": 15135,
Expand Down Expand Up @@ -414,7 +417,8 @@
"previous_export_state": None,
"workspace_id": 399,
"source_account_type": "PERSONAL_CORPORATE_CREDIT_CARD_ACCOUNT",
"bank_transaction_id": "btxnQe02cfpD9n"
"bank_transaction_id": "btxnQe02cfpD9n",
"is_posted_at_null": False
},
{
"id": 15136,
Expand Down Expand Up @@ -458,7 +462,8 @@
"previous_export_state": None,
"workspace_id": 399,
"source_account_type": "PERSONAL_CORPORATE_CREDIT_CARD_ACCOUNT",
"bank_transaction_id": "btxnQe02cfpD9n"
"bank_transaction_id": "btxnQe02cfpD9n",
"is_posted_at_null": False
},
],

Expand Down Expand Up @@ -503,6 +508,7 @@
"Fyle Categories": "",
},
"bank_transaction_id": None,
"is_posted_at_null": False
}
],
"expense_group_id": {
Expand Down Expand Up @@ -711,6 +717,7 @@
"paid_on_xero": False,
"tax_amount": "None",
"tax_group_id": "None",
"is_posted_at_null": False
}
],
"fund_source": "PERSONAL",
Expand Down Expand Up @@ -780,6 +787,7 @@
"tax_amount": "None",
"tax_group_id": "None",
"bank_transaction_id": None,
"is_posted_at_null": False
}
],
"fund_source": "PERSONAL",
Expand Down
1 change: 1 addition & 0 deletions tests/test_workspaces/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
"paid_on_qbo": False,
"payment_number": "P/2022/05/R/7",
"bank_transaction_id": None,
"is_posted_at_null": False
}
],
"workspace_schedule": {
Expand Down

0 comments on commit 04d6d88

Please sign in to comment.