@zeniai/client-epic-state 4.8.9 → 4.8.11
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/jeSchedulesPayload.js +1 -1
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +2 -2
- package/lib/entity/transaction/transactionReducer.js +1 -1
- package/lib/entity/transaction/transactionState.d.ts +2 -2
- package/lib/index.d.ts +2 -2
- package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsEpic.js +1 -1
- package/lib/view/scheduleView/scheduleListView/scheduleListReducer.js +1 -1
- package/lib/view/transactionDetail/transactionDetailState.d.ts +2 -0
- package/lib/view/transactionDetail/transactionDetailState.js +14 -3
- package/package.json +1 -1
|
@@ -98,7 +98,7 @@ function toJEClassPayload(payload, type) {
|
|
|
98
98
|
exports.toJEClassPayload = toJEClassPayload;
|
|
99
99
|
function getTransactionDetailKeyPayload(payload) {
|
|
100
100
|
const transactionId = (0, transactionIDPayload_1.toTransactionID)(payload);
|
|
101
|
-
return (0, transactionDetailState_1.
|
|
101
|
+
return (0, transactionDetailState_1.getZeniTransactionDetailKey)(transactionId);
|
|
102
102
|
}
|
|
103
103
|
exports.getTransactionDetailKeyPayload = getTransactionDetailKeyPayload;
|
|
104
104
|
function toJEScheduledTransaction(payload) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare type JEScheduleKey = ReturnType<typeof
|
|
1
|
+
import { getZeniTransactionDetailKey } from '../../view/transactionDetail/transactionDetailState';
|
|
2
|
+
export declare type JEScheduleKey = ReturnType<typeof getZeniTransactionDetailKey>;
|
|
3
3
|
export declare const ALL_SCHEDULES_TYPES: readonly ["prepaid_expenses", "fixed_assets", "accured_expenses", "deferred_revenue"];
|
|
4
4
|
export declare const toScheduleTypesType: (v: string) => "prepaid_expenses" | "fixed_assets" | "accured_expenses" | "deferred_revenue";
|
|
5
5
|
export declare type SchedulesTypes = ReturnType<typeof toScheduleTypesType>;
|
|
@@ -55,7 +55,7 @@ const transaction = (0, toolkit_1.createSlice)({
|
|
|
55
55
|
updateScheduleTransactions: {
|
|
56
56
|
reducer(draft, action) {
|
|
57
57
|
action.payload.transactionsPayload.forEach((value) => {
|
|
58
|
-
const id = (0, transactionDetailState_1.
|
|
58
|
+
const id = (0, transactionDetailState_1.getZeniTransactionDetailKey)({
|
|
59
59
|
id: value.transaction_id,
|
|
60
60
|
type: (0, transactionType_1.toTransactionType)(value.transaction_type),
|
|
61
61
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ID } from '../../commonStateTypes/common';
|
|
2
|
-
import { TransactionDetailKey } from '../../view/transactionDetail/transactionDetailState';
|
|
2
|
+
import { TransactionDetailKey, ZeniTransactionDetailKey } from '../../view/transactionDetail/transactionDetailState';
|
|
3
3
|
import { CustomerTransactionPayload } from './payloadTypes/customerTransactionPayload';
|
|
4
4
|
import { TransactionPayload } from './payloadTypes/transactionPayload';
|
|
5
5
|
import { VendorTransactionPayload } from './payloadTypes/vendorTransactionPayload';
|
|
@@ -12,5 +12,5 @@ export declare type SupportedTransactionPayload = TransactionPayload | CustomerT
|
|
|
12
12
|
export declare type AllSupportedTransactions = SupportedTransaction | undefined;
|
|
13
13
|
export interface TransactionState {
|
|
14
14
|
transactionById: Record<ID | TransactionDetailKey, SupportedTransaction | undefined>;
|
|
15
|
-
scheduleTransactionById: Record<
|
|
15
|
+
scheduleTransactionById: Record<ZeniTransactionDetailKey, ScheduleTransaction>;
|
|
16
16
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -310,8 +310,8 @@ import { CompanyDetailsLocalData, CompanyInfoLocalData, IncInfoLocalData, TaxDet
|
|
|
310
310
|
import { CompanyOfficerLocalData, PrimaryContactLocalData, CompanyOfficerType } from './view/companyView/types/companyPassport/companyUsersLocalData';
|
|
311
311
|
import { CompanyPassportLocalData, toCompanyPassportLocalData } from './view/companyView/types/companyPassport/companyPassportLocalData';
|
|
312
312
|
export { CompanyInfoLocalData, IncInfoLocalData, TaxDetailsLocalData, CompanyDetailsLocalData, PrimaryContactLocalData, CompanyOfficerLocalData, CompanyOfficerType, CompanyPassportLocalData, toCompanyPassportLocalData, };
|
|
313
|
-
import { AccountListSelectorView, getUncategorizedAccounts, getNestedAccountListHeirarchy } from './view/accountList/accountListSelector';
|
|
314
|
-
export { getUncategorizedAccounts, getNestedAccountListHeirarchy };
|
|
313
|
+
import { AccountListSelectorView, getUncategorizedAccounts, getNestedAccountListHeirarchy, UncategorizedAccounts } from './view/accountList/accountListSelector';
|
|
314
|
+
export { getUncategorizedAccounts, UncategorizedAccounts, getNestedAccountListHeirarchy, };
|
|
315
315
|
import { getBankAccount, BankAccountSelectorView } from './view/bankAccountView/bankAccountViewSelector';
|
|
316
316
|
export { getBankAccount, BankAccountSelectorView };
|
|
317
317
|
import { SubscriptionListUIState, SubscriptionUpdateData, SubscriptionCreateData, SubscriptionActionType } from './view/subscriptionView/subscriptionViewState';
|
|
@@ -28,7 +28,7 @@ const fetchScheduleDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0
|
|
|
28
28
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
29
29
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
30
30
|
const transactionData = response.data.je_schedules[0].base_transaction;
|
|
31
|
-
const selectedJEScheduleKey = (0, transactionDetailState_1.
|
|
31
|
+
const selectedJEScheduleKey = (0, transactionDetailState_1.getZeniTransactionDetailKey)({
|
|
32
32
|
id: transactionData.transaction_id,
|
|
33
33
|
type: (0, transactionType_1.toTransactionType)(transactionData.transaction_type),
|
|
34
34
|
});
|
|
@@ -214,7 +214,7 @@ exports.default = scheduleListView.reducer;
|
|
|
214
214
|
function doUpdateScheduleList(draft, payload, tab, selectedTimeframe, selectedCategoryId) {
|
|
215
215
|
const jeScheduleTransactionKeys = payload.map((schedules) => {
|
|
216
216
|
const transactionID = (0, transactionIDPayload_1.toTransactionID)(schedules.base_transaction);
|
|
217
|
-
return (0, transactionDetailState_1.
|
|
217
|
+
return (0, transactionDetailState_1.getZeniTransactionDetailKey)(transactionID);
|
|
218
218
|
});
|
|
219
219
|
draft.selectedCategoryId = selectedCategoryId;
|
|
220
220
|
draft.selectedTimeframe = selectedTimeframe;
|
|
@@ -10,6 +10,8 @@ import { EntityRecommendationKey } from '../recommendation/recommendationState';
|
|
|
10
10
|
import { TransactionDetailLocalData } from './transactionDetailTypes';
|
|
11
11
|
export declare const getTransactionDetailKey: (transactionId: TransactionID) => `${string}_expense` | `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_refund` | `${string}_check` | `${string}_bill` | `${string}_bill_payment` | `${string}_bill_payment_check` | `${string}_bill_payment_credit_card` | `${string}_vendor_credit` | `${string}_credit_card_credit` | `${string}_transfer` | `${string}_credit_card_payment` | `${string}_deposit` | `${string}_journal_entry`;
|
|
12
12
|
export declare type TransactionDetailKey = ReturnType<typeof getTransactionDetailKey>;
|
|
13
|
+
export declare const getZeniTransactionDetailKey: (transactionId: TransactionID) => `${string}_expense` | `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_refund` | `${string}_check` | `${string}_bill` | `${string}_bill_payment` | `${string}_bill_payment_check` | `${string}_bill_payment_credit_card` | `${string}_vendor_credit` | `${string}_credit_card_credit` | `${string}_transfer` | `${string}_credit_card_payment` | `${string}_deposit` | `${string}_journal_entry`;
|
|
14
|
+
export declare type ZeniTransactionDetailKey = ReturnType<typeof getTransactionDetailKey>;
|
|
13
15
|
export declare const getThirdPartyIdFromTransactionId: (transactionId: TransactionID) => string;
|
|
14
16
|
export declare function getAllLinkedTransactions(transaction: Transaction): TransactionID[];
|
|
15
17
|
export interface SupportedTransactionDetail extends FetchedState {
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initialSupportedTransactionDetail = exports.getAllLinkedTransactions = exports.getThirdPartyIdFromTransactionId = exports.getTransactionDetailKey = void 0;
|
|
3
|
+
exports.initialSupportedTransactionDetail = exports.getAllLinkedTransactions = exports.getThirdPartyIdFromTransactionId = exports.getZeniTransactionDetailKey = exports.getTransactionDetailKey = void 0;
|
|
4
4
|
// This transaction key only extracts the third party ID and uses that
|
|
5
5
|
// for the ID
|
|
6
|
-
const getTransactionDetailKey = (transactionId) => `${transactionId.id}_${transactionId.type}`;
|
|
6
|
+
const getTransactionDetailKey = (transactionId) => `${getActualTransactionID(transactionId.id)}_${transactionId.type}`;
|
|
7
7
|
exports.getTransactionDetailKey = getTransactionDetailKey;
|
|
8
|
+
const getZeniTransactionDetailKey = (transactionId) => `${transactionId.id}_${transactionId.type}`;
|
|
9
|
+
exports.getZeniTransactionDetailKey = getZeniTransactionDetailKey;
|
|
8
10
|
const getThirdPartyIdFromTransactionId = (transactionId) => {
|
|
9
11
|
const zeniGeneratedId = transactionId.id;
|
|
12
|
+
return getActualTransactionID(zeniGeneratedId);
|
|
13
|
+
};
|
|
14
|
+
exports.getThirdPartyIdFromTransactionId = getThirdPartyIdFromTransactionId;
|
|
15
|
+
/**
|
|
16
|
+
* Returns actual QBO transaction ID.
|
|
17
|
+
* @param zeniGeneratedId zeni transaciton Id in the form of tran_<uuid>:<qbo_id>
|
|
18
|
+
* @returns retruns the actual QBO transaction Id.
|
|
19
|
+
* @note in case if the given transaction id itself is QBO id, the it just passes it back.
|
|
20
|
+
*/
|
|
21
|
+
const getActualTransactionID = (zeniGeneratedId) => {
|
|
10
22
|
const splittedIds = zeniGeneratedId.trim().split(':');
|
|
11
23
|
if (splittedIds.length === 1) {
|
|
12
24
|
return splittedIds[0];
|
|
@@ -15,7 +27,6 @@ const getThirdPartyIdFromTransactionId = (transactionId) => {
|
|
|
15
27
|
return splittedIds[1];
|
|
16
28
|
}
|
|
17
29
|
};
|
|
18
|
-
exports.getThirdPartyIdFromTransactionId = getThirdPartyIdFromTransactionId;
|
|
19
30
|
function getAllLinkedTransactions(transaction) {
|
|
20
31
|
var _a, _b;
|
|
21
32
|
const result = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.11",
|
|
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",
|