@zeniai/client-epic-state 4.7.98 → 4.8.0
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/commonPayloadTypes/statusPayload.d.ts +4 -0
- package/lib/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.d.ts +3 -0
- package/lib/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.js +4 -1
- package/lib/commonStateTypes/timePeriod.d.ts +9 -2
- package/lib/commonStateTypes/timePeriod.js +12 -1
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +1 -1
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +1 -0
- package/lib/entity/account/accountPayload.d.ts +1 -1
- package/lib/entity/account/accountSelector.d.ts +3 -3
- package/lib/entity/account/accountState.d.ts +4 -4
- package/lib/entity/account/accountState.js +1 -0
- package/lib/entity/account/pickAndMergeForecastAccountReport.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupSelector.d.ts +22 -22
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +2 -2
- package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +55 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +142 -0
- package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +11 -0
- package/lib/entity/jeSchedules/jeSchedulesReducer.js +91 -0
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +58 -0
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +74 -0
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +61 -0
- package/lib/entity/jeSchedules/jeSchedulesState.js +2 -0
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +10 -0
- package/lib/entity/jeSchedules/jeSchedulesTypes.js +25 -0
- package/lib/entity/jeSchedules/updateJESchedulesEpic.d.ts +10 -0
- package/lib/entity/jeSchedules/updateJESchedulesEpic.js +65 -0
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +3 -1
- package/lib/entity/tenant/clearAllEpic.js +4 -0
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +12 -0
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +37 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +3 -3
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +1 -1
- package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +11 -0
- package/lib/entity/transaction/stateTypes/scheduleTransaction.js +2 -0
- package/lib/entity/transaction/stateTypes/transaction.d.ts +10 -7
- package/lib/entity/transaction/stateTypes/transactionType.d.ts +4 -0
- package/lib/entity/transaction/stateTypes/transactionType.js +11 -3
- package/lib/entity/transaction/transactionReducer.d.ts +7 -0
- package/lib/entity/transaction/transactionReducer.js +39 -3
- package/lib/entity/transaction/transactionSelector.d.ts +6 -0
- package/lib/entity/transaction/transactionSelector.js +19 -0
- package/lib/entity/transaction/transactionState.d.ts +3 -0
- package/lib/epic.d.ts +77 -67
- package/lib/epic.js +11 -1
- package/lib/index.d.ts +19 -6
- package/lib/index.js +58 -17
- package/lib/reducer.d.ts +9 -0
- package/lib/reducer.js +9 -0
- package/lib/view/accountList/accountListReducer.js +2 -0
- package/lib/view/accountList/accountListSelector.d.ts +16 -1
- package/lib/view/accountList/accountListSelector.js +33 -4
- package/lib/view/accountList/accountListState.d.ts +1 -1
- package/lib/view/accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload.d.ts +1 -1
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +2 -2
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +2 -2
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
- package/lib/view/people/deletePersonEpic.d.ts +1 -1
- package/lib/view/people/invitePeopleEpic.d.ts +1 -1
- package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
- package/lib/view/people/resendInviteEpic.d.ts +1 -1
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reviewCompanyView/reviewCompanyViewState.d.ts +2 -2
- package/lib/view/reviewCompanyView/reviewCompanyViewState.js +1 -0
- package/lib/view/scheduleView/scheduleDetailView/epics/createNewSchedulesEpic.d.ts +6 -0
- package/lib/view/scheduleView/scheduleDetailView/epics/createNewSchedulesEpic.js +28 -0
- package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsEpic.d.ts +8 -0
- package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsEpic.js +51 -0
- package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsPageEpic.d.ts +7 -0
- package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsPageEpic.js +16 -0
- package/lib/view/scheduleView/scheduleDetailView/epics/initializeScheduleDetailLocalDataEpic.d.ts +6 -0
- package/lib/view/scheduleView/scheduleDetailView/epics/initializeScheduleDetailLocalDataEpic.js +32 -0
- package/lib/view/scheduleView/scheduleDetailView/epics/saveScheduleDetailsEpic.d.ts +11 -0
- package/lib/view/scheduleView/scheduleDetailView/epics/saveScheduleDetailsEpic.js +102 -0
- package/lib/view/scheduleView/scheduleDetailView/epics/updateAmountsInScheduleDetailEpic.d.ts +6 -0
- package/lib/view/scheduleView/scheduleDetailView/epics/updateAmountsInScheduleDetailEpic.js +29 -0
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailLocalDataHelper.d.ts +18 -0
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailLocalDataHelper.js +185 -0
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailPayload.d.ts +58 -0
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailPayload.js +118 -0
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailReducer.d.ts +50 -0
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailReducer.js +237 -0
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailSelector.d.ts +21 -0
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailSelector.js +67 -0
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailState.d.ts +47 -0
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailState.js +5 -0
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailTypes.d.ts +3 -0
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailTypes.js +14 -0
- package/lib/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.d.ts +8 -0
- package/lib/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +52 -0
- package/lib/view/scheduleView/scheduleListView/epics/fetchScheduleListEpic.d.ts +27 -0
- package/lib/view/scheduleView/scheduleListView/epics/fetchScheduleListEpic.js +75 -0
- package/lib/view/scheduleView/scheduleListView/epics/fetchSchedulesAccountEpic.d.ts +19 -0
- package/lib/view/scheduleView/scheduleListView/epics/fetchSchedulesAccountEpic.js +37 -0
- package/lib/view/scheduleView/scheduleListView/scheduleListHelper.d.ts +70 -0
- package/lib/view/scheduleView/scheduleListView/scheduleListHelper.js +187 -0
- package/lib/view/scheduleView/scheduleListView/scheduleListPayload.d.ts +7 -0
- package/lib/view/scheduleView/scheduleListView/scheduleListPayload.js +2 -0
- package/lib/view/scheduleView/scheduleListView/scheduleListReducer.d.ts +55 -0
- package/lib/view/scheduleView/scheduleListView/scheduleListReducer.js +228 -0
- package/lib/view/scheduleView/scheduleListView/scheduleListSelector.d.ts +38 -0
- package/lib/view/scheduleView/scheduleListView/scheduleListSelector.js +193 -0
- package/lib/view/scheduleView/scheduleListView/scheduleListState.d.ts +29 -0
- package/lib/view/scheduleView/scheduleListView/scheduleListState.js +2 -0
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +22 -0
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.js +39 -0
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.d.ts +2 -1
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.js +10 -1
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.d.ts +6 -0
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.js +13 -1
- package/lib/view/spendManagement/helpers.d.ts +2 -0
- package/lib/view/spendManagement/helpers.js +12 -1
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailReducer.js +1 -1
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailSelector.js +2 -2
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailState.d.ts +2 -2
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferMoneyEpic.js +3 -2
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/transactionDetail/epics/initializeTransactionDetailLocalDataEpic.js +2 -5
- package/lib/view/transactionDetail/epics/saveTransactionDetailEpic.js +2 -1
- package/lib/view/transactionDetail/epics/transactionDetailEpic.js +3 -2
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +2 -1
- package/lib/view/transactionDetail/transactionDetailSelector.js +3 -2
- package/lib/view/transactionDetail/transactionDetailState.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailState.js +3 -16
- package/lib/view/transactionList/transactionListByAccountSelector.js +2 -1
- package/lib/view/transactionList/transactionListByCategoryTypeSelector.js +2 -1
- package/lib/view/transactionList/transactionListByClassSelector.js +2 -1
- package/lib/view/transactionList/transactionListByEntitySelector.js +2 -1
- package/lib/view/vendorList/vendorListSelector.d.ts +3 -0
- package/lib/view/vendorList/vendorListSelector.js +11 -1
- package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewState.d.ts +2 -2
- package/lib/zeniDayJS.d.ts +1 -0
- package/lib/zeniDayJS.js +7 -1
- package/package.json +1 -1
|
@@ -12,6 +12,7 @@ const classListSelector_1 = require("../classList/classListSelector");
|
|
|
12
12
|
const accountListSelector_1 = require("../accountList/accountListSelector");
|
|
13
13
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
14
14
|
const vendorSelector_1 = require("../../entity/vendor/vendorSelector");
|
|
15
|
+
const transactionSelector_1 = require("../../entity/transaction/transactionSelector");
|
|
15
16
|
const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = true) => {
|
|
16
17
|
var _a, _b;
|
|
17
18
|
const { transactionDetailState, transactionState, vendorState, vendorListState, accountState, classState, classListState, accountListState, } = state;
|
|
@@ -21,7 +22,7 @@ const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = tr
|
|
|
21
22
|
fetchState: (_a = transactionDetail === null || transactionDetail === void 0 ? void 0 : transactionDetail.fetchState) !== null && _a !== void 0 ? _a : 'Not-Started',
|
|
22
23
|
error: transactionDetail === null || transactionDetail === void 0 ? void 0 : transactionDetail.error,
|
|
23
24
|
};
|
|
24
|
-
const transaction = (0,
|
|
25
|
+
const transaction = (0, transactionSelector_1.getSupportedTransactionById)(transactionState, detailKey);
|
|
25
26
|
let linkedTransactions = [];
|
|
26
27
|
if ((transactionDetail === null || transactionDetail === void 0 ? void 0 : transactionDetail.fetchState) === 'Completed' && transaction != null) {
|
|
27
28
|
// IMPORTANT: filtering out unsupported linked transactions
|
|
@@ -42,7 +43,7 @@ const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = tr
|
|
|
42
43
|
linkedTransactions = linkedTransactionDetails
|
|
43
44
|
.map((linkedTranDetail) => {
|
|
44
45
|
const key = (0, transactionDetailState_1.getTransactionDetailKey)(linkedTranDetail.transactionId); // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
|
45
|
-
return transactionState
|
|
46
|
+
return (0, transactionSelector_1.getSupportedTransactionById)(transactionState, key);
|
|
46
47
|
})
|
|
47
48
|
.filter((value) => {
|
|
48
49
|
if (value == null) {
|
|
@@ -8,7 +8,7 @@ import { Transaction, TransactionID } from '../../entity/transaction/stateTypes/
|
|
|
8
8
|
import { VendorBase } from '../../entity/vendor/vendorState';
|
|
9
9
|
import { EntityRecommendationKey } from '../recommendation/recommendationState';
|
|
10
10
|
import { TransactionDetailLocalData } from './transactionDetailTypes';
|
|
11
|
-
export declare const getTransactionDetailKey: (transactionId: TransactionID) => string
|
|
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
13
|
export declare function getAllLinkedTransactions(transaction: Transaction): TransactionID[];
|
|
14
14
|
export interface SupportedTransactionDetail extends FetchedState {
|
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.initialSupportedTransactionDetail = exports.getAllLinkedTransactions = exports.getTransactionDetailKey = void 0;
|
|
4
|
-
|
|
4
|
+
// This transaction key only extracts the third party ID and uses that
|
|
5
|
+
// for the ID
|
|
6
|
+
const getTransactionDetailKey = (transactionId) => `${transactionId.id}_${transactionId.type}`;
|
|
5
7
|
exports.getTransactionDetailKey = getTransactionDetailKey;
|
|
6
|
-
/**
|
|
7
|
-
* Returns actual QBO transaction ID.
|
|
8
|
-
* @param zeniGeneratedId zeni transaciton Id in the form of tran_<uuid>:<qbo_id>
|
|
9
|
-
* @returns retruns the actual QBO transaction Id.
|
|
10
|
-
* @note in case if the given transaction id itself is QBO id, the it just passes it back.
|
|
11
|
-
*/
|
|
12
|
-
const getActualTransactionID = (zeniGeneratedId) => {
|
|
13
|
-
const splittedIds = zeniGeneratedId.trim().split(':');
|
|
14
|
-
if (splittedIds.length === 1) {
|
|
15
|
-
return splittedIds[0];
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
return splittedIds[1];
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
8
|
function getAllLinkedTransactions(transaction) {
|
|
22
9
|
var _a, _b;
|
|
23
10
|
const result = [];
|
|
@@ -10,6 +10,7 @@ const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
|
10
10
|
const parallelFetchAccountTransactionListEpic_1 = require("./parallelFetchAccountTransactionListEpic");
|
|
11
11
|
const reduceTransactionListFetchState_1 = require("./reduceTransactionListFetchState");
|
|
12
12
|
const transactionListState_1 = require("./transactionListState");
|
|
13
|
+
const transactionSelector_1 = require("../../entity/transaction/transactionSelector");
|
|
13
14
|
const getTransactionListByAccount = (transactionState, transactionListState, accountId, accountType, timeframe, filterByTimePeriod) => {
|
|
14
15
|
const timePeriods = (0, parallelFetchAccountTransactionListEpic_1.splitPeriod)(filterByTimePeriod); // Note: Split by months.
|
|
15
16
|
const accountTransactions = timePeriods
|
|
@@ -27,7 +28,7 @@ const getTransactionListByAccount = (transactionState, transactionListState, acc
|
|
|
27
28
|
if ((0, reduceTransactionListFetchState_1.isAnyFetchCompleted)(accountTransactions)) {
|
|
28
29
|
const allTransactionIDs = (0, flatMap_1.default)(accountTransactions, (value) => value.transactionIDs);
|
|
29
30
|
const transactionsUnsorted = allTransactionIDs
|
|
30
|
-
.map((transactionId) => transactionState
|
|
31
|
+
.map((transactionId) => (0, transactionSelector_1.getSupportedTransactionById)(transactionState, transactionId))
|
|
31
32
|
.filter((value) => {
|
|
32
33
|
if (value == null) {
|
|
33
34
|
console.error("Can't have null transaction at this stage!");
|
|
@@ -10,6 +10,7 @@ const flatMap_1 = __importDefault(require("lodash/flatMap"));
|
|
|
10
10
|
const transactionListState_1 = require("./transactionListState");
|
|
11
11
|
const reduceTransactionListFetchState_1 = require("./reduceTransactionListFetchState");
|
|
12
12
|
const parallelFetchAccountTransactionListEpic_1 = require("./parallelFetchAccountTransactionListEpic");
|
|
13
|
+
const transactionSelector_1 = require("../../entity/transaction/transactionSelector");
|
|
13
14
|
const getTransactionsListByCategoryType = (transactionState, transactionListState, filterByTimePeriod, timeframe, transactionCategoryType) => {
|
|
14
15
|
const timePeriods = (0, parallelFetchAccountTransactionListEpic_1.splitPeriod)(filterByTimePeriod); // Note: Split by months.
|
|
15
16
|
const categoryTransactions = timePeriods
|
|
@@ -24,7 +25,7 @@ const getTransactionsListByCategoryType = (transactionState, transactionListStat
|
|
|
24
25
|
if ((0, reduceTransactionListFetchState_1.isAnyFetchCompleted)(categoryTransactions)) {
|
|
25
26
|
const allTransactionIDs = (0, flatMap_1.default)(categoryTransactions, (value) => value.transactionIDs);
|
|
26
27
|
const transactionsUnsorted = allTransactionIDs
|
|
27
|
-
.map((transactionId) => transactionState
|
|
28
|
+
.map((transactionId) => (0, transactionSelector_1.getSupportedTransactionById)(transactionState, transactionId))
|
|
28
29
|
.filter((value) => {
|
|
29
30
|
if (value == null) {
|
|
30
31
|
console.error("Can't have null transaction at this stage!");
|
|
@@ -10,6 +10,7 @@ const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
|
10
10
|
const parallelFetchAccountTransactionListEpic_1 = require("./parallelFetchAccountTransactionListEpic");
|
|
11
11
|
const reduceTransactionListFetchState_1 = require("./reduceTransactionListFetchState");
|
|
12
12
|
const transactionListState_1 = require("./transactionListState");
|
|
13
|
+
const transactionSelector_1 = require("../../entity/transaction/transactionSelector");
|
|
13
14
|
const getTransactionListByClass = (transactionState, transactionListState, accountId, accountType, classId, timeframe, filterByTimePeriod) => {
|
|
14
15
|
const timePeriods = (0, parallelFetchAccountTransactionListEpic_1.splitPeriod)(filterByTimePeriod); // Note: Split by months.
|
|
15
16
|
const accountTransactions = timePeriods
|
|
@@ -27,7 +28,7 @@ const getTransactionListByClass = (transactionState, transactionListState, accou
|
|
|
27
28
|
if ((0, reduceTransactionListFetchState_1.isAnyFetchCompleted)(accountTransactions)) {
|
|
28
29
|
const allTransactionIDs = (0, flatMap_1.default)(accountTransactions, (value) => value.transactionIDs);
|
|
29
30
|
const transactionsUnsorted = allTransactionIDs
|
|
30
|
-
.map((transactionId) => transactionState
|
|
31
|
+
.map((transactionId) => (0, transactionSelector_1.getSupportedTransactionById)(transactionState, transactionId))
|
|
31
32
|
.filter((value) => {
|
|
32
33
|
if (value == null) {
|
|
33
34
|
console.error("Can't have null transaction at this stage!");
|
|
@@ -11,6 +11,7 @@ const timeframeTick_1 = require("../../commonStateTypes/timeframeTick");
|
|
|
11
11
|
const parallelFetchAccountTransactionListEpic_1 = require("./parallelFetchAccountTransactionListEpic");
|
|
12
12
|
const reduceTransactionListFetchState_1 = require("./reduceTransactionListFetchState");
|
|
13
13
|
const transactionListState_1 = require("./transactionListState");
|
|
14
|
+
const transactionSelector_1 = require("../../entity/transaction/transactionSelector");
|
|
14
15
|
const getTransactionListByEntity = (transactionState, transactionListState, filterByTimePeriod, entity) => {
|
|
15
16
|
const timePeriods = (0, parallelFetchAccountTransactionListEpic_1.splitPeriod)((0, timeframeTick_1.toTimePeriod)(filterByTimePeriod)); // Note: Split by months.
|
|
16
17
|
const entityTransactions = timePeriods
|
|
@@ -25,7 +26,7 @@ const getTransactionListByEntity = (transactionState, transactionListState, filt
|
|
|
25
26
|
if ((0, reduceTransactionListFetchState_1.isAnyFetchCompleted)(entityTransactions)) {
|
|
26
27
|
const allTransactionIDs = (0, flatMap_1.default)(entityTransactions, (value) => value.transactionIDs);
|
|
27
28
|
const transactionsUnsorted = allTransactionIDs
|
|
28
|
-
.map((transactionId) => transactionState
|
|
29
|
+
.map((transactionId) => (0, transactionSelector_1.getSupportedTransactionById)(transactionState, transactionId))
|
|
29
30
|
.filter((value) => {
|
|
30
31
|
if (value == null) {
|
|
31
32
|
console.error("Can't have null transaction at this stage!");
|
|
@@ -8,6 +8,9 @@ import { Vendor } from '../../entity/vendor/vendorState';
|
|
|
8
8
|
import { RootState } from '../../reducer';
|
|
9
9
|
import { ZeniDate } from '../../zeniDayJS';
|
|
10
10
|
import { VendorListViewSortKey, VendorListViewYTDSpendSortKey, VendorViewUIState } from './vendorListState';
|
|
11
|
+
export declare const toVendorReportIDType: (v: string) => "operating_expenses_by_vendor" | "vendors_tab" | "prepaid_expenses";
|
|
12
|
+
export declare const toVendorReportIDTypeStrict: (v?: string | undefined) => "operating_expenses_by_vendor" | "vendors_tab" | "prepaid_expenses" | undefined;
|
|
13
|
+
export declare type VendorReportIDType = ReturnType<typeof toVendorReportIDType>;
|
|
11
14
|
export interface VendorListSelectorView extends SelectorView {
|
|
12
15
|
vendors: VendorListView[];
|
|
13
16
|
uiState: VendorViewUIState;
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isVendorsTabVisible = exports.isColumnYTDSpend = exports.getVendorList = void 0;
|
|
3
|
+
exports.isVendorsTabVisible = exports.isColumnYTDSpend = exports.getVendorList = exports.toVendorReportIDTypeStrict = exports.toVendorReportIDType = void 0;
|
|
4
4
|
const accountSelector_1 = require("../../entity/account/accountSelector");
|
|
5
5
|
const classSelector_1 = require("../../entity/class/classSelector");
|
|
6
6
|
const userSelector_1 = require("../../entity/user/userSelector");
|
|
7
7
|
const vendorSelector_1 = require("../../entity/vendor/vendorSelector");
|
|
8
|
+
const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
|
|
9
|
+
const ALL_VENDOR_REPORT_ID_TYPES = [
|
|
10
|
+
'operating_expenses_by_vendor',
|
|
11
|
+
'vendors_tab',
|
|
12
|
+
'prepaid_expenses',
|
|
13
|
+
];
|
|
14
|
+
const toVendorReportIDType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_VENDOR_REPORT_ID_TYPES);
|
|
15
|
+
exports.toVendorReportIDType = toVendorReportIDType;
|
|
16
|
+
const toVendorReportIDTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v !== null && v !== void 0 ? v : '', ALL_VENDOR_REPORT_ID_TYPES);
|
|
17
|
+
exports.toVendorReportIDTypeStrict = toVendorReportIDTypeStrict;
|
|
8
18
|
const getVendorList = (state, view) => {
|
|
9
19
|
var _a;
|
|
10
20
|
const { vendorListState, vendorState, accountState, classState, userState } = state;
|
|
@@ -3,8 +3,8 @@ import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderType
|
|
|
3
3
|
import { PageToken } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
4
|
import { RecommendedNonExistingGlobalMerchant } from '../vendorFirstReviewView/vendorFirstReviewViewState';
|
|
5
5
|
export declare const VENDOR_GLOBAL_REVIEW_COLUMN_SORT_KEYS: readonly ["tenants", "vendors", "updatedFrom", "recommended"];
|
|
6
|
-
export declare const toVendorGlobalReviewColumnSortKeyType: (v: string) => "vendors" | "
|
|
7
|
-
export declare const toVendorGlobalReviewColumnSortKeyTypeStrict: (v: string) => "vendors" | "
|
|
6
|
+
export declare const toVendorGlobalReviewColumnSortKeyType: (v: string) => "vendors" | "recommended" | "tenants" | "updatedFrom";
|
|
7
|
+
export declare const toVendorGlobalReviewColumnSortKeyTypeStrict: (v: string) => "vendors" | "recommended" | "tenants" | "updatedFrom" | undefined;
|
|
8
8
|
export declare type VendorGlobalReviewViewColumnSortKey = ReturnType<typeof toVendorGlobalReviewColumnSortKeyType>;
|
|
9
9
|
export interface VendorGlobalReviewViewUIState {
|
|
10
10
|
searchText: string;
|
package/lib/zeniDayJS.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export declare function date(dateStringISO: string, format?: string): ZeniDate;
|
|
|
24
24
|
export declare function dateInUTC(dateStringISO: string): ZeniDate;
|
|
25
25
|
export declare function dateLocal(dateStringISO: string): ZeniDate;
|
|
26
26
|
export declare function dateNow(): ZeniDate;
|
|
27
|
+
export declare function dateFromYearMonthDate(year: number, month: number, day?: number): ZeniDate;
|
|
27
28
|
export declare function getBusinessDayOfDate(date: ZeniDate): number;
|
|
28
29
|
export declare function setLocalTimezone(timezone: string): void;
|
|
29
30
|
export declare function getLocalTimezone(): string;
|
package/lib/zeniDayJS.js
CHANGED
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.getMonthIndex = exports.getLocalTimezone = exports.setLocalTimezone = exports.getBusinessDayOfDate = exports.dateNow = exports.dateLocal = exports.dateInUTC = exports.date = exports.dateInLocal = exports.updateZeniDateLocaleID = exports.Dayjs = void 0;
|
|
29
|
+
exports.getMonthIndex = exports.getLocalTimezone = exports.setLocalTimezone = exports.getBusinessDayOfDate = exports.dateFromYearMonthDate = exports.dateNow = exports.dateLocal = exports.dateInUTC = exports.date = exports.dateInLocal = exports.updateZeniDateLocaleID = exports.Dayjs = void 0;
|
|
30
30
|
const dayjs_1 = __importStar(require("dayjs"));
|
|
31
31
|
Object.defineProperty(exports, "Dayjs", { enumerable: true, get: function () { return dayjs_1.Dayjs; } });
|
|
32
32
|
require("dayjs/locale/en");
|
|
@@ -100,6 +100,12 @@ function dateNow() {
|
|
|
100
100
|
return (0, dayjs_1.default)();
|
|
101
101
|
}
|
|
102
102
|
exports.dateNow = dateNow;
|
|
103
|
+
function dateFromYearMonthDate(year, month, day) {
|
|
104
|
+
return day != null
|
|
105
|
+
? (0, dayjs_1.default)().month(month).year(year).date(day)
|
|
106
|
+
: (0, dayjs_1.default)().month(month).year(year);
|
|
107
|
+
}
|
|
108
|
+
exports.dateFromYearMonthDate = dateFromYearMonthDate;
|
|
103
109
|
function getBusinessDayOfDate(date) {
|
|
104
110
|
return Math.abs(date.businessDaysDiff(date.startOf('month')));
|
|
105
111
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.8.0",
|
|
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",
|