@zeniai/client-epic-state 4.10.94 → 4.10.96
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/vendor/vendorPayload.d.ts +0 -2
- package/lib/entity/vendor/vendorPayload.js +1 -4
- package/lib/entity/vendor/vendorState.d.ts +0 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListPayload.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +3 -1
- package/lib/view/vendorReviewView/vendorFirstReviewView/epics/fetchVendorFirstReviewViewEpic.js +0 -1
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewPayload.d.ts +0 -3
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.js +5 -7
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewSelector.d.ts +0 -2
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewSelector.js +0 -2
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewState.d.ts +2 -4
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewState.js +1 -2
- package/package.json +1 -1
|
@@ -10,7 +10,6 @@ import { UserPayload } from '../user/userPayload';
|
|
|
10
10
|
import { FilePayload } from '../file/filePayload';
|
|
11
11
|
import { RecommendationPayload } from '../../commonPayloadTypes/recommendationPayload';
|
|
12
12
|
import { PaymentInstrumentPayload } from '../paymentInstrument/paymentInstrumentPayload';
|
|
13
|
-
import { AttachmentPayload } from '../transaction/payloadTypes/attachmentPayload';
|
|
14
13
|
export interface VendorBasePayload {
|
|
15
14
|
vendor_id: string;
|
|
16
15
|
vendor_name: string;
|
|
@@ -35,7 +34,6 @@ export interface VendorPayload extends VendorBasePayload, SpendPayload {
|
|
|
35
34
|
qbo_id: string;
|
|
36
35
|
currency_code: string;
|
|
37
36
|
currency_symbol: string;
|
|
38
|
-
transaction_attachments?: AttachmentPayload[] | null;
|
|
39
37
|
title?: string;
|
|
40
38
|
suffix?: string;
|
|
41
39
|
first_name?: string;
|
|
@@ -5,7 +5,6 @@ const urlPayload_1 = require("../../commonPayloadTypes/urlPayload");
|
|
|
5
5
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
6
6
|
const transactionPayload_1 = require("../transaction/payloadTypes/transactionPayload");
|
|
7
7
|
const billTransactionState_1 = require("../billPay/billTransaction/billTransactionState");
|
|
8
|
-
const attachmentPayload_1 = require("../transaction/payloadTypes/attachmentPayload");
|
|
9
8
|
const mapVendorBasePayloadToVendorBase = (payload) => ({
|
|
10
9
|
id: payload.vendor_id,
|
|
11
10
|
name: payload.vendor_name,
|
|
@@ -37,8 +36,6 @@ const mapVendorPayloadToVendor = (payload) => {
|
|
|
37
36
|
? (0, transactionPayload_1.transformRecommendation)(payload.recommendation[0]) // In this case, there will be only one recommendation item since this is entity recommendation payload.
|
|
38
37
|
: [], preferredInternationalTransferFeeBearerPaymentMethod: payload.preferred_international_transfer_fee_bearer_payment_method != null
|
|
39
38
|
? (0, billTransactionState_1.toInternationalTransferFeeBearerPaymentMethod)(payload.preferred_international_transfer_fee_bearer_payment_method)
|
|
40
|
-
: undefined
|
|
41
|
-
? payload.transaction_attachments.map((attachmentPayload) => (0, attachmentPayload_1.toAttachment)(attachmentPayload))
|
|
42
|
-
: [] });
|
|
39
|
+
: undefined });
|
|
43
40
|
};
|
|
44
41
|
exports.mapVendorPayloadToVendor = mapVendorPayloadToVendor;
|
|
@@ -4,7 +4,6 @@ import { Recommendation } from '../../commonStateTypes/recommendationBase';
|
|
|
4
4
|
import { ZeniDate } from '../../zeniDayJS';
|
|
5
5
|
import { ZeniUrl as Url } from '../../zeniUrl';
|
|
6
6
|
import { InternationalTransferFeeBearerPaymentMethod } from '../billPay/billTransaction/billTransactionState';
|
|
7
|
-
import { Attachment } from '../transaction/stateTypes/attachment';
|
|
8
7
|
export interface VendorBase {
|
|
9
8
|
id: ID;
|
|
10
9
|
name: string;
|
|
@@ -58,7 +57,6 @@ export interface Vendor extends VendorBase {
|
|
|
58
57
|
last6MonthsSpend?: number;
|
|
59
58
|
last12MonthsSpend?: number;
|
|
60
59
|
previousYearSpend?: number;
|
|
61
|
-
transactionAttachments?: Attachment[];
|
|
62
60
|
}
|
|
63
61
|
export interface VendorState {
|
|
64
62
|
vendorByID: Record<ID, Vendor>;
|
|
@@ -28,9 +28,9 @@ export interface CreditAccount extends FetchStateAndError {
|
|
|
28
28
|
status: CreditAccountStatusType;
|
|
29
29
|
available: Amount;
|
|
30
30
|
balance: Amount;
|
|
31
|
-
cashback: Amount;
|
|
32
31
|
hold: Amount;
|
|
33
32
|
limit: Amount;
|
|
33
|
+
cashback?: Amount;
|
|
34
34
|
}
|
|
35
35
|
export declare const initialCreditAcc: CreditAccount;
|
|
36
36
|
export declare const initialIssueChargeCard: IssueChargeCard;
|
|
@@ -18,7 +18,6 @@ export interface CreditAccountPayload {
|
|
|
18
18
|
};
|
|
19
19
|
is_for_charge_cards: boolean;
|
|
20
20
|
balance_amount: number;
|
|
21
|
-
cashback_amount: number;
|
|
22
21
|
hold_amount: number;
|
|
23
22
|
available_amount: number;
|
|
24
23
|
currency_code: string;
|
|
@@ -26,6 +25,7 @@ export interface CreditAccountPayload {
|
|
|
26
25
|
credit_limit: number;
|
|
27
26
|
create_time: string;
|
|
28
27
|
update_time: string;
|
|
28
|
+
cashback_amount?: number | null;
|
|
29
29
|
}
|
|
30
30
|
export interface CreditAccountListPayload {
|
|
31
31
|
credit_accounts: CreditAccountPayload[];
|
|
@@ -110,7 +110,9 @@ const toCreditAccount = (payload) => ({
|
|
|
110
110
|
status: (0, chargeCardList_1.toCreditAccountStatusType)(payload.status.code),
|
|
111
111
|
available: (0, amount_1.toAmount)(payload.available_amount, payload.currency_code, payload.currency_symbol),
|
|
112
112
|
balance: (0, amount_1.toAmount)(payload.balance_amount, payload.currency_code, payload.currency_symbol),
|
|
113
|
-
cashback:
|
|
113
|
+
cashback: payload.cashback_amount != null
|
|
114
|
+
? (0, amount_1.toAmount)(payload.cashback_amount, payload.currency_code, payload.currency_symbol)
|
|
115
|
+
: undefined,
|
|
114
116
|
hold: (0, amount_1.toAmount)(payload.hold_amount, payload.currency_code, payload.currency_symbol),
|
|
115
117
|
limit: (0, amount_1.toAmount)(payload.credit_limit, payload.currency_code, payload.currency_symbol),
|
|
116
118
|
fetchState: 'Completed',
|
package/lib/view/vendorReviewView/vendorFirstReviewView/epics/fetchVendorFirstReviewViewEpic.js
CHANGED
|
@@ -67,7 +67,6 @@ const mapVendorPayloadFromVendorFirstReviewViewResponse = (vendor) => {
|
|
|
67
67
|
qbo_id: vendor.qbo_id,
|
|
68
68
|
currency_code: vendor.currency_code,
|
|
69
69
|
currency_symbol: vendor.currency_symbol,
|
|
70
|
-
transaction_attachments: vendor.transaction_attachments,
|
|
71
70
|
};
|
|
72
71
|
};
|
|
73
72
|
const mapUsersPayloadFromVendorFirstReviewViewResponse = (vendorsResponse) => {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { AttachmentPayload } from '../../../entity/transaction/payloadTypes/attachmentPayload';
|
|
2
1
|
import { UserBasePayload } from '../../../entity/user/userPayload';
|
|
3
2
|
import { VendorPayload } from '../../../entity/vendor/vendorPayload';
|
|
4
3
|
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
@@ -9,7 +8,6 @@ export interface VendorFirstReviewViewPayload extends VendorPayload {
|
|
|
9
8
|
status: ReviewStatusPayload;
|
|
10
9
|
last_updated_vendor_name_by_user: UserBasePayload | null;
|
|
11
10
|
merge_vendor_name: string | null;
|
|
12
|
-
transaction_attachments?: AttachmentPayload[] | null;
|
|
13
11
|
}
|
|
14
12
|
export interface FetchVendorFirstReviewViewQuery {
|
|
15
13
|
search_text: string;
|
|
@@ -40,7 +38,6 @@ export interface SaveVendorFirstReviewViewPayload extends VendorPayload {
|
|
|
40
38
|
last_updated_vendor_name_by_user: UserBasePayload | null;
|
|
41
39
|
status: ReviewStatusPayload;
|
|
42
40
|
merge_vendor_name: string | null;
|
|
43
|
-
transaction_attachments: AttachmentPayload[];
|
|
44
41
|
}
|
|
45
42
|
export interface SaveVendorFirstReviewView {
|
|
46
43
|
vendors?: SaveVendorFirstReviewViewPayload[];
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.saveVendorFirstReviewViewSuccessOrFailure = exports.clearRecentlySavedErroredVendorData = exports.updateRecentlySavedErroredVendorData = exports.resetVendorFirstReviewLocalData = exports.updateVendorFirstReviewViewLocalData = exports.initializeVendorFirstReviewViewLocalData = exports.updateVendorFirstReviewSortUiState = exports.saveVendorFirstReviewView = exports.updateVendorFirstReviewViewPageToken = exports.updateVendorFirstReviewViewScrollYOffset = exports.clearVendorReviewView = exports.updateVendorFirstReviewViewFailure = exports.updateSavedVendorFirstReviewViewLocalData = exports.fetchVendorFirstReviewView = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const commonTypes_1 = require("../common/state/commonTypes");
|
|
7
|
-
const attachmentPayload_1 = require("../../../entity/transaction/payloadTypes/attachmentPayload");
|
|
8
7
|
exports.initialState = {
|
|
9
8
|
vendorFirstReviewViewLocalDataById: {},
|
|
10
9
|
fetchState: 'Not-Started',
|
|
@@ -180,9 +179,11 @@ const vendorFirstReviewView = (0, toolkit_1.createSlice)({
|
|
|
180
179
|
saveVendorFirstReviewViewSuccessOrFailure: {
|
|
181
180
|
reducer(draft, action) {
|
|
182
181
|
const vendorId = action.payload.vendorId;
|
|
183
|
-
draft.vendorFirstReviewViewLocalDataById[vendorId]
|
|
184
|
-
|
|
185
|
-
|
|
182
|
+
if (draft.vendorFirstReviewViewLocalDataById[vendorId] != null) {
|
|
183
|
+
draft.vendorFirstReviewViewLocalDataById[vendorId].saveStatus.fetchState = action.payload.fetchState;
|
|
184
|
+
draft.vendorFirstReviewViewLocalDataById[vendorId].saveStatus.error =
|
|
185
|
+
action.payload.error;
|
|
186
|
+
}
|
|
186
187
|
const status = action.payload.reviewStatus != null &&
|
|
187
188
|
(0, commonTypes_1.toVendorFirstReviewViewStatusesTypeStrict)(action.payload.reviewStatus.code);
|
|
188
189
|
// Note: We need to delete vendor local data when save is success with status code 'reviewed' OR it is marked as en employee
|
|
@@ -253,9 +254,6 @@ const mapPayloadToVendorFirstReviewView = (payload) => {
|
|
|
253
254
|
mergeVendorName: payload.merge_vendor_name != null && payload.merge_vendor_name.length > 0
|
|
254
255
|
? payload.merge_vendor_name
|
|
255
256
|
: undefined,
|
|
256
|
-
transactionAttachments: payload.transaction_attachments != null
|
|
257
|
-
? payload.transaction_attachments.map((attachmentPayload) => (0, attachmentPayload_1.toAttachment)(attachmentPayload))
|
|
258
|
-
: [],
|
|
259
257
|
/* merge_vendor_name can be an empty string from platform in cases other than `merge_in_qbo` status.
|
|
260
258
|
So, to avoid further string length checks, making this undefined.*/
|
|
261
259
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
-
import { Attachment } from '../../../entity/transaction/stateTypes/attachment';
|
|
4
3
|
import { User } from '../../../entity/user/userState';
|
|
5
4
|
import { Vendor } from '../../../entity/vendor/vendorState';
|
|
6
5
|
import { RootState } from '../../../reducer';
|
|
@@ -30,7 +29,6 @@ export interface VendorFirstReviewSelectorView {
|
|
|
30
29
|
saveStatus: FetchStateAndError;
|
|
31
30
|
recommendations: RecommendedNonExistingGlobalMerchant[];
|
|
32
31
|
currentSelection: VendorReviewRowCurrentSelection;
|
|
33
|
-
transactionAttachments: Attachment[];
|
|
34
32
|
}
|
|
35
33
|
export interface RecentlySavedErroredVendorView {
|
|
36
34
|
vendorId: ID;
|
|
@@ -23,7 +23,6 @@ const getVendorFirstReviewView = (state) => {
|
|
|
23
23
|
...recommendations,
|
|
24
24
|
...vendorLocalData.recommendedNonExistingGlobalMerchants,
|
|
25
25
|
];
|
|
26
|
-
const transactionAttachments = vendorLocalData.transactionAttachments;
|
|
27
26
|
let selectedVendor;
|
|
28
27
|
const vendor = (0, vendorSelector_1.getVendorByVendorId)(vendorState, vendorLocalData.selectedVendorId);
|
|
29
28
|
if (vendor != null) {
|
|
@@ -62,7 +61,6 @@ const getVendorFirstReviewView = (state) => {
|
|
|
62
61
|
recommendations,
|
|
63
62
|
currentSelection: vendorLocalData.currentSelection,
|
|
64
63
|
mergeVendorName: vendorLocalData.mergeVendorName,
|
|
65
|
-
transactionAttachments,
|
|
66
64
|
};
|
|
67
65
|
});
|
|
68
66
|
let recentlyUpdatedErroredVendorData = undefined;
|
|
@@ -2,14 +2,13 @@ import { FetchedState, FetchStateAndError, ID } from '../../../commonStateTypes/
|
|
|
2
2
|
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
3
3
|
import { PageToken } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
4
|
import { GlobalMerchant } from '../../../entity/globalMerchant/globalMerchantState';
|
|
5
|
-
import { Attachment } from '../../../entity/transaction/stateTypes/attachment';
|
|
6
5
|
import { VendorReviewRowCurrentSelection, ReviewStatus } from '../common/state/commonTypes';
|
|
7
|
-
export declare const VENDOR_FIRST_REVIEW_VIEW_COLUMN_KEYS: readonly ["vendor", "updateTo", "retain", "status", "action", "ytd"
|
|
6
|
+
export declare const VENDOR_FIRST_REVIEW_VIEW_COLUMN_KEYS: readonly ["vendor", "updateTo", "retain", "status", "action", "ytd"];
|
|
8
7
|
export interface CurrentSelectionByColumn {
|
|
9
8
|
retain: boolean;
|
|
10
9
|
update: boolean;
|
|
11
10
|
}
|
|
12
|
-
export declare const toVendorFirstReviewViewColumnKeyType: (v: string) => "action" | "status" | "vendor" | "retain" | "updateTo" | "ytd"
|
|
11
|
+
export declare const toVendorFirstReviewViewColumnKeyType: (v: string) => "action" | "status" | "vendor" | "retain" | "updateTo" | "ytd";
|
|
13
12
|
export declare type VendorFirstReviewViewColumnKey = ReturnType<typeof toVendorFirstReviewViewColumnKeyType>;
|
|
14
13
|
export interface RecommendedNonExistingGlobalMerchant extends Omit<GlobalMerchant, 'globalMerchantId'> {
|
|
15
14
|
globalMerchantId?: ID;
|
|
@@ -32,7 +31,6 @@ export interface VendorFirstReviewViewLocalData {
|
|
|
32
31
|
vendorRenamedText?: string;
|
|
33
32
|
lastUpdatedVendorNameByUserId?: ID;
|
|
34
33
|
mergeVendorName: string | undefined;
|
|
35
|
-
transactionAttachments: Attachment[];
|
|
36
34
|
}
|
|
37
35
|
export interface RecentlySavedErroredVendorData {
|
|
38
36
|
vendorId: ID;
|
|
@@ -8,8 +8,7 @@ exports.VENDOR_FIRST_REVIEW_VIEW_COLUMN_KEYS = [
|
|
|
8
8
|
'retain',
|
|
9
9
|
'status',
|
|
10
10
|
'action',
|
|
11
|
-
'ytd',
|
|
12
|
-
'viewTenantInvoice',
|
|
11
|
+
'ytd', // Note: this is not part of list view, we are keeping it to use for default sorting purpose since default sorting is by year_to_date_spend
|
|
13
12
|
];
|
|
14
13
|
const toVendorFirstReviewViewColumnKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.VENDOR_FIRST_REVIEW_VIEW_COLUMN_KEYS);
|
|
15
14
|
exports.toVendorFirstReviewViewColumnKeyType = toVendorFirstReviewViewColumnKeyType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.10.
|
|
3
|
+
"version": "4.10.96",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|