@solibo/solibo-query 1.46.2 → 1.50.0
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/dist/api/commands/company/createCompanyCustomerClaim.d.ts +1 -1
- package/dist/api/commands/invoicing/customerLedger.d.ts +31 -0
- package/dist/api/commands/invoicing/customerLedger.js +42 -0
- package/dist/api/commands/invoicing/financeInvalidations.d.ts +5 -0
- package/dist/api/commands/invoicing/financeInvalidations.js +20 -0
- package/dist/api/commands/invoicing/overdueDelays.d.ts +33 -0
- package/dist/api/commands/invoicing/overdueDelays.js +52 -0
- package/dist/api/commands/invoicing/paymentAllocation.d.ts +46 -0
- package/dist/api/commands/invoicing/paymentAllocation.js +63 -0
- package/dist/api/queries/invoicing/customerLedger.d.ts +39 -0
- package/dist/api/queries/invoicing/customerLedger.js +64 -0
- package/dist/api/queries/invoicing/customers.d.ts +3 -1
- package/dist/api/queries/invoicing/customers.js +4 -1
- package/dist/api/queries/invoicing/financeQueryIdentity.d.ts +2 -0
- package/dist/api/queries/invoicing/financeQueryIdentity.js +14 -0
- package/dist/api/queries/invoicing/invoicingKeys.d.ts +1 -1
- package/dist/api/queries/invoicing/invoicingKeys.js +2 -1
- package/dist/api/queries/invoicing/overdueDelays.d.ts +17 -0
- package/dist/api/queries/invoicing/overdueDelays.js +21 -0
- package/dist/api/queries/invoicing/paymentAllocation.d.ts +57 -0
- package/dist/api/queries/invoicing/paymentAllocation.js +89 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +6 -1
- package/package.json +2 -2
- package/dist/api/commands/invoicing/registerPayment.d.ts +0 -18
- package/dist/api/commands/invoicing/registerPayment.js +0 -40
|
@@ -7,6 +7,6 @@ export declare function createCompanyCustomerClaimMutationOptions(sdk: SoliboCli
|
|
|
7
7
|
customerType: string;
|
|
8
8
|
customerId: Id;
|
|
9
9
|
cmd: SdkInput<CreateCustomerClaimCommandProps>;
|
|
10
|
-
}) => Promise<import("@solibo/solibo-sdk").
|
|
10
|
+
}) => Promise<import("@solibo/solibo-sdk").CustomerClaimCreated>;
|
|
11
11
|
onSuccess: (_: any, params: any) => Promise<[void, void, void, void, void, void, void]>;
|
|
12
12
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { SoliboClient } from "@solibo/solibo-sdk/core";
|
|
2
|
+
import type { QueryClient } from "@tanstack/query-core";
|
|
3
|
+
import { createInvoicingCustomerLedgerClaim, uploadInvoicingCustomerLedgerClaimAttachment, previewInvoicingCustomerLedgerClaim, cancelInvoicingCustomerLedgerClaim, approveInvoicingCustomerLedgerPosting, revokeInvoicingCustomerLedgerPostingApproval } from "@solibo/solibo-sdk/invoicing/operations";
|
|
4
|
+
export declare function createInvoicingCustomerLedgerClaimMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
|
|
5
|
+
retry: false;
|
|
6
|
+
mutationFn: (params: Parameters<typeof createInvoicingCustomerLedgerClaim>[1]) => Promise<import("@solibo/solibo-sdk").CustomerLedgerClaimResult>;
|
|
7
|
+
onSuccess: () => Promise<[void, void]>;
|
|
8
|
+
};
|
|
9
|
+
export declare function uploadInvoicingCustomerLedgerClaimAttachmentMutationOptions(sdk: SoliboClient, _queryClient: QueryClient): {
|
|
10
|
+
retry: false;
|
|
11
|
+
mutationFn: (params: Parameters<typeof uploadInvoicingCustomerLedgerClaimAttachment>[1]) => Promise<import("@solibo/solibo-sdk").CustomerLedgerClaimAttachment>;
|
|
12
|
+
};
|
|
13
|
+
export declare function previewInvoicingCustomerLedgerClaimMutationOptions(sdk: SoliboClient, _queryClient: QueryClient): {
|
|
14
|
+
retry: false;
|
|
15
|
+
mutationFn: (params: Parameters<typeof previewInvoicingCustomerLedgerClaim>[1]) => Promise<import("@solibo/solibo-sdk").CustomerLedgerClaimPreview>;
|
|
16
|
+
};
|
|
17
|
+
export declare function cancelInvoicingCustomerLedgerClaimMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
|
|
18
|
+
retry: false;
|
|
19
|
+
mutationFn: (params: Parameters<typeof cancelInvoicingCustomerLedgerClaim>[1]) => Promise<void>;
|
|
20
|
+
onSuccess: () => Promise<[void, void]>;
|
|
21
|
+
};
|
|
22
|
+
export declare function approveInvoicingCustomerLedgerPostingMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
|
|
23
|
+
retry: false;
|
|
24
|
+
mutationFn: (params: Parameters<typeof approveInvoicingCustomerLedgerPosting>[1]) => Promise<import("@solibo/solibo-sdk").CustomerLedgerPostingApprovalResult>;
|
|
25
|
+
onSuccess: () => Promise<[void, void]>;
|
|
26
|
+
};
|
|
27
|
+
export declare function revokeInvoicingCustomerLedgerPostingApprovalMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
|
|
28
|
+
retry: false;
|
|
29
|
+
mutationFn: (params: Parameters<typeof revokeInvoicingCustomerLedgerPostingApproval>[1]) => Promise<import("@solibo/solibo-sdk").CustomerLedgerPostingApprovalResult>;
|
|
30
|
+
onSuccess: () => Promise<[void, void]>;
|
|
31
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createInvoicingCustomerLedgerClaim, uploadInvoicingCustomerLedgerClaimAttachment, previewInvoicingCustomerLedgerClaim, cancelInvoicingCustomerLedgerClaim, approveInvoicingCustomerLedgerPosting, revokeInvoicingCustomerLedgerPostingApproval, } from "@solibo/solibo-sdk/invoicing/operations";
|
|
2
|
+
import { invalidateFinanceQueries } from "./financeInvalidations.js";
|
|
3
|
+
export function createInvoicingCustomerLedgerClaimMutationOptions(sdk, queryClient) {
|
|
4
|
+
return {
|
|
5
|
+
retry: false,
|
|
6
|
+
mutationFn: (params) => createInvoicingCustomerLedgerClaim(sdk, params),
|
|
7
|
+
onSuccess: () => invalidateFinanceQueries(queryClient),
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export function uploadInvoicingCustomerLedgerClaimAttachmentMutationOptions(sdk, _queryClient) {
|
|
11
|
+
return {
|
|
12
|
+
retry: false,
|
|
13
|
+
mutationFn: (params) => uploadInvoicingCustomerLedgerClaimAttachment(sdk, params),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function previewInvoicingCustomerLedgerClaimMutationOptions(sdk, _queryClient) {
|
|
17
|
+
return {
|
|
18
|
+
retry: false,
|
|
19
|
+
mutationFn: (params) => previewInvoicingCustomerLedgerClaim(sdk, params),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export function cancelInvoicingCustomerLedgerClaimMutationOptions(sdk, queryClient) {
|
|
23
|
+
return {
|
|
24
|
+
retry: false,
|
|
25
|
+
mutationFn: (params) => cancelInvoicingCustomerLedgerClaim(sdk, params),
|
|
26
|
+
onSuccess: () => invalidateFinanceQueries(queryClient),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export function approveInvoicingCustomerLedgerPostingMutationOptions(sdk, queryClient) {
|
|
30
|
+
return {
|
|
31
|
+
retry: false,
|
|
32
|
+
mutationFn: (params) => approveInvoicingCustomerLedgerPosting(sdk, params),
|
|
33
|
+
onSuccess: () => invalidateFinanceQueries(queryClient),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export function revokeInvoicingCustomerLedgerPostingApprovalMutationOptions(sdk, queryClient) {
|
|
37
|
+
return {
|
|
38
|
+
retry: false,
|
|
39
|
+
mutationFn: (params) => revokeInvoicingCustomerLedgerPostingApproval(sdk, params),
|
|
40
|
+
onSuccess: () => invalidateFinanceQueries(queryClient),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { QueryClient } from "@tanstack/query-core";
|
|
2
|
+
/** Payment allocation, ledger balances and overdue state are shared across company and portfolio views. */
|
|
3
|
+
export declare function invalidateFinanceQueries(queryClient: QueryClient): Promise<[void, void]>;
|
|
4
|
+
/** A saved delay can reject while its provider reconciliation remains pending. */
|
|
5
|
+
export declare function isSavedOverdueDelayError(error: unknown): boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { invoicingKeys } from "../../queries/invoicing/invoicingKeys.js";
|
|
2
|
+
/** Payment allocation, ledger balances and overdue state are shared across company and portfolio views. */
|
|
3
|
+
export function invalidateFinanceQueries(queryClient) {
|
|
4
|
+
return Promise.all([
|
|
5
|
+
queryClient.invalidateQueries({ queryKey: [invoicingKeys.all] }),
|
|
6
|
+
queryClient.invalidateQueries({ queryKey: [["accounting"]] }),
|
|
7
|
+
]);
|
|
8
|
+
}
|
|
9
|
+
/** A saved delay can reject while its provider reconciliation remains pending. */
|
|
10
|
+
export function isSavedOverdueDelayError(error) {
|
|
11
|
+
if (error === null || typeof error !== "object")
|
|
12
|
+
return false;
|
|
13
|
+
const candidate = error;
|
|
14
|
+
return ((candidate.status ?? candidate.statusCode) === 503 &&
|
|
15
|
+
Array.isArray(candidate.errors) &&
|
|
16
|
+
candidate.errors.some((detail) => detail !== null &&
|
|
17
|
+
typeof detail === "object" &&
|
|
18
|
+
"code" in detail &&
|
|
19
|
+
detail.code === "OVERDUE_DELAY_PENDING_RECONCILIATION"));
|
|
20
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { SoliboClient } from "@solibo/solibo-sdk/core";
|
|
2
|
+
import type { QueryClient } from "@tanstack/query-core";
|
|
3
|
+
import { syncOverdueDelaysToGenghis, putCompanyInvoicesOverdueDelay, deleteCompanyInvoiceOverdueDelay, putCompanyInvoiceOverdueDelay, putCompanyInvoiceOverdueDelayEnd } from "@solibo/solibo-sdk/invoicing/operations";
|
|
4
|
+
export declare function syncOverdueDelaysToGenghisMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
|
|
5
|
+
retry: false;
|
|
6
|
+
mutationFn: (params: Parameters<typeof syncOverdueDelaysToGenghis>[1]) => Promise<import("@solibo/solibo-sdk").SyncOverdueDelaysResult>;
|
|
7
|
+
onSuccess: () => Promise<[void, void]>;
|
|
8
|
+
onError: (error: unknown) => Promise<[void, void]> | undefined;
|
|
9
|
+
};
|
|
10
|
+
export declare function putCompanyInvoicesOverdueDelayMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
|
|
11
|
+
retry: false;
|
|
12
|
+
mutationFn: (params: Parameters<typeof putCompanyInvoicesOverdueDelay>[1]) => Promise<import("@solibo/solibo-sdk").InvoiceOverdueDelay[]>;
|
|
13
|
+
onSuccess: () => Promise<[void, void]>;
|
|
14
|
+
onError: (error: unknown) => Promise<[void, void]> | undefined;
|
|
15
|
+
};
|
|
16
|
+
export declare function deleteCompanyInvoiceOverdueDelayMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
|
|
17
|
+
retry: false;
|
|
18
|
+
mutationFn: (params: Parameters<typeof deleteCompanyInvoiceOverdueDelay>[1]) => Promise<void>;
|
|
19
|
+
onSuccess: () => Promise<[void, void]>;
|
|
20
|
+
onError: (error: unknown) => Promise<[void, void]> | undefined;
|
|
21
|
+
};
|
|
22
|
+
export declare function putCompanyInvoiceOverdueDelayMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
|
|
23
|
+
retry: false;
|
|
24
|
+
mutationFn: (params: Parameters<typeof putCompanyInvoiceOverdueDelay>[1]) => Promise<import("@solibo/solibo-sdk").InvoiceOverdueDelay>;
|
|
25
|
+
onSuccess: () => Promise<[void, void]>;
|
|
26
|
+
onError: (error: unknown) => Promise<[void, void]> | undefined;
|
|
27
|
+
};
|
|
28
|
+
export declare function putCompanyInvoiceOverdueDelayEndMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
|
|
29
|
+
retry: false;
|
|
30
|
+
mutationFn: (params: Parameters<typeof putCompanyInvoiceOverdueDelayEnd>[1]) => Promise<import("@solibo/solibo-sdk").InvoiceOverdueDelay>;
|
|
31
|
+
onSuccess: () => Promise<[void, void]>;
|
|
32
|
+
onError: (error: unknown) => Promise<[void, void]> | undefined;
|
|
33
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { syncOverdueDelaysToGenghis, putCompanyInvoicesOverdueDelay, deleteCompanyInvoiceOverdueDelay, putCompanyInvoiceOverdueDelay, putCompanyInvoiceOverdueDelayEnd, } from "@solibo/solibo-sdk/invoicing/operations";
|
|
2
|
+
import { invalidateFinanceQueries, isSavedOverdueDelayError, } from "./financeInvalidations.js";
|
|
3
|
+
export function syncOverdueDelaysToGenghisMutationOptions(sdk, queryClient) {
|
|
4
|
+
return {
|
|
5
|
+
retry: false,
|
|
6
|
+
mutationFn: (params) => syncOverdueDelaysToGenghis(sdk, params),
|
|
7
|
+
onSuccess: () => invalidateFinanceQueries(queryClient),
|
|
8
|
+
onError: (error) => isSavedOverdueDelayError(error)
|
|
9
|
+
? invalidateFinanceQueries(queryClient)
|
|
10
|
+
: undefined,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export function putCompanyInvoicesOverdueDelayMutationOptions(sdk, queryClient) {
|
|
14
|
+
return {
|
|
15
|
+
retry: false,
|
|
16
|
+
mutationFn: (params) => putCompanyInvoicesOverdueDelay(sdk, params),
|
|
17
|
+
onSuccess: () => invalidateFinanceQueries(queryClient),
|
|
18
|
+
onError: (error) => isSavedOverdueDelayError(error)
|
|
19
|
+
? invalidateFinanceQueries(queryClient)
|
|
20
|
+
: undefined,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export function deleteCompanyInvoiceOverdueDelayMutationOptions(sdk, queryClient) {
|
|
24
|
+
return {
|
|
25
|
+
retry: false,
|
|
26
|
+
mutationFn: (params) => deleteCompanyInvoiceOverdueDelay(sdk, params),
|
|
27
|
+
onSuccess: () => invalidateFinanceQueries(queryClient),
|
|
28
|
+
onError: (error) => isSavedOverdueDelayError(error)
|
|
29
|
+
? invalidateFinanceQueries(queryClient)
|
|
30
|
+
: undefined,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export function putCompanyInvoiceOverdueDelayMutationOptions(sdk, queryClient) {
|
|
34
|
+
return {
|
|
35
|
+
retry: false,
|
|
36
|
+
mutationFn: (params) => putCompanyInvoiceOverdueDelay(sdk, params),
|
|
37
|
+
onSuccess: () => invalidateFinanceQueries(queryClient),
|
|
38
|
+
onError: (error) => isSavedOverdueDelayError(error)
|
|
39
|
+
? invalidateFinanceQueries(queryClient)
|
|
40
|
+
: undefined,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export function putCompanyInvoiceOverdueDelayEndMutationOptions(sdk, queryClient) {
|
|
44
|
+
return {
|
|
45
|
+
retry: false,
|
|
46
|
+
mutationFn: (params) => putCompanyInvoiceOverdueDelayEnd(sdk, params),
|
|
47
|
+
onSuccess: () => invalidateFinanceQueries(queryClient),
|
|
48
|
+
onError: (error) => isSavedOverdueDelayError(error)
|
|
49
|
+
? invalidateFinanceQueries(queryClient)
|
|
50
|
+
: undefined,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { SoliboClient } from "@solibo/solibo-sdk/core";
|
|
2
|
+
import type { QueryClient } from "@tanstack/query-core";
|
|
3
|
+
import { createCompanyManualPaymentSource, evaluateCompanyPaymentSourceAllocationDraft, finalizeCompanyPaymentSourceAllocation, previewCompanyPaymentSourceAllocation, closeCompanyPaymentSource, reallocateCompanyPaymentSource, reconcileCompanyPaymentSourceAllocation, retryCompanyPaymentSourceAllocation, reverseCompanyPaymentSourceAllocation } from "@solibo/solibo-sdk/paymentAllocation/operations";
|
|
4
|
+
export declare function createCompanyManualPaymentSourceMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
|
|
5
|
+
retry: false;
|
|
6
|
+
mutationFn: (params: Parameters<typeof createCompanyManualPaymentSource>[1]) => Promise<import("@solibo/solibo-sdk").PaymentSource>;
|
|
7
|
+
onSuccess: () => Promise<[void, void]>;
|
|
8
|
+
};
|
|
9
|
+
export declare function evaluateCompanyPaymentSourceAllocationDraftMutationOptions(sdk: SoliboClient, _queryClient: QueryClient): {
|
|
10
|
+
retry: false;
|
|
11
|
+
mutationFn: (params: Parameters<typeof evaluateCompanyPaymentSourceAllocationDraft>[1]) => Promise<import("@solibo/solibo-sdk").PaymentAllocationDraft>;
|
|
12
|
+
};
|
|
13
|
+
export declare function finalizeCompanyPaymentSourceAllocationMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
|
|
14
|
+
retry: false;
|
|
15
|
+
mutationFn: (params: Parameters<typeof finalizeCompanyPaymentSourceAllocation>[1]) => Promise<import("@solibo/solibo-sdk").PaymentAllocationCommand>;
|
|
16
|
+
onSuccess: () => Promise<[void, void]>;
|
|
17
|
+
};
|
|
18
|
+
export declare function previewCompanyPaymentSourceAllocationMutationOptions(sdk: SoliboClient, _queryClient: QueryClient): {
|
|
19
|
+
retry: false;
|
|
20
|
+
mutationFn: (params: Parameters<typeof previewCompanyPaymentSourceAllocation>[1]) => Promise<import("@solibo/solibo-sdk").PaymentAllocationPreview>;
|
|
21
|
+
};
|
|
22
|
+
export declare function closeCompanyPaymentSourceMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
|
|
23
|
+
retry: false;
|
|
24
|
+
mutationFn: (params: Parameters<typeof closeCompanyPaymentSource>[1]) => Promise<import("@solibo/solibo-sdk").PaymentAllocationCommand>;
|
|
25
|
+
onSuccess: () => Promise<[void, void]>;
|
|
26
|
+
};
|
|
27
|
+
export declare function reallocateCompanyPaymentSourceMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
|
|
28
|
+
retry: false;
|
|
29
|
+
mutationFn: (params: Parameters<typeof reallocateCompanyPaymentSource>[1]) => Promise<import("@solibo/solibo-sdk").PaymentAllocationCommand>;
|
|
30
|
+
onSuccess: () => Promise<[void, void]>;
|
|
31
|
+
};
|
|
32
|
+
export declare function reconcileCompanyPaymentSourceAllocationMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
|
|
33
|
+
retry: false;
|
|
34
|
+
mutationFn: (params: Parameters<typeof reconcileCompanyPaymentSourceAllocation>[1]) => Promise<import("@solibo/solibo-sdk").PaymentAllocationCommand>;
|
|
35
|
+
onSuccess: () => Promise<[void, void]>;
|
|
36
|
+
};
|
|
37
|
+
export declare function retryCompanyPaymentSourceAllocationMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
|
|
38
|
+
retry: false;
|
|
39
|
+
mutationFn: (params: Parameters<typeof retryCompanyPaymentSourceAllocation>[1]) => Promise<import("@solibo/solibo-sdk").PaymentAllocationCommand>;
|
|
40
|
+
onSuccess: () => Promise<[void, void]>;
|
|
41
|
+
};
|
|
42
|
+
export declare function reverseCompanyPaymentSourceAllocationMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
|
|
43
|
+
retry: false;
|
|
44
|
+
mutationFn: (params: Parameters<typeof reverseCompanyPaymentSourceAllocation>[1]) => Promise<import("@solibo/solibo-sdk").PaymentAllocationCommand>;
|
|
45
|
+
onSuccess: () => Promise<[void, void]>;
|
|
46
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { createCompanyManualPaymentSource, evaluateCompanyPaymentSourceAllocationDraft, finalizeCompanyPaymentSourceAllocation, previewCompanyPaymentSourceAllocation, closeCompanyPaymentSource, reallocateCompanyPaymentSource, reconcileCompanyPaymentSourceAllocation, retryCompanyPaymentSourceAllocation, reverseCompanyPaymentSourceAllocation, } from "@solibo/solibo-sdk/paymentAllocation/operations";
|
|
2
|
+
import { invalidateFinanceQueries } from "./financeInvalidations.js";
|
|
3
|
+
export function createCompanyManualPaymentSourceMutationOptions(sdk, queryClient) {
|
|
4
|
+
return {
|
|
5
|
+
retry: false,
|
|
6
|
+
mutationFn: (params) => createCompanyManualPaymentSource(sdk, params),
|
|
7
|
+
onSuccess: () => invalidateFinanceQueries(queryClient),
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export function evaluateCompanyPaymentSourceAllocationDraftMutationOptions(sdk, _queryClient) {
|
|
11
|
+
return {
|
|
12
|
+
retry: false,
|
|
13
|
+
mutationFn: (params) => evaluateCompanyPaymentSourceAllocationDraft(sdk, params),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function finalizeCompanyPaymentSourceAllocationMutationOptions(sdk, queryClient) {
|
|
17
|
+
return {
|
|
18
|
+
retry: false,
|
|
19
|
+
mutationFn: (params) => finalizeCompanyPaymentSourceAllocation(sdk, params),
|
|
20
|
+
onSuccess: () => invalidateFinanceQueries(queryClient),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export function previewCompanyPaymentSourceAllocationMutationOptions(sdk, _queryClient) {
|
|
24
|
+
return {
|
|
25
|
+
retry: false,
|
|
26
|
+
mutationFn: (params) => previewCompanyPaymentSourceAllocation(sdk, params),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export function closeCompanyPaymentSourceMutationOptions(sdk, queryClient) {
|
|
30
|
+
return {
|
|
31
|
+
retry: false,
|
|
32
|
+
mutationFn: (params) => closeCompanyPaymentSource(sdk, params),
|
|
33
|
+
onSuccess: () => invalidateFinanceQueries(queryClient),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export function reallocateCompanyPaymentSourceMutationOptions(sdk, queryClient) {
|
|
37
|
+
return {
|
|
38
|
+
retry: false,
|
|
39
|
+
mutationFn: (params) => reallocateCompanyPaymentSource(sdk, params),
|
|
40
|
+
onSuccess: () => invalidateFinanceQueries(queryClient),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export function reconcileCompanyPaymentSourceAllocationMutationOptions(sdk, queryClient) {
|
|
44
|
+
return {
|
|
45
|
+
retry: false,
|
|
46
|
+
mutationFn: (params) => reconcileCompanyPaymentSourceAllocation(sdk, params),
|
|
47
|
+
onSuccess: () => invalidateFinanceQueries(queryClient),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export function retryCompanyPaymentSourceAllocationMutationOptions(sdk, queryClient) {
|
|
51
|
+
return {
|
|
52
|
+
retry: false,
|
|
53
|
+
mutationFn: (params) => retryCompanyPaymentSourceAllocation(sdk, params),
|
|
54
|
+
onSuccess: () => invalidateFinanceQueries(queryClient),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export function reverseCompanyPaymentSourceAllocationMutationOptions(sdk, queryClient) {
|
|
58
|
+
return {
|
|
59
|
+
retry: false,
|
|
60
|
+
mutationFn: (params) => reverseCompanyPaymentSourceAllocation(sdk, params),
|
|
61
|
+
onSuccess: () => invalidateFinanceQueries(queryClient),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { SoliboClient } from "@solibo/solibo-sdk/core";
|
|
2
|
+
import { showInvoicingCompanyCustomerLedger, showInvoicingCompanyCustomerLedgerSummary, showInvoicingCustomerLedger, showInvoicingCustomerInvoiceSummary } from "@solibo/solibo-sdk/invoicing/operations";
|
|
3
|
+
import { nextPageParam, prevPageParam } from "../../../utils/pageUtils.js";
|
|
4
|
+
export type ShowInvoicingCompanyCustomerLedgerParams = Parameters<typeof showInvoicingCompanyCustomerLedger>[1];
|
|
5
|
+
export type ShowInvoicingCompanyCustomerLedgerSummaryParams = Parameters<typeof showInvoicingCompanyCustomerLedgerSummary>[1];
|
|
6
|
+
export type ShowInvoicingCustomerLedgerParams = Parameters<typeof showInvoicingCustomerLedger>[1];
|
|
7
|
+
export type ShowInvoicingCustomerInvoiceSummaryParams = Parameters<typeof showInvoicingCustomerInvoiceSummary>[1];
|
|
8
|
+
export declare const customerLedgerKeys: {
|
|
9
|
+
all: readonly ["invoicing", "customerLedger"];
|
|
10
|
+
showInvoicingCompanyCustomerLedger: (params?: ShowInvoicingCompanyCustomerLedgerParams) => readonly ["invoicing", "customerLedger", "showInvoicingCompanyCustomerLedger", unknown];
|
|
11
|
+
showInvoicingCompanyCustomerLedgerSummary: (params?: ShowInvoicingCompanyCustomerLedgerSummaryParams) => readonly ["invoicing", "customerLedger", "showInvoicingCompanyCustomerLedgerSummary", unknown];
|
|
12
|
+
showInvoicingCustomerLedger: (params?: ShowInvoicingCustomerLedgerParams) => readonly ["invoicing", "customerLedger", "showInvoicingCustomerLedger", unknown];
|
|
13
|
+
showInvoicingCustomerInvoiceSummary: (params?: ShowInvoicingCustomerInvoiceSummaryParams) => readonly ["invoicing", "customerLedger", "showInvoicingCustomerInvoiceSummary", unknown];
|
|
14
|
+
};
|
|
15
|
+
export declare function showInvoicingCompanyCustomerLedgerQueryOptions(sdk: SoliboClient, params: ShowInvoicingCompanyCustomerLedgerParams): {
|
|
16
|
+
initialPageParam: string | undefined;
|
|
17
|
+
queryKey: (readonly ["invoicing", "customerLedger", "showInvoicingCompanyCustomerLedger", unknown])[];
|
|
18
|
+
queryFn: ({ pageParam }: {
|
|
19
|
+
pageParam: string | undefined;
|
|
20
|
+
}) => Promise<import("@solibo/solibo-sdk").PagedListCompanyCustomerLedgerEntry>;
|
|
21
|
+
getNextPageParam: typeof nextPageParam;
|
|
22
|
+
getPreviousPageParam: typeof prevPageParam;
|
|
23
|
+
};
|
|
24
|
+
export declare function showInvoicingCompanyCustomerLedgerSummaryQueryOptions(sdk: SoliboClient, params: ShowInvoicingCompanyCustomerLedgerSummaryParams): {
|
|
25
|
+
queryKey: (readonly ["invoicing", "customerLedger", "showInvoicingCompanyCustomerLedgerSummary", unknown])[];
|
|
26
|
+
queryFn: () => Promise<import("@solibo/solibo-sdk").CompanyCustomerLedgerSummary>;
|
|
27
|
+
};
|
|
28
|
+
export declare function showInvoicingCustomerLedgerQueryOptions(sdk: SoliboClient, params: ShowInvoicingCustomerLedgerParams): {
|
|
29
|
+
initialPageParam: string | undefined;
|
|
30
|
+
queryKey: (readonly ["invoicing", "customerLedger", "showInvoicingCustomerLedger", unknown])[];
|
|
31
|
+
queryFn: ({ pageParam }: {
|
|
32
|
+
pageParam: string | undefined;
|
|
33
|
+
}) => Promise<import("@solibo/solibo-sdk").CustomerLedger>;
|
|
34
|
+
getNextPageParam: (lastPage: Awaited<ReturnType<typeof showInvoicingCustomerLedger>>) => string | undefined;
|
|
35
|
+
};
|
|
36
|
+
export declare function showInvoicingCustomerInvoiceSummaryQueryOptions(sdk: SoliboClient, params: ShowInvoicingCustomerInvoiceSummaryParams): {
|
|
37
|
+
queryKey: (readonly ["invoicing", "customerLedger", "showInvoicingCustomerInvoiceSummary", unknown])[];
|
|
38
|
+
queryFn: () => Promise<import("@solibo/solibo-sdk").CustomerInvoiceSummary>;
|
|
39
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { showInvoicingCompanyCustomerLedger, showInvoicingCompanyCustomerLedgerSummary, showInvoicingCustomerLedger, showInvoicingCustomerInvoiceSummary, } from "@solibo/solibo-sdk/invoicing/operations";
|
|
2
|
+
import { nextPageParam, prevPageParam } from "../../../utils/pageUtils.js";
|
|
3
|
+
import { trimTrailingUndefined } from "../../../utils/queryKeys.js";
|
|
4
|
+
import { financeQueryIdentity } from "./financeQueryIdentity.js";
|
|
5
|
+
export const customerLedgerKeys = {
|
|
6
|
+
all: ["invoicing", "customerLedger"],
|
|
7
|
+
showInvoicingCompanyCustomerLedger: (params) => trimTrailingUndefined([
|
|
8
|
+
...customerLedgerKeys.all,
|
|
9
|
+
"showInvoicingCompanyCustomerLedger",
|
|
10
|
+
params === undefined ? undefined : financeQueryIdentity(params),
|
|
11
|
+
]),
|
|
12
|
+
showInvoicingCompanyCustomerLedgerSummary: (params) => trimTrailingUndefined([
|
|
13
|
+
...customerLedgerKeys.all,
|
|
14
|
+
"showInvoicingCompanyCustomerLedgerSummary",
|
|
15
|
+
params === undefined ? undefined : financeQueryIdentity(params),
|
|
16
|
+
]),
|
|
17
|
+
showInvoicingCustomerLedger: (params) => trimTrailingUndefined([
|
|
18
|
+
...customerLedgerKeys.all,
|
|
19
|
+
"showInvoicingCustomerLedger",
|
|
20
|
+
params === undefined ? undefined : financeQueryIdentity(params),
|
|
21
|
+
]),
|
|
22
|
+
showInvoicingCustomerInvoiceSummary: (params) => trimTrailingUndefined([
|
|
23
|
+
...customerLedgerKeys.all,
|
|
24
|
+
"showInvoicingCustomerInvoiceSummary",
|
|
25
|
+
params === undefined ? undefined : financeQueryIdentity(params),
|
|
26
|
+
]),
|
|
27
|
+
};
|
|
28
|
+
export function showInvoicingCompanyCustomerLedgerQueryOptions(sdk, params) {
|
|
29
|
+
return {
|
|
30
|
+
initialPageParam: params.pageToken ?? undefined,
|
|
31
|
+
queryKey: [customerLedgerKeys.showInvoicingCompanyCustomerLedger(params)],
|
|
32
|
+
queryFn: ({ pageParam }) => showInvoicingCompanyCustomerLedger(sdk, {
|
|
33
|
+
...params,
|
|
34
|
+
pageToken: pageParam,
|
|
35
|
+
}),
|
|
36
|
+
getNextPageParam: nextPageParam,
|
|
37
|
+
getPreviousPageParam: prevPageParam,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export function showInvoicingCompanyCustomerLedgerSummaryQueryOptions(sdk, params) {
|
|
41
|
+
return {
|
|
42
|
+
queryKey: [
|
|
43
|
+
customerLedgerKeys.showInvoicingCompanyCustomerLedgerSummary(params),
|
|
44
|
+
],
|
|
45
|
+
queryFn: () => showInvoicingCompanyCustomerLedgerSummary(sdk, params),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export function showInvoicingCustomerLedgerQueryOptions(sdk, params) {
|
|
49
|
+
return {
|
|
50
|
+
initialPageParam: params.pageToken ?? undefined,
|
|
51
|
+
queryKey: [customerLedgerKeys.showInvoicingCustomerLedger(params)],
|
|
52
|
+
queryFn: ({ pageParam }) => showInvoicingCustomerLedger(sdk, { ...params, pageToken: pageParam }),
|
|
53
|
+
getNextPageParam: (lastPage) => {
|
|
54
|
+
const token = lastPage.nextPageToken;
|
|
55
|
+
return token == null || token === "END_OF_LIST" ? undefined : token;
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export function showInvoicingCustomerInvoiceSummaryQueryOptions(sdk, params) {
|
|
60
|
+
return {
|
|
61
|
+
queryKey: [customerLedgerKeys.showInvoicingCustomerInvoiceSummary(params)],
|
|
62
|
+
queryFn: () => showInvoicingCustomerInvoiceSummary(sdk, params),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import type { Id } from "@solibo/solibo-sdk";
|
|
2
2
|
import { SoliboClient } from "@solibo/solibo-sdk/core";
|
|
3
3
|
import { nextPageParam, prevPageParam } from "../../../utils/pageUtils.js";
|
|
4
|
+
import { indexInvoicingCustomers } from "@solibo/solibo-sdk/invoicing/operations";
|
|
4
5
|
export declare function customersQueryOptions(sdk: SoliboClient, params: {
|
|
5
6
|
companyId?: Id | null | undefined;
|
|
7
|
+
search?: Parameters<typeof indexInvoicingCustomers>[1]["search"];
|
|
6
8
|
fields?: string;
|
|
7
9
|
pageToken?: string;
|
|
8
10
|
autoPaginate?: boolean | null;
|
|
9
11
|
count?: number;
|
|
10
12
|
}): {
|
|
11
13
|
initialPageParam: string | undefined;
|
|
12
|
-
queryKey: (string | number | readonly ["invoicing", "customers", string | number | null | undefined] | undefined)[];
|
|
14
|
+
queryKey: (string | number | boolean | readonly ["invoicing", "customers", string | number | null | undefined, string | null | undefined] | null | undefined)[];
|
|
13
15
|
queryFn: ({ pageParam }: {
|
|
14
16
|
pageParam: any;
|
|
15
17
|
}) => Promise<import("@solibo/solibo-sdk").PagedListCustomer>;
|
|
@@ -5,12 +5,15 @@ export function customersQueryOptions(sdk, params) {
|
|
|
5
5
|
return {
|
|
6
6
|
initialPageParam: params.pageToken,
|
|
7
7
|
queryKey: [
|
|
8
|
-
invoicingKeys.customers(params.companyId),
|
|
8
|
+
invoicingKeys.customers(params.companyId, params.search),
|
|
9
9
|
params.fields,
|
|
10
10
|
params.count,
|
|
11
|
+
params.pageToken,
|
|
12
|
+
params.autoPaginate,
|
|
11
13
|
],
|
|
12
14
|
queryFn: ({ pageParam }) => indexInvoicingCustomers(sdk, {
|
|
13
15
|
companyId: params.companyId,
|
|
16
|
+
search: params.search,
|
|
14
17
|
fields: params.fields,
|
|
15
18
|
pageToken: pageParam,
|
|
16
19
|
autoPaginate: params.autoPaginate,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Canonicalizes IDs without interpreting opaque cursors, filters or selections. */
|
|
2
|
+
export function financeQueryIdentity(value) {
|
|
3
|
+
if (typeof value === "bigint" || typeof value === "number")
|
|
4
|
+
return value.toString();
|
|
5
|
+
if (Array.isArray(value))
|
|
6
|
+
return value.map(financeQueryIdentity);
|
|
7
|
+
if (value !== null && typeof value === "object") {
|
|
8
|
+
return Object.fromEntries(Object.entries(value).map(([key, item]) => [
|
|
9
|
+
key,
|
|
10
|
+
financeQueryIdentity(item),
|
|
11
|
+
]));
|
|
12
|
+
}
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CustomerType, ExpiredType, Id, InvoicePlanType, PayerType } from "@solibo/solibo-sdk";
|
|
2
2
|
export declare const invoicingKeys: {
|
|
3
3
|
all: readonly ["invoicing"];
|
|
4
|
-
customers: (companyId?: Id | null | undefined) => readonly ["invoicing", "customers", string | number | null | undefined];
|
|
4
|
+
customers: (companyId?: Id | null | undefined, search?: string | null) => readonly ["invoicing", "customers", string | number | null | undefined, string | null | undefined];
|
|
5
5
|
customerDetail: (companyId?: Id | null | undefined, customerId?: Id | null | undefined, type?: CustomerType) => readonly ["invoicing", "customerDetail", string | number | null | undefined, string | number | null | undefined, CustomerType | undefined];
|
|
6
6
|
customerInvoices: (companyId?: Id | null | undefined, customerId?: Id | null | undefined) => readonly ["invoicing", "customerInvoices", string | number | null | undefined, string | number | null | undefined];
|
|
7
7
|
customerMeta: (companyId?: Id | null | undefined, customerId?: Id | null | undefined) => readonly ["invoicing", "customerMeta", string | number | null | undefined, string | number | null | undefined];
|
|
@@ -3,10 +3,11 @@ import { trimTrailingUndefined } from "../../../utils/queryKeys.js";
|
|
|
3
3
|
export const invoicingKeys = {
|
|
4
4
|
all: ["invoicing"],
|
|
5
5
|
// Customers
|
|
6
|
-
customers: (companyId) => trimTrailingUndefined([
|
|
6
|
+
customers: (companyId, search) => trimTrailingUndefined([
|
|
7
7
|
...invoicingKeys.all,
|
|
8
8
|
"customers",
|
|
9
9
|
toKeyId(companyId),
|
|
10
|
+
search,
|
|
10
11
|
]),
|
|
11
12
|
customerDetail: (companyId, customerId, type) => trimTrailingUndefined([
|
|
12
13
|
...invoicingKeys.all,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SoliboClient } from "@solibo/solibo-sdk/core";
|
|
2
|
+
import { indexOverdueDelaysForCompanies } from "@solibo/solibo-sdk/invoicing/operations";
|
|
3
|
+
import { nextPageParam, prevPageParam } from "../../../utils/pageUtils.js";
|
|
4
|
+
export type IndexOverdueDelaysForCompaniesParams = Parameters<typeof indexOverdueDelaysForCompanies>[1];
|
|
5
|
+
export declare const overdueDelayKeys: {
|
|
6
|
+
all: readonly ["invoicing", "overdueDelays"];
|
|
7
|
+
indexOverdueDelaysForCompanies: (params?: IndexOverdueDelaysForCompaniesParams) => readonly ["invoicing", "overdueDelays", "indexOverdueDelaysForCompanies", unknown];
|
|
8
|
+
};
|
|
9
|
+
export declare function indexOverdueDelaysForCompaniesQueryOptions(sdk: SoliboClient, params: IndexOverdueDelaysForCompaniesParams): {
|
|
10
|
+
initialPageParam: string | undefined;
|
|
11
|
+
queryKey: (readonly ["invoicing", "overdueDelays", "indexOverdueDelaysForCompanies", unknown])[];
|
|
12
|
+
queryFn: ({ pageParam }: {
|
|
13
|
+
pageParam: string | undefined;
|
|
14
|
+
}) => Promise<import("@solibo/solibo-sdk").PagedListOverdueDelayListItem>;
|
|
15
|
+
getNextPageParam: typeof nextPageParam;
|
|
16
|
+
getPreviousPageParam: typeof prevPageParam;
|
|
17
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { indexOverdueDelaysForCompanies } from "@solibo/solibo-sdk/invoicing/operations";
|
|
2
|
+
import { nextPageParam, prevPageParam } from "../../../utils/pageUtils.js";
|
|
3
|
+
import { trimTrailingUndefined } from "../../../utils/queryKeys.js";
|
|
4
|
+
import { financeQueryIdentity } from "./financeQueryIdentity.js";
|
|
5
|
+
export const overdueDelayKeys = {
|
|
6
|
+
all: ["invoicing", "overdueDelays"],
|
|
7
|
+
indexOverdueDelaysForCompanies: (params) => trimTrailingUndefined([
|
|
8
|
+
...overdueDelayKeys.all,
|
|
9
|
+
"indexOverdueDelaysForCompanies",
|
|
10
|
+
params === undefined ? undefined : financeQueryIdentity(params),
|
|
11
|
+
]),
|
|
12
|
+
};
|
|
13
|
+
export function indexOverdueDelaysForCompaniesQueryOptions(sdk, params) {
|
|
14
|
+
return {
|
|
15
|
+
initialPageParam: params.pageToken ?? undefined,
|
|
16
|
+
queryKey: [overdueDelayKeys.indexOverdueDelaysForCompanies(params)],
|
|
17
|
+
queryFn: ({ pageParam }) => indexOverdueDelaysForCompanies(sdk, { ...params, pageToken: pageParam }),
|
|
18
|
+
getNextPageParam: nextPageParam,
|
|
19
|
+
getPreviousPageParam: prevPageParam,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { SoliboClient } from "@solibo/solibo-sdk/core";
|
|
2
|
+
import { indexPaymentSourcesForCompanies, indexCompanyPaymentSources, showCompanyPaymentSourceReadStatus, showCompanyPaymentSource, indexCompanyPaymentSourceHistory, indexCompanyPaymentSourceInvoiceCandidates } from "@solibo/solibo-sdk/paymentAllocation/operations";
|
|
3
|
+
import { nextPageParam, prevPageParam } from "../../../utils/pageUtils.js";
|
|
4
|
+
export type IndexPaymentSourcesForCompaniesParams = Parameters<typeof indexPaymentSourcesForCompanies>[1];
|
|
5
|
+
export type IndexCompanyPaymentSourcesParams = Parameters<typeof indexCompanyPaymentSources>[1];
|
|
6
|
+
export type ShowCompanyPaymentSourceReadStatusParams = Parameters<typeof showCompanyPaymentSourceReadStatus>[1];
|
|
7
|
+
export type ShowCompanyPaymentSourceParams = Parameters<typeof showCompanyPaymentSource>[1];
|
|
8
|
+
export type IndexCompanyPaymentSourceHistoryParams = Parameters<typeof indexCompanyPaymentSourceHistory>[1];
|
|
9
|
+
export type IndexCompanyPaymentSourceInvoiceCandidatesParams = Parameters<typeof indexCompanyPaymentSourceInvoiceCandidates>[1];
|
|
10
|
+
export declare const paymentAllocationKeys: {
|
|
11
|
+
all: readonly ["invoicing", "paymentAllocation"];
|
|
12
|
+
indexPaymentSourcesForCompanies: (params?: IndexPaymentSourcesForCompaniesParams) => readonly ["invoicing", "paymentAllocation", "indexPaymentSourcesForCompanies", unknown];
|
|
13
|
+
indexCompanyPaymentSources: (params?: IndexCompanyPaymentSourcesParams) => readonly ["invoicing", "paymentAllocation", "indexCompanyPaymentSources", unknown];
|
|
14
|
+
showCompanyPaymentSourceReadStatus: (params?: ShowCompanyPaymentSourceReadStatusParams) => readonly ["invoicing", "paymentAllocation", "showCompanyPaymentSourceReadStatus", unknown];
|
|
15
|
+
showCompanyPaymentSource: (params?: ShowCompanyPaymentSourceParams) => readonly ["invoicing", "paymentAllocation", "showCompanyPaymentSource", unknown];
|
|
16
|
+
indexCompanyPaymentSourceHistory: (params?: IndexCompanyPaymentSourceHistoryParams) => readonly ["invoicing", "paymentAllocation", "indexCompanyPaymentSourceHistory", unknown];
|
|
17
|
+
indexCompanyPaymentSourceInvoiceCandidates: (params?: IndexCompanyPaymentSourceInvoiceCandidatesParams) => readonly ["invoicing", "paymentAllocation", "indexCompanyPaymentSourceInvoiceCandidates", unknown];
|
|
18
|
+
};
|
|
19
|
+
export declare function indexPaymentSourcesForCompaniesQueryOptions(sdk: SoliboClient, params: IndexPaymentSourcesForCompaniesParams): {
|
|
20
|
+
initialPageParam: string | undefined;
|
|
21
|
+
queryKey: (readonly ["invoicing", "paymentAllocation", "indexPaymentSourcesForCompanies", unknown])[];
|
|
22
|
+
queryFn: ({ pageParam }: {
|
|
23
|
+
pageParam: string | undefined;
|
|
24
|
+
}) => Promise<import("@solibo/solibo-sdk").PagedListCompanyPaymentSourceListItem>;
|
|
25
|
+
getNextPageParam: typeof nextPageParam;
|
|
26
|
+
getPreviousPageParam: typeof prevPageParam;
|
|
27
|
+
};
|
|
28
|
+
export declare function indexCompanyPaymentSourcesQueryOptions(sdk: SoliboClient, params: IndexCompanyPaymentSourcesParams): {
|
|
29
|
+
initialPageParam: string | undefined;
|
|
30
|
+
queryKey: (readonly ["invoicing", "paymentAllocation", "indexCompanyPaymentSources", unknown])[];
|
|
31
|
+
queryFn: ({ pageParam }: {
|
|
32
|
+
pageParam: string | undefined;
|
|
33
|
+
}) => Promise<import("@solibo/solibo-sdk").PagedListPaymentSourceListItem>;
|
|
34
|
+
getNextPageParam: typeof nextPageParam;
|
|
35
|
+
getPreviousPageParam: typeof prevPageParam;
|
|
36
|
+
};
|
|
37
|
+
export declare function showCompanyPaymentSourceReadStatusQueryOptions(sdk: SoliboClient, params: ShowCompanyPaymentSourceReadStatusParams): {
|
|
38
|
+
queryKey: (readonly ["invoicing", "paymentAllocation", "showCompanyPaymentSourceReadStatus", unknown])[];
|
|
39
|
+
queryFn: () => Promise<import("@solibo/solibo-sdk").PaymentSourceReadStatus>;
|
|
40
|
+
};
|
|
41
|
+
export declare function showCompanyPaymentSourceQueryOptions(sdk: SoliboClient, params: ShowCompanyPaymentSourceParams): {
|
|
42
|
+
queryKey: (readonly ["invoicing", "paymentAllocation", "showCompanyPaymentSource", unknown])[];
|
|
43
|
+
queryFn: () => Promise<import("@solibo/solibo-sdk").PaymentSource>;
|
|
44
|
+
};
|
|
45
|
+
export declare function indexCompanyPaymentSourceHistoryQueryOptions(sdk: SoliboClient, params: IndexCompanyPaymentSourceHistoryParams): {
|
|
46
|
+
queryKey: (readonly ["invoicing", "paymentAllocation", "indexCompanyPaymentSourceHistory", unknown])[];
|
|
47
|
+
queryFn: () => Promise<import("@solibo/solibo-sdk").PaymentAllocationHistory>;
|
|
48
|
+
};
|
|
49
|
+
export declare function indexCompanyPaymentSourceInvoiceCandidatesQueryOptions(sdk: SoliboClient, params: IndexCompanyPaymentSourceInvoiceCandidatesParams): {
|
|
50
|
+
initialPageParam: string | undefined;
|
|
51
|
+
queryKey: (readonly ["invoicing", "paymentAllocation", "indexCompanyPaymentSourceInvoiceCandidates", unknown])[];
|
|
52
|
+
queryFn: ({ pageParam }: {
|
|
53
|
+
pageParam: string | undefined;
|
|
54
|
+
}) => Promise<import("@solibo/solibo-sdk").PagedListPaymentAllocationInvoiceCandidate>;
|
|
55
|
+
getNextPageParam: typeof nextPageParam;
|
|
56
|
+
getPreviousPageParam: typeof prevPageParam;
|
|
57
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { indexPaymentSourcesForCompanies, indexCompanyPaymentSources, showCompanyPaymentSourceReadStatus, showCompanyPaymentSource, indexCompanyPaymentSourceHistory, indexCompanyPaymentSourceInvoiceCandidates, } from "@solibo/solibo-sdk/paymentAllocation/operations";
|
|
2
|
+
import { nextPageParam, prevPageParam } from "../../../utils/pageUtils.js";
|
|
3
|
+
import { trimTrailingUndefined } from "../../../utils/queryKeys.js";
|
|
4
|
+
import { financeQueryIdentity } from "./financeQueryIdentity.js";
|
|
5
|
+
export const paymentAllocationKeys = {
|
|
6
|
+
all: ["invoicing", "paymentAllocation"],
|
|
7
|
+
indexPaymentSourcesForCompanies: (params) => trimTrailingUndefined([
|
|
8
|
+
...paymentAllocationKeys.all,
|
|
9
|
+
"indexPaymentSourcesForCompanies",
|
|
10
|
+
params === undefined ? undefined : financeQueryIdentity(params),
|
|
11
|
+
]),
|
|
12
|
+
indexCompanyPaymentSources: (params) => trimTrailingUndefined([
|
|
13
|
+
...paymentAllocationKeys.all,
|
|
14
|
+
"indexCompanyPaymentSources",
|
|
15
|
+
params === undefined ? undefined : financeQueryIdentity(params),
|
|
16
|
+
]),
|
|
17
|
+
showCompanyPaymentSourceReadStatus: (params) => trimTrailingUndefined([
|
|
18
|
+
...paymentAllocationKeys.all,
|
|
19
|
+
"showCompanyPaymentSourceReadStatus",
|
|
20
|
+
params === undefined ? undefined : financeQueryIdentity(params),
|
|
21
|
+
]),
|
|
22
|
+
showCompanyPaymentSource: (params) => trimTrailingUndefined([
|
|
23
|
+
...paymentAllocationKeys.all,
|
|
24
|
+
"showCompanyPaymentSource",
|
|
25
|
+
params === undefined ? undefined : financeQueryIdentity(params),
|
|
26
|
+
]),
|
|
27
|
+
indexCompanyPaymentSourceHistory: (params) => trimTrailingUndefined([
|
|
28
|
+
...paymentAllocationKeys.all,
|
|
29
|
+
"indexCompanyPaymentSourceHistory",
|
|
30
|
+
params === undefined ? undefined : financeQueryIdentity(params),
|
|
31
|
+
]),
|
|
32
|
+
indexCompanyPaymentSourceInvoiceCandidates: (params) => trimTrailingUndefined([
|
|
33
|
+
...paymentAllocationKeys.all,
|
|
34
|
+
"indexCompanyPaymentSourceInvoiceCandidates",
|
|
35
|
+
params === undefined ? undefined : financeQueryIdentity(params),
|
|
36
|
+
]),
|
|
37
|
+
};
|
|
38
|
+
export function indexPaymentSourcesForCompaniesQueryOptions(sdk, params) {
|
|
39
|
+
return {
|
|
40
|
+
initialPageParam: params.pageToken ?? undefined,
|
|
41
|
+
queryKey: [paymentAllocationKeys.indexPaymentSourcesForCompanies(params)],
|
|
42
|
+
queryFn: ({ pageParam }) => indexPaymentSourcesForCompanies(sdk, { ...params, pageToken: pageParam }),
|
|
43
|
+
getNextPageParam: nextPageParam,
|
|
44
|
+
getPreviousPageParam: prevPageParam,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export function indexCompanyPaymentSourcesQueryOptions(sdk, params) {
|
|
48
|
+
return {
|
|
49
|
+
initialPageParam: params.pageToken ?? undefined,
|
|
50
|
+
queryKey: [paymentAllocationKeys.indexCompanyPaymentSources(params)],
|
|
51
|
+
queryFn: ({ pageParam }) => indexCompanyPaymentSources(sdk, { ...params, pageToken: pageParam }),
|
|
52
|
+
getNextPageParam: nextPageParam,
|
|
53
|
+
getPreviousPageParam: prevPageParam,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export function showCompanyPaymentSourceReadStatusQueryOptions(sdk, params) {
|
|
57
|
+
return {
|
|
58
|
+
queryKey: [
|
|
59
|
+
paymentAllocationKeys.showCompanyPaymentSourceReadStatus(params),
|
|
60
|
+
],
|
|
61
|
+
queryFn: () => showCompanyPaymentSourceReadStatus(sdk, params),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export function showCompanyPaymentSourceQueryOptions(sdk, params) {
|
|
65
|
+
return {
|
|
66
|
+
queryKey: [paymentAllocationKeys.showCompanyPaymentSource(params)],
|
|
67
|
+
queryFn: () => showCompanyPaymentSource(sdk, params),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export function indexCompanyPaymentSourceHistoryQueryOptions(sdk, params) {
|
|
71
|
+
return {
|
|
72
|
+
queryKey: [paymentAllocationKeys.indexCompanyPaymentSourceHistory(params)],
|
|
73
|
+
queryFn: () => indexCompanyPaymentSourceHistory(sdk, params),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
export function indexCompanyPaymentSourceInvoiceCandidatesQueryOptions(sdk, params) {
|
|
77
|
+
return {
|
|
78
|
+
initialPageParam: params.pageToken ?? undefined,
|
|
79
|
+
queryKey: [
|
|
80
|
+
paymentAllocationKeys.indexCompanyPaymentSourceInvoiceCandidates(params),
|
|
81
|
+
],
|
|
82
|
+
queryFn: ({ pageParam }) => indexCompanyPaymentSourceInvoiceCandidates(sdk, {
|
|
83
|
+
...params,
|
|
84
|
+
pageToken: pageParam,
|
|
85
|
+
}),
|
|
86
|
+
getNextPageParam: nextPageParam,
|
|
87
|
+
getPreviousPageParam: prevPageParam,
|
|
88
|
+
};
|
|
89
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -139,7 +139,6 @@ export * from "./api/commands/invoicing/deleteInvoiceRecipient.js";
|
|
|
139
139
|
export * from "./api/commands/invoicing/deletePlannedInvoiceLineChanges.js";
|
|
140
140
|
export * from "./api/commands/invoicing/directSendInvoice.js";
|
|
141
141
|
export * from "./api/commands/invoicing/invoicingMutations.js";
|
|
142
|
-
export * from "./api/commands/invoicing/registerPayment.js";
|
|
143
142
|
export * from "./api/commands/invoicing/toggleInvoicingPlanTransactionOverdue.js";
|
|
144
143
|
export * from "./api/commands/invoicing/toggleOverdue.js";
|
|
145
144
|
export * from "./api/commands/invoicing/toggleOverdues.js";
|
|
@@ -545,3 +544,9 @@ export * from "./api/commands/conversation/flagConversation.js";
|
|
|
545
544
|
export * from "./api/commands/conversation/unflagConversation.js";
|
|
546
545
|
export * from "./api/commands/conversation/markConversationUnread.js";
|
|
547
546
|
export * from "./api/queries/residentsAndSections/tenantRegistrations.js";
|
|
547
|
+
export * from "./api/queries/invoicing/paymentAllocation.js";
|
|
548
|
+
export * from "./api/queries/invoicing/customerLedger.js";
|
|
549
|
+
export * from "./api/queries/invoicing/overdueDelays.js";
|
|
550
|
+
export * from "./api/commands/invoicing/paymentAllocation.js";
|
|
551
|
+
export * from "./api/commands/invoicing/customerLedger.js";
|
|
552
|
+
export * from "./api/commands/invoicing/overdueDelays.js";
|
package/dist/index.js
CHANGED
|
@@ -135,7 +135,6 @@ export * from "./api/commands/invoicing/deleteInvoiceRecipient.js";
|
|
|
135
135
|
export * from "./api/commands/invoicing/deletePlannedInvoiceLineChanges.js";
|
|
136
136
|
export * from "./api/commands/invoicing/directSendInvoice.js";
|
|
137
137
|
export * from "./api/commands/invoicing/invoicingMutations.js";
|
|
138
|
-
export * from "./api/commands/invoicing/registerPayment.js";
|
|
139
138
|
export * from "./api/commands/invoicing/toggleInvoicingPlanTransactionOverdue.js";
|
|
140
139
|
export * from "./api/commands/invoicing/toggleOverdue.js";
|
|
141
140
|
export * from "./api/commands/invoicing/toggleOverdues.js";
|
|
@@ -541,3 +540,9 @@ export * from "./api/commands/conversation/flagConversation.js";
|
|
|
541
540
|
export * from "./api/commands/conversation/unflagConversation.js";
|
|
542
541
|
export * from "./api/commands/conversation/markConversationUnread.js";
|
|
543
542
|
export * from "./api/queries/residentsAndSections/tenantRegistrations.js";
|
|
543
|
+
export * from "./api/queries/invoicing/paymentAllocation.js";
|
|
544
|
+
export * from "./api/queries/invoicing/customerLedger.js";
|
|
545
|
+
export * from "./api/queries/invoicing/overdueDelays.js";
|
|
546
|
+
export * from "./api/commands/invoicing/paymentAllocation.js";
|
|
547
|
+
export * from "./api/commands/invoicing/customerLedger.js";
|
|
548
|
+
export * from "./api/commands/invoicing/overdueDelays.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solibo/solibo-query",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.50.0",
|
|
4
4
|
"description": "Framework-agnostic TanStack Query options for the Solibo Home SDK. Solibo Home is the platform for owning and managing homes in Norway.",
|
|
5
5
|
"homepage": "https://sdk.solibo.no",
|
|
6
6
|
"repository": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"buffer": "^6.0.3",
|
|
42
42
|
"hash-wasm": "^4.12.0",
|
|
43
43
|
"mime-types": "^3.0.2",
|
|
44
|
-
"@solibo/solibo-sdk": "1.
|
|
44
|
+
"@solibo/solibo-sdk": "1.50.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@eslint/js": "^10.0.1",
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Id } from "@solibo/solibo-sdk";
|
|
2
|
-
import { SoliboClient } from "@solibo/solibo-sdk/core";
|
|
3
|
-
import type { QueryClient } from "@tanstack/query-core";
|
|
4
|
-
export declare function registerPaymentToInvoiceMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
|
|
5
|
-
mutationFn: (params: {
|
|
6
|
-
orgNr: string;
|
|
7
|
-
paymentId: Id;
|
|
8
|
-
invoiceId: string;
|
|
9
|
-
}) => Promise<import("@solibo/solibo-sdk").Invoice>;
|
|
10
|
-
onSuccess: (_: any) => Promise<[void, void, void, void[]]>;
|
|
11
|
-
};
|
|
12
|
-
export declare function rejectPaymentMutationOptions(sdk: SoliboClient, queryClient: QueryClient): {
|
|
13
|
-
mutationFn: (params: {
|
|
14
|
-
orgNr: string;
|
|
15
|
-
paymentId: Id;
|
|
16
|
-
}) => Promise<void>;
|
|
17
|
-
onSuccess: (_: any) => Promise<[void, void]>;
|
|
18
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { invoicingKeys } from "../../queries/invoicing/invoicingKeys.js";
|
|
2
|
-
import { invalidateOverdueInvoices } from "./invoiceStatusInvalidations.js";
|
|
3
|
-
import { attachPaymentToInvoice, rejectPayment, } from "@solibo/solibo-sdk/invoicing/operations";
|
|
4
|
-
export function registerPaymentToInvoiceMutationOptions(sdk, queryClient) {
|
|
5
|
-
return {
|
|
6
|
-
mutationFn: (params) => attachPaymentToInvoice(sdk, {
|
|
7
|
-
orgNr: params.orgNr,
|
|
8
|
-
paymentId: params.paymentId,
|
|
9
|
-
invoiceId: params.invoiceId,
|
|
10
|
-
}),
|
|
11
|
-
onSuccess: (_) => Promise.all([
|
|
12
|
-
queryClient.invalidateQueries({
|
|
13
|
-
queryKey: [invoicingKeys.unprocessedPayments()],
|
|
14
|
-
}),
|
|
15
|
-
queryClient.invalidateQueries({
|
|
16
|
-
queryKey: [invoicingKeys.processedPayments()],
|
|
17
|
-
}),
|
|
18
|
-
queryClient.invalidateQueries({
|
|
19
|
-
queryKey: [invoicingKeys.historicInvoicesForCompanies()],
|
|
20
|
-
}),
|
|
21
|
-
invalidateOverdueInvoices(queryClient),
|
|
22
|
-
]),
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export function rejectPaymentMutationOptions(sdk, queryClient) {
|
|
26
|
-
return {
|
|
27
|
-
mutationFn: (params) => rejectPayment(sdk, {
|
|
28
|
-
orgNr: params.orgNr,
|
|
29
|
-
paymentId: params.paymentId,
|
|
30
|
-
}),
|
|
31
|
-
onSuccess: (_) => Promise.all([
|
|
32
|
-
queryClient.invalidateQueries({
|
|
33
|
-
queryKey: [invoicingKeys.unprocessedPayments()],
|
|
34
|
-
}),
|
|
35
|
-
queryClient.invalidateQueries({
|
|
36
|
-
queryKey: [invoicingKeys.processedPayments()],
|
|
37
|
-
}),
|
|
38
|
-
]),
|
|
39
|
-
};
|
|
40
|
-
}
|