Skip to content

Commit

Permalink
Merge branch 'master' into disable-items-category
Browse files Browse the repository at this point in the history
  • Loading branch information
Hrishabh17 committed Sep 23, 2024
2 parents 489fe70 + 00a2d4f commit f11f81a
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 7 deletions.
10 changes: 10 additions & 0 deletions .github/pr_checks_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pr_checks:
title:
- name: 'prefix_check'
regex: '^(?i)(fix|feat|test|chore|refactor|build):'
message_if_not_matching: 'PR title must start with "fix:", "feat:", "chore:", "refactor", or "test:" (case-insensitive)'

description:
- name: 'clickup_check'
regex: '(?i)app.clickup.com'
message_if_not_matching: 'PR description must contain a link to a ClickUp (case-insensitive)'
19 changes: 19 additions & 0 deletions .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Strong PR Checks

on:
pull_request:
types: [opened, synchronize, edited]

permissions:
pull-requests: write
contents: read

jobs:
pr_checks:
runs-on: ubuntu-latest
steps:
- name: Run strong checks
uses: fylein/fyle-pr-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
config-file: .github/pr_checks_config.yml
6 changes: 5 additions & 1 deletion apps/quickbooks_online/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,11 @@ def sync_accounts(self):
accounts_generator = self.connection.accounts.get_all_generator()
category_sync_version = 'v2'
general_settings = WorkspaceGeneralSettings.objects.filter(workspace_id=self.workspace_id).first()
is_category_import_to_fyle_enabled = False

if general_settings:
category_sync_version = general_settings.category_sync_version
is_category_import_to_fyle_enabled = general_settings.import_categories

for accounts in accounts_generator:
account_attributes = {'account': [], 'credit_card_account': [], 'bank_account': [], 'accounts_payable': []}
Expand Down Expand Up @@ -254,7 +257,8 @@ def sync_accounts(self):
self.workspace_id,
True,
attribute_type.title().replace('_', ' '),
attribute_disable_callback_path=ATTRIBUTE_CALLBACK_PATH.get(attribute_type.upper())
attribute_disable_callback_path=ATTRIBUTE_CALLBACK_PATH.get(attribute_type.upper()),
is_import_to_fyle_enabled=is_category_import_to_fyle_enabled
)

last_synced_time = get_last_synced_time(self.workspace_id, 'CATEGORY')
Expand Down
2 changes: 1 addition & 1 deletion fyle_integrations_imports
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ django-sendgrid-v5==1.2.0
enum34==1.1.10
future==0.18.2
fyle==0.37.0
fyle-accounting-mappings==1.34.2
fyle-integrations-platform-connector==1.38.4
fyle-accounting-mappings==1.34.4
fyle-integrations-platform-connector==1.39.1
fyle-rest-auth==1.7.2
flake8==4.0.1
gevent==23.9.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ def test_disable_categories(
mock_platform = mocker.patch('fyle_integrations_imports.modules.categories.PlatformConnector')
bulk_post_call = mocker.patch.object(mock_platform.return_value.categories, 'post_bulk')

disable_categories(workspace_id, categories_to_disable)
disable_categories(workspace_id, categories_to_disable, is_import_to_fyle_enabled=True)

assert bulk_post_call.call_count == 1

Expand All @@ -517,7 +517,7 @@ def test_disable_categories(
}
}

disable_categories(workspace_id, categories_to_disable)
disable_categories(workspace_id, categories_to_disable, is_import_to_fyle_enabled=True)
assert bulk_post_call.call_count == 1

# Test disable category with code in naming
Expand Down Expand Up @@ -550,7 +550,7 @@ def test_disable_categories(
'id': 'source_id_123'
}]

bulk_payload = disable_categories(workspace_id, categories_to_disable)
bulk_payload = disable_categories(workspace_id, categories_to_disable, is_import_to_fyle_enabled=True)
assert bulk_payload == payload


Expand Down

0 comments on commit f11f81a

Please sign in to comment.