Skip to content

Commit

Permalink
feat: qbd direct tracking for export and sync on click (#1134)
Browse files Browse the repository at this point in the history
* feat: qbd direct tracking for export and sync on click

* wording change for connector page
  • Loading branch information
DhaaraniCIT committed Dec 20, 2024
1 parent 08307b3 commit 75a4527
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
14 changes: 13 additions & 1 deletion src/app/core/models/enum/enum.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ export enum TravelperkUpdateEvent {
ADVANCED_SETTINGS_TRAVELPERK = 'Advanced Settings TravelPerk',
}

export enum QbdDirectUpdateEvent {
CONFIRM_PRE_REQUISITES_QBD_DIRECT = 'Confirm Pre Requisites QuickBooks Desktop Connector',
CONNECT_QBD_DIRECT = 'Step 2.1 - Connect QuickBooks Desktop Connector',
PENDING_QWC_UPLOAD_QBD_DIRECT = 'Step 2.2 - Upload QWC downloaded file to QuickBooks Desktop Connector',
DESTINATION_SYNC_COMPLETE_QBD_DIRECT = 'Step 2.3 - Sync destination entities with QuickBooks Desktop Connector',
EXPORT_SETTING_QBD_DIRECT = 'Export Settings QuickBooks Desktop Connector',
IMPORT_SETTINGS_QBD_DIRECT = 'Import Settings QuickBooks Desktop Connector',
ADVANCED_SETTINGS_QBD_DIRECT = 'Advanced Settings QuickBooks Desktop Connector',
}

export enum AppName {
BAMBOO_HR = 'BambooHR',
QBD = 'QuickBooks Desktop',
Expand Down Expand Up @@ -150,7 +160,9 @@ export enum ClickEvent {
PREVIEW_INTACCT_EXPORT = 'Preview Sage Intacct Export',
INTACCT_EXPORT = 'Export Sage Intacct',
CONNECT_SAGE300 = 'Connect Sage 300 CRE',
CONNECT_BUSINESS_CENTRAL = 'Connect Dynamic 365 Business Central'
CONNECT_BUSINESS_CENTRAL = 'Connect Dynamic 365 Business Central',
QBD_DIRECT_EXPORT = 'Direct Export Quickbooks Desktop',
QBD_DIRECT_SYNC = 'Sync Quickbooks Desktop Direct'
}

export enum ProgressPhase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { ApiService } from '../../common/api.service';
import { WorkspaceService } from '../../common/workspace.service';
import { Observable } from 'rxjs';
import { IntegrationsToastService } from '../../common/integrations-toast.service';
import { ToastSeverity } from 'src/app/core/models/enum/enum.model';
import { ClickEvent, ToastSeverity, TrackingApp } from 'src/app/core/models/enum/enum.model';
import { TrackingService } from '../../integration/tracking.service';

@Injectable({
providedIn: 'root'
Expand All @@ -13,14 +14,16 @@ export class QbdDirectHelperService {
constructor(
private apiService: ApiService,
private workspaceService: WorkspaceService,
private toastService: IntegrationsToastService
private toastService: IntegrationsToastService,
private trackingService: TrackingService
) { }

importQBDAttributes(refresh: boolean): Observable<{}> {
return this.apiService.post(`/workspaces/${this.workspaceService.getWorkspaceId()}/qbd/import_attributes/`, {refresh});
}

importAttributes(refresh: boolean): void {
this.trackingService.onClickEvent(TrackingApp.QBD_DIRECT, ClickEvent.QBD_DIRECT_SYNC);
this.workspaceService.importFyleAttributes(refresh).subscribe();
this.importQBDAttributes(refresh).subscribe();
this.toastService.displayToastMessage(ToastSeverity.SUCCESS, 'Syncing data dimensions from Quickbooks Desktop');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import { brandingFeatureConfig } from 'src/app/branding/branding-config';
import { brandingConfig } from 'src/app/branding/c1-contents-config';
import { AccountingExportSummary, AccountingExportSummaryModel } from 'src/app/core/models/db/accounting-export-summary.model';
import { DestinationFieldMap, DashboardModel } from 'src/app/core/models/db/dashboard.model';
import { AccountingGroupedErrors, AccountingGroupedErrorStat, Error, ErrorResponse } from 'src/app/core/models/db/error.model';
import { AppName, AccountingErrorType, QbdDirectTaskLogType, ReimbursableImportState, CCCImportState, AppUrl, TaskLogState } from 'src/app/core/models/enum/enum.model';
import { AccountingGroupedErrors, AccountingGroupedErrorStat, ErrorResponse } from 'src/app/core/models/db/error.model';
import { AppName, AccountingErrorType, ReimbursableImportState, CCCImportState, AppUrl, TaskLogState, ClickEvent, TrackingApp } from 'src/app/core/models/enum/enum.model';
import { QbdDirectTaskResponse, QbdDirectTaskLog } from 'src/app/core/models/qbd-direct/db/qbd-direct-task-log.model';
import { QbdDirectImportSettingModel } from 'src/app/core/models/qbd-direct/qbd-direct-configuration/qbd-direct-import-settings.model';
import { AccountingExportService } from 'src/app/core/services/common/accounting-export.service';
import { DashboardService } from 'src/app/core/services/common/dashboard.service';
import { WorkspaceService } from 'src/app/core/services/common/workspace.service';
import { TrackingService } from 'src/app/core/services/integration/tracking.service';
import { QbdDirectExportSettingsService } from 'src/app/core/services/qbd-direct/qbd-direct-configuration/qbd-direct-export-settings.service';
import { QbdDirectImportSettingsService } from 'src/app/core/services/qbd-direct/qbd-direct-configuration/qbd-direct-import-settings.service';
import { SharedModule } from 'src/app/shared/shared.module';
Expand Down Expand Up @@ -83,12 +83,13 @@ export class QbdDirectDashboardComponent implements OnInit {
private accountingExportService: AccountingExportService,
private dashboardService: DashboardService,
private QbdDirectExportSettingsService: QbdDirectExportSettingsService,
private workspaceService: WorkspaceService,
private trackingService: TrackingService,
private importSettingService: QbdDirectImportSettingsService
) { }

export() {
this.isExportInProgress = true;
this.trackingService.onClickEvent(TrackingApp.QBD_DIRECT, ClickEvent.QBD_DIRECT_EXPORT);
this.dashboardService.triggerAccountingExport('v1').subscribe(() => {
this.pollExportStatus(this.exportableAccountingExportIds);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import { Component, OnInit } from '@angular/core';
import { Router, RouterModule } from '@angular/router';
import { MenuItem } from 'primeng/api';
import { brandingContent, brandingFeatureConfig } from 'src/app/branding/branding-config';
import { AppName, ToastSeverity } from 'src/app/core/models/enum/enum.model';
import { IntegrationsToastService } from 'src/app/core/services/common/integrations-toast.service';
import { WorkspaceService } from 'src/app/core/services/common/workspace.service';
import { AppName } from 'src/app/core/models/enum/enum.model';
import { QbdDirectHelperService } from 'src/app/core/services/qbd-direct/qbd-direct-core/qbd-direct-helper.service';
import { SharedModule } from 'src/app/shared/shared.module';

Expand Down Expand Up @@ -35,9 +33,7 @@ export class QbdDirectMainComponent implements OnInit {

constructor(
private qbdDirectHelperService: QbdDirectHelperService,
private router: Router,
private toastService: IntegrationsToastService,
private workspaceService: WorkspaceService
private router: Router
) { }


Expand Down

0 comments on commit 75a4527

Please sign in to comment.