@zeniai/client-epic-state 4.8.86 → 4.8.87
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 +2 -1
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +4 -3
- package/lib/entity/account/accountSelector.d.ts +6 -6
- package/lib/entity/account/accountState.d.ts +3 -3
- package/lib/entity/account/accountState.js +1 -0
- package/lib/entity/account/pickAndMergeForecastAccountReport.d.ts +2 -2
- package/lib/entity/accountGroup/accountGroupSelector.d.ts +44 -44
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +6 -1
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +11 -1
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +2 -1
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +2 -1
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +5 -1
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +4 -4
- package/lib/entity/jeSchedules/jeSchedulesTypes.js +1 -1
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -1
- package/lib/entity/tenant/clearAllEpic.js +2 -0
- package/lib/entity/tenant/tenantSelector.d.ts +12 -4
- package/lib/entity/tenant/tenantSelector.js +95 -31
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +1 -0
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
- package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +1 -0
- package/lib/epic.d.ts +7 -1
- package/lib/epic.js +7 -1
- package/lib/index.d.ts +21 -13
- package/lib/index.js +48 -20
- package/lib/init.js +1 -1
- package/lib/reducer.d.ts +6 -0
- package/lib/reducer.js +6 -0
- package/lib/view/accountList/accountListReducer.d.ts +2 -2
- package/lib/view/accountList/accountListReducer.js +2 -1
- package/lib/view/accountList/accountListState.d.ts +1 -1
- package/lib/view/accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload.d.ts +1 -1
- 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/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +3 -3
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +3 -3
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/companyView/types/cockpitTypes.d.ts +4 -2
- package/lib/view/companyView/types/cockpitTypes.js +10 -1
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- 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/referralView/epics/fetchReferralsEpic.d.ts +7 -0
- package/lib/view/referralView/epics/fetchReferralsEpic.js +36 -0
- package/lib/view/referralView/epics/fetchRewardsPlanEpic.d.ts +7 -0
- package/lib/view/referralView/epics/fetchRewardsPlanEpic.js +41 -0
- package/lib/view/referralView/epics/resendReferralInviteEpic.d.ts +8 -0
- package/lib/view/referralView/epics/resendReferralInviteEpic.js +39 -0
- package/lib/view/referralView/epics/sendReferralInviteEpic.d.ts +8 -0
- package/lib/view/referralView/epics/sendReferralInviteEpic.js +44 -0
- package/lib/view/referralView/referralPayload.d.ts +43 -0
- package/lib/view/referralView/referralPayload.js +33 -0
- package/lib/view/referralView/referralReducer.d.ts +23 -0
- package/lib/view/referralView/referralReducer.js +167 -0
- package/lib/view/referralView/referralSelector.d.ts +23 -0
- package/lib/view/referralView/referralSelector.js +88 -0
- package/lib/view/referralView/referralState.d.ts +55 -0
- package/lib/view/referralView/referralState.js +40 -0
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reviewCompanyView/fetchReviewCompanyViewEpic.js +1 -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/scheduleView/scheduleDetailView/epics/createNewSchedulesEpic.js +9 -2
- package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsEpic.js +6 -6
- package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsPageEpic.d.ts +3 -2
- package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsPageEpic.js +13 -5
- package/lib/view/scheduleView/scheduleDetailView/epics/initializeScheduleDetailLocalDataEpic.js +11 -8
- package/lib/view/scheduleView/scheduleDetailView/epics/saveScheduleDetailsEpic.js +4 -4
- package/lib/view/scheduleView/scheduleDetailView/epics/updateAmountsInScheduleDetailEpic.js +8 -6
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailLocalDataHelper.d.ts +7 -5
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailLocalDataHelper.js +37 -6
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailPayload.d.ts +8 -4
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailPayload.js +53 -4
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailReducer.d.ts +21 -11
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailReducer.js +66 -35
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailSelector.d.ts +12 -3
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailSelector.js +31 -14
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailState.d.ts +19 -5
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailState.js +0 -3
- package/lib/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +4 -3
- package/lib/view/scheduleView/scheduleListView/epics/fetchScheduleListEpic.d.ts +0 -10
- package/lib/view/scheduleView/scheduleListView/epics/fetchScheduleListEpic.js +7 -24
- package/lib/view/scheduleView/scheduleListView/epics/fetchSchedulesAccountEpic.js +2 -5
- package/lib/view/scheduleView/scheduleListView/scheduleListHelper.d.ts +7 -5
- package/lib/view/scheduleView/scheduleListView/scheduleListHelper.js +37 -28
- package/lib/view/scheduleView/scheduleListView/scheduleListReducer.d.ts +27 -18
- package/lib/view/scheduleView/scheduleListView/scheduleListReducer.js +109 -76
- package/lib/view/scheduleView/scheduleListView/scheduleListSelector.d.ts +4 -8
- package/lib/view/scheduleView/scheduleListView/scheduleListSelector.js +42 -40
- package/lib/view/scheduleView/scheduleListView/scheduleListState.d.ts +16 -13
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +5 -5
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.js +3 -1
- package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +2 -2
- package/lib/view/transactionList/transactionListReducer.d.ts +12 -12
- package/lib/view/vendorList/vendorListSelector.d.ts +2 -2
- package/lib/view/vendorList/vendorListSelector.js +1 -0
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.d.ts +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.updateRewardsPlanFailure = exports.updateRewardsPlan = exports.fetchRewardsPlan = exports.clearReferrals = exports.resendReferralInviteSuccess = exports.resendReferralInvite = exports.sendReferralInviteFailure = exports.closeReferralInviteConfirmationPopup = exports.sendReferralInviteSuccess = exports.sendReferralInvite = exports.clearReferralFormDataInLocalStore = exports.saveReferralFormDataInLocalStore = exports.updateReferralsFailure = exports.updateReferralListSortUiState = exports.updateReferrals = exports.fetchReferrals = exports.initialState = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
const referralPayload_1 = require("./referralPayload");
|
|
7
|
+
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
8
|
+
const amount_1 = require("../../commonStateTypes/amount");
|
|
9
|
+
const zeniUrl_1 = require("../../zeniUrl");
|
|
10
|
+
exports.initialState = {
|
|
11
|
+
fetchState: 'Not-Started',
|
|
12
|
+
error: undefined,
|
|
13
|
+
hasValidState() {
|
|
14
|
+
return this.fetchState === 'Completed';
|
|
15
|
+
},
|
|
16
|
+
earnedBonus: {
|
|
17
|
+
amount: 0,
|
|
18
|
+
currencyCode: 'USD',
|
|
19
|
+
currencySymbol: '$',
|
|
20
|
+
},
|
|
21
|
+
pendingBonus: {
|
|
22
|
+
amount: 0,
|
|
23
|
+
currencyCode: 'USD',
|
|
24
|
+
currencySymbol: '$',
|
|
25
|
+
},
|
|
26
|
+
pendingReferrals: 0,
|
|
27
|
+
invitations: [],
|
|
28
|
+
referralFormLocalData: [
|
|
29
|
+
{
|
|
30
|
+
companyName: '',
|
|
31
|
+
emailIds: [],
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
sendInviteState: {
|
|
35
|
+
fetchState: 'Not-Started',
|
|
36
|
+
},
|
|
37
|
+
uiState: {
|
|
38
|
+
sortKey: 'referral_date',
|
|
39
|
+
sortOrder: 'descending', //default sort order
|
|
40
|
+
},
|
|
41
|
+
referalUniqueLink: (0, zeniUrl_1.toZeniUrl)(''),
|
|
42
|
+
rewardsPlanFetchState: {
|
|
43
|
+
fetchState: 'Not-Started',
|
|
44
|
+
error: undefined,
|
|
45
|
+
},
|
|
46
|
+
rewardsPlan: {
|
|
47
|
+
amount: {
|
|
48
|
+
amount: 0,
|
|
49
|
+
currencyCode: 'USD',
|
|
50
|
+
currencySymbol: '$',
|
|
51
|
+
},
|
|
52
|
+
referRewardPlanId: 'dummy',
|
|
53
|
+
},
|
|
54
|
+
showConfirmationPopup: false,
|
|
55
|
+
};
|
|
56
|
+
const referral = (0, toolkit_1.createSlice)({
|
|
57
|
+
name: 'referral',
|
|
58
|
+
initialState: exports.initialState,
|
|
59
|
+
reducers: {
|
|
60
|
+
fetchReferrals: {
|
|
61
|
+
reducer(draft) {
|
|
62
|
+
draft.fetchState = 'In-Progress';
|
|
63
|
+
draft.error = undefined;
|
|
64
|
+
},
|
|
65
|
+
prepare(cacheOverride = false) {
|
|
66
|
+
return {
|
|
67
|
+
payload: { cacheOverride },
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
updateReferrals(draft, action) {
|
|
72
|
+
draft.fetchState = 'Completed';
|
|
73
|
+
draft.error = undefined;
|
|
74
|
+
draft.earnedBonus = (0, amount_1.toAmount)(action.payload.earned_bonus.amount, action.payload.earned_bonus.currency_code, action.payload.earned_bonus.currency_symbol);
|
|
75
|
+
draft.pendingBonus = (0, amount_1.toAmount)(action.payload.pending_bonus.amount, action.payload.pending_bonus.currency_code, action.payload.pending_bonus.currency_symbol);
|
|
76
|
+
draft.pendingReferrals = action.payload.pending_referals;
|
|
77
|
+
draft.referalUniqueLink = (0, zeniUrl_1.toZeniUrl)(action.payload.static_referal_link);
|
|
78
|
+
draft.invitations = (0, referralPayload_1.toReferralInvitation)(action.payload.referees);
|
|
79
|
+
},
|
|
80
|
+
updateReferralsFailure(draft, action) {
|
|
81
|
+
draft.fetchState = 'Error';
|
|
82
|
+
draft.error = action.payload;
|
|
83
|
+
},
|
|
84
|
+
updateReferralListSortUiState(draft, action) {
|
|
85
|
+
draft.uiState = {
|
|
86
|
+
sortKey: action.payload.sortkey,
|
|
87
|
+
sortOrder: action.payload.sortOrder,
|
|
88
|
+
};
|
|
89
|
+
if (action.payload.scrollYOffset != null) {
|
|
90
|
+
draft.uiState.scrollYOffset = action.payload.scrollYOffset;
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
saveReferralFormDataInLocalStore(draft, action) {
|
|
94
|
+
draft.referralFormLocalData = action.payload.localData;
|
|
95
|
+
},
|
|
96
|
+
clearReferralFormDataInLocalStore(draft) {
|
|
97
|
+
draft.referralFormLocalData = exports.initialState.referralFormLocalData;
|
|
98
|
+
},
|
|
99
|
+
sendReferralInvite(draft) {
|
|
100
|
+
draft.sendInviteState.fetchState = 'In-Progress';
|
|
101
|
+
draft.sendInviteState.error = undefined;
|
|
102
|
+
draft.showConfirmationPopup = true;
|
|
103
|
+
},
|
|
104
|
+
sendReferralInviteSuccess(draft) {
|
|
105
|
+
draft.sendInviteState.fetchState = 'Completed';
|
|
106
|
+
draft.sendInviteState.error = undefined;
|
|
107
|
+
},
|
|
108
|
+
closeReferralInviteConfirmationPopup(draft) {
|
|
109
|
+
draft.showConfirmationPopup = exports.initialState.showConfirmationPopup;
|
|
110
|
+
},
|
|
111
|
+
sendReferralInviteFailure(draft, action) {
|
|
112
|
+
draft.sendInviteState.fetchState = 'Error';
|
|
113
|
+
draft.sendInviteState.error = action.payload;
|
|
114
|
+
},
|
|
115
|
+
resendReferralInvite: {
|
|
116
|
+
prepare(emailId) {
|
|
117
|
+
return { payload: { emailId } };
|
|
118
|
+
},
|
|
119
|
+
reducer(draft, action) {
|
|
120
|
+
const inviteeIndex = draft.invitations.findIndex((invitee) => invitee.refereeEmailId === action.payload.emailId);
|
|
121
|
+
if (inviteeIndex > -1) {
|
|
122
|
+
draft.invitations[inviteeIndex] = Object.assign(Object.assign({}, draft.invitations[inviteeIndex]), { resendInviteStatus: {
|
|
123
|
+
fetchState: 'In-Progress',
|
|
124
|
+
error: undefined,
|
|
125
|
+
} });
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
resendReferralInviteSuccess(draft, action) {
|
|
130
|
+
const inviteeIndex = draft.invitations.findIndex((invitee) => invitee.refereeEmailId === action.payload.emailId);
|
|
131
|
+
if (inviteeIndex > -1) {
|
|
132
|
+
draft.invitations[inviteeIndex] = Object.assign(Object.assign({}, draft.invitations[inviteeIndex]), { resendInviteStatus: {
|
|
133
|
+
fetchState: 'Completed',
|
|
134
|
+
error: undefined,
|
|
135
|
+
}, lastInviteTimestamp: action.payload.timestamp != null
|
|
136
|
+
? (0, zeniDayJS_1.date)(action.payload.timestamp)
|
|
137
|
+
: undefined });
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
fetchRewardsPlan: {
|
|
141
|
+
reducer(draft) {
|
|
142
|
+
draft.rewardsPlanFetchState.fetchState = 'In-Progress';
|
|
143
|
+
draft.rewardsPlanFetchState.error = undefined;
|
|
144
|
+
},
|
|
145
|
+
prepare(cacheOverride = false) {
|
|
146
|
+
return {
|
|
147
|
+
payload: { cacheOverride },
|
|
148
|
+
};
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
updateRewardsPlan(draft, action) {
|
|
152
|
+
draft.rewardsPlanFetchState.fetchState = 'Completed';
|
|
153
|
+
draft.rewardsPlanFetchState.error = undefined;
|
|
154
|
+
draft.rewardsPlan.amount = (0, amount_1.toAmount)(action.payload.referral_plan_amount.amount, action.payload.referral_plan_amount.currency_code, action.payload.referral_plan_amount.currency_symbol);
|
|
155
|
+
draft.rewardsPlan.referRewardPlanId = action.payload.refer_reward_plan_id;
|
|
156
|
+
},
|
|
157
|
+
updateRewardsPlanFailure(draft, action) {
|
|
158
|
+
draft.rewardsPlanFetchState.fetchState = 'Error';
|
|
159
|
+
draft.rewardsPlanFetchState.error = action.payload;
|
|
160
|
+
},
|
|
161
|
+
clearReferrals(draft) {
|
|
162
|
+
draft.referralFormLocalData = exports.initialState.referralFormLocalData;
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
_a = referral.actions, exports.fetchReferrals = _a.fetchReferrals, exports.updateReferrals = _a.updateReferrals, exports.updateReferralListSortUiState = _a.updateReferralListSortUiState, exports.updateReferralsFailure = _a.updateReferralsFailure, exports.saveReferralFormDataInLocalStore = _a.saveReferralFormDataInLocalStore, exports.clearReferralFormDataInLocalStore = _a.clearReferralFormDataInLocalStore, exports.sendReferralInvite = _a.sendReferralInvite, exports.sendReferralInviteSuccess = _a.sendReferralInviteSuccess, exports.closeReferralInviteConfirmationPopup = _a.closeReferralInviteConfirmationPopup, exports.sendReferralInviteFailure = _a.sendReferralInviteFailure, exports.resendReferralInvite = _a.resendReferralInvite, exports.resendReferralInviteSuccess = _a.resendReferralInviteSuccess, exports.clearReferrals = _a.clearReferrals, exports.fetchRewardsPlan = _a.fetchRewardsPlan, exports.updateRewardsPlan = _a.updateRewardsPlan, exports.updateRewardsPlanFailure = _a.updateRewardsPlanFailure;
|
|
167
|
+
exports.default = referral.reducer;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { RootState } from '../../reducer';
|
|
2
|
+
import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
+
import { InviteCompanyLocalData, ReferralInvitation, ReferralViewUIState } from './referralState';
|
|
4
|
+
import { Amount } from '../../commonStateTypes/amount';
|
|
5
|
+
import { FetchStateAndError } from '../../commonStateTypes/common';
|
|
6
|
+
import ZeniUrl from '../../zeniUrl';
|
|
7
|
+
export interface ReferralListSelectorView extends SelectorView {
|
|
8
|
+
earnedBonus: Amount;
|
|
9
|
+
pendingBonus: Amount;
|
|
10
|
+
pendingReferrals: number;
|
|
11
|
+
referralLink: ZeniUrl;
|
|
12
|
+
invitations: ReferralInvitation[];
|
|
13
|
+
uiState: ReferralViewUIState;
|
|
14
|
+
showConfirmationPopup: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface InviteFormSelectorView extends SelectorView {
|
|
17
|
+
localData: InviteCompanyLocalData[];
|
|
18
|
+
saveStatus: FetchStateAndError;
|
|
19
|
+
amount: Amount;
|
|
20
|
+
showConfirmationPopup: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare const getReferralListView: (state: RootState) => ReferralListSelectorView;
|
|
23
|
+
export declare const getInviteFormView: (state: RootState) => InviteFormSelectorView;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getInviteFormView = exports.getReferralListView = void 0;
|
|
7
|
+
const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
8
|
+
const getReferralListView = (state) => {
|
|
9
|
+
const { referralViewState } = state;
|
|
10
|
+
const { fetchState, error } = referralViewState;
|
|
11
|
+
const unsortedInvitations = referralViewState.invitations;
|
|
12
|
+
const invitationsWithNoSortKeyValue = [];
|
|
13
|
+
const invitationsWithSortKeyValue = [];
|
|
14
|
+
const { sortKey, sortOrder } = referralViewState.uiState;
|
|
15
|
+
unsortedInvitations.forEach((invitation) => {
|
|
16
|
+
switch (sortKey) {
|
|
17
|
+
case 'invitee_email':
|
|
18
|
+
if (Boolean(invitation.refereeEmailId) === true) {
|
|
19
|
+
invitationsWithSortKeyValue.push(invitation);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
invitationsWithNoSortKeyValue.push(invitation);
|
|
23
|
+
}
|
|
24
|
+
break;
|
|
25
|
+
case 'amount':
|
|
26
|
+
if (Boolean(invitation.amount) === true) {
|
|
27
|
+
invitationsWithSortKeyValue.push(invitation);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
invitationsWithNoSortKeyValue.push(invitation);
|
|
31
|
+
}
|
|
32
|
+
break;
|
|
33
|
+
case 'status':
|
|
34
|
+
if (Boolean(invitation.statusCode) === true) {
|
|
35
|
+
invitationsWithSortKeyValue.push(invitation);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
invitationsWithNoSortKeyValue.push(invitation);
|
|
39
|
+
}
|
|
40
|
+
break;
|
|
41
|
+
case 'referral_date':
|
|
42
|
+
if (Boolean(invitation.lastInviteTimestamp) === true) {
|
|
43
|
+
invitationsWithSortKeyValue.push(invitation);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
invitationsWithNoSortKeyValue.push(invitation);
|
|
47
|
+
}
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
const sortedInvitations = (0, orderBy_1.default)(invitationsWithSortKeyValue, (invitation) => {
|
|
52
|
+
switch (sortKey) {
|
|
53
|
+
case 'invitee_email':
|
|
54
|
+
return invitation.refereeEmailId.toLowerCase();
|
|
55
|
+
case 'amount':
|
|
56
|
+
return invitation.amount.amount;
|
|
57
|
+
case 'status':
|
|
58
|
+
return invitation.statusCode.toLowerCase();
|
|
59
|
+
case 'referral_date':
|
|
60
|
+
return invitation.lastInviteTimestamp;
|
|
61
|
+
}
|
|
62
|
+
}, sortOrder === 'ascending' ? 'asc' : 'desc');
|
|
63
|
+
return {
|
|
64
|
+
earnedBonus: referralViewState.earnedBonus,
|
|
65
|
+
pendingBonus: referralViewState.pendingBonus,
|
|
66
|
+
pendingReferrals: referralViewState.pendingReferrals,
|
|
67
|
+
referralLink: referralViewState.referalUniqueLink,
|
|
68
|
+
invitations: sortedInvitations,
|
|
69
|
+
uiState: referralViewState.uiState,
|
|
70
|
+
fetchState,
|
|
71
|
+
error,
|
|
72
|
+
amount: referralViewState.rewardsPlan.amount,
|
|
73
|
+
showConfirmationPopup: referralViewState.showConfirmationPopup,
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
exports.getReferralListView = getReferralListView;
|
|
77
|
+
const getInviteFormView = (state) => {
|
|
78
|
+
const { referralViewState } = state;
|
|
79
|
+
return {
|
|
80
|
+
localData: referralViewState.referralFormLocalData,
|
|
81
|
+
saveStatus: referralViewState.sendInviteState,
|
|
82
|
+
amount: referralViewState.rewardsPlan.amount,
|
|
83
|
+
fetchState: referralViewState.rewardsPlanFetchState.fetchState,
|
|
84
|
+
error: referralViewState.rewardsPlanFetchState.error,
|
|
85
|
+
showConfirmationPopup: referralViewState.showConfirmationPopup,
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
exports.getInviteFormView = getInviteFormView;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Amount } from '../../commonStateTypes/amount';
|
|
2
|
+
import { FetchStateAndError, FetchedState, ID } from '../../commonStateTypes/common';
|
|
3
|
+
import { SortOrder } from '../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
4
|
+
import { ZeniDate } from '../../zeniDayJS';
|
|
5
|
+
import ZeniUrl from '../../zeniUrl';
|
|
6
|
+
export interface ReferralInvitation {
|
|
7
|
+
companyName: string;
|
|
8
|
+
statusCode: string;
|
|
9
|
+
inviteesId: ID;
|
|
10
|
+
isActive: boolean;
|
|
11
|
+
lastInviteTimestamp?: ZeniDate;
|
|
12
|
+
refereeEmailId: string;
|
|
13
|
+
rewardPlan: string;
|
|
14
|
+
userId: ID;
|
|
15
|
+
voucherId: ID;
|
|
16
|
+
amount: Amount;
|
|
17
|
+
resendInviteStatus: FetchStateAndError;
|
|
18
|
+
}
|
|
19
|
+
export interface ReferralViewState extends FetchedState {
|
|
20
|
+
earnedBonus: Amount;
|
|
21
|
+
pendingBonus: Amount;
|
|
22
|
+
pendingReferrals: number;
|
|
23
|
+
invitations: ReferralInvitation[];
|
|
24
|
+
referralFormLocalData: InviteCompanyLocalData[];
|
|
25
|
+
referalUniqueLink: ZeniUrl;
|
|
26
|
+
sendInviteState: FetchStateAndError;
|
|
27
|
+
uiState: ReferralViewUIState;
|
|
28
|
+
rewardsPlanFetchState: FetchStateAndError;
|
|
29
|
+
rewardsPlan: RewardsPlanData;
|
|
30
|
+
showConfirmationPopup: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface ReferralViewUIState {
|
|
33
|
+
sortOrder: SortOrder;
|
|
34
|
+
sortKey: ReferralListViewSortKey;
|
|
35
|
+
scrollYOffset?: number;
|
|
36
|
+
}
|
|
37
|
+
export interface RewardsPlanData {
|
|
38
|
+
amount: Amount;
|
|
39
|
+
referRewardPlanId: ID;
|
|
40
|
+
}
|
|
41
|
+
export interface InviteCompanyLocalData {
|
|
42
|
+
companyName: string;
|
|
43
|
+
emailIds: string[];
|
|
44
|
+
}
|
|
45
|
+
export declare const REFERRAL_LIST_VIEW_SORT_KEYS: readonly ["invitee_email", "amount", "status", "referral_date"];
|
|
46
|
+
export declare const toReferralListViewSortKeyType: (v: string) => "status" | "amount" | "invitee_email" | "referral_date";
|
|
47
|
+
export declare type ReferralListViewSortKey = ReturnType<typeof toReferralListViewSortKeyType>;
|
|
48
|
+
export declare const ALL_REFERRAL_STATUSES: readonly ["invite_sent", "onboarding", "active", "declined", "resend_invite", "reward_sent"];
|
|
49
|
+
export declare const toReferralStatusType: (v: string) => "active" | "onboarding" | "invite_sent" | "declined" | "resend_invite" | "reward_sent";
|
|
50
|
+
export declare type ReferralStatus = ReturnType<typeof toReferralStatusType>;
|
|
51
|
+
export declare const StatusTypes: Record<ReferralStatus, string>;
|
|
52
|
+
export declare const ALL_REFERRAL_AMOUNT_STATUSES: readonly ["received", "to_be_received"];
|
|
53
|
+
export declare const toReferralAmountStatusType: (v: string) => "received" | "to_be_received";
|
|
54
|
+
export declare type ReferralAmountStatus = ReturnType<typeof toReferralAmountStatusType>;
|
|
55
|
+
export declare const AmountStatusTypes: Record<ReferralAmountStatus, string>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AmountStatusTypes = exports.toReferralAmountStatusType = exports.ALL_REFERRAL_AMOUNT_STATUSES = exports.StatusTypes = exports.toReferralStatusType = exports.ALL_REFERRAL_STATUSES = exports.toReferralListViewSortKeyType = exports.REFERRAL_LIST_VIEW_SORT_KEYS = void 0;
|
|
4
|
+
const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
|
|
5
|
+
exports.REFERRAL_LIST_VIEW_SORT_KEYS = [
|
|
6
|
+
'invitee_email',
|
|
7
|
+
'amount',
|
|
8
|
+
'status',
|
|
9
|
+
'referral_date',
|
|
10
|
+
];
|
|
11
|
+
const toReferralListViewSortKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.REFERRAL_LIST_VIEW_SORT_KEYS);
|
|
12
|
+
exports.toReferralListViewSortKeyType = toReferralListViewSortKeyType;
|
|
13
|
+
exports.ALL_REFERRAL_STATUSES = [
|
|
14
|
+
'invite_sent',
|
|
15
|
+
'onboarding',
|
|
16
|
+
'active',
|
|
17
|
+
'declined',
|
|
18
|
+
'resend_invite',
|
|
19
|
+
'reward_sent',
|
|
20
|
+
];
|
|
21
|
+
const toReferralStatusType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_REFERRAL_STATUSES);
|
|
22
|
+
exports.toReferralStatusType = toReferralStatusType;
|
|
23
|
+
exports.StatusTypes = {
|
|
24
|
+
invite_sent: 'Invite Sent',
|
|
25
|
+
onboarding: 'Onboarding',
|
|
26
|
+
active: 'Active',
|
|
27
|
+
declined: 'Declined',
|
|
28
|
+
resend_invite: 'Resend Invite',
|
|
29
|
+
reward_sent: 'Reward Sent',
|
|
30
|
+
};
|
|
31
|
+
exports.ALL_REFERRAL_AMOUNT_STATUSES = [
|
|
32
|
+
'received',
|
|
33
|
+
'to_be_received',
|
|
34
|
+
];
|
|
35
|
+
const toReferralAmountStatusType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_REFERRAL_AMOUNT_STATUSES);
|
|
36
|
+
exports.toReferralAmountStatusType = toReferralAmountStatusType;
|
|
37
|
+
exports.AmountStatusTypes = {
|
|
38
|
+
received: 'Received',
|
|
39
|
+
to_be_received: 'To be received',
|
|
40
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RootState } from '../../reducer';
|
|
2
2
|
export declare const getReimbursementCardReport: (state: RootState) => {
|
|
3
|
-
reportId: "cash_balance" | "card_balance" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses";
|
|
3
|
+
reportId: "cash_balance" | "card_balance" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets";
|
|
4
4
|
reportTitle: string;
|
|
5
5
|
version: string | number | undefined;
|
|
6
6
|
fetchState: import("../..").FetchState;
|
|
@@ -11,7 +11,7 @@ const fetchReviewCompanyViewEpic = (actions$, state$, zeniAPI) => actions$.pipe(
|
|
|
11
11
|
const { fetchState } = state.reviewCompanyViewState;
|
|
12
12
|
if (cacheOverride === true || fetchState !== 'In-Progress') {
|
|
13
13
|
return zeniAPI
|
|
14
|
-
.getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels/
|
|
14
|
+
.getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels/audit`)
|
|
15
15
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
16
16
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
17
17
|
const actions = [
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { ID } from '../../commonStateTypes/common';
|
|
2
2
|
import { OnboardingInfoPayload } from '../../entity/company/companyPayload';
|
|
3
3
|
import { ZeniAPIResponse } from '../../responsePayload';
|
|
4
|
+
export interface AuditSummaryPayload {
|
|
5
|
+
fixes_required: number;
|
|
6
|
+
total_checks: number;
|
|
7
|
+
audit_score_percentage: number;
|
|
8
|
+
audit_report_last_generated_date?: string | null;
|
|
9
|
+
}
|
|
4
10
|
export interface ReviewCompanyPayload {
|
|
5
11
|
company_id: ID;
|
|
6
12
|
name: string;
|
|
@@ -12,11 +18,29 @@ export interface ReviewCompanyPayload {
|
|
|
12
18
|
is_uncategorized_income_transactions_present: boolean;
|
|
13
19
|
is_miscategorized_expenses_transactions_present: boolean;
|
|
14
20
|
is_miscategorized_income_transactions_present: boolean;
|
|
15
|
-
onboarding_info?: OnboardingInfoPayload;
|
|
16
21
|
is_vendor_review_required: boolean;
|
|
22
|
+
onboarding_info?: OnboardingInfoPayload;
|
|
23
|
+
audit_summary: AuditSummaryPayload;
|
|
24
|
+
}
|
|
25
|
+
export interface AuditRuleGroupPayload {
|
|
26
|
+
audit_rule_category: string;
|
|
27
|
+
audit_rule_group_description: string;
|
|
28
|
+
audit_rule_group_id: string;
|
|
29
|
+
audit_rules: AuditRulePayload[];
|
|
30
|
+
sequence: number;
|
|
31
|
+
}
|
|
32
|
+
export interface AuditRulePayload {
|
|
33
|
+
audit_rule_description: string;
|
|
34
|
+
audit_rule_id: string;
|
|
35
|
+
sequence: number;
|
|
36
|
+
}
|
|
37
|
+
export interface AuditRuleGroupsPayload {
|
|
38
|
+
audit_rule_groups: AuditRuleGroupPayload[];
|
|
39
|
+
version: string;
|
|
17
40
|
}
|
|
18
41
|
export interface ReviewCompanyViewPayload {
|
|
19
42
|
companies: ReviewCompanyPayload[];
|
|
20
43
|
}
|
|
21
44
|
export declare type ReviewCompanyListResponse = ZeniAPIResponse<ReviewCompanyViewPayload>;
|
|
45
|
+
export declare type AuditRuleGroupsResponse = ZeniAPIResponse<AuditRuleGroupsPayload>;
|
|
22
46
|
export declare type RetryBankAccountConnectionResponse = ZeniAPIResponse<ReviewCompanyViewPayload>;
|
|
@@ -12,3 +12,4 @@ export interface ReviewCompanySelectorView extends SelectorView {
|
|
|
12
12
|
}
|
|
13
13
|
export declare const getReviewCompanySelectorView: (state: RootState) => ReviewCompanySelectorView;
|
|
14
14
|
export declare const getReviewCompanyListCount: (state: RootState) => number;
|
|
15
|
+
export declare const getAuditWarningsCount: (companyView: ReviewCompanyView) => number;
|
|
@@ -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.getReviewCompanyListCount = exports.getReviewCompanySelectorView = void 0;
|
|
6
|
+
exports.getAuditWarningsCount = 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,7 +27,8 @@ 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
|
|
30
|
+
var _a;
|
|
31
|
+
const warningCount = (0, exports.getAuditWarningsCount)(company);
|
|
31
32
|
switch (sortKey) {
|
|
32
33
|
case 'notes':
|
|
33
34
|
return (_a = company.note) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
@@ -37,12 +38,10 @@ exports.getReviewCompanySelectorView = (0, toolkit_1.createSelector)((state) =>
|
|
|
37
38
|
case 'miscategorized':
|
|
38
39
|
return ((company.miscategorizedTransactions.income ? 1 : 0) +
|
|
39
40
|
(company.miscategorizedTransactions.expense ? 1 : 0));
|
|
40
|
-
case '
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
case 'identityVerified':
|
|
45
|
-
return (_d = company.onboardingInfo) === null || _d === void 0 ? void 0 : _d[sortKey].status.toLowerCase();
|
|
41
|
+
case 'warnings':
|
|
42
|
+
return warningCount;
|
|
43
|
+
case 'auditScore':
|
|
44
|
+
return company.auditSummary.fixesRequired;
|
|
46
45
|
case 'reviewVendor':
|
|
47
46
|
return company.isVendorReviewReqiured;
|
|
48
47
|
case 'companyName':
|
|
@@ -62,3 +61,27 @@ exports.getReviewCompanyListCount = (0, toolkit_1.createSelector)((state) => sta
|
|
|
62
61
|
const companies = (0, values_1.default)(rootState.reviewCompanyViewState.reviewCompanyById);
|
|
63
62
|
return companies.length;
|
|
64
63
|
});
|
|
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,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;
|
|
@@ -6,8 +6,9 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const scheduleDetailReducer_1 = require("../scheduleDetailReducer");
|
|
7
7
|
const jeSchedulesSelector_1 = require("../../../../entity/jeSchedules/jeSchedulesSelector");
|
|
8
8
|
const scheduleDetailLocalDataHelper_1 = require("../scheduleDetailLocalDataHelper");
|
|
9
|
-
const createNewSchedulesEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(scheduleDetailReducer_1.createNewSchedules.match), (0, operators_1.mergeMap)(() => {
|
|
9
|
+
const createNewSchedulesEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(scheduleDetailReducer_1.createNewSchedules.match), (0, operators_1.mergeMap)((action) => {
|
|
10
10
|
const actions = [];
|
|
11
|
+
const scheduleType = action.payload.scheduleType;
|
|
11
12
|
const state = state$.value;
|
|
12
13
|
const { scheduleDetailState } = state;
|
|
13
14
|
const selectedJEScheduleKey = scheduleDetailState.selectedJEScheduleKey;
|
|
@@ -15,10 +16,16 @@ const createNewSchedulesEpic = (actions$, state$) => actions$.pipe((0, operators
|
|
|
15
16
|
const jeScheduleTransactionState = (0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleKey)(selectedJEScheduleKey, state);
|
|
16
17
|
const totalAmount = jeScheduleTransactionState.baseTransaction.amount;
|
|
17
18
|
const vendorName = jeScheduleTransactionState.vendor.name;
|
|
19
|
+
const currentLocalData = scheduleDetailState.newScheduleState[scheduleType];
|
|
20
|
+
const assetId = currentLocalData.scheduleType === 'fixed_assets'
|
|
21
|
+
? currentLocalData.assetId
|
|
22
|
+
: undefined;
|
|
18
23
|
const localData = {
|
|
19
|
-
|
|
24
|
+
scheduleType,
|
|
25
|
+
jeScheduleDetails: (0, scheduleDetailLocalDataHelper_1.createNewSchedulesHelper)(scheduleDetailState.newScheduleState[scheduleType], totalAmount, vendorName, scheduleType === 'fixed_assets' ? { assetId } : undefined),
|
|
20
26
|
};
|
|
21
27
|
actions.push((0, scheduleDetailReducer_1.updateScheduleDetailsLocalData)({
|
|
28
|
+
scheduleType,
|
|
22
29
|
selectedJeScheduleDetailId: undefined,
|
|
23
30
|
localData,
|
|
24
31
|
}));
|