@zeniai/client-epic-state 5.0.9-beta0ND → 5.0.9-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/coreEpics.js +1 -2
- package/lib/entity/account/accountReducer.js +3 -0
- package/lib/entity/project/projectReducer.js +2 -0
- package/lib/entity/sectionAccountsView/sectionAccountsViewEpic.js +3 -0
- package/lib/entity/sectionAccountsView/sectionAccountsViewReducer.js +1 -0
- package/lib/entity/sectionAccountsView/sectionAccountsViewSelector.js +2 -0
- package/lib/entity/sectionProjectView/sectionProjectViewEpic.js +4 -0
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.js +2 -0
- package/lib/entity/sectionProjectView/sectionProjectViewSelector.js +3 -0
- package/lib/entity/tenant/tenantReducer.d.ts +1 -5
- package/lib/entity/tenant/tenantReducer.js +2 -23
- package/lib/entity/tenant/tenantState.d.ts +0 -1
- package/lib/esm/coreEpics.js +1 -2
- package/lib/esm/entity/account/accountReducer.js +3 -0
- package/lib/esm/entity/project/projectReducer.js +2 -0
- package/lib/esm/entity/sectionAccountsView/sectionAccountsViewEpic.js +3 -0
- package/lib/esm/entity/sectionAccountsView/sectionAccountsViewReducer.js +1 -0
- package/lib/esm/entity/sectionAccountsView/sectionAccountsViewSelector.js +2 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectViewEpic.js +4 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectViewReducer.js +2 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectViewSelector.js +3 -0
- package/lib/esm/entity/tenant/tenantReducer.js +1 -21
- package/lib/esm/index.js +2 -5
- package/lib/esm/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.js +15 -0
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewSelector.js +2 -0
- package/lib/index.d.ts +2 -5
- package/lib/index.js +30 -36
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.js +15 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelector.js +2 -0
- package/package.json +1 -1
- package/lib/entity/tenant/SessionManager.d.ts +0 -38
- package/lib/entity/tenant/SessionManager.js +0 -171
- package/lib/entity/tenant/epic/sessionHeartbeatEpic.d.ts +0 -16
- package/lib/entity/tenant/epic/sessionHeartbeatEpic.js +0 -16
- package/lib/entity/tenant/sessionTypes.d.ts +0 -26
- package/lib/entity/tenant/sessionTypes.js +0 -12
- package/lib/esm/entity/tenant/SessionManager.js +0 -167
- package/lib/esm/entity/tenant/epic/sessionHeartbeatEpic.js +0 -12
- package/lib/esm/entity/tenant/sessionTypes.js +0 -9
package/lib/coreEpics.js
CHANGED
|
@@ -24,7 +24,6 @@ const resendVerifyDeviceOTPEpic_1 = require("./entity/tenant/epic/resendVerifyDe
|
|
|
24
24
|
const saveExternalConnectionEpic_1 = require("./entity/tenant/epic/saveExternalConnectionEpic");
|
|
25
25
|
const sendEmailMagicLinkToUserEpic_1 = require("./entity/tenant/epic/sendEmailMagicLinkToUserEpic");
|
|
26
26
|
const signInUserEpic_1 = require("./entity/tenant/epic/signInUserEpic");
|
|
27
|
-
const sessionHeartbeatEpic_1 = require("./entity/tenant/epic/sessionHeartbeatEpic");
|
|
28
27
|
const signOutUserEpic_1 = require("./entity/tenant/epic/signOutUserEpic");
|
|
29
28
|
const verifyDeviceWithTwoFAEpic_1 = require("./entity/tenant/epic/verifyDeviceWithTwoFAEpic");
|
|
30
29
|
// ── Toast Notification Epic ──────────────────────────────────────────
|
|
@@ -49,7 +48,7 @@ const verifyOtpEpic_1 = require("./view/twoFactorAuthentication/verifyOtpEpic");
|
|
|
49
48
|
// RootActionType is only available in the dynamically imported epic.ts.
|
|
50
49
|
const coreRootEpic = (0, redux_observable_1.combineEpics)(
|
|
51
50
|
// Auth & tenant
|
|
52
|
-
clearAllEpic_1.clearAllEpic, doMagicLinkSignInEpic_1.doMagicLinkSignInEpic, signInUserEpic_1.doSignInEpic, signOutUserEpic_1.doSignOutEpic,
|
|
51
|
+
clearAllEpic_1.clearAllEpic, doMagicLinkSignInEpic_1.doMagicLinkSignInEpic, signInUserEpic_1.doSignInEpic, signOutUserEpic_1.doSignOutEpic, fetchActiveTenantEpic_1.fetchActiveTenantEpic, fetchAllTenantsEpic_1.fetchAllTenantsEpic, fetchExcludedResourcesEpic_1.fetchExcludedResourcesEpic, fetchExternalConnectionsEpic_1.fetchExternalConnectionsEpic, fetchSubscriptionSummaryForTenantEpic_1.fetchSubscriptionSummaryForTenantEpic, resendVerifyDeviceOTPEpic_1.resendVerifyDeviceOTPEpic, saveExternalConnectionEpic_1.saveExternalConnectionEpic, sendEmailMagicLinkToUserEpic_1.sendEmailMagicLinkToUserEpic, verifyDeviceWithTwoFAEpic_1.verifyDeviceWithTwoFAEpic,
|
|
53
52
|
// Toast
|
|
54
53
|
pushToastNotificationEpic_1.pushToastNotificationEpic,
|
|
55
54
|
// Collaboration
|
|
@@ -22,6 +22,7 @@ const account = (0, toolkit_1.createSlice)({
|
|
|
22
22
|
reducers: {
|
|
23
23
|
updateAccounts: {
|
|
24
24
|
reducer(draft, action) {
|
|
25
|
+
console.log('$$$ [accountReducer.updateAccounts] reportId:', action.meta.reportId, 'updateType:', action.meta.updateType, 'classesViewParentId:', action.meta.classesViewParentId, 'count:', action.payload.length);
|
|
25
26
|
doUpdateAccounts(draft.accountsByKey, action.payload, action.meta.reportId, action.meta.classesViewParentId, action.meta.updateType);
|
|
26
27
|
},
|
|
27
28
|
prepare(payload, reportId, classesViewParentId, updateType = 'merge') {
|
|
@@ -33,6 +34,7 @@ const account = (0, toolkit_1.createSlice)({
|
|
|
33
34
|
},
|
|
34
35
|
updateMultipleSubAccountsWithBalances: {
|
|
35
36
|
reducer(draft, action) {
|
|
37
|
+
console.log('$$$ [accountReducer.updateMultipleSubAccountsWithBalances] reportId:', action.payload.reportId, 'timeframe:', action.payload.timeframe, 'updateType:', action.payload.updateType, 'count:', action.payload.subAccountWithBalancesListPayloads.length, 'payloads:', action.payload.subAccountWithBalancesListPayloads);
|
|
36
38
|
doUpdateSubAccountsWithBalances(draft.accountsByKey, action.payload.subAccountWithBalancesListPayloads, action.payload.currencyPayload, action.payload.reportId, action.payload.timeframe, action.payload.updateType);
|
|
37
39
|
},
|
|
38
40
|
prepare(subAccountWithBalancesListPayloads, currencyPayload, reportId, timeframe, updateType = 'merge') {
|
|
@@ -96,6 +98,7 @@ function doUpdateSubAccountsWithBalances(draft, subAccountWithBalancesListPayloa
|
|
|
96
98
|
}
|
|
97
99
|
function doUpdateAccountWithBalancesV2(draft, accountBasePayload, accountBalancesPayload, currencyPayload, reportId, timeframe, classesViewParentId, accountsViewParentId, projectsViewParentId, updateType) {
|
|
98
100
|
const key = (0, accountState_1.getAccountKey)(reportId, accountBasePayload.account_id, classesViewParentId, accountsViewParentId, projectsViewParentId);
|
|
101
|
+
console.log('$$$ [accountReducer.doUpdateAccountWithBalancesV2] key:', key, 'accountId:', accountBasePayload.account_id, 'projectsViewParentId:', projectsViewParentId, 'accountsViewParentId:', accountsViewParentId, 'classesViewParentId:', classesViewParentId);
|
|
99
102
|
const balancesByPeriod = (0, coaBalancePayload_2.mapCOABalanceGroupedByPeriodPayloadV2ToCOABalanceGroupedByPeriod)(accountBalancesPayload, currencyPayload, timeframe);
|
|
100
103
|
if (key in draft && updateType === 'merge') {
|
|
101
104
|
// only add balances
|
|
@@ -13,9 +13,11 @@ const projectSlice = (0, toolkit_1.createSlice)({
|
|
|
13
13
|
reducers: {
|
|
14
14
|
updateProjects: {
|
|
15
15
|
reducer(draft, action) {
|
|
16
|
+
console.log('$$$ [projectReducer.updateProjects] payload count:', action.payload.length, 'payload:', action.payload);
|
|
16
17
|
action.payload.forEach((projectPayload) => {
|
|
17
18
|
const project = (0, projectPayload_1.mapProjectMetadataPayloadToProject)(projectPayload);
|
|
18
19
|
draft.projects[project.projectId] = project;
|
|
20
|
+
console.log('$$$ [projectReducer.updateProjects] stored project', project.projectId, project);
|
|
19
21
|
});
|
|
20
22
|
},
|
|
21
23
|
prepare(payload) {
|
|
@@ -21,10 +21,12 @@ const updateSectionAccountsViewEpic = (actions$) => actions$.pipe((0, operators_
|
|
|
21
21
|
const currencyPayload = action.payload.currencyPayload;
|
|
22
22
|
const accountsMetadata = accountsMetadataPayload.map((eachAccount) => (0, accountPayload_1.mapAccountMetadataPayloadToAccountMetadata)(eachAccount));
|
|
23
23
|
const accountMetadataRecordsByID = (0, getNestedAccountIDHierarchyForReport_1.getAllAccountMetadataRecordsByID)(accountsMetadataPayload);
|
|
24
|
+
console.log('$$$ [sectionAccountsViewEpic] triggered for section:', sectionId, 'reportId:', reportId, 'hasAccounts:', sectionPayload.accounts != null, 'hasAccountGroups:', sectionPayload.account_groups != null);
|
|
24
25
|
// This would mean a non-zeni COA
|
|
25
26
|
if (sectionPayload.accounts != null) {
|
|
26
27
|
const accounts = sectionPayload.accounts;
|
|
27
28
|
const accountMetadataWithBalancesPayloads = (0, subAccountPayloadHelper_1.getSubAccountsMetadataForAccountList)(accounts, accountMetadataRecordsByID, sectionId);
|
|
29
|
+
console.log('$$$ [sectionAccountsViewEpic] non-zeni COA path — section:', sectionId, 'built', accountMetadataWithBalancesPayloads.length, 'sub-account payloads');
|
|
28
30
|
if (accountMetadataWithBalancesPayloads.length > 0) {
|
|
29
31
|
actions.push((0, accountReducer_1.updateMultipleSubAccountsWithBalances)(accountMetadataWithBalancesPayloads, currencyPayload, reportId, timeframe));
|
|
30
32
|
}
|
|
@@ -48,6 +50,7 @@ const updateSectionAccountsViewEpic = (actions$) => actions$.pipe((0, operators_
|
|
|
48
50
|
accountMetadataWithBalancesPayloads.push(...subAccounts);
|
|
49
51
|
}
|
|
50
52
|
});
|
|
53
|
+
console.log('$$$ [sectionAccountsViewEpic] zeni COA path — section:', sectionId, 'accountGroups:', accountGroupMetadataWithBalancesPayloads.length, 'subAccounts:', accountMetadataWithBalancesPayloads.length);
|
|
51
54
|
actions.push((0, accountGroupReducer_1.addAccountGroupsWithBalances)(timeframe, accountGroupMetadataWithBalancesPayloads, currencyPayload, sectionId, reportId));
|
|
52
55
|
actions.push((0, accountReducer_1.updateMultipleSubAccountsWithBalances)(accountMetadataWithBalancesPayloads, currencyPayload, reportId, timeframe));
|
|
53
56
|
}
|
|
@@ -31,6 +31,7 @@ const sectionAccountsView = (0, toolkit_1.createSlice)({
|
|
|
31
31
|
};
|
|
32
32
|
},
|
|
33
33
|
reducer(draft, action) {
|
|
34
|
+
console.log('$$$ [sectionAccountsViewReducer.updateSectionAccountsView] section:', action.payload.sectionId, 'reportId:', action.payload.reportId, 'timeframe:', action.payload.timeframe, 'sectionPayload:', action.payload.sectionPayload);
|
|
34
35
|
updateSection(draft, action.payload.timeframe, action.payload.sectionId, action.payload.reportId, action.payload.sectionPayload, action.payload.accountsMetadataPayload, action.payload.currencyPayload);
|
|
35
36
|
},
|
|
36
37
|
},
|
|
@@ -16,6 +16,7 @@ const sectionAccountsView_1 = require("./sectionAccountsView");
|
|
|
16
16
|
const getSectionAccountsViewReport = (accountState, accountGroupState, sectionState, id, filter, additionalBalancesOptions) => {
|
|
17
17
|
const sectionKey = (0, sectionAccountsView_1.getSectionAccountViewKey)(id.sectionId, id.reportId);
|
|
18
18
|
const sectionView = (0, get_1.default)(sectionState.sectionsByKey, sectionKey, undefined);
|
|
19
|
+
console.log('$$$ [getSectionAccountsViewReport] IN sectionId:', id.sectionId, 'reportId:', id.reportId, 'sectionKey:', sectionKey, 'sectionView:', sectionView);
|
|
19
20
|
const accountReports = [];
|
|
20
21
|
if (sectionView?.nestedAccountIds != null) {
|
|
21
22
|
sectionView.nestedAccountIds.forEach((nestedAccountId) => {
|
|
@@ -47,6 +48,7 @@ const getSectionAccountsViewReport = (accountState, accountGroupState, sectionSt
|
|
|
47
48
|
});
|
|
48
49
|
const sortedAccountGroupReports = (0, accountGroupV2Selector_1.sortAccountGroupReports)(accountGroupReports, filter);
|
|
49
50
|
const balances = (0, coaBalance_1.getCOABalances)(sectionView?.balancesByPeriod, filter, additionalBalancesOptions);
|
|
51
|
+
console.log('$$$ [getSectionAccountsViewReport] OUT sectionId:', id.sectionId, 'accountReports count:', sortedAccountReports.length, 'accountGroupReports count:', sortedAccountGroupReports.length);
|
|
50
52
|
return {
|
|
51
53
|
sectionId: id.sectionId,
|
|
52
54
|
reportId: id.reportId,
|
|
@@ -16,6 +16,7 @@ const updateSectionProjectViewEpic = (actions$) => actions$.pipe((0, operators_1
|
|
|
16
16
|
const accountsMetadataPayload = action.payload.accountsMetadataPayload;
|
|
17
17
|
const accountMetadataRecordsByID = (0, getNestedAccountIDHierarchyForReport_1.getAllAccountMetadataRecordsByID)(accountsMetadataPayload);
|
|
18
18
|
const accountMetadataWithBalancesPayloads = [];
|
|
19
|
+
console.log('$$$ [sectionProjectViewEpic] triggered for section:', sectionId, 'timeframe:', timeframe, 'projectIds:', sectionPayload.projects ? Object.keys(sectionPayload.projects) : 'null');
|
|
19
20
|
if (sectionPayload.projects != null) {
|
|
20
21
|
Object.keys(sectionPayload.projects).forEach((projectId) => {
|
|
21
22
|
const projectAccounts = sectionPayload.projects[projectId].accounts;
|
|
@@ -23,11 +24,14 @@ const updateSectionProjectViewEpic = (actions$) => actions$.pipe((0, operators_1
|
|
|
23
24
|
projectId,
|
|
24
25
|
sectionId,
|
|
25
26
|
};
|
|
27
|
+
console.log('$$$ [sectionProjectViewEpic] project', projectId, 'in section', sectionId, 'has account keys:', projectAccounts ? Object.keys(projectAccounts) : 'null');
|
|
26
28
|
getSubAccountsMetadataForProjectAccountList(projectAccounts, accountMetadataRecordsByID, sectionId, projectsViewParentID, accountMetadataWithBalancesPayloads);
|
|
27
29
|
});
|
|
28
30
|
}
|
|
31
|
+
console.log('$$$ [sectionProjectViewEpic] built', accountMetadataWithBalancesPayloads.length, 'accountMetadataWithBalancesPayloads for section', sectionId, accountMetadataWithBalancesPayloads);
|
|
29
32
|
if (accountMetadataWithBalancesPayloads.length > 0) {
|
|
30
33
|
actions.push((0, accountReducer_1.updateMultipleSubAccountsWithBalances)(accountMetadataWithBalancesPayloads, currencyPayload, reportId, timeframe));
|
|
34
|
+
console.log('$$$ [sectionProjectViewEpic] dispatching updateMultipleSubAccountsWithBalances for section', sectionId);
|
|
31
35
|
}
|
|
32
36
|
return (0, rxjs_1.from)(actions);
|
|
33
37
|
}));
|
|
@@ -28,6 +28,7 @@ const sectionProjectView = (0, toolkit_1.createSlice)({
|
|
|
28
28
|
},
|
|
29
29
|
reducer(draft, action) {
|
|
30
30
|
const { timeframe, sectionPayload, sectionId, reportId, currencyPayload } = action.payload;
|
|
31
|
+
console.log('$$$ [sectionProjectViewReducer.updateSectionProjectView] section:', sectionId, 'timeframe:', timeframe, 'reportId:', reportId, 'projectsInPayload:', sectionPayload.projects ? Object.keys(sectionPayload.projects) : 'null', 'fullPayload:', sectionPayload);
|
|
31
32
|
if (sectionPayload.projects != null) {
|
|
32
33
|
Object.keys(sectionPayload.projects).forEach((projectId) => {
|
|
33
34
|
const projectPayload = sectionPayload.projects[projectId];
|
|
@@ -46,6 +47,7 @@ exports.default = sectionProjectView.reducer;
|
|
|
46
47
|
const updateSectionProject = (draft, timeframe, projectPayload, sectionId, projectId, reportId, currencyPayload) => {
|
|
47
48
|
const sectionKey = (0, sectionProjectView_1.getSectionProjectViewKey)(sectionId, projectId, reportId);
|
|
48
49
|
const section = draft.sectionsByKey[sectionKey];
|
|
50
|
+
console.log('$$$ Updating section project view for section key:', sectionKey, 'with payload:', projectPayload);
|
|
49
51
|
if (section != null) {
|
|
50
52
|
draft.sectionsByKey[sectionKey].balancesByPeriod = Object.assign({}, draft.sectionsByKey[sectionKey].balancesByPeriod, (0, coaBalancePayload_1.mapCOABalanceGroupedByPeriodPayloadV2ToCOABalanceGroupedByPeriod)(projectPayload, currencyPayload, timeframe));
|
|
51
53
|
}
|
|
@@ -15,9 +15,11 @@ const getNestedAccountIDHierarchyForSection_1 = require("../sectionAccountsView/
|
|
|
15
15
|
const sectionProjectView_1 = require("./sectionProjectView");
|
|
16
16
|
const getSectionProjectViewReport = (accountState, projectState, sectionState, projectIds, id, filter) => {
|
|
17
17
|
const projectIdsToShow = projectIds.filter((projectId) => !filter.projectsToFilterOut.includes(projectId));
|
|
18
|
+
console.log('$$$ [getSectionProjectViewReport] IN section:', id.sectionId, 'reportId:', id.reportId, 'projectIds:', projectIds, 'projectIdsToShow:', projectIdsToShow);
|
|
18
19
|
const projectReports = [];
|
|
19
20
|
const sectionBalancesTotalByPeriodArray = [];
|
|
20
21
|
const accountsByProject = getAccountsByProject(accountState, id.sectionId, id.reportId);
|
|
22
|
+
console.log('$$$ [getSectionProjectViewReport] accountsByProject for section', id.sectionId, ':', accountsByProject);
|
|
21
23
|
projectIdsToShow.forEach((projectId) => {
|
|
22
24
|
const project = (0, projectSelector_1.getProjectById)(projectState, projectId);
|
|
23
25
|
if (project == null) {
|
|
@@ -70,6 +72,7 @@ const getSectionProjectViewReport = (accountState, projectState, sectionState, p
|
|
|
70
72
|
sectionBalancesTotalByPeriodArray.push(projectBalancesTotalByPeriod);
|
|
71
73
|
});
|
|
72
74
|
const sectionBalancesTotalByPeriod = (0, getSumOfBalancesGroupedByPeriod_1.getSumOfBalancesByGroupedByPeriod)(sectionBalancesTotalByPeriodArray) ?? {};
|
|
75
|
+
console.log('$$$ [getSectionProjectViewReport] OUT section:', id.sectionId, 'projectReports count:', projectReports.length, 'projectReports:', projectReports);
|
|
73
76
|
return {
|
|
74
77
|
projects: projectReports,
|
|
75
78
|
...(0, coaBalance_1.getCOABalances)(sectionBalancesTotalByPeriod, filter),
|
|
@@ -51,11 +51,7 @@ export declare const updateTenants: import("@reduxjs/toolkit").ActionCreatorWith
|
|
|
51
51
|
accountLockTime?: string;
|
|
52
52
|
accountUnlockTime?: string;
|
|
53
53
|
isAccountLocked?: boolean;
|
|
54
|
-
}, "tenant/sendEmailMagicLinkToUserFailure">, updateSignInState: import("@reduxjs/toolkit").ActionCreatorWithPayload<FetchState, "tenant/updateSignInState">, doSignOut: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"tenant/doSignOut">, signOutSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"tenant/signOutSuccess">,
|
|
55
|
-
expiresAt: string;
|
|
56
|
-
}, "tenant/sessionHeartbeatSuccess", never, never>, sessionHeartbeatFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], {
|
|
57
|
-
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
58
|
-
}, "tenant/sessionHeartbeatFailure", never, never>, updateLoggedInUser: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[userPayload: LoggedInUserPayload, zeniSessionId: string, authProvider: AuthProvider], {
|
|
54
|
+
}, "tenant/sendEmailMagicLinkToUserFailure">, updateSignInState: import("@reduxjs/toolkit").ActionCreatorWithPayload<FetchState, "tenant/updateSignInState">, doSignOut: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"tenant/doSignOut">, signOutSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"tenant/signOutSuccess">, updateLoggedInUser: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[userPayload: LoggedInUserPayload, zeniSessionId: string, authProvider: AuthProvider], {
|
|
59
55
|
userPayload: LoggedInUserPayload;
|
|
60
56
|
zeniSessionId: string;
|
|
61
57
|
authProvider: AuthProvider;
|
|
@@ -4,8 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
var _a;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.resendVerifyDeviceOTPSuccess = exports.resendVerifyDeviceOTP = exports.verifyDeviceWithTwoFAFailure = exports.verifyDeviceWithTwoFASuccess = exports.verifyDeviceWithTwoFA = exports.updateTenantMasterTOSInfo = exports.updateTenantAccountingClassesEnabled = exports.trigger2FA = exports.resetSignInState = exports.updateTreasuryVideoViewedForLoggedInUser = exports.updateReferViewedForLoggedInUser = exports.updateTenantReimbursementInfo = exports.removeOnboardingTenant = exports.updateOnboardingTenants = exports.updateSubscriptionSummaryForTenantFailure = exports.updateSubscriptionSummaryForTenantSuccess = exports.fetchSubscriptionSummaryForTenant = exports.clearAll = exports.fetchExternalConnectionsSuccess = exports.fetchExternalConnectionsFailure = exports.saveExternalConnectionFailure = exports.saveExternalConnectionSuccess = exports.saveExternalConnection = exports.fetchExternalConnections = exports.updateLoggedInUser = exports.
|
|
8
|
-
exports.toConnection = exports.toRoleResource = exports.resendVerifyDeviceOTPFailure = void 0;
|
|
7
|
+
exports.toConnection = exports.toRoleResource = exports.resendVerifyDeviceOTPFailure = exports.resendVerifyDeviceOTPSuccess = exports.resendVerifyDeviceOTP = exports.verifyDeviceWithTwoFAFailure = exports.verifyDeviceWithTwoFASuccess = exports.verifyDeviceWithTwoFA = exports.updateTenantMasterTOSInfo = exports.updateTenantAccountingClassesEnabled = exports.trigger2FA = exports.resetSignInState = exports.updateTreasuryVideoViewedForLoggedInUser = exports.updateReferViewedForLoggedInUser = exports.updateTenantReimbursementInfo = exports.removeOnboardingTenant = exports.updateOnboardingTenants = exports.updateSubscriptionSummaryForTenantFailure = exports.updateSubscriptionSummaryForTenantSuccess = exports.fetchSubscriptionSummaryForTenant = exports.clearAll = exports.fetchExternalConnectionsSuccess = exports.fetchExternalConnectionsFailure = exports.saveExternalConnectionFailure = exports.saveExternalConnectionSuccess = exports.saveExternalConnection = exports.fetchExternalConnections = exports.updateLoggedInUser = exports.signOutSuccess = exports.doSignOut = exports.updateSignInState = exports.sendEmailMagicLinkToUserFailure = exports.sendEmailMagicLinkToUserSuccess = exports.sendEmailMagicLinkToUser = exports.magicLinkSignInFailure = exports.magicLinkSignInSuccess = exports.doMagicLinkSignIn = exports.doSignIn = exports.updateExcludedResourcesFailure = exports.updateExcludedResourcesSuccess = exports.fetchExcludedResources = exports.updateCurrentTenant = exports.updateTenantFailure = exports.updateTenantSuccess = exports.fetchActiveTenant = exports.updateTenantsFailure = exports.updateTenantsSuccess = exports.fetchAllTenants = exports.updateTenants = exports.initialState = void 0;
|
|
9
8
|
exports.mapConnectionsPayloadToState = mapConnectionsPayloadToState;
|
|
10
9
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
11
10
|
const js_base64_1 = require("js-base64");
|
|
@@ -437,26 +436,6 @@ const tenant = (0, toolkit_1.createSlice)({
|
|
|
437
436
|
signOutSuccess(draft) {
|
|
438
437
|
draft.loggedInUser = undefined;
|
|
439
438
|
draft.currentTenantId = undefined;
|
|
440
|
-
draft.sessionExpiresAt = undefined;
|
|
441
|
-
},
|
|
442
|
-
sendSessionHeartbeat() {
|
|
443
|
-
// No state change needed — epic handles the API call
|
|
444
|
-
},
|
|
445
|
-
sessionHeartbeatSuccess: {
|
|
446
|
-
prepare(expiresAt) {
|
|
447
|
-
return { payload: { expiresAt } };
|
|
448
|
-
},
|
|
449
|
-
reducer(draft, action) {
|
|
450
|
-
draft.sessionExpiresAt = action.payload.expiresAt;
|
|
451
|
-
},
|
|
452
|
-
},
|
|
453
|
-
sessionHeartbeatFailure: {
|
|
454
|
-
prepare(error) {
|
|
455
|
-
return { payload: { error } };
|
|
456
|
-
},
|
|
457
|
-
reducer(draft, action) {
|
|
458
|
-
draft.error = action.payload.error;
|
|
459
|
-
},
|
|
460
439
|
},
|
|
461
440
|
fetchSubscriptionSummaryForTenant: {
|
|
462
441
|
prepare(tenantId) {
|
|
@@ -564,7 +543,7 @@ const tenant = (0, toolkit_1.createSlice)({
|
|
|
564
543
|
},
|
|
565
544
|
},
|
|
566
545
|
});
|
|
567
|
-
_a = tenant.actions, exports.updateTenants = _a.updateTenants, exports.fetchAllTenants = _a.fetchAllTenants, exports.updateTenantsSuccess = _a.updateTenantsSuccess, exports.updateTenantsFailure = _a.updateTenantsFailure, exports.fetchActiveTenant = _a.fetchActiveTenant, exports.updateTenantSuccess = _a.updateTenantSuccess, exports.updateTenantFailure = _a.updateTenantFailure, exports.updateCurrentTenant = _a.updateCurrentTenant, exports.fetchExcludedResources = _a.fetchExcludedResources, exports.updateExcludedResourcesSuccess = _a.updateExcludedResourcesSuccess, exports.updateExcludedResourcesFailure = _a.updateExcludedResourcesFailure, exports.doSignIn = _a.doSignIn, exports.doMagicLinkSignIn = _a.doMagicLinkSignIn, exports.magicLinkSignInSuccess = _a.magicLinkSignInSuccess, exports.magicLinkSignInFailure = _a.magicLinkSignInFailure, exports.sendEmailMagicLinkToUser = _a.sendEmailMagicLinkToUser, exports.sendEmailMagicLinkToUserSuccess = _a.sendEmailMagicLinkToUserSuccess, exports.sendEmailMagicLinkToUserFailure = _a.sendEmailMagicLinkToUserFailure, exports.updateSignInState = _a.updateSignInState, exports.doSignOut = _a.doSignOut, exports.signOutSuccess = _a.signOutSuccess, exports.
|
|
546
|
+
_a = tenant.actions, exports.updateTenants = _a.updateTenants, exports.fetchAllTenants = _a.fetchAllTenants, exports.updateTenantsSuccess = _a.updateTenantsSuccess, exports.updateTenantsFailure = _a.updateTenantsFailure, exports.fetchActiveTenant = _a.fetchActiveTenant, exports.updateTenantSuccess = _a.updateTenantSuccess, exports.updateTenantFailure = _a.updateTenantFailure, exports.updateCurrentTenant = _a.updateCurrentTenant, exports.fetchExcludedResources = _a.fetchExcludedResources, exports.updateExcludedResourcesSuccess = _a.updateExcludedResourcesSuccess, exports.updateExcludedResourcesFailure = _a.updateExcludedResourcesFailure, exports.doSignIn = _a.doSignIn, exports.doMagicLinkSignIn = _a.doMagicLinkSignIn, exports.magicLinkSignInSuccess = _a.magicLinkSignInSuccess, exports.magicLinkSignInFailure = _a.magicLinkSignInFailure, exports.sendEmailMagicLinkToUser = _a.sendEmailMagicLinkToUser, exports.sendEmailMagicLinkToUserSuccess = _a.sendEmailMagicLinkToUserSuccess, exports.sendEmailMagicLinkToUserFailure = _a.sendEmailMagicLinkToUserFailure, exports.updateSignInState = _a.updateSignInState, exports.doSignOut = _a.doSignOut, exports.signOutSuccess = _a.signOutSuccess, exports.updateLoggedInUser = _a.updateLoggedInUser, exports.fetchExternalConnections = _a.fetchExternalConnections, exports.saveExternalConnection = _a.saveExternalConnection, exports.saveExternalConnectionSuccess = _a.saveExternalConnectionSuccess, exports.saveExternalConnectionFailure = _a.saveExternalConnectionFailure, exports.fetchExternalConnectionsFailure = _a.fetchExternalConnectionsFailure, exports.fetchExternalConnectionsSuccess = _a.fetchExternalConnectionsSuccess, exports.clearAll = _a.clearAll, exports.fetchSubscriptionSummaryForTenant = _a.fetchSubscriptionSummaryForTenant, exports.updateSubscriptionSummaryForTenantSuccess = _a.updateSubscriptionSummaryForTenantSuccess, exports.updateSubscriptionSummaryForTenantFailure = _a.updateSubscriptionSummaryForTenantFailure, exports.updateOnboardingTenants = _a.updateOnboardingTenants, exports.removeOnboardingTenant = _a.removeOnboardingTenant, exports.updateTenantReimbursementInfo = _a.updateTenantReimbursementInfo, exports.updateReferViewedForLoggedInUser = _a.updateReferViewedForLoggedInUser, exports.updateTreasuryVideoViewedForLoggedInUser = _a.updateTreasuryVideoViewedForLoggedInUser, exports.resetSignInState = _a.resetSignInState, exports.trigger2FA = _a.trigger2FA, exports.updateTenantAccountingClassesEnabled = _a.updateTenantAccountingClassesEnabled, exports.updateTenantMasterTOSInfo = _a.updateTenantMasterTOSInfo, exports.verifyDeviceWithTwoFA = _a.verifyDeviceWithTwoFA, exports.verifyDeviceWithTwoFASuccess = _a.verifyDeviceWithTwoFASuccess, exports.verifyDeviceWithTwoFAFailure = _a.verifyDeviceWithTwoFAFailure, exports.resendVerifyDeviceOTP = _a.resendVerifyDeviceOTP, exports.resendVerifyDeviceOTPSuccess = _a.resendVerifyDeviceOTPSuccess, exports.resendVerifyDeviceOTPFailure = _a.resendVerifyDeviceOTPFailure;
|
|
568
547
|
exports.default = tenant.reducer;
|
|
569
548
|
/**
|
|
570
549
|
* Converts tenants payload to Tenant and User State
|
package/lib/esm/coreEpics.js
CHANGED
|
@@ -22,7 +22,6 @@ import { resendVerifyDeviceOTPEpic } from './entity/tenant/epic/resendVerifyDevi
|
|
|
22
22
|
import { saveExternalConnectionEpic } from './entity/tenant/epic/saveExternalConnectionEpic';
|
|
23
23
|
import { sendEmailMagicLinkToUserEpic } from './entity/tenant/epic/sendEmailMagicLinkToUserEpic';
|
|
24
24
|
import { doSignInEpic } from './entity/tenant/epic/signInUserEpic';
|
|
25
|
-
import { sessionHeartbeatEpic } from './entity/tenant/epic/sessionHeartbeatEpic';
|
|
26
25
|
import { doSignOutEpic } from './entity/tenant/epic/signOutUserEpic';
|
|
27
26
|
import { verifyDeviceWithTwoFAEpic } from './entity/tenant/epic/verifyDeviceWithTwoFAEpic';
|
|
28
27
|
// ── Toast Notification Epic ──────────────────────────────────────────
|
|
@@ -47,7 +46,7 @@ import { verifyOtpEpic } from './view/twoFactorAuthentication/verifyOtpEpic';
|
|
|
47
46
|
// RootActionType is only available in the dynamically imported epic.ts.
|
|
48
47
|
const coreRootEpic = combineEpics(
|
|
49
48
|
// Auth & tenant
|
|
50
|
-
clearAllEpic, doMagicLinkSignInEpic, doSignInEpic, doSignOutEpic,
|
|
49
|
+
clearAllEpic, doMagicLinkSignInEpic, doSignInEpic, doSignOutEpic, fetchActiveTenantEpic, fetchAllTenantsEpic, fetchExcludedResourcesEpic, fetchExternalConnectionsEpic, fetchSubscriptionSummaryForTenantEpic, resendVerifyDeviceOTPEpic, saveExternalConnectionEpic, sendEmailMagicLinkToUserEpic, verifyDeviceWithTwoFAEpic,
|
|
51
50
|
// Toast
|
|
52
51
|
pushToastNotificationEpic,
|
|
53
52
|
// Collaboration
|
|
@@ -15,6 +15,7 @@ const account = createSlice({
|
|
|
15
15
|
reducers: {
|
|
16
16
|
updateAccounts: {
|
|
17
17
|
reducer(draft, action) {
|
|
18
|
+
console.log('$$$ [accountReducer.updateAccounts] reportId:', action.meta.reportId, 'updateType:', action.meta.updateType, 'classesViewParentId:', action.meta.classesViewParentId, 'count:', action.payload.length);
|
|
18
19
|
doUpdateAccounts(draft.accountsByKey, action.payload, action.meta.reportId, action.meta.classesViewParentId, action.meta.updateType);
|
|
19
20
|
},
|
|
20
21
|
prepare(payload, reportId, classesViewParentId, updateType = 'merge') {
|
|
@@ -26,6 +27,7 @@ const account = createSlice({
|
|
|
26
27
|
},
|
|
27
28
|
updateMultipleSubAccountsWithBalances: {
|
|
28
29
|
reducer(draft, action) {
|
|
30
|
+
console.log('$$$ [accountReducer.updateMultipleSubAccountsWithBalances] reportId:', action.payload.reportId, 'timeframe:', action.payload.timeframe, 'updateType:', action.payload.updateType, 'count:', action.payload.subAccountWithBalancesListPayloads.length, 'payloads:', action.payload.subAccountWithBalancesListPayloads);
|
|
29
31
|
doUpdateSubAccountsWithBalances(draft.accountsByKey, action.payload.subAccountWithBalancesListPayloads, action.payload.currencyPayload, action.payload.reportId, action.payload.timeframe, action.payload.updateType);
|
|
30
32
|
},
|
|
31
33
|
prepare(subAccountWithBalancesListPayloads, currencyPayload, reportId, timeframe, updateType = 'merge') {
|
|
@@ -89,6 +91,7 @@ function doUpdateSubAccountsWithBalances(draft, subAccountWithBalancesListPayloa
|
|
|
89
91
|
}
|
|
90
92
|
function doUpdateAccountWithBalancesV2(draft, accountBasePayload, accountBalancesPayload, currencyPayload, reportId, timeframe, classesViewParentId, accountsViewParentId, projectsViewParentId, updateType) {
|
|
91
93
|
const key = getAccountKey(reportId, accountBasePayload.account_id, classesViewParentId, accountsViewParentId, projectsViewParentId);
|
|
94
|
+
console.log('$$$ [accountReducer.doUpdateAccountWithBalancesV2] key:', key, 'accountId:', accountBasePayload.account_id, 'projectsViewParentId:', projectsViewParentId, 'accountsViewParentId:', accountsViewParentId, 'classesViewParentId:', classesViewParentId);
|
|
92
95
|
const balancesByPeriod = mapCOABalanceGroupedByPeriodPayloadV2ToCOABalanceGroupedByPeriod(accountBalancesPayload, currencyPayload, timeframe);
|
|
93
96
|
if (key in draft && updateType === 'merge') {
|
|
94
97
|
// only add balances
|
|
@@ -9,9 +9,11 @@ const projectSlice = createSlice({
|
|
|
9
9
|
reducers: {
|
|
10
10
|
updateProjects: {
|
|
11
11
|
reducer(draft, action) {
|
|
12
|
+
console.log('$$$ [projectReducer.updateProjects] payload count:', action.payload.length, 'payload:', action.payload);
|
|
12
13
|
action.payload.forEach((projectPayload) => {
|
|
13
14
|
const project = mapProjectMetadataPayloadToProject(projectPayload);
|
|
14
15
|
draft.projects[project.projectId] = project;
|
|
16
|
+
console.log('$$$ [projectReducer.updateProjects] stored project', project.projectId, project);
|
|
15
17
|
});
|
|
16
18
|
},
|
|
17
19
|
prepare(payload) {
|
|
@@ -18,10 +18,12 @@ export const updateSectionAccountsViewEpic = (actions$) => actions$.pipe(filter(
|
|
|
18
18
|
const currencyPayload = action.payload.currencyPayload;
|
|
19
19
|
const accountsMetadata = accountsMetadataPayload.map((eachAccount) => mapAccountMetadataPayloadToAccountMetadata(eachAccount));
|
|
20
20
|
const accountMetadataRecordsByID = getAllAccountMetadataRecordsByID(accountsMetadataPayload);
|
|
21
|
+
console.log('$$$ [sectionAccountsViewEpic] triggered for section:', sectionId, 'reportId:', reportId, 'hasAccounts:', sectionPayload.accounts != null, 'hasAccountGroups:', sectionPayload.account_groups != null);
|
|
21
22
|
// This would mean a non-zeni COA
|
|
22
23
|
if (sectionPayload.accounts != null) {
|
|
23
24
|
const accounts = sectionPayload.accounts;
|
|
24
25
|
const accountMetadataWithBalancesPayloads = getSubAccountsMetadataForAccountList(accounts, accountMetadataRecordsByID, sectionId);
|
|
26
|
+
console.log('$$$ [sectionAccountsViewEpic] non-zeni COA path — section:', sectionId, 'built', accountMetadataWithBalancesPayloads.length, 'sub-account payloads');
|
|
25
27
|
if (accountMetadataWithBalancesPayloads.length > 0) {
|
|
26
28
|
actions.push(updateMultipleSubAccountsWithBalances(accountMetadataWithBalancesPayloads, currencyPayload, reportId, timeframe));
|
|
27
29
|
}
|
|
@@ -45,6 +47,7 @@ export const updateSectionAccountsViewEpic = (actions$) => actions$.pipe(filter(
|
|
|
45
47
|
accountMetadataWithBalancesPayloads.push(...subAccounts);
|
|
46
48
|
}
|
|
47
49
|
});
|
|
50
|
+
console.log('$$$ [sectionAccountsViewEpic] zeni COA path — section:', sectionId, 'accountGroups:', accountGroupMetadataWithBalancesPayloads.length, 'subAccounts:', accountMetadataWithBalancesPayloads.length);
|
|
48
51
|
actions.push(addAccountGroupsWithBalances(timeframe, accountGroupMetadataWithBalancesPayloads, currencyPayload, sectionId, reportId));
|
|
49
52
|
actions.push(updateMultipleSubAccountsWithBalances(accountMetadataWithBalancesPayloads, currencyPayload, reportId, timeframe));
|
|
50
53
|
}
|
|
@@ -27,6 +27,7 @@ const sectionAccountsView = createSlice({
|
|
|
27
27
|
};
|
|
28
28
|
},
|
|
29
29
|
reducer(draft, action) {
|
|
30
|
+
console.log('$$$ [sectionAccountsViewReducer.updateSectionAccountsView] section:', action.payload.sectionId, 'reportId:', action.payload.reportId, 'timeframe:', action.payload.timeframe, 'sectionPayload:', action.payload.sectionPayload);
|
|
30
31
|
updateSection(draft, action.payload.timeframe, action.payload.sectionId, action.payload.reportId, action.payload.sectionPayload, action.payload.accountsMetadataPayload, action.payload.currencyPayload);
|
|
31
32
|
},
|
|
32
33
|
},
|
|
@@ -9,6 +9,7 @@ import { getSectionAccountViewKey } from './sectionAccountsView';
|
|
|
9
9
|
export const getSectionAccountsViewReport = (accountState, accountGroupState, sectionState, id, filter, additionalBalancesOptions) => {
|
|
10
10
|
const sectionKey = getSectionAccountViewKey(id.sectionId, id.reportId);
|
|
11
11
|
const sectionView = recordGet(sectionState.sectionsByKey, sectionKey, undefined);
|
|
12
|
+
console.log('$$$ [getSectionAccountsViewReport] IN sectionId:', id.sectionId, 'reportId:', id.reportId, 'sectionKey:', sectionKey, 'sectionView:', sectionView);
|
|
12
13
|
const accountReports = [];
|
|
13
14
|
if (sectionView?.nestedAccountIds != null) {
|
|
14
15
|
sectionView.nestedAccountIds.forEach((nestedAccountId) => {
|
|
@@ -40,6 +41,7 @@ export const getSectionAccountsViewReport = (accountState, accountGroupState, se
|
|
|
40
41
|
});
|
|
41
42
|
const sortedAccountGroupReports = sortAccountGroupReports(accountGroupReports, filter);
|
|
42
43
|
const balances = getCOABalances(sectionView?.balancesByPeriod, filter, additionalBalancesOptions);
|
|
44
|
+
console.log('$$$ [getSectionAccountsViewReport] OUT sectionId:', id.sectionId, 'accountReports count:', sortedAccountReports.length, 'accountGroupReports count:', sortedAccountGroupReports.length);
|
|
43
45
|
return {
|
|
44
46
|
sectionId: id.sectionId,
|
|
45
47
|
reportId: id.reportId,
|
|
@@ -13,6 +13,7 @@ export const updateSectionProjectViewEpic = (actions$) => actions$.pipe(filter(u
|
|
|
13
13
|
const accountsMetadataPayload = action.payload.accountsMetadataPayload;
|
|
14
14
|
const accountMetadataRecordsByID = getAllAccountMetadataRecordsByID(accountsMetadataPayload);
|
|
15
15
|
const accountMetadataWithBalancesPayloads = [];
|
|
16
|
+
console.log('$$$ [sectionProjectViewEpic] triggered for section:', sectionId, 'timeframe:', timeframe, 'projectIds:', sectionPayload.projects ? Object.keys(sectionPayload.projects) : 'null');
|
|
16
17
|
if (sectionPayload.projects != null) {
|
|
17
18
|
Object.keys(sectionPayload.projects).forEach((projectId) => {
|
|
18
19
|
const projectAccounts = sectionPayload.projects[projectId].accounts;
|
|
@@ -20,11 +21,14 @@ export const updateSectionProjectViewEpic = (actions$) => actions$.pipe(filter(u
|
|
|
20
21
|
projectId,
|
|
21
22
|
sectionId,
|
|
22
23
|
};
|
|
24
|
+
console.log('$$$ [sectionProjectViewEpic] project', projectId, 'in section', sectionId, 'has account keys:', projectAccounts ? Object.keys(projectAccounts) : 'null');
|
|
23
25
|
getSubAccountsMetadataForProjectAccountList(projectAccounts, accountMetadataRecordsByID, sectionId, projectsViewParentID, accountMetadataWithBalancesPayloads);
|
|
24
26
|
});
|
|
25
27
|
}
|
|
28
|
+
console.log('$$$ [sectionProjectViewEpic] built', accountMetadataWithBalancesPayloads.length, 'accountMetadataWithBalancesPayloads for section', sectionId, accountMetadataWithBalancesPayloads);
|
|
26
29
|
if (accountMetadataWithBalancesPayloads.length > 0) {
|
|
27
30
|
actions.push(updateMultipleSubAccountsWithBalances(accountMetadataWithBalancesPayloads, currencyPayload, reportId, timeframe));
|
|
31
|
+
console.log('$$$ [sectionProjectViewEpic] dispatching updateMultipleSubAccountsWithBalances for section', sectionId);
|
|
28
32
|
}
|
|
29
33
|
return from(actions);
|
|
30
34
|
}));
|
|
@@ -24,6 +24,7 @@ const sectionProjectView = createSlice({
|
|
|
24
24
|
},
|
|
25
25
|
reducer(draft, action) {
|
|
26
26
|
const { timeframe, sectionPayload, sectionId, reportId, currencyPayload } = action.payload;
|
|
27
|
+
console.log('$$$ [sectionProjectViewReducer.updateSectionProjectView] section:', sectionId, 'timeframe:', timeframe, 'reportId:', reportId, 'projectsInPayload:', sectionPayload.projects ? Object.keys(sectionPayload.projects) : 'null', 'fullPayload:', sectionPayload);
|
|
27
28
|
if (sectionPayload.projects != null) {
|
|
28
29
|
Object.keys(sectionPayload.projects).forEach((projectId) => {
|
|
29
30
|
const projectPayload = sectionPayload.projects[projectId];
|
|
@@ -42,6 +43,7 @@ export default sectionProjectView.reducer;
|
|
|
42
43
|
const updateSectionProject = (draft, timeframe, projectPayload, sectionId, projectId, reportId, currencyPayload) => {
|
|
43
44
|
const sectionKey = getSectionProjectViewKey(sectionId, projectId, reportId);
|
|
44
45
|
const section = draft.sectionsByKey[sectionKey];
|
|
46
|
+
console.log('$$$ Updating section project view for section key:', sectionKey, 'with payload:', projectPayload);
|
|
45
47
|
if (section != null) {
|
|
46
48
|
draft.sectionsByKey[sectionKey].balancesByPeriod = Object.assign({}, draft.sectionsByKey[sectionKey].balancesByPeriod, mapCOABalanceGroupedByPeriodPayloadV2ToCOABalanceGroupedByPeriod(projectPayload, currencyPayload, timeframe));
|
|
47
49
|
}
|
|
@@ -9,9 +9,11 @@ import { getNestedAccountIDHierarchyForAccounts } from '../sectionAccountsView/g
|
|
|
9
9
|
import { getSectionProjectViewKey } from './sectionProjectView';
|
|
10
10
|
export const getSectionProjectViewReport = (accountState, projectState, sectionState, projectIds, id, filter) => {
|
|
11
11
|
const projectIdsToShow = projectIds.filter((projectId) => !filter.projectsToFilterOut.includes(projectId));
|
|
12
|
+
console.log('$$$ [getSectionProjectViewReport] IN section:', id.sectionId, 'reportId:', id.reportId, 'projectIds:', projectIds, 'projectIdsToShow:', projectIdsToShow);
|
|
12
13
|
const projectReports = [];
|
|
13
14
|
const sectionBalancesTotalByPeriodArray = [];
|
|
14
15
|
const accountsByProject = getAccountsByProject(accountState, id.sectionId, id.reportId);
|
|
16
|
+
console.log('$$$ [getSectionProjectViewReport] accountsByProject for section', id.sectionId, ':', accountsByProject);
|
|
15
17
|
projectIdsToShow.forEach((projectId) => {
|
|
16
18
|
const project = getProjectById(projectState, projectId);
|
|
17
19
|
if (project == null) {
|
|
@@ -64,6 +66,7 @@ export const getSectionProjectViewReport = (accountState, projectState, sectionS
|
|
|
64
66
|
sectionBalancesTotalByPeriodArray.push(projectBalancesTotalByPeriod);
|
|
65
67
|
});
|
|
66
68
|
const sectionBalancesTotalByPeriod = getSumOfBalancesByGroupedByPeriod(sectionBalancesTotalByPeriodArray) ?? {};
|
|
69
|
+
console.log('$$$ [getSectionProjectViewReport] OUT section:', id.sectionId, 'projectReports count:', projectReports.length, 'projectReports:', projectReports);
|
|
67
70
|
return {
|
|
68
71
|
projects: projectReports,
|
|
69
72
|
...getCOABalances(sectionBalancesTotalByPeriod, filter),
|
|
@@ -428,26 +428,6 @@ const tenant = createSlice({
|
|
|
428
428
|
signOutSuccess(draft) {
|
|
429
429
|
draft.loggedInUser = undefined;
|
|
430
430
|
draft.currentTenantId = undefined;
|
|
431
|
-
draft.sessionExpiresAt = undefined;
|
|
432
|
-
},
|
|
433
|
-
sendSessionHeartbeat() {
|
|
434
|
-
// No state change needed — epic handles the API call
|
|
435
|
-
},
|
|
436
|
-
sessionHeartbeatSuccess: {
|
|
437
|
-
prepare(expiresAt) {
|
|
438
|
-
return { payload: { expiresAt } };
|
|
439
|
-
},
|
|
440
|
-
reducer(draft, action) {
|
|
441
|
-
draft.sessionExpiresAt = action.payload.expiresAt;
|
|
442
|
-
},
|
|
443
|
-
},
|
|
444
|
-
sessionHeartbeatFailure: {
|
|
445
|
-
prepare(error) {
|
|
446
|
-
return { payload: { error } };
|
|
447
|
-
},
|
|
448
|
-
reducer(draft, action) {
|
|
449
|
-
draft.error = action.payload.error;
|
|
450
|
-
},
|
|
451
431
|
},
|
|
452
432
|
fetchSubscriptionSummaryForTenant: {
|
|
453
433
|
prepare(tenantId) {
|
|
@@ -555,7 +535,7 @@ const tenant = createSlice({
|
|
|
555
535
|
},
|
|
556
536
|
},
|
|
557
537
|
});
|
|
558
|
-
export const { updateTenants, fetchAllTenants, updateTenantsSuccess, updateTenantsFailure, fetchActiveTenant, updateTenantSuccess, updateTenantFailure, updateCurrentTenant, fetchExcludedResources, updateExcludedResourcesSuccess, updateExcludedResourcesFailure, doSignIn, doMagicLinkSignIn, magicLinkSignInSuccess, magicLinkSignInFailure, sendEmailMagicLinkToUser, sendEmailMagicLinkToUserSuccess, sendEmailMagicLinkToUserFailure, updateSignInState, doSignOut, signOutSuccess,
|
|
538
|
+
export const { updateTenants, fetchAllTenants, updateTenantsSuccess, updateTenantsFailure, fetchActiveTenant, updateTenantSuccess, updateTenantFailure, updateCurrentTenant, fetchExcludedResources, updateExcludedResourcesSuccess, updateExcludedResourcesFailure, doSignIn, doMagicLinkSignIn, magicLinkSignInSuccess, magicLinkSignInFailure, sendEmailMagicLinkToUser, sendEmailMagicLinkToUserSuccess, sendEmailMagicLinkToUserFailure, updateSignInState, doSignOut, signOutSuccess, updateLoggedInUser, fetchExternalConnections, saveExternalConnection, saveExternalConnectionSuccess, saveExternalConnectionFailure, fetchExternalConnectionsFailure, fetchExternalConnectionsSuccess, clearAll, fetchSubscriptionSummaryForTenant, updateSubscriptionSummaryForTenantSuccess, updateSubscriptionSummaryForTenantFailure, updateOnboardingTenants, removeOnboardingTenant, updateTenantReimbursementInfo, updateReferViewedForLoggedInUser, updateTreasuryVideoViewedForLoggedInUser, resetSignInState, trigger2FA, updateTenantAccountingClassesEnabled, updateTenantMasterTOSInfo, verifyDeviceWithTwoFA, verifyDeviceWithTwoFASuccess, verifyDeviceWithTwoFAFailure, resendVerifyDeviceOTP, resendVerifyDeviceOTPSuccess, resendVerifyDeviceOTPFailure, } = tenant.actions;
|
|
559
539
|
export default tenant.reducer;
|
|
560
540
|
/**
|
|
561
541
|
* Converts tenants payload to Tenant and User State
|
package/lib/esm/index.js
CHANGED
|
@@ -59,7 +59,7 @@ import { closeSnackbar, openSnackbar } from './entity/snackbar/snackbarReducer';
|
|
|
59
59
|
import { getSnackbar } from './entity/snackbar/snackbarSelector';
|
|
60
60
|
import { toPriorityCodeType, toTaskStatusCodeType, } from './entity/task/taskState';
|
|
61
61
|
import { getTaskGroupById } from './entity/taskGroup/taskGroupSelector';
|
|
62
|
-
import { clearAll, doMagicLinkSignIn, doSignIn, doSignOut,
|
|
62
|
+
import { clearAll, doMagicLinkSignIn, doSignIn, doSignOut, fetchActiveTenant, fetchAllTenants, fetchExcludedResources as fetchExcludedResourcesForTenant, fetchExternalConnections as fetchExternalConnectionsForTenant, fetchSubscriptionSummaryForTenant, resendVerifyDeviceOTP, resetSignInState, saveExternalConnection as saveExternalConnectionForTenant, sendEmailMagicLinkToUser, updateCurrentTenant, updateSignInState, verifyDeviceWithTwoFA, } from './entity/tenant/tenantReducer';
|
|
63
63
|
import { getCurrentTenant, getIsAccountingClassesEnabled, getIsAccountingProjectsEnabled, getTenantBaseById, getTenantBaseViewForTenantId, getTenantBaseViewForTenantView, getTenantsBaseByCheckInDateSelector, getTenantsByCheckInDateSelector, getTenantsCoreDetailsByCheckInDateSelector, isOtherProductsEnabledForTenant, isTenantBankingOnly, isTenantBookkeepingEnabled, isTenantCardsOnly, isTenantUsingZeniCOA, isZeniDomainTenant, toTenantCoreDetailsView, } from './entity/tenant/tenantSelector';
|
|
64
64
|
import { pushToastNotification } from './entity/toastNotification/toastNotificationReducer';
|
|
65
65
|
import { getLastNotificationTime, getNotifications, } from './entity/toastNotification/toastNotificationSelector';
|
|
@@ -433,7 +433,7 @@ export { toTimeframeTick, mapTimePeriodtoTimeframeTick, toTimePeriod, toAbsolute
|
|
|
433
433
|
export { toVendorSpendTrendFilterTabsTypeStrict, } from './entity/vendorExpense/vendorExpenseSelector';
|
|
434
434
|
export { getNumberOfPeriods };
|
|
435
435
|
export { SCHEDULE_DAYS_OF_MONTH, toScheduleDaysOfMonth, toMonth, toMonthStrict, toQuarter, toQuarterStrict, };
|
|
436
|
-
export { getTenantBaseById, getCurrentTenant, getIsAccountingClassesEnabled, getIsAccountingProjectsEnabled, getTenantsByCheckInDateSelector, getTenantsBaseByCheckInDateSelector, getTenantsCoreDetailsByCheckInDateSelector, toTenantCoreDetailsView, getTenantBaseViewForTenantView, getTenantBaseViewForTenantId, isZeniDomainTenant, isTenantUsingZeniCOA, fetchActiveTenant, fetchAllTenants, updateCurrentTenant, clearAll, doMagicLinkSignIn, verifyDeviceWithTwoFA, resendVerifyDeviceOTP, sendEmailMagicLinkToUser, doSignIn, updateSignInState, doSignOut,
|
|
436
|
+
export { getTenantBaseById, getCurrentTenant, getIsAccountingClassesEnabled, getIsAccountingProjectsEnabled, getTenantsByCheckInDateSelector, getTenantsBaseByCheckInDateSelector, getTenantsCoreDetailsByCheckInDateSelector, toTenantCoreDetailsView, getTenantBaseViewForTenantView, getTenantBaseViewForTenantId, isZeniDomainTenant, isTenantUsingZeniCOA, fetchActiveTenant, fetchAllTenants, updateCurrentTenant, clearAll, doMagicLinkSignIn, verifyDeviceWithTwoFA, resendVerifyDeviceOTP, sendEmailMagicLinkToUser, doSignIn, updateSignInState, doSignOut, resetSignInState, fetchExcludedResourcesForTenant, fetchExternalConnectionsForTenant, saveExternalConnectionForTenant, fetchSubscriptionSummaryForTenant, isTenantBankingOnly, isTenantCardsOnly, isTenantBookkeepingEnabled, isOtherProductsEnabledForTenant, };
|
|
437
437
|
export { toAccountType, toAccountGroupType, getAccountGroupKey, };
|
|
438
438
|
export { getClassById } from './entity/class/classSelector';
|
|
439
439
|
export { getForecast };
|
|
@@ -631,6 +631,3 @@ export { getAutoTransferRules, getAutoTransferRuleById, getAutoTransferRuleHisto
|
|
|
631
631
|
export { BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS, BULK_UPLOAD_BAR_COMPLETE_HOLD_MS, } from './view/expenseAutomationView/helpers/bulkUploadTiming';
|
|
632
632
|
export { fetchTransactionActivityLog } from './view/transactionActivityLogView/transactionActivityLogViewReducer';
|
|
633
633
|
export { getTransactionActivityLogView, } from './view/transactionActivityLogView/transactionActivityLogViewSelector';
|
|
634
|
-
// ── Session Management ──────────────────────────────────────────────
|
|
635
|
-
export { SessionManager } from './entity/tenant/SessionManager';
|
|
636
|
-
export { DEFAULT_SESSION_CONFIG } from './entity/tenant/sessionTypes';
|
|
@@ -27,6 +27,20 @@ export const fetchProfitAndLossForTimeframeProjectViewEpic = (actions$, _, zeniA
|
|
|
27
27
|
const actions = [];
|
|
28
28
|
const report = response.data.report;
|
|
29
29
|
const currency = report.currency;
|
|
30
|
+
console.log('$$$ [P&L project epic] API response received', {
|
|
31
|
+
timeframe: action.payload.timeframe,
|
|
32
|
+
projects: report.projects,
|
|
33
|
+
accounts: report.accounts,
|
|
34
|
+
sections: {
|
|
35
|
+
cogs: report.cogs,
|
|
36
|
+
expenses: report.expenses,
|
|
37
|
+
income: report.income,
|
|
38
|
+
other_expenses: report.other_expenses,
|
|
39
|
+
other_income: report.other_income,
|
|
40
|
+
},
|
|
41
|
+
currency,
|
|
42
|
+
});
|
|
43
|
+
console.log('$$$ [P&L project epic] dispatching updateProjects with', report.projects);
|
|
30
44
|
actions.push(updateProjects(report.projects));
|
|
31
45
|
actions.push(updateSectionProjectView(action.payload.timeframe, 'cogs', 'profit_and_loss_by_projects', report.cogs, report.accounts, currency));
|
|
32
46
|
actions.push(updateSectionProjectView(action.payload.timeframe, 'expenses', 'profit_and_loss_by_projects', report.expenses, report.accounts, currency));
|
|
@@ -37,6 +51,7 @@ export const fetchProfitAndLossForTimeframeProjectViewEpic = (actions$, _, zeniA
|
|
|
37
51
|
timeframe: action.payload.timeframe,
|
|
38
52
|
report: response.data,
|
|
39
53
|
}));
|
|
54
|
+
console.log('$$$ [P&L project epic] dispatching', actions.length, 'actions for timeframe', action.payload.timeframe);
|
|
40
55
|
return from(actions);
|
|
41
56
|
}
|
|
42
57
|
else {
|
|
@@ -25,6 +25,7 @@ export const getProfitAndLossProjectView = (filter, accountState, projectState,
|
|
|
25
25
|
const reportId = 'profit_and_loss_by_projects';
|
|
26
26
|
const sections = {};
|
|
27
27
|
const calculatedSections = {};
|
|
28
|
+
console.log('$$$ [getProfitAndLossProjectView] fetchState:', fetchState.fetchState, 'projectIds in viewState:', profitAndLossProjectViewState.projectIds, 'projectsToFilterOut:', profitAndLossProjectViewState.uiState.projectsToFilterOut);
|
|
28
29
|
if (fetchState.fetchState === 'Completed') {
|
|
29
30
|
ALL_PANDL_REPORT_VIEW_SECTION_IDS.forEach((sectionId) => {
|
|
30
31
|
sections[`${sectionId}`] = getSectionProjectViewReport(accountState, projectState, sectionsState, profitAndLossProjectViewState.projectIds, {
|
|
@@ -43,6 +44,7 @@ export const getProfitAndLossProjectView = (filter, accountState, projectState,
|
|
|
43
44
|
netOtherIncomeBalances,
|
|
44
45
|
]);
|
|
45
46
|
calculatedSections['netIncome'] = getCOABalances(netIncomeBalances, filter);
|
|
47
|
+
console.log('$$$ [getProfitAndLossProjectView] assembled sections:', Object.keys(sections), 'calculatedSections:', Object.keys(calculatedSections), 'full sections:', sections);
|
|
46
48
|
}
|
|
47
49
|
return {
|
|
48
50
|
sections,
|
package/lib/index.d.ts
CHANGED
|
@@ -123,7 +123,7 @@ import { PriorityCodeType, Task, TaskCodeType, TaskPriority, TaskStatus, TaskSta
|
|
|
123
123
|
import { getTaskGroupById } from './entity/taskGroup/taskGroupSelector';
|
|
124
124
|
import { TaskGroupState } from './entity/taskGroup/taskGroupState';
|
|
125
125
|
import { TaskGroupTemplate } from './entity/taskGroupTemplate/taskGroupTemplateState';
|
|
126
|
-
import { DoSignInPayload, clearAll, doMagicLinkSignIn, doSignIn, doSignOut,
|
|
126
|
+
import { DoSignInPayload, clearAll, doMagicLinkSignIn, doSignIn, doSignOut, fetchActiveTenant, fetchAllTenants, fetchExcludedResources as fetchExcludedResourcesForTenant, fetchExternalConnections as fetchExternalConnectionsForTenant, fetchSubscriptionSummaryForTenant, resendVerifyDeviceOTP, resetSignInState, saveExternalConnection as saveExternalConnectionForTenant, sendEmailMagicLinkToUser, updateCurrentTenant, updateSignInState, verifyDeviceWithTwoFA } from './entity/tenant/tenantReducer';
|
|
127
127
|
import { CurrentTenant, TenantBaseView, TenantCoreDetailsView, TenantView, TenantsBaseOrdered, TenantsOrdered, getCurrentTenant, getIsAccountingClassesEnabled, getIsAccountingProjectsEnabled, getTenantBaseById, getTenantBaseViewForTenantId, getTenantBaseViewForTenantView, getTenantsBaseByCheckInDateSelector, getTenantsByCheckInDateSelector, getTenantsCoreDetailsByCheckInDateSelector, isOtherProductsEnabledForTenant, isTenantBankingOnly, isTenantBookkeepingEnabled, isTenantCardsOnly, isTenantUsingZeniCOA, isZeniDomainTenant, toTenantCoreDetailsView } from './entity/tenant/tenantSelector';
|
|
128
128
|
import { Connection, LoggedInUser, RoleResource, Tenant, TenantProductSettings } from './entity/tenant/tenantState';
|
|
129
129
|
import { ToastNotificationPayload } from './entity/toastNotification/toastNotificationPayload';
|
|
@@ -643,7 +643,7 @@ export { TimeframeTick, TimeframeTickWithMetaData, toTimeframeTick, mapTimePerio
|
|
|
643
643
|
export { VendorSpendTrendFilterTabType, toVendorSpendTrendFilterTabsTypeStrict, } from './entity/vendorExpense/vendorExpenseSelector';
|
|
644
644
|
export { getNumberOfPeriods };
|
|
645
645
|
export { SCHEDULE_DAYS_OF_MONTH, ScheduleDaysOfMonth, toScheduleDaysOfMonth, Day, Month, toMonth, toMonthStrict, Quarter, toQuarter, toQuarterStrict, AbsoluteDay, TimePeriod, };
|
|
646
|
-
export { Tenant, TenantView, LoggedInUser, TenantBaseView, CurrentTenant, TenantProductSettings, getTenantBaseById, getCurrentTenant, getIsAccountingClassesEnabled, getIsAccountingProjectsEnabled, getTenantsByCheckInDateSelector, getTenantsBaseByCheckInDateSelector, getTenantsCoreDetailsByCheckInDateSelector, toTenantCoreDetailsView, getTenantBaseViewForTenantView, getTenantBaseViewForTenantId, isZeniDomainTenant, isTenantUsingZeniCOA, TenantsBaseOrdered, TenantsOrdered, TenantCoreDetailsView, fetchActiveTenant, fetchAllTenants, updateCurrentTenant, clearAll, doMagicLinkSignIn, verifyDeviceWithTwoFA, resendVerifyDeviceOTP, sendEmailMagicLinkToUser, doSignIn, updateSignInState, DoSignInPayload, doSignOut,
|
|
646
|
+
export { Tenant, TenantView, LoggedInUser, TenantBaseView, CurrentTenant, TenantProductSettings, getTenantBaseById, getCurrentTenant, getIsAccountingClassesEnabled, getIsAccountingProjectsEnabled, getTenantsByCheckInDateSelector, getTenantsBaseByCheckInDateSelector, getTenantsCoreDetailsByCheckInDateSelector, toTenantCoreDetailsView, getTenantBaseViewForTenantView, getTenantBaseViewForTenantId, isZeniDomainTenant, isTenantUsingZeniCOA, TenantsBaseOrdered, TenantsOrdered, TenantCoreDetailsView, fetchActiveTenant, fetchAllTenants, updateCurrentTenant, clearAll, doMagicLinkSignIn, verifyDeviceWithTwoFA, resendVerifyDeviceOTP, sendEmailMagicLinkToUser, doSignIn, updateSignInState, DoSignInPayload, doSignOut, resetSignInState, RoleResource, Connection, fetchExcludedResourcesForTenant, fetchExternalConnectionsForTenant, saveExternalConnectionForTenant, fetchSubscriptionSummaryForTenant, isTenantBankingOnly, isTenantCardsOnly, isTenantBookkeepingEnabled, isOtherProductsEnabledForTenant, };
|
|
647
647
|
export { Account, AccountType, AccountBase, StatementCloseDay, toAccountType, AccountReport, NestedAccountReport, AccountWithBalanceReport, AccountGroup, AccountGroupReportV2, AccountGroupType, toAccountGroupType, AccountGroupReport, getAccountGroupKey, AccountGroupKey, RecommendedAccountBase, };
|
|
648
648
|
export { Class, ClassBase, RecommendedClassBase, } from './entity/class/classState';
|
|
649
649
|
export { getClassById } from './entity/class/classSelector';
|
|
@@ -901,6 +901,3 @@ export { BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS, BULK_UPLOAD_BAR_COMPLETE_HOLD_MS,
|
|
|
901
901
|
export { fetchTransactionActivityLog } from './view/transactionActivityLogView/transactionActivityLogViewReducer';
|
|
902
902
|
export { TransactionActivityLogViewSelectorView, getTransactionActivityLogView, } from './view/transactionActivityLogView/transactionActivityLogViewSelector';
|
|
903
903
|
export { UserGroup } from './entity/userGroups/userGroupsState';
|
|
904
|
-
export { SessionManager } from './entity/tenant/SessionManager';
|
|
905
|
-
export type { SessionCallbacks, SessionConfig } from './entity/tenant/sessionTypes';
|
|
906
|
-
export { DEFAULT_SESSION_CONFIG } from './entity/tenant/sessionTypes';
|