@zeniai/client-epic-state 5.2.14-betaRD1 → 5.2.14
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/approvalRule/approvalRuleConflict.d.ts +0 -13
- package/lib/entity/approvalRule/approvalRuleConflict.js +1 -16
- package/lib/entity/jeSchedules/jeScheduleHelper.d.ts +0 -1
- package/lib/entity/jeSchedules/jeScheduleHelper.js +0 -7
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +1 -78
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +4 -183
- package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +2 -4
- package/lib/entity/jeSchedules/jeSchedulesReducer.js +2 -30
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +2 -11
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +3 -38
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +1 -123
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -24
- package/lib/entity/jeSchedules/jeSchedulesTypes.js +1 -96
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -3
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +0 -2
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -2
- package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +0 -2
- package/lib/epic.d.ts +1 -9
- package/lib/epic.js +0 -16
- package/lib/esm/entity/approvalRule/approvalRuleConflict.js +1 -16
- package/lib/esm/entity/jeSchedules/jeScheduleHelper.js +0 -6
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +5 -183
- package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +2 -30
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +2 -36
- package/lib/esm/entity/jeSchedules/jeSchedulesTypes.js +0 -86
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -3
- package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -2
- package/lib/esm/epic.js +0 -16
- package/lib/esm/index.js +8 -14
- package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +3 -6
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +1 -9
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +5 -41
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +2 -14
- package/lib/esm/view/expenseAutomationView/payload/jeSchedulesPayload.js +0 -55
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +29 -319
- package/lib/esm/view/expenseAutomationView/selectors/jeAccountSettingsViewSelector.js +0 -1
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +22 -327
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +6 -5
- package/lib/esm/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
- package/lib/esm/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +2 -7
- package/lib/esm/view/scheduleView/scheduleListView/scheduleListReducer.js +3 -5
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +1 -20
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewSelector.js +1 -20
- package/lib/index.d.ts +12 -17
- package/lib/index.js +47 -91
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +3 -6
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +1 -9
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +2 -3
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +3 -39
- package/lib/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +2 -14
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +3 -86
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +1 -58
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +12 -93
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +29 -321
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/selectorTypes/jeAccountSettingsViewSelectorTypes.d.ts +0 -1
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +7 -41
- package/lib/view/expenseAutomationView/selectors/jeAccountSettingsViewSelector.js +0 -1
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +0 -34
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +21 -335
- package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +8 -83
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -8
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +1 -1
- package/lib/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
- package/lib/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +2 -7
- package/lib/view/scheduleView/scheduleListView/scheduleListReducer.d.ts +2 -4
- package/lib/view/scheduleView/scheduleListView/scheduleListReducer.js +3 -5
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +1 -20
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelectorTypes.d.ts +0 -3
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewSelector.js +1 -20
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewSelectorTypes.d.ts +0 -3
- package/package.json +1 -1
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +0 -45
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +0 -104
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +0 -25
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +0 -138
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +0 -79
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +0 -180
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +0 -111
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +0 -28
- package/lib/esm/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +0 -140
- package/lib/esm/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +0 -1
- package/lib/esm/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +0 -106
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.d.ts +0 -21
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +0 -49
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.d.ts +0 -9
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +0 -108
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +0 -29
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.d.ts +0 -9
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +0 -142
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +0 -83
- package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.d.ts +0 -13
- package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +0 -187
- package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.d.ts +0 -65
- package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +0 -115
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +0 -6
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +0 -32
- package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.d.ts +0 -36
- package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +0 -145
- package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.d.ts +0 -42
- package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +0 -2
- package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.d.ts +0 -21
- package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +0 -112
|
@@ -46,19 +46,6 @@ import { ApprovalRule, Criteria } from './approvalRuleState';
|
|
|
46
46
|
export type RuleForOverlapCheck = Pick<ApprovalRule, 'approvalRuleId' | 'criteria' | 'isFallback'>;
|
|
47
47
|
export interface RuleOverlap<TRule extends RuleForOverlapCheck = ApprovalRule> {
|
|
48
48
|
conflictingRule: TRule;
|
|
49
|
-
/**
|
|
50
|
-
* 'duplicate' — every criterion matches exactly, including the
|
|
51
|
-
* amount interval (same comparator + min + max, not just an
|
|
52
|
-
* intersecting range). 'partial' — vendor/department match exactly
|
|
53
|
-
* (required for any overlap at all) but the amount intervals only
|
|
54
|
-
* intersect.
|
|
55
|
-
*
|
|
56
|
-
* Callers typically treat 'duplicate' as a blocking error (the
|
|
57
|
-
* candidate rule is unreachable — the existing rule already
|
|
58
|
-
* matches every bill/reimbursement it would) and 'partial' as a
|
|
59
|
-
* dismissible warning.
|
|
60
|
-
*/
|
|
61
|
-
overlapKind: 'duplicate' | 'partial';
|
|
62
49
|
}
|
|
63
50
|
export interface DetectRuleOverlapInput<TRule extends RuleForOverlapCheck = ApprovalRule> {
|
|
64
51
|
candidateCriteria: Criteria[];
|
|
@@ -23,12 +23,7 @@ function detectRuleOverlap({ candidateCriteria, existingRules, excludeRuleId, })
|
|
|
23
23
|
}
|
|
24
24
|
const ruleAmount = pickAmount(rule.criteria);
|
|
25
25
|
if (amountsOverlap(candidateAmount, ruleAmount)) {
|
|
26
|
-
overlaps.push({
|
|
27
|
-
conflictingRule: rule,
|
|
28
|
-
overlapKind: areAmountCriteriaEqual(candidateAmount, ruleAmount)
|
|
29
|
-
? 'duplicate'
|
|
30
|
-
: 'partial',
|
|
31
|
-
});
|
|
26
|
+
overlaps.push({ conflictingRule: rule });
|
|
32
27
|
}
|
|
33
28
|
}
|
|
34
29
|
return overlaps;
|
|
@@ -80,13 +75,3 @@ const amountsOverlap = (a, b) => {
|
|
|
80
75
|
const bHigh = b.max?.amount ?? Number.POSITIVE_INFINITY;
|
|
81
76
|
return Math.max(aLow, bLow) <= Math.min(aHigh, bHigh);
|
|
82
77
|
};
|
|
83
|
-
// Only called once `amountsOverlap` is already true, so this decides
|
|
84
|
-
// duplicate vs partial rather than overlap vs no-overlap.
|
|
85
|
-
const areAmountCriteriaEqual = (a, b) => {
|
|
86
|
-
if (a == null || b == null) {
|
|
87
|
-
return a == null && b == null;
|
|
88
|
-
}
|
|
89
|
-
return (a.comparator === b.comparator &&
|
|
90
|
-
(a.min?.amount ?? null) === (b.min?.amount ?? null) &&
|
|
91
|
-
(a.max?.amount ?? null) === (b.max?.amount ?? null));
|
|
92
|
-
};
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateJEScheduleKey = generateJEScheduleKey;
|
|
4
|
-
exports.generateJEOneTimeAccrualKey = generateJEOneTimeAccrualKey;
|
|
5
4
|
function generateJEScheduleKey(jeScheduleId, jeScheduleType) {
|
|
6
5
|
return `${jeScheduleId}_${jeScheduleType}`;
|
|
7
6
|
}
|
|
8
|
-
// Suffixed rather than using the bare Mongo _id so the key is a distinct type from
|
|
9
|
-
// JEScheduleKey / JEScheduleTransactionKey and the three cannot be passed interchangeably.
|
|
10
|
-
// The unsuffixed id stays on the entity as `accrualId` for callers that need it.
|
|
11
|
-
function generateJEOneTimeAccrualKey(accrualId) {
|
|
12
|
-
return `${accrualId}_one_time_accrual`;
|
|
13
|
-
}
|
|
@@ -7,7 +7,7 @@ import { TransactionIDPayload } from '../transaction/payloadTypes/transactionIDP
|
|
|
7
7
|
import { TransactionCategory } from '../transaction/stateTypes/transactionType';
|
|
8
8
|
import { UserPayload } from '../user/userPayload';
|
|
9
9
|
import { VendorPayload } from '../vendor/vendorPayload';
|
|
10
|
-
import { JEAccruedScheduledTransactionState,
|
|
10
|
+
import { JEAccruedScheduledTransactionState, JEScheduledTransactionState, ScheduledJournalEntryState } from './jeSchedulesState';
|
|
11
11
|
import { JEScheduleKey, JEScheduleTransactionKey } from './jeSchedulesTypes';
|
|
12
12
|
export interface JEScheduleOtherAttributesPayload {
|
|
13
13
|
asset_id?: string | null;
|
|
@@ -19,25 +19,14 @@ export interface JEScheduleAISummaryFieldPayload {
|
|
|
19
19
|
cot?: string[];
|
|
20
20
|
predicted_value?: number | string;
|
|
21
21
|
}
|
|
22
|
-
/** The whole-recommendation summary. Carries narrative only -- no predicted value, no confidence. */
|
|
23
|
-
export interface JEScheduleSummaryPayload {
|
|
24
|
-
confidence?: number;
|
|
25
|
-
cot?: string[];
|
|
26
|
-
reasoning?: string;
|
|
27
|
-
reasoning_long?: string;
|
|
28
|
-
}
|
|
29
22
|
export interface JEScheduleAISummariesPayload {
|
|
30
23
|
credit_account?: JEScheduleAISummaryFieldPayload;
|
|
31
24
|
credit_accounting_class?: JEScheduleAISummaryFieldPayload;
|
|
32
25
|
debit_account?: JEScheduleAISummaryFieldPayload;
|
|
33
26
|
debit_accounting_class?: JEScheduleAISummaryFieldPayload;
|
|
34
|
-
end_date?: JEScheduleAISummaryFieldPayload;
|
|
35
27
|
period?: JEScheduleAISummaryFieldPayload;
|
|
36
28
|
posting_date?: JEScheduleAISummaryFieldPayload;
|
|
37
|
-
posting_start_date?: JEScheduleAISummaryFieldPayload;
|
|
38
|
-
schedule_summary?: JEScheduleSummaryPayload;
|
|
39
29
|
schedule_type?: JEScheduleAISummaryFieldPayload;
|
|
40
|
-
starting_month?: JEScheduleAISummaryFieldPayload;
|
|
41
30
|
}
|
|
42
31
|
export interface JEScheduleRecommendationsPayload {
|
|
43
32
|
credit_account_confidence?: number;
|
|
@@ -83,13 +72,9 @@ export interface JEScheduledTransactionPayload {
|
|
|
83
72
|
updated_by: UserPayload;
|
|
84
73
|
vendor: VendorPayload;
|
|
85
74
|
ai_summaries?: JEScheduleAISummariesPayload;
|
|
86
|
-
confidence_score?: number | null;
|
|
87
|
-
create_time?: string | null;
|
|
88
75
|
created_by?: UserPayload;
|
|
89
76
|
end_date?: string | null;
|
|
90
|
-
posted_count?: number | null;
|
|
91
77
|
recommendations?: JEScheduleRecommendationsPayload;
|
|
92
|
-
recurring_amount?: number | null;
|
|
93
78
|
updated_at?: string | null;
|
|
94
79
|
}
|
|
95
80
|
export interface JEAccruedScheduledTransactionPayload extends Omit<JEScheduledTransactionPayload, 'base_transaction' | 'je_schedule_id' | 'je_schedule_type'> {
|
|
@@ -99,67 +84,6 @@ export interface JEAccruedScheduledTransactionPayload extends Omit<JEScheduledTr
|
|
|
99
84
|
memo: string;
|
|
100
85
|
recurring_amount: number;
|
|
101
86
|
}
|
|
102
|
-
/**
|
|
103
|
-
* The frozen vendor profile the Cron used to decide an accrual, so the detail page can show its
|
|
104
|
-
* reasoning even after the live profile is rebuilt. Present on agent/Cron rows ONLY — a human-created
|
|
105
|
-
* accrual carries none, which is why every consumer has to treat it as absent rather than empty.
|
|
106
|
-
*/
|
|
107
|
-
export interface JEOneTimeAccrualProfileSnapshotPayload {
|
|
108
|
-
billing_pattern?: {
|
|
109
|
-
avg_amount?: number | null;
|
|
110
|
-
billing_lag_days?: number | null;
|
|
111
|
-
consistency_score?: number | null;
|
|
112
|
-
frequency?: string | null;
|
|
113
|
-
last_bill_amount?: number | null;
|
|
114
|
-
last_bill_date?: string | null;
|
|
115
|
-
months_of_history?: number | null;
|
|
116
|
-
typical_bill_day?: number | null;
|
|
117
|
-
} | null;
|
|
118
|
-
monthly_totals?: Record<string, number> | null;
|
|
119
|
-
sorted_months?: string[] | null;
|
|
120
|
-
}
|
|
121
|
-
/** The JE the AI originally suggested, frozen at draft time for suggested-vs-posted comparison. */
|
|
122
|
-
export interface JEOneTimeAccrualAiSuggestionPayload {
|
|
123
|
-
estimated_amount?: number | null;
|
|
124
|
-
je_credit_account_id?: ID | null;
|
|
125
|
-
je_credit_account_name?: string | null;
|
|
126
|
-
je_debit_account_id?: ID | null;
|
|
127
|
-
je_debit_account_name?: string | null;
|
|
128
|
-
memo?: string | null;
|
|
129
|
-
}
|
|
130
|
-
export interface JEOneTimeAccrualPayload {
|
|
131
|
-
_id: ID;
|
|
132
|
-
estimated_amount: number;
|
|
133
|
-
origin: string;
|
|
134
|
-
service_month: string;
|
|
135
|
-
status: string;
|
|
136
|
-
vendor_id: ID;
|
|
137
|
-
vendor_name: string;
|
|
138
|
-
actual_post_date?: string | null;
|
|
139
|
-
actual_reversal_post_date?: string | null;
|
|
140
|
-
ai_suggestion?: JEOneTimeAccrualAiSuggestionPayload | null;
|
|
141
|
-
automation_tier?: string | null;
|
|
142
|
-
created_by_user?: UserPayload | null;
|
|
143
|
-
currency?: string | null;
|
|
144
|
-
expected_reversal_date?: string | null;
|
|
145
|
-
is_ignored?: boolean;
|
|
146
|
-
je_credit_account_id?: ID | null;
|
|
147
|
-
je_credit_account_name?: string | null;
|
|
148
|
-
je_credit_accounting_class_id?: ID | null;
|
|
149
|
-
je_credit_accounting_class_name?: string | null;
|
|
150
|
-
je_debit_account_id?: ID | null;
|
|
151
|
-
je_debit_account_name?: string | null;
|
|
152
|
-
je_debit_accounting_class_id?: ID | null;
|
|
153
|
-
je_debit_accounting_class_name?: string | null;
|
|
154
|
-
memo?: string | null;
|
|
155
|
-
posting_date?: string | null;
|
|
156
|
-
profile_snapshot?: JEOneTimeAccrualProfileSnapshotPayload | null;
|
|
157
|
-
reversal_policy?: string | null;
|
|
158
|
-
reversal_transaction_id?: ID | null;
|
|
159
|
-
reversal_trigger?: string | null;
|
|
160
|
-
transaction_id?: ID | null;
|
|
161
|
-
transaction_integration_id?: ID | null;
|
|
162
|
-
}
|
|
163
87
|
export interface ScheduledJournalEntryPayload {
|
|
164
88
|
actual_post_date: string | null;
|
|
165
89
|
create_time: string | null;
|
|
@@ -190,4 +114,3 @@ export declare function getJEScheduleTransactionDetailKeyPayload(payload: Schedu
|
|
|
190
114
|
export declare function getJEScheduleKey(payload: JEAccruedScheduledTransactionPayload): JEScheduleKey;
|
|
191
115
|
export declare function toJEScheduledTransaction(payload: JEScheduledTransactionPayload): JEScheduledTransactionState;
|
|
192
116
|
export declare function toJEAccruedScheduledTransaction(payload: JEAccruedScheduledTransactionPayload): JEAccruedScheduledTransactionState;
|
|
193
|
-
export declare function toJEOneTimeAccrual(payload: JEOneTimeAccrualPayload): JEOneTimeAccrualState;
|
|
@@ -8,15 +8,12 @@ exports.getJEScheduleTransactionDetailKeyPayload = getJEScheduleTransactionDetai
|
|
|
8
8
|
exports.getJEScheduleKey = getJEScheduleKey;
|
|
9
9
|
exports.toJEScheduledTransaction = toJEScheduledTransaction;
|
|
10
10
|
exports.toJEAccruedScheduledTransaction = toJEAccruedScheduledTransaction;
|
|
11
|
-
exports.toJEOneTimeAccrual = toJEOneTimeAccrual;
|
|
12
11
|
const amount_1 = require("../../commonStateTypes/amount");
|
|
13
12
|
const timePeriod_1 = require("../../commonStateTypes/timePeriod");
|
|
14
13
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
15
|
-
const zeniUrl_1 = require("../../zeniUrl");
|
|
16
14
|
const transactionIDPayload_1 = require("../transaction/payloadTypes/transactionIDPayload");
|
|
17
15
|
const jeScheduleHelper_1 = require("./jeScheduleHelper");
|
|
18
16
|
const jeSchedulesTypes_1 = require("./jeSchedulesTypes");
|
|
19
|
-
const USD_CURRENCY_CODE = 'USD';
|
|
20
17
|
function toScheduledJournalEntryState(payload, currency_code, currency_symbol) {
|
|
21
18
|
return {
|
|
22
19
|
status: {
|
|
@@ -215,43 +212,6 @@ function toJEScheduleAISummaries(payload) {
|
|
|
215
212
|
: undefined,
|
|
216
213
|
};
|
|
217
214
|
}
|
|
218
|
-
if (payload.starting_month != null) {
|
|
219
|
-
result.startingMonth = {
|
|
220
|
-
confidence: payload.starting_month.confidence,
|
|
221
|
-
reasoning: payload.starting_month.reasoning,
|
|
222
|
-
cot: Array.isArray(payload.starting_month.cot)
|
|
223
|
-
? payload.starting_month.cot
|
|
224
|
-
: undefined,
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
if (payload.end_date != null) {
|
|
228
|
-
result.endDate = {
|
|
229
|
-
confidence: payload.end_date.confidence,
|
|
230
|
-
reasoning: payload.end_date.reasoning,
|
|
231
|
-
cot: Array.isArray(payload.end_date.cot)
|
|
232
|
-
? payload.end_date.cot
|
|
233
|
-
: undefined,
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
if (payload.posting_start_date != null) {
|
|
237
|
-
result.postingStartDate = {
|
|
238
|
-
confidence: payload.posting_start_date.confidence,
|
|
239
|
-
reasoning: payload.posting_start_date.reasoning,
|
|
240
|
-
cot: Array.isArray(payload.posting_start_date.cot)
|
|
241
|
-
? payload.posting_start_date.cot
|
|
242
|
-
: undefined,
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
if (payload.schedule_summary != null) {
|
|
246
|
-
result.scheduleSummary = {
|
|
247
|
-
confidence: payload.schedule_summary.confidence,
|
|
248
|
-
reasoning: payload.schedule_summary.reasoning,
|
|
249
|
-
reasoningLong: payload.schedule_summary.reasoning_long,
|
|
250
|
-
cot: Array.isArray(payload.schedule_summary.cot)
|
|
251
|
-
? payload.schedule_summary.cot
|
|
252
|
-
: undefined,
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
215
|
return Object.keys(result).length > 0 ? result : undefined;
|
|
256
216
|
}
|
|
257
217
|
function toJEScheduleRecommendations(payload) {
|
|
@@ -298,18 +258,9 @@ function toJEScheduledTransaction(payload) {
|
|
|
298
258
|
startDate: payload.start_date != null ? (0, zeniDayJS_1.date)(payload.start_date) : undefined,
|
|
299
259
|
endDate: payload.end_date != null ? (0, zeniDayJS_1.date)(payload.end_date) : undefined,
|
|
300
260
|
period: payload.period != null ? Number(payload.period) : undefined,
|
|
301
|
-
recurringAmount: payload.recurring_amount != null
|
|
302
|
-
? {
|
|
303
|
-
amount: payload.recurring_amount,
|
|
304
|
-
currencyCode: payload.currency_code,
|
|
305
|
-
currencySymbol: payload.currency_symbol,
|
|
306
|
-
}
|
|
307
|
-
: undefined,
|
|
308
|
-
postedCount: payload.posted_count ?? undefined,
|
|
309
261
|
updatedByUserID: payload.updated_by.user_id,
|
|
310
262
|
balanceAsOfToday: payload.balance ?? undefined,
|
|
311
263
|
updatedAt: payload.updated_at != null ? (0, zeniDayJS_1.date)(payload.updated_at) : undefined,
|
|
312
|
-
createTime: payload.create_time != null ? (0, zeniDayJS_1.date)(payload.create_time) : undefined,
|
|
313
264
|
jeCredit: {
|
|
314
265
|
accountId: payload.je_credit_account_id ?? undefined,
|
|
315
266
|
accountingClassId: payload.je_credit_accounting_class_id ?? undefined,
|
|
@@ -334,7 +285,6 @@ function toJEScheduledTransaction(payload) {
|
|
|
334
285
|
: {},
|
|
335
286
|
scheduledJournalEntry: [],
|
|
336
287
|
aiSummaries: toJEScheduleAISummaries(payload.ai_summaries),
|
|
337
|
-
confidenceScore: payload.confidence_score ?? undefined,
|
|
338
288
|
createdByUserID: payload.created_by?.user_id ?? undefined,
|
|
339
289
|
recommendations: toJEScheduleRecommendations(payload.recommendations),
|
|
340
290
|
};
|
|
@@ -347,20 +297,17 @@ function toJEAccruedScheduledTransaction(payload) {
|
|
|
347
297
|
label: payload.status.label,
|
|
348
298
|
},
|
|
349
299
|
vendorId: payload.vendor.vendor_id,
|
|
350
|
-
// The accrued payload extends JEScheduledTransactionPayload, so it carries currency_code and
|
|
351
|
-
// currency_symbol like every other schedule -- this mapper was hardcoding USD over fields it
|
|
352
|
-
// already had.
|
|
353
300
|
recurringAmount: {
|
|
354
301
|
amount: payload.recurring_amount,
|
|
355
|
-
currencyCode:
|
|
356
|
-
currencySymbol:
|
|
302
|
+
currencyCode: 'USD',
|
|
303
|
+
currencySymbol: '$',
|
|
357
304
|
},
|
|
358
305
|
otherAttributes: {
|
|
359
306
|
startingBalance: payload.other_attributes?.starting_balance != null
|
|
360
307
|
? {
|
|
361
308
|
amount: payload.other_attributes?.starting_balance ?? 0,
|
|
362
|
-
currencyCode:
|
|
363
|
-
currencySymbol:
|
|
309
|
+
currencyCode: 'USD',
|
|
310
|
+
currencySymbol: '$',
|
|
364
311
|
}
|
|
365
312
|
: undefined,
|
|
366
313
|
},
|
|
@@ -369,9 +316,6 @@ function toJEAccruedScheduledTransaction(payload) {
|
|
|
369
316
|
endDate: payload.end_date != null ? (0, zeniDayJS_1.date)(payload.end_date) : undefined,
|
|
370
317
|
period: payload.period != null ? Number(payload.period) : undefined,
|
|
371
318
|
updatedByUserID: payload.updated_by.user_id,
|
|
372
|
-
// The accrued joiner resolves createdByUserID into the "Created by" cell. Without this the
|
|
373
|
-
// payload's created_by was dropped here and every accrued row rendered a hyphen.
|
|
374
|
-
createdByUserID: payload.created_by?.user_id ?? undefined,
|
|
375
319
|
balanceAsOfToday: payload.balance ?? undefined,
|
|
376
320
|
updatedAt: payload.updated_at != null ? (0, zeniDayJS_1.date)(payload.updated_at) : undefined,
|
|
377
321
|
jeCredit: {
|
|
@@ -398,126 +342,3 @@ function toJEAccruedScheduledTransaction(payload) {
|
|
|
398
342
|
jeScheduleType: (0, jeSchedulesTypes_1.toScheduleTypesTypeStrict)(payload.je_schedule_type),
|
|
399
343
|
};
|
|
400
344
|
}
|
|
401
|
-
/**
|
|
402
|
-
* Reads the months in the order the snapshot gives them rather than deriving a range: a vendor that
|
|
403
|
-
* skipped a month has no entry for it, so filling gaps would invent history that was never billed.
|
|
404
|
-
*/
|
|
405
|
-
function toJEOneTimeAccrualMonthlyTotals(snapshot, currencyCode) {
|
|
406
|
-
const monthlyTotals = snapshot.monthly_totals;
|
|
407
|
-
if (monthlyTotals == null) {
|
|
408
|
-
return [];
|
|
409
|
-
}
|
|
410
|
-
const months = snapshot.sorted_months ?? Object.keys(monthlyTotals).sort();
|
|
411
|
-
return months
|
|
412
|
-
.filter((month) => monthlyTotals[month] != null)
|
|
413
|
-
.map((month) => ({
|
|
414
|
-
month,
|
|
415
|
-
amount: toOneTimeAccrualAmount(monthlyTotals[month], currencyCode),
|
|
416
|
-
}));
|
|
417
|
-
}
|
|
418
|
-
function toJEOneTimeAccrualProfileSnapshot(payload, currencyCode) {
|
|
419
|
-
if (payload == null) {
|
|
420
|
-
return undefined;
|
|
421
|
-
}
|
|
422
|
-
const billingPattern = payload.billing_pattern;
|
|
423
|
-
return {
|
|
424
|
-
monthlyTotals: toJEOneTimeAccrualMonthlyTotals(payload, currencyCode),
|
|
425
|
-
billingPattern: billingPattern != null
|
|
426
|
-
? {
|
|
427
|
-
frequency: billingPattern.frequency ?? undefined,
|
|
428
|
-
monthsOfHistory: billingPattern.months_of_history ?? undefined,
|
|
429
|
-
consistencyScore: billingPattern.consistency_score ?? undefined,
|
|
430
|
-
billingLagDays: billingPattern.billing_lag_days ?? undefined,
|
|
431
|
-
typicalBillDay: billingPattern.typical_bill_day ?? undefined,
|
|
432
|
-
avgAmount: billingPattern.avg_amount != null
|
|
433
|
-
? toOneTimeAccrualAmount(billingPattern.avg_amount, currencyCode)
|
|
434
|
-
: undefined,
|
|
435
|
-
lastBillAmount: billingPattern.last_bill_amount != null
|
|
436
|
-
? toOneTimeAccrualAmount(billingPattern.last_bill_amount, currencyCode)
|
|
437
|
-
: undefined,
|
|
438
|
-
lastBillDate: billingPattern.last_bill_date != null
|
|
439
|
-
? (0, zeniDayJS_1.date)(billingPattern.last_bill_date)
|
|
440
|
-
: undefined,
|
|
441
|
-
}
|
|
442
|
-
: undefined,
|
|
443
|
-
};
|
|
444
|
-
}
|
|
445
|
-
function toJEOneTimeAccrualAiSuggestion(payload, currencyCode) {
|
|
446
|
-
if (payload == null) {
|
|
447
|
-
return undefined;
|
|
448
|
-
}
|
|
449
|
-
return {
|
|
450
|
-
memo: payload.memo ?? undefined,
|
|
451
|
-
jeDebitAccountName: payload.je_debit_account_name ?? undefined,
|
|
452
|
-
jeCreditAccountName: payload.je_credit_account_name ?? undefined,
|
|
453
|
-
estimatedAmount: payload.estimated_amount != null
|
|
454
|
-
? toOneTimeAccrualAmount(payload.estimated_amount, currencyCode)
|
|
455
|
-
: undefined,
|
|
456
|
-
};
|
|
457
|
-
}
|
|
458
|
-
function toJEOneTimeAccrual(payload) {
|
|
459
|
-
return {
|
|
460
|
-
accrualId: payload._id,
|
|
461
|
-
vendorId: payload.vendor_id,
|
|
462
|
-
vendorName: payload.vendor_name,
|
|
463
|
-
serviceMonth: payload.service_month,
|
|
464
|
-
accrualStatus: (0, jeSchedulesTypes_1.toOneTimeAccrualStatusCodeType)(payload.status),
|
|
465
|
-
origin: (0, jeSchedulesTypes_1.toOneTimeAccrualOriginType)(payload.origin),
|
|
466
|
-
automationTier: payload.automation_tier != null
|
|
467
|
-
? (0, jeSchedulesTypes_1.toOneTimeAccrualAutomationTierType)(payload.automation_tier)
|
|
468
|
-
: undefined,
|
|
469
|
-
estimatedAmount: toOneTimeAccrualAmount(payload.estimated_amount, payload.currency),
|
|
470
|
-
memo: payload.memo ?? '',
|
|
471
|
-
profileSnapshot: toJEOneTimeAccrualProfileSnapshot(payload.profile_snapshot, payload.currency),
|
|
472
|
-
isIgnored: payload.is_ignored === true,
|
|
473
|
-
aiSuggestion: toJEOneTimeAccrualAiSuggestion(payload.ai_suggestion, payload.currency),
|
|
474
|
-
// Exclusive by contract: a scheduled row reverses on expectedReversalDate and bills never
|
|
475
|
-
// drive it, so the two never need reconciling. Defaulting to on_bill_match matches the
|
|
476
|
-
// create path's default when the field is absent on an older document.
|
|
477
|
-
reversalPolicy: (0, jeSchedulesTypes_1.toOneTimeAccrualReversalPolicyType)(payload.reversal_policy ?? 'on_bill_match'),
|
|
478
|
-
reversalTrigger: (0, jeSchedulesTypes_1.toOneTimeAccrualReversalTriggerType)(payload.reversal_trigger ?? undefined),
|
|
479
|
-
expectedReversalDate: payload.expected_reversal_date != null
|
|
480
|
-
? (0, zeniDayJS_1.date)(payload.expected_reversal_date)
|
|
481
|
-
: undefined,
|
|
482
|
-
postingDate: payload.posting_date != null ? (0, zeniDayJS_1.date)(payload.posting_date) : undefined,
|
|
483
|
-
actualPostDate: payload.actual_post_date != null
|
|
484
|
-
? (0, zeniDayJS_1.date)(payload.actual_post_date)
|
|
485
|
-
: undefined,
|
|
486
|
-
actualReversalPostDate: payload.actual_reversal_post_date != null
|
|
487
|
-
? (0, zeniDayJS_1.date)(payload.actual_reversal_post_date)
|
|
488
|
-
: undefined,
|
|
489
|
-
jeDebitAccountId: payload.je_debit_account_id ?? undefined,
|
|
490
|
-
jeDebitAccountName: payload.je_debit_account_name ?? undefined,
|
|
491
|
-
jeDebitAccountingClassId: payload.je_debit_accounting_class_id ?? undefined,
|
|
492
|
-
jeDebitAccountingClassName: payload.je_debit_accounting_class_name ?? undefined,
|
|
493
|
-
jeCreditAccountId: payload.je_credit_account_id ?? undefined,
|
|
494
|
-
jeCreditAccountName: payload.je_credit_account_name ?? undefined,
|
|
495
|
-
jeCreditAccountingClassId: payload.je_credit_accounting_class_id ?? undefined,
|
|
496
|
-
jeCreditAccountingClassName: payload.je_credit_accounting_class_name ?? undefined,
|
|
497
|
-
transactionId: payload.transaction_id ?? undefined,
|
|
498
|
-
transactionIntegrationId: payload.transaction_integration_id ?? undefined,
|
|
499
|
-
reversalTransactionId: payload.reversal_transaction_id ?? undefined,
|
|
500
|
-
createdBy: toJEOneTimeAccrualCreator(payload.created_by_user),
|
|
501
|
-
};
|
|
502
|
-
}
|
|
503
|
-
// The accrual wire format carries a currency CODE but no symbol, so the symbol has to be derived.
|
|
504
|
-
// Only USD has a known glyph today (the create path is USD-only); anything else falls back to the
|
|
505
|
-
// code, which reads correctly as "EUR 1,200" rather than silently rendering a wrong "$".
|
|
506
|
-
function toOneTimeAccrualAmount(amount, currencyCode) {
|
|
507
|
-
const code = currencyCode ?? USD_CURRENCY_CODE;
|
|
508
|
-
return (0, amount_1.toAmount)(amount, code, code === USD_CURRENCY_CODE ? '$' : code);
|
|
509
|
-
}
|
|
510
|
-
function toJEOneTimeAccrualCreator(payload) {
|
|
511
|
-
if (payload == null) {
|
|
512
|
-
return undefined;
|
|
513
|
-
}
|
|
514
|
-
return {
|
|
515
|
-
userId: payload.user_id,
|
|
516
|
-
email: payload.email ?? undefined,
|
|
517
|
-
firstName: payload.first_name ?? undefined,
|
|
518
|
-
lastName: payload.last_name ?? undefined,
|
|
519
|
-
photo: payload.photo?.original != null
|
|
520
|
-
? (0, zeniUrl_1.toZeniUrl)(payload.photo.original)
|
|
521
|
-
: undefined,
|
|
522
|
-
};
|
|
523
|
-
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UpdateType } from '../../commonStateTypes/common';
|
|
2
|
-
import { JEAccruedScheduledTransactionPayload,
|
|
2
|
+
import { JEAccruedScheduledTransactionPayload, JEScheduledTransactionPayload, ScheduledJournalEntryPayload } from './jeSchedulesPayload';
|
|
3
3
|
import { JESchedulesState } from './jeSchedulesState';
|
|
4
4
|
export declare const initialState: JESchedulesState;
|
|
5
5
|
export declare const updateJESchedules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeSchedulesTransactionsPayload: JEScheduledTransactionPayload[]], {
|
|
@@ -22,8 +22,6 @@ export declare const updateJESchedules: import("@reduxjs/toolkit").ActionCreator
|
|
|
22
22
|
jeScheduleTransactionKey: `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`;
|
|
23
23
|
}, "jeSchedules/deleteJESchedulesDetails", never, never>, deleteAccruedJESchedulesDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[JEScheduleKey: `${string}_${string}`], {
|
|
24
24
|
JEScheduleKey: `${string}_${string}`;
|
|
25
|
-
}, "jeSchedules/deleteAccruedJESchedulesDetails", never, never
|
|
26
|
-
jeOneTimeAccrualsPayload: JEOneTimeAccrualPayload[];
|
|
27
|
-
}, "jeSchedules/updateJEOneTimeAccruals", never, never>;
|
|
25
|
+
}, "jeSchedules/deleteAccruedJESchedulesDetails", never, never>;
|
|
28
26
|
declare const _default: import("redux").Reducer<JESchedulesState>;
|
|
29
27
|
export default _default;
|
|
@@ -4,16 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
var _a;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
7
|
+
exports.deleteAccruedJESchedulesDetails = exports.deleteJESchedulesDetails = exports.updateAccruedJESchedulesDetails = exports.updateJESchedulesDetails = exports.updateAccruedJEScheduledTransaction = exports.updateJEScheduledTransaction = exports.updateAccruedJESchedules = exports.updateJESchedules = exports.initialState = void 0;
|
|
8
8
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
9
|
const assignWith_1 = __importDefault(require("lodash/assignWith"));
|
|
10
10
|
const rootActions_1 = require("../../rootActions");
|
|
11
|
-
const jeScheduleHelper_1 = require("./jeScheduleHelper");
|
|
12
11
|
const jeSchedulesPayload_1 = require("./jeSchedulesPayload");
|
|
13
12
|
exports.initialState = {
|
|
14
13
|
schedulesByTransactionKey: {},
|
|
15
14
|
schedulesByAccruedJEScheduleKey: {},
|
|
16
|
-
oneTimeAccrualsByKey: {},
|
|
17
15
|
};
|
|
18
16
|
const jeSchedules = (0, toolkit_1.createSlice)({
|
|
19
17
|
name: 'jeSchedules',
|
|
@@ -118,41 +116,15 @@ const jeSchedules = (0, toolkit_1.createSlice)({
|
|
|
118
116
|
delete draft.schedulesByAccruedJEScheduleKey[JEScheduleKey];
|
|
119
117
|
},
|
|
120
118
|
},
|
|
121
|
-
// Writes directly, unlike updateAccruedJESchedules / updateJESchedules, which are no-op
|
|
122
|
-
// actions whose only job is to trigger the entity fan-out epic that fetches vendors,
|
|
123
|
-
// accounts, classes and users. An accrual denormalizes all of those as names on the document,
|
|
124
|
-
// so there is nothing to fan out to.
|
|
125
|
-
updateJEOneTimeAccruals: {
|
|
126
|
-
prepare(jeOneTimeAccrualsPayload) {
|
|
127
|
-
return {
|
|
128
|
-
payload: {
|
|
129
|
-
jeOneTimeAccrualsPayload,
|
|
130
|
-
},
|
|
131
|
-
};
|
|
132
|
-
},
|
|
133
|
-
reducer(draft, action) {
|
|
134
|
-
action.payload.jeOneTimeAccrualsPayload.forEach((accrualPayload) => {
|
|
135
|
-
const accrual = (0, jeSchedulesPayload_1.toJEOneTimeAccrual)(accrualPayload);
|
|
136
|
-
draft.oneTimeAccrualsByKey[(0, jeScheduleHelper_1.generateJEOneTimeAccrualKey)(accrual.accrualId)] = accrual;
|
|
137
|
-
});
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
clearAllJEScheduleTransactions(draft) {
|
|
141
|
-
draft.schedulesByTransactionKey = {};
|
|
142
|
-
},
|
|
143
|
-
clearAllAccruedJESchedules(draft) {
|
|
144
|
-
draft.schedulesByAccruedJEScheduleKey = {};
|
|
145
|
-
},
|
|
146
119
|
},
|
|
147
120
|
extraReducers: (builder) => {
|
|
148
121
|
builder.addCase(rootActions_1.clearAll, (draft) => {
|
|
149
122
|
draft.schedulesByAccruedJEScheduleKey = {};
|
|
150
123
|
draft.schedulesByTransactionKey = {};
|
|
151
|
-
draft.oneTimeAccrualsByKey = {};
|
|
152
124
|
});
|
|
153
125
|
},
|
|
154
126
|
});
|
|
155
|
-
_a = jeSchedules.actions, exports.updateJESchedules = _a.updateJESchedules, exports.updateAccruedJESchedules = _a.updateAccruedJESchedules, exports.updateJEScheduledTransaction = _a.updateJEScheduledTransaction, exports.updateAccruedJEScheduledTransaction = _a.updateAccruedJEScheduledTransaction, exports.updateJESchedulesDetails = _a.updateJESchedulesDetails, exports.updateAccruedJESchedulesDetails = _a.updateAccruedJESchedulesDetails, exports.deleteJESchedulesDetails = _a.deleteJESchedulesDetails, exports.deleteAccruedJESchedulesDetails = _a.deleteAccruedJESchedulesDetails
|
|
127
|
+
_a = jeSchedules.actions, exports.updateJESchedules = _a.updateJESchedules, exports.updateAccruedJESchedules = _a.updateAccruedJESchedules, exports.updateJEScheduledTransaction = _a.updateJEScheduledTransaction, exports.updateAccruedJEScheduledTransaction = _a.updateAccruedJEScheduledTransaction, exports.updateJESchedulesDetails = _a.updateJESchedulesDetails, exports.updateAccruedJESchedulesDetails = _a.updateAccruedJESchedulesDetails, exports.deleteJESchedulesDetails = _a.deleteJESchedulesDetails, exports.deleteAccruedJESchedulesDetails = _a.deleteAccruedJESchedulesDetails;
|
|
156
128
|
exports.default = jeSchedules.reducer;
|
|
157
129
|
/**
|
|
158
130
|
* Helper functions
|
|
@@ -9,8 +9,8 @@ import { ScheduleTransaction } from '../transaction/stateTypes/scheduleTransacti
|
|
|
9
9
|
import { TransactionID } from '../transaction/stateTypes/transactionID';
|
|
10
10
|
import { User } from '../user/userState';
|
|
11
11
|
import { Vendor } from '../vendor/vendorState';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { JEScheduleAISummaries, JEScheduleOtherAttributes, JEScheduleRecommendations, ScheduleJournalStatusCode, ScheduleStatus } from './jeSchedulesState';
|
|
13
|
+
import { JEScheduleKey, JEScheduleTransactionKey, JournalEntryErrorCodeType, ScheduleTypes } from './jeSchedulesTypes';
|
|
14
14
|
export interface ScheduledJournalEntry {
|
|
15
15
|
error: JournalEntryErrorCodeType[];
|
|
16
16
|
expectedPostDate: ZeniDate;
|
|
@@ -55,17 +55,13 @@ export interface JEScheduledTransaction {
|
|
|
55
55
|
accountingClass?: Class;
|
|
56
56
|
};
|
|
57
57
|
jeScheduleTransactionKey: JEScheduleTransactionKey;
|
|
58
|
-
lifecycleTotal: number;
|
|
59
58
|
otherAttributes: JEScheduleOtherAttributes;
|
|
60
|
-
postedCount: number;
|
|
61
59
|
scheduledJournalEntry: ScheduledJournalEntry[];
|
|
62
60
|
status: ScheduleStatus;
|
|
63
61
|
vendor: Vendor;
|
|
64
62
|
aiSummaries?: JEScheduleAISummaries;
|
|
65
63
|
balanceAsOfToday?: Amount;
|
|
66
|
-
confidenceScore?: number;
|
|
67
64
|
createdByUser?: User;
|
|
68
|
-
createTime?: ZeniDate;
|
|
69
65
|
dayOfPostingDate?: ScheduleDaysOfMonth;
|
|
70
66
|
endDate?: ZeniDate;
|
|
71
67
|
jeScheduleId?: ID;
|
|
@@ -73,14 +69,9 @@ export interface JEScheduledTransaction {
|
|
|
73
69
|
lastDayOfMonth?: boolean;
|
|
74
70
|
period?: number;
|
|
75
71
|
recommendations?: JEScheduleRecommendations;
|
|
76
|
-
recurringAmount?: Amount;
|
|
77
72
|
startDate?: ZeniDate;
|
|
78
73
|
updatedAt?: ZeniDate;
|
|
79
74
|
updatedByUser?: User;
|
|
80
75
|
}
|
|
81
|
-
export interface JEOneTimeAccrual extends JEOneTimeAccrualState {
|
|
82
|
-
jeOneTimeAccrualKey: JEOneTimeAccrualKey;
|
|
83
|
-
}
|
|
84
|
-
export declare const getJEOneTimeAccrualByKey: (jeOneTimeAccrualKey: JEOneTimeAccrualKey, jeSchedulesState: JESchedulesState) => JEOneTimeAccrual | undefined;
|
|
85
76
|
export declare const getJEAccruedScheduleByJEScheduleKey: (JEScheduleKey: JEScheduleKey, state: RootState) => JEAccruedSchedule | undefined;
|
|
86
77
|
export declare const getJEScheduledTransactionByJEScheduleTransactionKey: (jeScheduleTransactionKey: JEScheduleTransactionKey, state: RootState) => JEScheduledTransaction;
|