@fayz-ai/plugin-financial 0.1.1 → 0.1.4
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/LICENSE +21 -0
- package/README.md +50 -0
- package/dist/FinancialContext.d.ts +2 -0
- package/dist/FinancialContext.d.ts.map +1 -1
- package/dist/FinancialPage.d.ts.map +1 -1
- package/dist/components/PaymentModal.d.ts.map +1 -1
- package/dist/components/PersonStatementWidget.d.ts +18 -0
- package/dist/components/PersonStatementWidget.d.ts.map +1 -0
- package/dist/components/TransferModal.d.ts +7 -0
- package/dist/components/TransferModal.d.ts.map +1 -0
- package/dist/contract.test.d.ts +2 -0
- package/dist/contract.test.d.ts.map +1 -0
- package/dist/data/capability.test.d.ts +2 -0
- package/dist/data/capability.test.d.ts.map +1 -0
- package/dist/data/mock.d.ts.map +1 -1
- package/dist/data/supabase.d.ts.map +1 -1
- package/dist/data/types.d.ts +13 -2
- package/dist/data/types.d.ts.map +1 -1
- package/dist/index.cjs +1529 -263
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1437 -171
- package/dist/index.js.map +1 -1
- package/dist/locales/en.d.ts.map +1 -1
- package/dist/locales/pt-BR.d.ts.map +1 -1
- package/dist/registries.d.ts.map +1 -1
- package/dist/store.d.ts +4 -2
- package/dist/store.d.ts.map +1 -1
- package/dist/types.d.ts +111 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/views/InvoiceDetailView.d.ts +3 -1
- package/dist/views/InvoiceDetailView.d.ts.map +1 -1
- package/dist/views/InvoiceFormView.d.ts.map +1 -1
- package/dist/views/PayablesView.d.ts +5 -1
- package/dist/views/PayablesView.d.ts.map +1 -1
- package/dist/views/ReceivablesView.d.ts +5 -1
- package/dist/views/ReceivablesView.d.ts.map +1 -1
- package/dist/views/ReconciliationView.d.ts +3 -0
- package/dist/views/ReconciliationView.d.ts.map +1 -0
- package/dist/views/StatementsView.d.ts +3 -1
- package/dist/views/StatementsView.d.ts.map +1 -1
- package/dist/views/navReferrer.d.ts +5 -0
- package/dist/views/navReferrer.d.ts.map +1 -0
- package/package.json +8 -5
- package/src/FinancialContext.tsx +2 -0
- package/src/FinancialPage.tsx +32 -17
- package/src/components/PaymentModal.tsx +58 -11
- package/src/components/PersonStatementWidget.tsx +133 -0
- package/src/components/TransferModal.tsx +150 -0
- package/src/contract.test.ts +58 -0
- package/src/data/capability.test.ts +90 -0
- package/src/data/mock.ts +265 -52
- package/src/data/supabase.ts +359 -30
- package/src/data/types.ts +22 -3
- package/src/index.ts +28 -2
- package/src/locales/en.ts +76 -0
- package/src/locales/pt-BR.ts +76 -0
- package/src/migrations/006_extract_fee_amount.sql +20 -0
- package/src/migrations/006_rls_policies.sql +37 -0
- package/src/migrations/007_reconciliation.sql +32 -0
- package/src/migrations/008_split_payment_movements.sql +29 -0
- package/src/registries.ts +3 -1
- package/src/store.ts +27 -7
- package/src/types.ts +126 -1
- package/src/views/InvoiceDetailView.tsx +70 -51
- package/src/views/InvoiceFormView.tsx +55 -20
- package/src/views/PayablesView.tsx +13 -2
- package/src/views/ReceivablesView.tsx +13 -2
- package/src/views/ReconciliationView.tsx +211 -0
- package/src/views/StatementsView.tsx +241 -29
- package/src/views/navReferrer.ts +24 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Faya Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# @fayz-ai/plugin-financial
|
|
2
|
+
|
|
3
|
+
> Order-to-cash for your SaaS — invoices, payables, cash, and commissions in one plugin.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@fayz-ai/plugin-financial)
|
|
6
|
+
[](https://github.com/FayaLabs/fayz-sdk/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
Most vertical SaaS bolts on finance as an afterthought: a "total" field, a spreadsheet export, and a prayer. `plugin-financial` makes money a first-class part of the app. It models the full order-to-cash loop — receivables, payables, cash registers, statements, card reconciliation, and commission rules — as composable modules you toggle per business.
|
|
9
|
+
|
|
10
|
+
It's built to be the financial spine other plugins lean on. Agenda creates orders against it, reports read from it, and the dashboard surfaces balance, cash flow, and overdue alerts without bespoke glue. Every module is optional, every label and currency is configurable, and item lines can resolve products and services from other plugins via entity lookups. Compose a real, money-aware SaaS instead of stitching one together.
|
|
11
|
+
|
|
12
|
+
## What's inside
|
|
13
|
+
- **Financial page** (`/financial`) — summary, accounts receivable & payable (with recurring), cash registers, statements, commissions (overview + rules), and cards (overview + reconciliation).
|
|
14
|
+
- **Invoice flow** — list, detail, and form views with configurable item types (service / product / other) and optional service-execution tracking.
|
|
15
|
+
- **Dashboard widgets** — total-balance / receivable / payable KPIs, a cash-flow chart, breakdown and overdue-alert panels, and a recent-transactions table.
|
|
16
|
+
- **AI tools** — `getRevenue`, `createInvoice`, `listPayables` for natural-language finance.
|
|
17
|
+
- **Cross-plugin hooks** — `entityLookups` and `contactLookup` to wire product/service/contact selectors, plus `onBookingClick` to jump from an invoice back to its booking.
|
|
18
|
+
- `createSafeFinancialProvider` (Supabase-or-mock) so the same provider can back both the plugin and a cross-plugin bridge; settings tab and i18n included.
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
```bash
|
|
22
|
+
npm install @fayz-ai/plugin-financial
|
|
23
|
+
```
|
|
24
|
+
Peer deps: `react`, `react-dom`. Runtime deps include `@fayz-ai/core`, `@fayz-ai/ui`, and `@fayz-ai/saas`.
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
```tsx
|
|
28
|
+
import { defineSaas } from '@fayz-ai/saas'
|
|
29
|
+
import { createFinancialPlugin } from '@fayz-ai/plugin-financial'
|
|
30
|
+
|
|
31
|
+
export const app = defineSaas({
|
|
32
|
+
// ...
|
|
33
|
+
plugins: [
|
|
34
|
+
createFinancialPlugin({
|
|
35
|
+
currency: { code: 'BRL', locale: 'pt-BR', symbol: 'R$' },
|
|
36
|
+
modules: { commissions: true, cards: false },
|
|
37
|
+
itemTypes: [
|
|
38
|
+
{ value: 'service', label: 'Service', icon: 'Briefcase' },
|
|
39
|
+
{ value: 'product', label: 'Product', icon: 'Package' },
|
|
40
|
+
],
|
|
41
|
+
}),
|
|
42
|
+
],
|
|
43
|
+
})
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Part of the Fayz SDK
|
|
47
|
+
`plugin-financial` is the money layer of the SDK. It pairs with `@fayz-ai/plugin-agenda` (bookings auto-create orders via the financial bridge) and feeds `@fayz-ai/plugin-reports` for revenue and commission reporting.
|
|
48
|
+
|
|
49
|
+
## Roadmap & contributing
|
|
50
|
+
Built and evolving in the open. See the [Fayz SDK roadmap](../../docs/ROADMAP.md#plugin-financial) for current gaps, missing features, and good first issues.
|
|
@@ -9,6 +9,8 @@ export interface FinancialModules {
|
|
|
9
9
|
statements: boolean;
|
|
10
10
|
commissions: boolean;
|
|
11
11
|
cards: boolean;
|
|
12
|
+
/** Bank reconciliation (conciliação). Opt-in — enable when a bank connector imports statements. */
|
|
13
|
+
reconciliation: boolean;
|
|
12
14
|
}
|
|
13
15
|
export type FinancialCurrency = CurrencyConfig;
|
|
14
16
|
export interface LocationOption {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FinancialContext.d.ts","sourceRoot":"","sources":["../src/FinancialContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AACjI,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAM/C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,EAAE,OAAO,CAAA;IACpB,aAAa,EAAE,OAAO,CAAA;IACtB,UAAU,EAAE,OAAO,CAAA;IACnB,WAAW,EAAE,OAAO,CAAA;IACpB,KAAK,EAAE,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"FinancialContext.d.ts","sourceRoot":"","sources":["../src/FinancialContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AACjI,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACpE,OA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|
1
|
-
{"version":3,"file":"FinancialPage.d.ts","sourceRoot":"","sources":["../src/FinancialPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAA;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAG/C,OAAO,EAA4B,KAAK,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AAC3F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAqB,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"FinancialPage.d.ts","sourceRoot":"","sources":["../src/FinancialPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAA;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAG/C,OAAO,EAA4B,KAAK,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AAC3F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAqB,MAAM,eAAe,CAAA;AAiBzE,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAA;IACzC,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAqHD,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE;IACrE,MAAM,EAAE,uBAAuB,CAAA;IAC/B,QAAQ,EAAE,qBAAqB,CAAA;IAC/B,KAAK,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAA;IACjC,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAA;CACjC,qBA6HA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentModal.d.ts","sourceRoot":"","sources":["../../src/components/PaymentModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAA;AAQ3D,OAAO,KAAK,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"PaymentModal.d.ts","sourceRoot":"","sources":["../../src/components/PaymentModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAA;AAQ3D,OAAO,KAAK,EAAE,iBAAiB,EAAsC,MAAM,UAAU,CAAA;AA0CrF,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IAC1D,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB,qBA0TA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ResolvedFinancialConfig } from '../FinancialContext';
|
|
3
|
+
import type { FinancialDataProvider } from '../data/types';
|
|
4
|
+
/**
|
|
5
|
+
* Per-person financial statement (account_central-style extract): every invoice where
|
|
6
|
+
* this person is the contact — a client paying receivables, or a professional receiving
|
|
7
|
+
* commissions/payables. Rendered as a tab on the person detail page via the
|
|
8
|
+
* `person.detail.financial` widget zone.
|
|
9
|
+
*/
|
|
10
|
+
export declare function PersonStatementWidget({ person, provider, config }: {
|
|
11
|
+
person: {
|
|
12
|
+
id?: string;
|
|
13
|
+
name?: string;
|
|
14
|
+
};
|
|
15
|
+
provider: FinancialDataProvider;
|
|
16
|
+
config: ResolvedFinancialConfig;
|
|
17
|
+
}): React.JSX.Element;
|
|
18
|
+
//# sourceMappingURL=PersonStatementWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PersonStatementWidget.d.ts","sourceRoot":"","sources":["../../src/components/PersonStatementWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAA;AAK3D,OAAO,EAAkB,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAClF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAW1D;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE;IAClE,MAAM,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACtC,QAAQ,EAAE,qBAAqB,CAAA;IAC/B,MAAM,EAAE,uBAAuB,CAAA;CAChC,qBAgGA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransferModal.d.ts","sourceRoot":"","sources":["../../src/components/TransferModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAOlD,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE;IAChE,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,qBA0IA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.test.d.ts","sourceRoot":"","sources":["../src/contract.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability.test.d.ts","sourceRoot":"","sources":["../../src/data/capability.test.ts"],"names":[],"mappings":""}
|
package/dist/data/mock.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../src/data/mock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../src/data/mock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AA+HpD,MAAM,WAAW,4BAA4B;IAC3C,kBAAkB,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACvE;AAED,wBAAgB,2BAA2B,CAAC,OAAO,CAAC,EAAE,4BAA4B,GAAG,qBAAqB,CAylBzG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supabase.d.ts","sourceRoot":"","sources":["../../src/data/supabase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"supabase.d.ts","sourceRoot":"","sources":["../../src/data/supabase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAqIpD,wBAAgB,+BAA+B,IAAI,qBAAqB,CAgsBvE"}
|
package/dist/data/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Invoice, InvoiceItem, FinancialMovement, BankAccount, CashSession, PaymentMethod, PaymentMethodType, ChartOfAccountsNode, CardTransaction, CreateInvoiceInput, PayMovementInput, OpenCashSessionInput, CloseCashSessionInput, CreateBankAccountInput, InvoiceQuery, MovementQuery, StatementQuery, PaginatedResult, FinancialSummary,
|
|
1
|
+
import type { Invoice, InvoiceItem, FinancialMovement, BankAccount, CashSession, PaymentMethod, PaymentMethodType, ChartOfAccountsNode, CardTransaction, CreateInvoiceInput, PayMovementInput, CreateTransferInput, TransferResult, OpenCashSessionInput, CloseCashSessionInput, CreateBankAccountInput, InvoiceQuery, MovementQuery, StatementQuery, PaginatedResult, FinancialSummary, StatementResult, CashSessionSummary, DateRange, ImportBankTransactionsInput, ImportBankTransactionsResult, UnreconciledQuery, ReconciliationCandidate, ReconcileInput } from '../types';
|
|
2
2
|
export interface FinancialDataProvider {
|
|
3
3
|
getInvoices(query: InvoiceQuery): Promise<PaginatedResult<Invoice>>;
|
|
4
4
|
getInvoiceById(id: string): Promise<Invoice | null>;
|
|
@@ -9,6 +9,7 @@ export interface FinancialDataProvider {
|
|
|
9
9
|
getMovements(query: MovementQuery): Promise<PaginatedResult<FinancialMovement>>;
|
|
10
10
|
payMovement(input: PayMovementInput): Promise<FinancialMovement>;
|
|
11
11
|
cancelMovement(id: string): Promise<void>;
|
|
12
|
+
createTransfer(input: CreateTransferInput): Promise<TransferResult>;
|
|
12
13
|
getBankAccounts(): Promise<BankAccount[]>;
|
|
13
14
|
createBankAccount(data: CreateBankAccountInput): Promise<BankAccount>;
|
|
14
15
|
updateBankAccount(id: string, data: Partial<BankAccount>): Promise<BankAccount>;
|
|
@@ -21,7 +22,17 @@ export interface FinancialDataProvider {
|
|
|
21
22
|
getPaymentMethodTypes(): Promise<PaymentMethodType[]>;
|
|
22
23
|
getChartOfAccounts(): Promise<ChartOfAccountsNode[]>;
|
|
23
24
|
getCardTransactions(dateRange?: DateRange): Promise<CardTransaction[]>;
|
|
24
|
-
getStatement(query: StatementQuery): Promise<
|
|
25
|
+
getStatement(query: StatementQuery): Promise<StatementResult>;
|
|
25
26
|
getSummary(dateRange?: DateRange): Promise<FinancialSummary>;
|
|
27
|
+
/** Upsert normalized bank-statement lines as movements (idempotent by external id). */
|
|
28
|
+
importBankTransactions?(input: ImportBankTransactionsInput): Promise<ImportBankTransactionsResult>;
|
|
29
|
+
/** Imported lines not yet reconciled (externalSource set, reconciledAt null). */
|
|
30
|
+
getUnreconciled?(query?: UnreconciledQuery): Promise<FinancialMovement[]>;
|
|
31
|
+
/** Internal-movement candidates to match a given imported line, ranked by score. */
|
|
32
|
+
suggestReconciliation?(bankMovementId: string): Promise<ReconciliationCandidate[]>;
|
|
33
|
+
/** Reconcile: link to an internal movement, or accept the line standalone. */
|
|
34
|
+
reconcileMovement?(input: ReconcileInput): Promise<void>;
|
|
35
|
+
/** Undo a reconciliation. */
|
|
36
|
+
unreconcileMovement?(bankMovementId: string): Promise<void>;
|
|
26
37
|
}
|
|
27
38
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/data/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/data/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,WAAW,EACpD,WAAW,EAAE,aAAa,EAAE,iBAAiB,EAAE,mBAAmB,EAClE,eAAe,EACf,kBAAkB,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/data/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,WAAW,EACpD,WAAW,EAAE,aAAa,EAAE,iBAAiB,EAAE,mBAAmB,EAClE,eAAe,EACf,kBAAkB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,cAAc,EACzE,oBAAoB,EAAE,qBAAqB,EAAE,sBAAsB,EACnE,YAAY,EAAE,aAAa,EAAE,cAAc,EAC3C,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,kBAAkB,EACtE,SAAS,EACT,2BAA2B,EAAE,4BAA4B,EACzD,iBAAiB,EAAE,uBAAuB,EAAE,cAAc,EAC3D,MAAM,UAAU,CAAA;AAEjB,MAAM,WAAW,qBAAqB;IAEpC,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAA;IACnE,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAA;IACnD,eAAe,CAAC,SAAS,EA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