@zeniai/client-epic-state 4.9.6 → 4.9.8
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/fiscalYearHelpers/formatZeniDateFY.d.ts +0 -1
- package/lib/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.js +1 -2
- package/lib/entity/userRole/userRoleType.d.ts +1 -0
- package/lib/entity/userRole/userRoleType.js +8 -1
- package/lib/epic.d.ts +6 -8
- package/lib/epic.js +6 -8
- package/lib/index.d.ts +11 -10
- package/lib/index.js +20 -22
- package/lib/view/companyMonthEndReportView/companyMonthEndReportViewPayload.d.ts +0 -16
- package/lib/view/companyMonthEndReportView/companyMonthEndReportViewReducer.d.ts +1 -21
- package/lib/view/companyMonthEndReportView/companyMonthEndReportViewReducer.js +3 -77
- package/lib/view/companyMonthEndReportView/companyMonthEndReportViewSelector.d.ts +1 -9
- package/lib/view/companyMonthEndReportView/companyMonthEndReportViewSelector.js +1 -42
- package/lib/view/companyMonthEndReportView/companyMonthEndReportViewState.d.ts +3 -15
- package/lib/view/companyMonthEndReportView/companyMonthEndReportViewState.js +1 -18
- package/lib/view/companyMonthEndReportView/{epics/fetchCompanyMonthEndReportViewEpic.d.ts → fetchCompanyMonthEndReportViewEpic.d.ts} +4 -4
- package/lib/view/companyMonthEndReportView/{epics/fetchCompanyMonthEndReportViewEpic.js → fetchCompanyMonthEndReportViewEpic.js} +2 -4
- package/lib/view/companyMonthEndReportView/{epics/improveUsingZeniGPTEpic.d.ts → improveUsingZeniGPTEpic.d.ts} +3 -3
- package/lib/view/companyMonthEndReportView/{epics/improveUsingZeniGPTEpic.js → improveUsingZeniGPTEpic.js} +2 -2
- package/lib/view/companyMonthEndReportView/{epics/saveCompanyMonthEndReportEpic.d.ts → saveCompanyMonthEndReportEpic.d.ts} +5 -5
- package/lib/view/companyMonthEndReportView/{epics/saveCompanyMonthEndReportEpic.js → saveCompanyMonthEndReportEpic.js} +7 -9
- package/lib/view/companyMonthEndReportView/{epics/sendCompanyMonthEndReportEpic.d.ts → sendCompanyMonthEndReportEpic.d.ts} +5 -5
- package/lib/view/companyMonthEndReportView/{epics/sendCompanyMonthEndReportEpic.js → sendCompanyMonthEndReportEpic.js} +7 -9
- package/lib/view/recommendation/fetchRecommendationByEntityIdEpic.js +2 -2
- package/lib/view/recommendation/fetchRecommendationByEntityQboIdEpic.d.ts +10 -0
- package/lib/view/recommendation/{fetchEntityRecommendationsByTransactionIdEpic.js → fetchRecommendationByEntityQboIdEpic.js} +6 -13
- package/lib/view/recommendation/recommendationHelper.d.ts +0 -3
- package/lib/view/recommendation/recommendationHelper.js +21 -37
- package/lib/view/recommendation/recommendationReducer.d.ts +1 -1
- package/lib/view/recommendation/recommendationReducer.js +3 -3
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.d.ts +0 -1
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +13 -17
- package/lib/view/spendManagement/reimbursement/reimbursementConfig/reimbursementConfigState.d.ts +0 -1
- package/lib/view/spendManagement/reimbursement/reimbursementConfig/reimbursementConfigState.js +1 -2
- package/lib/view/spendManagement/reimbursement/remiDetailView/epics/fetchRemiDetailEpic.d.ts +1 -2
- package/lib/view/spendManagement/reimbursement/remiDetailView/epics/fetchRemiDetailEpic.js +2 -8
- package/lib/view/spendManagement/reimbursement/remiDetailView/remiDetailViewSelector.d.ts +1 -2
- package/lib/view/spendManagement/reimbursement/remiDetailView/remiDetailViewSelector.js +14 -23
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.d.ts +1 -2
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +2 -3
- package/lib/view/transactionDetail/transactionDetailReducer.d.ts +3 -3
- package/lib/view/transactionDetail/transactionDetailReducer.js +4 -4
- package/lib/view/transactionDetail/transactionDetailState.d.ts +0 -7
- package/lib/view/transactionDetail/transactionDetailState.js +3 -4
- package/package.json +1 -1
- package/lib/view/companyMonthEndReportView/epics/fetchCompanyMonthEndReportHistoricDataEpic.d.ts +0 -8
- package/lib/view/companyMonthEndReportView/epics/fetchCompanyMonthEndReportHistoricDataEpic.js +0 -66
- package/lib/view/companyMonthEndReportView/epics/fetchCompanyMonthEndReportHistoricDatesEpic.d.ts +0 -7
- package/lib/view/companyMonthEndReportView/epics/fetchCompanyMonthEndReportHistoricDatesEpic.js +0 -54
- package/lib/view/recommendation/fetchEntityRecommendationsByTransactionIdEpic.d.ts +0 -10
|
@@ -1,51 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getRecommendationFromRecommendationPayload = void 0;
|
|
4
4
|
const accountPayload_1 = require("../../entity/account/accountPayload");
|
|
5
5
|
const classPayload_1 = require("../../entity/class/classPayload");
|
|
6
|
-
const transactionPayload_1 = require("../../entity/transaction/payloadTypes/transactionPayload");
|
|
7
6
|
const getRecommendationFromRecommendationPayload = (payload) => {
|
|
7
|
+
var _a, _b;
|
|
8
8
|
if (payload == null || payload.length === 0) {
|
|
9
9
|
return undefined;
|
|
10
10
|
}
|
|
11
|
+
const recommendation = payload[0]; // In this case, there will be only one recommendation item since this is an entity recommendation.
|
|
12
|
+
const accounts = recommendation.accounts;
|
|
13
|
+
const classObjs = recommendation.accounting_classes;
|
|
11
14
|
const recommendations = [];
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
mappedAccounts.length >= ((_a = mappedClasses === null || mappedClasses === void 0 ? void 0 : mappedClasses.length) !== null && _a !== void 0 ? _a : 0)) {
|
|
20
|
-
mappedAccounts.forEach((account, index) => {
|
|
21
|
-
recommendations.push({
|
|
22
|
-
account,
|
|
23
|
-
class: mappedClasses === null || mappedClasses === void 0 ? void 0 : mappedClasses[index],
|
|
24
|
-
});
|
|
15
|
+
const mappedAccounts = accounts === null || accounts === void 0 ? void 0 : accounts.map((acc) => (0, accountPayload_1.mapRecommendedAccountBasePayloadToRecommendedAccountBase)(acc));
|
|
16
|
+
const mappedClasses = classObjs === null || classObjs === void 0 ? void 0 : classObjs.map((cls) => (0, classPayload_1.mapRecommendedClassBasePayloadToRecommendedClassBase)(cls));
|
|
17
|
+
if (((_a = mappedAccounts === null || mappedAccounts === void 0 ? void 0 : mappedAccounts.length) !== null && _a !== void 0 ? _a : 0) >= ((_b = mappedClasses === null || mappedClasses === void 0 ? void 0 : mappedClasses.length) !== null && _b !== void 0 ? _b : 0)) {
|
|
18
|
+
mappedAccounts === null || mappedAccounts === void 0 ? void 0 : mappedAccounts.forEach((acc, index) => {
|
|
19
|
+
recommendations.push({
|
|
20
|
+
account: acc,
|
|
21
|
+
class: mappedClasses === null || mappedClasses === void 0 ? void 0 : mappedClasses[index],
|
|
25
22
|
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
});
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
mappedClasses === null || mappedClasses === void 0 ? void 0 : mappedClasses.forEach((cls, index) => {
|
|
27
|
+
recommendations.push({
|
|
28
|
+
account: mappedAccounts === null || mappedAccounts === void 0 ? void 0 : mappedAccounts[index],
|
|
29
|
+
class: cls,
|
|
34
30
|
});
|
|
35
|
-
}
|
|
36
|
-
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
37
33
|
return recommendations;
|
|
38
34
|
};
|
|
39
35
|
exports.getRecommendationFromRecommendationPayload = getRecommendationFromRecommendationPayload;
|
|
40
|
-
const getRecommendationByLineIdFromRecommendationPayload = (recommendationPayload, lineIds) => {
|
|
41
|
-
if (recommendationPayload.length === 0) {
|
|
42
|
-
return undefined;
|
|
43
|
-
}
|
|
44
|
-
const recommendationsWithLine = {};
|
|
45
|
-
recommendationPayload.forEach((lineRecommendations, index) => {
|
|
46
|
-
recommendationsWithLine[lineIds[index]] =
|
|
47
|
-
(0, transactionPayload_1.transformRecommendation)(lineRecommendations);
|
|
48
|
-
});
|
|
49
|
-
return recommendationsWithLine;
|
|
50
|
-
};
|
|
51
|
-
exports.getRecommendationByLineIdFromRecommendationPayload = getRecommendationByLineIdFromRecommendationPayload;
|
|
@@ -6,7 +6,7 @@ import { SupportedTransaction } from '../../entity/transaction/transactionState'
|
|
|
6
6
|
import { ZeniAPIStatus } from '../../responsePayload';
|
|
7
7
|
import { EntityRecommendationState } from './recommendationState';
|
|
8
8
|
export declare const initialState: EntityRecommendationState;
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const fetchRecommendationByEntityQboId: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[entity: Entity, amount: number, transactionDetails: {
|
|
10
10
|
transactionId: TransactionID;
|
|
11
11
|
transaction: SupportedTransaction;
|
|
12
12
|
lineIds: ID[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearRecommendation = exports.indicateReadyToInitializeRecommendation = exports.updateRecommendationForEntityFailure = exports.updateRecommendationForEntity = exports.fetchRecommendationByEntityId = exports.fetchRecommendationByEntityName = exports.
|
|
4
|
+
exports.clearRecommendation = exports.indicateReadyToInitializeRecommendation = exports.updateRecommendationForEntityFailure = exports.updateRecommendationForEntity = exports.fetchRecommendationByEntityId = exports.fetchRecommendationByEntityName = exports.fetchRecommendationByEntityQboId = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const recommendationState_1 = require("./recommendationState");
|
|
7
7
|
exports.initialState = {
|
|
@@ -11,7 +11,7 @@ const recommendation = (0, toolkit_1.createSlice)({
|
|
|
11
11
|
name: 'recommendation',
|
|
12
12
|
initialState: exports.initialState,
|
|
13
13
|
reducers: {
|
|
14
|
-
|
|
14
|
+
fetchRecommendationByEntityQboId: {
|
|
15
15
|
reducer(draft,
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
17
17
|
action) {
|
|
@@ -101,7 +101,7 @@ const recommendation = (0, toolkit_1.createSlice)({
|
|
|
101
101
|
},
|
|
102
102
|
},
|
|
103
103
|
});
|
|
104
|
-
_a = recommendation.actions, exports.
|
|
104
|
+
_a = recommendation.actions, exports.fetchRecommendationByEntityQboId = _a.fetchRecommendationByEntityQboId, exports.fetchRecommendationByEntityName = _a.fetchRecommendationByEntityName, exports.fetchRecommendationByEntityId = _a.fetchRecommendationByEntityId, exports.updateRecommendationForEntity = _a.updateRecommendationForEntity, exports.updateRecommendationForEntityFailure = _a.updateRecommendationForEntityFailure, exports.indicateReadyToInitializeRecommendation = _a.indicateReadyToInitializeRecommendation, exports.clearRecommendation = _a.clearRecommendation;
|
|
105
105
|
exports.default = recommendation.reducer;
|
|
106
106
|
const doUpdateRecommendationForEntity = (draft, entityId, entityType, payload) => {
|
|
107
107
|
const key = (0, recommendationState_1.getEntityRecommendationKey)(entityType, entityId);
|
|
@@ -23,7 +23,6 @@ import { DuplicateLine } from '../remiDetailView/remiDetailViewState';
|
|
|
23
23
|
export interface EditRemiDetailSelectorView extends BankAccountSelectorView, SelectorView {
|
|
24
24
|
remiId: ID | undefined;
|
|
25
25
|
whatForSection: WhatForSection;
|
|
26
|
-
achSameDayMaxDays: number;
|
|
27
26
|
lineDetailSection: Record<ID, Partial<ReimbursementLineWithAttachmentAndRecommendation>>;
|
|
28
27
|
currencyConversionStatus: Record<ID, FetchStateAndError>;
|
|
29
28
|
paymentTo?: string;
|
|
@@ -20,8 +20,6 @@ const currencySelector_1 = require("../../../../entity/currency/currencySelector
|
|
|
20
20
|
const recommendationSelector_1 = require("../../../recommendation/recommendationSelector");
|
|
21
21
|
const helpers_1 = require("../../helpers");
|
|
22
22
|
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
23
|
-
const reimbursementConfigSelector_1 = require("../reimbursementConfig/reimbursementConfigSelector");
|
|
24
|
-
const reimbursementConfigState_1 = require("../reimbursementConfig/reimbursementConfigState");
|
|
25
23
|
const mapFileToAttachment = (file) => {
|
|
26
24
|
var _a;
|
|
27
25
|
if (file != null) {
|
|
@@ -42,11 +40,10 @@ const mapFileToAttachment = (file) => {
|
|
|
42
40
|
};
|
|
43
41
|
exports.mapFileToAttachment = mapFileToAttachment;
|
|
44
42
|
const getEditRemiDetail = (state, reimbursementId) => {
|
|
45
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r
|
|
43
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
46
44
|
const { accountListState, accountState, remiDetailViewState, reimbursementState, currencyState, classListState, classState, editRemiDetailViewState, reimbursementConfigState, merchantListState, merchantState, userState, bankAccountState, commonHistoryState, } = state;
|
|
47
|
-
const achSameDayMaxDays = (_b = (_a = (0, reimbursementConfigSelector_1.getReimbursementConfigByKey)(reimbursementConfigState, 'reimbursement_ach_same-day')) === null || _a === void 0 ? void 0 : _a.maxPeriod.value) !== null && _b !== void 0 ? _b : reimbursementConfigState_1.REIMBURSEMENT_PAYMENT_NUMBER_OF_DAYS;
|
|
48
45
|
const sourceRemiDetail = reimbursementId != null
|
|
49
|
-
? (
|
|
46
|
+
? (_a = editRemiDetailViewState.editRemiStateById) === null || _a === void 0 ? void 0 : _a[reimbursementId]
|
|
50
47
|
: editRemiDetailViewState.newRemiState;
|
|
51
48
|
let whatForSection = {};
|
|
52
49
|
let fetchState = 'Not-Started';
|
|
@@ -70,13 +67,13 @@ const getEditRemiDetail = (state, reimbursementId) => {
|
|
|
70
67
|
let reimbursementInfo = undefined;
|
|
71
68
|
if (reimbursementId != null) {
|
|
72
69
|
const reimbursement = (0, get_1.default)(reimbursementState.reimbursementById, reimbursementId, undefined);
|
|
73
|
-
isDeleted = (
|
|
70
|
+
isDeleted = (_b = reimbursement === null || reimbursement === void 0 ? void 0 : reimbursement.isDeleted) !== null && _b !== void 0 ? _b : false;
|
|
74
71
|
reimbursementInfo = reimbursement === null || reimbursement === void 0 ? void 0 : reimbursement.reimbursementInfo;
|
|
75
72
|
const initialWhatForSection = {
|
|
76
73
|
reportTitle: reimbursement === null || reimbursement === void 0 ? void 0 : reimbursement.reportTitle,
|
|
77
74
|
};
|
|
78
75
|
const updatesByLineId = {};
|
|
79
|
-
(
|
|
76
|
+
(_c = reimbursement === null || reimbursement === void 0 ? void 0 : reimbursement.lines) === null || _c === void 0 ? void 0 : _c.forEach((line) => {
|
|
80
77
|
updatesByLineId[line.lineId] = Object.assign({}, line, {
|
|
81
78
|
file: reimbursement.attachments.find((attachment) => attachment.fileId === line.fileId),
|
|
82
79
|
});
|
|
@@ -94,8 +91,8 @@ const getEditRemiDetail = (state, reimbursementId) => {
|
|
|
94
91
|
merchantListState,
|
|
95
92
|
reimbursementConfigState,
|
|
96
93
|
]).fetchState;
|
|
97
|
-
remiStage = (
|
|
98
|
-
createdBy = (0, userSelector_1.getUserByUserId)(userState, (
|
|
94
|
+
remiStage = (_d = reimbursementInfo === null || reimbursementInfo === void 0 ? void 0 : reimbursementInfo.stage.code) !== null && _d !== void 0 ? _d : 'draft';
|
|
95
|
+
createdBy = (0, userSelector_1.getUserByUserId)(userState, (_e = reimbursement === null || reimbursement === void 0 ? void 0 : reimbursement.createdBy) !== null && _e !== void 0 ? _e : '');
|
|
99
96
|
createTime = reimbursement === null || reimbursement === void 0 ? void 0 : reimbursement.createTime;
|
|
100
97
|
remiStatus = reimbursementInfo === null || reimbursementInfo === void 0 ? void 0 : reimbursementInfo.billStatus.code;
|
|
101
98
|
const remiViewState = remiDetailViewState.remiDetailById[reimbursementId];
|
|
@@ -111,14 +108,14 @@ const getEditRemiDetail = (state, reimbursementId) => {
|
|
|
111
108
|
}
|
|
112
109
|
if (sourceRemiDetail != null && fetchState == 'Completed') {
|
|
113
110
|
const updatedRecord = sourceRemiDetail.remiDetailLocalData;
|
|
114
|
-
whatForSection = { reportTitle: (
|
|
111
|
+
whatForSection = { reportTitle: (_f = updatedRecord.whatForSection) === null || _f === void 0 ? void 0 : _f.reportTitle };
|
|
115
112
|
addRemiAutoFieldsByLineId = sourceRemiDetail.addRemiAutoFieldsByLineId;
|
|
116
113
|
tentativeMerchantNameByLineId =
|
|
117
114
|
sourceRemiDetail.tentativeMerchantNameByLineId;
|
|
118
115
|
}
|
|
119
116
|
const lineDetailSection = {};
|
|
120
|
-
const lineDetailSectionUpdatesByLineId = (
|
|
121
|
-
const currencyConversionStatus = (
|
|
117
|
+
const lineDetailSectionUpdatesByLineId = (_h = (_g = sourceRemiDetail === null || sourceRemiDetail === void 0 ? void 0 : sourceRemiDetail.remiDetailLocalData) === null || _g === void 0 ? void 0 : _g.updatesByLineId) !== null && _h !== void 0 ? _h : {};
|
|
118
|
+
const currencyConversionStatus = (_k = (_j = sourceRemiDetail === null || sourceRemiDetail === void 0 ? void 0 : sourceRemiDetail.remiDetailLocalData) === null || _j === void 0 ? void 0 : _j.currencyConversionStateByLineId) !== null && _k !== void 0 ? _k : {};
|
|
122
119
|
Object.keys(lineDetailSectionUpdatesByLineId).forEach((lineId) => {
|
|
123
120
|
var _a, _b, _c;
|
|
124
121
|
lineDetailSection[lineId] = Object.assign({}, lineDetailSectionUpdatesByLineId[lineId], {
|
|
@@ -142,22 +139,21 @@ const getEditRemiDetail = (state, reimbursementId) => {
|
|
|
142
139
|
}
|
|
143
140
|
}
|
|
144
141
|
});
|
|
145
|
-
const paymentTo = (
|
|
142
|
+
const paymentTo = (_l = sourceRemiDetail === null || sourceRemiDetail === void 0 ? void 0 : sourceRemiDetail.remiDetailLocalData) === null || _l === void 0 ? void 0 : _l.paymentTo;
|
|
146
143
|
const paymentToBankAccountDetail = paymentTo != null
|
|
147
144
|
? (0, bankAccountSelector_1.getBankAccountByBankAccountId)(bankAccountState, paymentTo)
|
|
148
145
|
: undefined;
|
|
149
146
|
const bankAccount = (0, bankAccountViewSelector_1.getBankAccount)(state);
|
|
150
147
|
const accountsHeirarchyList = (0, accountListSelector_1.getNestedAccountListHeirarchy)(accountListState, 'reimbursementAccountList');
|
|
151
148
|
const classHeirarchyList = (0, classListSelector_1.getNestedClassListHeirarchy)(classListState);
|
|
152
|
-
const loggedInUserDepartmentId = (
|
|
149
|
+
const loggedInUserDepartmentId = (_m = (0, tenantSelector_1.getCurrentTenant)(state).accountingClassIDs) === null || _m === void 0 ? void 0 : _m[0];
|
|
153
150
|
const duplicateReimbursementStatus = remiDetailViewState.duplicateReimbursementFetchStatus;
|
|
154
151
|
const duplicateLineByLineId = remiDetailViewState.duplicateLineByLineId;
|
|
155
|
-
return Object.assign(Object.assign({}, bankAccount), {
|
|
156
|
-
duplicateReimbursementStatus,
|
|
152
|
+
return Object.assign(Object.assign({}, bankAccount), { duplicateReimbursementStatus,
|
|
157
153
|
duplicateLineByLineId, bankAccountCreationState: {
|
|
158
154
|
fetchState: bankAccount.fetchState,
|
|
159
155
|
error: bankAccount.error,
|
|
160
|
-
}, remiId: reimbursementId, fetchState: fetchState, isDeleted, saveStatus: (
|
|
156
|
+
}, remiId: reimbursementId, fetchState: fetchState, isDeleted, saveStatus: (_o = sourceRemiDetail === null || sourceRemiDetail === void 0 ? void 0 : sourceRemiDetail.saveStatus) !== null && _o !== void 0 ? _o : undefined, uploadStatus: (_p = sourceRemiDetail === null || sourceRemiDetail === void 0 ? void 0 : sourceRemiDetail.uploadFetchState) !== null && _p !== void 0 ? _p : 'Not-Started', error: (_r = (_q = sourceRemiDetail === null || sourceRemiDetail === void 0 ? void 0 : sourceRemiDetail.fetchStatus) === null || _q === void 0 ? void 0 : _q.error) !== null && _r !== void 0 ? _r : undefined, version: 0, whatForSection, lineDetailSection: lineDetailSection, paymentTo,
|
|
161
157
|
accountList,
|
|
162
158
|
currencyConversionStatus, classList: (0, classListSelector_1.getClassList)(classState, classListState), merchantList: (0, merchantListSelector_1.getMerchantList)(merchantState, merchantListState), allCurrencies: (0, currencySelector_1.getAllCurrencies)(currencyState), addRemiAutoFieldsByLineId,
|
|
163
159
|
tentativeMerchantNameByLineId,
|
package/lib/view/spendManagement/reimbursement/reimbursementConfig/reimbursementConfigState.d.ts
CHANGED
|
@@ -15,4 +15,3 @@ export declare const REIMBURSEMENT_PAYMENT_METHOD_CODE: readonly ["ach"];
|
|
|
15
15
|
export declare const toReimbursementmentMethodCodeType: (v: string) => "ach";
|
|
16
16
|
export declare type ReimbursementmentConfigCodeType = ReturnType<typeof toReimbursementmentMethodCodeType>;
|
|
17
17
|
export declare type ReimbursementmentSubConfigCodeType = PaymentAchSubConfigCodeType;
|
|
18
|
-
export declare const REIMBURSEMENT_PAYMENT_NUMBER_OF_DAYS = 2;
|
package/lib/view/spendManagement/reimbursement/reimbursementConfig/reimbursementConfigState.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.toReimbursementmentMethodCodeType = exports.REIMBURSEMENT_PAYMENT_METHOD_CODE = exports.getReimbursementConfigKey = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../../../commonStateTypes/stringToUnion");
|
|
5
5
|
const getReimbursementConfigKey = (method, subMethod) => `reimbursement_${method}_${subMethod}`;
|
|
6
6
|
exports.getReimbursementConfigKey = getReimbursementConfigKey;
|
|
7
7
|
exports.REIMBURSEMENT_PAYMENT_METHOD_CODE = ['ach'];
|
|
8
8
|
const toReimbursementmentMethodCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.REIMBURSEMENT_PAYMENT_METHOD_CODE);
|
|
9
9
|
exports.toReimbursementmentMethodCodeType = toReimbursementmentMethodCodeType;
|
|
10
|
-
exports.REIMBURSEMENT_PAYMENT_NUMBER_OF_DAYS = 2;
|
package/lib/view/spendManagement/reimbursement/remiDetailView/epics/fetchRemiDetailEpic.d.ts
CHANGED
|
@@ -14,6 +14,5 @@ import { indicateReadyToInitializeRemiLocalStore } from '../../editRemiView/edit
|
|
|
14
14
|
import { updateMerchantListIds } from '../../../merchantList/merchantListReducer';
|
|
15
15
|
import { fetchEntityHistory } from '../../../commonHistoryView/commonHistoryReducer';
|
|
16
16
|
import { updateRecommendationForEntity } from '../../../../recommendation/recommendationReducer';
|
|
17
|
-
|
|
18
|
-
export declare type ActionType = ReturnType<typeof fetchRemiDetail> | ReturnType<typeof updateReimbursement> | ReturnType<typeof updateBankAccounts> | ReturnType<typeof updateRemiDetailFetchState> | ReturnType<typeof removeReimbursement> | ReturnType<typeof removeRemiDetail> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateApprovalRules> | ReturnType<typeof fetchReimbursementConfig> | ReturnType<typeof updateMerchantListIds> | ReturnType<typeof updateEntityApprovalStatus> | ReturnType<typeof updateRecommendationForEntity> | ReturnType<typeof updateMerchants> | ReturnType<typeof fetchDuplicateReimbursement> | ReturnType<typeof indicateReadyToInitializeRemiLocalStore> | ReturnType<typeof updateRemiDetail> | ReturnType<typeof fetchEntityHistory>;
|
|
17
|
+
export declare type ActionType = ReturnType<typeof fetchRemiDetail> | ReturnType<typeof updateReimbursement> | ReturnType<typeof updateBankAccounts> | ReturnType<typeof updateRemiDetailFetchState> | ReturnType<typeof removeReimbursement> | ReturnType<typeof removeRemiDetail> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateApprovalRules> | ReturnType<typeof updateMerchantListIds> | ReturnType<typeof updateEntityApprovalStatus> | ReturnType<typeof updateRecommendationForEntity> | ReturnType<typeof updateMerchants> | ReturnType<typeof fetchDuplicateReimbursement> | ReturnType<typeof indicateReadyToInitializeRemiLocalStore> | ReturnType<typeof updateRemiDetail> | ReturnType<typeof fetchEntityHistory>;
|
|
19
18
|
export declare const fetchRemiDetailEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -20,17 +20,15 @@ const merchantListReducer_1 = require("../../../merchantList/merchantListReducer
|
|
|
20
20
|
const commonHistoryReducer_1 = require("../../../commonHistoryView/commonHistoryReducer");
|
|
21
21
|
const recommendationReducer_1 = require("../../../../recommendation/recommendationReducer");
|
|
22
22
|
const recommendationHelper_1 = require("../../../../recommendation/recommendationHelper");
|
|
23
|
-
const reimbursementConfigReducer_1 = require("../../../reimbursement/reimbursementConfig/reimbursementConfigReducer");
|
|
24
23
|
const fetchRemiDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(remiDetailViewReducer_1.fetchRemiDetail.match), (0, operators_1.mergeMap)((action) => {
|
|
25
24
|
const { reimbursementId, cacheOverride, isShowDeletedReimbursementEnabled, } = action.payload;
|
|
26
25
|
const remiActions = [];
|
|
27
26
|
const state = state$.value;
|
|
28
|
-
const { remiDetailViewState, reimbursementConfigState } = state;
|
|
29
27
|
if (cacheOverride === true) {
|
|
30
|
-
const existingReimbursement = (0, get_1.default)(remiDetailViewState.remiDetailById, reimbursementId, undefined);
|
|
28
|
+
const existingReimbursement = (0, get_1.default)(state.remiDetailViewState.remiDetailById, reimbursementId, undefined);
|
|
31
29
|
remiActions.push(...removeExistingRemi(reimbursementId, existingReimbursement));
|
|
32
30
|
}
|
|
33
|
-
const remiDetail = (0, get_1.default)(remiDetailViewState.remiDetailById, reimbursementId, undefined);
|
|
31
|
+
const remiDetail = (0, get_1.default)(state.remiDetailViewState.remiDetailById, reimbursementId, undefined);
|
|
34
32
|
if (cacheOverride == true ||
|
|
35
33
|
remiDetail == null ||
|
|
36
34
|
remiDetail.fetchState !== 'In-Progress') {
|
|
@@ -65,10 +63,6 @@ const fetchRemiDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
65
63
|
(0, bankAccountReducer_1.updateBankAccounts)(reimburseeBankAccount != null ? [reimburseeBankAccount] : []),
|
|
66
64
|
(0, remiDetailViewReducer_1.updateRemiDetailFetchState)(transcationId, 'Completed'),
|
|
67
65
|
];
|
|
68
|
-
if (reimbursementConfigState.fetchState !== 'In-Progress' &&
|
|
69
|
-
reimbursementConfigState.fetchState !== 'Completed') {
|
|
70
|
-
actions.push((0, reimbursementConfigReducer_1.fetchReimbursementConfig)());
|
|
71
|
-
}
|
|
72
66
|
//update the merchants recommendation in recommendation view
|
|
73
67
|
response.data.merchants.forEach((merchant) => {
|
|
74
68
|
var _a;
|
|
@@ -4,11 +4,11 @@ import { Reimbursement } from '../../../../entity/reimbursement/reimbursementSta
|
|
|
4
4
|
import { RootState } from '../../../../reducer';
|
|
5
5
|
import { ReimbursementLineWithAttachment } from '../editRemiView/editRemiViewSelector';
|
|
6
6
|
import { DuplicateLine } from './remiDetailViewState';
|
|
7
|
+
import { AttributeType, Criteria } from '../../../../entity/approvalRule/approvalRuleState';
|
|
7
8
|
import { ZeniDate } from '../../../../zeniDayJS';
|
|
8
9
|
import { ActivityStatus, Actor, EntityType } from '../../../../entity/entityApprovalStatus/entityApprovalStatusState';
|
|
9
10
|
import { StepWithUser } from '../remiSetupApproverView/remiSetupApproverViewSelectorTypes';
|
|
10
11
|
import { User } from '../../../../entity/user/userState';
|
|
11
|
-
import { AttributeType, Criteria } from '../../../../entity/approvalRule/approvalRuleState';
|
|
12
12
|
import { ActivityHistorySelectorView } from '../../commonHistoryView/commonHistorySelector';
|
|
13
13
|
import { LoggedInUser } from '../../../../entity/tenant/tenantState';
|
|
14
14
|
import { ActivityRealTimeApprovalSelectorView } from '../../realTimeApprovalView/realTimeApprovalSelector';
|
|
@@ -20,7 +20,6 @@ export interface RemiDetailViewSelector extends SelectorView {
|
|
|
20
20
|
cancelAndDeleteStatus: FetchStateAndError;
|
|
21
21
|
cancelStatus: FetchStateAndError;
|
|
22
22
|
approvalUpdateStatus: FetchStateAndError;
|
|
23
|
-
achSameDayMaxDays: number;
|
|
24
23
|
duplicateLineByLineId: Record<ID, DuplicateLine>;
|
|
25
24
|
duplicateReimbursementStatus: FetchStateAndError;
|
|
26
25
|
remiActivities: RemiActivity[];
|
|
@@ -15,22 +15,18 @@ const realTimeApprovalSelector_1 = require("../../realTimeApprovalView/realTimeA
|
|
|
15
15
|
const userRoleSelector_1 = require("../../../../entity/userRole/userRoleSelector");
|
|
16
16
|
const classSelector_1 = require("../../../../entity/class/classSelector");
|
|
17
17
|
const helpers_1 = require("../../helpers");
|
|
18
|
-
const reimbursementConfigSelector_1 = require("../reimbursementConfig/reimbursementConfigSelector");
|
|
19
|
-
const reimbursementConfigState_1 = require("../reimbursementConfig/reimbursementConfigState");
|
|
20
|
-
const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
|
|
21
18
|
const getRemiDetailView = (state, reimbursementId) => {
|
|
22
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
23
|
-
const { remiDetailViewState, reimbursementState, userState, commonHistoryState, realTimeApprovalState, userRoleState, classListState, classState, entityApprovalStatusState, remiSetupApproverViewState,
|
|
19
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
20
|
+
const { remiDetailViewState, reimbursementState, userState, commonHistoryState, realTimeApprovalState, userRoleState, classListState, classState, entityApprovalStatusState, remiSetupApproverViewState, } = state;
|
|
24
21
|
const remiTransactionDetails = (0, get_1.default)(remiDetailViewState.remiDetailById, reimbursementId, undefined);
|
|
25
|
-
const achSameDayMaxDays = (_b = (_a = (0, reimbursementConfigSelector_1.getReimbursementConfigByKey)(reimbursementConfigState, 'reimbursement_ach_same-day')) === null || _a === void 0 ? void 0 : _a.maxPeriod.value) !== null && _b !== void 0 ? _b : reimbursementConfigState_1.REIMBURSEMENT_PAYMENT_NUMBER_OF_DAYS;
|
|
26
22
|
const { approverListState } = remiSetupApproverViewState;
|
|
27
23
|
const reimbursement = reimbursementState.reimbursementById[reimbursementId];
|
|
28
24
|
let remiDetails;
|
|
29
25
|
if (reimbursement != null) {
|
|
30
26
|
remiDetails = Object.assign({}, reimbursement, {
|
|
31
|
-
lines: (
|
|
27
|
+
lines: (_b = (_a = reimbursement.lines) === null || _a === void 0 ? void 0 : _a.map((line) => {
|
|
32
28
|
return Object.assign(Object.assign({}, line), { file: reimbursement.attachments.find((attachment) => attachment.fileId === line.fileId) });
|
|
33
|
-
})) !== null &&
|
|
29
|
+
})) !== null && _b !== void 0 ? _b : [],
|
|
34
30
|
});
|
|
35
31
|
}
|
|
36
32
|
const { approverIds, attributes, attributeSubTypeToUserIdMapping } = approverListState;
|
|
@@ -45,7 +41,7 @@ const getRemiDetailView = (state, reimbursementId) => {
|
|
|
45
41
|
.filter((approver) => approver.user != null);
|
|
46
42
|
const filteredAttributes = (0, cloneDeep_1.default)(attributes);
|
|
47
43
|
const filteredApprovers = (0, cloneDeep_1.default)(allApprovers);
|
|
48
|
-
const entityApprovalStatusByIds = (0, entityApprovalStatusSelector_1.getEntityApprovalStatusByIds)(entityApprovalStatusState, (
|
|
44
|
+
const entityApprovalStatusByIds = (0, entityApprovalStatusSelector_1.getEntityApprovalStatusByIds)(entityApprovalStatusState, (_c = remiTransactionDetails === null || remiTransactionDetails === void 0 ? void 0 : remiTransactionDetails.entityApprovalIds) !== null && _c !== void 0 ? _c : []);
|
|
49
45
|
if (remiActivities != null &&
|
|
50
46
|
(reimbursement === null || reimbursement === void 0 ? void 0 : reimbursement.reimbursementInfo.stage.code) !== 'draft') {
|
|
51
47
|
entityApprovalStatusByIds.forEach((approval) => {
|
|
@@ -65,15 +61,15 @@ const getRemiDetailView = (state, reimbursementId) => {
|
|
|
65
61
|
}
|
|
66
62
|
});
|
|
67
63
|
}
|
|
68
|
-
const createdBy = (0, userSelector_1.getUserByUserId)(userState, (
|
|
69
|
-
const
|
|
70
|
-
fetchState: (
|
|
64
|
+
const createdBy = (0, userSelector_1.getUserByUserId)(userState, (_d = remiDetails === null || remiDetails === void 0 ? void 0 : remiDetails.createdBy) !== null && _d !== void 0 ? _d : '');
|
|
65
|
+
const fetchState = {
|
|
66
|
+
fetchState: (_e = remiTransactionDetails === null || remiTransactionDetails === void 0 ? void 0 : remiTransactionDetails.fetchState) !== null && _e !== void 0 ? _e : 'Not-Started',
|
|
71
67
|
error: remiTransactionDetails === null || remiTransactionDetails === void 0 ? void 0 : remiTransactionDetails.error,
|
|
72
68
|
};
|
|
73
|
-
const deleteStatus = (
|
|
74
|
-
const cancelStatus = (
|
|
75
|
-
const cancelAndDeleteStatus = (
|
|
76
|
-
const approvalUpdateStatus = (
|
|
69
|
+
const deleteStatus = (_f = remiTransactionDetails === null || remiTransactionDetails === void 0 ? void 0 : remiTransactionDetails.deleteStatus) !== null && _f !== void 0 ? _f : remiDetailViewState_1.initialRemiDetailView.deleteStatus;
|
|
70
|
+
const cancelStatus = (_g = remiTransactionDetails === null || remiTransactionDetails === void 0 ? void 0 : remiTransactionDetails.cancelStatus) !== null && _g !== void 0 ? _g : remiDetailViewState_1.initialRemiDetailView.cancelStatus;
|
|
71
|
+
const cancelAndDeleteStatus = (_h = remiTransactionDetails === null || remiTransactionDetails === void 0 ? void 0 : remiTransactionDetails.cancelAndDeleteStatus) !== null && _h !== void 0 ? _h : remiDetailViewState_1.initialRemiDetailView.cancelAndDeleteStatus;
|
|
72
|
+
const approvalUpdateStatus = (_j = remiTransactionDetails === null || remiTransactionDetails === void 0 ? void 0 : remiTransactionDetails.approvalUpdateStatus) !== null && _j !== void 0 ? _j : remiDetailViewState_1.initialRemiDetailView.approvalUpdateStatus;
|
|
77
73
|
const duplicateReimbursementStatus = remiDetailViewState.duplicateReimbursementFetchStatus;
|
|
78
74
|
const { classIds } = classListState;
|
|
79
75
|
const duplicateLineByLineId = remiDetailViewState.duplicateLineByLineId;
|
|
@@ -81,14 +77,9 @@ const getRemiDetailView = (state, reimbursementId) => {
|
|
|
81
77
|
classIds: classIds,
|
|
82
78
|
reportId: 'class_list',
|
|
83
79
|
});
|
|
84
|
-
const fetchState = (0, reduceFetchState_1.reduceFetchState)([
|
|
85
|
-
remiDetailFetchState,
|
|
86
|
-
reimbursementConfigState,
|
|
87
|
-
]).fetchState;
|
|
88
80
|
return {
|
|
89
|
-
fetchState,
|
|
90
|
-
|
|
91
|
-
error: remiTransactionDetails === null || remiTransactionDetails === void 0 ? void 0 : remiTransactionDetails.error,
|
|
81
|
+
fetchState: fetchState.fetchState,
|
|
82
|
+
error: fetchState.error,
|
|
92
83
|
version: 0,
|
|
93
84
|
remiDetails: remiDetails,
|
|
94
85
|
deleteStatus,
|
|
@@ -3,7 +3,6 @@ import { Recommendation } from '../../commonStateTypes/recommendationBase';
|
|
|
3
3
|
import { AccountBase } from '../../entity/account/accountState';
|
|
4
4
|
import { ClassBase } from '../../entity/class/classState';
|
|
5
5
|
import { Entity } from '../../entity/genericEntity/entity';
|
|
6
|
-
import { RecommendationByLineId } from '../../entity/transaction/stateTypes/transaction';
|
|
7
6
|
import { SupportedTransaction } from '../../entity/transaction/transactionState';
|
|
8
7
|
import { UncategorizedAccounts } from '../accountList/accountListSelector';
|
|
9
8
|
import { TransactionDetailLocalData } from './transactionDetailTypes';
|
|
@@ -17,6 +16,6 @@ export declare const toSetAllLineItemsToCategoryClass: (transaction: SupportedTr
|
|
|
17
16
|
updateOrRetain: 'update' | 'retain';
|
|
18
17
|
} | undefined, recommendations?: Recommendation[] | undefined) => TransactionDetailLocalData;
|
|
19
18
|
export declare const toSetAllLineItemsLocalDataIsUpdateAllChecked: (transaction: SupportedTransaction, transactionDetailLocalData: TransactionDetailLocalData, isUpdateAll: boolean, entity?: Entity | undefined) => TransactionDetailLocalData;
|
|
20
|
-
export declare const setEntityRecommendationForLineIdInLocalData: (transaction: SupportedTransaction, transactionDetailLocalData: TransactionDetailLocalData, entity: Entity, recommendationLineIds: ID[],
|
|
19
|
+
export declare const setEntityRecommendationForLineIdInLocalData: (transaction: SupportedTransaction, transactionDetailLocalData: TransactionDetailLocalData, entity: Entity, recommendationLineIds: ID[], recommendations?: Recommendation[] | undefined, uncategorizedIncomeExpense?: UncategorizedAccounts | undefined) => TransactionDetailLocalData;
|
|
21
20
|
export declare const removeEntityRecommendationForLineIdInLocalData: (transaction: SupportedTransaction, transactionDetailLocalData: TransactionDetailLocalData, recommendationLineIds: ID[]) => TransactionDetailLocalData;
|
|
22
21
|
export declare const getChangedLineItemCountFromLocalData: (transaction: SupportedTransaction, transactionLocalData: TransactionDetailLocalData) => number;
|
|
@@ -428,7 +428,7 @@ const toSetAllLineItemsLocalDataIsUpdateAllChecked = (transaction, transactionDe
|
|
|
428
428
|
return newLocalData;
|
|
429
429
|
};
|
|
430
430
|
exports.toSetAllLineItemsLocalDataIsUpdateAllChecked = toSetAllLineItemsLocalDataIsUpdateAllChecked;
|
|
431
|
-
const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDetailLocalData, entity, recommendationLineIds,
|
|
431
|
+
const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDetailLocalData, entity, recommendationLineIds, recommendations, uncategorizedIncomeExpense) => {
|
|
432
432
|
const newLineItems = {};
|
|
433
433
|
let matchingEntityLineId = undefined;
|
|
434
434
|
const checkIfNotJEAndDeposit = (0, vendorTransaction_1.isVendorTransaction)(transaction) === true ||
|
|
@@ -440,12 +440,11 @@ const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDet
|
|
|
440
440
|
const lineId = line.id;
|
|
441
441
|
const oldRecord = transactionDetailLocalData.lineItemById[lineId];
|
|
442
442
|
// check if any line already has this entity
|
|
443
|
-
if (recommendationLineIds.includes(
|
|
443
|
+
if (recommendationLineIds.includes(line.id)) {
|
|
444
444
|
if (line.type === 'transaction_with_account_and_class_line' ||
|
|
445
445
|
line.type === 'transaction_with_product_or_service_line' ||
|
|
446
446
|
line.type === 'journal_entry_transaction_line') {
|
|
447
447
|
const record = Object.assign({}, oldRecord);
|
|
448
|
-
const recommendations = recommendationByLineId === null || recommendationByLineId === void 0 ? void 0 : recommendationByLineId[lineId];
|
|
449
448
|
const accountLine = line;
|
|
450
449
|
record.account = accountLine.account;
|
|
451
450
|
record.class = accountLine.class;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ZeniAPIStatus } from '../../responsePayload';
|
|
2
|
-
import {
|
|
2
|
+
import { TransactionID } from '../../entity/transaction/stateTypes/transaction';
|
|
3
3
|
import { TransactionDetailState, TransactionSaveUpdates } from './transactionDetailState';
|
|
4
4
|
import { FetchState, UpdateType } from '../../commonStateTypes/common';
|
|
5
5
|
import { SupportedTransaction, SupportedTransactionPayload } from '../../entity/transaction/transactionState';
|
|
@@ -84,13 +84,13 @@ export declare const fetchTransactionDetail: import("@reduxjs/toolkit").ActionCr
|
|
|
84
84
|
transaction: SupportedTransaction;
|
|
85
85
|
isUpdateAll: boolean;
|
|
86
86
|
entity: Entity | undefined;
|
|
87
|
-
}, string, never, never>, setEntityRecommendationForLineIdsForTransactionDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, transaction: SupportedTransaction, lineIds: string[], entity: Entity, amount: number,
|
|
87
|
+
}, string, never, never>, setEntityRecommendationForLineIdsForTransactionDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, transaction: SupportedTransaction, lineIds: string[], entity: Entity, amount: number, recommendations?: Recommendation[] | undefined, uncategorizedIncomeExpense?: UncategorizedAccounts | undefined], {
|
|
88
88
|
transactionId: TransactionID;
|
|
89
89
|
transaction: SupportedTransaction;
|
|
90
90
|
lineIds: string[];
|
|
91
91
|
entity: Entity;
|
|
92
92
|
amount: number;
|
|
93
|
-
|
|
93
|
+
recommendations: Recommendation[] | undefined;
|
|
94
94
|
uncategorizedIncomeExpense: UncategorizedAccounts | undefined;
|
|
95
95
|
}, string, never, never>, removeEntityRecommendationForLineIdForTransactionDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, transaction: SupportedTransaction, lineId: string], {
|
|
96
96
|
transactionId: TransactionID;
|
|
@@ -270,15 +270,15 @@ const transactionDetail = (0, toolkit_1.createSlice)({
|
|
|
270
270
|
},
|
|
271
271
|
setEntityRecommendationForLineIdsForTransactionDetail: {
|
|
272
272
|
reducer(draft, action) {
|
|
273
|
-
const { transaction, lineIds,
|
|
273
|
+
const { transaction, lineIds, recommendations, uncategorizedIncomeExpense, } = action.payload;
|
|
274
274
|
const key = (0, transactionDetailState_1.getTransactionDetailKey)(action.payload.transactionId);
|
|
275
275
|
const detail = (0, get_1.default)(draft.transactionDetailById, key, undefined);
|
|
276
276
|
if (detail != null) {
|
|
277
|
-
const newLocalData = (0, transactionDetailLocalDataHelper_1.setEntityRecommendationForLineIdInLocalData)(transaction, detail.transactionDetailLocalData, action.payload.entity, lineIds,
|
|
277
|
+
const newLocalData = (0, transactionDetailLocalDataHelper_1.setEntityRecommendationForLineIdInLocalData)(transaction, detail.transactionDetailLocalData, action.payload.entity, lineIds, recommendations, uncategorizedIncomeExpense);
|
|
278
278
|
draft.transactionDetailById[key] = Object.assign(Object.assign({}, detail), { transactionDetailLocalData: newLocalData });
|
|
279
279
|
}
|
|
280
280
|
},
|
|
281
|
-
prepare(transactionId, transaction, lineIds, entity, amount,
|
|
281
|
+
prepare(transactionId, transaction, lineIds, entity, amount, recommendations, uncategorizedIncomeExpense) {
|
|
282
282
|
return {
|
|
283
283
|
payload: {
|
|
284
284
|
transactionId,
|
|
@@ -286,7 +286,7 @@ const transactionDetail = (0, toolkit_1.createSlice)({
|
|
|
286
286
|
lineIds,
|
|
287
287
|
entity,
|
|
288
288
|
amount,
|
|
289
|
-
|
|
289
|
+
recommendations,
|
|
290
290
|
uncategorizedIncomeExpense,
|
|
291
291
|
},
|
|
292
292
|
};
|
|
@@ -13,13 +13,6 @@ export declare type TransactionDetailKey = ReturnType<typeof getTransactionDetai
|
|
|
13
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
14
|
export declare type ZeniTransactionDetailKey = ReturnType<typeof getTransactionDetailKey>;
|
|
15
15
|
export declare const getThirdPartyIdFromTransactionId: (transactionId: TransactionID) => string;
|
|
16
|
-
/**
|
|
17
|
-
* Returns actual QBO transaction ID.
|
|
18
|
-
* @param zeniGeneratedId zeni transaciton Id in the form of tran_<uuid>:<qbo_id>
|
|
19
|
-
* @returns retruns the actual QBO transaction Id.
|
|
20
|
-
* @note in case if the given transaction id itself is QBO id, the it just passes it back.
|
|
21
|
-
*/
|
|
22
|
-
export declare const getActualTransactionID: (zeniGeneratedId: string) => string;
|
|
23
16
|
export declare function getAllLinkedTransactions(transaction: Transaction): TransactionID[];
|
|
24
17
|
export interface SupportedTransactionDetail extends FetchedState {
|
|
25
18
|
transactionId?: TransactionID;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initialSupportedTransactionDetail = exports.getAllLinkedTransactions = exports.
|
|
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) => `${
|
|
6
|
+
const getTransactionDetailKey = (transactionId) => `${getActualTransactionID(transactionId.id)}_${transactionId.type}`;
|
|
7
7
|
exports.getTransactionDetailKey = getTransactionDetailKey;
|
|
8
8
|
const getZeniTransactionDetailKey = (transactionId) => `${transactionId.id}_${transactionId.type}`;
|
|
9
9
|
exports.getZeniTransactionDetailKey = getZeniTransactionDetailKey;
|
|
10
10
|
const getThirdPartyIdFromTransactionId = (transactionId) => {
|
|
11
11
|
const zeniGeneratedId = transactionId.id;
|
|
12
|
-
return
|
|
12
|
+
return getActualTransactionID(zeniGeneratedId);
|
|
13
13
|
};
|
|
14
14
|
exports.getThirdPartyIdFromTransactionId = getThirdPartyIdFromTransactionId;
|
|
15
15
|
/**
|
|
@@ -27,7 +27,6 @@ const getActualTransactionID = (zeniGeneratedId) => {
|
|
|
27
27
|
return splittedIds[1];
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
exports.getActualTransactionID = getActualTransactionID;
|
|
31
30
|
function getAllLinkedTransactions(transaction) {
|
|
32
31
|
var _a, _b;
|
|
33
32
|
const result = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.8",
|
|
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",
|
package/lib/view/companyMonthEndReportView/epics/fetchCompanyMonthEndReportHistoricDataEpic.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
3
|
-
import { ZeniAPI } from '../../../zeniAPI';
|
|
4
|
-
import { RootState } from '../../../reducer';
|
|
5
|
-
import { fetchCompanyMonthEndReportHistoricData, updateCompanyMonthEndReportHistoricDataOnSuccess, updateCompanyMonthEndReportHistoricDataOnFailure } from '../companyMonthEndReportViewReducer';
|
|
6
|
-
import { updateAttachmentFiles } from '../../../entity/file/fileReducer';
|
|
7
|
-
export declare type ActionType = ReturnType<typeof fetchCompanyMonthEndReportHistoricData> | ReturnType<typeof updateCompanyMonthEndReportHistoricDataOnSuccess> | ReturnType<typeof updateCompanyMonthEndReportHistoricDataOnFailure> | ReturnType<typeof updateAttachmentFiles>;
|
|
8
|
-
export declare const fetchCompanyMonthEndReportHistoricDataEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|