@zeniai/client-epic-state 5.1.78 → 5.1.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/entity/invoicing/invoicingCommonPayload.d.ts +0 -42
- package/lib/entity/invoicing/invoicingCommonPayload.js +1 -66
- package/lib/entity/tenant/clearAllEpic.d.ts +1 -2
- package/lib/entity/tenant/clearAllEpic.js +0 -2
- package/lib/epic.d.ts +1 -2
- package/lib/epic.js +1 -7
- package/lib/esm/entity/invoicing/invoicingCommonPayload.js +0 -61
- package/lib/esm/entity/tenant/clearAllEpic.js +0 -2
- package/lib/esm/epic.js +1 -7
- package/lib/esm/index.js +1 -5
- package/lib/esm/reducer.js +0 -3
- package/lib/esm/view/dashboard/dashboardSelector.js +10 -14
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +18 -4
- package/lib/esm/view/invoicing/createCreditNote/createCreditNoteFormConfig.js +1 -6
- package/lib/esm/view/invoicing/createCreditNote/createCreditNotePayload.js +8 -1
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +5 -4
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +11 -10
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormConfig.js +10 -8
- 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 +1 -43
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/invoicingCouponFormConfig.js +44 -0
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewPayload.js +5 -2
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig.js +2 -1
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +1 -7
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +0 -3
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNotePayload.js +11 -4
- package/lib/esm/view/invoicing/recordPayment/recordPaymentFormConfig.js +1 -0
- package/lib/esm/view/invoicing/recordPayment/recordPaymentPayload.js +14 -5
- package/lib/index.d.ts +1 -7
- package/lib/index.js +4 -20
- package/lib/reducer.d.ts +0 -3
- package/lib/reducer.js +0 -3
- package/lib/view/dashboard/dashboardSelector.d.ts +3 -2
- package/lib/view/dashboard/dashboardSelector.js +9 -13
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +17 -3
- package/lib/view/invoicing/createCreditNote/createCreditNoteFormConfig.js +1 -6
- package/lib/view/invoicing/createCreditNote/createCreditNotePayload.js +8 -1
- package/lib/view/invoicing/createCreditNote/createCreditNoteState.d.ts +1 -3
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.d.ts +1 -2
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +5 -4
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +11 -10
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewState.d.ts +5 -10
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormConfig.js +10 -8
- 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 +2 -9
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewState.js +0 -45
- package/lib/view/invoicing/editInvoicingCouponDetailView/invoicingCouponFormConfig.d.ts +5 -0
- package/lib/view/invoicing/editInvoicingCouponDetailView/invoicingCouponFormConfig.js +48 -0
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewPayload.js +5 -2
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewState.d.ts +1 -3
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig.js +2 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewPayload.d.ts +1 -4
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +0 -6
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.d.ts +1 -4
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +0 -3
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewState.d.ts +1 -4
- package/lib/view/invoicing/issueCreditNote/issueCreditNotePayload.js +11 -4
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteState.d.ts +2 -3
- package/lib/view/invoicing/recordPayment/recordPaymentFormConfig.js +1 -0
- package/lib/view/invoicing/recordPayment/recordPaymentPayload.js +14 -5
- package/lib/view/invoicing/recordPayment/recordPaymentState.d.ts +2 -4
- package/package.json +1 -1
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.js +0 -25
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.js +0 -15
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboConnectionEpic.js +0 -15
- package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboSyncHealthEpic.js +0 -15
- package/lib/esm/view/invoicing/invoicingQboView/epics/invoicingQboViewActionType.js +0 -1
- package/lib/esm/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +0 -26
- package/lib/esm/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +0 -18
- package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewPayload.js +0 -47
- package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewReducer.js +0 -128
- package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +0 -20
- package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewState.js +0 -1
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.d.ts +0 -6
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.js +0 -29
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.d.ts +0 -6
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.js +0 -19
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboConnectionEpic.d.ts +0 -6
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboConnectionEpic.js +0 -19
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboSyncHealthEpic.d.ts +0 -6
- package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboSyncHealthEpic.js +0 -19
- package/lib/view/invoicing/invoicingQboView/epics/invoicingQboViewActionType.d.ts +0 -2
- package/lib/view/invoicing/invoicingQboView/epics/invoicingQboViewActionType.js +0 -2
- package/lib/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.d.ts +0 -6
- package/lib/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +0 -30
- package/lib/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.d.ts +0 -6
- package/lib/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +0 -22
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewPayload.d.ts +0 -79
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewPayload.js +0 -52
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewReducer.d.ts +0 -25
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewReducer.js +0 -132
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.d.ts +0 -21
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +0 -24
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewState.d.ts +0 -14
- package/lib/view/invoicing/invoicingQboView/invoicingQboViewState.js +0 -2
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
2
|
-
export interface InvoicingQboConnectionPayload {
|
|
3
|
-
connected: boolean;
|
|
4
|
-
company_name?: string | null;
|
|
5
|
-
connection_id?: string | null;
|
|
6
|
-
realm_id?: string | null;
|
|
7
|
-
}
|
|
8
|
-
export interface InvoicingQboConnection {
|
|
9
|
-
connected: boolean;
|
|
10
|
-
companyName?: string;
|
|
11
|
-
connectionId?: string;
|
|
12
|
-
realmId?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare function mapInvoicingQboConnection(payload: InvoicingQboConnectionPayload): InvoicingQboConnection;
|
|
15
|
-
/**
|
|
16
|
-
* A single row from the QBO accounts / classes endpoints. The rows carry the
|
|
17
|
-
* QBO id plus one or more name fields depending on the entity — inspect
|
|
18
|
-
* loosely, render the name, submit the id.
|
|
19
|
-
*/
|
|
20
|
-
export interface InvoicingQboAccountRowPayload {
|
|
21
|
-
account_id?: string | null;
|
|
22
|
-
account_name?: string | null;
|
|
23
|
-
account_type?: string | null;
|
|
24
|
-
accounting_class_name?: string | null;
|
|
25
|
-
fully_qualified_name?: string | null;
|
|
26
|
-
id?: string | null;
|
|
27
|
-
name?: string | null;
|
|
28
|
-
qbo_accounting_class_name?: string | null;
|
|
29
|
-
qbo_id?: string | null;
|
|
30
|
-
}
|
|
31
|
-
export interface InvoicingQboAccountOption {
|
|
32
|
-
id: string;
|
|
33
|
-
name: string;
|
|
34
|
-
accountType?: string;
|
|
35
|
-
}
|
|
36
|
-
export declare function mapInvoicingQboAccountOptions(rows: InvoicingQboAccountRowPayload[]): InvoicingQboAccountOption[];
|
|
37
|
-
export interface InvoicingQboAccountsPayload {
|
|
38
|
-
accounts: InvoicingQboAccountRowPayload[];
|
|
39
|
-
}
|
|
40
|
-
export interface InvoicingQboFailedTaskPayload {
|
|
41
|
-
attempts: number;
|
|
42
|
-
entity_id: string;
|
|
43
|
-
entity_type: string;
|
|
44
|
-
task_id: string;
|
|
45
|
-
last_error?: string | null;
|
|
46
|
-
updated_at?: string | null;
|
|
47
|
-
}
|
|
48
|
-
export interface InvoicingQboFailedTask {
|
|
49
|
-
attempts: number;
|
|
50
|
-
entityId: string;
|
|
51
|
-
entityType: string;
|
|
52
|
-
taskId: string;
|
|
53
|
-
lastError?: string;
|
|
54
|
-
updatedAt?: string;
|
|
55
|
-
}
|
|
56
|
-
export interface InvoicingQboSyncHealthPayload {
|
|
57
|
-
connection?: InvoicingQboConnectionPayload | null;
|
|
58
|
-
counts_by_status?: Record<string, number> | null;
|
|
59
|
-
failed_tasks?: InvoicingQboFailedTaskPayload[] | null;
|
|
60
|
-
}
|
|
61
|
-
export interface InvoicingQboSyncHealth {
|
|
62
|
-
countsByStatus: Record<string, number>;
|
|
63
|
-
failedTasks: InvoicingQboFailedTask[];
|
|
64
|
-
connection?: InvoicingQboConnection;
|
|
65
|
-
}
|
|
66
|
-
export declare function mapInvoicingQboSyncHealth(payload: InvoicingQboSyncHealthPayload): InvoicingQboSyncHealth;
|
|
67
|
-
export interface InvoicingQboRetryTaskPayload {
|
|
68
|
-
status: string;
|
|
69
|
-
task_id: string;
|
|
70
|
-
}
|
|
71
|
-
export interface InvoicingQboBackfillPayload {
|
|
72
|
-
enqueued?: Record<string, number> | null;
|
|
73
|
-
start_date?: string | null;
|
|
74
|
-
}
|
|
75
|
-
export type InvoicingQboConnectionResponse = ZeniAPIResponse<InvoicingQboConnectionPayload>;
|
|
76
|
-
export type InvoicingQboAccountsResponse = ZeniAPIResponse<InvoicingQboAccountsPayload>;
|
|
77
|
-
export type InvoicingQboSyncHealthResponse = ZeniAPIResponse<InvoicingQboSyncHealthPayload>;
|
|
78
|
-
export type InvoicingQboRetryTaskResponse = ZeniAPIResponse<InvoicingQboRetryTaskPayload>;
|
|
79
|
-
export type InvoicingQboBackfillResponse = ZeniAPIResponse<InvoicingQboBackfillPayload>;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapInvoicingQboConnection = mapInvoicingQboConnection;
|
|
4
|
-
exports.mapInvoicingQboAccountOptions = mapInvoicingQboAccountOptions;
|
|
5
|
-
exports.mapInvoicingQboSyncHealth = mapInvoicingQboSyncHealth;
|
|
6
|
-
function mapInvoicingQboConnection(payload) {
|
|
7
|
-
return {
|
|
8
|
-
connected: payload.connected,
|
|
9
|
-
companyName: payload.company_name ?? undefined,
|
|
10
|
-
connectionId: payload.connection_id ?? undefined,
|
|
11
|
-
realmId: payload.realm_id ?? undefined,
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
function mapInvoicingQboAccountOptions(rows) {
|
|
15
|
-
return rows.flatMap((row) => {
|
|
16
|
-
// Only qbo_id is a valid QBO AccountRef/ClassRef value — platform-internal
|
|
17
|
-
// ids (account_id / id) are display metadata and must never be submitted.
|
|
18
|
-
const accountId = row.qbo_id ?? row.id ?? row.account_id ?? '';
|
|
19
|
-
if (accountId === '') {
|
|
20
|
-
return [];
|
|
21
|
-
}
|
|
22
|
-
const accountName = row.name ??
|
|
23
|
-
row.account_name ??
|
|
24
|
-
row.accounting_class_name ??
|
|
25
|
-
row.qbo_accounting_class_name ??
|
|
26
|
-
row.fully_qualified_name ??
|
|
27
|
-
accountId;
|
|
28
|
-
return [
|
|
29
|
-
{
|
|
30
|
-
id: accountId,
|
|
31
|
-
name: accountName,
|
|
32
|
-
accountType: row.account_type ?? undefined,
|
|
33
|
-
},
|
|
34
|
-
];
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
function mapInvoicingQboSyncHealth(payload) {
|
|
38
|
-
return {
|
|
39
|
-
connection: payload.connection != null
|
|
40
|
-
? mapInvoicingQboConnection(payload.connection)
|
|
41
|
-
: undefined,
|
|
42
|
-
countsByStatus: payload.counts_by_status ?? {},
|
|
43
|
-
failedTasks: (payload.failed_tasks ?? []).map((task) => ({
|
|
44
|
-
attempts: task.attempts,
|
|
45
|
-
entityId: task.entity_id,
|
|
46
|
-
entityType: task.entity_type,
|
|
47
|
-
taskId: task.task_id,
|
|
48
|
-
lastError: task.last_error ?? undefined,
|
|
49
|
-
updatedAt: task.updated_at ?? undefined,
|
|
50
|
-
})),
|
|
51
|
-
};
|
|
52
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
2
|
-
import { InvoicingQboAccountOption, InvoicingQboConnection, InvoicingQboSyncHealth } from './invoicingQboViewPayload';
|
|
3
|
-
import { InvoicingQboViewState } from './invoicingQboViewState';
|
|
4
|
-
export declare const initialState: InvoicingQboViewState;
|
|
5
|
-
export declare const fetchInvoicingQboConnection: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingQboView/fetchInvoicingQboConnection">, updateInvoicingQboConnection: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingQboConnection, "invoicingQboView/updateInvoicingQboConnection">, updateInvoicingQboConnectionFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingQboView/updateInvoicingQboConnectionFailure">, fetchInvoicingQboAccounts: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accountTypes: string], {
|
|
6
|
-
accountTypes: string;
|
|
7
|
-
}, "invoicingQboView/fetchInvoicingQboAccounts", never, never>, updateInvoicingQboAccounts: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
8
|
-
accounts: InvoicingQboAccountOption[];
|
|
9
|
-
accountTypes: string;
|
|
10
|
-
}, "invoicingQboView/updateInvoicingQboAccounts">, updateInvoicingQboAccountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
11
|
-
accountTypes: string;
|
|
12
|
-
status: ZeniAPIStatus;
|
|
13
|
-
}, "invoicingQboView/updateInvoicingQboAccountsFailure">, fetchInvoicingQboClasses: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingQboView/fetchInvoicingQboClasses">, updateInvoicingQboClasses: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingQboAccountOption[], "invoicingQboView/updateInvoicingQboClasses">, updateInvoicingQboClassesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingQboView/updateInvoicingQboClassesFailure">, fetchInvoicingQboSyncHealth: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingQboView/fetchInvoicingQboSyncHealth">, updateInvoicingQboSyncHealth: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingQboSyncHealth, "invoicingQboView/updateInvoicingQboSyncHealth">, updateInvoicingQboSyncHealthFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingQboView/updateInvoicingQboSyncHealthFailure">, retryInvoicingQboSyncTask: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[taskId: string], {
|
|
14
|
-
taskId: string;
|
|
15
|
-
}, "invoicingQboView/retryInvoicingQboSyncTask", never, never>, retryInvoicingQboSyncTaskSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
16
|
-
status: string;
|
|
17
|
-
taskId: string;
|
|
18
|
-
}, "invoicingQboView/retryInvoicingQboSyncTaskSuccess">, retryInvoicingQboSyncTaskFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
19
|
-
status: ZeniAPIStatus;
|
|
20
|
-
taskId: string;
|
|
21
|
-
}, "invoicingQboView/retryInvoicingQboSyncTaskFailure">, startInvoicingQboBackfill: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[startDate: string], {
|
|
22
|
-
startDate: string;
|
|
23
|
-
}, "invoicingQboView/startInvoicingQboBackfill", never, never>, startInvoicingQboBackfillSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingQboView/startInvoicingQboBackfillSuccess">, startInvoicingQboBackfillFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingQboView/startInvoicingQboBackfillFailure">, clearInvoicingQboView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingQboView/clearInvoicingQboView">;
|
|
24
|
-
declare const _default: import("redux").Reducer<InvoicingQboViewState>;
|
|
25
|
-
export default _default;
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearInvoicingQboView = exports.startInvoicingQboBackfillFailure = exports.startInvoicingQboBackfillSuccess = exports.startInvoicingQboBackfill = exports.retryInvoicingQboSyncTaskFailure = exports.retryInvoicingQboSyncTaskSuccess = exports.retryInvoicingQboSyncTask = exports.updateInvoicingQboSyncHealthFailure = exports.updateInvoicingQboSyncHealth = exports.fetchInvoicingQboSyncHealth = exports.updateInvoicingQboClassesFailure = exports.updateInvoicingQboClasses = exports.fetchInvoicingQboClasses = exports.updateInvoicingQboAccountsFailure = exports.updateInvoicingQboAccounts = exports.fetchInvoicingQboAccounts = exports.updateInvoicingQboConnectionFailure = exports.updateInvoicingQboConnection = exports.fetchInvoicingQboConnection = exports.initialState = void 0;
|
|
5
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
exports.initialState = {
|
|
7
|
-
accountsByAccountTypes: {},
|
|
8
|
-
accountsFetchStateByAccountTypes: {},
|
|
9
|
-
backfillFetchState: { fetchState: 'Not-Started', error: undefined },
|
|
10
|
-
classes: [],
|
|
11
|
-
classesFetchState: { fetchState: 'Not-Started', error: undefined },
|
|
12
|
-
connection: undefined,
|
|
13
|
-
connectionFetchState: { fetchState: 'Not-Started', error: undefined },
|
|
14
|
-
retryFetchStateByTaskId: {},
|
|
15
|
-
syncHealth: undefined,
|
|
16
|
-
syncHealthFetchState: { fetchState: 'Not-Started', error: undefined },
|
|
17
|
-
};
|
|
18
|
-
const invoicingQboView = (0, toolkit_1.createSlice)({
|
|
19
|
-
name: 'invoicingQboView',
|
|
20
|
-
initialState: exports.initialState,
|
|
21
|
-
reducers: {
|
|
22
|
-
fetchInvoicingQboConnection(draft) {
|
|
23
|
-
draft.connectionFetchState = {
|
|
24
|
-
fetchState: 'In-Progress',
|
|
25
|
-
error: undefined,
|
|
26
|
-
};
|
|
27
|
-
},
|
|
28
|
-
updateInvoicingQboConnection(draft, action) {
|
|
29
|
-
draft.connection = action.payload;
|
|
30
|
-
draft.connectionFetchState = { fetchState: 'Completed', error: undefined };
|
|
31
|
-
},
|
|
32
|
-
updateInvoicingQboConnectionFailure(draft, action) {
|
|
33
|
-
draft.connectionFetchState = { fetchState: 'Error', error: action.payload };
|
|
34
|
-
},
|
|
35
|
-
fetchInvoicingQboAccounts: {
|
|
36
|
-
reducer(draft, action) {
|
|
37
|
-
draft.accountsFetchStateByAccountTypes[action.payload.accountTypes] = {
|
|
38
|
-
fetchState: 'In-Progress',
|
|
39
|
-
error: undefined,
|
|
40
|
-
};
|
|
41
|
-
},
|
|
42
|
-
prepare(accountTypes) {
|
|
43
|
-
return { payload: { accountTypes } };
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
updateInvoicingQboAccounts(draft, action) {
|
|
47
|
-
draft.accountsByAccountTypes[action.payload.accountTypes] =
|
|
48
|
-
action.payload.accounts;
|
|
49
|
-
draft.accountsFetchStateByAccountTypes[action.payload.accountTypes] = {
|
|
50
|
-
fetchState: 'Completed',
|
|
51
|
-
error: undefined,
|
|
52
|
-
};
|
|
53
|
-
},
|
|
54
|
-
updateInvoicingQboAccountsFailure(draft, action) {
|
|
55
|
-
draft.accountsFetchStateByAccountTypes[action.payload.accountTypes] = {
|
|
56
|
-
fetchState: 'Error',
|
|
57
|
-
error: action.payload.status,
|
|
58
|
-
};
|
|
59
|
-
},
|
|
60
|
-
fetchInvoicingQboClasses(draft) {
|
|
61
|
-
draft.classesFetchState = { fetchState: 'In-Progress', error: undefined };
|
|
62
|
-
},
|
|
63
|
-
updateInvoicingQboClasses(draft, action) {
|
|
64
|
-
draft.classes = action.payload;
|
|
65
|
-
draft.classesFetchState = { fetchState: 'Completed', error: undefined };
|
|
66
|
-
},
|
|
67
|
-
updateInvoicingQboClassesFailure(draft, action) {
|
|
68
|
-
draft.classesFetchState = { fetchState: 'Error', error: action.payload };
|
|
69
|
-
},
|
|
70
|
-
fetchInvoicingQboSyncHealth(draft) {
|
|
71
|
-
draft.syncHealthFetchState = {
|
|
72
|
-
fetchState: 'In-Progress',
|
|
73
|
-
error: undefined,
|
|
74
|
-
};
|
|
75
|
-
},
|
|
76
|
-
updateInvoicingQboSyncHealth(draft, action) {
|
|
77
|
-
draft.syncHealth = action.payload;
|
|
78
|
-
draft.syncHealthFetchState = { fetchState: 'Completed', error: undefined };
|
|
79
|
-
},
|
|
80
|
-
updateInvoicingQboSyncHealthFailure(draft, action) {
|
|
81
|
-
draft.syncHealthFetchState = {
|
|
82
|
-
fetchState: 'Error',
|
|
83
|
-
error: action.payload,
|
|
84
|
-
};
|
|
85
|
-
},
|
|
86
|
-
retryInvoicingQboSyncTask: {
|
|
87
|
-
reducer(draft, action) {
|
|
88
|
-
draft.retryFetchStateByTaskId[action.payload.taskId] = {
|
|
89
|
-
fetchState: 'In-Progress',
|
|
90
|
-
error: undefined,
|
|
91
|
-
};
|
|
92
|
-
},
|
|
93
|
-
prepare(taskId) {
|
|
94
|
-
return { payload: { taskId } };
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
retryInvoicingQboSyncTaskSuccess(draft, action) {
|
|
98
|
-
draft.retryFetchStateByTaskId[action.payload.taskId] = {
|
|
99
|
-
fetchState: 'Completed',
|
|
100
|
-
error: undefined,
|
|
101
|
-
};
|
|
102
|
-
},
|
|
103
|
-
retryInvoicingQboSyncTaskFailure(draft, action) {
|
|
104
|
-
draft.retryFetchStateByTaskId[action.payload.taskId] = {
|
|
105
|
-
fetchState: 'Error',
|
|
106
|
-
error: action.payload.status,
|
|
107
|
-
};
|
|
108
|
-
},
|
|
109
|
-
startInvoicingQboBackfill: {
|
|
110
|
-
reducer(draft) {
|
|
111
|
-
draft.backfillFetchState = {
|
|
112
|
-
fetchState: 'In-Progress',
|
|
113
|
-
error: undefined,
|
|
114
|
-
};
|
|
115
|
-
},
|
|
116
|
-
prepare(startDate) {
|
|
117
|
-
return { payload: { startDate } };
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
startInvoicingQboBackfillSuccess(draft) {
|
|
121
|
-
draft.backfillFetchState = { fetchState: 'Completed', error: undefined };
|
|
122
|
-
},
|
|
123
|
-
startInvoicingQboBackfillFailure(draft, action) {
|
|
124
|
-
draft.backfillFetchState = { fetchState: 'Error', error: action.payload };
|
|
125
|
-
},
|
|
126
|
-
clearInvoicingQboView(draft) {
|
|
127
|
-
Object.assign(draft, exports.initialState);
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
});
|
|
131
|
-
_a = invoicingQboView.actions, exports.fetchInvoicingQboConnection = _a.fetchInvoicingQboConnection, exports.updateInvoicingQboConnection = _a.updateInvoicingQboConnection, exports.updateInvoicingQboConnectionFailure = _a.updateInvoicingQboConnectionFailure, exports.fetchInvoicingQboAccounts = _a.fetchInvoicingQboAccounts, exports.updateInvoicingQboAccounts = _a.updateInvoicingQboAccounts, exports.updateInvoicingQboAccountsFailure = _a.updateInvoicingQboAccountsFailure, exports.fetchInvoicingQboClasses = _a.fetchInvoicingQboClasses, exports.updateInvoicingQboClasses = _a.updateInvoicingQboClasses, exports.updateInvoicingQboClassesFailure = _a.updateInvoicingQboClassesFailure, exports.fetchInvoicingQboSyncHealth = _a.fetchInvoicingQboSyncHealth, exports.updateInvoicingQboSyncHealth = _a.updateInvoicingQboSyncHealth, exports.updateInvoicingQboSyncHealthFailure = _a.updateInvoicingQboSyncHealthFailure, exports.retryInvoicingQboSyncTask = _a.retryInvoicingQboSyncTask, exports.retryInvoicingQboSyncTaskSuccess = _a.retryInvoicingQboSyncTaskSuccess, exports.retryInvoicingQboSyncTaskFailure = _a.retryInvoicingQboSyncTaskFailure, exports.startInvoicingQboBackfill = _a.startInvoicingQboBackfill, exports.startInvoicingQboBackfillSuccess = _a.startInvoicingQboBackfillSuccess, exports.startInvoicingQboBackfillFailure = _a.startInvoicingQboBackfillFailure, exports.clearInvoicingQboView = _a.clearInvoicingQboView;
|
|
132
|
-
exports.default = invoicingQboView.reducer;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { FetchStateAndError } from '../../../commonStateTypes/common';
|
|
2
|
-
import { RootState } from '../../../reducer';
|
|
3
|
-
import { InvoicingQboAccountOption, InvoicingQboConnection, InvoicingQboSyncHealth } from './invoicingQboViewPayload';
|
|
4
|
-
export interface InvoicingQboView {
|
|
5
|
-
accountsByAccountTypes: Record<string, InvoicingQboAccountOption[]>;
|
|
6
|
-
accountsFetchStateByAccountTypes: Record<string, FetchStateAndError>;
|
|
7
|
-
backfillState: FetchStateAndError;
|
|
8
|
-
classes: InvoicingQboAccountOption[];
|
|
9
|
-
classesFetchState: FetchStateAndError;
|
|
10
|
-
connectionFetchState: FetchStateAndError;
|
|
11
|
-
retryFetchStateByTaskId: Record<string, FetchStateAndError>;
|
|
12
|
-
syncHealthFetchState: FetchStateAndError;
|
|
13
|
-
connection?: InvoicingQboConnection;
|
|
14
|
-
syncHealth?: InvoicingQboSyncHealth;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Single bundled view for the QBO integration settings screen — the
|
|
18
|
-
* connection, per-account-types account options, classes, sync health, and the
|
|
19
|
-
* fetch/action states for each of them.
|
|
20
|
-
*/
|
|
21
|
-
export declare const getInvoicingQboView: (state: RootState) => InvoicingQboView;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getInvoicingQboView = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Single bundled view for the QBO integration settings screen — the
|
|
6
|
-
* connection, per-account-types account options, classes, sync health, and the
|
|
7
|
-
* fetch/action states for each of them.
|
|
8
|
-
*/
|
|
9
|
-
const getInvoicingQboView = (state) => {
|
|
10
|
-
const qboState = state.invoicingQboViewState;
|
|
11
|
-
return {
|
|
12
|
-
accountsByAccountTypes: qboState.accountsByAccountTypes,
|
|
13
|
-
accountsFetchStateByAccountTypes: qboState.accountsFetchStateByAccountTypes,
|
|
14
|
-
backfillState: qboState.backfillFetchState,
|
|
15
|
-
classes: qboState.classes,
|
|
16
|
-
classesFetchState: qboState.classesFetchState,
|
|
17
|
-
connection: qboState.connection,
|
|
18
|
-
connectionFetchState: qboState.connectionFetchState,
|
|
19
|
-
retryFetchStateByTaskId: qboState.retryFetchStateByTaskId,
|
|
20
|
-
syncHealth: qboState.syncHealth,
|
|
21
|
-
syncHealthFetchState: qboState.syncHealthFetchState,
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
exports.getInvoicingQboView = getInvoicingQboView;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FetchStateAndError } from '../../../commonStateTypes/common';
|
|
2
|
-
import { InvoicingQboAccountOption, InvoicingQboConnection, InvoicingQboSyncHealth } from './invoicingQboViewPayload';
|
|
3
|
-
export interface InvoicingQboViewState {
|
|
4
|
-
accountsByAccountTypes: Record<string, InvoicingQboAccountOption[]>;
|
|
5
|
-
accountsFetchStateByAccountTypes: Record<string, FetchStateAndError>;
|
|
6
|
-
backfillFetchState: FetchStateAndError;
|
|
7
|
-
classes: InvoicingQboAccountOption[];
|
|
8
|
-
classesFetchState: FetchStateAndError;
|
|
9
|
-
connectionFetchState: FetchStateAndError;
|
|
10
|
-
retryFetchStateByTaskId: Record<string, FetchStateAndError>;
|
|
11
|
-
syncHealthFetchState: FetchStateAndError;
|
|
12
|
-
connection?: InvoicingQboConnection;
|
|
13
|
-
syncHealth?: InvoicingQboSyncHealth;
|
|
14
|
-
}
|