@zeniai/client-epic-state 5.1.35-betaAK5 → 5.1.35-betaAK7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/entity/invoicing/{transaction/transactionPayload.d.ts → invoicingTransaction/invoicingTransactionPayload.d.ts} +1 -1
- package/lib/entity/invoicing/{transaction/transactionReducer.d.ts → invoicingTransaction/invoicingTransactionReducer.d.ts} +2 -2
- package/lib/entity/invoicing/invoicingTransaction/invoicingTransactionReducer.js +49 -0
- package/lib/entity/invoicing/invoicingTransaction/invoicingTransactionSelector.d.ts +4 -0
- package/lib/entity/invoicing/{transaction/transactionSelector.js → invoicingTransaction/invoicingTransactionSelector.js} +6 -6
- package/lib/entity/invoicing/{transaction/transactionState.d.ts → invoicingTransaction/invoicingTransactionState.d.ts} +2 -2
- package/lib/entity/tenant/clearAllEpic.d.ts +1 -1
- package/lib/entity/tenant/clearAllEpic.js +4 -4
- package/lib/esm/entity/invoicing/invoicingTransaction/invoicingTransactionReducer.js +42 -0
- package/lib/esm/entity/invoicing/invoicingTransaction/invoicingTransactionSelector.js +10 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +1 -1
- package/lib/esm/index.js +8 -1
- package/lib/esm/reducer.js +1 -1
- package/lib/esm/view/invoicing/couponView/couponViewSelector.js +3 -0
- package/lib/esm/view/invoicing/couponView/couponViewState.js +24 -1
- package/lib/esm/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +3 -0
- package/lib/esm/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewState.js +18 -1
- package/lib/esm/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewSelector.js +3 -0
- package/lib/esm/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewState.js +22 -1
- package/lib/esm/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewSelector.js +3 -0
- package/lib/esm/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.js +18 -1
- package/lib/esm/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewSelector.js +3 -0
- package/lib/esm/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +22 -1
- package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js +3 -0
- package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js +22 -1
- package/lib/esm/view/invoicing/invoicingTransactionDetailView/invoicingTransactionDetailViewEpics.js +1 -1
- package/lib/esm/view/invoicing/invoicingTransactionDetailView/invoicingTransactionDetailViewSelector.js +1 -1
- package/lib/esm/view/invoicing/invoicingTransactionListView/epics/fetchInvoicingTransactionKPIsEpic.js +1 -1
- package/lib/esm/view/invoicing/invoicingTransactionListView/epics/fetchInvoicingTransactionListEpic.js +1 -1
- package/lib/esm/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewSelector.js +4 -1
- package/lib/esm/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewState.js +22 -1
- package/lib/esm/view/invoicing/paymentAction/paymentActionEpic.js +1 -1
- package/lib/esm/view/invoicing/recordPayment/recordPaymentEpic.js +1 -1
- package/lib/index.d.ts +17 -10
- package/lib/index.js +28 -7
- package/lib/reducer.d.ts +1 -1
- package/lib/reducer.js +6 -6
- package/lib/view/invoicing/couponView/couponViewSelector.d.ts +4 -1
- package/lib/view/invoicing/couponView/couponViewSelector.js +3 -0
- package/lib/view/invoicing/couponView/couponViewState.d.ts +15 -0
- package/lib/view/invoicing/couponView/couponViewState.js +26 -0
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.d.ts +4 -1
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector.js +3 -0
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewState.d.ts +15 -0
- package/lib/view/invoicing/invoicingCatalogListView/invoicingCatalogListViewState.js +20 -0
- package/lib/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewSelector.d.ts +4 -1
- package/lib/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewSelector.js +3 -0
- package/lib/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewState.d.ts +15 -0
- package/lib/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewState.js +24 -0
- package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewSelector.d.ts +4 -1
- package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewSelector.js +3 -0
- package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.d.ts +15 -0
- package/lib/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState.js +20 -0
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewSelector.d.ts +4 -1
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewSelector.js +3 -0
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.d.ts +15 -0
- package/lib/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js +24 -0
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.d.ts +4 -1
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector.js +3 -0
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.d.ts +15 -0
- package/lib/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js +24 -0
- package/lib/view/invoicing/invoicingTransactionDetailView/invoicingTransactionDetailViewEpics.d.ts +1 -1
- package/lib/view/invoicing/invoicingTransactionDetailView/invoicingTransactionDetailViewEpics.js +2 -2
- package/lib/view/invoicing/invoicingTransactionDetailView/invoicingTransactionDetailViewPayload.d.ts +1 -1
- package/lib/view/invoicing/invoicingTransactionDetailView/invoicingTransactionDetailViewSelector.d.ts +1 -1
- package/lib/view/invoicing/invoicingTransactionDetailView/invoicingTransactionDetailViewSelector.js +2 -2
- package/lib/view/invoicing/invoicingTransactionListView/epics/fetchInvoicingTransactionKPIsEpic.js +2 -2
- package/lib/view/invoicing/invoicingTransactionListView/epics/fetchInvoicingTransactionListEpic.d.ts +1 -1
- package/lib/view/invoicing/invoicingTransactionListView/epics/fetchInvoicingTransactionListEpic.js +2 -2
- package/lib/view/invoicing/invoicingTransactionListView/epics/fetchInvoicingTransactionListPageEpic.d.ts +1 -1
- package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewPayload.d.ts +1 -1
- package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewSelector.d.ts +5 -2
- package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewSelector.js +5 -2
- package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewState.d.ts +16 -1
- package/lib/view/invoicing/invoicingTransactionListView/invoicingTransactionListViewState.js +24 -0
- package/lib/view/invoicing/paymentAction/paymentActionEpic.d.ts +1 -1
- package/lib/view/invoicing/paymentAction/paymentActionEpic.js +2 -2
- package/lib/view/invoicing/paymentAction/paymentActionPayload.d.ts +1 -1
- package/lib/view/invoicing/recordPayment/recordPaymentEpic.d.ts +1 -1
- package/lib/view/invoicing/recordPayment/recordPaymentEpic.js +2 -2
- package/lib/view/invoicing/recordPayment/recordPaymentPayload.d.ts +1 -1
- package/package.json +1 -1
- package/lib/entity/invoicing/transaction/transactionReducer.js +0 -49
- package/lib/entity/invoicing/transaction/transactionSelector.d.ts +0 -4
- package/lib/esm/entity/invoicing/transaction/transactionReducer.js +0 -42
- package/lib/esm/entity/invoicing/transaction/transactionSelector.js +0 -10
- /package/lib/entity/invoicing/{transaction/transactionPayload.js → invoicingTransaction/invoicingTransactionPayload.js} +0 -0
- /package/lib/entity/invoicing/{transaction/transactionState.js → invoicingTransaction/invoicingTransactionState.js} +0 -0
- /package/lib/esm/entity/invoicing/{transaction/transactionPayload.js → invoicingTransaction/invoicingTransactionPayload.js} +0 -0
- /package/lib/esm/entity/invoicing/{transaction/transactionState.js → invoicingTransaction/invoicingTransactionState.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InvoicingPaymentKPIs, InvoicingTransaction } from './
|
|
1
|
+
import { InvoicingPaymentKPIs, InvoicingTransaction } from './invoicingTransactionState';
|
|
2
2
|
export type InvoicingTransactionType = 'payment' | 'refund' | 'authorization' | 'payment_reversal';
|
|
3
3
|
export type InvoicingTransactionStatus = 'in_progress' | 'success' | 'voided' | 'failure' | 'timeout' | 'needs_attention' | 'late_failure' | 'failed';
|
|
4
4
|
export interface InvoicingLinkedInvoiceRefPayload {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UpdateType } from '../../../commonStateTypes/common';
|
|
2
|
-
import { InvoicingTransactionPayload } from './
|
|
3
|
-
import { InvoicingTransactionState } from './
|
|
2
|
+
import { InvoicingTransactionPayload } from './invoicingTransactionPayload';
|
|
3
|
+
import { InvoicingTransactionState } from './invoicingTransactionState';
|
|
4
4
|
export declare const initialState: InvoicingTransactionState;
|
|
5
5
|
export declare const updateInvoicingTransactions: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: InvoicingTransactionPayload[], updateType?: UpdateType | undefined], InvoicingTransactionPayload[], "invoicingTransaction/updateInvoicingTransactions", never, {
|
|
6
6
|
updateType: UpdateType;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
var _a;
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.clearAllInvoicingTransactions = exports.removeInvoicingTransaction = exports.updateInvoicingTransactions = exports.initialState = void 0;
|
|
8
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
|
+
const assignWith_1 = __importDefault(require("lodash/assignWith"));
|
|
10
|
+
const invoicingTransactionPayload_1 = require("./invoicingTransactionPayload");
|
|
11
|
+
exports.initialState = {
|
|
12
|
+
invoicingTransactionByID: {},
|
|
13
|
+
};
|
|
14
|
+
const invoicingTransaction = (0, toolkit_1.createSlice)({
|
|
15
|
+
name: 'invoicingTransaction',
|
|
16
|
+
initialState: exports.initialState,
|
|
17
|
+
reducers: {
|
|
18
|
+
updateInvoicingTransactions: {
|
|
19
|
+
reducer(draft, action) {
|
|
20
|
+
doUpdateInvoicingTransactions(draft.invoicingTransactionByID, action.payload, action.meta.updateType);
|
|
21
|
+
},
|
|
22
|
+
prepare(payload, updateType = 'replace') {
|
|
23
|
+
return { payload, meta: { updateType } };
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
removeInvoicingTransaction(draft, action) {
|
|
27
|
+
delete draft.invoicingTransactionByID[action.payload];
|
|
28
|
+
},
|
|
29
|
+
clearAllInvoicingTransactions(draft) {
|
|
30
|
+
Object.assign(draft, exports.initialState);
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
_a = invoicingTransaction.actions, exports.updateInvoicingTransactions = _a.updateInvoicingTransactions, exports.removeInvoicingTransaction = _a.removeInvoicingTransaction, exports.clearAllInvoicingTransactions = _a.clearAllInvoicingTransactions;
|
|
35
|
+
exports.default = invoicingTransaction.reducer;
|
|
36
|
+
/**
|
|
37
|
+
* Helper functions.
|
|
38
|
+
*/
|
|
39
|
+
function doUpdateInvoicingTransactions(draft, payload, updateType) {
|
|
40
|
+
payload.forEach((invoicingTransactionPayload) => {
|
|
41
|
+
const latestInvoicingTransaction = (0, invoicingTransactionPayload_1.mapInvoicingTransactionPayloadToState)(invoicingTransactionPayload);
|
|
42
|
+
if (latestInvoicingTransaction.id in draft && updateType === 'merge') {
|
|
43
|
+
(0, assignWith_1.default)(draft[latestInvoicingTransaction.id], latestInvoicingTransaction, (objValue, srcValue) => (srcValue == null ? objValue : srcValue));
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
draft[latestInvoicingTransaction.id] = latestInvoicingTransaction;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ID } from '../../../commonStateTypes/common';
|
|
2
|
+
import { InvoicingTransaction, InvoicingTransactionState } from './invoicingTransactionState';
|
|
3
|
+
export declare function getInvoicingTransactionsByIds(invoicingTransactionState: InvoicingTransactionState, ids: ID[]): InvoicingTransaction[];
|
|
4
|
+
export declare function getInvoicingTransactionById(invoicingTransactionState: InvoicingTransactionState, id: ID): InvoicingTransaction | undefined;
|
|
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.getInvoicingTransactionsByIds = getInvoicingTransactionsByIds;
|
|
7
7
|
exports.getInvoicingTransactionById = getInvoicingTransactionById;
|
|
8
8
|
const get_1 = __importDefault(require("lodash/get"));
|
|
9
|
-
function getInvoicingTransactionsByIds(
|
|
10
|
-
const
|
|
11
|
-
.map((id) => getInvoicingTransactionById(
|
|
9
|
+
function getInvoicingTransactionsByIds(invoicingTransactionState, ids) {
|
|
10
|
+
const invoicingTransactions = ids
|
|
11
|
+
.map((id) => getInvoicingTransactionById(invoicingTransactionState, id))
|
|
12
12
|
.filter((value) => value != null);
|
|
13
|
-
return
|
|
13
|
+
return invoicingTransactions;
|
|
14
14
|
}
|
|
15
|
-
function getInvoicingTransactionById(
|
|
16
|
-
return (0, get_1.default)(
|
|
15
|
+
function getInvoicingTransactionById(invoicingTransactionState, id) {
|
|
16
|
+
return (0, get_1.default)(invoicingTransactionState.invoicingTransactionByID, id);
|
|
17
17
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Amount } from '../../../commonStateTypes/amount';
|
|
2
2
|
import { ID } from '../../../commonStateTypes/common';
|
|
3
3
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
4
|
-
import { InvoicingTransactionStatus, InvoicingTransactionType } from './
|
|
4
|
+
import { InvoicingTransactionStatus, InvoicingTransactionType } from './invoicingTransactionPayload';
|
|
5
5
|
export interface InvoicingLinkedInvoiceRef {
|
|
6
6
|
appliedAmount: Amount;
|
|
7
7
|
invoiceID: ID;
|
|
@@ -55,5 +55,5 @@ export interface InvoicingPaymentKPIs {
|
|
|
55
55
|
totalRefunds: Amount;
|
|
56
56
|
}
|
|
57
57
|
export interface InvoicingTransactionState {
|
|
58
|
-
|
|
58
|
+
invoicingTransactionByID: Record<ID, InvoicingTransaction>;
|
|
59
59
|
}
|
|
@@ -230,9 +230,9 @@ import { clearAllInvoicingDunningCases } from '../invoicing/dunningCase/dunningC
|
|
|
230
230
|
import { clearAllInvoices } from '../invoicing/invoice/invoiceReducer';
|
|
231
231
|
import { clearAllInvoicingCustomers } from '../invoicing/invoicingCustomer/invoicingCustomerReducer';
|
|
232
232
|
import { clearAllInvoicingSubscriptions } from '../invoicing/invoicingSubscription/invoicingSubscriptionReducer';
|
|
233
|
+
import { clearAllInvoicingTransactions } from '../invoicing/invoicingTransaction/invoicingTransactionReducer';
|
|
233
234
|
import { clearAllInvoicingPlans } from '../invoicing/plan/planReducer';
|
|
234
235
|
import { clearAllInvoicingProducts } from '../invoicing/product/productReducer';
|
|
235
|
-
import { clearAllInvoicingTransactions } from '../invoicing/transaction/transactionReducer';
|
|
236
236
|
import { clearAllAccruedJESchedules, clearAllJEScheduleTransactions } from '../jeSchedules/jeSchedulesReducer';
|
|
237
237
|
import { clearAllMerchants } from '../merchant/merchantReducer';
|
|
238
238
|
import { clearAllOnboardingCustomersInfo } from '../onboardingCustomer/onboardingCustomerReducer';
|
|
@@ -234,9 +234,9 @@ const dunningCaseReducer_1 = require("../invoicing/dunningCase/dunningCaseReduce
|
|
|
234
234
|
const invoiceReducer_1 = require("../invoicing/invoice/invoiceReducer");
|
|
235
235
|
const invoicingCustomerReducer_1 = require("../invoicing/invoicingCustomer/invoicingCustomerReducer");
|
|
236
236
|
const invoicingSubscriptionReducer_1 = require("../invoicing/invoicingSubscription/invoicingSubscriptionReducer");
|
|
237
|
+
const invoicingTransactionReducer_1 = require("../invoicing/invoicingTransaction/invoicingTransactionReducer");
|
|
237
238
|
const planReducer_1 = require("../invoicing/plan/planReducer");
|
|
238
239
|
const productReducer_1 = require("../invoicing/product/productReducer");
|
|
239
|
-
const transactionReducer_1 = require("../invoicing/transaction/transactionReducer");
|
|
240
240
|
const jeSchedulesReducer_1 = require("../jeSchedules/jeSchedulesReducer");
|
|
241
241
|
const merchantReducer_1 = require("../merchant/merchantReducer");
|
|
242
242
|
const onboardingCustomerReducer_1 = require("../onboardingCustomer/onboardingCustomerReducer");
|
|
@@ -256,7 +256,7 @@ const tagReducer_1 = require("../tag/tagReducer");
|
|
|
256
256
|
const taskReducer_1 = require("../task/taskReducer");
|
|
257
257
|
const taskGroupTemplateReducer_1 = require("../taskGroupTemplate/taskGroupTemplateReducer");
|
|
258
258
|
const taskSummaryReducer_1 = require("../taskSummary/taskSummaryReducer");
|
|
259
|
-
const
|
|
259
|
+
const transactionReducer_1 = require("../transaction/transactionReducer");
|
|
260
260
|
const userReducer_1 = require("../user/userReducer");
|
|
261
261
|
const userRoleReducer_1 = require("../userRole/userRoleReducer");
|
|
262
262
|
const vendorReducer_1 = require("../vendor/vendorReducer");
|
|
@@ -492,7 +492,7 @@ const clearAllEpic = (actions$) => actions$.pipe((0, operators_1.filter)(tenantR
|
|
|
492
492
|
(0, planReducer_1.clearAllInvoicingPlans)(),
|
|
493
493
|
(0, productReducer_1.clearAllInvoicingProducts)(),
|
|
494
494
|
(0, invoicingSubscriptionReducer_1.clearAllInvoicingSubscriptions)(),
|
|
495
|
-
(0,
|
|
495
|
+
(0, invoicingTransactionReducer_1.clearAllInvoicingTransactions)(),
|
|
496
496
|
(0, jeSchedulesReducer_1.clearAllJEScheduleTransactions)(),
|
|
497
497
|
(0, merchantReducer_1.clearAllMerchants)(),
|
|
498
498
|
(0, monthEndCloseChecksReducer_1.clearAllMonthEndCloseChecks)(),
|
|
@@ -516,7 +516,7 @@ const clearAllEpic = (actions$) => actions$.pipe((0, operators_1.filter)(tenantR
|
|
|
516
516
|
(0, taskReducer_1.clearAllTasks)(),
|
|
517
517
|
(0, taskSummaryReducer_1.clearAllTaskSummary)(),
|
|
518
518
|
(0, toastNotificationReducer_1.clearAllToastNotifications)(),
|
|
519
|
-
(0,
|
|
519
|
+
(0, transactionReducer_1.clearAllTransactions)(),
|
|
520
520
|
(0, userRoleReducer_1.clearAllUserRoles)(),
|
|
521
521
|
(0, userReducer_1.clearAllUsers)(),
|
|
522
522
|
(0, vendorExpenseReducer_1.clearAllVendorExpenseTrends)(),
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createSlice } from '@reduxjs/toolkit';
|
|
2
|
+
import assignWith from 'lodash/assignWith';
|
|
3
|
+
import { mapInvoicingTransactionPayloadToState, } from './invoicingTransactionPayload';
|
|
4
|
+
export const initialState = {
|
|
5
|
+
invoicingTransactionByID: {},
|
|
6
|
+
};
|
|
7
|
+
const invoicingTransaction = createSlice({
|
|
8
|
+
name: 'invoicingTransaction',
|
|
9
|
+
initialState,
|
|
10
|
+
reducers: {
|
|
11
|
+
updateInvoicingTransactions: {
|
|
12
|
+
reducer(draft, action) {
|
|
13
|
+
doUpdateInvoicingTransactions(draft.invoicingTransactionByID, action.payload, action.meta.updateType);
|
|
14
|
+
},
|
|
15
|
+
prepare(payload, updateType = 'replace') {
|
|
16
|
+
return { payload, meta: { updateType } };
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
removeInvoicingTransaction(draft, action) {
|
|
20
|
+
delete draft.invoicingTransactionByID[action.payload];
|
|
21
|
+
},
|
|
22
|
+
clearAllInvoicingTransactions(draft) {
|
|
23
|
+
Object.assign(draft, initialState);
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
export const { updateInvoicingTransactions, removeInvoicingTransaction, clearAllInvoicingTransactions, } = invoicingTransaction.actions;
|
|
28
|
+
export default invoicingTransaction.reducer;
|
|
29
|
+
/**
|
|
30
|
+
* Helper functions.
|
|
31
|
+
*/
|
|
32
|
+
function doUpdateInvoicingTransactions(draft, payload, updateType) {
|
|
33
|
+
payload.forEach((invoicingTransactionPayload) => {
|
|
34
|
+
const latestInvoicingTransaction = mapInvoicingTransactionPayloadToState(invoicingTransactionPayload);
|
|
35
|
+
if (latestInvoicingTransaction.id in draft && updateType === 'merge') {
|
|
36
|
+
assignWith(draft[latestInvoicingTransaction.id], latestInvoicingTransaction, (objValue, srcValue) => (srcValue == null ? objValue : srcValue));
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
draft[latestInvoicingTransaction.id] = latestInvoicingTransaction;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import recordGet from 'lodash/get';
|
|
2
|
+
export function getInvoicingTransactionsByIds(invoicingTransactionState, ids) {
|
|
3
|
+
const invoicingTransactions = ids
|
|
4
|
+
.map((id) => getInvoicingTransactionById(invoicingTransactionState, id))
|
|
5
|
+
.filter((value) => value != null);
|
|
6
|
+
return invoicingTransactions;
|
|
7
|
+
}
|
|
8
|
+
export function getInvoicingTransactionById(invoicingTransactionState, id) {
|
|
9
|
+
return recordGet(invoicingTransactionState.invoicingTransactionByID, id);
|
|
10
|
+
}
|
|
@@ -231,9 +231,9 @@ import { clearAllInvoicingDunningCases } from '../invoicing/dunningCase/dunningC
|
|
|
231
231
|
import { clearAllInvoices } from '../invoicing/invoice/invoiceReducer';
|
|
232
232
|
import { clearAllInvoicingCustomers } from '../invoicing/invoicingCustomer/invoicingCustomerReducer';
|
|
233
233
|
import { clearAllInvoicingSubscriptions } from '../invoicing/invoicingSubscription/invoicingSubscriptionReducer';
|
|
234
|
+
import { clearAllInvoicingTransactions } from '../invoicing/invoicingTransaction/invoicingTransactionReducer';
|
|
234
235
|
import { clearAllInvoicingPlans } from '../invoicing/plan/planReducer';
|
|
235
236
|
import { clearAllInvoicingProducts } from '../invoicing/product/productReducer';
|
|
236
|
-
import { clearAllInvoicingTransactions } from '../invoicing/transaction/transactionReducer';
|
|
237
237
|
import { clearAllAccruedJESchedules, clearAllJEScheduleTransactions, } from '../jeSchedules/jeSchedulesReducer';
|
|
238
238
|
import { clearAllMerchants } from '../merchant/merchantReducer';
|
|
239
239
|
import { clearAllOnboardingCustomersInfo } from '../onboardingCustomer/onboardingCustomerReducer';
|
package/lib/esm/index.js
CHANGED
|
@@ -750,6 +750,7 @@ export { INVOICING_LIST_PAGE_SIZE } from './view/invoicing/invoicingApiHelper';
|
|
|
750
750
|
// ── Invoicing: customers ──────────────────────────────────────────────────────
|
|
751
751
|
export { clearAllInvoicingCustomers, removeInvoicingCustomer, updateInvoicingCustomers, } from './entity/invoicing/invoicingCustomer/invoicingCustomerReducer';
|
|
752
752
|
export { clearInvoicingCustomerListView, fetchInvoicingCustomerCounts, fetchInvoicingCustomerList, fetchInvoicingCustomerListPage, updateInvoicingCustomerFilters, } from './view/invoicing/invoicingCustomerListView/invoicingCustomerListViewReducer';
|
|
753
|
+
export { ALL_INVOICING_CUSTOMER_SORT_KEYS, INVOICING_CUSTOMER_COLUMNS, } from './view/invoicing/invoicingCustomerListView/invoicingCustomerListViewState';
|
|
753
754
|
export { getInvoicingCustomerListView } from './view/invoicing/invoicingCustomerListView/invoicingCustomerListViewSelector';
|
|
754
755
|
export { clearInvoicingCustomerDetailView, fetchInvoicingCustomerDetail, fetchInvoicingCustomerDetailPage, } from './view/invoicing/invoicingCustomerDetailView/invoicingCustomerDetailViewReducer';
|
|
755
756
|
export { getInvoicingCustomerDetail } from './view/invoicing/invoicingCustomerDetailView/invoicingCustomerDetailViewSelector';
|
|
@@ -759,24 +760,28 @@ export { getInvoicingPaymentLinkSendState, getInvoicingPaymentMethodSaveState, g
|
|
|
759
760
|
// ── Invoicing: subscriptions ──────────────────────────────────────────────────
|
|
760
761
|
export { clearAllInvoicingSubscriptions, removeInvoicingSubscription, updateInvoicingSubscriptions, } from './entity/invoicing/invoicingSubscription/invoicingSubscriptionReducer';
|
|
761
762
|
export { clearInvoicingSubscriptionListView, fetchInvoicingSubscriptionCounts, fetchInvoicingSubscriptionList, fetchInvoicingSubscriptionListPage, updateInvoicingSubscriptionFilters, } from './view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewReducer';
|
|
763
|
+
export { ALL_INVOICING_SUBSCRIPTION_SORT_KEYS, INVOICING_SUBSCRIPTION_COLUMNS, } from './view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState';
|
|
762
764
|
export { getInvoicingSubscriptionListView } from './view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewSelector';
|
|
763
765
|
export { clearInvoicingSubscriptionDetailView, fetchInvoicingSubscriptionDetail, } from './view/invoicing/invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewReducer';
|
|
764
766
|
export { getInvoicingSubscriptionById, getInvoicingSubscriptionDetail, } from './view/invoicing/invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector';
|
|
765
767
|
// ── Invoicing: payments (transactions) ────────────────────────────────────────
|
|
766
|
-
export { clearAllInvoicingTransactions, removeInvoicingTransaction, updateInvoicingTransactions, } from './entity/invoicing/
|
|
768
|
+
export { clearAllInvoicingTransactions, removeInvoicingTransaction, updateInvoicingTransactions, } from './entity/invoicing/invoicingTransaction/invoicingTransactionReducer';
|
|
767
769
|
export { clearInvoicingTransactionListView, fetchInvoicingTransactionKPIs, fetchInvoicingTransactionList, fetchInvoicingTransactionListPage, updateInvoicingTransactionFilters, } from './view/invoicing/invoicingTransactionListView/invoicingTransactionListViewReducer';
|
|
770
|
+
export { ALL_INVOICING_TRANSACTION_SORT_KEYS, INVOICING_TRANSACTION_COLUMNS, } from './view/invoicing/invoicingTransactionListView/invoicingTransactionListViewState';
|
|
768
771
|
export { getInvoicingTransactionListView } from './view/invoicing/invoicingTransactionListView/invoicingTransactionListViewSelector';
|
|
769
772
|
export { clearInvoicingTransactionDetailView, fetchInvoicingTransactionDetail, } from './view/invoicing/invoicingTransactionDetailView/invoicingTransactionDetailViewReducer';
|
|
770
773
|
export { getInvoicingTransactionById, getInvoicingTransactionDetail, } from './view/invoicing/invoicingTransactionDetailView/invoicingTransactionDetailViewSelector';
|
|
771
774
|
// ── Invoicing: credit notes ───────────────────────────────────────────────────
|
|
772
775
|
export { clearAllInvoicingCreditNotes, removeInvoicingCreditNote, updateInvoicingCreditNotes, } from './entity/invoicing/creditNote/creditNoteReducer';
|
|
773
776
|
export { clearInvoicingCreditNoteListView, fetchInvoicingCreditNoteCounts, fetchInvoicingCreditNoteKPIs, fetchInvoicingCreditNoteList, fetchInvoicingCreditNoteListPage, updateInvoicingCreditNoteFilters, } from './view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewReducer';
|
|
777
|
+
export { ALL_INVOICING_CREDIT_NOTE_SORT_KEYS, INVOICING_CREDIT_NOTE_COLUMNS, } from './view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewState';
|
|
774
778
|
export { getInvoicingCreditNoteListView } from './view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewSelector';
|
|
775
779
|
export { clearInvoicingCreditNoteDetailView, fetchInvoicingCreditNoteDetail, } from './view/invoicing/invoicingCreditNoteDetailView/invoicingCreditNoteDetailViewReducer';
|
|
776
780
|
export { getInvoicingCreditNoteById, getInvoicingCreditNoteDetail, } from './view/invoicing/invoicingCreditNoteDetailView/invoicingCreditNoteDetailViewSelector';
|
|
777
781
|
// ── Invoicing: discounts (coupons) ────────────────────────────────────────────
|
|
778
782
|
export { clearAllInvoicingCoupons, removeInvoicingCoupon, updateInvoicingCoupons, } from './entity/invoicing/coupon/couponReducer';
|
|
779
783
|
export { clearInvoicingCouponView, fetchInvoicingCouponCounts, fetchInvoicingCouponKPIs, fetchInvoicingCouponList, fetchInvoicingCouponListPage, updateInvoicingCouponFilters, } from './view/invoicing/couponView/couponViewReducer';
|
|
784
|
+
export { ALL_INVOICING_COUPON_SORT_KEYS, INVOICING_COUPON_COLUMNS, } from './view/invoicing/couponView/couponViewState';
|
|
780
785
|
export { getInvoicingCouponCounts, getInvoicingCouponKPIs, getInvoicingCouponListFetchState, getInvoicingCouponListFilters, getInvoicingCouponListHasMore, getInvoicingCouponListItems, getInvoicingCouponListNextCursor, getInvoicingCouponListView, } from './view/invoicing/couponView/couponViewSelector';
|
|
781
786
|
export { getInvoicingCouponById } from './entity/invoicing/coupon/couponSelector';
|
|
782
787
|
export { clearInvoicingCouponDetailView, fetchInvoicingCouponDetail, } from './view/invoicing/invoicingCouponDetailView/invoicingCouponDetailViewReducer';
|
|
@@ -784,6 +789,7 @@ export { getInvoicingCouponDetail } from './view/invoicing/invoicingCouponDetail
|
|
|
784
789
|
// ── Invoicing: dunning ────────────────────────────────────────────────────────
|
|
785
790
|
export { clearAllInvoicingDunningCases, removeInvoicingDunningCase, updateInvoicingDunningCases, } from './entity/invoicing/dunningCase/dunningCaseReducer';
|
|
786
791
|
export { clearInvoicingDunningCaseListView, fetchInvoicingDunningCaseCounts, fetchInvoicingDunningCaseKPIs, fetchInvoicingDunningCaseList, fetchInvoicingDunningCaseListPage, updateInvoicingDunningCaseFilters, } from './view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewReducer';
|
|
792
|
+
export { ALL_INVOICING_DUNNING_CASE_SORT_KEYS, INVOICING_DUNNING_CASE_COLUMNS, } from './view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState';
|
|
787
793
|
export { getInvoicingDunningCaseListView } from './view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewSelector';
|
|
788
794
|
export { clearInvoicingDunningCaseDetailView, fetchInvoicingDunningCaseDetail, } from './view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewReducer';
|
|
789
795
|
export { getInvoicingDunningCaseById, getInvoicingDunningCaseDetail, } from './view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewSelector';
|
|
@@ -791,6 +797,7 @@ export { getInvoicingDunningCaseById, getInvoicingDunningCaseDetail, } from './v
|
|
|
791
797
|
export { clearAllInvoicingPlans, removeInvoicingPlan, updateInvoicingPlans, } from './entity/invoicing/plan/planReducer';
|
|
792
798
|
export { clearAllInvoicingProducts, removeInvoicingProduct, updateInvoicingProducts, } from './entity/invoicing/product/productReducer';
|
|
793
799
|
export { clearInvoicingCatalogListView, fetchInvoicingCatalogCounts, fetchInvoicingCatalogKPIs, fetchInvoicingCatalogListPage, fetchInvoicingCatalogPlanList, fetchInvoicingCatalogProductList, updateInvoicingCatalogPlanFilters, updateInvoicingCatalogProductFilters, } from './view/invoicing/invoicingCatalogListView/invoicingCatalogListViewReducer';
|
|
800
|
+
export { ALL_INVOICING_PRODUCT_SORT_KEYS, INVOICING_PRODUCT_COLUMNS, } from './view/invoicing/invoicingCatalogListView/invoicingCatalogListViewState';
|
|
794
801
|
export { getInvoicingCatalogListView } from './view/invoicing/invoicingCatalogListView/invoicingCatalogListViewSelector';
|
|
795
802
|
export { clearInvoicingCatalogItemDetailView, fetchInvoicingCatalogItemDetail, } from './view/invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewReducer';
|
|
796
803
|
export { getInvoicingCatalogItemDetail, getInvoicingPlanById, getInvoicingProductById, } from './view/invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector';
|
package/lib/esm/reducer.js
CHANGED
|
@@ -39,9 +39,9 @@ import invoicingDunningCase, { initialState as initialInvoicingDunningCaseState,
|
|
|
39
39
|
import invoicingInvoice, { initialState as initialInvoicingInvoiceState, } from './entity/invoicing/invoice/invoiceReducer';
|
|
40
40
|
import invoicingCustomer, { initialState as initialInvoicingCustomerState, } from './entity/invoicing/invoicingCustomer/invoicingCustomerReducer';
|
|
41
41
|
import invoicingSubscription, { initialState as initialInvoicingSubscriptionState, } from './entity/invoicing/invoicingSubscription/invoicingSubscriptionReducer';
|
|
42
|
+
import invoicingTransaction, { initialState as initialInvoicingTransactionState, } from './entity/invoicing/invoicingTransaction/invoicingTransactionReducer';
|
|
42
43
|
import invoicingPlan, { initialState as initialInvoicingPlanState, } from './entity/invoicing/plan/planReducer';
|
|
43
44
|
import invoicingProduct, { initialState as initialInvoicingProductState, } from './entity/invoicing/product/productReducer';
|
|
44
|
-
import invoicingTransaction, { initialState as initialInvoicingTransactionState, } from './entity/invoicing/transaction/transactionReducer';
|
|
45
45
|
import jeSchedules, { initialState as initialJESchedulesState, } from './entity/jeSchedules/jeSchedulesReducer';
|
|
46
46
|
import merchant, { initialState as initialMerchantState, } from './entity/merchant/merchantReducer';
|
|
47
47
|
import monthEndCloseChecks, { initialState as initialMonthEndCloseChecksState, } from './entity/monthEndCloseChecks/monthEndCloseChecksReducer';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createSelector } from '@reduxjs/toolkit';
|
|
2
|
+
import { INVOICING_COUPON_COLUMNS, } from './couponViewState';
|
|
2
3
|
export const getInvoicingCouponListItems = (state) => state.invoicingCouponViewState.ids
|
|
3
4
|
.map((id) => state.invoicingCouponState.couponByID[id])
|
|
4
5
|
.filter((item) => item != null);
|
|
@@ -18,6 +19,7 @@ export const getInvoicingCouponKPIs = (state) => state.invoicingCouponViewState.
|
|
|
18
19
|
* coupon entity slice or the list-view slice actually change.
|
|
19
20
|
*/
|
|
20
21
|
export const getInvoicingCouponListView = createSelector((state) => state.invoicingCouponState, (state) => state.invoicingCouponViewState, (couponState, listViewState) => ({
|
|
22
|
+
columns: INVOICING_COUPON_COLUMNS,
|
|
21
23
|
coupons: listViewState.ids
|
|
22
24
|
.map((id) => couponState.couponByID[id])
|
|
23
25
|
.filter((item) => item != null),
|
|
@@ -29,5 +31,6 @@ export const getInvoicingCouponListView = createSelector((state) => state.invoic
|
|
|
29
31
|
nextCursor: listViewState.nextCursor,
|
|
30
32
|
fetchState: listViewState.fetchState,
|
|
31
33
|
error: listViewState.error,
|
|
34
|
+
sort: listViewState.sort,
|
|
32
35
|
version: 1.0,
|
|
33
36
|
}));
|
|
@@ -1 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import { stringToUnion } from '../../../commonStateTypes/stringToUnion';
|
|
2
|
+
export const ALL_INVOICING_COUPON_SORT_KEYS = [
|
|
3
|
+
'coupon_id',
|
|
4
|
+
'name',
|
|
5
|
+
'discount',
|
|
6
|
+
'duration',
|
|
7
|
+
'created',
|
|
8
|
+
'valid_till',
|
|
9
|
+
'apply_on',
|
|
10
|
+
'status',
|
|
11
|
+
'redemptions',
|
|
12
|
+
];
|
|
13
|
+
export const toInvoicingCouponSortKey = (v) => stringToUnion(v, ALL_INVOICING_COUPON_SORT_KEYS);
|
|
14
|
+
export const INVOICING_COUPON_COLUMNS = [
|
|
15
|
+
{ key: 'coupon_id', sortable: true },
|
|
16
|
+
{ key: 'name', sortable: true },
|
|
17
|
+
{ key: 'discount', sortable: false },
|
|
18
|
+
{ key: 'duration', sortable: true },
|
|
19
|
+
{ key: 'created', sortable: true },
|
|
20
|
+
{ key: 'valid_till', sortable: true },
|
|
21
|
+
{ key: 'apply_on', sortable: true },
|
|
22
|
+
{ key: 'status', sortable: true },
|
|
23
|
+
{ key: 'redemptions', sortable: true },
|
|
24
|
+
];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createSelector } from '@reduxjs/toolkit';
|
|
2
2
|
import { getInvoicingPlansByIds } from '../../../entity/invoicing/plan/planSelector';
|
|
3
3
|
import { getInvoicingProductsByIds } from '../../../entity/invoicing/product/productSelector';
|
|
4
|
+
import { INVOICING_PRODUCT_COLUMNS, } from './invoicingCatalogListViewState';
|
|
4
5
|
/**
|
|
5
6
|
* Bundled read view for the single catalog page (plans + products tabs).
|
|
6
7
|
* Memoized over the plan + product entity slices and the list-view slice so the
|
|
@@ -9,7 +10,9 @@ import { getInvoicingProductsByIds } from '../../../entity/invoicing/product/pro
|
|
|
9
10
|
*/
|
|
10
11
|
export const getInvoicingCatalogListView = createSelector((state) => state.invoicingPlanState, (state) => state.invoicingProductState, (state) => state.invoicingCatalogListViewState, (planState, productState, listViewState) => ({
|
|
11
12
|
plans: getInvoicingPlansByIds(planState, listViewState.planIds),
|
|
13
|
+
productColumns: INVOICING_PRODUCT_COLUMNS,
|
|
12
14
|
products: getInvoicingProductsByIds(productState, listViewState.productIds),
|
|
15
|
+
productSort: listViewState.productSort,
|
|
13
16
|
count: listViewState.counts,
|
|
14
17
|
countsFetchState: listViewState.countsFetchState,
|
|
15
18
|
kpis: listViewState.kpis,
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import { stringToUnion } from '../../../commonStateTypes/stringToUnion';
|
|
2
|
+
export const ALL_INVOICING_PRODUCT_SORT_KEYS = [
|
|
3
|
+
'product_name',
|
|
4
|
+
'type',
|
|
5
|
+
'pricing',
|
|
6
|
+
'usage',
|
|
7
|
+
'updated',
|
|
8
|
+
'status',
|
|
9
|
+
];
|
|
10
|
+
export const toInvoicingProductSortKey = (v) => stringToUnion(v, ALL_INVOICING_PRODUCT_SORT_KEYS);
|
|
11
|
+
export const INVOICING_PRODUCT_COLUMNS = [
|
|
12
|
+
{ key: 'product_name', sortable: true },
|
|
13
|
+
{ key: 'type', sortable: true },
|
|
14
|
+
{ key: 'pricing', sortable: true },
|
|
15
|
+
{ key: 'usage', sortable: true },
|
|
16
|
+
{ key: 'updated', sortable: true },
|
|
17
|
+
{ key: 'status', sortable: true },
|
|
18
|
+
];
|
package/lib/esm/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewSelector.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { createSelector } from '@reduxjs/toolkit';
|
|
2
2
|
import { getInvoicingCreditNotesByIds } from '../../../entity/invoicing/creditNote/creditNoteSelector';
|
|
3
|
+
import { INVOICING_CREDIT_NOTE_COLUMNS, } from './invoicingCreditNoteListViewState';
|
|
3
4
|
/**
|
|
4
5
|
* Memoized so the denormalized `creditNotes` array (and the wrapping view
|
|
5
6
|
* object) keep referential identity until the credit-note entity slice or the
|
|
6
7
|
* list-view slice actually change.
|
|
7
8
|
*/
|
|
8
9
|
export const getInvoicingCreditNoteListView = createSelector((state) => state.invoicingCreditNoteState, (state) => state.invoicingCreditNoteListViewState, (creditNoteState, listViewState) => ({
|
|
10
|
+
columns: INVOICING_CREDIT_NOTE_COLUMNS,
|
|
9
11
|
creditNotes: getInvoicingCreditNotesByIds(creditNoteState, listViewState.ids),
|
|
10
12
|
count: listViewState.counts,
|
|
11
13
|
countsFetchState: listViewState.countsFetchState,
|
|
@@ -15,5 +17,6 @@ export const getInvoicingCreditNoteListView = createSelector((state) => state.in
|
|
|
15
17
|
nextCursor: listViewState.nextCursor,
|
|
16
18
|
fetchState: listViewState.fetchState,
|
|
17
19
|
error: listViewState.error,
|
|
20
|
+
sort: listViewState.sort,
|
|
18
21
|
version: 1.0,
|
|
19
22
|
}));
|
package/lib/esm/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewState.js
CHANGED
|
@@ -1 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
import { stringToUnion } from '../../../commonStateTypes/stringToUnion';
|
|
2
|
+
export const ALL_INVOICING_CREDIT_NOTE_SORT_KEYS = [
|
|
3
|
+
'credit_note',
|
|
4
|
+
'customer',
|
|
5
|
+
'date',
|
|
6
|
+
'type',
|
|
7
|
+
'status',
|
|
8
|
+
'reference_invoice',
|
|
9
|
+
'utilization',
|
|
10
|
+
'total',
|
|
11
|
+
];
|
|
12
|
+
export const toInvoicingCreditNoteSortKey = (v) => stringToUnion(v, ALL_INVOICING_CREDIT_NOTE_SORT_KEYS);
|
|
13
|
+
export const INVOICING_CREDIT_NOTE_COLUMNS = [
|
|
14
|
+
{ key: 'credit_note', sortable: true },
|
|
15
|
+
{ key: 'customer', sortable: true },
|
|
16
|
+
{ key: 'date', sortable: true },
|
|
17
|
+
{ key: 'type', sortable: true },
|
|
18
|
+
{ key: 'status', sortable: true },
|
|
19
|
+
{ key: 'reference_invoice', sortable: true },
|
|
20
|
+
{ key: 'utilization', sortable: true },
|
|
21
|
+
{ key: 'total', sortable: true },
|
|
22
|
+
];
|
package/lib/esm/view/invoicing/invoicingCustomerListView/invoicingCustomerListViewSelector.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createSelector } from '@reduxjs/toolkit';
|
|
2
2
|
import { getInvoicingCustomersByIds } from '../../../entity/invoicing/invoicingCustomer/invoicingCustomerSelector';
|
|
3
|
+
import { INVOICING_CUSTOMER_COLUMNS, } from './invoicingCustomerListViewState';
|
|
3
4
|
/**
|
|
4
5
|
* Memoized so the denormalized `customers` array (and the wrapping view object)
|
|
5
6
|
* keep referential identity until the customer entity slice or the list-view
|
|
@@ -7,10 +8,12 @@ import { getInvoicingCustomersByIds } from '../../../entity/invoicing/invoicingC
|
|
|
7
8
|
* every unrelated redux action because a fresh array was built each call.
|
|
8
9
|
*/
|
|
9
10
|
export const getInvoicingCustomerListView = createSelector((state) => state.invoicingCustomerState, (state) => state.invoicingCustomerListViewState, (customerState, listViewState) => ({
|
|
11
|
+
columns: INVOICING_CUSTOMER_COLUMNS,
|
|
10
12
|
customers: getInvoicingCustomersByIds(customerState, listViewState.ids),
|
|
11
13
|
fetchState: listViewState.fetchState,
|
|
12
14
|
error: listViewState.error,
|
|
13
15
|
nextCursor: listViewState.nextCursor,
|
|
14
16
|
filters: listViewState.filters,
|
|
15
17
|
count: listViewState.counts,
|
|
18
|
+
sort: listViewState.sort,
|
|
16
19
|
}));
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import { stringToUnion } from '../../../commonStateTypes/stringToUnion';
|
|
2
|
+
export const ALL_INVOICING_CUSTOMER_SORT_KEYS = [
|
|
3
|
+
'name',
|
|
4
|
+
'email',
|
|
5
|
+
'billingAddress',
|
|
6
|
+
'cardStatus',
|
|
7
|
+
'autoCollect',
|
|
8
|
+
'status',
|
|
9
|
+
];
|
|
10
|
+
export const toInvoicingCustomerSortKey = (v) => stringToUnion(v, ALL_INVOICING_CUSTOMER_SORT_KEYS);
|
|
11
|
+
export const INVOICING_CUSTOMER_COLUMNS = [
|
|
12
|
+
{ key: 'name', sortable: true },
|
|
13
|
+
{ key: 'email', sortable: true },
|
|
14
|
+
{ key: 'billingAddress', sortable: false },
|
|
15
|
+
{ key: 'cardStatus', sortable: true },
|
|
16
|
+
{ key: 'autoCollect', sortable: true },
|
|
17
|
+
{ key: 'status', sortable: true },
|
|
18
|
+
];
|
package/lib/esm/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewSelector.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { createSelector } from '@reduxjs/toolkit';
|
|
2
2
|
import { getInvoicingDunningCasesByIds } from '../../../entity/invoicing/dunningCase/dunningCaseSelector';
|
|
3
|
+
import { INVOICING_DUNNING_CASE_COLUMNS, } from './invoicingDunningCaseListViewState';
|
|
3
4
|
/**
|
|
4
5
|
* Memoized so the denormalized `dunningCases` array (and the wrapping view
|
|
5
6
|
* object) keep referential identity until the dunning-case entity slice or the
|
|
6
7
|
* list-view slice actually change.
|
|
7
8
|
*/
|
|
8
9
|
export const getInvoicingDunningCaseListView = createSelector((state) => state.invoicingDunningCaseState, (state) => state.invoicingDunningCaseListViewState, (dunningCaseState, listViewState) => ({
|
|
10
|
+
columns: INVOICING_DUNNING_CASE_COLUMNS,
|
|
9
11
|
dunningCases: getInvoicingDunningCasesByIds(dunningCaseState, listViewState.ids),
|
|
10
12
|
count: listViewState.counts,
|
|
11
13
|
countsFetchState: listViewState.countsFetchState,
|
|
@@ -15,5 +17,6 @@ export const getInvoicingDunningCaseListView = createSelector((state) => state.i
|
|
|
15
17
|
nextCursor: listViewState.nextCursor,
|
|
16
18
|
fetchState: listViewState.fetchState,
|
|
17
19
|
error: listViewState.error,
|
|
20
|
+
sort: listViewState.sort,
|
|
18
21
|
version: 1.0,
|
|
19
22
|
}));
|
package/lib/esm/view/invoicing/invoicingDunningCaseListView/invoicingDunningCaseListViewState.js
CHANGED
|
@@ -1 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
import { stringToUnion } from '../../../commonStateTypes/stringToUnion';
|
|
2
|
+
export const ALL_INVOICING_DUNNING_CASE_SORT_KEYS = [
|
|
3
|
+
'customer',
|
|
4
|
+
'invoice',
|
|
5
|
+
'attempts',
|
|
6
|
+
'nextRetry',
|
|
7
|
+
'daysPastDue',
|
|
8
|
+
'failureReason',
|
|
9
|
+
'status',
|
|
10
|
+
'amount',
|
|
11
|
+
];
|
|
12
|
+
export const toInvoicingDunningCaseSortKey = (v) => stringToUnion(v, ALL_INVOICING_DUNNING_CASE_SORT_KEYS);
|
|
13
|
+
export const INVOICING_DUNNING_CASE_COLUMNS = [
|
|
14
|
+
{ key: 'customer', sortable: true },
|
|
15
|
+
{ key: 'invoice', sortable: true },
|
|
16
|
+
{ key: 'attempts', sortable: true },
|
|
17
|
+
{ key: 'nextRetry', sortable: true },
|
|
18
|
+
{ key: 'daysPastDue', sortable: true },
|
|
19
|
+
{ key: 'failureReason', sortable: false },
|
|
20
|
+
{ key: 'status', sortable: true },
|
|
21
|
+
{ key: 'amount', sortable: true },
|
|
22
|
+
];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createSelector } from '@reduxjs/toolkit';
|
|
2
2
|
import { getInvoicingSubscriptionsByIds } from '../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionSelector';
|
|
3
|
+
import { INVOICING_SUBSCRIPTION_COLUMNS, } from './invoicingSubscriptionListViewState';
|
|
3
4
|
/**
|
|
4
5
|
* Memoized so the denormalized `subscriptions` array (and the wrapping view
|
|
5
6
|
* object) keep referential identity until the subscription entity slice or the
|
|
@@ -8,10 +9,12 @@ import { getInvoicingSubscriptionsByIds } from '../../../entity/invoicing/invoic
|
|
|
8
9
|
* each call.
|
|
9
10
|
*/
|
|
10
11
|
export const getInvoicingSubscriptionListView = createSelector((state) => state.invoicingSubscriptionState, (state) => state.invoicingSubscriptionListViewState, (subscriptionState, listViewState) => ({
|
|
12
|
+
columns: INVOICING_SUBSCRIPTION_COLUMNS,
|
|
11
13
|
subscriptions: getInvoicingSubscriptionsByIds(subscriptionState, listViewState.ids),
|
|
12
14
|
fetchState: listViewState.fetchState,
|
|
13
15
|
error: listViewState.error,
|
|
14
16
|
nextCursor: listViewState.nextCursor,
|
|
15
17
|
filters: listViewState.filters,
|
|
16
18
|
count: listViewState.counts,
|
|
19
|
+
sort: listViewState.sort,
|
|
17
20
|
}));
|
package/lib/esm/view/invoicing/invoicingSubscriptionListView/invoicingSubscriptionListViewState.js
CHANGED
|
@@ -1 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
import { stringToUnion } from '../../../commonStateTypes/stringToUnion';
|
|
2
|
+
export const ALL_INVOICING_SUBSCRIPTION_SORT_KEYS = [
|
|
3
|
+
'subscription',
|
|
4
|
+
'customer',
|
|
5
|
+
'plan',
|
|
6
|
+
'term_end',
|
|
7
|
+
'next_billing',
|
|
8
|
+
'auto_collect',
|
|
9
|
+
'status',
|
|
10
|
+
'mrr',
|
|
11
|
+
];
|
|
12
|
+
export const toInvoicingSubscriptionSortKey = (v) => stringToUnion(v, ALL_INVOICING_SUBSCRIPTION_SORT_KEYS);
|
|
13
|
+
export const INVOICING_SUBSCRIPTION_COLUMNS = [
|
|
14
|
+
{ key: 'subscription', sortable: true },
|
|
15
|
+
{ key: 'customer', sortable: false },
|
|
16
|
+
{ key: 'plan', sortable: true },
|
|
17
|
+
{ key: 'term_end', sortable: true },
|
|
18
|
+
{ key: 'next_billing', sortable: true },
|
|
19
|
+
{ key: 'auto_collect', sortable: true },
|
|
20
|
+
{ key: 'status', sortable: true },
|
|
21
|
+
{ key: 'mrr', sortable: true },
|
|
22
|
+
];
|
package/lib/esm/view/invoicing/invoicingTransactionDetailView/invoicingTransactionDetailViewEpics.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { of } from 'rxjs';
|
|
2
2
|
import { catchError, filter, switchMap } from 'rxjs/operators';
|
|
3
|
-
import { updateInvoicingTransactions } from '../../../entity/invoicing/
|
|
3
|
+
import { updateInvoicingTransactions } from '../../../entity/invoicing/invoicingTransaction/invoicingTransactionReducer';
|
|
4
4
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
5
5
|
import { fetchInvoicingTransactionDetail, updateInvoicingTransactionDetail, updateInvoicingTransactionDetailFailure, } from './invoicingTransactionDetailViewReducer';
|
|
6
6
|
export const fetchInvoicingTransactionDetailEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchInvoicingTransactionDetail.match), switchMap((action) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getInvoicingTransactionById as getInvoicingTransactionByIdFromState } from '../../../entity/invoicing/
|
|
1
|
+
import { getInvoicingTransactionById as getInvoicingTransactionByIdFromState } from '../../../entity/invoicing/invoicingTransaction/invoicingTransactionSelector';
|
|
2
2
|
import { getInvoicingPaymentActionState } from '../paymentAction/paymentActionSelector';
|
|
3
3
|
export const getInvoicingTransactionById = (state, id) => getInvoicingTransactionByIdFromState(state.invoicingTransactionState, id);
|
|
4
4
|
export const getInvoicingTransactionDetail = (state, invoicingTransactionID) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { of } from 'rxjs';
|
|
2
2
|
import { catchError, filter, switchMap } from 'rxjs/operators';
|
|
3
|
-
import { mapInvoicingPaymentKPIsPayloadToState } from '../../../../entity/invoicing/
|
|
3
|
+
import { mapInvoicingPaymentKPIsPayloadToState } from '../../../../entity/invoicing/invoicingTransaction/invoicingTransactionPayload';
|
|
4
4
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
5
5
|
import { fetchInvoicingTransactionKPIs, updateInvoicingTransactionKPIs, updateInvoicingTransactionKPIsFailure, } from '../invoicingTransactionListViewReducer';
|
|
6
6
|
export const fetchInvoicingTransactionKPIsEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchInvoicingTransactionKPIs.match), switchMap(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { of } from 'rxjs';
|
|
2
2
|
import { catchError, filter, switchMap } from 'rxjs/operators';
|
|
3
|
-
import { updateInvoicingTransactions } from '../../../../entity/invoicing/
|
|
3
|
+
import { updateInvoicingTransactions } from '../../../../entity/invoicing/invoicingTransaction/invoicingTransactionReducer';
|
|
4
4
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
5
5
|
import { INVOICING_LIST_PAGE_SIZE, applyListSortParams, withQuery, } from '../../invoicingApiHelper';
|
|
6
6
|
import { fetchInvoicingTransactionList, updateInvoicingTransactionList, updateInvoicingTransactionListFailure, } from '../invoicingTransactionListViewReducer';
|