@zeniai/client-epic-state 5.1.61-betaDI0 → 5.1.62-betaRD1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +2 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +2 -0
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +4 -0
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +11 -1
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +2 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +3 -0
- package/lib/entity/tenant/tenantReducer.d.ts +4 -1
- package/lib/entity/tenant/tenantReducer.js +8 -2
- package/lib/entity/tenant/tenantSelector.d.ts +1 -0
- package/lib/entity/tenant/tenantSelector.js +4 -0
- package/lib/entity/transaction/scheduleTransactionHelper.d.ts +15 -0
- package/lib/entity/transaction/scheduleTransactionHelper.js +43 -0
- package/lib/epic.d.ts +8 -1
- package/lib/epic.js +8 -1
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +2 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +11 -1
- package/lib/esm/entity/snackbar/snackbarTypes.js +3 -0
- package/lib/esm/entity/tenant/tenantReducer.js +7 -1
- package/lib/esm/entity/tenant/tenantSelector.js +3 -0
- package/lib/esm/entity/transaction/scheduleTransactionHelper.js +39 -0
- package/lib/esm/epic.js +8 -1
- package/lib/esm/index.js +9 -6
- package/lib/esm/view/companyView/companyViewReducer.js +68 -1
- package/lib/esm/view/companyView/epic/companyPassport/dismissCapitalizationOnboardingEpic.js +2 -1
- package/lib/esm/view/companyView/epic/companyPassport/projects/disableAccountingProjectsEpic.js +56 -0
- package/lib/esm/view/companyView/epic/companyPassport/projects/enableAccountingProjectsEpic.js +37 -0
- package/lib/esm/view/companyView/epic/companyPassport/projects/resumeEnableAccountingProjectsEpic.js +73 -0
- package/lib/esm/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.js +2 -1
- package/lib/esm/view/companyView/epic/companyPassport/updateCapitalizationAccountThresholdEpic.js +2 -1
- package/lib/esm/view/companyView/types/companyPassport/companyPassportViewState.js +5 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +15 -2
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +21 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +110 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +44 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +22 -0
- package/lib/esm/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +152 -0
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +126 -6
- package/lib/esm/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +1 -0
- package/lib/esm/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +71 -0
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +65 -11
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +3 -6
- package/lib/index.d.ts +11 -8
- package/lib/index.js +70 -48
- package/lib/view/companyView/companyViewReducer.d.ts +9 -1
- package/lib/view/companyView/companyViewReducer.js +70 -3
- package/lib/view/companyView/epic/companyPassport/dismissCapitalizationOnboardingEpic.js +2 -1
- package/lib/view/companyView/epic/companyPassport/projects/disableAccountingProjectsEpic.d.ts +10 -0
- package/lib/view/companyView/epic/companyPassport/projects/disableAccountingProjectsEpic.js +60 -0
- package/lib/view/companyView/epic/companyPassport/projects/enableAccountingProjectsEpic.d.ts +11 -0
- package/lib/view/companyView/epic/companyPassport/projects/enableAccountingProjectsEpic.js +41 -0
- package/lib/view/companyView/epic/companyPassport/projects/resumeEnableAccountingProjectsEpic.d.ts +13 -0
- package/lib/view/companyView/epic/companyPassport/projects/resumeEnableAccountingProjectsEpic.js +77 -0
- package/lib/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.js +2 -1
- package/lib/view/companyView/epic/companyPassport/updateCapitalizationAccountThresholdEpic.js +2 -1
- package/lib/view/companyView/types/companyPassport/companyPassportViewState.d.ts +2 -0
- package/lib/view/companyView/types/companyPassport/companyPassportViewState.js +5 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +14 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +25 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.d.ts +45 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +114 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +48 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +6 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +26 -0
- package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.d.ts +43 -0
- package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +158 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +1 -0
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +36 -8
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +128 -7
- package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.d.ts +25 -0
- package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +2 -0
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +29 -4
- package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.d.ts +10 -0
- package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +76 -0
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +65 -11
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +53 -6
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +5 -8
- package/package.json +1 -1
|
@@ -68,7 +68,15 @@ export declare const fetchCompanyPassportView: import("@reduxjs/toolkit").Action
|
|
|
68
68
|
enabled: boolean;
|
|
69
69
|
}, "companyView/updateAccountingClassesEnabled", never, never>, updateAccountingClassesEnabledSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"companyView/updateAccountingClassesEnabledSuccess">, updateAccountingClassesEnabledFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
70
70
|
status: ZeniAPIStatus;
|
|
71
|
-
}, "companyView/updateAccountingClassesEnabledFailure">,
|
|
71
|
+
}, "companyView/updateAccountingClassesEnabledFailure">, enableAccountingProjects: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string], {
|
|
72
|
+
companyId: string;
|
|
73
|
+
}, "companyView/enableAccountingProjects", never, never>, resumeEnableAccountingProjects: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string], {
|
|
74
|
+
companyId: string;
|
|
75
|
+
}, "companyView/resumeEnableAccountingProjects", never, never>, disableAccountingProjects: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string], {
|
|
76
|
+
companyId: string;
|
|
77
|
+
}, "companyView/disableAccountingProjects", never, never>, updateAccountingProjectsEnabledSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"companyView/updateAccountingProjectsEnabledSuccess">, updateAccountingProjectsEnabledFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
78
|
+
status: ZeniAPIStatus;
|
|
79
|
+
}, "companyView/updateAccountingProjectsEnabledFailure">, requestQboProjectsReconnect: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"companyView/requestQboProjectsReconnect">, clearQboProjectsReconnectRequest: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"companyView/clearQboProjectsReconnectRequest">, updateCapitalizationAccountThreshold: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, accountId: string, threshold: number | null, dismissOnboardingForAccount?: boolean | undefined, allOverrides?: Record<string, number> | null | undefined], {
|
|
72
80
|
companyId: string;
|
|
73
81
|
accountId: string;
|
|
74
82
|
threshold: number | null;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
5
|
-
exports.updateMetaDataOnSendMonthEndReport = exports.updateCompanyMetaDataOnFailure = exports.updateCompanyMetaDataOnSuccess = exports.fetchCompanyMetaData = exports.updateCompanyDownloadState = void 0;
|
|
4
|
+
exports.companyPassportCreateCompanyOfficersSuccess = exports.companyPassportCreateCompanyOfficers = exports.companyPassportUpdateCompanyOfficerFailure = exports.companyPassportUpdateCompanyOfficerSuccess = exports.companyPassportUpdateCompanyOfficer = exports.companyPassportUpdatePrimaryContactFailure = exports.companyPassportUpdatePrimaryContactSuccess = exports.companyPassportUpdatePrimaryContact = exports.dismissCapitalizationOnboarding = exports.updateCapitalizationAccountThresholdFailure = exports.updateCapitalizationAccountThresholdSuccess = exports.updateCapitalizationAccountThreshold = exports.clearQboProjectsReconnectRequest = exports.requestQboProjectsReconnect = exports.updateAccountingProjectsEnabledFailure = exports.updateAccountingProjectsEnabledSuccess = exports.disableAccountingProjects = exports.resumeEnableAccountingProjects = exports.enableAccountingProjects = exports.updateAccountingClassesEnabledFailure = exports.updateAccountingClassesEnabledSuccess = exports.updateAccountingClassesEnabled = exports.companyPassportUpdateCompanyDetailsFailure = exports.companyPassportUpdateCompanyDetailsSuccess = exports.companyPassportUpdateCompanyDetails = exports.companyPassportClearDataInLocalStore = exports.deleteCompanyOfficerInLocalStore = exports.companyPassportSaveDataInLocalStore = exports.updateCompanyManagementUIState = exports.updateCompanyPortfolioUIState = exports.clearCompanyView = exports.updateZeniUsersOnFailure = exports.updateZeniUsersOnSuccess = exports.fetchZeniUsers = exports.fetchCompanyPortfolioView = exports.updateCompanyViewOnFailure = exports.updateCompanyViewOnSuccess = exports.companyManagementSaveUpdatesFailure = exports.companyManagementSaveUpdatesSuccess = exports.companyManagementDiscardUpdates = exports.companyManagementSavePendingUpdates = exports.companyManagementSaveUpdates = exports.fetchCompanyManagementView = exports.fetchPortfolioView = exports.fetchSubscriptionView = exports.fetchManagementView = exports.fetchOnboardingView = exports.fetchAllCockpitViews = exports.fetchCompanyPassportView = exports.initialState = void 0;
|
|
5
|
+
exports.updateMetaDataOnSendMonthEndReport = exports.updateCompanyMetaDataOnFailure = exports.updateCompanyMetaDataOnSuccess = exports.fetchCompanyMetaData = exports.updateCompanyDownloadState = exports.updateParentSubsidiaryViewOnFailure = exports.updateParentSubsidiaryView = exports.fetchParentSubsidiaryManagementView = exports.saveCompanyPassportDetails = exports.saveIndustryAndIncDateInCompanyPassportLocalStore = exports.updateCompanyPassportLocalStoreData = exports.companyPassportCreateCompanyOfficersFailure = void 0;
|
|
6
6
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
7
7
|
const parentSubsidiaryViewState_1 = require("./parentSubsidiaryView/parentSubsidiaryViewState");
|
|
8
8
|
const companyManagementViewState_1 = require("./types/companyManagementViewState");
|
|
@@ -314,6 +314,73 @@ const companyView = (0, toolkit_1.createSlice)({
|
|
|
314
314
|
error: action.payload.status,
|
|
315
315
|
};
|
|
316
316
|
},
|
|
317
|
+
enableAccountingProjects: {
|
|
318
|
+
reducer(draft,
|
|
319
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
320
|
+
_action) {
|
|
321
|
+
draft.passportView.accountingProjectsUpdateStatus = {
|
|
322
|
+
fetchState: 'In-Progress',
|
|
323
|
+
error: undefined,
|
|
324
|
+
};
|
|
325
|
+
draft.passportView.needsQboProjectsReconnect = false;
|
|
326
|
+
},
|
|
327
|
+
prepare(companyId) {
|
|
328
|
+
return { payload: { companyId } };
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
resumeEnableAccountingProjects: {
|
|
332
|
+
reducer(draft,
|
|
333
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
334
|
+
_action) {
|
|
335
|
+
draft.passportView.accountingProjectsUpdateStatus = {
|
|
336
|
+
fetchState: 'In-Progress',
|
|
337
|
+
error: undefined,
|
|
338
|
+
};
|
|
339
|
+
draft.passportView.needsQboProjectsReconnect = false;
|
|
340
|
+
},
|
|
341
|
+
prepare(companyId) {
|
|
342
|
+
return { payload: { companyId } };
|
|
343
|
+
},
|
|
344
|
+
},
|
|
345
|
+
disableAccountingProjects: {
|
|
346
|
+
reducer(draft,
|
|
347
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
348
|
+
_action) {
|
|
349
|
+
draft.passportView.accountingProjectsUpdateStatus = {
|
|
350
|
+
fetchState: 'In-Progress',
|
|
351
|
+
error: undefined,
|
|
352
|
+
};
|
|
353
|
+
draft.passportView.needsQboProjectsReconnect = false;
|
|
354
|
+
},
|
|
355
|
+
prepare(companyId) {
|
|
356
|
+
return { payload: { companyId } };
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
updateAccountingProjectsEnabledSuccess(draft) {
|
|
360
|
+
draft.passportView.accountingProjectsUpdateStatus = {
|
|
361
|
+
fetchState: 'Completed',
|
|
362
|
+
error: undefined,
|
|
363
|
+
};
|
|
364
|
+
draft.passportView.needsQboProjectsReconnect = false;
|
|
365
|
+
},
|
|
366
|
+
updateAccountingProjectsEnabledFailure(draft, action) {
|
|
367
|
+
draft.passportView.accountingProjectsUpdateStatus = {
|
|
368
|
+
fetchState: 'Error',
|
|
369
|
+
error: action.payload.status,
|
|
370
|
+
};
|
|
371
|
+
draft.passportView.needsQboProjectsReconnect = false;
|
|
372
|
+
},
|
|
373
|
+
requestQboProjectsReconnect(draft) {
|
|
374
|
+
draft.passportView.needsQboProjectsReconnect = true;
|
|
375
|
+
// Keep In-Progress so the Projects toggle stays locked through OAuth.
|
|
376
|
+
draft.passportView.accountingProjectsUpdateStatus = {
|
|
377
|
+
fetchState: 'In-Progress',
|
|
378
|
+
error: undefined,
|
|
379
|
+
};
|
|
380
|
+
},
|
|
381
|
+
clearQboProjectsReconnectRequest(draft) {
|
|
382
|
+
draft.passportView.needsQboProjectsReconnect = false;
|
|
383
|
+
},
|
|
317
384
|
updateCapitalizationAccountThreshold: {
|
|
318
385
|
prepare(companyId, accountId, threshold, dismissOnboardingForAccount, allOverrides) {
|
|
319
386
|
return {
|
|
@@ -632,5 +699,5 @@ const companyView = (0, toolkit_1.createSlice)({
|
|
|
632
699
|
},
|
|
633
700
|
},
|
|
634
701
|
});
|
|
635
|
-
_a = companyView.actions, exports.fetchCompanyPassportView = _a.fetchCompanyPassportView, exports.fetchAllCockpitViews = _a.fetchAllCockpitViews, exports.fetchOnboardingView = _a.fetchOnboardingView, exports.fetchManagementView = _a.fetchManagementView, exports.fetchSubscriptionView = _a.fetchSubscriptionView, exports.fetchPortfolioView = _a.fetchPortfolioView, exports.fetchCompanyManagementView = _a.fetchCompanyManagementView, exports.companyManagementSaveUpdates = _a.companyManagementSaveUpdates, exports.companyManagementSavePendingUpdates = _a.companyManagementSavePendingUpdates, exports.companyManagementDiscardUpdates = _a.companyManagementDiscardUpdates, exports.companyManagementSaveUpdatesSuccess = _a.companyManagementSaveUpdatesSuccess, exports.companyManagementSaveUpdatesFailure = _a.companyManagementSaveUpdatesFailure, exports.updateCompanyViewOnSuccess = _a.updateCompanyViewOnSuccess, exports.updateCompanyViewOnFailure = _a.updateCompanyViewOnFailure, exports.fetchCompanyPortfolioView = _a.fetchCompanyPortfolioView, exports.fetchZeniUsers = _a.fetchZeniUsers, exports.updateZeniUsersOnSuccess = _a.updateZeniUsersOnSuccess, exports.updateZeniUsersOnFailure = _a.updateZeniUsersOnFailure, exports.clearCompanyView = _a.clearCompanyView, exports.updateCompanyPortfolioUIState = _a.updateCompanyPortfolioUIState, exports.updateCompanyManagementUIState = _a.updateCompanyManagementUIState, exports.companyPassportSaveDataInLocalStore = _a.companyPassportSaveDataInLocalStore, exports.deleteCompanyOfficerInLocalStore = _a.deleteCompanyOfficerInLocalStore, exports.companyPassportClearDataInLocalStore = _a.companyPassportClearDataInLocalStore, exports.companyPassportUpdateCompanyDetails = _a.companyPassportUpdateCompanyDetails, exports.companyPassportUpdateCompanyDetailsSuccess = _a.companyPassportUpdateCompanyDetailsSuccess, exports.companyPassportUpdateCompanyDetailsFailure = _a.companyPassportUpdateCompanyDetailsFailure, exports.updateAccountingClassesEnabled = _a.updateAccountingClassesEnabled, exports.updateAccountingClassesEnabledSuccess = _a.updateAccountingClassesEnabledSuccess, exports.updateAccountingClassesEnabledFailure = _a.updateAccountingClassesEnabledFailure, exports.updateCapitalizationAccountThreshold = _a.updateCapitalizationAccountThreshold, exports.updateCapitalizationAccountThresholdSuccess = _a.updateCapitalizationAccountThresholdSuccess, exports.updateCapitalizationAccountThresholdFailure = _a.updateCapitalizationAccountThresholdFailure, exports.dismissCapitalizationOnboarding = _a.dismissCapitalizationOnboarding, exports.companyPassportUpdatePrimaryContact = _a.companyPassportUpdatePrimaryContact, exports.companyPassportUpdatePrimaryContactSuccess = _a.companyPassportUpdatePrimaryContactSuccess, exports.companyPassportUpdatePrimaryContactFailure = _a.companyPassportUpdatePrimaryContactFailure, exports.companyPassportUpdateCompanyOfficer = _a.companyPassportUpdateCompanyOfficer, exports.companyPassportUpdateCompanyOfficerSuccess = _a.companyPassportUpdateCompanyOfficerSuccess, exports.companyPassportUpdateCompanyOfficerFailure = _a.companyPassportUpdateCompanyOfficerFailure, exports.companyPassportCreateCompanyOfficers = _a.companyPassportCreateCompanyOfficers, exports.companyPassportCreateCompanyOfficersSuccess = _a.companyPassportCreateCompanyOfficersSuccess, exports.companyPassportCreateCompanyOfficersFailure = _a.companyPassportCreateCompanyOfficersFailure, exports.updateCompanyPassportLocalStoreData = _a.updateCompanyPassportLocalStoreData, exports.saveIndustryAndIncDateInCompanyPassportLocalStore = _a.saveIndustryAndIncDateInCompanyPassportLocalStore, exports.saveCompanyPassportDetails = _a.saveCompanyPassportDetails, exports.fetchParentSubsidiaryManagementView = _a.fetchParentSubsidiaryManagementView, exports.updateParentSubsidiaryView = _a.updateParentSubsidiaryView, exports.updateParentSubsidiaryViewOnFailure = _a.updateParentSubsidiaryViewOnFailure, exports.updateCompanyDownloadState = _a.updateCompanyDownloadState, exports.fetchCompanyMetaData = _a.fetchCompanyMetaData, exports.updateCompanyMetaDataOnSuccess = _a.updateCompanyMetaDataOnSuccess, exports.updateCompanyMetaDataOnFailure = _a.updateCompanyMetaDataOnFailure, exports.updateMetaDataOnSendMonthEndReport = _a.updateMetaDataOnSendMonthEndReport;
|
|
702
|
+
_a = companyView.actions, exports.fetchCompanyPassportView = _a.fetchCompanyPassportView, exports.fetchAllCockpitViews = _a.fetchAllCockpitViews, exports.fetchOnboardingView = _a.fetchOnboardingView, exports.fetchManagementView = _a.fetchManagementView, exports.fetchSubscriptionView = _a.fetchSubscriptionView, exports.fetchPortfolioView = _a.fetchPortfolioView, exports.fetchCompanyManagementView = _a.fetchCompanyManagementView, exports.companyManagementSaveUpdates = _a.companyManagementSaveUpdates, exports.companyManagementSavePendingUpdates = _a.companyManagementSavePendingUpdates, exports.companyManagementDiscardUpdates = _a.companyManagementDiscardUpdates, exports.companyManagementSaveUpdatesSuccess = _a.companyManagementSaveUpdatesSuccess, exports.companyManagementSaveUpdatesFailure = _a.companyManagementSaveUpdatesFailure, exports.updateCompanyViewOnSuccess = _a.updateCompanyViewOnSuccess, exports.updateCompanyViewOnFailure = _a.updateCompanyViewOnFailure, exports.fetchCompanyPortfolioView = _a.fetchCompanyPortfolioView, exports.fetchZeniUsers = _a.fetchZeniUsers, exports.updateZeniUsersOnSuccess = _a.updateZeniUsersOnSuccess, exports.updateZeniUsersOnFailure = _a.updateZeniUsersOnFailure, exports.clearCompanyView = _a.clearCompanyView, exports.updateCompanyPortfolioUIState = _a.updateCompanyPortfolioUIState, exports.updateCompanyManagementUIState = _a.updateCompanyManagementUIState, exports.companyPassportSaveDataInLocalStore = _a.companyPassportSaveDataInLocalStore, exports.deleteCompanyOfficerInLocalStore = _a.deleteCompanyOfficerInLocalStore, exports.companyPassportClearDataInLocalStore = _a.companyPassportClearDataInLocalStore, exports.companyPassportUpdateCompanyDetails = _a.companyPassportUpdateCompanyDetails, exports.companyPassportUpdateCompanyDetailsSuccess = _a.companyPassportUpdateCompanyDetailsSuccess, exports.companyPassportUpdateCompanyDetailsFailure = _a.companyPassportUpdateCompanyDetailsFailure, exports.updateAccountingClassesEnabled = _a.updateAccountingClassesEnabled, exports.updateAccountingClassesEnabledSuccess = _a.updateAccountingClassesEnabledSuccess, exports.updateAccountingClassesEnabledFailure = _a.updateAccountingClassesEnabledFailure, exports.enableAccountingProjects = _a.enableAccountingProjects, exports.resumeEnableAccountingProjects = _a.resumeEnableAccountingProjects, exports.disableAccountingProjects = _a.disableAccountingProjects, exports.updateAccountingProjectsEnabledSuccess = _a.updateAccountingProjectsEnabledSuccess, exports.updateAccountingProjectsEnabledFailure = _a.updateAccountingProjectsEnabledFailure, exports.requestQboProjectsReconnect = _a.requestQboProjectsReconnect, exports.clearQboProjectsReconnectRequest = _a.clearQboProjectsReconnectRequest, exports.updateCapitalizationAccountThreshold = _a.updateCapitalizationAccountThreshold, exports.updateCapitalizationAccountThresholdSuccess = _a.updateCapitalizationAccountThresholdSuccess, exports.updateCapitalizationAccountThresholdFailure = _a.updateCapitalizationAccountThresholdFailure, exports.dismissCapitalizationOnboarding = _a.dismissCapitalizationOnboarding, exports.companyPassportUpdatePrimaryContact = _a.companyPassportUpdatePrimaryContact, exports.companyPassportUpdatePrimaryContactSuccess = _a.companyPassportUpdatePrimaryContactSuccess, exports.companyPassportUpdatePrimaryContactFailure = _a.companyPassportUpdatePrimaryContactFailure, exports.companyPassportUpdateCompanyOfficer = _a.companyPassportUpdateCompanyOfficer, exports.companyPassportUpdateCompanyOfficerSuccess = _a.companyPassportUpdateCompanyOfficerSuccess, exports.companyPassportUpdateCompanyOfficerFailure = _a.companyPassportUpdateCompanyOfficerFailure, exports.companyPassportCreateCompanyOfficers = _a.companyPassportCreateCompanyOfficers, exports.companyPassportCreateCompanyOfficersSuccess = _a.companyPassportCreateCompanyOfficersSuccess, exports.companyPassportCreateCompanyOfficersFailure = _a.companyPassportCreateCompanyOfficersFailure, exports.updateCompanyPassportLocalStoreData = _a.updateCompanyPassportLocalStoreData, exports.saveIndustryAndIncDateInCompanyPassportLocalStore = _a.saveIndustryAndIncDateInCompanyPassportLocalStore, exports.saveCompanyPassportDetails = _a.saveCompanyPassportDetails, exports.fetchParentSubsidiaryManagementView = _a.fetchParentSubsidiaryManagementView, exports.updateParentSubsidiaryView = _a.updateParentSubsidiaryView, exports.updateParentSubsidiaryViewOnFailure = _a.updateParentSubsidiaryViewOnFailure, exports.updateCompanyDownloadState = _a.updateCompanyDownloadState, exports.fetchCompanyMetaData = _a.fetchCompanyMetaData, exports.updateCompanyMetaDataOnSuccess = _a.updateCompanyMetaDataOnSuccess, exports.updateCompanyMetaDataOnFailure = _a.updateCompanyMetaDataOnFailure, exports.updateMetaDataOnSendMonthEndReport = _a.updateMetaDataOnSendMonthEndReport;
|
|
636
703
|
exports.default = companyView.reducer;
|
|
@@ -4,11 +4,12 @@ exports.dismissCapitalizationOnboardingEpic = void 0;
|
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const tenantReducer_1 = require("../../../../entity/tenant/tenantReducer");
|
|
7
|
+
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
7
8
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
8
9
|
const companyViewReducer_1 = require("../../companyViewReducer");
|
|
9
10
|
const dismissCapitalizationOnboardingEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(companyViewReducer_1.dismissCapitalizationOnboarding.match), (0, operators_1.switchMap)((action) => {
|
|
10
11
|
const { companyId, accountId } = action.payload;
|
|
11
|
-
const tenantId =
|
|
12
|
+
const tenantId = (0, tenantSelector_1.getTenantIdByCompanyId)(state$.value.tenantState, companyId);
|
|
12
13
|
const body = {
|
|
13
14
|
capitalization_onboarding_dismissed_accounts: { [accountId]: true },
|
|
14
15
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { updateCompanies } from '../../../../../entity/company/companyReducer';
|
|
4
|
+
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
5
|
+
import { updateTenantAccountingProjectsEnabled } from '../../../../../entity/tenant/tenantReducer';
|
|
6
|
+
import { RootState } from '../../../../../reducer';
|
|
7
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
8
|
+
import { disableAccountingProjects, updateAccountingProjectsEnabledFailure, updateAccountingProjectsEnabledSuccess } from '../../../companyViewReducer';
|
|
9
|
+
export type ActionType = ReturnType<typeof disableAccountingProjects> | ReturnType<typeof updateCompanies> | ReturnType<typeof updateTenantAccountingProjectsEnabled> | ReturnType<typeof updateAccountingProjectsEnabledSuccess> | ReturnType<typeof updateAccountingProjectsEnabledFailure> | ReturnType<typeof openSnackbar>;
|
|
10
|
+
export declare const disableAccountingProjectsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.disableAccountingProjectsEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const companyReducer_1 = require("../../../../../entity/company/companyReducer");
|
|
7
|
+
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
8
|
+
const tenantReducer_1 = require("../../../../../entity/tenant/tenantReducer");
|
|
9
|
+
const tenantSelector_1 = require("../../../../../entity/tenant/tenantSelector");
|
|
10
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
11
|
+
const companyViewReducer_1 = require("../../../companyViewReducer");
|
|
12
|
+
const disableAccountingProjectsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(companyViewReducer_1.disableAccountingProjects.match), (0, operators_1.switchMap)((action) => {
|
|
13
|
+
const { companyId } = action.payload;
|
|
14
|
+
const tenantId = (0, tenantSelector_1.getTenantIdByCompanyId)(state$.value.tenantState, companyId);
|
|
15
|
+
return zeniAPI
|
|
16
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, { is_accounting_projects_enabled: false })
|
|
17
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
18
|
+
const companies = response.data?.companies ?? [];
|
|
19
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && companies.length > 0) {
|
|
20
|
+
const actions = [
|
|
21
|
+
(0, companyReducer_1.updateCompanies)({
|
|
22
|
+
payload: companies,
|
|
23
|
+
schema: {},
|
|
24
|
+
}),
|
|
25
|
+
];
|
|
26
|
+
if (tenantId != null) {
|
|
27
|
+
actions.push((0, tenantReducer_1.updateTenantAccountingProjectsEnabled)({
|
|
28
|
+
enabled: false,
|
|
29
|
+
tenantId,
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
actions.push((0, companyViewReducer_1.updateAccountingProjectsEnabledSuccess)());
|
|
33
|
+
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
34
|
+
messageSection: 'accounting_projects_enabled_update',
|
|
35
|
+
messageText: 'success',
|
|
36
|
+
type: 'success',
|
|
37
|
+
}));
|
|
38
|
+
return (0, rxjs_1.from)(actions);
|
|
39
|
+
}
|
|
40
|
+
return (0, rxjs_1.from)([
|
|
41
|
+
(0, companyViewReducer_1.updateAccountingProjectsEnabledFailure)({
|
|
42
|
+
status: response.status,
|
|
43
|
+
}),
|
|
44
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
45
|
+
messageSection: 'accounting_projects_enabled_update',
|
|
46
|
+
messageText: 'failed',
|
|
47
|
+
type: 'error',
|
|
48
|
+
}),
|
|
49
|
+
]);
|
|
50
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, companyViewReducer_1.updateAccountingProjectsEnabledFailure)({
|
|
51
|
+
status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', `Update Accounting Projects Enabled errored out - ${error instanceof Error
|
|
52
|
+
? error.message
|
|
53
|
+
: JSON.stringify(error)}`),
|
|
54
|
+
}), (0, snackbarReducer_1.openSnackbar)({
|
|
55
|
+
messageSection: 'accounting_projects_enabled_update',
|
|
56
|
+
messageText: 'failed',
|
|
57
|
+
type: 'error',
|
|
58
|
+
}))));
|
|
59
|
+
}));
|
|
60
|
+
exports.disableAccountingProjectsEpic = disableAccountingProjectsEpic;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
4
|
+
import { RootState } from '../../../../../reducer';
|
|
5
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
6
|
+
import { enableAccountingProjects, requestQboProjectsReconnect, resumeEnableAccountingProjects, updateAccountingProjectsEnabledFailure } from '../../../companyViewReducer';
|
|
7
|
+
export interface AccountingProviderProjectAuthorizationStatusResponse {
|
|
8
|
+
is_accounting_provider_project_apis_authorized: boolean;
|
|
9
|
+
}
|
|
10
|
+
export type ActionType = ReturnType<typeof enableAccountingProjects> | ReturnType<typeof requestQboProjectsReconnect> | ReturnType<typeof resumeEnableAccountingProjects> | ReturnType<typeof updateAccountingProjectsEnabledFailure> | ReturnType<typeof openSnackbar>;
|
|
11
|
+
export declare const enableAccountingProjectsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.enableAccountingProjectsEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
7
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
8
|
+
const companyViewReducer_1 = require("../../../companyViewReducer");
|
|
9
|
+
const enableAccountingProjectsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(companyViewReducer_1.enableAccountingProjects.match), (0, operators_1.switchMap)((action) => {
|
|
10
|
+
const { companyId } = action.payload;
|
|
11
|
+
return zeniAPI
|
|
12
|
+
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accounting_provider_project_authorization_status`)
|
|
13
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
14
|
+
if (!(0, responsePayload_1.isSuccessResponse)(response) || response.data == null) {
|
|
15
|
+
return (0, rxjs_1.from)([
|
|
16
|
+
(0, companyViewReducer_1.updateAccountingProjectsEnabledFailure)({
|
|
17
|
+
status: response.status,
|
|
18
|
+
}),
|
|
19
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
20
|
+
messageSection: 'accounting_projects_enabled_update',
|
|
21
|
+
messageText: 'failed',
|
|
22
|
+
type: 'error',
|
|
23
|
+
}),
|
|
24
|
+
]);
|
|
25
|
+
}
|
|
26
|
+
if (response.data.is_accounting_provider_project_apis_authorized !==
|
|
27
|
+
true) {
|
|
28
|
+
return (0, rxjs_1.from)([(0, companyViewReducer_1.requestQboProjectsReconnect)()]);
|
|
29
|
+
}
|
|
30
|
+
return (0, rxjs_1.from)([(0, companyViewReducer_1.resumeEnableAccountingProjects)(companyId)]);
|
|
31
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, companyViewReducer_1.updateAccountingProjectsEnabledFailure)({
|
|
32
|
+
status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', `Accounting provider project authorization status errored out - ${error instanceof Error
|
|
33
|
+
? error.message
|
|
34
|
+
: JSON.stringify(error)}`),
|
|
35
|
+
}), (0, snackbarReducer_1.openSnackbar)({
|
|
36
|
+
messageSection: 'accounting_projects_enabled_update',
|
|
37
|
+
messageText: 'failed',
|
|
38
|
+
type: 'error',
|
|
39
|
+
}))));
|
|
40
|
+
}));
|
|
41
|
+
exports.enableAccountingProjectsEpic = enableAccountingProjectsEpic;
|
package/lib/view/companyView/epic/companyPassport/projects/resumeEnableAccountingProjectsEpic.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
4
|
+
import { updateTenantAccountingProjectsEnabled } from '../../../../../entity/tenant/tenantReducer';
|
|
5
|
+
import { RootState } from '../../../../../reducer';
|
|
6
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
7
|
+
import { resumeEnableAccountingProjects, updateAccountingProjectsEnabledFailure, updateAccountingProjectsEnabledSuccess } from '../../../companyViewReducer';
|
|
8
|
+
export interface AccountingProviderProjectEnablementStatusResponse {
|
|
9
|
+
is_accounting_projects_enabled: boolean;
|
|
10
|
+
is_accounting_provider_project_apis_enabled: boolean;
|
|
11
|
+
}
|
|
12
|
+
export type ActionType = ReturnType<typeof resumeEnableAccountingProjects> | ReturnType<typeof updateTenantAccountingProjectsEnabled> | ReturnType<typeof updateAccountingProjectsEnabledSuccess> | ReturnType<typeof updateAccountingProjectsEnabledFailure> | ReturnType<typeof openSnackbar>;
|
|
13
|
+
export declare const resumeEnableAccountingProjectsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
package/lib/view/companyView/epic/companyPassport/projects/resumeEnableAccountingProjectsEpic.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resumeEnableAccountingProjectsEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
7
|
+
const tenantReducer_1 = require("../../../../../entity/tenant/tenantReducer");
|
|
8
|
+
const tenantSelector_1 = require("../../../../../entity/tenant/tenantSelector");
|
|
9
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
10
|
+
const companyViewReducer_1 = require("../../../companyViewReducer");
|
|
11
|
+
const resumeEnableAccountingProjectsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(companyViewReducer_1.resumeEnableAccountingProjects.match), (0, operators_1.switchMap)((action) => {
|
|
12
|
+
const { companyId } = action.payload;
|
|
13
|
+
const tenantId = (0, tenantSelector_1.getTenantIdByCompanyId)(state$.value.tenantState, companyId);
|
|
14
|
+
if (tenantId == null) {
|
|
15
|
+
return (0, rxjs_1.from)([
|
|
16
|
+
(0, companyViewReducer_1.updateAccountingProjectsEnabledFailure)({
|
|
17
|
+
status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Tenant not found for company'),
|
|
18
|
+
}),
|
|
19
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
20
|
+
messageSection: 'accounting_projects_enabled_update',
|
|
21
|
+
messageText: 'failed',
|
|
22
|
+
type: 'error',
|
|
23
|
+
}),
|
|
24
|
+
]);
|
|
25
|
+
}
|
|
26
|
+
return zeniAPI
|
|
27
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accounting_provider_project_enablement_status`)
|
|
28
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
29
|
+
if (!(0, responsePayload_1.isSuccessResponse)(response) || response.data == null) {
|
|
30
|
+
return (0, rxjs_1.from)([
|
|
31
|
+
(0, companyViewReducer_1.updateAccountingProjectsEnabledFailure)({
|
|
32
|
+
status: response.status,
|
|
33
|
+
}),
|
|
34
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
35
|
+
messageSection: 'accounting_projects_enabled_update',
|
|
36
|
+
messageText: 'failed',
|
|
37
|
+
type: 'error',
|
|
38
|
+
}),
|
|
39
|
+
]);
|
|
40
|
+
}
|
|
41
|
+
if (response.data.is_accounting_provider_project_apis_enabled !==
|
|
42
|
+
true ||
|
|
43
|
+
response.data.is_accounting_projects_enabled !== true) {
|
|
44
|
+
return (0, rxjs_1.from)([
|
|
45
|
+
(0, companyViewReducer_1.updateAccountingProjectsEnabledFailure)({
|
|
46
|
+
status: (0, responsePayload_1.createZeniAPIStatus)('Projects not enabled in QBO', 'Please enable projects in QBO before enabling in the Zeni dashboard!'),
|
|
47
|
+
}),
|
|
48
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
49
|
+
messageSection: 'accounting_projects_qbo_not_enabled',
|
|
50
|
+
messageText: 'failed',
|
|
51
|
+
type: 'error',
|
|
52
|
+
}),
|
|
53
|
+
]);
|
|
54
|
+
}
|
|
55
|
+
return (0, rxjs_1.from)([
|
|
56
|
+
(0, tenantReducer_1.updateTenantAccountingProjectsEnabled)({
|
|
57
|
+
enabled: true,
|
|
58
|
+
tenantId,
|
|
59
|
+
}),
|
|
60
|
+
(0, companyViewReducer_1.updateAccountingProjectsEnabledSuccess)(),
|
|
61
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
62
|
+
messageSection: 'accounting_projects_enabled_update',
|
|
63
|
+
messageText: 'success',
|
|
64
|
+
type: 'success',
|
|
65
|
+
}),
|
|
66
|
+
]);
|
|
67
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, companyViewReducer_1.updateAccountingProjectsEnabledFailure)({
|
|
68
|
+
status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', `Accounting provider project enablement status errored out - ${error instanceof Error
|
|
69
|
+
? error.message
|
|
70
|
+
: JSON.stringify(error)}`),
|
|
71
|
+
}), (0, snackbarReducer_1.openSnackbar)({
|
|
72
|
+
messageSection: 'accounting_projects_enabled_update',
|
|
73
|
+
messageText: 'failed',
|
|
74
|
+
type: 'error',
|
|
75
|
+
}))));
|
|
76
|
+
}));
|
|
77
|
+
exports.resumeEnableAccountingProjectsEpic = resumeEnableAccountingProjectsEpic;
|
|
@@ -6,11 +6,12 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const companyReducer_1 = require("../../../../entity/company/companyReducer");
|
|
7
7
|
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
8
8
|
const tenantReducer_1 = require("../../../../entity/tenant/tenantReducer");
|
|
9
|
+
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
9
10
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
10
11
|
const companyViewReducer_1 = require("../../companyViewReducer");
|
|
11
12
|
const updateAccountingClassesEnabledEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(companyViewReducer_1.updateAccountingClassesEnabled.match), (0, operators_1.switchMap)((action) => {
|
|
12
13
|
const { companyId, enabled } = action.payload;
|
|
13
|
-
const tenantId =
|
|
14
|
+
const tenantId = (0, tenantSelector_1.getTenantIdByCompanyId)(state$.value.tenantState, companyId);
|
|
14
15
|
return zeniAPI
|
|
15
16
|
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, { is_accounting_classes_enabled: enabled })
|
|
16
17
|
.pipe((0, operators_1.mergeMap)((response) => {
|
package/lib/view/companyView/epic/companyPassport/updateCapitalizationAccountThresholdEpic.js
CHANGED
|
@@ -6,11 +6,12 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const companyReducer_1 = require("../../../../entity/company/companyReducer");
|
|
7
7
|
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
8
8
|
const tenantReducer_1 = require("../../../../entity/tenant/tenantReducer");
|
|
9
|
+
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
9
10
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
10
11
|
const companyViewReducer_1 = require("../../companyViewReducer");
|
|
11
12
|
const updateCapitalizationAccountThresholdEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(companyViewReducer_1.updateCapitalizationAccountThreshold.match), (0, operators_1.switchMap)((action) => {
|
|
12
13
|
const { companyId, accountId, threshold, dismissOnboardingForAccount, allOverrides, } = action.payload;
|
|
13
|
-
const tenantId =
|
|
14
|
+
const tenantId = (0, tenantSelector_1.getTenantIdByCompanyId)(state$.value.tenantState, companyId);
|
|
14
15
|
let finalOverrides;
|
|
15
16
|
if (allOverrides !== undefined) {
|
|
16
17
|
finalOverrides = allOverrides ?? {};
|
|
@@ -5,6 +5,7 @@ import { CompanyOfficerLocalData, CompanyOfficerType, PrimaryContactLocalData }
|
|
|
5
5
|
export type UpdateActionType = 'company_update' | 'user_create' | 'user_update';
|
|
6
6
|
export interface CompanyPassportViewState extends CommonState, FetchedState {
|
|
7
7
|
accountingClassesUpdateStatus: FetchStateAndError;
|
|
8
|
+
accountingProjectsUpdateStatus: FetchStateAndError;
|
|
8
9
|
capitalizationThresholdUpdateStatus: FetchStateAndError;
|
|
9
10
|
companyDetails: {
|
|
10
11
|
updateStatus: FetchStateAndError;
|
|
@@ -14,6 +15,7 @@ export interface CompanyPassportViewState extends CommonState, FetchedState {
|
|
|
14
15
|
updateStatus: FetchStateAndError;
|
|
15
16
|
localData?: CompanyOfficerLocalData;
|
|
16
17
|
}>;
|
|
18
|
+
needsQboProjectsReconnect: boolean;
|
|
17
19
|
primaryContact: {
|
|
18
20
|
updateStatus: FetchStateAndError;
|
|
19
21
|
localData?: PrimaryContactLocalData;
|
|
@@ -8,10 +8,15 @@ exports.initialCompanyPassportView = {
|
|
|
8
8
|
fetchState: 'Not-Started',
|
|
9
9
|
error: undefined,
|
|
10
10
|
},
|
|
11
|
+
accountingProjectsUpdateStatus: {
|
|
12
|
+
fetchState: 'Not-Started',
|
|
13
|
+
error: undefined,
|
|
14
|
+
},
|
|
11
15
|
capitalizationThresholdUpdateStatus: {
|
|
12
16
|
fetchState: 'Not-Started',
|
|
13
17
|
error: undefined,
|
|
14
18
|
},
|
|
19
|
+
needsQboProjectsReconnect: false,
|
|
15
20
|
companyDetails: {
|
|
16
21
|
localData: undefined,
|
|
17
22
|
updateStatus: {
|
|
@@ -3,10 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.fetchJeSchedulesEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const formatZeniDateFY_1 = require("../../../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY");
|
|
6
7
|
const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
|
|
7
8
|
const jeSchedulesReducer_1 = require("../../../../entity/jeSchedules/jeSchedulesReducer");
|
|
8
9
|
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
9
10
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
11
|
+
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
10
12
|
const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
|
|
11
13
|
const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.fetchJeSchedules.match), (0, operators_1.mergeMap)((action) => {
|
|
12
14
|
const state = state$.value;
|
|
@@ -14,9 +16,20 @@ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
|
|
|
14
16
|
const { period, refreshViewInBackground } = action.payload;
|
|
15
17
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
16
18
|
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
19
|
+
const isClosePeriodTab = state.expenseAutomationJESchedulesViewState.uiState.selectedPageTab ===
|
|
20
|
+
'schedules';
|
|
21
|
+
const existingEndDate = (0, timePeriod_1.toAbsoluteDay)((0, zeniDayJS_1.date)((0, timePeriod_1.toString)(period.start))
|
|
22
|
+
.subtract(1, 'month')
|
|
23
|
+
.endOf('month')
|
|
24
|
+
.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT));
|
|
17
25
|
const queryParam = {
|
|
18
26
|
start_date: (0, timePeriod_1.toString)(period.start),
|
|
19
|
-
end_date:
|
|
27
|
+
end_date: isClosePeriodTab || existingEndDate == null
|
|
28
|
+
? (0, timePeriod_1.toString)(period.end)
|
|
29
|
+
: (0, timePeriod_1.toString)(existingEndDate),
|
|
30
|
+
...(isClosePeriodTab
|
|
31
|
+
? { close_period_start_date: (0, timePeriod_1.toString)(period.start) }
|
|
32
|
+
: {}),
|
|
20
33
|
};
|
|
21
34
|
return zeniAPI
|
|
22
35
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/expenses_automation/je_schedules?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../../../reducer';
|
|
4
|
+
import { fetchAccountList } from '../../../../accountList/accountListReducer';
|
|
5
|
+
import { fetchClassList } from '../../../../classList/classListReducer';
|
|
6
|
+
import { clearSearchTransactionsForNewSchedule, initializeNewSchedule, resetNewScheduleLocalData } from '../../../reducers/jeSchedulesViewReducer';
|
|
7
|
+
export type ActionType = ReturnType<typeof clearSearchTransactionsForNewSchedule> | ReturnType<typeof fetchAccountList> | ReturnType<typeof fetchClassList> | ReturnType<typeof initializeNewSchedule> | ReturnType<typeof resetNewScheduleLocalData>;
|
|
8
|
+
export declare const initializeNewScheduleEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initializeNewScheduleEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const accountListReducer_1 = require("../../../../accountList/accountListReducer");
|
|
7
|
+
const classListReducer_1 = require("../../../../classList/classListReducer");
|
|
8
|
+
const scheduleListHelper_1 = require("../../../../scheduleView/scheduleListView/scheduleListHelper");
|
|
9
|
+
const jeSchedulesViewReducer_1 = require("../../../reducers/jeSchedulesViewReducer");
|
|
10
|
+
const initializeNewScheduleEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.initializeNewSchedule.match), (0, operators_1.mergeMap)((action) => {
|
|
11
|
+
const newScheduleActions = [];
|
|
12
|
+
const accountType = (0, scheduleListHelper_1.getAccountsTypesForScheduleEpics)();
|
|
13
|
+
const { accountListState, classListState } = state$.value;
|
|
14
|
+
if (accountListState.byReportId[accountType.accountListKey]?.fetchState ===
|
|
15
|
+
'Not-Started') {
|
|
16
|
+
newScheduleActions.push((0, accountListReducer_1.fetchAccountList)(accountType.accountListKey, true, false, false, false, accountType.allowedAccountList));
|
|
17
|
+
}
|
|
18
|
+
if (classListState.fetchState === 'Not-Started') {
|
|
19
|
+
newScheduleActions.push((0, classListReducer_1.fetchClassList)());
|
|
20
|
+
}
|
|
21
|
+
newScheduleActions.push((0, jeSchedulesViewReducer_1.resetNewScheduleLocalData)({ scheduleType: action.payload.scheduleType }));
|
|
22
|
+
newScheduleActions.push((0, jeSchedulesViewReducer_1.clearSearchTransactionsForNewSchedule)());
|
|
23
|
+
return (0, rxjs_1.from)(newScheduleActions);
|
|
24
|
+
}));
|
|
25
|
+
exports.initializeNewScheduleEpic = initializeNewScheduleEpic;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { updateJESchedules, updateJESchedulesDetails } from '../../../../../entity/jeSchedules/jeSchedulesReducer';
|
|
3
|
+
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
4
|
+
import { RootState } from '../../../../../reducer';
|
|
5
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
6
|
+
import { resetNewScheduleLocalData, saveNewSchedule, saveNewScheduleFailure, saveNewScheduleSuccess } from '../../../reducers/jeSchedulesViewReducer';
|
|
7
|
+
export type ActionType = ReturnType<typeof saveNewSchedule> | ReturnType<typeof saveNewScheduleSuccess> | ReturnType<typeof saveNewScheduleFailure> | ReturnType<typeof updateJESchedules> | ReturnType<typeof updateJESchedulesDetails> | ReturnType<typeof resetNewScheduleLocalData> | ReturnType<typeof openSnackbar>;
|
|
8
|
+
export declare const saveNewScheduleEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
9
|
+
payload: {
|
|
10
|
+
messageSection: import("../../../../..").SnackbarMessageSections;
|
|
11
|
+
messageText: import("../../../../..").SnackbarMessageSectionTexts;
|
|
12
|
+
type: import("../../../../..").SnackbarMessageType;
|
|
13
|
+
showStatusIcon?: boolean;
|
|
14
|
+
variables?: {
|
|
15
|
+
variableName: string;
|
|
16
|
+
variableValue: string;
|
|
17
|
+
}[];
|
|
18
|
+
};
|
|
19
|
+
type: "snackbar/openSnackbar";
|
|
20
|
+
} | {
|
|
21
|
+
payload: {
|
|
22
|
+
jeSchedulesTransactionsPayload: import("../../../../../entity/jeSchedules/jeSchedulesPayload").JEScheduledTransactionPayload[];
|
|
23
|
+
};
|
|
24
|
+
type: "jeSchedules/updateJESchedules";
|
|
25
|
+
} | {
|
|
26
|
+
payload: {
|
|
27
|
+
jeSchedulesPayload: import("../../../../../entity/jeSchedules/jeSchedulesPayload").JEScheduledTransactionPayload[];
|
|
28
|
+
scheduledJEntriesPayload: import("../../../../../entity/jeSchedules/jeSchedulesPayload").ScheduledJournalEntryPayload[] | undefined;
|
|
29
|
+
updateType: import("../../../../..").UpdateType;
|
|
30
|
+
};
|
|
31
|
+
type: "jeSchedules/updateJESchedulesDetails";
|
|
32
|
+
} | {
|
|
33
|
+
payload: {
|
|
34
|
+
scheduleType: "prepaid_expenses" | "fixed_assets";
|
|
35
|
+
};
|
|
36
|
+
type: "expenseAutomationJESchedulesView/resetNewScheduleLocalData";
|
|
37
|
+
} | {
|
|
38
|
+
payload: undefined;
|
|
39
|
+
type: "expenseAutomationJESchedulesView/saveNewScheduleSuccess";
|
|
40
|
+
} | {
|
|
41
|
+
payload: {
|
|
42
|
+
status: import("../../../../../responsePayload").ZeniAPIStatus;
|
|
43
|
+
};
|
|
44
|
+
type: "expenseAutomationJESchedulesView/saveNewScheduleFailure";
|
|
45
|
+
}>;
|