@zeniai/client-epic-state 4.8.82 → 4.8.84
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 +0 -1
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +3 -3
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/entity/tenant/clearAllEpic.d.ts +1 -2
- package/lib/entity/tenant/clearAllEpic.js +0 -2
- package/lib/entity/tenant/tenantSelector.d.ts +4 -12
- package/lib/entity/tenant/tenantSelector.js +31 -95
- package/lib/epic.d.ts +1 -7
- package/lib/epic.js +1 -7
- package/lib/index.d.ts +9 -17
- package/lib/index.js +19 -45
- package/lib/init.js +1 -1
- package/lib/reducer.d.ts +0 -6
- package/lib/reducer.js +0 -6
- package/lib/view/companyView/types/cockpitTypes.d.ts +2 -4
- package/lib/view/companyView/types/cockpitTypes.js +1 -10
- package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
- package/lib/view/people/deletePersonEpic.d.ts +1 -1
- package/lib/view/people/invitePeopleEpic.d.ts +1 -1
- package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
- package/lib/view/people/resendInviteEpic.d.ts +1 -1
- package/lib/view/reviewCompanyView/fetchReviewCompanyViewEpic.js +1 -1
- package/lib/view/reviewCompanyView/reviewCompanyPayload.d.ts +1 -25
- package/lib/view/reviewCompanyView/reviewCompanyViewSelector.d.ts +0 -1
- package/lib/view/reviewCompanyView/reviewCompanyViewSelector.js +8 -31
- package/lib/view/reviewCompanyView/reviewCompanyViewState.d.ts +4 -12
- package/lib/view/reviewCompanyView/reviewCompanyViewState.js +5 -15
- package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
- package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.d.ts +1 -3
- package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.js +1 -35
- package/package.json +2 -2
- package/lib/view/auditReportView/auditReportViewHelper.d.ts +0 -12
- package/lib/view/auditReportView/auditReportViewHelper.js +0 -79
- package/lib/view/auditReportView/auditReportViewPayload.d.ts +0 -53
- package/lib/view/auditReportView/auditReportViewPayload.js +0 -2
- package/lib/view/auditReportView/auditReportViewReducer.d.ts +0 -27
- package/lib/view/auditReportView/auditReportViewReducer.js +0 -121
- package/lib/view/auditReportView/auditReportViewSelector.d.ts +0 -22
- package/lib/view/auditReportView/auditReportViewSelector.js +0 -34
- package/lib/view/auditReportView/auditReportViewState.d.ts +0 -71
- package/lib/view/auditReportView/auditReportViewState.js +0 -22
- package/lib/view/auditReportView/epics/fetchAuditReportGroupViewEpic.d.ts +0 -7
- package/lib/view/auditReportView/epics/fetchAuditReportGroupViewEpic.js +0 -54
- package/lib/view/auditReportView/epics/fetchAuditRuleGroupViewEpic.d.ts +0 -7
- package/lib/view/auditReportView/epics/fetchAuditRuleGroupViewEpic.js +0 -39
- package/lib/view/referralView/epics/fetchReferralsEpic.d.ts +0 -7
- package/lib/view/referralView/epics/fetchReferralsEpic.js +0 -36
- package/lib/view/referralView/epics/fetchRewardsPlanEpic.d.ts +0 -7
- package/lib/view/referralView/epics/fetchRewardsPlanEpic.js +0 -41
- package/lib/view/referralView/epics/resendReferralInviteEpic.d.ts +0 -8
- package/lib/view/referralView/epics/resendReferralInviteEpic.js +0 -39
- package/lib/view/referralView/epics/sendReferralInviteEpic.d.ts +0 -8
- package/lib/view/referralView/epics/sendReferralInviteEpic.js +0 -52
- package/lib/view/referralView/referralPayload.d.ts +0 -43
- package/lib/view/referralView/referralPayload.js +0 -33
- package/lib/view/referralView/referralReducer.d.ts +0 -23
- package/lib/view/referralView/referralReducer.js +0 -162
- package/lib/view/referralView/referralSelector.d.ts +0 -21
- package/lib/view/referralView/referralSelector.js +0 -76
- package/lib/view/referralView/referralState.d.ts +0 -54
- package/lib/view/referralView/referralState.js +0 -37
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.getReviewCompanyListCount = exports.getReviewCompanySelectorView = void 0;
|
|
7
7
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
8
8
|
const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
9
9
|
const values_1 = __importDefault(require("lodash/values"));
|
|
@@ -27,8 +27,7 @@ exports.getReviewCompanySelectorView = (0, toolkit_1.createSelector)((state) =>
|
|
|
27
27
|
.filter((value) => value != null);
|
|
28
28
|
const orderedZeniUsers = (0, orderBy_1.default)(zeniUsers, (user) => (0, userSelector_1.getUserName)(user), 'asc');
|
|
29
29
|
const sortedCompanies = (0, orderBy_1.default)(companies, (company) => {
|
|
30
|
-
var _a;
|
|
31
|
-
const warningCount = (0, exports.getAuditWarningsCount)(company);
|
|
30
|
+
var _a, _b, _c, _d;
|
|
32
31
|
switch (sortKey) {
|
|
33
32
|
case 'notes':
|
|
34
33
|
return (_a = company.note) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
@@ -38,10 +37,12 @@ exports.getReviewCompanySelectorView = (0, toolkit_1.createSelector)((state) =>
|
|
|
38
37
|
case 'miscategorized':
|
|
39
38
|
return ((company.miscategorizedTransactions.income ? 1 : 0) +
|
|
40
39
|
(company.miscategorizedTransactions.expense ? 1 : 0));
|
|
41
|
-
case '
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
case 'bankAccountLinked':
|
|
41
|
+
case 'qboLinked':
|
|
42
|
+
return ((_c = (_b = company.onboardingInfo) === null || _b === void 0 ? void 0 : _b[sortKey]) === null || _c === void 0 ? void 0 : _c.completed) === true;
|
|
43
|
+
case 'businessVerified':
|
|
44
|
+
case 'identityVerified':
|
|
45
|
+
return (_d = company.onboardingInfo) === null || _d === void 0 ? void 0 : _d[sortKey].status.toLowerCase();
|
|
45
46
|
case 'reviewVendor':
|
|
46
47
|
return company.isVendorReviewReqiured;
|
|
47
48
|
case 'companyName':
|
|
@@ -61,27 +62,3 @@ exports.getReviewCompanyListCount = (0, toolkit_1.createSelector)((state) => sta
|
|
|
61
62
|
const companies = (0, values_1.default)(rootState.reviewCompanyViewState.reviewCompanyById);
|
|
62
63
|
return companies.length;
|
|
63
64
|
});
|
|
64
|
-
const getAuditWarningsCount = (companyView) => {
|
|
65
|
-
var _a, _b, _c, _d;
|
|
66
|
-
let warningsCount = 0;
|
|
67
|
-
const bankConnectionStepInfo = (_a = companyView.onboardingInfo) === null || _a === void 0 ? void 0 : _a['bankAccountLinked'];
|
|
68
|
-
if ((bankConnectionStepInfo === null || bankConnectionStepInfo === void 0 ? void 0 : bankConnectionStepInfo.error) === true ||
|
|
69
|
-
(bankConnectionStepInfo === null || bankConnectionStepInfo === void 0 ? void 0 : bankConnectionStepInfo.completed) === false) {
|
|
70
|
-
warningsCount++;
|
|
71
|
-
}
|
|
72
|
-
const qboLinkedStepInfo = (_b = companyView.onboardingInfo) === null || _b === void 0 ? void 0 : _b['qboLinked'];
|
|
73
|
-
if ((qboLinkedStepInfo === null || qboLinkedStepInfo === void 0 ? void 0 : qboLinkedStepInfo.error) === true ||
|
|
74
|
-
(qboLinkedStepInfo === null || qboLinkedStepInfo === void 0 ? void 0 : qboLinkedStepInfo.completed) === false) {
|
|
75
|
-
warningsCount++;
|
|
76
|
-
}
|
|
77
|
-
const identityVerificationStepInfo = (_c = companyView.onboardingInfo) === null || _c === void 0 ? void 0 : _c['identityVerified'];
|
|
78
|
-
if ((identityVerificationStepInfo === null || identityVerificationStepInfo === void 0 ? void 0 : identityVerificationStepInfo.status) !== 'Complete') {
|
|
79
|
-
warningsCount++;
|
|
80
|
-
}
|
|
81
|
-
const businessVerificationStepInfo = (_d = companyView.onboardingInfo) === null || _d === void 0 ? void 0 : _d['businessVerified'];
|
|
82
|
-
if ((businessVerificationStepInfo === null || businessVerificationStepInfo === void 0 ? void 0 : businessVerificationStepInfo.status) !== 'Complete') {
|
|
83
|
-
warningsCount++;
|
|
84
|
-
}
|
|
85
|
-
return warningsCount;
|
|
86
|
-
};
|
|
87
|
-
exports.getAuditWarningsCount = getAuditWarningsCount;
|
|
@@ -2,30 +2,23 @@ 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 {
|
|
6
|
-
export declare const REVIEW_COMPANY_COLUMN_KEYS: readonly ["
|
|
7
|
-
export declare const toReviewColumnKeyType: (v: string) => "companyName" | "
|
|
5
|
+
import { ReviewCompanyPayload } from './reviewCompanyPayload';
|
|
6
|
+
export declare const REVIEW_COMPANY_COLUMN_KEYS: readonly ["miscategorized", "companyName", "notes", "uncategorized", "vendorReview", "bankAccountLinked", "qboLinked", "identityVerified", "businessVerified", "reviewVendor"];
|
|
7
|
+
export declare const toReviewColumnKeyType: (v: string) => "companyName" | "identityVerified" | "businessVerified" | "bankAccountLinked" | "qboLinked" | "notes" | "miscategorized" | "uncategorized" | "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
|
-
}
|
|
16
10
|
export interface ReviewCompany {
|
|
17
11
|
companyId: ID;
|
|
18
12
|
name: string;
|
|
19
13
|
primaryEmailDomain: string;
|
|
20
14
|
miscategorizedTransactions: Record<ReviewTransactionsType, boolean>;
|
|
21
15
|
uncategorizedTransactions: Record<ReviewTransactionsType, boolean>;
|
|
22
|
-
isVendorReviewReqiured: boolean;
|
|
23
|
-
auditSummary: AuditSummary;
|
|
24
16
|
noteLastUpdatedUserId?: ID;
|
|
25
17
|
noteLastUpdateTime?: ZeniDate;
|
|
26
18
|
note?: string;
|
|
27
19
|
onboardingInfo?: OnboardingInfo;
|
|
28
20
|
retryBankAccountConnectionFetchState: FetchStateAndError;
|
|
21
|
+
isVendorReviewReqiured: boolean;
|
|
29
22
|
}
|
|
30
23
|
export interface ReviewCompanyListUIState {
|
|
31
24
|
filterText: string;
|
|
@@ -36,5 +29,4 @@ export interface ReviewCompanyViewState extends FetchedState {
|
|
|
36
29
|
reviewCompanyById: Record<ID, ReviewCompany>;
|
|
37
30
|
uiState: ReviewCompanyListUIState;
|
|
38
31
|
}
|
|
39
|
-
export declare const toAuditSummary: (auditSummaryPayload: AuditSummaryPayload) => AuditSummary;
|
|
40
32
|
export declare function toReviewCompany(company: ReviewCompanyPayload): ReviewCompany;
|
|
@@ -1,32 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toReviewCompany = exports.
|
|
3
|
+
exports.toReviewCompany = 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',
|
|
9
8
|
'miscategorized',
|
|
10
9
|
'companyName',
|
|
11
10
|
'notes',
|
|
12
11
|
'uncategorized',
|
|
13
|
-
'warnings',
|
|
14
12
|
'vendorReview',
|
|
13
|
+
'bankAccountLinked',
|
|
14
|
+
'qboLinked',
|
|
15
|
+
'identityVerified',
|
|
16
|
+
'businessVerified',
|
|
15
17
|
'reviewVendor',
|
|
16
18
|
];
|
|
17
19
|
const toReviewColumnKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.REVIEW_COMPANY_COLUMN_KEYS);
|
|
18
20
|
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;
|
|
30
21
|
function toReviewCompany(company) {
|
|
31
22
|
const reviewCompany = {
|
|
32
23
|
companyId: company.company_id,
|
|
@@ -44,7 +35,6 @@ function toReviewCompany(company) {
|
|
|
44
35
|
fetchState: 'Not-Started',
|
|
45
36
|
},
|
|
46
37
|
isVendorReviewReqiured: company.is_vendor_review_required,
|
|
47
|
-
auditSummary: (0, exports.toAuditSummary)(company.audit_summary),
|
|
48
38
|
};
|
|
49
39
|
if (company.note != null) {
|
|
50
40
|
reviewCompany.note = company.note;
|
|
@@ -18,7 +18,7 @@ export declare const saveNotificationSettingsEpic: (actions$: ActionsObservable<
|
|
|
18
18
|
type: string;
|
|
19
19
|
} | {
|
|
20
20
|
payload: {
|
|
21
|
-
messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_monthEndEmailSent" | "cockpit_monthEndEmailSave" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "zeni_account_accept_term" | "update_vendor" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "charge_card_setup" | "charge_card_accept_term" | "create_schedule" | "save_schedule" | "save_task_detail" | "delete_task" | "archive_task" | "update_charge_card" | "notification_settings_saved"
|
|
21
|
+
messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_monthEndEmailSent" | "cockpit_monthEndEmailSave" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "zeni_account_accept_term" | "update_vendor" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "charge_card_setup" | "charge_card_accept_term" | "create_schedule" | "save_schedule" | "save_task_detail" | "delete_task" | "archive_task" | "update_charge_card" | "notification_settings_saved";
|
|
22
22
|
messageText: "failed" | "success";
|
|
23
23
|
type: import("../../..").SnackbarMessageType;
|
|
24
24
|
showStatusIcon?: boolean | undefined;
|
|
@@ -3,8 +3,7 @@ import { ZeniAPI } from '../../../../../zeniAPI';
|
|
|
3
3
|
import { RootState } from '../../../../../reducer';
|
|
4
4
|
import { saveBillDetail, saveBillSuccessOrFailure } from '../editBillViewReducer';
|
|
5
5
|
import { updateBillTransaction } from '../../../../../entity/billPay/billTransaction/billTransactionReducer';
|
|
6
|
-
import {
|
|
7
|
-
import { BillTransaction } from '../../../../../entity/billPay/billTransaction/billTransactionState';
|
|
6
|
+
import { RecurringBillInstance } from '../editBillViewState';
|
|
8
7
|
import { updateRecurringBillConfigs, updateRecurringBills } from '../../../../../entity/billPay/recurringBills/recurringBillsReducer';
|
|
9
8
|
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
10
9
|
export declare type ActionType = ReturnType<typeof saveBillDetail> | ReturnType<typeof updateBillTransaction> | ReturnType<typeof openSnackbar> | ReturnType<typeof saveBillSuccessOrFailure> | ReturnType<typeof updateRecurringBillConfigs> | ReturnType<typeof updateRecurringBills>;
|
|
@@ -16,4 +15,3 @@ export interface RecurringBillInstancePayload {
|
|
|
16
15
|
vendor_receive_date_notes: string;
|
|
17
16
|
}
|
|
18
17
|
export declare const toRecurringBillInstancePayload: (recurringBillInstance: RecurringBillInstance, maxPaymentProcessingDays: number) => RecurringBillInstancePayload;
|
|
19
|
-
export declare const checkIfUpdateCurrentBill: (editBillDetail: EditBillDetail, originalBillDetail?: BillTransaction | undefined) => boolean;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.toRecurringBillInstancePayload = exports.saveBillDetailEpic = void 0;
|
|
7
7
|
const rxjs_1 = require("rxjs");
|
|
8
8
|
const operators_1 = require("rxjs/operators");
|
|
9
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
@@ -169,7 +169,6 @@ function prepareSaveBillPayload(accountState, billTransactionState, paymentAccou
|
|
|
169
169
|
if ((detail === null || detail === void 0 ? void 0 : detail.isRecurring) === true &&
|
|
170
170
|
Boolean(billDetail.billDetailLocalData.isRecurring) === false) {
|
|
171
171
|
payload.is_recurring = false;
|
|
172
|
-
payload.is_update_current_bill = true;
|
|
173
172
|
}
|
|
174
173
|
}
|
|
175
174
|
else {
|
|
@@ -194,11 +193,6 @@ function prepareSaveBillPayload(accountState, billTransactionState, paymentAccou
|
|
|
194
193
|
payload.is_update_recurring_bill_config = isConfigChangedForExistingBill;
|
|
195
194
|
payload.is_update_future_recurring_bills =
|
|
196
195
|
recurringConfig.updateRecurringBills === 'all';
|
|
197
|
-
payload.is_update_current_bill =
|
|
198
|
-
recurringConfig.updateRecurringBills === 'all' ||
|
|
199
|
-
(0, exports.checkIfUpdateCurrentBill)(billDetail, detail)
|
|
200
|
-
? true
|
|
201
|
-
: recurringConfig.updateRecurringBills === 'current';
|
|
202
196
|
if ((isConfigChangedForExistingBill ||
|
|
203
197
|
recurringConfig.updateRecurringBills === 'all') &&
|
|
204
198
|
payload.recurring_bill_config != null) {
|
|
@@ -227,10 +221,6 @@ function prepareSaveBillPayload(accountState, billTransactionState, paymentAccou
|
|
|
227
221
|
return (0, exports.toRecurringBillInstancePayload)(instance, (_d = (_c = (_b = (_a = billDetail.billDetailLocalData.paymentDetailsSection) === null || _a === void 0 ? void 0 : _a.paymentType) === null || _b === void 0 ? void 0 : _b.maxPeriod) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : workingDayHelper_1.PAYMENT_BUSINESS_DAYS);
|
|
228
222
|
});
|
|
229
223
|
}
|
|
230
|
-
//platform needs this when converting a bill from non-recurring to recurring
|
|
231
|
-
if ((detail === null || detail === void 0 ? void 0 : detail.isRecurring) === false) {
|
|
232
|
-
payload.is_update_current_bill = true;
|
|
233
|
-
}
|
|
234
224
|
}
|
|
235
225
|
return payload;
|
|
236
226
|
}
|
|
@@ -258,27 +248,3 @@ const toRecurringBillInstancePayload = (recurringBillInstance, maxPaymentProcess
|
|
|
258
248
|
};
|
|
259
249
|
};
|
|
260
250
|
exports.toRecurringBillInstancePayload = toRecurringBillInstancePayload;
|
|
261
|
-
const checkIfUpdateCurrentBill = (editBillDetail, originalBillDetail) => {
|
|
262
|
-
var _a, _b, _c, _d, _e;
|
|
263
|
-
const { paymentDetailsSection, whatForSection } = editBillDetail.billDetailLocalData;
|
|
264
|
-
if (((_a = paymentDetailsSection === null || paymentDetailsSection === void 0 ? void 0 : paymentDetailsSection.paymentDate) === null || _a === void 0 ? void 0 : _a.toString()) !==
|
|
265
|
-
((_b = originalBillDetail === null || originalBillDetail === void 0 ? void 0 : originalBillDetail.billPayInfo.paymentDate) === null || _b === void 0 ? void 0 : _b.toString())) {
|
|
266
|
-
return true;
|
|
267
|
-
}
|
|
268
|
-
if ((whatForSection === null || whatForSection === void 0 ? void 0 : whatForSection.invoiceNumber) !== (originalBillDetail === null || originalBillDetail === void 0 ? void 0 : originalBillDetail.documentId)) {
|
|
269
|
-
return true;
|
|
270
|
-
}
|
|
271
|
-
if (((_c = whatForSection === null || whatForSection === void 0 ? void 0 : whatForSection.billDueDate) === null || _c === void 0 ? void 0 : _c.toString()) !==
|
|
272
|
-
((_d = originalBillDetail === null || originalBillDetail === void 0 ? void 0 : originalBillDetail.dueDate) === null || _d === void 0 ? void 0 : _d.toString())) {
|
|
273
|
-
return true;
|
|
274
|
-
}
|
|
275
|
-
if (((_e = whatForSection === null || whatForSection === void 0 ? void 0 : whatForSection.invoiceDate) === null || _e === void 0 ? void 0 : _e.toString()) !==
|
|
276
|
-
(originalBillDetail === null || originalBillDetail === void 0 ? void 0 : originalBillDetail.date.toString())) {
|
|
277
|
-
return true;
|
|
278
|
-
}
|
|
279
|
-
if ((originalBillDetail === null || originalBillDetail === void 0 ? void 0 : originalBillDetail.billPayInfo.stage.code) === 'draft') {
|
|
280
|
-
return true;
|
|
281
|
-
}
|
|
282
|
-
return false;
|
|
283
|
-
};
|
|
284
|
-
exports.checkIfUpdateCurrentBill = checkIfUpdateCurrentBill;
|
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.84",
|
|
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",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
},
|
|
76
76
|
"scripts": {
|
|
77
77
|
"clean": "rimraf lib",
|
|
78
|
-
"test": "jest --config jest.config.json
|
|
78
|
+
"test": "jest --config jest.config.json",
|
|
79
79
|
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
|
|
80
80
|
"find-dead-code": "ts-prune | grep -v '(used in module)'",
|
|
81
81
|
"find-unused-exports": "ts-unused-exports ./tsconfig.json",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { AuditRule, AuditRuleGroup, AuditReportGroupQuery, AuditReport, AuditRuleGroupReport, AuditReportGroup, AuditRuleBase, AuditReportRule } from './auditReportViewState';
|
|
2
|
-
import { AuditReportGroupPayload, AuditReportGroupQueryPayload, AuditReportPayload, AuditRuleGroupPayload, AuditRulePayload, AuditRuleGroupReportPayload, AuditRuleBasePayload, AuditReportRulePayload } from './auditReportViewPayload';
|
|
3
|
-
declare const toAuditRuleGroupFromPayload: (auditRuleGroupPayload: AuditRuleGroupPayload) => AuditRuleGroup;
|
|
4
|
-
declare const toAuditRulesFromPayload: (auditRulesPayload: AuditRulePayload[]) => AuditRule[];
|
|
5
|
-
declare const toAuditRuleBaseFromPayload: (auditRuleBasePayload: AuditRuleBasePayload) => AuditRuleBase;
|
|
6
|
-
declare const toAuditRuleFromPayload: (auditRulesPayload: AuditRulePayload) => AuditRule;
|
|
7
|
-
declare const toAuditReportGroupViewFromPayload: (auditReportGroupPayload: AuditReportGroupPayload) => AuditReportGroup;
|
|
8
|
-
declare const toAuditReportGroupQueryFromPayload: (queryPayload: AuditReportGroupQueryPayload) => AuditReportGroupQuery;
|
|
9
|
-
declare const toAuditReportFromPayload: (auditReportPayload: AuditReportPayload) => AuditReport;
|
|
10
|
-
declare const toAuditReportRuleFromPayload: (auditReportRulesPayload: AuditReportRulePayload[]) => AuditReportRule[];
|
|
11
|
-
declare const toAuditRuleReportGroupFromPayload: (auditRuleReportGroupPayload: AuditRuleGroupReportPayload[]) => AuditRuleGroupReport[];
|
|
12
|
-
export { toAuditRuleGroupFromPayload, toAuditRulesFromPayload, toAuditRuleBaseFromPayload, toAuditRuleFromPayload, toAuditReportGroupViewFromPayload, toAuditReportGroupQueryFromPayload, toAuditReportFromPayload, toAuditReportRuleFromPayload, toAuditRuleReportGroupFromPayload, };
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toAuditRuleReportGroupFromPayload = exports.toAuditReportRuleFromPayload = exports.toAuditReportFromPayload = exports.toAuditReportGroupQueryFromPayload = exports.toAuditReportGroupViewFromPayload = exports.toAuditRuleFromPayload = exports.toAuditRuleBaseFromPayload = exports.toAuditRulesFromPayload = exports.toAuditRuleGroupFromPayload = void 0;
|
|
4
|
-
const statusPayload_1 = require("../../commonPayloadTypes/statusPayload");
|
|
5
|
-
const viewAndReport_1 = require("../../commonStateTypes/viewAndReport/viewAndReport");
|
|
6
|
-
const auditReportViewState_1 = require("./auditReportViewState");
|
|
7
|
-
const toAuditRuleGroupFromPayload = (auditRuleGroupPayload) => {
|
|
8
|
-
return {
|
|
9
|
-
auditRuleCategory: auditRuleGroupPayload.audit_rule_category,
|
|
10
|
-
auditRuleGroupDescription: auditRuleGroupPayload.audit_rule_group_description,
|
|
11
|
-
auditRuleGroupId: auditRuleGroupPayload.audit_rule_group_id,
|
|
12
|
-
auditRules: toAuditRulesFromPayload(auditRuleGroupPayload.audit_rules),
|
|
13
|
-
sequence: auditRuleGroupPayload.sequence,
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
exports.toAuditRuleGroupFromPayload = toAuditRuleGroupFromPayload;
|
|
17
|
-
const toAuditRulesFromPayload = (auditRulesPayload) => {
|
|
18
|
-
const auditRules = [];
|
|
19
|
-
auditRulesPayload.forEach((auditRulePayload) => auditRules.push(toAuditRuleFromPayload(auditRulePayload)));
|
|
20
|
-
return auditRules;
|
|
21
|
-
};
|
|
22
|
-
exports.toAuditRulesFromPayload = toAuditRulesFromPayload;
|
|
23
|
-
const toAuditRuleBaseFromPayload = (auditRuleBasePayload) => {
|
|
24
|
-
return {
|
|
25
|
-
auditRuleId: auditRuleBasePayload.audit_rule_id,
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
exports.toAuditRuleBaseFromPayload = toAuditRuleBaseFromPayload;
|
|
29
|
-
const toAuditRuleFromPayload = (auditRulesPayload) => {
|
|
30
|
-
return Object.assign(Object.assign({}, toAuditRuleBaseFromPayload(auditRulesPayload)), { auditRuleDescription: auditRulesPayload.audit_rule_description, sequence: auditRulesPayload.sequence });
|
|
31
|
-
};
|
|
32
|
-
exports.toAuditRuleFromPayload = toAuditRuleFromPayload;
|
|
33
|
-
const toAuditReportGroupViewFromPayload = (auditReportGroupPayload) => {
|
|
34
|
-
const query = toAuditReportGroupQueryFromPayload(auditReportGroupPayload.query);
|
|
35
|
-
const report = toAuditReportFromPayload(auditReportGroupPayload.report);
|
|
36
|
-
return {
|
|
37
|
-
report,
|
|
38
|
-
query,
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
exports.toAuditReportGroupViewFromPayload = toAuditReportGroupViewFromPayload;
|
|
42
|
-
const toAuditReportGroupQueryFromPayload = (queryPayload) => {
|
|
43
|
-
return {
|
|
44
|
-
auditRuleGroupIds: queryPayload.audit_rule_group_ids,
|
|
45
|
-
action: (0, auditReportViewState_1.toAuditReportActionType)(queryPayload.action),
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
exports.toAuditReportGroupQueryFromPayload = toAuditReportGroupQueryFromPayload;
|
|
49
|
-
const toAuditReportFromPayload = (auditReportPayload) => {
|
|
50
|
-
return {
|
|
51
|
-
auditMonthAndYear: auditReportPayload.audit_month_and_year,
|
|
52
|
-
auditRulesGroupReport: toAuditRuleReportGroupFromPayload(auditReportPayload.audit_rules_group_report),
|
|
53
|
-
reportId: auditReportPayload.report_id,
|
|
54
|
-
reportTitle: auditReportPayload.report_title,
|
|
55
|
-
status: (0, statusPayload_1.mapStatusPayloadToStatus)(auditReportPayload.status),
|
|
56
|
-
version: auditReportPayload.version,
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
exports.toAuditReportFromPayload = toAuditReportFromPayload;
|
|
60
|
-
const toAuditReportRuleFromPayload = (auditReportRulesPayload) => {
|
|
61
|
-
var _a;
|
|
62
|
-
return ((_a = auditReportRulesPayload.map((auditReportRulePayload) => {
|
|
63
|
-
return Object.assign(Object.assign({}, toAuditRuleBaseFromPayload(auditReportRulePayload)), { isSuccess: auditReportRulePayload.is_success, entityType: (0, auditReportViewState_1.toAuditRuleEntityType)(auditReportRulePayload.entity_type), entityIds: auditReportRulePayload.entity_ids.map((id) => (0, viewAndReport_1.toReportID)(id)), message: auditReportRulePayload.message, sequence: auditReportRulePayload.sequence });
|
|
64
|
-
})) !== null && _a !== void 0 ? _a : []);
|
|
65
|
-
};
|
|
66
|
-
exports.toAuditReportRuleFromPayload = toAuditReportRuleFromPayload;
|
|
67
|
-
const toAuditRuleReportGroupFromPayload = (auditRuleReportGroupPayload) => {
|
|
68
|
-
return auditRuleReportGroupPayload.map((auditRuleReportGroup) => {
|
|
69
|
-
var _a;
|
|
70
|
-
return {
|
|
71
|
-
auditRuleGroupId: auditRuleReportGroup.audit_rule_group_id,
|
|
72
|
-
isSuccess: auditRuleReportGroup.is_success,
|
|
73
|
-
message: auditRuleReportGroup.message,
|
|
74
|
-
auditRules: toAuditReportRuleFromPayload((_a = auditRuleReportGroup.audit_rules) !== null && _a !== void 0 ? _a : []),
|
|
75
|
-
sequence: auditRuleReportGroup.sequence,
|
|
76
|
-
};
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
exports.toAuditRuleReportGroupFromPayload = toAuditRuleReportGroupFromPayload;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { StatusPayload } from '../../commonPayloadTypes/statusPayload';
|
|
2
|
-
import { ZeniAPIResponse } from '../../responsePayload';
|
|
3
|
-
export interface AuditRuleGroupBasePayload {
|
|
4
|
-
audit_rule_group_id: string;
|
|
5
|
-
}
|
|
6
|
-
export interface AuditRuleGroupPayload extends AuditRuleGroupBasePayload {
|
|
7
|
-
audit_rule_category: string;
|
|
8
|
-
audit_rule_group_description: string;
|
|
9
|
-
audit_rules: AuditRulePayload[];
|
|
10
|
-
sequence: number;
|
|
11
|
-
}
|
|
12
|
-
export interface AuditRuleBasePayload {
|
|
13
|
-
audit_rule_id: string;
|
|
14
|
-
}
|
|
15
|
-
export interface AuditRulePayload extends AuditRuleBasePayload {
|
|
16
|
-
audit_rule_description: string;
|
|
17
|
-
sequence: number;
|
|
18
|
-
}
|
|
19
|
-
export interface AuditRuleGroupsPayload {
|
|
20
|
-
audit_rule_groups: AuditRuleGroupPayload[];
|
|
21
|
-
version: string;
|
|
22
|
-
}
|
|
23
|
-
export interface AuditReportRulePayload extends AuditRuleBasePayload {
|
|
24
|
-
is_success: boolean;
|
|
25
|
-
entity_type: string;
|
|
26
|
-
entity_ids: string[];
|
|
27
|
-
message: string;
|
|
28
|
-
sequence: number;
|
|
29
|
-
}
|
|
30
|
-
export interface AuditRuleGroupReportPayload extends AuditRuleGroupBasePayload {
|
|
31
|
-
is_success: boolean;
|
|
32
|
-
message: string;
|
|
33
|
-
audit_rules?: AuditReportRulePayload[] | null;
|
|
34
|
-
sequence: number;
|
|
35
|
-
}
|
|
36
|
-
export interface AuditReportPayload {
|
|
37
|
-
audit_month_and_year: string;
|
|
38
|
-
audit_rules_group_report: AuditRuleGroupReportPayload[];
|
|
39
|
-
report_id: string;
|
|
40
|
-
report_title: string;
|
|
41
|
-
status: StatusPayload;
|
|
42
|
-
version: string;
|
|
43
|
-
}
|
|
44
|
-
export interface AuditReportGroupQueryPayload {
|
|
45
|
-
audit_rule_group_ids: string[];
|
|
46
|
-
action: string;
|
|
47
|
-
}
|
|
48
|
-
export interface AuditReportGroupPayload {
|
|
49
|
-
query: AuditReportGroupQueryPayload;
|
|
50
|
-
report: AuditReportPayload;
|
|
51
|
-
}
|
|
52
|
-
export declare type AuditReportGroupResponse = ZeniAPIResponse<AuditReportGroupPayload>;
|
|
53
|
-
export declare type AuditRuleGroupsResponse = ZeniAPIResponse<AuditRuleGroupsPayload>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ZeniAPIStatus } from '../../responsePayload';
|
|
2
|
-
import { AuditReportViewState } from './auditReportViewState';
|
|
3
|
-
import { AuditReportGroupPayload, AuditRuleGroupPayload } from './auditReportViewPayload';
|
|
4
|
-
export declare const initialState: AuditReportViewState;
|
|
5
|
-
export declare const fetchAuditRuleGroupView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: any], {
|
|
6
|
-
cacheOverride: any;
|
|
7
|
-
}, string, never, never>, updateAuditRuleGroupViewOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[auditRuleGroups: AuditRuleGroupPayload[]], {
|
|
8
|
-
auditRuleGroups: AuditRuleGroupPayload[];
|
|
9
|
-
}, string, never, never>, updateAuditRuleGroupViewOnFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], {
|
|
10
|
-
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
11
|
-
}, string, never, never>, fetchAuditReportGroupView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, fetchAction: "view" | "generate", reportGroupId: string], {
|
|
12
|
-
companyId: string;
|
|
13
|
-
fetchAction: "view" | "generate";
|
|
14
|
-
reportGroupId: string;
|
|
15
|
-
}, string, never, never>, updateAuditReportGroupViewOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, reportGroupId: string, auditReportGroupPayload: AuditReportGroupPayload], {
|
|
16
|
-
companyId: string;
|
|
17
|
-
reportGroupId: string;
|
|
18
|
-
auditReportGroupPayload: AuditReportGroupPayload;
|
|
19
|
-
}, string, never, never>, updateAuditReportGroupViewOnFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, reportGroupId: string, error: ZeniAPIStatus<Record<string, unknown>>], {
|
|
20
|
-
companyId: string;
|
|
21
|
-
reportGroupId: string;
|
|
22
|
-
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
23
|
-
}, string, never, never>, clearAuditRuleGroupView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, clearAuditReportGroupViewByCompanyId: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string], {
|
|
24
|
-
companyId: string;
|
|
25
|
-
}, string, never, never>, clearAuditReportGroupView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
26
|
-
declare const _default: import("@reduxjs/toolkit").Reducer<AuditReportViewState, import("@reduxjs/toolkit").AnyAction>;
|
|
27
|
-
export default _default;
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearAuditReportGroupView = exports.clearAuditReportGroupViewByCompanyId = exports.clearAuditRuleGroupView = exports.updateAuditReportGroupViewOnFailure = exports.updateAuditReportGroupViewOnSuccess = exports.fetchAuditReportGroupView = exports.updateAuditRuleGroupViewOnFailure = exports.updateAuditRuleGroupViewOnSuccess = exports.fetchAuditRuleGroupView = exports.initialState = void 0;
|
|
5
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const auditReportViewHelper_1 = require("./auditReportViewHelper");
|
|
7
|
-
exports.initialState = {
|
|
8
|
-
auditRuleGroupView: {
|
|
9
|
-
auditRuleGroups: [],
|
|
10
|
-
fetchState: 'Not-Started',
|
|
11
|
-
error: undefined,
|
|
12
|
-
hasValidState() {
|
|
13
|
-
return this.fetchState == 'Completed';
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
auditReportViewByCompanyId: {},
|
|
17
|
-
};
|
|
18
|
-
const auditReportView = (0, toolkit_1.createSlice)({
|
|
19
|
-
name: 'auditReportView',
|
|
20
|
-
initialState: exports.initialState,
|
|
21
|
-
reducers: {
|
|
22
|
-
fetchAuditRuleGroupView: {
|
|
23
|
-
prepare(cacheOverride = true) {
|
|
24
|
-
return { payload: { cacheOverride } };
|
|
25
|
-
},
|
|
26
|
-
reducer(draft) {
|
|
27
|
-
if (draft.auditRuleGroupView.fetchState !== 'Completed' ||
|
|
28
|
-
draft.auditRuleGroupView.auditRuleGroups.length === 0) {
|
|
29
|
-
draft.auditRuleGroupView.fetchState = 'In-Progress';
|
|
30
|
-
}
|
|
31
|
-
draft.auditRuleGroupView.error = undefined;
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
updateAuditRuleGroupViewOnSuccess: {
|
|
35
|
-
reducer(draft, action) {
|
|
36
|
-
const { auditRuleGroups } = action.payload;
|
|
37
|
-
draft.auditRuleGroupView.fetchState = 'Completed';
|
|
38
|
-
draft.auditRuleGroupView.error = undefined;
|
|
39
|
-
draft.auditRuleGroupView.auditRuleGroups = auditRuleGroups.map((ruleGroup) => (0, auditReportViewHelper_1.toAuditRuleGroupFromPayload)(ruleGroup));
|
|
40
|
-
},
|
|
41
|
-
prepare(auditRuleGroups) {
|
|
42
|
-
return {
|
|
43
|
-
payload: { auditRuleGroups },
|
|
44
|
-
};
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
updateAuditRuleGroupViewOnFailure: {
|
|
48
|
-
reducer(draft, action) {
|
|
49
|
-
draft.auditRuleGroupView.fetchState = 'Error';
|
|
50
|
-
draft.auditRuleGroupView.error = action.payload.error;
|
|
51
|
-
},
|
|
52
|
-
prepare(error) {
|
|
53
|
-
return { payload: { error } };
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
fetchAuditReportGroupView: {
|
|
57
|
-
prepare(companyId, fetchAction, reportGroupId) {
|
|
58
|
-
return {
|
|
59
|
-
payload: { companyId, fetchAction, reportGroupId },
|
|
60
|
-
};
|
|
61
|
-
},
|
|
62
|
-
reducer(draft, action) {
|
|
63
|
-
var _a;
|
|
64
|
-
const { companyId, reportGroupId } = action.payload;
|
|
65
|
-
const draftReportById = (_a = draft.auditReportViewByCompanyId[companyId]) === null || _a === void 0 ? void 0 : _a.auditReportGroupViewByGroupId;
|
|
66
|
-
draft.auditReportViewByCompanyId[companyId] = {
|
|
67
|
-
auditReportGroupViewByGroupId: Object.assign(Object.assign({}, draftReportById), { [reportGroupId]: {
|
|
68
|
-
id: reportGroupId,
|
|
69
|
-
fetchState: 'In-Progress',
|
|
70
|
-
error: undefined,
|
|
71
|
-
hasValidState: exports.initialState.auditRuleGroupView.hasValidState,
|
|
72
|
-
} }),
|
|
73
|
-
};
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
updateAuditReportGroupViewOnSuccess: {
|
|
77
|
-
reducer(draft, action) {
|
|
78
|
-
const { auditReportGroupPayload, reportGroupId, companyId } = action.payload;
|
|
79
|
-
draft.auditReportViewByCompanyId[companyId].auditReportGroupViewByGroupId[reportGroupId].fetchState = 'Completed';
|
|
80
|
-
draft.auditReportViewByCompanyId[companyId].auditReportGroupViewByGroupId[reportGroupId].error = undefined;
|
|
81
|
-
draft.auditReportViewByCompanyId[companyId].auditReportGroupViewByGroupId[reportGroupId].auditReportGroup =
|
|
82
|
-
(0, auditReportViewHelper_1.toAuditReportGroupViewFromPayload)(auditReportGroupPayload);
|
|
83
|
-
},
|
|
84
|
-
prepare(companyId, reportGroupId, auditReportGroupPayload) {
|
|
85
|
-
return {
|
|
86
|
-
payload: { companyId, reportGroupId, auditReportGroupPayload },
|
|
87
|
-
};
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
updateAuditReportGroupViewOnFailure: {
|
|
91
|
-
reducer(draft, action) {
|
|
92
|
-
const { companyId, reportGroupId } = action.payload;
|
|
93
|
-
draft.auditReportViewByCompanyId[companyId].auditReportGroupViewByGroupId[reportGroupId].fetchState = 'Error';
|
|
94
|
-
draft.auditReportViewByCompanyId[companyId].auditReportGroupViewByGroupId[reportGroupId].error =
|
|
95
|
-
action.payload.error;
|
|
96
|
-
},
|
|
97
|
-
prepare(companyId, reportGroupId, error) {
|
|
98
|
-
return { payload: { companyId, reportGroupId, error } };
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
clearAuditReportGroupViewByCompanyId: {
|
|
102
|
-
reducer(draft, action) {
|
|
103
|
-
const { companyId } = action.payload;
|
|
104
|
-
delete draft.auditReportViewByCompanyId[companyId];
|
|
105
|
-
},
|
|
106
|
-
prepare(companyId) {
|
|
107
|
-
return {
|
|
108
|
-
payload: { companyId },
|
|
109
|
-
};
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
clearAuditRuleGroupView(draft) {
|
|
113
|
-
draft.auditRuleGroupView = Object.assign(draft.auditRuleGroupView, exports.initialState.auditRuleGroupView);
|
|
114
|
-
},
|
|
115
|
-
clearAuditReportGroupView(draft) {
|
|
116
|
-
Object.assign(draft, exports.initialState);
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
});
|
|
120
|
-
_a = auditReportView.actions, exports.fetchAuditRuleGroupView = _a.fetchAuditRuleGroupView, exports.updateAuditRuleGroupViewOnSuccess = _a.updateAuditRuleGroupViewOnSuccess, exports.updateAuditRuleGroupViewOnFailure = _a.updateAuditRuleGroupViewOnFailure, exports.fetchAuditReportGroupView = _a.fetchAuditReportGroupView, exports.updateAuditReportGroupViewOnSuccess = _a.updateAuditReportGroupViewOnSuccess, exports.updateAuditReportGroupViewOnFailure = _a.updateAuditReportGroupViewOnFailure, exports.clearAuditRuleGroupView = _a.clearAuditRuleGroupView, exports.clearAuditReportGroupViewByCompanyId = _a.clearAuditReportGroupViewByCompanyId, exports.clearAuditReportGroupView = _a.clearAuditReportGroupView;
|
|
121
|
-
exports.default = auditReportView.reducer;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { RootState } from '../../reducer';
|
|
2
|
-
import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
-
import { ID } from '../../commonStateTypes/common';
|
|
4
|
-
import { AuditReport, AuditRuleGroup } from './auditReportViewState';
|
|
5
|
-
export interface AuditRuleGroupViewSelectorView extends SelectorView {
|
|
6
|
-
auditRuleGroups: AuditRuleGroup[];
|
|
7
|
-
}
|
|
8
|
-
export interface AuditReportGroupSelectorView extends SelectorView {
|
|
9
|
-
auditReportGroupId: ID;
|
|
10
|
-
auditReport?: AuditReport;
|
|
11
|
-
}
|
|
12
|
-
export interface AuditReportGroupViewSelectorView {
|
|
13
|
-
auditReportGroups: AuditReportGroupSelectorView[];
|
|
14
|
-
}
|
|
15
|
-
export declare const getAuditRuleGroupViewSelectorView: (state: RootState) => {
|
|
16
|
-
auditRuleGroups: AuditRuleGroup[];
|
|
17
|
-
fetchState: import("../../commonStateTypes/common").FetchState;
|
|
18
|
-
error: import("../..").ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
19
|
-
};
|
|
20
|
-
export declare const getAuditReportGroupViewSelectorView: (companyId: ID, state: RootState) => {
|
|
21
|
-
auditReportGroups: AuditReportGroupSelectorView[];
|
|
22
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAuditReportGroupViewSelectorView = exports.getAuditRuleGroupViewSelectorView = void 0;
|
|
4
|
-
const getAuditRuleGroupViewSelectorView = (state) => {
|
|
5
|
-
const { auditRuleGroupView } = state.auditReportViewState;
|
|
6
|
-
const auditRuleGroups = auditRuleGroupView.auditRuleGroups;
|
|
7
|
-
return {
|
|
8
|
-
auditRuleGroups,
|
|
9
|
-
fetchState: auditRuleGroupView.fetchState,
|
|
10
|
-
error: auditRuleGroupView.error,
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
exports.getAuditRuleGroupViewSelectorView = getAuditRuleGroupViewSelectorView;
|
|
14
|
-
const getAuditReportGroupViewSelectorView = (companyId, state) => {
|
|
15
|
-
var _a;
|
|
16
|
-
const { auditReportViewByCompanyId } = state.auditReportViewState;
|
|
17
|
-
const auditReportGroupViewByGroupId = (_a = auditReportViewByCompanyId[companyId]) === null || _a === void 0 ? void 0 : _a.auditReportGroupViewByGroupId;
|
|
18
|
-
const auditReportGroups = [];
|
|
19
|
-
if (auditReportGroupViewByGroupId != null) {
|
|
20
|
-
Object.values(auditReportGroupViewByGroupId).forEach((reportView) => {
|
|
21
|
-
var _a;
|
|
22
|
-
auditReportGroups.push({
|
|
23
|
-
auditReportGroupId: reportView.id,
|
|
24
|
-
auditReport: (_a = reportView.auditReportGroup) === null || _a === void 0 ? void 0 : _a.report,
|
|
25
|
-
fetchState: reportView.fetchState,
|
|
26
|
-
error: reportView.error,
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
return {
|
|
31
|
-
auditReportGroups,
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
exports.getAuditReportGroupViewSelectorView = getAuditReportGroupViewSelectorView;
|