@zeniai/client-epic-state 4.8.68 → 4.8.69
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/commonStateTypes/viewAndReport/viewAndReport.d.ts +1 -0
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +3 -3
- package/lib/epic.d.ts +3 -1
- package/lib/epic.js +3 -1
- package/lib/index.d.ts +11 -7
- package/lib/index.js +20 -12
- package/lib/reducer.d.ts +3 -0
- package/lib/reducer.js +3 -0
- package/lib/view/auditReportView/auditReportViewHelper.d.ts +12 -0
- package/lib/view/auditReportView/auditReportViewHelper.js +79 -0
- package/lib/view/auditReportView/auditReportViewPayload.d.ts +53 -0
- package/lib/view/auditReportView/auditReportViewPayload.js +2 -0
- package/lib/view/auditReportView/auditReportViewReducer.d.ts +27 -0
- package/lib/view/auditReportView/auditReportViewReducer.js +121 -0
- package/lib/view/auditReportView/auditReportViewSelector.d.ts +22 -0
- package/lib/view/auditReportView/auditReportViewSelector.js +34 -0
- package/lib/view/auditReportView/auditReportViewState.d.ts +71 -0
- package/lib/view/auditReportView/auditReportViewState.js +22 -0
- package/lib/view/auditReportView/epics/fetchAuditReportGroupViewEpic.d.ts +7 -0
- package/lib/view/auditReportView/epics/fetchAuditReportGroupViewEpic.js +54 -0
- package/lib/view/auditReportView/epics/fetchAuditRuleGroupViewEpic.d.ts +7 -0
- package/lib/view/auditReportView/epics/fetchAuditRuleGroupViewEpic.js +39 -0
- package/lib/view/companyView/types/cockpitTypes.d.ts +2 -0
- package/lib/view/companyView/types/cockpitTypes.js +9 -1
- package/lib/view/reviewCompanyView/reviewCompanyPayload.d.ts +25 -1
- package/lib/view/reviewCompanyView/reviewCompanyViewSelector.d.ts +1 -0
- package/lib/view/reviewCompanyView/reviewCompanyViewSelector.js +31 -8
- package/lib/view/reviewCompanyView/reviewCompanyViewState.d.ts +12 -4
- package/lib/view/reviewCompanyView/reviewCompanyViewState.js +15 -5
- package/lib/view/spendManagement/helpers.d.ts +1 -1
- package/lib/view/spendManagement/helpers.js +8 -8
- package/package.json +1 -1
|
@@ -2,23 +2,30 @@ import { FetchedState, ID, FetchStateAndError } from '../../commonStateTypes/com
|
|
|
2
2
|
import { SortOrder } from '../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
3
3
|
import { OnboardingInfo } from '../../entity/company/companyStateTypes';
|
|
4
4
|
import { ZeniDate } from '../../zeniDayJS';
|
|
5
|
-
import { ReviewCompanyPayload } from './reviewCompanyPayload';
|
|
6
|
-
export declare const REVIEW_COMPANY_COLUMN_KEYS: readonly ["miscategorized", "companyName", "notes", "uncategorized", "
|
|
7
|
-
export declare const toReviewColumnKeyType: (v: string) => "companyName" | "
|
|
5
|
+
import { AuditSummaryPayload, ReviewCompanyPayload } from './reviewCompanyPayload';
|
|
6
|
+
export declare const REVIEW_COMPANY_COLUMN_KEYS: readonly ["auditScore", "miscategorized", "companyName", "notes", "uncategorized", "warnings", "vendorReview", "reviewVendor"];
|
|
7
|
+
export declare const toReviewColumnKeyType: (v: string) => "companyName" | "notes" | "auditScore" | "miscategorized" | "uncategorized" | "warnings" | "vendorReview" | "reviewVendor";
|
|
8
8
|
export declare type ReviewCompanyColumnKey = ReturnType<typeof toReviewColumnKeyType>;
|
|
9
9
|
export declare type ReviewTransactionsType = 'income' | 'expense';
|
|
10
|
+
export interface AuditSummary {
|
|
11
|
+
fixesRequired: number;
|
|
12
|
+
totalChecks: number;
|
|
13
|
+
auditScorePercentage: number;
|
|
14
|
+
auditReportLastGeneratedDate: ZeniDate | null;
|
|
15
|
+
}
|
|
10
16
|
export interface ReviewCompany {
|
|
11
17
|
companyId: ID;
|
|
12
18
|
name: string;
|
|
13
19
|
primaryEmailDomain: string;
|
|
14
20
|
miscategorizedTransactions: Record<ReviewTransactionsType, boolean>;
|
|
15
21
|
uncategorizedTransactions: Record<ReviewTransactionsType, boolean>;
|
|
22
|
+
isVendorReviewReqiured: boolean;
|
|
23
|
+
auditSummary: AuditSummary;
|
|
16
24
|
noteLastUpdatedUserId?: ID;
|
|
17
25
|
noteLastUpdateTime?: ZeniDate;
|
|
18
26
|
note?: string;
|
|
19
27
|
onboardingInfo?: OnboardingInfo;
|
|
20
28
|
retryBankAccountConnectionFetchState: FetchStateAndError;
|
|
21
|
-
isVendorReviewReqiured: boolean;
|
|
22
29
|
}
|
|
23
30
|
export interface ReviewCompanyListUIState {
|
|
24
31
|
filterText: string;
|
|
@@ -29,4 +36,5 @@ export interface ReviewCompanyViewState extends FetchedState {
|
|
|
29
36
|
reviewCompanyById: Record<ID, ReviewCompany>;
|
|
30
37
|
uiState: ReviewCompanyListUIState;
|
|
31
38
|
}
|
|
39
|
+
export declare const toAuditSummary: (auditSummaryPayload: AuditSummaryPayload) => AuditSummary;
|
|
32
40
|
export declare function toReviewCompany(company: ReviewCompanyPayload): ReviewCompany;
|
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toReviewCompany = exports.toReviewColumnKeyType = exports.REVIEW_COMPANY_COLUMN_KEYS = void 0;
|
|
3
|
+
exports.toReviewCompany = exports.toAuditSummary = exports.toReviewColumnKeyType = exports.REVIEW_COMPANY_COLUMN_KEYS = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
|
|
5
5
|
const companyPayload_1 = require("../../entity/company/companyPayload");
|
|
6
6
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
7
7
|
exports.REVIEW_COMPANY_COLUMN_KEYS = [
|
|
8
|
+
'auditScore',
|
|
8
9
|
'miscategorized',
|
|
9
10
|
'companyName',
|
|
10
11
|
'notes',
|
|
11
12
|
'uncategorized',
|
|
13
|
+
'warnings',
|
|
12
14
|
'vendorReview',
|
|
13
|
-
'bankAccountLinked',
|
|
14
|
-
'qboLinked',
|
|
15
|
-
'identityVerified',
|
|
16
|
-
'businessVerified',
|
|
17
15
|
'reviewVendor',
|
|
18
16
|
];
|
|
19
17
|
const toReviewColumnKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.REVIEW_COMPANY_COLUMN_KEYS);
|
|
20
18
|
exports.toReviewColumnKeyType = toReviewColumnKeyType;
|
|
19
|
+
const toAuditSummary = (auditSummaryPayload) => {
|
|
20
|
+
return {
|
|
21
|
+
fixesRequired: auditSummaryPayload.fixes_required,
|
|
22
|
+
totalChecks: auditSummaryPayload.total_checks,
|
|
23
|
+
auditScorePercentage: auditSummaryPayload.audit_score_percentage,
|
|
24
|
+
auditReportLastGeneratedDate: auditSummaryPayload.audit_report_last_generated_date != null
|
|
25
|
+
? (0, zeniDayJS_1.date)(auditSummaryPayload.audit_report_last_generated_date)
|
|
26
|
+
: null,
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
exports.toAuditSummary = toAuditSummary;
|
|
21
30
|
function toReviewCompany(company) {
|
|
22
31
|
const reviewCompany = {
|
|
23
32
|
companyId: company.company_id,
|
|
@@ -35,6 +44,7 @@ function toReviewCompany(company) {
|
|
|
35
44
|
fetchState: 'Not-Started',
|
|
36
45
|
},
|
|
37
46
|
isVendorReviewReqiured: company.is_vendor_review_required,
|
|
47
|
+
auditSummary: (0, exports.toAuditSummary)(company.audit_summary),
|
|
38
48
|
};
|
|
39
49
|
if (company.note != null) {
|
|
40
50
|
reviewCompany.note = company.note;
|
|
@@ -19,5 +19,5 @@ export declare const isRecurringConfigChanged: (recurringBillNewConfig: Recurrin
|
|
|
19
19
|
export declare const getTotalPayments: (startDate: ZeniDate, endDate: ZeniDate, frequency: RecurringBillFrequency, currentInstance?: RecurringBillInstance | undefined) => number;
|
|
20
20
|
export declare const getEndDate: (startDate: ZeniDate, frequency: RecurringBillFrequency, totalPayments: number, currentInstance?: RecurringBillInstance | undefined) => ZeniDate;
|
|
21
21
|
export declare const accountTypeSubConfigCodeToAccType: (code?: "depositAccount" | "paymentAccount" | undefined) => AccType | undefined;
|
|
22
|
-
export declare function showReimbursementPromoPage(currentTenant: CurrentTenant): boolean;
|
|
22
|
+
export declare function showReimbursementPromoPage(currentTenant: CurrentTenant, userRoleMap: RoleMap): boolean;
|
|
23
23
|
export declare function showBillPayPromoPage(currentTenant: CurrentTenant, userRoleMap: RoleMap): boolean;
|
|
@@ -228,27 +228,27 @@ const accountTypeSubConfigCodeToAccType = (code) => {
|
|
|
228
228
|
}
|
|
229
229
|
};
|
|
230
230
|
exports.accountTypeSubConfigCodeToAccType = accountTypeSubConfigCodeToAccType;
|
|
231
|
-
function showReimbursementPromoPage(currentTenant) {
|
|
231
|
+
function showReimbursementPromoPage(currentTenant, userRoleMap) {
|
|
232
232
|
var _a, _b, _c;
|
|
233
233
|
const isReimbursementTOSAccepted = Boolean((_a = currentTenant.company) === null || _a === void 0 ? void 0 : _a.companyReimbursementInfo.isReimbursementTOSAccepted);
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
234
|
+
const isUserHasRemiAccess = (0, userRoleType_1.hasReimbursementAccess)(userRoleMap);
|
|
235
|
+
const isUserHasAdminLevelRemiAccess = (0, userRoleType_1.hasReimbursementAdminLevelAccess)(userRoleMap);
|
|
236
|
+
const isNonAdminLevelAccess = isUserHasRemiAccess && !isUserHasAdminLevelRemiAccess;
|
|
237
237
|
const isEmployeeReimbursementTOSAccepted = Boolean((_b = currentTenant.userReimbursementInfo) === null || _b === void 0 ? void 0 : _b.isReimbursementTOSAccepted);
|
|
238
238
|
return ((Boolean((_c = currentTenant.company) === null || _c === void 0 ? void 0 : _c.companyReimbursementInfo) &&
|
|
239
239
|
!isReimbursementTOSAccepted) ||
|
|
240
240
|
(Boolean(currentTenant.userReimbursementInfo) &&
|
|
241
|
-
|
|
241
|
+
isNonAdminLevelAccess &&
|
|
242
242
|
!isEmployeeReimbursementTOSAccepted));
|
|
243
243
|
}
|
|
244
244
|
exports.showReimbursementPromoPage = showReimbursementPromoPage;
|
|
245
245
|
function showBillPayPromoPage(currentTenant, userRoleMap) {
|
|
246
246
|
var _a, _b, _c;
|
|
247
|
-
const
|
|
247
|
+
const isUserHasBillPayAccess = (0, userRoleType_1.hasBillPayAccess)(userRoleMap);
|
|
248
|
+
const isUserHasAdminLevelBillPayAccess = (0, userRoleType_1.hasBillPayAdminLevelAccess)(userRoleMap);
|
|
248
249
|
const isBillPayTOSAccepted = Boolean((_b = (_a = currentTenant.companyBillPayInfo) === null || _a === void 0 ? void 0 : _a.info) === null || _b === void 0 ? void 0 : _b.isBillPayTOSAccepted);
|
|
249
250
|
return (Boolean((_c = currentTenant.companyBillPayInfo) === null || _c === void 0 ? void 0 : _c.info) &&
|
|
250
251
|
(isBillPayTOSAccepted === false ||
|
|
251
|
-
(
|
|
252
|
-
Boolean(userRoleMap.bill_pay_admin) === false)));
|
|
252
|
+
(isUserHasBillPayAccess && isUserHasAdminLevelBillPayAccess === false)));
|
|
253
253
|
}
|
|
254
254
|
exports.showBillPayPromoPage = showBillPayPromoPage;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.69",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|