@zeniai/client-epic-state 4.8.77 → 4.8.78
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/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/epic.d.ts +7 -1
- package/lib/epic.js +7 -1
- package/lib/index.d.ts +15 -7
- package/lib/index.js +35 -12
- package/lib/init.js +1 -1
- package/lib/reducer.d.ts +6 -0
- package/lib/reducer.js +6 -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/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 +52 -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 +162 -0
- package/lib/view/referralView/referralSelector.d.ts +21 -0
- package/lib/view/referralView/referralSelector.js +76 -0
- package/lib/view/referralView/referralState.d.ts +54 -0
- package/lib/view/referralView/referralState.js +37 -0
- 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/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchAuditRuleGroupViewEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
+
const auditReportViewReducer_1 = require("../auditReportViewReducer");
|
|
8
|
+
const fetchAuditRuleGroupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(auditReportViewReducer_1.fetchAuditRuleGroupView.match), (0, operators_1.switchMap)((action) => {
|
|
9
|
+
const { cacheOverride } = action.payload;
|
|
10
|
+
const state = state$.value;
|
|
11
|
+
const { fetchState } = state.auditReportViewState.auditRuleGroupView;
|
|
12
|
+
if (cacheOverride === true || fetchState !== 'In-Progress') {
|
|
13
|
+
return zeniAPI
|
|
14
|
+
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/audit-rule-groups`)
|
|
15
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
16
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
17
|
+
const actions = [
|
|
18
|
+
(0, auditReportViewReducer_1.updateAuditRuleGroupViewOnSuccess)(response.data.audit_rule_groups),
|
|
19
|
+
];
|
|
20
|
+
return (0, rxjs_1.from)(actions);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
const actions = [
|
|
24
|
+
(0, auditReportViewReducer_1.updateAuditRuleGroupViewOnFailure)(response.status),
|
|
25
|
+
];
|
|
26
|
+
return (0, rxjs_1.from)(actions);
|
|
27
|
+
}
|
|
28
|
+
}), (0, operators_1.catchError)((error) => {
|
|
29
|
+
const actions = [
|
|
30
|
+
(0, auditReportViewReducer_1.updateAuditRuleGroupViewOnFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Audit rule group view errored out' + JSON.stringify(error))),
|
|
31
|
+
];
|
|
32
|
+
return (0, rxjs_1.from)(actions);
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
return (0, rxjs_1.from)([]);
|
|
37
|
+
}
|
|
38
|
+
}));
|
|
39
|
+
exports.fetchAuditRuleGroupViewEpic = fetchAuditRuleGroupViewEpic;
|
|
@@ -41,3 +41,5 @@ export interface DownloadCockpitTabOptions {
|
|
|
41
41
|
tabs: CockpitDownloadTabsID[];
|
|
42
42
|
filterByTabs: Record<CockpitDownloadTabsID, FilterCombinationsByTabs>;
|
|
43
43
|
}
|
|
44
|
+
export declare const ALL_ONBOARDING_STEP_KEYS: readonly ["bankAccountLinked", "qboLinked", "identityVerified", "businessVerified"];
|
|
45
|
+
export declare const toOnboardingStepKeyType: (v: string) => "identityVerified" | "businessVerified" | "bankAccountLinked" | "qboLinked";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toManagementStatusCodeType = exports.MANAGEMENT_STATUS_CODES = exports.toHealthSortKeyType = exports.toOnboardingSortKeyType = exports.toManagementSortKeyType = exports.toPortfolioSortKeyType = exports.ALL_HEALTH_SORT_KEYS = exports.ALL_ONBOARDING_SORT_KEYS = exports.ALL_MANAGEMENT_SORT_KEYS = exports.ALL_PORTFOLIO_SORT_KEYS = void 0;
|
|
3
|
+
exports.toOnboardingStepKeyType = exports.ALL_ONBOARDING_STEP_KEYS = exports.toManagementStatusCodeType = exports.MANAGEMENT_STATUS_CODES = exports.toHealthSortKeyType = exports.toOnboardingSortKeyType = exports.toManagementSortKeyType = exports.toPortfolioSortKeyType = exports.ALL_HEALTH_SORT_KEYS = exports.ALL_ONBOARDING_SORT_KEYS = exports.ALL_MANAGEMENT_SORT_KEYS = exports.ALL_PORTFOLIO_SORT_KEYS = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
5
5
|
exports.ALL_PORTFOLIO_SORT_KEYS = [
|
|
6
6
|
'companyName',
|
|
@@ -69,3 +69,11 @@ exports.MANAGEMENT_STATUS_CODES = [
|
|
|
69
69
|
];
|
|
70
70
|
const toManagementStatusCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.MANAGEMENT_STATUS_CODES);
|
|
71
71
|
exports.toManagementStatusCodeType = toManagementStatusCodeType;
|
|
72
|
+
exports.ALL_ONBOARDING_STEP_KEYS = [
|
|
73
|
+
'bankAccountLinked',
|
|
74
|
+
'qboLinked',
|
|
75
|
+
'identityVerified',
|
|
76
|
+
'businessVerified',
|
|
77
|
+
];
|
|
78
|
+
const toOnboardingStepKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_ONBOARDING_STEP_KEYS);
|
|
79
|
+
exports.toOnboardingStepKeyType = toOnboardingStepKeyType;
|
|
@@ -26,7 +26,7 @@ export declare const changeZeniPersonRolesEpic: (actions$: ActionsObservable<Act
|
|
|
26
26
|
type: string;
|
|
27
27
|
} | {
|
|
28
28
|
payload: {
|
|
29
|
-
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";
|
|
29
|
+
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" | "referral_invite_sent";
|
|
30
30
|
messageText: "failed" | "success";
|
|
31
31
|
type: import("../..").SnackbarMessageType;
|
|
32
32
|
showStatusIcon?: boolean | undefined;
|
|
@@ -18,7 +18,7 @@ export declare const deletePersonEpic: (actions$: ActionsObservable<ActionType>,
|
|
|
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" | "referral_invite_sent";
|
|
22
22
|
messageText: "failed" | "success";
|
|
23
23
|
type: import("../..").SnackbarMessageType;
|
|
24
24
|
showStatusIcon?: boolean | undefined;
|
|
@@ -35,7 +35,7 @@ export declare const invitePeopleEpic: (actions$: ActionsObservable<ActionType>,
|
|
|
35
35
|
type: string;
|
|
36
36
|
} | {
|
|
37
37
|
payload: {
|
|
38
|
-
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";
|
|
38
|
+
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" | "referral_invite_sent";
|
|
39
39
|
messageText: "failed" | "success";
|
|
40
40
|
type: import("../..").SnackbarMessageType;
|
|
41
41
|
showStatusIcon?: boolean | undefined;
|
|
@@ -32,7 +32,7 @@ export declare const inviteZeniPeopleEpic: (actions$: ActionsObservable<ActionTy
|
|
|
32
32
|
type: string;
|
|
33
33
|
} | {
|
|
34
34
|
payload: {
|
|
35
|
-
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";
|
|
35
|
+
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" | "referral_invite_sent";
|
|
36
36
|
messageText: "failed" | "success";
|
|
37
37
|
type: import("../..").SnackbarMessageType;
|
|
38
38
|
showStatusIcon?: boolean | undefined;
|
|
@@ -13,7 +13,7 @@ export declare const resendInviteEpic: (actions$: ActionsObservable<ActionType>,
|
|
|
13
13
|
type: string;
|
|
14
14
|
} | {
|
|
15
15
|
payload: {
|
|
16
|
-
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";
|
|
16
|
+
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" | "referral_invite_sent";
|
|
17
17
|
messageText: "failed" | "success";
|
|
18
18
|
type: import("../..").SnackbarMessageType;
|
|
19
19
|
showStatusIcon?: boolean | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
|
+
import { updateReferrals, fetchReferrals, updateReferralsFailure } from '../referralReducer';
|
|
6
|
+
export declare type ActionType = ReturnType<typeof updateReferrals> | ReturnType<typeof fetchReferrals> | ReturnType<typeof updateReferralsFailure>;
|
|
7
|
+
export declare const fetchReferralsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchReferralsEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
+
const referralReducer_1 = require("../referralReducer");
|
|
8
|
+
const fetchReferralsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(referralReducer_1.fetchReferrals.match), (0, operators_1.mergeMap)((action) => {
|
|
9
|
+
const { cacheOverride } = action.payload;
|
|
10
|
+
const state = state$.value;
|
|
11
|
+
const fetchState = state.referralViewState.fetchState;
|
|
12
|
+
if (cacheOverride === true || fetchState === 'Not-Started') {
|
|
13
|
+
const { userId, sessionId } = zeniAPI;
|
|
14
|
+
const headers = {
|
|
15
|
+
'zeni-user-id': userId,
|
|
16
|
+
'zeni-tenant-id': '',
|
|
17
|
+
'zeni-session-id': sessionId,
|
|
18
|
+
};
|
|
19
|
+
return zeniAPI
|
|
20
|
+
.getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/company-referals`, headers)
|
|
21
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
22
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
23
|
+
const actions = [(0, referralReducer_1.updateReferrals)(response.data)];
|
|
24
|
+
return (0, rxjs_1.from)(actions);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
return (0, rxjs_1.of)((0, referralReducer_1.updateReferralsFailure)(response.status));
|
|
28
|
+
}
|
|
29
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, referralReducer_1.updateReferralsFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch referrals REST API call errored out' +
|
|
30
|
+
JSON.stringify(error))))));
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
}));
|
|
36
|
+
exports.fetchReferralsEpic = fetchReferralsEpic;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
|
+
import { fetchRewardsPlan, updateRewardsPlan, updateRewardsPlanFailure } from '../referralReducer';
|
|
6
|
+
export declare type ActionType = ReturnType<typeof updateRewardsPlan> | ReturnType<typeof fetchRewardsPlan> | ReturnType<typeof updateRewardsPlanFailure>;
|
|
7
|
+
export declare const fetchRewardsPlanEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchRewardsPlanEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
+
const referralReducer_1 = require("../referralReducer");
|
|
8
|
+
const fetchRewardsPlanEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(referralReducer_1.fetchRewardsPlan.match), (0, operators_1.mergeMap)((action) => {
|
|
9
|
+
const { cacheOverride } = action.payload;
|
|
10
|
+
const state = state$.value;
|
|
11
|
+
const fetchState = state.referralViewState.rewardsPlanFetchState.fetchState;
|
|
12
|
+
if (cacheOverride === true || fetchState === 'Not-Started') {
|
|
13
|
+
const { userId, sessionId } = zeniAPI;
|
|
14
|
+
const headers = {
|
|
15
|
+
'zeni-user-id': userId,
|
|
16
|
+
'zeni-tenant-id': '',
|
|
17
|
+
'zeni-session-id': sessionId,
|
|
18
|
+
};
|
|
19
|
+
const payload = {
|
|
20
|
+
is_primary_refer_reward_plan: true,
|
|
21
|
+
};
|
|
22
|
+
return zeniAPI
|
|
23
|
+
.getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/company-refer-reward-plan?query=${encodeURIComponent(JSON.stringify(payload))}`, headers)
|
|
24
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
25
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
26
|
+
const actions = [
|
|
27
|
+
(0, referralReducer_1.updateRewardsPlan)(response.data),
|
|
28
|
+
];
|
|
29
|
+
return (0, rxjs_1.from)(actions);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
return (0, rxjs_1.of)((0, referralReducer_1.updateRewardsPlanFailure)(response.status));
|
|
33
|
+
}
|
|
34
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, referralReducer_1.updateRewardsPlanFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch rewards plan REST API call errored out' +
|
|
35
|
+
JSON.stringify(error))))));
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
}));
|
|
41
|
+
exports.fetchRewardsPlanEpic = fetchRewardsPlanEpic;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
|
+
import { resendReferralInvite, resendReferralInviteSuccess, sendReferralInviteFailure } from '../referralReducer';
|
|
6
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
7
|
+
export declare type ActionType = ReturnType<typeof resendReferralInvite> | ReturnType<typeof sendReferralInviteFailure> | ReturnType<typeof resendReferralInviteSuccess> | ReturnType<typeof openSnackbar>;
|
|
8
|
+
export declare const resendReferralInviteEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resendReferralInviteEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
+
const referralReducer_1 = require("../referralReducer");
|
|
8
|
+
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
9
|
+
const resendReferralInviteEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(referralReducer_1.resendReferralInvite.match), (0, operators_1.switchMap)((action) => {
|
|
10
|
+
const { userId, sessionId } = zeniAPI;
|
|
11
|
+
const headers = {
|
|
12
|
+
'zeni-user-id': userId,
|
|
13
|
+
'zeni-tenant-id': '',
|
|
14
|
+
'zeni-session-id': sessionId,
|
|
15
|
+
};
|
|
16
|
+
return zeniAPI
|
|
17
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/company-referals`, { reinvite_to: action.payload.emailId }, headers)
|
|
18
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
19
|
+
if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
|
|
20
|
+
const actions = [
|
|
21
|
+
(0, referralReducer_1.resendReferralInviteSuccess)({
|
|
22
|
+
emailId: action.payload.emailId,
|
|
23
|
+
timestamp: response.data.last_invite_timestamp,
|
|
24
|
+
}),
|
|
25
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
26
|
+
messageSection: 'referral_invite_sent',
|
|
27
|
+
messageText: 'success',
|
|
28
|
+
type: 'success',
|
|
29
|
+
}),
|
|
30
|
+
];
|
|
31
|
+
return actions;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return (0, rxjs_1.of)((0, referralReducer_1.sendReferralInviteFailure)(response.status));
|
|
35
|
+
}
|
|
36
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, referralReducer_1.sendReferralInviteFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Resend referral REST API call errored out' +
|
|
37
|
+
JSON.stringify(error))))));
|
|
38
|
+
}));
|
|
39
|
+
exports.resendReferralInviteEpic = resendReferralInviteEpic;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
|
+
import { sendReferralInvite, sendReferralInviteSuccess, sendReferralInviteFailure } from '../referralReducer';
|
|
6
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
7
|
+
export declare type ActionType = ReturnType<typeof sendReferralInvite> | ReturnType<typeof sendReferralInviteFailure> | ReturnType<typeof sendReferralInviteSuccess> | ReturnType<typeof openSnackbar>;
|
|
8
|
+
export declare const sendReferralInviteEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendReferralInviteEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
+
const referralReducer_1 = require("../referralReducer");
|
|
8
|
+
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
9
|
+
const sendReferralInviteEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(referralReducer_1.sendReferralInvite.match), (0, operators_1.switchMap)(() => {
|
|
10
|
+
const { referralViewState } = state$.value;
|
|
11
|
+
const referralFormLocalData = referralViewState.referralFormLocalData;
|
|
12
|
+
const referRewardsPlanId = referralViewState.rewardsPlan.referRewardPlanId;
|
|
13
|
+
const invitePayload = Object.assign({}, toInvitePayloadFromLocalData(referralFormLocalData, referRewardsPlanId));
|
|
14
|
+
const { userId, sessionId } = zeniAPI;
|
|
15
|
+
const headers = {
|
|
16
|
+
'zeni-user-id': userId,
|
|
17
|
+
'zeni-tenant-id': '',
|
|
18
|
+
'zeni-session-id': sessionId,
|
|
19
|
+
};
|
|
20
|
+
return zeniAPI
|
|
21
|
+
.postAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/company-referals`, invitePayload, headers)
|
|
22
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
23
|
+
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
24
|
+
const actions = [
|
|
25
|
+
(0, referralReducer_1.sendReferralInviteSuccess)(),
|
|
26
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
27
|
+
messageSection: 'referral_invite_sent',
|
|
28
|
+
messageText: 'success',
|
|
29
|
+
type: 'success',
|
|
30
|
+
}),
|
|
31
|
+
];
|
|
32
|
+
return actions;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
return (0, rxjs_1.of)((0, referralReducer_1.sendReferralInviteFailure)(response.status));
|
|
36
|
+
}
|
|
37
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, referralReducer_1.sendReferralInviteFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Send referral REST API call errored out' +
|
|
38
|
+
JSON.stringify(error))))));
|
|
39
|
+
}));
|
|
40
|
+
exports.sendReferralInviteEpic = sendReferralInviteEpic;
|
|
41
|
+
const toInvitePayloadFromLocalData = (inviteCompanyLocalData, referRewardsPlanId) => {
|
|
42
|
+
const invitedCompanies = inviteCompanyLocalData.map((local) => {
|
|
43
|
+
return {
|
|
44
|
+
company: local.companyName,
|
|
45
|
+
email_ids: local.emailIds,
|
|
46
|
+
refer_reward_plan_id: referRewardsPlanId,
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
return {
|
|
50
|
+
referrals: invitedCompanies,
|
|
51
|
+
};
|
|
52
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { AmountPayload } from '../../entity/reimbursement/reimbursementPayload';
|
|
2
|
+
import { ZeniAPIResponse } from '../../responsePayload';
|
|
3
|
+
import { ReferralInvitation } from './referralState';
|
|
4
|
+
export interface ReferralSubmitPayload {
|
|
5
|
+
referal_unique_link: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ReferralResubmitPayload {
|
|
8
|
+
last_invite_timestamp?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare type ReferralSubmitResponse = ZeniAPIResponse<ReferralSubmitPayload>;
|
|
11
|
+
export declare type ReferralResubmitResponse = ZeniAPIResponse<ReferralResubmitPayload>;
|
|
12
|
+
export interface FetchRewardsPayload {
|
|
13
|
+
pending_bonus: AmountPayload;
|
|
14
|
+
earned_bonus: AmountPayload;
|
|
15
|
+
pending_referals: number;
|
|
16
|
+
static_referal_link: string;
|
|
17
|
+
referees: InviteePayload[];
|
|
18
|
+
}
|
|
19
|
+
export interface FetchRewardsPlanPayload {
|
|
20
|
+
create_time: string | null;
|
|
21
|
+
is_deleted: boolean | null;
|
|
22
|
+
is_primary: boolean | null;
|
|
23
|
+
period: number;
|
|
24
|
+
period_unit: string;
|
|
25
|
+
refer_reward_plan_id: string;
|
|
26
|
+
referral_plan_amount: AmountPayload;
|
|
27
|
+
update_time: string | null;
|
|
28
|
+
}
|
|
29
|
+
export interface InviteePayload {
|
|
30
|
+
company_name: string;
|
|
31
|
+
current_state: string;
|
|
32
|
+
invitees_id: string;
|
|
33
|
+
is_active: boolean;
|
|
34
|
+
last_invite_timestamp: string | null;
|
|
35
|
+
referee_email_id: string;
|
|
36
|
+
reward_plan: string;
|
|
37
|
+
user_id: string;
|
|
38
|
+
voucher_id: string;
|
|
39
|
+
referral_amount: AmountPayload;
|
|
40
|
+
}
|
|
41
|
+
export declare type FetchRewardsResponse = ZeniAPIResponse<FetchRewardsPayload>;
|
|
42
|
+
export declare type FetchRewardsPlanResponse = ZeniAPIResponse<FetchRewardsPlanPayload>;
|
|
43
|
+
export declare const toReferralInvitation: (payload: InviteePayload[]) => ReferralInvitation[];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toReferralInvitation = void 0;
|
|
4
|
+
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
5
|
+
const toReferralInvitation = (payload) => {
|
|
6
|
+
const invitations = [];
|
|
7
|
+
payload.map((invitee) => {
|
|
8
|
+
invitations.push({
|
|
9
|
+
companyName: invitee.company_name,
|
|
10
|
+
currentState: invitee.current_state,
|
|
11
|
+
inviteesId: invitee.invitees_id,
|
|
12
|
+
isActive: invitee.is_active,
|
|
13
|
+
lastInviteTimestamp: invitee.last_invite_timestamp != null
|
|
14
|
+
? (0, zeniDayJS_1.date)(invitee.last_invite_timestamp)
|
|
15
|
+
: undefined,
|
|
16
|
+
refereeEmailId: invitee.referee_email_id,
|
|
17
|
+
rewardPlan: invitee.reward_plan,
|
|
18
|
+
userId: invitee.user_id,
|
|
19
|
+
voucherId: invitee.voucher_id,
|
|
20
|
+
amount: {
|
|
21
|
+
amount: invitee.referral_amount.amount,
|
|
22
|
+
currencyCode: invitee.referral_amount.currency_code,
|
|
23
|
+
currencySymbol: invitee.referral_amount.currency_symbol,
|
|
24
|
+
},
|
|
25
|
+
resendInviteStatus: {
|
|
26
|
+
fetchState: 'Not-Started',
|
|
27
|
+
error: undefined,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
return invitations;
|
|
32
|
+
};
|
|
33
|
+
exports.toReferralInvitation = toReferralInvitation;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ZeniAPIStatus } from '../../responsePayload';
|
|
2
|
+
import { InviteCompanyLocalData, ReferralListViewSortKey, ReferralViewState } from './referralState';
|
|
3
|
+
import { FetchRewardsPayload, FetchRewardsPlanPayload } from './referralPayload';
|
|
4
|
+
import { SortOrder } from '../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
5
|
+
export declare const initialState: ReferralViewState;
|
|
6
|
+
export declare const fetchReferrals: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: any], {
|
|
7
|
+
cacheOverride: any;
|
|
8
|
+
}, string, never, never>, updateReferrals: import("@reduxjs/toolkit").ActionCreatorWithPayload<FetchRewardsPayload, string>, updateReferralListSortUiState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
9
|
+
sortOrder: SortOrder;
|
|
10
|
+
sortkey: ReferralListViewSortKey;
|
|
11
|
+
scrollYOffset?: number | undefined;
|
|
12
|
+
}, string>, updateReferralsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, saveReferralFormDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
13
|
+
localData: InviteCompanyLocalData[];
|
|
14
|
+
}, string>, clearReferralFormDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, sendReferralInvite: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, sendReferralInviteSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, sendReferralInviteFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, resendReferralInvite: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[emailId: string], {
|
|
15
|
+
emailId: string;
|
|
16
|
+
}, string, never, never>, resendReferralInviteSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
17
|
+
emailId: string;
|
|
18
|
+
timestamp?: string | undefined;
|
|
19
|
+
}, string>, clearReferrals: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, fetchRewardsPlan: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: any], {
|
|
20
|
+
cacheOverride: any;
|
|
21
|
+
}, string, never, never>, updateRewardsPlan: import("@reduxjs/toolkit").ActionCreatorWithPayload<FetchRewardsPlanPayload, string>, updateRewardsPlanFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>;
|
|
22
|
+
declare const _default: import("@reduxjs/toolkit").Reducer<ReferralViewState, import("@reduxjs/toolkit").AnyAction>;
|
|
23
|
+
export default _default;
|