@zeniai/client-epic-state 5.0.92-betaNB2 → 5.0.92
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/viewAndReport/agingReportStateTypes.d.ts +1 -1
- package/lib/entity/accountRecon/accountReconPayload.d.ts +1 -20
- package/lib/entity/accountRecon/accountReconPayload.js +1 -23
- package/lib/entity/accountRecon/accountReconSelector.d.ts +1 -6
- package/lib/entity/accountRecon/accountReconSelector.js +0 -5
- package/lib/entity/accountRecon/accountReconState.d.ts +0 -19
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksPayload.d.ts +0 -7
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksPayload.js +0 -9
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksState.d.ts +0 -7
- package/lib/epic.d.ts +1 -3
- package/lib/epic.js +1 -3
- package/lib/esm/entity/accountRecon/accountReconPayload.js +1 -23
- package/lib/esm/entity/accountRecon/accountReconSelector.js +0 -5
- package/lib/esm/entity/monthEndCloseChecks/monthEndCloseChecksPayload.js +0 -9
- package/lib/esm/epic.js +1 -3
- package/lib/esm/index.js +2 -2
- package/lib/esm/view/expenseAutomationView/payload/reconciliationPayload.js +0 -73
- package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +4 -98
- package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +0 -20
- package/lib/esm/view/expenseAutomationView/types/reconciliationViewState.js +0 -20
- package/lib/index.d.ts +5 -5
- package/lib/index.js +33 -41
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +1 -83
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.js +0 -75
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +3 -35
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +5 -99
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +1 -5
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +0 -20
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +0 -128
- package/lib/view/expenseAutomationView/types/reconciliationViewState.js +0 -21
- package/lib/view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListState.d.ts +1 -1
- package/package.json +1 -1
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/parseStatementEpic.js +0 -34
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/updateStatementInfoEpic.js +0 -42
- package/lib/view/expenseAutomationView/epics/accountRecon/parseStatementEpic.d.ts +0 -6
- package/lib/view/expenseAutomationView/epics/accountRecon/parseStatementEpic.js +0 -38
- package/lib/view/expenseAutomationView/epics/accountRecon/updateStatementInfoEpic.d.ts +0 -19
- package/lib/view/expenseAutomationView/epics/accountRecon/updateStatementInfoEpic.js +0 -46
|
@@ -1,28 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.toReconciliationTabsType = exports.toReconcileActions = exports.RECONCILE_ACTIONS = void 0;
|
|
4
|
-
exports.toReconciliationViewSummary = toReconciliationViewSummary;
|
|
5
4
|
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
6
|
-
function toReconciliationViewSummary(payload) {
|
|
7
|
-
return {
|
|
8
|
-
accounts: {
|
|
9
|
-
done: payload.accounts.done,
|
|
10
|
-
failed: payload.accounts.failed,
|
|
11
|
-
inProgress: payload.accounts.in_progress,
|
|
12
|
-
total: payload.accounts.total,
|
|
13
|
-
},
|
|
14
|
-
accountsToConnectCount: payload.accounts_to_connect_count,
|
|
15
|
-
autoMatched: {
|
|
16
|
-
matchedTxns: payload.auto_matched.matched_txns,
|
|
17
|
-
totalTxns: payload.auto_matched.total_txns,
|
|
18
|
-
},
|
|
19
|
-
needsReview: {
|
|
20
|
-
accountCount: payload.needs_review.account_count,
|
|
21
|
-
txnCount: payload.needs_review.txn_count,
|
|
22
|
-
},
|
|
23
|
-
timeSavedPercentage: payload.time_saved_percentage,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
5
|
exports.RECONCILE_ACTIONS = [
|
|
27
6
|
'reconcile',
|
|
28
7
|
'save_reconcile_for_later',
|
|
@@ -20,7 +20,7 @@ export interface VendorFiling1099ListQuery {
|
|
|
20
20
|
sortKey: VendorFiling1099ListViewSortKey;
|
|
21
21
|
sortOrder: SortOrder;
|
|
22
22
|
}
|
|
23
|
-
declare const toVendorFiling1099ListViewSortKey: (v: string) => "status" | "w9" | "
|
|
23
|
+
declare const toVendorFiling1099ListViewSortKey: (v: string) => "status" | "w9" | "legal_name" | "total" | "tax_classification" | "filing1099type";
|
|
24
24
|
export type VendorFiling1099ListViewSortKey = ReturnType<typeof toVendorFiling1099ListViewSortKey>;
|
|
25
25
|
export type Type1099Download = 'nec' | 'misc' | 'int';
|
|
26
26
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.92
|
|
3
|
+
"version": "5.0.92",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { from, of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
4
|
-
import { transformParseStatementPayloadToState, } from '../../payload/reconciliationPayload';
|
|
5
|
-
import { parseStatement, parseStatementFailure, parseStatementSuccess, updateParsedStatementData, } from '../../reducers/reconciliationViewReducer';
|
|
6
|
-
export const parseStatementEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(parseStatement.match), mergeMap((action) => {
|
|
7
|
-
const { accountId, selectedPeriod, statementUploadId } = action.payload;
|
|
8
|
-
const parseStatementApi$ = zeniAPI.getJSON(`${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/2.0/statement-uploads/${statementUploadId}`);
|
|
9
|
-
return parseStatementApi$.pipe(mergeMap((response) => {
|
|
10
|
-
if (isSuccessResponse(response) === true && response.data != null) {
|
|
11
|
-
const actions = [];
|
|
12
|
-
const transformedData = transformParseStatementPayloadToState(response.data);
|
|
13
|
-
actions.push(updateParsedStatementData({
|
|
14
|
-
accountId,
|
|
15
|
-
selectedPeriod,
|
|
16
|
-
parsedStatementData: transformedData,
|
|
17
|
-
}));
|
|
18
|
-
actions.push(parseStatementSuccess({ accountId, selectedPeriod }));
|
|
19
|
-
return from(actions);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
return of(parseStatementFailure({
|
|
23
|
-
accountId,
|
|
24
|
-
selectedPeriod,
|
|
25
|
-
error: response.status,
|
|
26
|
-
}));
|
|
27
|
-
}
|
|
28
|
-
}), catchError((error) => of(parseStatementFailure({
|
|
29
|
-
accountId,
|
|
30
|
-
selectedPeriod,
|
|
31
|
-
error: createZeniAPIStatus('Unexpected Error', 'Parse Statement REST API call errored out ' +
|
|
32
|
-
JSON.stringify(error)),
|
|
33
|
-
}))));
|
|
34
|
-
}));
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { toMonthYearPeriodId } from '../../../../commonStateTypes/timePeriod';
|
|
4
|
-
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
5
|
-
import { transformStatementUpdateStateToPayload, } from '../../payload/reconciliationPayload';
|
|
6
|
-
import { submitStatementUpdate, submitStatementUpdateFailure, submitStatementUpdateSuccess, } from '../../reducers/reconciliationViewReducer';
|
|
7
|
-
export const updateStatementInfoEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(submitStatementUpdate.match), mergeMap((action) => {
|
|
8
|
-
const { accountId, selectedPeriod, statementUploadId } = action.payload;
|
|
9
|
-
const state = state$.value;
|
|
10
|
-
const reconciliationView = state.expenseAutomationReconciliationViewState;
|
|
11
|
-
const accountRecon = reconciliationView.accountReconciliationRecordsBySelectedPeriod[toMonthYearPeriodId(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
12
|
-
const localData = accountRecon?.localData?.statementUpdateLocalData;
|
|
13
|
-
if (!localData) {
|
|
14
|
-
return of(submitStatementUpdateFailure({
|
|
15
|
-
accountId,
|
|
16
|
-
selectedPeriod,
|
|
17
|
-
error: createZeniAPIStatus('Missing Data', 'No statement update data found'),
|
|
18
|
-
}));
|
|
19
|
-
}
|
|
20
|
-
const payload = transformStatementUpdateStateToPayload(localData);
|
|
21
|
-
const updateStatementApi$ = zeniAPI.putAndGetJSON(`${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/2.0/statement-uploads/${statementUploadId}`, payload);
|
|
22
|
-
return updateStatementApi$.pipe(mergeMap((response) => {
|
|
23
|
-
if (isSuccessResponse(response) === true && response.data != null) {
|
|
24
|
-
return of(submitStatementUpdateSuccess({
|
|
25
|
-
accountId,
|
|
26
|
-
selectedPeriod,
|
|
27
|
-
}));
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
return of(submitStatementUpdateFailure({
|
|
31
|
-
accountId,
|
|
32
|
-
selectedPeriod,
|
|
33
|
-
error: response.status,
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
|
-
}), catchError((error) => of(submitStatementUpdateFailure({
|
|
37
|
-
accountId,
|
|
38
|
-
selectedPeriod,
|
|
39
|
-
error: createZeniAPIStatus('Unexpected Error', 'Update Statement REST API call errored out ' +
|
|
40
|
-
JSON.stringify(error)),
|
|
41
|
-
}))));
|
|
42
|
-
}));
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { RootState } from '../../../../reducer';
|
|
3
|
-
import { ZeniAPI } from '../../../../zeniAPI';
|
|
4
|
-
import { parseStatement, parseStatementFailure, parseStatementSuccess, updateParsedStatementData } from '../../reducers/reconciliationViewReducer';
|
|
5
|
-
export type ActionType = ReturnType<typeof parseStatement> | ReturnType<typeof parseStatementSuccess> | ReturnType<typeof parseStatementFailure> | ReturnType<typeof updateParsedStatementData>;
|
|
6
|
-
export declare const parseStatementEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseStatementEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
-
const reconciliationPayload_1 = require("../../payload/reconciliationPayload");
|
|
8
|
-
const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewReducer");
|
|
9
|
-
const parseStatementEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(reconciliationViewReducer_1.parseStatement.match), (0, operators_1.mergeMap)((action) => {
|
|
10
|
-
const { accountId, selectedPeriod, statementUploadId } = action.payload;
|
|
11
|
-
const parseStatementApi$ = zeniAPI.getJSON(`${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/2.0/statement-uploads/${statementUploadId}`);
|
|
12
|
-
return parseStatementApi$.pipe((0, operators_1.mergeMap)((response) => {
|
|
13
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) === true && response.data != null) {
|
|
14
|
-
const actions = [];
|
|
15
|
-
const transformedData = (0, reconciliationPayload_1.transformParseStatementPayloadToState)(response.data);
|
|
16
|
-
actions.push((0, reconciliationViewReducer_1.updateParsedStatementData)({
|
|
17
|
-
accountId,
|
|
18
|
-
selectedPeriod,
|
|
19
|
-
parsedStatementData: transformedData,
|
|
20
|
-
}));
|
|
21
|
-
actions.push((0, reconciliationViewReducer_1.parseStatementSuccess)({ accountId, selectedPeriod }));
|
|
22
|
-
return (0, rxjs_1.from)(actions);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
return (0, rxjs_1.of)((0, reconciliationViewReducer_1.parseStatementFailure)({
|
|
26
|
-
accountId,
|
|
27
|
-
selectedPeriod,
|
|
28
|
-
error: response.status,
|
|
29
|
-
}));
|
|
30
|
-
}
|
|
31
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, reconciliationViewReducer_1.parseStatementFailure)({
|
|
32
|
-
accountId,
|
|
33
|
-
selectedPeriod,
|
|
34
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Parse Statement REST API call errored out ' +
|
|
35
|
-
JSON.stringify(error)),
|
|
36
|
-
}))));
|
|
37
|
-
}));
|
|
38
|
-
exports.parseStatementEpic = parseStatementEpic;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { RootState } from '../../../../reducer';
|
|
3
|
-
import { ZeniAPI } from '../../../../zeniAPI';
|
|
4
|
-
import { submitStatementUpdate, submitStatementUpdateFailure, submitStatementUpdateSuccess } from '../../reducers/reconciliationViewReducer';
|
|
5
|
-
export type ActionType = ReturnType<typeof submitStatementUpdate> | ReturnType<typeof submitStatementUpdateSuccess> | ReturnType<typeof submitStatementUpdateFailure>;
|
|
6
|
-
export declare const updateStatementInfoEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
7
|
-
payload: {
|
|
8
|
-
accountId: import("../../../..").ID;
|
|
9
|
-
selectedPeriod: import("../../../../commonStateTypes/timePeriod").MonthYearPeriod;
|
|
10
|
-
};
|
|
11
|
-
type: "expenseAutomationReconciliationView/submitStatementUpdateSuccess";
|
|
12
|
-
} | {
|
|
13
|
-
payload: {
|
|
14
|
-
accountId: import("../../../..").ID;
|
|
15
|
-
error: import("../../../../responsePayload").ZeniAPIStatus;
|
|
16
|
-
selectedPeriod: import("../../../../commonStateTypes/timePeriod").MonthYearPeriod;
|
|
17
|
-
};
|
|
18
|
-
type: "expenseAutomationReconciliationView/submitStatementUpdateFailure";
|
|
19
|
-
}>;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateStatementInfoEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
|
|
7
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
8
|
-
const reconciliationPayload_1 = require("../../payload/reconciliationPayload");
|
|
9
|
-
const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewReducer");
|
|
10
|
-
const updateStatementInfoEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(reconciliationViewReducer_1.submitStatementUpdate.match), (0, operators_1.mergeMap)((action) => {
|
|
11
|
-
const { accountId, selectedPeriod, statementUploadId } = action.payload;
|
|
12
|
-
const state = state$.value;
|
|
13
|
-
const reconciliationView = state.expenseAutomationReconciliationViewState;
|
|
14
|
-
const accountRecon = reconciliationView.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]?.reconciliationByAccountID[accountId];
|
|
15
|
-
const localData = accountRecon?.localData?.statementUpdateLocalData;
|
|
16
|
-
if (!localData) {
|
|
17
|
-
return (0, rxjs_1.of)((0, reconciliationViewReducer_1.submitStatementUpdateFailure)({
|
|
18
|
-
accountId,
|
|
19
|
-
selectedPeriod,
|
|
20
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Missing Data', 'No statement update data found'),
|
|
21
|
-
}));
|
|
22
|
-
}
|
|
23
|
-
const payload = (0, reconciliationPayload_1.transformStatementUpdateStateToPayload)(localData);
|
|
24
|
-
const updateStatementApi$ = zeniAPI.putAndGetJSON(`${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/2.0/statement-uploads/${statementUploadId}`, payload);
|
|
25
|
-
return updateStatementApi$.pipe((0, operators_1.mergeMap)((response) => {
|
|
26
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) === true && response.data != null) {
|
|
27
|
-
return (0, rxjs_1.of)((0, reconciliationViewReducer_1.submitStatementUpdateSuccess)({
|
|
28
|
-
accountId,
|
|
29
|
-
selectedPeriod,
|
|
30
|
-
}));
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
return (0, rxjs_1.of)((0, reconciliationViewReducer_1.submitStatementUpdateFailure)({
|
|
34
|
-
accountId,
|
|
35
|
-
selectedPeriod,
|
|
36
|
-
error: response.status,
|
|
37
|
-
}));
|
|
38
|
-
}
|
|
39
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, reconciliationViewReducer_1.submitStatementUpdateFailure)({
|
|
40
|
-
accountId,
|
|
41
|
-
selectedPeriod,
|
|
42
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Update Statement REST API call errored out ' +
|
|
43
|
-
JSON.stringify(error)),
|
|
44
|
-
}))));
|
|
45
|
-
}));
|
|
46
|
-
exports.updateStatementInfoEpic = updateStatementInfoEpic;
|