-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding projects test * adding new test * addin exceptions test * lint fix for test
- Loading branch information
Showing
10 changed files
with
6,971 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from fyle_integrations_imports.modules.base import Base | ||
from fyle_integrations_platform_connector import PlatformConnector | ||
from apps.workspaces.models import FyleCredential, QBOCredential | ||
from apps.quickbooks_online.utils import QBOConnector | ||
|
||
|
||
def get_base_class_instance( | ||
workspace_id: int = 1, | ||
source_field: str = 'PROJECT', | ||
destination_field: str = 'PROJECT', | ||
platform_class_name: str = 'projects', | ||
sync_after: str = None, | ||
destination_sync_method: str = 'customers' | ||
): | ||
|
||
qbo_credentials = QBOCredential.get_active_qbo_credentials(workspace_id) | ||
qbo_connection = QBOConnector(credentials_object=qbo_credentials, workspace_id=workspace_id) | ||
|
||
base = Base( | ||
workspace_id = workspace_id, | ||
source_field = source_field, | ||
destination_field = destination_field, | ||
platform_class_name = platform_class_name, | ||
sync_after = sync_after, | ||
sdk_connection = qbo_connection, | ||
destination_sync_method = destination_sync_method | ||
) | ||
|
||
return base | ||
|
||
|
||
def get_platform_connection(workspace_id): | ||
fyle_credentials = FyleCredential.objects.get(workspace_id=workspace_id) | ||
platform = PlatformConnector(fyle_credentials=fyle_credentials) | ||
|
||
return platform |
Oops, something went wrong.