@zeniai/client-epic-state 5.2.76-betaGS1 → 5.2.76-betaNB1
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/reconciliationReport/reconciliationReportPayload.d.ts +124 -0
- package/lib/entity/reconciliationReport/reconciliationReportPayload.js +2 -0
- package/lib/entity/reconciliationReport/reconciliationReportReducer.d.ts +7 -0
- package/lib/entity/reconciliationReport/reconciliationReportReducer.js +173 -0
- package/lib/entity/reconciliationReport/reconciliationReportSelector.d.ts +3 -0
- package/lib/entity/reconciliationReport/reconciliationReportSelector.js +10 -0
- package/lib/entity/reconciliationReport/reconciliationReportState.d.ts +133 -0
- package/lib/entity/reconciliationReport/reconciliationReportState.js +15 -0
- package/lib/entity/tenant/epic/deleteConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.d.ts +3 -3
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.js +2 -2
- package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/epic/saveConnectorCredentialsEpic.d.ts +3 -3
- package/lib/entity/tenant/epic/saveOAuthConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/tenantPayload.d.ts +0 -1
- package/lib/entity/tenant/tenantReducer.d.ts +30 -32
- package/lib/entity/tenant/tenantReducer.js +2 -13
- package/lib/entity/tenant/tenantState.d.ts +0 -1
- package/lib/entity/tenant/tenantTypes.d.ts +1 -1
- package/lib/entity/tenant/tenantTypes.js +0 -1
- package/lib/epic.d.ts +2 -1
- package/lib/epic.js +2 -0
- package/lib/esm/entity/reconciliationReport/reconciliationReportPayload.js +1 -0
- package/lib/esm/entity/reconciliationReport/reconciliationReportReducer.js +168 -0
- package/lib/esm/entity/reconciliationReport/reconciliationReportSelector.js +4 -0
- package/lib/esm/entity/reconciliationReport/reconciliationReportState.js +10 -0
- package/lib/esm/entity/tenant/epic/initEmailConnectOAuthEpic.js +2 -2
- package/lib/esm/entity/tenant/tenantReducer.js +2 -13
- package/lib/esm/entity/tenant/tenantTypes.js +0 -1
- package/lib/esm/epic.js +2 -0
- package/lib/esm/index.js +3 -0
- package/lib/esm/reducer.js +7 -1
- package/lib/esm/view/reconciliationReportView/epic/fetchReconciliationReportEpic.js +29 -0
- package/lib/esm/view/reconciliationReportView/reconciliationReportViewPayload.js +1 -0
- package/lib/esm/view/reconciliationReportView/reconciliationReportViewReducer.js +44 -0
- package/lib/esm/view/reconciliationReportView/reconciliationReportViewSelector.js +10 -0
- package/lib/esm/view/reconciliationReportView/reconciliationReportViewState.js +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +39 -34
- package/lib/reducer.d.ts +2 -0
- package/lib/reducer.js +7 -1
- package/lib/rootStateTypes.d.ts +5 -1
- package/lib/view/reconciliationReportView/epic/fetchReconciliationReportEpic.d.ts +19 -0
- package/lib/view/reconciliationReportView/epic/fetchReconciliationReportEpic.js +33 -0
- package/lib/view/reconciliationReportView/reconciliationReportViewPayload.d.ts +3 -0
- package/lib/view/reconciliationReportView/reconciliationReportViewPayload.js +2 -0
- package/lib/view/reconciliationReportView/reconciliationReportViewReducer.d.ts +13 -0
- package/lib/view/reconciliationReportView/reconciliationReportViewReducer.js +48 -0
- package/lib/view/reconciliationReportView/reconciliationReportViewSelector.d.ts +9 -0
- package/lib/view/reconciliationReportView/reconciliationReportViewSelector.js +13 -0
- package/lib/view/reconciliationReportView/reconciliationReportViewState.d.ts +4 -0
- package/lib/view/reconciliationReportView/reconciliationReportViewState.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { StatusCodeWithLabelPayload } from '../../commonPayloadTypes/statusPayload';
|
|
2
|
+
import { CurrencyPayload } from '../../commonPayloadTypes/v2/viewAndReportPayloadv2';
|
|
3
|
+
import { ID } from '../../commonStateTypes/common';
|
|
4
|
+
export interface ReconciliationReportAccountPayload {
|
|
5
|
+
account_id: ID;
|
|
6
|
+
account_name?: string | null;
|
|
7
|
+
account_sub_type?: string | null;
|
|
8
|
+
account_type?: string | null;
|
|
9
|
+
coa_id?: string | null;
|
|
10
|
+
financial_institution?: string | null;
|
|
11
|
+
gl_account_name?: string | null;
|
|
12
|
+
last_4_digits?: string | null;
|
|
13
|
+
masked_account_number?: string | null;
|
|
14
|
+
}
|
|
15
|
+
export interface ReconciliationReportPeriodPayload {
|
|
16
|
+
end_date?: string | null;
|
|
17
|
+
start_date?: string | null;
|
|
18
|
+
}
|
|
19
|
+
export interface ReconciliationReportReconciledByPayload {
|
|
20
|
+
name?: string | null;
|
|
21
|
+
user_id?: ID | null;
|
|
22
|
+
}
|
|
23
|
+
export interface ReconciliationReportAiMatchPayload {
|
|
24
|
+
auto_matched_count: number;
|
|
25
|
+
cleared_count: number;
|
|
26
|
+
manually_matched_count: number;
|
|
27
|
+
}
|
|
28
|
+
export interface ReconciliationReportAfterPeriodEndPayload {
|
|
29
|
+
cleared_amount: number;
|
|
30
|
+
uncleared_amount: number;
|
|
31
|
+
}
|
|
32
|
+
export interface ReconciliationReportDifferencePayload {
|
|
33
|
+
amount?: number | null;
|
|
34
|
+
}
|
|
35
|
+
export interface ReconciliationReportCountAmountPayload {
|
|
36
|
+
amount: number;
|
|
37
|
+
count: number;
|
|
38
|
+
}
|
|
39
|
+
export interface ReconciliationReportStatementPayload {
|
|
40
|
+
deposits_cleared: ReconciliationReportCountAmountPayload;
|
|
41
|
+
payments_cleared: ReconciliationReportCountAmountPayload;
|
|
42
|
+
closing_balance?: number | null;
|
|
43
|
+
opening_balance?: number | null;
|
|
44
|
+
}
|
|
45
|
+
export interface ReconciliationReportRegisterPayload {
|
|
46
|
+
outstanding_as_of_period_end: number;
|
|
47
|
+
balance_as_of_period_end?: number | null;
|
|
48
|
+
balance_as_of_reconciled_at?: number | null;
|
|
49
|
+
}
|
|
50
|
+
export interface ReconciliationReportTransactionRowPayload {
|
|
51
|
+
amount: number;
|
|
52
|
+
match: string;
|
|
53
|
+
payee: string;
|
|
54
|
+
type: string;
|
|
55
|
+
age_days?: number | null;
|
|
56
|
+
cleared_balance?: number;
|
|
57
|
+
date?: string | null;
|
|
58
|
+
gl_account?: string | null;
|
|
59
|
+
issue_date?: string | null;
|
|
60
|
+
reference_number?: string | null;
|
|
61
|
+
transaction_id?: ID | null;
|
|
62
|
+
}
|
|
63
|
+
export interface ReconciliationReportBucketPayload {
|
|
64
|
+
amount: number;
|
|
65
|
+
count: number;
|
|
66
|
+
transactions: ReconciliationReportTransactionRowPayload[];
|
|
67
|
+
}
|
|
68
|
+
export interface ReconciliationReportPaymentsDepositsPayload {
|
|
69
|
+
deposits: ReconciliationReportBucketPayload;
|
|
70
|
+
payments: ReconciliationReportBucketPayload;
|
|
71
|
+
}
|
|
72
|
+
export interface ReconciliationReportBridgePayload {
|
|
73
|
+
uncleared_deposits: number;
|
|
74
|
+
uncleared_payments: number;
|
|
75
|
+
bank_closing?: number | null;
|
|
76
|
+
computed_ledger_closing?: number | null;
|
|
77
|
+
ledger_closing?: number | null;
|
|
78
|
+
variance?: number | null;
|
|
79
|
+
}
|
|
80
|
+
export interface ReconciliationReportSummaryPayload {
|
|
81
|
+
bridge: ReconciliationReportBridgePayload;
|
|
82
|
+
cleared_deposits: ReconciliationReportCountAmountPayload;
|
|
83
|
+
cleared_payments: ReconciliationReportCountAmountPayload;
|
|
84
|
+
uncleared_as_of_statement_date: {
|
|
85
|
+
deposits: ReconciliationReportCountAmountPayload;
|
|
86
|
+
payments: ReconciliationReportCountAmountPayload;
|
|
87
|
+
};
|
|
88
|
+
cleared_after_statement_date?: ReconciliationReportCountAmountPayload | null;
|
|
89
|
+
closing_balance?: number | null;
|
|
90
|
+
ledger_balance_as_of_reconciled_on?: number | null;
|
|
91
|
+
ledger_closing_as_of_statement_date?: number | null;
|
|
92
|
+
opening_balance?: number | null;
|
|
93
|
+
uncleared_after_statement_date?: ReconciliationReportCountAmountPayload | null;
|
|
94
|
+
variance?: number | null;
|
|
95
|
+
}
|
|
96
|
+
export interface ReconciliationReportDetailsPayload {
|
|
97
|
+
carried_forward: ReconciliationReportPaymentsDepositsPayload;
|
|
98
|
+
cleared: ReconciliationReportPaymentsDepositsPayload;
|
|
99
|
+
uncleared_as_of_statement_date: ReconciliationReportPaymentsDepositsPayload;
|
|
100
|
+
deposits_cleared?: ReconciliationReportTransactionRowPayload[];
|
|
101
|
+
payments_cleared?: ReconciliationReportTransactionRowPayload[];
|
|
102
|
+
}
|
|
103
|
+
export interface ReconciliationReportPayload {
|
|
104
|
+
account: ReconciliationReportAccountPayload;
|
|
105
|
+
after_period_end: ReconciliationReportAfterPeriodEndPayload;
|
|
106
|
+
ai_match: ReconciliationReportAiMatchPayload;
|
|
107
|
+
currency: CurrencyPayload;
|
|
108
|
+
data_source: string;
|
|
109
|
+
details: ReconciliationReportDetailsPayload;
|
|
110
|
+
difference: ReconciliationReportDifferencePayload;
|
|
111
|
+
disclaimer: string;
|
|
112
|
+
locked: boolean;
|
|
113
|
+
period: ReconciliationReportPeriodPayload;
|
|
114
|
+
reconciled_by: ReconciliationReportReconciledByPayload;
|
|
115
|
+
reconciliation_id: ID;
|
|
116
|
+
register: ReconciliationReportRegisterPayload;
|
|
117
|
+
statement: ReconciliationReportStatementPayload;
|
|
118
|
+
status: StatusCodeWithLabelPayload;
|
|
119
|
+
summary: ReconciliationReportSummaryPayload;
|
|
120
|
+
company_name?: string | null;
|
|
121
|
+
reconciled_at?: string | null;
|
|
122
|
+
report_reference?: string | null;
|
|
123
|
+
statement_date?: string | null;
|
|
124
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReconciliationReportPayload } from './reconciliationReportPayload';
|
|
2
|
+
import { ReconciliationReport, ReconciliationReportState } from './reconciliationReportState';
|
|
3
|
+
export declare const initialState: ReconciliationReportState;
|
|
4
|
+
export declare const updateReconciliationReport: import("@reduxjs/toolkit").ActionCreatorWithPayload<ReconciliationReportPayload, "reconciliationReport/updateReconciliationReport">, removeReconciliationReport: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "reconciliationReport/removeReconciliationReport">;
|
|
5
|
+
declare const _default: import("redux").Reducer<ReconciliationReportState>;
|
|
6
|
+
export default _default;
|
|
7
|
+
export declare function mapReconciliationReportPayloadToReconciliationReport(payload: ReconciliationReportPayload): ReconciliationReport;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.removeReconciliationReport = exports.updateReconciliationReport = exports.initialState = void 0;
|
|
5
|
+
exports.mapReconciliationReportPayloadToReconciliationReport = mapReconciliationReportPayloadToReconciliationReport;
|
|
6
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
7
|
+
const viewAndReportPayloadv2_1 = require("../../commonPayloadTypes/v2/viewAndReportPayloadv2");
|
|
8
|
+
const amount_1 = require("../../commonStateTypes/amount");
|
|
9
|
+
const rootActions_1 = require("../../rootActions");
|
|
10
|
+
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
11
|
+
const accountReconState_1 = require("../accountRecon/accountReconState");
|
|
12
|
+
const reconciliationReportState_1 = require("./reconciliationReportState");
|
|
13
|
+
exports.initialState = {
|
|
14
|
+
reportsByReconciliationId: {},
|
|
15
|
+
};
|
|
16
|
+
const reconciliationReport = (0, toolkit_1.createSlice)({
|
|
17
|
+
name: 'reconciliationReport',
|
|
18
|
+
initialState: exports.initialState,
|
|
19
|
+
reducers: {
|
|
20
|
+
updateReconciliationReport(draft, action) {
|
|
21
|
+
const report = mapReconciliationReportPayloadToReconciliationReport(action.payload);
|
|
22
|
+
draft.reportsByReconciliationId[report.reconciliationId] = report;
|
|
23
|
+
},
|
|
24
|
+
removeReconciliationReport(draft, action) {
|
|
25
|
+
delete draft.reportsByReconciliationId[action.payload];
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
extraReducers: (builder) => {
|
|
29
|
+
builder.addCase(rootActions_1.clearAll, (draft) => {
|
|
30
|
+
Object.assign(draft, exports.initialState);
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
_a = reconciliationReport.actions, exports.updateReconciliationReport = _a.updateReconciliationReport, exports.removeReconciliationReport = _a.removeReconciliationReport;
|
|
35
|
+
exports.default = reconciliationReport.reducer;
|
|
36
|
+
function toOptionalAmount(amount, currency) {
|
|
37
|
+
if (amount == null) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
return (0, amount_1.toAmountWC)(amount, currency);
|
|
41
|
+
}
|
|
42
|
+
function toOptionalDate(value) {
|
|
43
|
+
if (value == null || value === '') {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
return (0, zeniDayJS_1.date)(value);
|
|
47
|
+
}
|
|
48
|
+
function mapCountAmount(payload, currency) {
|
|
49
|
+
return {
|
|
50
|
+
count: payload.count,
|
|
51
|
+
amount: (0, amount_1.toAmountWC)(payload.amount, currency),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function mapTransactionRow(payload, currency) {
|
|
55
|
+
return {
|
|
56
|
+
transactionId: payload.transaction_id ?? undefined,
|
|
57
|
+
date: toOptionalDate(payload.date),
|
|
58
|
+
type: payload.type,
|
|
59
|
+
payee: payload.payee,
|
|
60
|
+
match: (0, reconciliationReportState_1.toReconciliationReportMatchType)(payload.match),
|
|
61
|
+
amount: (0, amount_1.toAmountWC)(payload.amount, currency),
|
|
62
|
+
clearedBalance: payload.cleared_balance != null
|
|
63
|
+
? (0, amount_1.toAmountWC)(payload.cleared_balance, currency)
|
|
64
|
+
: undefined,
|
|
65
|
+
glAccount: payload.gl_account ?? undefined,
|
|
66
|
+
referenceNumber: payload.reference_number ?? undefined,
|
|
67
|
+
issueDate: toOptionalDate(payload.issue_date),
|
|
68
|
+
ageDays: payload.age_days ?? undefined,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function mapBucket(payload, currency) {
|
|
72
|
+
return {
|
|
73
|
+
count: payload.count,
|
|
74
|
+
amount: (0, amount_1.toAmountWC)(payload.amount, currency),
|
|
75
|
+
transactions: payload.transactions.map((transaction) => mapTransactionRow(transaction, currency)),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function mapPaymentsDeposits(payload, currency) {
|
|
79
|
+
return {
|
|
80
|
+
payments: mapBucket(payload.payments, currency),
|
|
81
|
+
deposits: mapBucket(payload.deposits, currency),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function mapReconciliationReportPayloadToReconciliationReport(payload) {
|
|
85
|
+
const currency = (0, viewAndReportPayloadv2_1.mapCurrencyPayloadToCurrency)(payload.currency);
|
|
86
|
+
return {
|
|
87
|
+
reconciliationId: payload.reconciliation_id,
|
|
88
|
+
companyName: payload.company_name ?? undefined,
|
|
89
|
+
account: {
|
|
90
|
+
accountId: payload.account.account_id,
|
|
91
|
+
accountName: payload.account.account_name ?? undefined,
|
|
92
|
+
accountType: payload.account.account_type ?? undefined,
|
|
93
|
+
accountSubType: payload.account.account_sub_type ?? undefined,
|
|
94
|
+
last4Digits: payload.account.last_4_digits ?? undefined,
|
|
95
|
+
maskedAccountNumber: payload.account.masked_account_number ?? undefined,
|
|
96
|
+
financialInstitution: payload.account.financial_institution ?? undefined,
|
|
97
|
+
glAccountName: payload.account.gl_account_name ?? undefined,
|
|
98
|
+
coaId: payload.account.coa_id ?? undefined,
|
|
99
|
+
},
|
|
100
|
+
period: {
|
|
101
|
+
startDate: toOptionalDate(payload.period.start_date),
|
|
102
|
+
endDate: toOptionalDate(payload.period.end_date),
|
|
103
|
+
},
|
|
104
|
+
statementDate: toOptionalDate(payload.statement_date),
|
|
105
|
+
dataSource: (0, reconciliationReportState_1.toReconciliationReportDataSource)(payload.data_source),
|
|
106
|
+
currency,
|
|
107
|
+
status: {
|
|
108
|
+
code: (0, accountReconState_1.toReconciliationStatusCodeType)(payload.status.code),
|
|
109
|
+
label: payload.status.label,
|
|
110
|
+
},
|
|
111
|
+
reconciledAt: toOptionalDate(payload.reconciled_at),
|
|
112
|
+
reconciledBy: {
|
|
113
|
+
userId: payload.reconciled_by.user_id ?? undefined,
|
|
114
|
+
name: payload.reconciled_by.name ?? undefined,
|
|
115
|
+
},
|
|
116
|
+
disclaimer: payload.disclaimer,
|
|
117
|
+
reportReference: payload.report_reference ?? undefined,
|
|
118
|
+
locked: payload.locked,
|
|
119
|
+
difference: toOptionalAmount(payload.difference.amount, currency),
|
|
120
|
+
aiMatch: {
|
|
121
|
+
autoMatchedCount: payload.ai_match.auto_matched_count,
|
|
122
|
+
manuallyMatchedCount: payload.ai_match.manually_matched_count,
|
|
123
|
+
clearedCount: payload.ai_match.cleared_count,
|
|
124
|
+
},
|
|
125
|
+
afterPeriodEnd: {
|
|
126
|
+
unclearedAmount: (0, amount_1.toAmountWC)(payload.after_period_end.uncleared_amount, currency),
|
|
127
|
+
clearedAmount: (0, amount_1.toAmountWC)(payload.after_period_end.cleared_amount, currency),
|
|
128
|
+
},
|
|
129
|
+
statement: {
|
|
130
|
+
openingBalance: toOptionalAmount(payload.statement.opening_balance, currency),
|
|
131
|
+
paymentsCleared: mapCountAmount(payload.statement.payments_cleared, currency),
|
|
132
|
+
depositsCleared: mapCountAmount(payload.statement.deposits_cleared, currency),
|
|
133
|
+
closingBalance: toOptionalAmount(payload.statement.closing_balance, currency),
|
|
134
|
+
},
|
|
135
|
+
register: {
|
|
136
|
+
balanceAsOfPeriodEnd: toOptionalAmount(payload.register.balance_as_of_period_end, currency),
|
|
137
|
+
outstandingAsOfPeriodEnd: (0, amount_1.toAmountWC)(payload.register.outstanding_as_of_period_end, currency),
|
|
138
|
+
balanceAsOfReconciledAt: toOptionalAmount(payload.register.balance_as_of_reconciled_at, currency),
|
|
139
|
+
},
|
|
140
|
+
summary: {
|
|
141
|
+
openingBalance: toOptionalAmount(payload.summary.opening_balance, currency),
|
|
142
|
+
clearedPayments: mapCountAmount(payload.summary.cleared_payments, currency),
|
|
143
|
+
clearedDeposits: mapCountAmount(payload.summary.cleared_deposits, currency),
|
|
144
|
+
closingBalance: toOptionalAmount(payload.summary.closing_balance, currency),
|
|
145
|
+
unclearedAsOfStatementDate: {
|
|
146
|
+
payments: mapCountAmount(payload.summary.uncleared_as_of_statement_date.payments, currency),
|
|
147
|
+
deposits: mapCountAmount(payload.summary.uncleared_as_of_statement_date.deposits, currency),
|
|
148
|
+
},
|
|
149
|
+
ledgerClosingAsOfStatementDate: toOptionalAmount(payload.summary.ledger_closing_as_of_statement_date, currency),
|
|
150
|
+
clearedAfterStatementDate: payload.summary.cleared_after_statement_date != null
|
|
151
|
+
? mapCountAmount(payload.summary.cleared_after_statement_date, currency)
|
|
152
|
+
: undefined,
|
|
153
|
+
unclearedAfterStatementDate: payload.summary.uncleared_after_statement_date != null
|
|
154
|
+
? mapCountAmount(payload.summary.uncleared_after_statement_date, currency)
|
|
155
|
+
: undefined,
|
|
156
|
+
ledgerBalanceAsOfReconciledOn: toOptionalAmount(payload.summary.ledger_balance_as_of_reconciled_on, currency),
|
|
157
|
+
bridge: {
|
|
158
|
+
bankClosing: toOptionalAmount(payload.summary.bridge.bank_closing, currency),
|
|
159
|
+
unclearedDeposits: (0, amount_1.toAmountWC)(payload.summary.bridge.uncleared_deposits, currency),
|
|
160
|
+
unclearedPayments: (0, amount_1.toAmountWC)(payload.summary.bridge.uncleared_payments, currency),
|
|
161
|
+
computedLedgerClosing: toOptionalAmount(payload.summary.bridge.computed_ledger_closing, currency),
|
|
162
|
+
ledgerClosing: toOptionalAmount(payload.summary.bridge.ledger_closing, currency),
|
|
163
|
+
variance: toOptionalAmount(payload.summary.bridge.variance, currency),
|
|
164
|
+
},
|
|
165
|
+
variance: toOptionalAmount(payload.summary.variance, currency),
|
|
166
|
+
},
|
|
167
|
+
details: {
|
|
168
|
+
cleared: mapPaymentsDeposits(payload.details.cleared, currency),
|
|
169
|
+
carriedForward: mapPaymentsDeposits(payload.details.carried_forward, currency),
|
|
170
|
+
unclearedAsOfStatementDate: mapPaymentsDeposits(payload.details.uncleared_as_of_statement_date, currency),
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ID } from '../../commonStateTypes/common';
|
|
2
|
+
import { ReconciliationReport, ReconciliationReportState } from './reconciliationReportState';
|
|
3
|
+
export declare function getReconciliationReportByReconciliationId(reconciliationReportState: ReconciliationReportState, reconciliationId: ID): ReconciliationReport | undefined;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getReconciliationReportByReconciliationId = getReconciliationReportByReconciliationId;
|
|
7
|
+
const get_1 = __importDefault(require("lodash/get"));
|
|
8
|
+
function getReconciliationReportByReconciliationId(reconciliationReportState, reconciliationId) {
|
|
9
|
+
return (0, get_1.default)(reconciliationReportState.reportsByReconciliationId, reconciliationId, undefined);
|
|
10
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Amount, Currency } from '../../commonStateTypes/amount';
|
|
2
|
+
import { ID } from '../../commonStateTypes/common';
|
|
3
|
+
import { ZeniDate } from '../../zeniDayJS';
|
|
4
|
+
import { ReconciliationStatusCodeType } from '../accountRecon/accountReconState';
|
|
5
|
+
declare const RECONCILIATION_REPORT_MATCH_TYPE: readonly ["automatic", "manual"];
|
|
6
|
+
export type ReconciliationReportMatchType = (typeof RECONCILIATION_REPORT_MATCH_TYPE)[number];
|
|
7
|
+
export declare const toReconciliationReportMatchType: (value: string) => ReconciliationReportMatchType;
|
|
8
|
+
export declare const toReconciliationReportDataSource: (value: string) => "Statement" | "Plaid";
|
|
9
|
+
export type ReconciliationReportDataSource = ReturnType<typeof toReconciliationReportDataSource>;
|
|
10
|
+
export interface ReconciliationReportAccount {
|
|
11
|
+
accountId: ID;
|
|
12
|
+
accountName?: string;
|
|
13
|
+
accountSubType?: string;
|
|
14
|
+
accountType?: string;
|
|
15
|
+
coaId?: string;
|
|
16
|
+
financialInstitution?: string;
|
|
17
|
+
glAccountName?: string;
|
|
18
|
+
last4Digits?: string;
|
|
19
|
+
maskedAccountNumber?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ReconciliationReportPeriod {
|
|
22
|
+
endDate?: ZeniDate;
|
|
23
|
+
startDate?: ZeniDate;
|
|
24
|
+
}
|
|
25
|
+
export interface ReconciliationReportReconciledBy {
|
|
26
|
+
name?: string;
|
|
27
|
+
userId?: ID;
|
|
28
|
+
}
|
|
29
|
+
export interface ReconciliationReportStatus {
|
|
30
|
+
code: ReconciliationStatusCodeType;
|
|
31
|
+
label: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ReconciliationReportAiMatch {
|
|
34
|
+
autoMatchedCount: number;
|
|
35
|
+
clearedCount: number;
|
|
36
|
+
manuallyMatchedCount: number;
|
|
37
|
+
}
|
|
38
|
+
export interface ReconciliationReportAfterPeriodEnd {
|
|
39
|
+
clearedAmount: Amount;
|
|
40
|
+
unclearedAmount: Amount;
|
|
41
|
+
}
|
|
42
|
+
export interface ReconciliationReportCountAmount {
|
|
43
|
+
amount: Amount;
|
|
44
|
+
count: number;
|
|
45
|
+
}
|
|
46
|
+
export interface ReconciliationReportStatement {
|
|
47
|
+
depositsCleared: ReconciliationReportCountAmount;
|
|
48
|
+
paymentsCleared: ReconciliationReportCountAmount;
|
|
49
|
+
closingBalance?: Amount;
|
|
50
|
+
openingBalance?: Amount;
|
|
51
|
+
}
|
|
52
|
+
export interface ReconciliationReportRegister {
|
|
53
|
+
outstandingAsOfPeriodEnd: Amount;
|
|
54
|
+
balanceAsOfPeriodEnd?: Amount;
|
|
55
|
+
balanceAsOfReconciledAt?: Amount;
|
|
56
|
+
}
|
|
57
|
+
export interface ReconciliationReportTransactionRow {
|
|
58
|
+
amount: Amount;
|
|
59
|
+
match: ReconciliationReportMatchType;
|
|
60
|
+
payee: string;
|
|
61
|
+
type: string;
|
|
62
|
+
ageDays?: number;
|
|
63
|
+
clearedBalance?: Amount;
|
|
64
|
+
date?: ZeniDate;
|
|
65
|
+
glAccount?: string;
|
|
66
|
+
issueDate?: ZeniDate;
|
|
67
|
+
referenceNumber?: string;
|
|
68
|
+
transactionId?: ID;
|
|
69
|
+
}
|
|
70
|
+
export interface ReconciliationReportBucket {
|
|
71
|
+
amount: Amount;
|
|
72
|
+
count: number;
|
|
73
|
+
transactions: ReconciliationReportTransactionRow[];
|
|
74
|
+
}
|
|
75
|
+
export interface ReconciliationReportPaymentsDeposits {
|
|
76
|
+
deposits: ReconciliationReportBucket;
|
|
77
|
+
payments: ReconciliationReportBucket;
|
|
78
|
+
}
|
|
79
|
+
export interface ReconciliationReportBridge {
|
|
80
|
+
unclearedDeposits: Amount;
|
|
81
|
+
unclearedPayments: Amount;
|
|
82
|
+
bankClosing?: Amount;
|
|
83
|
+
computedLedgerClosing?: Amount;
|
|
84
|
+
ledgerClosing?: Amount;
|
|
85
|
+
variance?: Amount;
|
|
86
|
+
}
|
|
87
|
+
export interface ReconciliationReportSummary {
|
|
88
|
+
bridge: ReconciliationReportBridge;
|
|
89
|
+
clearedDeposits: ReconciliationReportCountAmount;
|
|
90
|
+
clearedPayments: ReconciliationReportCountAmount;
|
|
91
|
+
unclearedAsOfStatementDate: {
|
|
92
|
+
deposits: ReconciliationReportCountAmount;
|
|
93
|
+
payments: ReconciliationReportCountAmount;
|
|
94
|
+
};
|
|
95
|
+
clearedAfterStatementDate?: ReconciliationReportCountAmount;
|
|
96
|
+
closingBalance?: Amount;
|
|
97
|
+
ledgerBalanceAsOfReconciledOn?: Amount;
|
|
98
|
+
ledgerClosingAsOfStatementDate?: Amount;
|
|
99
|
+
openingBalance?: Amount;
|
|
100
|
+
unclearedAfterStatementDate?: ReconciliationReportCountAmount;
|
|
101
|
+
variance?: Amount;
|
|
102
|
+
}
|
|
103
|
+
export interface ReconciliationReportDetails {
|
|
104
|
+
carriedForward: ReconciliationReportPaymentsDeposits;
|
|
105
|
+
cleared: ReconciliationReportPaymentsDeposits;
|
|
106
|
+
unclearedAsOfStatementDate: ReconciliationReportPaymentsDeposits;
|
|
107
|
+
}
|
|
108
|
+
export interface ReconciliationReport {
|
|
109
|
+
account: ReconciliationReportAccount;
|
|
110
|
+
afterPeriodEnd: ReconciliationReportAfterPeriodEnd;
|
|
111
|
+
aiMatch: ReconciliationReportAiMatch;
|
|
112
|
+
currency: Currency;
|
|
113
|
+
dataSource: ReconciliationReportDataSource;
|
|
114
|
+
details: ReconciliationReportDetails;
|
|
115
|
+
disclaimer: string;
|
|
116
|
+
locked: boolean;
|
|
117
|
+
period: ReconciliationReportPeriod;
|
|
118
|
+
reconciledBy: ReconciliationReportReconciledBy;
|
|
119
|
+
reconciliationId: ID;
|
|
120
|
+
register: ReconciliationReportRegister;
|
|
121
|
+
statement: ReconciliationReportStatement;
|
|
122
|
+
status: ReconciliationReportStatus;
|
|
123
|
+
summary: ReconciliationReportSummary;
|
|
124
|
+
companyName?: string;
|
|
125
|
+
difference?: Amount;
|
|
126
|
+
reconciledAt?: ZeniDate;
|
|
127
|
+
reportReference?: string;
|
|
128
|
+
statementDate?: ZeniDate;
|
|
129
|
+
}
|
|
130
|
+
export interface ReconciliationReportState {
|
|
131
|
+
reportsByReconciliationId: Record<ID, ReconciliationReport>;
|
|
132
|
+
}
|
|
133
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toReconciliationReportDataSource = exports.toReconciliationReportMatchType = void 0;
|
|
4
|
+
const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
|
|
5
|
+
const RECONCILIATION_REPORT_MATCH_TYPE = ['automatic', 'manual'];
|
|
6
|
+
const toReconciliationReportMatchType = (value) => {
|
|
7
|
+
if (value === 'auto') {
|
|
8
|
+
return 'automatic';
|
|
9
|
+
}
|
|
10
|
+
return (0, stringToUnion_1.stringToUnion)(value, RECONCILIATION_REPORT_MATCH_TYPE);
|
|
11
|
+
};
|
|
12
|
+
exports.toReconciliationReportMatchType = toReconciliationReportMatchType;
|
|
13
|
+
const RECONCILIATION_REPORT_DATA_SOURCE = ['Statement', 'Plaid'];
|
|
14
|
+
const toReconciliationReportDataSource = (value) => (0, stringToUnion_1.stringToUnion)(value, RECONCILIATION_REPORT_DATA_SOURCE);
|
|
15
|
+
exports.toReconciliationReportDataSource = toReconciliationReportDataSource;
|
|
@@ -7,7 +7,7 @@ export declare const deleteConnectionEpic: (actions$: ActionsObservable<ActionTy
|
|
|
7
7
|
payload: {
|
|
8
8
|
tenantId: string;
|
|
9
9
|
connectionId: string;
|
|
10
|
-
connectionType: "revenue" | "email" | "
|
|
10
|
+
connectionType: "revenue" | "email" | "payments";
|
|
11
11
|
};
|
|
12
12
|
type: "tenant/deleteConnectionSuccess";
|
|
13
13
|
} | {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { RootState } from '../../../rootStateTypes';
|
|
3
3
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
4
|
-
import {
|
|
4
|
+
import { initEmailConnectOAuth, initEmailConnectOAuthFailure, initEmailConnectOAuthSuccess } from '../tenantReducer';
|
|
5
5
|
export type ActionType = ReturnType<typeof initEmailConnectOAuth> | ReturnType<typeof initEmailConnectOAuthSuccess> | ReturnType<typeof initEmailConnectOAuthFailure>;
|
|
6
6
|
export type NavigateFn = (url: string) => void;
|
|
7
7
|
export declare const initEmailConnectOAuthEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI, navigate?: NavigateFn) => import("rxjs").Observable<{
|
|
8
8
|
payload: {
|
|
9
9
|
tenantId: string;
|
|
10
|
-
provider:
|
|
10
|
+
provider: "gmail" | "outlook";
|
|
11
11
|
authorizationUrl: string;
|
|
12
12
|
};
|
|
13
13
|
type: "tenant/initEmailConnectOAuthSuccess";
|
|
14
14
|
} | {
|
|
15
15
|
payload: {
|
|
16
16
|
tenantId: string;
|
|
17
|
-
provider:
|
|
17
|
+
provider: "gmail" | "outlook";
|
|
18
18
|
status: import("../../../zeniAPIStatus").ZeniAPIStatus<Record<string, unknown>>;
|
|
19
19
|
};
|
|
20
20
|
type: "tenant/initEmailConnectOAuthFailure";
|
|
@@ -14,7 +14,7 @@ const defaultNavigate = (url) => {
|
|
|
14
14
|
window.location.href = url;
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
// Backs the POST /1.0/connectors/<provider>/init endpoint on the
|
|
17
|
+
// Backs the new POST /1.0/connectors/email/<provider>/init endpoint on the
|
|
18
18
|
// auth service. The endpoint creates a CSRF state token in the auth NDB
|
|
19
19
|
// store and returns the provider's authorization_url; this epic then drives
|
|
20
20
|
// a full-page redirect so the user lands on Google's / Microsoft's consent
|
|
@@ -31,7 +31,7 @@ navigate = defaultNavigate) => actions$.pipe((0, operators_1.filter)(tenantReduc
|
|
|
31
31
|
// the gmail provider's `saveConnectorCredentialsStateBySlug` in
|
|
32
32
|
// `In-Progress` forever. groupBy gives each provider its own stream.
|
|
33
33
|
(0, operators_1.groupBy)((action) => action.payload.provider), (0, operators_1.mergeMap)((perProvider$) => perProvider$.pipe((0, operators_1.switchMap)((action) => zeniAPI
|
|
34
|
-
.postAndGetJSON(`${zeniAPI.apiEndPoints.authMicroServiceBaseUrl}/1.0/connectors/${action.payload.provider}/init`, { redirect_after_url: action.payload.redirectAfterUrl }, { 'zeni-tenant-id': action.payload.tenantId })
|
|
34
|
+
.postAndGetJSON(`${zeniAPI.apiEndPoints.authMicroServiceBaseUrl}/1.0/connectors/email/${action.payload.provider}/init`, { redirect_after_url: action.payload.redirectAfterUrl }, { 'zeni-tenant-id': action.payload.tenantId })
|
|
35
35
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
36
36
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
37
37
|
// Fire-and-forget side effect — once the browser navigates,
|
|
@@ -6,7 +6,7 @@ export type ActionType = ReturnType<typeof saveAPIKeyConnection> | ReturnType<ty
|
|
|
6
6
|
export declare const saveAPIKeyConnectionEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
7
7
|
payload: {
|
|
8
8
|
tenantId: string;
|
|
9
|
-
connectionType: "revenue" | "email" | "
|
|
9
|
+
connectionType: "revenue" | "email" | "payments";
|
|
10
10
|
connectionPayload: import("../tenantPayload").ConnectionDataPayload;
|
|
11
11
|
};
|
|
12
12
|
type: "tenant/saveAPIKeyConnectionSuccess";
|
|
@@ -6,15 +6,15 @@ export type ActionType = ReturnType<typeof saveConnectorCredentials> | ReturnTyp
|
|
|
6
6
|
export declare const saveConnectorCredentialsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
7
7
|
payload: {
|
|
8
8
|
tenantId: string;
|
|
9
|
-
connectionType: "revenue" | "email" | "
|
|
10
|
-
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook"
|
|
9
|
+
connectionType: "revenue" | "email" | "payments";
|
|
10
|
+
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook";
|
|
11
11
|
connectionPayload: import("../tenantPayload").ConnectionDataPayload;
|
|
12
12
|
};
|
|
13
13
|
type: "tenant/saveConnectorCredentialsSuccess";
|
|
14
14
|
} | {
|
|
15
15
|
payload: {
|
|
16
16
|
tenantId: string;
|
|
17
|
-
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook"
|
|
17
|
+
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook";
|
|
18
18
|
status: import("../../../zeniAPIStatus").ZeniAPIStatus<Record<string, unknown>>;
|
|
19
19
|
};
|
|
20
20
|
type: "tenant/saveConnectorCredentialsFailure";
|
|
@@ -6,7 +6,7 @@ export type ActionType = ReturnType<typeof saveOAuthConnection> | ReturnType<typ
|
|
|
6
6
|
export declare const saveOAuthConnectionEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
7
7
|
payload: {
|
|
8
8
|
tenantId: string;
|
|
9
|
-
connectionType: "revenue" | "email" | "
|
|
9
|
+
connectionType: "revenue" | "email" | "payments";
|
|
10
10
|
connectionPayload: import("../tenantPayload").ConnectionDataPayload;
|
|
11
11
|
};
|
|
12
12
|
type: "tenant/saveOAuthConnectionSuccess";
|