@zeniai/client-epic-state 5.2.58-beta1ND → 5.2.58-betaNB1
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/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -1
- package/lib/entity/reconciliationReport/reconciliationReportPayload.d.ts +123 -0
- package/lib/entity/reconciliationReport/reconciliationReportPayload.js +2 -0
- package/lib/entity/reconciliationReport/reconciliationReportReducer.d.ts +7 -0
- package/lib/entity/reconciliationReport/reconciliationReportReducer.js +172 -0
- package/lib/entity/reconciliationReport/reconciliationReportSelector.d.ts +3 -0
- package/lib/entity/reconciliationReport/reconciliationReportSelector.js +10 -0
- package/lib/entity/reconciliationReport/reconciliationReportState.d.ts +132 -0
- package/lib/entity/reconciliationReport/reconciliationReportState.js +15 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/epic.d.ts +2 -1
- package/lib/epic.js +2 -0
- package/lib/esm/entity/reconciliationReport/reconciliationReportPayload.js +1 -0
- package/lib/esm/entity/reconciliationReport/reconciliationReportReducer.js +167 -0
- package/lib/esm/entity/reconciliationReport/reconciliationReportSelector.js +4 -0
- package/lib/esm/entity/reconciliationReport/reconciliationReportState.js +10 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/esm/epic.js +2 -0
- package/lib/esm/index.js +4 -2
- package/lib/esm/reducer.js +6 -0
- package/lib/esm/view/recommendation/recommendationPayload.js +1 -3
- package/lib/esm/view/recommendation/recommendationReducer.js +7 -27
- package/lib/esm/view/recommendation/recommendationSelector.js +0 -1
- package/lib/esm/view/recommendation/submitRecommendationFeedbackEpic.js +8 -20
- package/lib/esm/view/reconciliationReportView/epic/fetchReconciliationReportEpic.js +29 -0
- package/lib/esm/view/reconciliationReportView/reconciliationReportViewPayload.js +1 -0
- package/lib/esm/view/reconciliationReportView/reconciliationReportViewReducer.js +44 -0
- package/lib/esm/view/reconciliationReportView/reconciliationReportViewSelector.js +10 -0
- package/lib/esm/view/reconciliationReportView/reconciliationReportViewState.js +1 -0
- package/lib/index.d.ts +5 -2
- package/lib/index.js +38 -36
- package/lib/reducer.d.ts +2 -0
- package/lib/reducer.js +6 -0
- package/lib/rootStateTypes.d.ts +4 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/recommendation/recommendationPayload.d.ts +0 -1
- package/lib/view/recommendation/recommendationPayload.js +0 -5
- package/lib/view/recommendation/recommendationReducer.d.ts +1 -7
- package/lib/view/recommendation/recommendationReducer.js +8 -28
- package/lib/view/recommendation/recommendationSelector.d.ts +0 -2
- package/lib/view/recommendation/recommendationSelector.js +1 -3
- package/lib/view/recommendation/recommendationState.d.ts +1 -2
- package/lib/view/recommendation/submitRecommendationFeedbackEpic.d.ts +2 -2
- package/lib/view/recommendation/submitRecommendationFeedbackEpic.js +6 -18
- package/lib/view/reconciliationReportView/epic/fetchReconciliationReportEpic.d.ts +19 -0
- package/lib/view/reconciliationReportView/epic/fetchReconciliationReportEpic.js +33 -0
- package/lib/view/reconciliationReportView/reconciliationReportViewPayload.d.ts +3 -0
- package/lib/view/reconciliationReportView/reconciliationReportViewPayload.js +2 -0
- package/lib/view/reconciliationReportView/reconciliationReportViewReducer.d.ts +13 -0
- package/lib/view/reconciliationReportView/reconciliationReportViewReducer.js +48 -0
- package/lib/view/reconciliationReportView/reconciliationReportViewSelector.d.ts +9 -0
- package/lib/view/reconciliationReportView/reconciliationReportViewSelector.js +13 -0
- package/lib/view/reconciliationReportView/reconciliationReportViewState.d.ts +4 -0
- package/lib/view/reconciliationReportView/reconciliationReportViewState.js +2 -0
- package/package.json +1 -1
package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export declare const getLineItemsByTransactionsIdsFromResponse: (transactions: S
|
|
|
39
39
|
export declare const getLineItemsByTransactionIdsFromLocalData: (transactionLocalData: TransactionReviewLocalDataSelectorView[], selectedTab: TransactionsTab) => Record<ID, string[]>;
|
|
40
40
|
export declare const mergeTabSpecificLineItems: (currentTabSpecificLineItems: TabSpecificLineItems, selectedTab: TransactionsTab, newLineItems: TabSpecificLineItems) => TabSpecificLineItems;
|
|
41
41
|
export declare const getSnackbarMessageForTransactionReview: (updatedCount: number, failedCount: number, categorizedCount: number) => {
|
|
42
|
-
messageSection: "common" | "
|
|
42
|
+
messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "actual_matching_match_and_reverse" | "actual_matching_undo_reversal" | "audit_score_updated" | "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_approval_reorder" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "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_approval_reorder" | "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" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "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" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "card_policy_created" | "card_policy_updated" | "card_policy_deleted" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "revert_schedule" | "ignore_accrual" | "revert_accrual" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "snooze_task" | "unsnooze_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "receipts_bulk_match" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "auto_transfer_rule_create" | "auto_transfer_rule_update" | "auto_transfer_rule_delete" | "auto_transfer_rule_pause" | "auto_transfer_rule_resume" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "create_transfer_entry" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed" | "accounting_classes_enabled_update" | "accounting_projects_enabled_update" | "accounting_projects_qbo_not_enabled" | "capitalization_threshold_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "confirm_statement_mapping" | "statement_parsing_in_progress" | "statement_parsing_complete" | "ai_accountant_trigger_job" | "oauth_consent_approve" | "oauth_consent_invalid_request" | "credit_agent_update_profile" | "credit_agent_save_macro" | "credit_agent_schedule_cron" | "create_sub_task" | "qbo_connection_already_linked" | "qbo_connection_failed" | "accounting_projects_qbo_reconnect_failed" | "product_services_update" | "qbo_realm_id_update" | "invoicing_dunning_case_resolved" | "invoicing_dunning_retry" | "invoicing_dunning_cancel" | "invoicing_dunning_settings_save" | "invoicing_qbo_backfill" | "invoicing_qbo_sync_health_retry" | "invoicing_qbo_settings_save" | "invoicing_branding_save" | "invoicing_discount_archive" | "invoicing_discount_unarchive" | "invoicing_discount_delete" | "invoicing_invoice_reminder_sent" | "invoicing_invoice_regenerated" | "invoicing_invoice_voided" | "invoicing_catalog_item_saved" | "invoicing_customer_saved" | "invoicing_subscription_saved" | "invoicing_coupon_saved" | "invoicing_invoice_saved" | "invoicing_credit_note_saved" | "invoicing_payment_recorded" | "invoicing_subscription_activated" | "invoicing_subscription_cancellation_removed" | "invoicing_subscription_cancelled" | "invoicing_subscription_non_renewing" | "invoicing_subscription_paused" | "invoicing_subscription_reactivated" | "invoicing_subscription_resumed" | "invoicing_subscription_term_end_changed";
|
|
43
43
|
messageText: "notification" | "failed" | "success";
|
|
44
44
|
type: "error" | "success" | "info";
|
|
45
45
|
variables: {
|
|
@@ -15,7 +15,6 @@ export type FetchRecommendationResponseWithCOT = ZeniAPIResponse<FetchRecommenda
|
|
|
15
15
|
export type RecommendationFeedbackDimension = 'vendor' | 'category' | 'class';
|
|
16
16
|
export type RecommendationFeedbackSource = 'primary' | 'alternate' | 'shadow' | 'qbo';
|
|
17
17
|
export type RecommendationFeedbackOutcome = 'accepted' | 'override_ranked' | 'override_outside' | 'retracted';
|
|
18
|
-
export declare const isPromptedRecommendationFeedback: (outcome: RecommendationFeedbackOutcome) => boolean;
|
|
19
18
|
export interface RecommendationFeedbackValue {
|
|
20
19
|
name: string;
|
|
21
20
|
id?: string | null;
|
|
@@ -1,7 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isPromptedRecommendationFeedback = void 0;
|
|
4
|
-
// Only an override opens the feedback popup. Silent accepts and retractions post
|
|
5
|
-
// in the background, so they must not drive the popup's loader or its toast.
|
|
6
|
-
const isPromptedRecommendationFeedback = (outcome) => outcome === 'override_outside' || outcome === 'override_ranked';
|
|
7
|
-
exports.isPromptedRecommendationFeedback = isPromptedRecommendationFeedback;
|
|
@@ -58,12 +58,6 @@ export declare const fetchEntityRecommendationsByTransactionId: import("@reduxjs
|
|
|
58
58
|
}, "recommendation/updateRecommendationForEntityFailure">, indicateReadyToInitializeRecommendation: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[entityIdOrName: string, entityType: EntityType], {
|
|
59
59
|
entityIdOrName: string;
|
|
60
60
|
entityType: EntityType;
|
|
61
|
-
}, "recommendation/indicateReadyToInitializeRecommendation", never, never>, submitRecommendationFeedback: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[args: SubmitRecommendationFeedbackPayload], SubmitRecommendationFeedbackPayload, "recommendation/submitRecommendationFeedback", never, never
|
|
62
|
-
succeeded: boolean;
|
|
63
|
-
error?: ZeniAPIStatus;
|
|
64
|
-
}], {
|
|
65
|
-
succeeded: boolean;
|
|
66
|
-
error?: ZeniAPIStatus;
|
|
67
|
-
}, "recommendation/submitRecommendationFeedbackCompleted", never, never>;
|
|
61
|
+
}, "recommendation/indicateReadyToInitializeRecommendation", never, never>, submitRecommendationFeedback: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[args: SubmitRecommendationFeedbackPayload], SubmitRecommendationFeedbackPayload, "recommendation/submitRecommendationFeedback", never, never>;
|
|
68
62
|
declare const _default: import("redux").Reducer<EntityRecommendationState>;
|
|
69
63
|
export default _default;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.submitRecommendationFeedback = exports.indicateReadyToInitializeRecommendation = exports.updateRecommendationForEntityFailure = exports.updateRecommendationForEntity = exports.fetchRecommendationByEntityId = exports.fetchRecommendationByEntityName = exports.fetchEntityRecommendationsForLineUpdate = exports.fetchEntityRecommendationsByTransactionId = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const rootActions_1 = require("../../rootActions");
|
|
7
|
-
const recommendationPayload_1 = require("./recommendationPayload");
|
|
8
7
|
const recommendationState_1 = require("./recommendationState");
|
|
9
8
|
exports.initialState = {
|
|
10
|
-
feedbackSubmitState: { fetchState: 'Not-Started', error: undefined },
|
|
11
9
|
recommendationByEntity: {},
|
|
12
10
|
};
|
|
13
11
|
const recommendation = (0, toolkit_1.createSlice)({
|
|
@@ -137,31 +135,13 @@ const recommendation = (0, toolkit_1.createSlice)({
|
|
|
137
135
|
};
|
|
138
136
|
},
|
|
139
137
|
},
|
|
140
|
-
//
|
|
141
|
-
// override). Handled by submitRecommendationFeedbackEpic
|
|
142
|
-
// accounting recommendation-feedback endpoint.
|
|
143
|
-
//
|
|
138
|
+
// Fire-and-forget human feedback on a recommendation (accept, ranked
|
|
139
|
+
// override or outside override). Handled by submitRecommendationFeedbackEpic
|
|
140
|
+
// which POSTs to the accounting recommendation-feedback endpoint. No state
|
|
141
|
+
// mutation: the categorization UX must not depend on the feedback round-trip.
|
|
144
142
|
submitRecommendationFeedback: {
|
|
145
|
-
reducer(
|
|
146
|
-
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
draft.feedbackSubmitState = {
|
|
150
|
-
fetchState: 'In-Progress',
|
|
151
|
-
error: undefined,
|
|
152
|
-
};
|
|
153
|
-
},
|
|
154
|
-
prepare(args) {
|
|
155
|
-
return { payload: args };
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
submitRecommendationFeedbackCompleted: {
|
|
159
|
-
reducer(draft, action) {
|
|
160
|
-
const { succeeded, error } = action.payload;
|
|
161
|
-
draft.feedbackSubmitState = {
|
|
162
|
-
fetchState: succeeded ? 'Completed' : 'Error',
|
|
163
|
-
error,
|
|
164
|
-
};
|
|
143
|
+
reducer() {
|
|
144
|
+
// Fire-and-forget: no state mutation; the epic performs the POST.
|
|
165
145
|
},
|
|
166
146
|
prepare(args) {
|
|
167
147
|
return { payload: args };
|
|
@@ -174,7 +154,7 @@ const recommendation = (0, toolkit_1.createSlice)({
|
|
|
174
154
|
});
|
|
175
155
|
},
|
|
176
156
|
});
|
|
177
|
-
_a = recommendation.actions, exports.fetchEntityRecommendationsByTransactionId = _a.fetchEntityRecommendationsByTransactionId, exports.fetchEntityRecommendationsForLineUpdate = _a.fetchEntityRecommendationsForLineUpdate, exports.fetchRecommendationByEntityName = _a.fetchRecommendationByEntityName, exports.fetchRecommendationByEntityId = _a.fetchRecommendationByEntityId, exports.updateRecommendationForEntity = _a.updateRecommendationForEntity, exports.updateRecommendationForEntityFailure = _a.updateRecommendationForEntityFailure, exports.indicateReadyToInitializeRecommendation = _a.indicateReadyToInitializeRecommendation, exports.submitRecommendationFeedback = _a.submitRecommendationFeedback
|
|
157
|
+
_a = recommendation.actions, exports.fetchEntityRecommendationsByTransactionId = _a.fetchEntityRecommendationsByTransactionId, exports.fetchEntityRecommendationsForLineUpdate = _a.fetchEntityRecommendationsForLineUpdate, exports.fetchRecommendationByEntityName = _a.fetchRecommendationByEntityName, exports.fetchRecommendationByEntityId = _a.fetchRecommendationByEntityId, exports.updateRecommendationForEntity = _a.updateRecommendationForEntity, exports.updateRecommendationForEntityFailure = _a.updateRecommendationForEntityFailure, exports.indicateReadyToInitializeRecommendation = _a.indicateReadyToInitializeRecommendation, exports.submitRecommendationFeedback = _a.submitRecommendationFeedback;
|
|
178
158
|
exports.default = recommendation.reducer;
|
|
179
159
|
const doUpdateRecommendationForEntity = (draft, entityId, entityType, payload) => {
|
|
180
160
|
const key = (0, recommendationState_1.getEntityRecommendationKey)(entityType, entityId);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { FetchStateAndError } from '../../commonStateTypes/common';
|
|
2
1
|
import { Recommendation } from '../../commonStateTypes/recommendationBase';
|
|
3
2
|
import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
3
|
import { EntityType } from '../../entity/genericEntity/entity';
|
|
@@ -9,4 +8,3 @@ export interface RecommendationByEntitySelectorView extends SelectorView {
|
|
|
9
8
|
recommendations?: Recommendation[];
|
|
10
9
|
}
|
|
11
10
|
export declare const getRecommendationsForEntity: (state: RootState, entityId: string, entityType: EntityType) => RecommendationByEntitySelectorView;
|
|
12
|
-
export declare const getRecommendationFeedbackSubmitState: (state: RootState) => FetchStateAndError;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getRecommendationsForEntity = void 0;
|
|
4
4
|
const recommendationState_1 = require("./recommendationState");
|
|
5
5
|
const getRecommendationsForEntity = (state, entityId, entityType) => {
|
|
6
6
|
const { entityRecommendationState } = state;
|
|
@@ -15,5 +15,3 @@ const getRecommendationsForEntity = (state, entityId, entityType) => {
|
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
17
|
exports.getRecommendationsForEntity = getRecommendationsForEntity;
|
|
18
|
-
const getRecommendationFeedbackSubmitState = (state) => state.entityRecommendationState.feedbackSubmitState;
|
|
19
|
-
exports.getRecommendationFeedbackSubmitState = getRecommendationFeedbackSubmitState;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FetchedState } from '../../commonStateTypes/common';
|
|
2
2
|
import { Recommendation } from '../../commonStateTypes/recommendationBase';
|
|
3
3
|
import { EntityType } from '../../entity/genericEntity/entity';
|
|
4
4
|
export declare const getEntityRecommendationKey: (entityType: EntityType, entityIdOrName: string) => `vendor_${string}` | `customer_${string}` | `merchant_${string}`;
|
|
@@ -8,6 +8,5 @@ export interface EntityRecommendationsStatus extends FetchedState {
|
|
|
8
8
|
}
|
|
9
9
|
export declare const initialEntityRecommendationState: EntityRecommendationsStatus;
|
|
10
10
|
export interface EntityRecommendationState {
|
|
11
|
-
feedbackSubmitState: FetchStateAndError;
|
|
12
11
|
recommendationByEntity: Record<EntityRecommendationKey, EntityRecommendationsStatus>;
|
|
13
12
|
}
|
|
@@ -2,6 +2,6 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { RootState } from '../../reducer';
|
|
4
4
|
import { ZeniAPI } from '../../zeniAPI';
|
|
5
|
-
import { submitRecommendationFeedback
|
|
6
|
-
export type ActionType = ReturnType<typeof submitRecommendationFeedback
|
|
5
|
+
import { submitRecommendationFeedback } from './recommendationReducer';
|
|
6
|
+
export type ActionType = ReturnType<typeof submitRecommendationFeedback>;
|
|
7
7
|
export declare const submitRecommendationFeedbackEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -4,7 +4,6 @@ exports.submitRecommendationFeedbackEpic = void 0;
|
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const responsePayload_1 = require("../../responsePayload");
|
|
7
|
-
const recommendationPayload_1 = require("./recommendationPayload");
|
|
8
7
|
const recommendationReducer_1 = require("./recommendationReducer");
|
|
9
8
|
const toRequestBody = (payload) => ({
|
|
10
9
|
line_id: payload.lineId ?? null,
|
|
@@ -37,32 +36,21 @@ const toRequestBody = (payload) => ({
|
|
|
37
36
|
retracts_feedback_id: payload.retractsFeedbackId ?? null,
|
|
38
37
|
features: payload.features ?? null,
|
|
39
38
|
});
|
|
40
|
-
//
|
|
41
|
-
//
|
|
42
|
-
//
|
|
39
|
+
// Fire-and-forget: the epic never re-emits an action. Feedback delivery is a
|
|
40
|
+
// side-effect that must not disrupt the categorization UX, so both the
|
|
41
|
+
// success and error paths complete silently (errors are logged for debugging).
|
|
43
42
|
const submitRecommendationFeedbackEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(recommendationReducer_1.submitRecommendationFeedback.match), (0, operators_1.mergeMap)((action) => {
|
|
44
43
|
const { transactionId } = action.payload;
|
|
45
|
-
// Only the override that opened the popup reports completion; accepts and
|
|
46
|
-
// retractions stay fire-and-forget so they cannot settle the popup.
|
|
47
|
-
const isPrompted = (0, recommendationPayload_1.isPromptedRecommendationFeedback)(action.payload.outcome);
|
|
48
44
|
return zeniAPI
|
|
49
45
|
.postAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/transactions/${transactionId}/recommendation-feedback`, toRequestBody(action.payload))
|
|
50
46
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
51
|
-
|
|
52
|
-
if (!succeeded) {
|
|
47
|
+
if (!(0, responsePayload_1.isSuccessStatus)(response)) {
|
|
53
48
|
console.error('submitRecommendationFeedbackEpic: recommendation feedback was not recorded', response.status);
|
|
54
49
|
}
|
|
55
|
-
return
|
|
56
|
-
? (0, rxjs_1.of)((0, recommendationReducer_1.submitRecommendationFeedbackCompleted)({
|
|
57
|
-
succeeded,
|
|
58
|
-
error: succeeded ? undefined : response.status,
|
|
59
|
-
}))
|
|
60
|
-
: rxjs_1.EMPTY;
|
|
50
|
+
return rxjs_1.EMPTY;
|
|
61
51
|
}), (0, operators_1.catchError)((error) => {
|
|
62
52
|
console.error('submitRecommendationFeedbackEpic: failed to submit recommendation feedback', error);
|
|
63
|
-
return
|
|
64
|
-
? (0, rxjs_1.of)((0, recommendationReducer_1.submitRecommendationFeedbackCompleted)({ succeeded: false }))
|
|
65
|
-
: rxjs_1.EMPTY;
|
|
53
|
+
return rxjs_1.EMPTY;
|
|
66
54
|
}));
|
|
67
55
|
}));
|
|
68
56
|
exports.submitRecommendationFeedbackEpic = submitRecommendationFeedbackEpic;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { updateReconciliationReport } from '../../../entity/reconciliationReport/reconciliationReportReducer';
|
|
3
|
+
import { RootState } from '../../../rootStateTypes';
|
|
4
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
|
+
import { fetchReconciliationReport, fetchReconciliationReportFailure, fetchReconciliationReportSuccess } from '../reconciliationReportViewReducer';
|
|
6
|
+
export type ActionType = ReturnType<typeof fetchReconciliationReport> | ReturnType<typeof updateReconciliationReport> | ReturnType<typeof fetchReconciliationReportSuccess> | ReturnType<typeof fetchReconciliationReportFailure>;
|
|
7
|
+
export declare const fetchReconciliationReportEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
8
|
+
payload: import("../../../entity/reconciliationReport/reconciliationReportPayload").ReconciliationReportPayload;
|
|
9
|
+
type: "reconciliationReport/updateReconciliationReport";
|
|
10
|
+
} | {
|
|
11
|
+
payload: string;
|
|
12
|
+
type: "reconciliationReportView/fetchReconciliationReportSuccess";
|
|
13
|
+
} | {
|
|
14
|
+
payload: {
|
|
15
|
+
reconciliationId: import("../../..").ID;
|
|
16
|
+
status: import("../../../zeniAPIStatus").ZeniAPIStatus;
|
|
17
|
+
};
|
|
18
|
+
type: "reconciliationReportView/fetchReconciliationReportFailure";
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchReconciliationReportEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const reconciliationReportReducer_1 = require("../../../entity/reconciliationReport/reconciliationReportReducer");
|
|
7
|
+
const reconciliationReportSelector_1 = require("../../../entity/reconciliationReport/reconciliationReportSelector");
|
|
8
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
9
|
+
const reconciliationReportViewReducer_1 = require("../reconciliationReportViewReducer");
|
|
10
|
+
const fetchReconciliationReportEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(reconciliationReportViewReducer_1.fetchReconciliationReport.match), (0, operators_1.switchMap)((action) => {
|
|
11
|
+
const { reconciliationId, cacheOverride } = action.payload;
|
|
12
|
+
const cachedReport = (0, reconciliationReportSelector_1.getReconciliationReportByReconciliationId)(state$.value.reconciliationReportState, reconciliationId);
|
|
13
|
+
if (cacheOverride === true || cachedReport == null) {
|
|
14
|
+
return zeniAPI
|
|
15
|
+
.getJSON(`${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/2.0/reconciliation/${reconciliationId}/report`)
|
|
16
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
17
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) === true &&
|
|
18
|
+
response.data != null) {
|
|
19
|
+
return (0, rxjs_1.of)((0, reconciliationReportReducer_1.updateReconciliationReport)(response.data), (0, reconciliationReportViewReducer_1.fetchReconciliationReportSuccess)(reconciliationId));
|
|
20
|
+
}
|
|
21
|
+
return (0, rxjs_1.of)((0, reconciliationReportViewReducer_1.fetchReconciliationReportFailure)({
|
|
22
|
+
reconciliationId,
|
|
23
|
+
status: response.status,
|
|
24
|
+
}));
|
|
25
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, reconciliationReportViewReducer_1.fetchReconciliationReportFailure)({
|
|
26
|
+
reconciliationId,
|
|
27
|
+
status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch Reconciliation Report REST API call errored out' +
|
|
28
|
+
JSON.stringify(error)),
|
|
29
|
+
}))));
|
|
30
|
+
}
|
|
31
|
+
return (0, rxjs_1.of)((0, reconciliationReportViewReducer_1.fetchReconciliationReportSuccess)(reconciliationId));
|
|
32
|
+
}));
|
|
33
|
+
exports.fetchReconciliationReportEpic = fetchReconciliationReportEpic;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ID } from '../../commonStateTypes/common';
|
|
2
|
+
import { ZeniAPIStatus } from '../../responsePayload';
|
|
3
|
+
import { ReconciliationReportViewState } from './reconciliationReportViewState';
|
|
4
|
+
export declare const initialState: ReconciliationReportViewState;
|
|
5
|
+
export declare const fetchReconciliationReport: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[reconciliationId: string, cacheOverride?: any], {
|
|
6
|
+
reconciliationId: string;
|
|
7
|
+
cacheOverride: any;
|
|
8
|
+
}, "reconciliationReportView/fetchReconciliationReport", never, never>, fetchReconciliationReportSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "reconciliationReportView/fetchReconciliationReportSuccess">, fetchReconciliationReportFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
9
|
+
reconciliationId: ID;
|
|
10
|
+
status: ZeniAPIStatus;
|
|
11
|
+
}, "reconciliationReportView/fetchReconciliationReportFailure">;
|
|
12
|
+
declare const _default: import("redux").Reducer<ReconciliationReportViewState>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.fetchReconciliationReportFailure = exports.fetchReconciliationReportSuccess = exports.fetchReconciliationReport = exports.initialState = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
const rootActions_1 = require("../../rootActions");
|
|
7
|
+
exports.initialState = {
|
|
8
|
+
fetchReconciliationReportState: {},
|
|
9
|
+
};
|
|
10
|
+
const reconciliationReportView = (0, toolkit_1.createSlice)({
|
|
11
|
+
name: 'reconciliationReportView',
|
|
12
|
+
initialState: exports.initialState,
|
|
13
|
+
reducers: {
|
|
14
|
+
fetchReconciliationReport: {
|
|
15
|
+
prepare(reconciliationId, cacheOverride = false) {
|
|
16
|
+
return { payload: { reconciliationId, cacheOverride } };
|
|
17
|
+
},
|
|
18
|
+
reducer(draft, action) {
|
|
19
|
+
const { reconciliationId } = action.payload;
|
|
20
|
+
draft.fetchReconciliationReportState[reconciliationId] = {
|
|
21
|
+
fetchState: 'In-Progress',
|
|
22
|
+
error: undefined,
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
fetchReconciliationReportSuccess(draft, action) {
|
|
27
|
+
const reconciliationId = action.payload;
|
|
28
|
+
draft.fetchReconciliationReportState[reconciliationId] = {
|
|
29
|
+
fetchState: 'Completed',
|
|
30
|
+
error: undefined,
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
fetchReconciliationReportFailure(draft, action) {
|
|
34
|
+
const { reconciliationId, status } = action.payload;
|
|
35
|
+
draft.fetchReconciliationReportState[reconciliationId] = {
|
|
36
|
+
fetchState: 'Error',
|
|
37
|
+
error: status,
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
extraReducers: (builder) => {
|
|
42
|
+
builder.addCase(rootActions_1.clearAll, (draft) => {
|
|
43
|
+
Object.assign(draft, exports.initialState);
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
_a = reconciliationReportView.actions, exports.fetchReconciliationReport = _a.fetchReconciliationReport, exports.fetchReconciliationReportSuccess = _a.fetchReconciliationReportSuccess, exports.fetchReconciliationReportFailure = _a.fetchReconciliationReportFailure;
|
|
48
|
+
exports.default = reconciliationReportView.reducer;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FetchState, ID } from '../../commonStateTypes/common';
|
|
2
|
+
import { ReconciliationReport } from '../../entity/reconciliationReport/reconciliationReportState';
|
|
3
|
+
import { ZeniAPIStatus } from '../../responsePayload';
|
|
4
|
+
import { RootState } from '../../rootStateTypes';
|
|
5
|
+
export declare function getReconciliationReport(state: RootState, reconciliationId: ID): {
|
|
6
|
+
fetchState: FetchState;
|
|
7
|
+
fetchError?: ZeniAPIStatus;
|
|
8
|
+
report?: ReconciliationReport;
|
|
9
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReconciliationReport = getReconciliationReport;
|
|
4
|
+
const reconciliationReportSelector_1 = require("../../entity/reconciliationReport/reconciliationReportSelector");
|
|
5
|
+
function getReconciliationReport(state, reconciliationId) {
|
|
6
|
+
const fetchReconciliationReportState = state.reconciliationReportViewState.fetchReconciliationReportState[reconciliationId];
|
|
7
|
+
const report = (0, reconciliationReportSelector_1.getReconciliationReportByReconciliationId)(state.reconciliationReportState, reconciliationId);
|
|
8
|
+
return {
|
|
9
|
+
fetchState: fetchReconciliationReportState?.fetchState ?? 'Not-Started',
|
|
10
|
+
fetchError: fetchReconciliationReportState?.error,
|
|
11
|
+
report,
|
|
12
|
+
};
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.2.58-
|
|
3
|
+
"version": "5.2.58-betaNB1",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|