@zeniai/client-epic-state 5.1.80 → 5.1.81-betaAK0
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/reportIDHelper.d.ts +1 -0
- package/lib/commonStateTypes/viewAndReport/reportIDHelper.js +13 -1
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +3 -0
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/invoicing/invoicingCommonPayload.d.ts +42 -0
- package/lib/entity/invoicing/invoicingCommonPayload.js +66 -1
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/sectionProjectView/sectionProjectView.d.ts +1 -1
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +2 -2
- package/lib/entity/tenant/clearAllEpic.d.ts +5 -1
- package/lib/entity/tenant/clearAllEpic.js +8 -0
- package/lib/epic.d.ts +9 -1
- package/lib/epic.js +14 -1
- package/lib/esm/commonStateTypes/viewAndReport/reportIDHelper.js +11 -0
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +3 -0
- package/lib/esm/entity/invoicing/invoicingCommonPayload.js +61 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +8 -0
- package/lib/esm/epic.js +14 -1
- package/lib/esm/index.js +19 -4
- package/lib/esm/reducer.js +12 -0
- package/lib/esm/view/dashboard/dashboardSelector.js +14 -10
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +4 -18
- package/lib/esm/view/invoicing/createCreditNote/createCreditNoteFormConfig.js +6 -1
- package/lib/esm/view/invoicing/createCreditNote/createCreditNotePayload.js +1 -8
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +4 -5
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +10 -11
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormConfig.js +8 -10
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewPayload.js +2 -2
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer.js +1 -1
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +1 -1
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewState.js +43 -1
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewPayload.js +2 -5
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig.js +1 -2
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +7 -1
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +3 -0
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.js +25 -0
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.js +15 -0
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboConnectionEpic.js +15 -0
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboSyncHealthEpic.js +15 -0
- package/lib/esm/view/invoicing/invoicingQboView/epics/invoicingQboViewActionType.js +1 -0
- package/lib/esm/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +26 -0
- package/lib/esm/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +18 -0
- package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewPayload.js +47 -0
- package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewReducer.js +128 -0
- package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +20 -0
- package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewState.js +1 -0
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNotePayload.js +4 -11
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +9 -12
- package/lib/esm/view/invoicing/recordPayment/recordPaymentFormConfig.js +0 -1
- package/lib/esm/view/invoicing/recordPayment/recordPaymentPayload.js +5 -14
- package/lib/esm/view/netBurnOrIncomeProjectView/netBurnOrIncomeForTimeframeProjectViewEpic.js +45 -0
- package/lib/esm/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewEpic.js +30 -0
- package/lib/esm/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewPayload.js +1 -0
- package/lib/esm/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewReducer.js +111 -0
- package/lib/esm/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewSelector.js +65 -0
- package/lib/esm/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewSelectorTypes.js +1 -0
- package/lib/esm/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewState.js +1 -0
- package/lib/esm/view/opExProjectView/opExForTimeframeProjectViewEpic.js +43 -0
- package/lib/esm/view/opExProjectView/opExProjectViewEpic.js +30 -0
- package/lib/esm/view/opExProjectView/opExProjectViewPayload.js +1 -0
- package/lib/esm/view/opExProjectView/opExProjectViewReducer.js +111 -0
- package/lib/esm/view/opExProjectView/opExProjectViewSelector.js +52 -0
- package/lib/esm/view/opExProjectView/opExProjectViewSelectorTypes.js +1 -0
- package/lib/esm/view/opExProjectView/opExProjectViewState.js +1 -0
- package/lib/esm/view/reportsResync/reportsClassViewRefetchingEpic.js +0 -4
- package/lib/esm/view/reportsResync/reportsProjectViewRefetchingEpic.js +30 -0
- package/lib/esm/view/reportsResync/reportsResyncEpic.js +11 -3
- package/lib/esm/view/reportsResync/reportsResyncReducer.js +9 -1
- package/lib/esm/view/revenueProjectView/revenueForTimeframeProjectViewEpic.js +35 -0
- package/lib/esm/view/revenueProjectView/revenueProjectViewEpic.js +30 -0
- package/lib/esm/view/revenueProjectView/revenueProjectViewPayload.js +1 -0
- package/lib/esm/view/revenueProjectView/revenueProjectViewReducer.js +111 -0
- package/lib/esm/view/revenueProjectView/revenueProjectViewSelector.js +58 -0
- package/lib/esm/view/revenueProjectView/revenueProjectViewSelectorTypes.js +1 -0
- package/lib/esm/view/revenueProjectView/revenueProjectViewState.js +1 -0
- package/lib/index.d.ts +28 -5
- package/lib/index.js +106 -51
- package/lib/reducer.d.ts +12 -0
- package/lib/reducer.js +12 -0
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/dashboard/dashboardSelector.d.ts +2 -3
- package/lib/view/dashboard/dashboardSelector.js +13 -9
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +3 -17
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/invoicing/createCreditNote/createCreditNoteFormConfig.js +6 -1
- package/lib/view/invoicing/createCreditNote/createCreditNotePayload.js +1 -8
- package/lib/view/invoicing/createCreditNote/createCreditNoteState.d.ts +3 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +4 -5
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +10 -11
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewState.d.ts +10 -5
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormConfig.js +8 -10
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewPayload.js +2 -2
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer.js +3 -3
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +2 -2
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewState.d.ts +9 -2
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewState.js +45 -0
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewPayload.js +2 -5
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewState.d.ts +3 -1
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig.js +1 -2
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewPayload.d.ts +4 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +6 -0
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.d.ts +4 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +3 -0
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewState.d.ts +4 -1
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.d.ts +6 -0
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.js +29 -0
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.d.ts +6 -0
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.js +19 -0
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboConnectionEpic.d.ts +6 -0
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboConnectionEpic.js +19 -0
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboSyncHealthEpic.d.ts +6 -0
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboSyncHealthEpic.js +19 -0
- package/lib/view/invoicing/invoicingQboView/epics/invoicingQboViewActionType.d.ts +2 -0
- package/lib/view/invoicing/invoicingQboView/epics/invoicingQboViewActionType.js +2 -0
- package/lib/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.d.ts +6 -0
- package/lib/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +30 -0
- package/lib/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.d.ts +6 -0
- package/lib/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +22 -0
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewPayload.d.ts +79 -0
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewPayload.js +52 -0
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewReducer.d.ts +25 -0
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewReducer.js +132 -0
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.d.ts +21 -0
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +24 -0
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewState.d.ts +14 -0
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewState.js +2 -0
- package/lib/view/invoicing/issueCreditNote/issueCreditNotePayload.js +4 -11
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.d.ts +15 -7
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +11 -15
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteState.d.ts +3 -2
- package/lib/view/invoicing/recordPayment/recordPaymentFormConfig.js +0 -1
- package/lib/view/invoicing/recordPayment/recordPaymentPayload.js +5 -14
- package/lib/view/invoicing/recordPayment/recordPaymentState.d.ts +4 -2
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeForTimeframeProjectViewEpic.d.ts +9 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeForTimeframeProjectViewEpic.js +49 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewEpic.d.ts +6 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewEpic.js +34 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewPayload.d.ts +11 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewPayload.js +2 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewReducer.d.ts +33 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewReducer.js +115 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewSelector.d.ts +13 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewSelector.js +69 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewSelectorTypes.d.ts +21 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewSelectorTypes.js +2 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewState.d.ts +20 -0
- package/lib/view/netBurnOrIncomeProjectView/netBurnOrIncomeProjectViewState.js +2 -0
- package/lib/view/opExProjectView/opExForTimeframeProjectViewEpic.d.ts +9 -0
- package/lib/view/opExProjectView/opExForTimeframeProjectViewEpic.js +47 -0
- package/lib/view/opExProjectView/opExProjectViewEpic.d.ts +6 -0
- package/lib/view/opExProjectView/opExProjectViewEpic.js +34 -0
- package/lib/view/opExProjectView/opExProjectViewPayload.d.ts +6 -0
- package/lib/view/opExProjectView/opExProjectViewPayload.js +2 -0
- package/lib/view/opExProjectView/opExProjectViewReducer.d.ts +33 -0
- package/lib/view/opExProjectView/opExProjectViewReducer.js +115 -0
- package/lib/view/opExProjectView/opExProjectViewSelector.d.ts +12 -0
- package/lib/view/opExProjectView/opExProjectViewSelector.js +56 -0
- package/lib/view/opExProjectView/opExProjectViewSelectorTypes.d.ts +19 -0
- package/lib/view/opExProjectView/opExProjectViewSelectorTypes.js +2 -0
- package/lib/view/opExProjectView/opExProjectViewState.d.ts +20 -0
- package/lib/view/opExProjectView/opExProjectViewState.js +2 -0
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsClassViewRefetchingEpic.d.ts +1 -2
- package/lib/view/reportsResync/reportsClassViewRefetchingEpic.js +0 -4
- package/lib/view/reportsResync/reportsProjectViewRefetchingEpic.d.ts +10 -0
- package/lib/view/reportsResync/reportsProjectViewRefetchingEpic.js +34 -0
- package/lib/view/reportsResync/reportsResyncEpic.d.ts +2 -2
- package/lib/view/reportsResync/reportsResyncEpic.js +10 -2
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +5 -3
- package/lib/view/reportsResync/reportsResyncReducer.js +10 -2
- package/lib/view/revenueProjectView/revenueForTimeframeProjectViewEpic.d.ts +9 -0
- package/lib/view/revenueProjectView/revenueForTimeframeProjectViewEpic.js +39 -0
- package/lib/view/revenueProjectView/revenueProjectViewEpic.d.ts +6 -0
- package/lib/view/revenueProjectView/revenueProjectViewEpic.js +34 -0
- package/lib/view/revenueProjectView/revenueProjectViewPayload.d.ts +9 -0
- package/lib/view/revenueProjectView/revenueProjectViewPayload.js +2 -0
- package/lib/view/revenueProjectView/revenueProjectViewReducer.d.ts +33 -0
- package/lib/view/revenueProjectView/revenueProjectViewReducer.js +115 -0
- package/lib/view/revenueProjectView/revenueProjectViewSelector.d.ts +12 -0
- package/lib/view/revenueProjectView/revenueProjectViewSelector.js +62 -0
- package/lib/view/revenueProjectView/revenueProjectViewSelectorTypes.d.ts +19 -0
- package/lib/view/revenueProjectView/revenueProjectViewSelectorTypes.js +2 -0
- package/lib/view/revenueProjectView/revenueProjectViewState.d.ts +20 -0
- package/lib/view/revenueProjectView/revenueProjectViewState.js +2 -0
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/package.json +1 -1
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/invoicingCouponFormConfig.js +0 -44
- package/lib/view/invoicing/editInvoicingCouponDetailView/invoicingCouponFormConfig.d.ts +0 -5
- package/lib/view/invoicing/editInvoicingCouponDetailView/invoicingCouponFormConfig.js +0 -48
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.clearRevenueProjectView = exports.resetProjectNodeCollapseState = exports.updateProjectViewAccountViewMode = exports.updateRevenueProjectViewUIState = exports.updateProjectsToFilterOut = exports.updateRevenueForTimeframeProjectViewFailure = exports.updateRevenueForTimeframeProjectView = exports.fetchRevenueForTimeframeProjectView = exports.fetchRevenueProjectView = exports.initialState = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
const viewAndReportPayloadv2_1 = require("../../commonPayloadTypes/v2/viewAndReportPayloadv2");
|
|
7
|
+
exports.initialState = {
|
|
8
|
+
fetchState: {
|
|
9
|
+
month: {
|
|
10
|
+
fetchState: 'Not-Started',
|
|
11
|
+
error: undefined,
|
|
12
|
+
},
|
|
13
|
+
quarter: {
|
|
14
|
+
fetchState: 'Not-Started',
|
|
15
|
+
error: undefined,
|
|
16
|
+
},
|
|
17
|
+
year: {
|
|
18
|
+
fetchState: 'Not-Started',
|
|
19
|
+
error: undefined,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
firstMonthOfFY: 1,
|
|
23
|
+
projectIds: [],
|
|
24
|
+
reportId: 'revenue_by_projects',
|
|
25
|
+
reportTitle: 'revenue_by_projects',
|
|
26
|
+
uiState: {
|
|
27
|
+
accountViewMode: 'account_group',
|
|
28
|
+
nodeCollapseState: {},
|
|
29
|
+
projectsToFilterOut: [],
|
|
30
|
+
scrollPosition: undefined,
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
const revenueProjectView = (0, toolkit_1.createSlice)({
|
|
34
|
+
name: 'revenueProjectView',
|
|
35
|
+
initialState: exports.initialState,
|
|
36
|
+
reducers: {
|
|
37
|
+
fetchRevenueProjectView: {
|
|
38
|
+
prepare(cacheOverride = false) {
|
|
39
|
+
return { payload: { cacheOverride } };
|
|
40
|
+
},
|
|
41
|
+
reducer(
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
43
|
+
_draft,
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
45
|
+
_action) {
|
|
46
|
+
// nothing to do here
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
fetchRevenueForTimeframeProjectView: {
|
|
50
|
+
prepare(timeframe, fetchFullReport = true, cacheOverride = false) {
|
|
51
|
+
return { payload: { timeframe, fetchFullReport, cacheOverride } };
|
|
52
|
+
},
|
|
53
|
+
reducer(draft, action) {
|
|
54
|
+
const timeframe = action.payload.timeframe;
|
|
55
|
+
draft.fetchState[timeframe].fetchState = 'In-Progress';
|
|
56
|
+
draft.fetchState[timeframe].error = undefined;
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
updateRevenueForTimeframeProjectView(draft, action) {
|
|
60
|
+
doUpdateRevenueProjectView(draft, action.payload.timeframe, action.payload.report);
|
|
61
|
+
},
|
|
62
|
+
updateRevenueForTimeframeProjectViewFailure: {
|
|
63
|
+
prepare(error, timeframe) {
|
|
64
|
+
return {
|
|
65
|
+
payload: {
|
|
66
|
+
error,
|
|
67
|
+
timeframe,
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
reducer(draft, action) {
|
|
72
|
+
draft.fetchState[action.payload.timeframe] = {
|
|
73
|
+
fetchState: 'Error',
|
|
74
|
+
error: action.payload.error,
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
updateProjectsToFilterOut(draft, action) {
|
|
79
|
+
draft.uiState.projectsToFilterOut = action.payload.projectsToFilterOut;
|
|
80
|
+
},
|
|
81
|
+
updateRevenueProjectViewUIState(draft, action) {
|
|
82
|
+
const { nodeCollapseState, scrollPosition } = action.payload;
|
|
83
|
+
if (nodeCollapseState != null) {
|
|
84
|
+
draft.uiState.nodeCollapseState = Object.assign({}, draft.uiState.nodeCollapseState, {
|
|
85
|
+
[nodeCollapseState.nodeId]: nodeCollapseState.isCollapsed,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
if (scrollPosition != null) {
|
|
89
|
+
draft.uiState.scrollPosition = scrollPosition;
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
updateProjectViewAccountViewMode(draft, action) {
|
|
93
|
+
draft.uiState.accountViewMode = action.payload.viewMode;
|
|
94
|
+
},
|
|
95
|
+
resetProjectNodeCollapseState(draft) {
|
|
96
|
+
draft.uiState.nodeCollapseState = {};
|
|
97
|
+
},
|
|
98
|
+
clearRevenueProjectView(draft) {
|
|
99
|
+
Object.assign(draft, exports.initialState);
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
_a = revenueProjectView.actions, exports.fetchRevenueProjectView = _a.fetchRevenueProjectView, exports.fetchRevenueForTimeframeProjectView = _a.fetchRevenueForTimeframeProjectView, exports.updateRevenueForTimeframeProjectView = _a.updateRevenueForTimeframeProjectView, exports.updateRevenueForTimeframeProjectViewFailure = _a.updateRevenueForTimeframeProjectViewFailure, exports.updateProjectsToFilterOut = _a.updateProjectsToFilterOut, exports.updateRevenueProjectViewUIState = _a.updateRevenueProjectViewUIState, exports.updateProjectViewAccountViewMode = _a.updateProjectViewAccountViewMode, exports.resetProjectNodeCollapseState = _a.resetProjectNodeCollapseState, exports.clearRevenueProjectView = _a.clearRevenueProjectView;
|
|
104
|
+
exports.default = revenueProjectView.reducer;
|
|
105
|
+
const doUpdateRevenueProjectView = (draft, timeframe, revenueReport) => {
|
|
106
|
+
const report = (0, viewAndReportPayloadv2_1.mapReportPayloadV2ToReportV2)(revenueReport.report);
|
|
107
|
+
draft.dataAvailable = report.dataAvailable;
|
|
108
|
+
draft.firstMonthOfFY = report.firstMonthOfFY;
|
|
109
|
+
draft.bookCloseDate = report.bookCloseDate;
|
|
110
|
+
draft.status = report.status;
|
|
111
|
+
draft.fetchState[timeframe].fetchState = 'Completed';
|
|
112
|
+
if (draft.projectIds.length <= 0) {
|
|
113
|
+
draft.projectIds = revenueReport.report.projects.map((project) => project.accounting_project_id);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { COABalancesFilterProjectView } from '../../commonStateTypes/coaBalance/coaBalancesFilterProjectView';
|
|
2
|
+
import { AccountState } from '../../entity/account/accountState';
|
|
3
|
+
import { ProjectState } from '../../entity/project/projectReducer';
|
|
4
|
+
import { SectionProjectViewState } from '../../entity/sectionProjectView/sectionProjectViewState';
|
|
5
|
+
import { RootState } from '../../reducer';
|
|
6
|
+
import { RevenueClassesViewCalculatedSectionID, RevenueClassesViewSectionID } from '../revenueClassesView/revenueClassesViewSelectorTypes';
|
|
7
|
+
import { RevenueProjectViewReport } from './revenueProjectViewSelectorTypes';
|
|
8
|
+
import { RevenueProjectViewState } from './revenueProjectViewState';
|
|
9
|
+
export declare const revenueProjectIdsInOrder: (RevenueClassesViewSectionID | RevenueClassesViewCalculatedSectionID)[];
|
|
10
|
+
export declare const getRevenueProjectView: (filter: COABalancesFilterProjectView, accountState: AccountState, projectState: ProjectState, sectionsState: SectionProjectViewState, revenueProjectViewState: RevenueProjectViewState) => RevenueProjectViewReport;
|
|
11
|
+
export declare const getRevenueProjectViewForSelectedRange: (state: RootState) => RevenueProjectViewReport;
|
|
12
|
+
export declare const getRevenueProjectViewForHighlightedRange: (state: RootState) => RevenueProjectViewReport;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRevenueProjectViewForHighlightedRange = exports.getRevenueProjectViewForSelectedRange = exports.getRevenueProjectView = exports.revenueProjectIdsInOrder = void 0;
|
|
4
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
5
|
+
const getDifferenceOfBalancesGroupedByPeriod_1 = require("../../commonStateTypes/coaBalance/classBalances/getDifferenceOfBalancesGroupedByPeriod");
|
|
6
|
+
const coaBalance_1 = require("../../commonStateTypes/coaBalance/coaBalance");
|
|
7
|
+
const coaBalancesFilterProjectView_1 = require("../../commonStateTypes/coaBalance/coaBalancesFilterProjectView");
|
|
8
|
+
const reduceFetchState_1 = require("../../commonStateTypes/reduceFetchState");
|
|
9
|
+
const projectSelector_1 = require("../../entity/project/projectSelector");
|
|
10
|
+
const sectionProjectViewSelector_1 = require("../../entity/sectionProjectView/sectionProjectViewSelector");
|
|
11
|
+
const revenueClassesViewSelectorTypes_1 = require("../revenueClassesView/revenueClassesViewSelectorTypes");
|
|
12
|
+
exports.revenueProjectIdsInOrder = ['income', 'cogs', 'grossMargin'];
|
|
13
|
+
const getRevenueProjectView = (filter, accountState, projectState, sectionsState, revenueProjectViewState) => {
|
|
14
|
+
const fetchState = (0, reduceFetchState_1.reduceFetchStateParallelTimeframes)([
|
|
15
|
+
revenueProjectViewState.fetchState.month,
|
|
16
|
+
revenueProjectViewState.fetchState.quarter,
|
|
17
|
+
revenueProjectViewState.fetchState.year,
|
|
18
|
+
]);
|
|
19
|
+
const reportId = 'revenue_by_projects';
|
|
20
|
+
const sections = {};
|
|
21
|
+
const calculatedSections = {};
|
|
22
|
+
if (fetchState.fetchState === 'Completed') {
|
|
23
|
+
revenueClassesViewSelectorTypes_1.ALL_REVENUE_CLASSES_VIEW_SECTION_IDS.forEach((sectionId) => {
|
|
24
|
+
sections[`${sectionId}`] = (0, sectionProjectViewSelector_1.getSectionProjectViewReport)(accountState, projectState, sectionsState, revenueProjectViewState.projectIds, {
|
|
25
|
+
reportId,
|
|
26
|
+
sectionId,
|
|
27
|
+
}, filter);
|
|
28
|
+
});
|
|
29
|
+
const grossProfitBalancesByPeriod = (0, getDifferenceOfBalancesGroupedByPeriod_1.getDifferenceOfBalancesGroupedByPeriod)(sections['income'].sectionBalancesTotalByPeriod, sections['cogs'].sectionBalancesTotalByPeriod);
|
|
30
|
+
calculatedSections['grossMargin'] = (0, coaBalance_1.getCOABalances)(grossProfitBalancesByPeriod, filter);
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
sections,
|
|
34
|
+
calculatedSections,
|
|
35
|
+
reportId: revenueProjectViewState.reportId,
|
|
36
|
+
reportTitle: revenueProjectViewState.reportTitle,
|
|
37
|
+
firstMonthOfFY: revenueProjectViewState.firstMonthOfFY,
|
|
38
|
+
dataAvailable: revenueProjectViewState.dataAvailable,
|
|
39
|
+
bookCloseDate: revenueProjectViewState.bookCloseDate,
|
|
40
|
+
version: revenueProjectViewState.version,
|
|
41
|
+
status: revenueProjectViewState.status,
|
|
42
|
+
fetchState: fetchState.fetchState,
|
|
43
|
+
error: fetchState.error,
|
|
44
|
+
filter,
|
|
45
|
+
uiState: revenueProjectViewState.uiState,
|
|
46
|
+
projects: (0, projectSelector_1.getProjectsByIds)(projectState, revenueProjectViewState.projectIds),
|
|
47
|
+
projectsToFilterOut: revenueProjectViewState.uiState.projectsToFilterOut,
|
|
48
|
+
idsInOrder: exports.revenueProjectIdsInOrder,
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
exports.getRevenueProjectView = getRevenueProjectView;
|
|
52
|
+
exports.getRevenueProjectViewForSelectedRange = (0, toolkit_1.createSelector)((state) => state.accountState, (state) => state.projectState, (state) => state.sectionProjectViewState, (state) => state.revenueState, (state) => state.revenueProjectViewState, (accountState, projectState, sectionsState, revenueState, revenueProjectViewState) => {
|
|
53
|
+
const { timeframe, selectedCOABalancesRange, selectedAdditionalBalances } = revenueState.uiState;
|
|
54
|
+
const noFilter = (0, coaBalancesFilterProjectView_1.newBalancesFilterProjectView)(revenueState.revenue.firstMonthOfFY, timeframe, selectedCOABalancesRange.numberOfPeriods, selectedCOABalancesRange.thisPeriod, 'ascending_date', selectedAdditionalBalances, revenueProjectViewState.uiState.projectsToFilterOut);
|
|
55
|
+
return (0, exports.getRevenueProjectView)(noFilter, accountState, projectState, sectionsState, revenueProjectViewState);
|
|
56
|
+
});
|
|
57
|
+
exports.getRevenueProjectViewForHighlightedRange = (0, toolkit_1.createSelector)((state) => state.accountState, (state) => state.projectState, (state) => state.sectionProjectViewState, (state) => state.revenueState, (state) => state.revenueProjectViewState, (accountState, projectState, sectionsState, revenueState, revenueProjectViewState) => {
|
|
58
|
+
const { timeframe, highlightedCOABalancesRange, selectedAdditionalBalances, maxNumOfPeriodsToHighlight, } = revenueState.uiState;
|
|
59
|
+
const filter = (0, coaBalancesFilterProjectView_1.newBalancesFilterProjectView)(revenueState.revenue.firstMonthOfFY, timeframe, highlightedCOABalancesRange?.numberOfPeriods ??
|
|
60
|
+
maxNumOfPeriodsToHighlight, highlightedCOABalancesRange?.thisPeriod, 'ascending_date', selectedAdditionalBalances, revenueProjectViewState.uiState.projectsToFilterOut);
|
|
61
|
+
return (0, exports.getRevenueProjectView)(filter, accountState, projectState, sectionsState, revenueProjectViewState);
|
|
62
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { COABalancesFilterProjectView } from '../../commonStateTypes/coaBalance/coaBalancesFilterProjectView';
|
|
2
|
+
import { ID } from '../../commonStateTypes/common';
|
|
3
|
+
import { DataAvailable } from '../../commonStateTypes/dataAvailable';
|
|
4
|
+
import { CalculatedSection } from '../../commonStateTypes/selectorTypes/selectorTypes';
|
|
5
|
+
import { SelectorReport } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
6
|
+
import { Project } from '../../entity/project/projectState';
|
|
7
|
+
import { SectionProjectViewReport } from '../../entity/sectionProjectView/sectionProjectViewSelectorTypes';
|
|
8
|
+
import { RevenueClassesViewCalculatedSectionID, RevenueClassesViewSectionID } from '../revenueClassesView/revenueClassesViewSelectorTypes';
|
|
9
|
+
import { RevenueProjectViewUIState } from './revenueProjectViewState';
|
|
10
|
+
export interface RevenueProjectViewReport extends SelectorReport {
|
|
11
|
+
calculatedSections: Record<RevenueClassesViewCalculatedSectionID, CalculatedSection>;
|
|
12
|
+
filter: COABalancesFilterProjectView;
|
|
13
|
+
idsInOrder: (RevenueClassesViewSectionID | RevenueClassesViewCalculatedSectionID)[];
|
|
14
|
+
projects: Project[];
|
|
15
|
+
projectsToFilterOut: ID[];
|
|
16
|
+
sections: Record<RevenueClassesViewSectionID, SectionProjectViewReport>;
|
|
17
|
+
uiState: RevenueProjectViewUIState;
|
|
18
|
+
dataAvailable?: DataAvailable;
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AccountViewMode, FetchStateAndError, ID } from '../../commonStateTypes/common';
|
|
2
|
+
import { Report } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
+
export interface RevenueProjectViewUIState {
|
|
4
|
+
accountViewMode: AccountViewMode;
|
|
5
|
+
nodeCollapseState: Record<ID, boolean>;
|
|
6
|
+
projectsToFilterOut: ID[];
|
|
7
|
+
scrollPosition: {
|
|
8
|
+
scrollTop: number;
|
|
9
|
+
scrollLeft?: number;
|
|
10
|
+
} | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface RevenueProjectViewState extends Report {
|
|
13
|
+
fetchState: {
|
|
14
|
+
month: FetchStateAndError;
|
|
15
|
+
quarter: FetchStateAndError;
|
|
16
|
+
year: FetchStateAndError;
|
|
17
|
+
};
|
|
18
|
+
projectIds: ID[];
|
|
19
|
+
uiState: RevenueProjectViewUIState;
|
|
20
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RootState } from '../../reducer';
|
|
2
2
|
export declare const getTasksCardReport: (state: RootState) => {
|
|
3
|
-
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts";
|
|
3
|
+
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts";
|
|
4
4
|
reportTitle: string;
|
|
5
5
|
version: string | number | undefined;
|
|
6
6
|
status: import("../..").Status | undefined;
|
|
@@ -4,7 +4,7 @@ import { RootState } from '../../reducer';
|
|
|
4
4
|
import { TopExReport, TopExTimePeriodWithMetaData } from './topExSelectorTypes';
|
|
5
5
|
import { TopExState } from './topExState';
|
|
6
6
|
export declare const getTopExpenses: (accountState: AccountState, topExState: TopExState, numberOfExpenses?: number) => {
|
|
7
|
-
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts";
|
|
7
|
+
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts";
|
|
8
8
|
reportTitle: string;
|
|
9
9
|
version: string | number | undefined;
|
|
10
10
|
status: import("../..").Status | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.81-betaAK0",
|
|
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,44 +0,0 @@
|
|
|
1
|
-
export const initialInvoicingCouponFormLocalData = {
|
|
2
|
-
applyOn: 'invoice_amount',
|
|
3
|
-
couponCode: '',
|
|
4
|
-
couponId: '',
|
|
5
|
-
discountAmount: '',
|
|
6
|
-
discountPercentage: '',
|
|
7
|
-
discountQuantity: '',
|
|
8
|
-
discountType: 'percentage',
|
|
9
|
-
durationType: 'one_time',
|
|
10
|
-
invoiceName: '',
|
|
11
|
-
invoiceNotes: '',
|
|
12
|
-
maxRedemptions: '',
|
|
13
|
-
name: '',
|
|
14
|
-
period: '',
|
|
15
|
-
periodUnit: 'month',
|
|
16
|
-
validFrom: '',
|
|
17
|
-
validTill: '',
|
|
18
|
-
};
|
|
19
|
-
/** Seed the form draft from an existing coupon entity (edit mode). */
|
|
20
|
-
export const entityToInvoicingCouponFormLocalData = (coupon) => {
|
|
21
|
-
if (coupon == null) {
|
|
22
|
-
return { ...initialInvoicingCouponFormLocalData };
|
|
23
|
-
}
|
|
24
|
-
return {
|
|
25
|
-
applyOn: coupon.applyOn ?? 'invoice_amount',
|
|
26
|
-
couponCode: coupon.couponCode ?? '',
|
|
27
|
-
couponId: coupon.id ?? '',
|
|
28
|
-
discountAmount: coupon.discountAmount != null ? String(coupon.discountAmount.amount) : '',
|
|
29
|
-
discountPercentage: coupon.discountPercentage != null
|
|
30
|
-
? String(coupon.discountPercentage)
|
|
31
|
-
: '',
|
|
32
|
-
discountQuantity: coupon.discountQuantity != null ? String(coupon.discountQuantity) : '',
|
|
33
|
-
discountType: coupon.discountType ?? 'percentage',
|
|
34
|
-
durationType: coupon.durationType ?? 'one_time',
|
|
35
|
-
invoiceName: coupon.invoiceName ?? '',
|
|
36
|
-
invoiceNotes: coupon.invoiceNotes ?? '',
|
|
37
|
-
maxRedemptions: coupon.maxRedemptions != null ? String(coupon.maxRedemptions) : '',
|
|
38
|
-
name: coupon.name ?? '',
|
|
39
|
-
period: coupon.period != null ? String(coupon.period) : '',
|
|
40
|
-
periodUnit: coupon.periodUnit ?? 'month',
|
|
41
|
-
validFrom: coupon.validFrom != null ? coupon.validFrom.format('YYYY-MM-DD') : '',
|
|
42
|
-
validTill: coupon.validTill != null ? coupon.validTill.format('YYYY-MM-DD') : '',
|
|
43
|
-
};
|
|
44
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { InvoicingCoupon } from '../../../entity/invoicing/coupon/couponState';
|
|
2
|
-
import { InvoicingCouponFormLocalData } from './editInvoicingCouponDetailViewState';
|
|
3
|
-
export declare const initialInvoicingCouponFormLocalData: InvoicingCouponFormLocalData;
|
|
4
|
-
/** Seed the form draft from an existing coupon entity (edit mode). */
|
|
5
|
-
export declare const entityToInvoicingCouponFormLocalData: (coupon?: InvoicingCoupon) => InvoicingCouponFormLocalData;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.entityToInvoicingCouponFormLocalData = exports.initialInvoicingCouponFormLocalData = void 0;
|
|
4
|
-
exports.initialInvoicingCouponFormLocalData = {
|
|
5
|
-
applyOn: 'invoice_amount',
|
|
6
|
-
couponCode: '',
|
|
7
|
-
couponId: '',
|
|
8
|
-
discountAmount: '',
|
|
9
|
-
discountPercentage: '',
|
|
10
|
-
discountQuantity: '',
|
|
11
|
-
discountType: 'percentage',
|
|
12
|
-
durationType: 'one_time',
|
|
13
|
-
invoiceName: '',
|
|
14
|
-
invoiceNotes: '',
|
|
15
|
-
maxRedemptions: '',
|
|
16
|
-
name: '',
|
|
17
|
-
period: '',
|
|
18
|
-
periodUnit: 'month',
|
|
19
|
-
validFrom: '',
|
|
20
|
-
validTill: '',
|
|
21
|
-
};
|
|
22
|
-
/** Seed the form draft from an existing coupon entity (edit mode). */
|
|
23
|
-
const entityToInvoicingCouponFormLocalData = (coupon) => {
|
|
24
|
-
if (coupon == null) {
|
|
25
|
-
return { ...exports.initialInvoicingCouponFormLocalData };
|
|
26
|
-
}
|
|
27
|
-
return {
|
|
28
|
-
applyOn: coupon.applyOn ?? 'invoice_amount',
|
|
29
|
-
couponCode: coupon.couponCode ?? '',
|
|
30
|
-
couponId: coupon.id ?? '',
|
|
31
|
-
discountAmount: coupon.discountAmount != null ? String(coupon.discountAmount.amount) : '',
|
|
32
|
-
discountPercentage: coupon.discountPercentage != null
|
|
33
|
-
? String(coupon.discountPercentage)
|
|
34
|
-
: '',
|
|
35
|
-
discountQuantity: coupon.discountQuantity != null ? String(coupon.discountQuantity) : '',
|
|
36
|
-
discountType: coupon.discountType ?? 'percentage',
|
|
37
|
-
durationType: coupon.durationType ?? 'one_time',
|
|
38
|
-
invoiceName: coupon.invoiceName ?? '',
|
|
39
|
-
invoiceNotes: coupon.invoiceNotes ?? '',
|
|
40
|
-
maxRedemptions: coupon.maxRedemptions != null ? String(coupon.maxRedemptions) : '',
|
|
41
|
-
name: coupon.name ?? '',
|
|
42
|
-
period: coupon.period != null ? String(coupon.period) : '',
|
|
43
|
-
periodUnit: coupon.periodUnit ?? 'month',
|
|
44
|
-
validFrom: coupon.validFrom != null ? coupon.validFrom.format('YYYY-MM-DD') : '',
|
|
45
|
-
validTill: coupon.validTill != null ? coupon.validTill.format('YYYY-MM-DD') : '',
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
exports.entityToInvoicingCouponFormLocalData = entityToInvoicingCouponFormLocalData;
|