@fayz-ai/plugin-financial 0.10.0 → 0.12.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.
Files changed (37) hide show
  1. package/README.md +2 -2
  2. package/dist/components/ReceiptPicker.d.ts +10 -0
  3. package/dist/components/ReceiptPicker.d.ts.map +1 -0
  4. package/dist/data/mock.d.ts.map +1 -1
  5. package/dist/data/registries.d.ts.map +1 -1
  6. package/dist/data/supabase.d.ts.map +1 -1
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +6311 -506
  9. package/dist/index.js.map +1 -1
  10. package/dist/lib/accounts.d.ts +16 -0
  11. package/dist/lib/accounts.d.ts.map +1 -0
  12. package/dist/lib/amount-in-words.d.ts +7 -0
  13. package/dist/lib/amount-in-words.d.ts.map +1 -0
  14. package/dist/lib/settlements.d.ts +22 -0
  15. package/dist/lib/settlements.d.ts.map +1 -0
  16. package/dist/lib/statement-order.d.ts +4 -0
  17. package/dist/lib/statement-order.d.ts.map +1 -0
  18. package/dist/locales/en.d.ts.map +1 -1
  19. package/dist/locales/pt-BR.d.ts.map +1 -1
  20. package/dist/migrations/index.d.ts +27 -1
  21. package/dist/migrations/index.d.ts.map +1 -1
  22. package/dist/types.d.ts +6 -0
  23. package/dist/types.d.ts.map +1 -1
  24. package/dist/views/CommissionsView.d.ts +7 -0
  25. package/dist/views/CommissionsView.d.ts.map +1 -1
  26. package/dist/views/FinancialPage.d.ts.map +1 -1
  27. package/dist/views/InvoiceDetailView.d.ts.map +1 -1
  28. package/dist/views/InvoiceFormView.d.ts.map +1 -1
  29. package/dist/views/InvoiceListView.d.ts.map +1 -1
  30. package/dist/views/ReceiptAgentSurface.d.ts +11 -0
  31. package/dist/views/ReceiptAgentSurface.d.ts.map +1 -0
  32. package/dist/views/StatementsView.d.ts.map +1 -1
  33. package/dist/views/receipt-agent.d.ts +70 -0
  34. package/dist/views/receipt-agent.d.ts.map +1 -0
  35. package/package.json +7 -5
  36. package/dist/components/ReceiptField.d.ts +0 -17
  37. package/dist/components/ReceiptField.d.ts.map +0 -1
@@ -0,0 +1,16 @@
1
+ import type { ChartOfAccountsNode } from '../types';
2
+ /**
3
+ * The accounts a document line can actually be posted to.
4
+ *
5
+ * A chart of accounts is mostly structure: Artorius's has 88 entries of which
6
+ * 82 are parents. Offering all 88 in a picker is a wall of headings the user
7
+ * must not choose. Only leaves are postable.
8
+ *
9
+ * `node_type` is the declared answer, but it is defaulted to 'leaf' at the DDL
10
+ * level, so a tree imported without setting it would come through as 88 leaves.
11
+ * Anything that is somebody's parent is therefore treated as a group regardless
12
+ * of what it says about itself.
13
+ */
14
+ export declare function postableAccounts(accounts: ChartOfAccountsNode[]): ChartOfAccountsNode[];
15
+ export declare function accountLabel(account: ChartOfAccountsNode): string;
16
+ //# sourceMappingURL=accounts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/lib/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAEnD;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,mBAAmB,EAAE,GAAG,mBAAmB,EAAE,CAGvF;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAEjE"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * "cinquenta reais" → 50. "cento e vinte e três reais e cinquenta centavos" →
3
+ * 123.5. Devolve null quando não há número nenhum ali — o extenso é opcional, e
4
+ * ausente não é o mesmo que zero.
5
+ */
6
+ export declare function parseAmountInWords(raw: unknown): number | null;
7
+ //# sourceMappingURL=amount-in-words.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"amount-in-words.d.ts","sourceRoot":"","sources":["../../src/lib/amount-in-words.ts"],"names":[],"mappings":"AAsDA;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAgC9D"}
@@ -0,0 +1,22 @@
1
+ import type { FinancialMovement } from '../types';
2
+ export interface SettlementGrouping {
3
+ /** bill id → the cash events that settled it, oldest first. */
4
+ byBillId: Map<string, FinancialMovement[]>;
5
+ /** Payments that name no bill we hold — surfaced, never silently dropped. */
6
+ unattributed: FinancialMovement[];
7
+ }
8
+ /**
9
+ * Which payments settled which bill.
10
+ *
11
+ * `settles_movement_id` (migration 014) is the answer whenever it is present.
12
+ * Before 014 the pairing had to be re-derived from (invoice_id,
13
+ * installment_number), and that derivation mis-attributes money: Artorius
14
+ * invoice 176440 carries two payments both stamped installment 1 while settling
15
+ * bills #1 and #2. So the derivation runs ONLY for payments carrying no link —
16
+ * it never overrides one.
17
+ *
18
+ * A payment pointing at a bill we did not load comes back as `unattributed`
19
+ * instead of disappearing: money that moved must stay visible on the schedule.
20
+ */
21
+ export declare function groupPaymentsByBill(bills: FinancialMovement[], payments: FinancialMovement[]): SettlementGrouping;
22
+ //# sourceMappingURL=settlements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settlements.d.ts","sourceRoot":"","sources":["../../src/lib/settlements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAEjD,MAAM,WAAW,kBAAkB;IACjC,+DAA+D;IAC/D,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAA;IAC1C,6EAA6E;IAC7E,YAAY,EAAE,iBAAiB,EAAE,CAAA;CAClC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,iBAAiB,EAAE,EAC1B,QAAQ,EAAE,iBAAiB,EAAE,GAC5B,kBAAkB,CAoBpB"}
@@ -0,0 +1,4 @@
1
+ import type { StatementEntry } from '../types';
2
+ /** Keeps ledger balances intact while presenting the newest cash events first. */
3
+ export declare function newestStatementEntriesFirst(entries: StatementEntry[]): StatementEntry[];
4
+ //# sourceMappingURL=statement-order.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statement-order.d.ts","sourceRoot":"","sources":["../../src/lib/statement-order.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAO9C,kFAAkF;AAClF,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,cAAc,EAAE,oBAoBpE"}
@@ -1 +1 @@
1
- {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/locales/en.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA6frC,CAAA"}
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/locales/en.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA+gBrC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"pt-BR.d.ts","sourceRoot":"","sources":["../../src/locales/pt-BR.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAggBvC,CAAA"}
1
+ {"version":3,"file":"pt-BR.d.ts","sourceRoot":"","sources":["../../src/locales/pt-BR.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAkhBvC,CAAA"}