@fayz-ai/plugin-financial 0.9.0 → 0.9.2

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 (95) hide show
  1. package/README.md +3 -3
  2. package/dist/components/PersonStatementWidget.d.ts +1 -1
  3. package/dist/components/PersonStatementWidget.d.ts.map +1 -1
  4. package/dist/{FinancialContext.d.ts → context.d.ts} +4 -2
  5. package/dist/context.d.ts.map +1 -0
  6. package/dist/data/registries.d.ts.map +1 -0
  7. package/dist/index.d.ts +13 -4
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +1426 -1426
  10. package/dist/index.js.map +1 -1
  11. package/dist/integrations/stripe/connectorDef.d.ts +14 -0
  12. package/dist/integrations/stripe/connectorDef.d.ts.map +1 -0
  13. package/dist/integrations/stripe/data.d.ts +43 -0
  14. package/dist/integrations/stripe/data.d.ts.map +1 -0
  15. package/dist/lib/message-events.d.ts +12 -0
  16. package/dist/lib/message-events.d.ts.map +1 -0
  17. package/dist/{quick-add.d.ts → lib/quick-add.d.ts} +1 -1
  18. package/dist/lib/quick-add.d.ts.map +1 -0
  19. package/dist/locales/en.d.ts.map +1 -1
  20. package/dist/locales/pt-BR.d.ts.map +1 -1
  21. package/dist/{FinancialPage.d.ts → views/FinancialPage.d.ts} +3 -3
  22. package/dist/views/FinancialPage.d.ts.map +1 -0
  23. package/dist/views/InvoiceDetailView.d.ts.map +1 -1
  24. package/dist/views/InvoiceFormView.d.ts.map +1 -1
  25. package/dist/views/InvoiceListView.d.ts.map +1 -1
  26. package/dist/views/PayablesView.d.ts +1 -1
  27. package/dist/views/PayablesView.d.ts.map +1 -1
  28. package/dist/views/ReceivablesView.d.ts +1 -1
  29. package/dist/views/ReceivablesView.d.ts.map +1 -1
  30. package/dist/views/StatementsView.d.ts.map +1 -1
  31. package/dist/views/dashboardWidgets.d.ts +1 -1
  32. package/dist/views/dashboardWidgets.d.ts.map +1 -1
  33. package/package.json +12 -14
  34. package/dist/FinancialContext.d.ts.map +0 -1
  35. package/dist/FinancialPage.d.ts.map +0 -1
  36. package/dist/contract.test.d.ts +0 -2
  37. package/dist/contract.test.d.ts.map +0 -1
  38. package/dist/quick-add.d.ts.map +0 -1
  39. package/dist/registries.d.ts.map +0 -1
  40. package/src/FinancialContext.tsx +0 -59
  41. package/src/FinancialPage.tsx +0 -413
  42. package/src/README.md +0 -155
  43. package/src/components/FinancialGeneralSettings.tsx +0 -39
  44. package/src/components/FinancialOnboarding.tsx +0 -87
  45. package/src/components/FinancialSettings.tsx +0 -31
  46. package/src/components/PaymentModal.tsx +0 -369
  47. package/src/components/PersonStatementWidget.tsx +0 -133
  48. package/src/components/TransferModal.tsx +0 -150
  49. package/src/contract.test.ts +0 -58
  50. package/src/data/capability.test.ts +0 -135
  51. package/src/data/index.ts +0 -3
  52. package/src/data/mock.ts +0 -842
  53. package/src/data/supabase.ts +0 -968
  54. package/src/data/tables.ts +0 -13
  55. package/src/data/types.ts +0 -86
  56. package/src/index.ts +0 -487
  57. package/src/lib/tenant.ts +0 -3
  58. package/src/locales/en.ts +0 -493
  59. package/src/locales/index.ts +0 -7
  60. package/src/locales/pt-BR.ts +0 -493
  61. package/src/migrations/000_plg_rename.sql +0 -30
  62. package/src/migrations/001_financial_base.sql +0 -109
  63. package/src/migrations/002_chart_of_accounts.sql +0 -28
  64. package/src/migrations/003_card_brands.sql +0 -12
  65. package/src/migrations/004_order_to_cash.sql +0 -178
  66. package/src/migrations/005_seed_defaults.sql +0 -38
  67. package/src/migrations/006_rls_policies.sql +0 -37
  68. package/src/migrations/006b_extract_fee_amount.sql +0 -20
  69. package/src/migrations/007_reconciliation.sql +0 -32
  70. package/src/migrations/007b_movement_payment_method_type.sql +0 -6
  71. package/src/migrations/008_split_payment_movements.sql +0 -29
  72. package/src/migrations/009_agent_rpcs.sql +0 -165
  73. package/src/migrations/010_invoice_internal.sql +0 -133
  74. package/src/migrations/011_nfe.sql +0 -58
  75. package/src/migrations/index.ts +0 -923
  76. package/src/quick-add.ts +0 -58
  77. package/src/registries.ts +0 -308
  78. package/src/store.ts +0 -329
  79. package/src/types.ts +0 -592
  80. package/src/views/CardsView.tsx +0 -213
  81. package/src/views/CashRegistersView.tsx +0 -597
  82. package/src/views/CommissionsView.tsx +0 -18
  83. package/src/views/InvoiceDetailView.tsx +0 -616
  84. package/src/views/InvoiceFormView.tsx +0 -945
  85. package/src/views/InvoiceListView.tsx +0 -323
  86. package/src/views/NotasFiscaisView.tsx +0 -209
  87. package/src/views/PayablesView.tsx +0 -48
  88. package/src/views/QuickTransactionForm.tsx +0 -548
  89. package/src/views/ReceivablesView.tsx +0 -48
  90. package/src/views/ReconciliationView.tsx +0 -211
  91. package/src/views/StatementsView.tsx +0 -335
  92. package/src/views/SummaryView.tsx +0 -203
  93. package/src/views/dashboardWidgets.tsx +0 -437
  94. package/src/views/navReferrer.ts +0 -24
  95. /package/dist/{registries.d.ts → data/registries.d.ts} +0 -0
@@ -0,0 +1,14 @@
1
+ import { type ConnectorDefinition, type ConnectorSetting } from '@fayz-ai/core';
2
+ export declare const STRIPE_CONNECTOR_ID = "stripe";
3
+ /**
4
+ * What the merchant may offer on a Stripe invoice — commercial policy, decided
5
+ * after the account is linked and changed whenever they like.
6
+ *
7
+ * A multi-select over what Stripe actually supports in BR, so the value cannot
8
+ * be a misspelling the invoice then silently does not offer. Required to
9
+ * OPERATE: an invoice with no method selected has no way to be paid, so the
10
+ * connection is real and reported as "conectado, falta configurar".
11
+ */
12
+ export declare const STRIPE_SETTINGS: ConnectorSetting[];
13
+ export declare const stripeConnectorDef: ConnectorDefinition;
14
+ //# sourceMappingURL=connectorDef.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connectorDef.d.ts","sourceRoot":"","sources":["../../../src/integrations/stripe/connectorDef.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAKL,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACtB,MAAM,eAAe,CAAA;AAItB,eAAO,MAAM,mBAAmB,WAAW,CAAA;AAE3C;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,EAAE,gBAAgB,EAiC7C,CAAA;AAeD,eAAO,MAAM,kBAAkB,EAAE,mBAwGhC,CAAA"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * The edge function that will hold every Stripe call this connector makes.
3
+ * It exists in no repo and is deployed to no pool yet (FAY-1393) — which is
4
+ * why connectorDef.tsx declares no startOAuth.
5
+ */
6
+ export declare const STRIPE_FUNCTION = "stripe-financial-sync";
7
+ /** What the tenant gets back after asking Stripe to charge an invoice. */
8
+ export interface StripeCharge {
9
+ /** `in_…` — the invoice at Stripe. Mirrored onto `Invoice.metadata`. */
10
+ stripeInvoiceId: string;
11
+ /** Where to send the customer. Absent while the invoice is still a draft. */
12
+ paymentUrl?: string;
13
+ /** Stripe's own word for where the charge stands. */
14
+ stripeStatus: string;
15
+ }
16
+ /**
17
+ * Ask Stripe who this grant belongs to.
18
+ *
19
+ * The credential is not in this app, so the browser cannot check it. What comes
20
+ * back is the account's name — the only answer a person can verify. "Sim, é a
21
+ * minha conta" is a different statement from "a chamada não deu erro".
22
+ */
23
+ export declare function checkAccount(): Promise<{
24
+ ok: boolean;
25
+ message?: string;
26
+ }>;
27
+ /**
28
+ * Raise this receivable at Stripe and get back somewhere to pay it.
29
+ *
30
+ * Idempotent on the Fayz invoice id: pressing "Cobrar no Stripe" twice returns
31
+ * the SAME Stripe invoice rather than billing the customer twice, which is the
32
+ * one mistake here that costs real money and cannot be taken back quietly.
33
+ */
34
+ export declare function chargeInvoice(invoiceId: string): Promise<StripeCharge>;
35
+ /**
36
+ * Re-read one invoice's status from Stripe.
37
+ *
38
+ * The webhook is what normally moves a receivable to paid; this is the manual
39
+ * "conferir agora" for when someone is looking at the screen and does not want
40
+ * to wonder whether the webhook arrived.
41
+ */
42
+ export declare function refreshInvoice(invoiceId: string): Promise<StripeCharge>;
43
+ //# sourceMappingURL=data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../src/integrations/stripe/data.ts"],"names":[],"mappings":"AAcA;;;;GAIG;AACH,eAAO,MAAM,eAAe,0BAA0B,CAAA;AAEtD,0EAA0E;AAC1E,MAAM,WAAW,YAAY;IAC3B,wEAAwE;IACxE,eAAe,EAAE,MAAM,CAAA;IACvB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,qDAAqD;IACrD,YAAY,EAAE,MAAM,CAAA;CACrB;AAqCD;;;;;;GAMG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAAC;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAEzE;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAEtE;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAEvE"}
@@ -0,0 +1,12 @@
1
+ import type { PluginEventDefinition, MessageDefaultsDef } from '@fayz-ai/core';
2
+ /**
3
+ * Os FATOS do financeiro.
4
+ *
5
+ * Todos auditados: dinheiro é justamente o assunto em que "quem emitiu isto?"
6
+ * e "quando foi baixado?" precisam de resposta — e a trilha é o único lugar
7
+ * onde a resposta sobrevive a uma edição posterior. 'invoice_due_soon' é a
8
+ * exceção: é o calendário passando, não um ato de alguém.
9
+ */
10
+ export declare function buildFinancialDomainEvents(): PluginEventDefinition[];
11
+ export declare function buildFinancialMessageDefaults(): MessageDefaultsDef[];
12
+ //# sourceMappingURL=message-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-events.d.ts","sourceRoot":"","sources":["../../src/lib/message-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,kBAAkB,EAAc,MAAM,eAAe,CAAA;AAyB1F;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,IAAI,qBAAqB,EAAE,CAuBpE;AAED,wBAAgB,6BAA6B,IAAI,kBAAkB,EAAE,CA6EpE"}
@@ -1,4 +1,4 @@
1
- import type { QuickTransactionType } from './types';
1
+ import type { QuickTransactionType } from '../types';
2
2
  export interface QuickAddRequest {
3
3
  type: QuickTransactionType;
4
4
  /** Foreground the receipt/attachment step + auto-open the picker. */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quick-add.d.ts","sourceRoot":"","sources":["../../src/lib/quick-add.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAEpD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,oBAAoB,CAAA;IAC1B,qEAAqE;IACrE,OAAO,EAAE,OAAO,CAAA;CACjB;AASD,oEAAoE;AACpE,wBAAgB,YAAY,CAAC,IAAI,GAAE,oBAAgC,EAAE,OAAO,UAAQ,GAAG,IAAI,CAG1F;AAED,mDAAmD;AACnD,wBAAgB,eAAe,IAAI,eAAe,GAAG,IAAI,CAIxD;AAaD,oEAAoE;AACpE,wBAAgB,kBAAkB,IAAI,eAAe,GAAG,IAAI,CAE3D"}
@@ -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,CA2erC,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,CAkfrC,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,CA2evC,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,CAqfvC,CAAA"}
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import type { StoreApi } from 'zustand/vanilla';
3
- import { type ResolvedFinancialConfig } from './FinancialContext';
4
- import type { FinancialDataProvider } from './data/types';
5
- import type { FinancialUIState } from './store';
3
+ import { type ResolvedFinancialConfig } from '../context';
4
+ import type { FinancialDataProvider } from '../data/types';
5
+ import type { FinancialUIState } from '../store';
6
6
  import type { PluginRegistryDef } from '@fayz-ai/core';
7
7
  export interface ViewIntent {
8
8
  view: string;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FinancialPage.d.ts","sourceRoot":"","sources":["../../src/views/FinancialPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAA;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAG/C,OAAO,EAA4B,KAAK,uBAAuB,EAAE,MAAM,YAAY,CAAA;AACnF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAqB,MAAM,eAAe,CAAA;AAuBzE,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;AAuID,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,qBA0PA"}
@@ -1 +1 @@
1
- {"version":3,"file":"InvoiceDetailView.d.ts","sourceRoot":"","sources":["../../src/views/InvoiceDetailView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAU1D,OAAO,KAAK,EAA2C,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAY7F,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;IACrF,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,oBAAoB,CAAA;IAC/B,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,8FAA8F;IAC9F,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,qBA0kBA"}
1
+ {"version":3,"file":"InvoiceDetailView.d.ts","sourceRoot":"","sources":["../../src/views/InvoiceDetailView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAa1D,OAAO,KAAK,EAA2C,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAY7F,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;IACrF,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,oBAAoB,CAAA;IAC/B,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,8FAA8F;IAC9F,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,qBA4aA"}
@@ -1 +1 @@
1
- {"version":3,"file":"InvoiceFormView.d.ts","sourceRoot":"","sources":["../../src/views/InvoiceFormView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAY1D,OAAO,KAAK,EAAE,oBAAoB,EAA+C,MAAM,UAAU,CAAA;AAMjG,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,OAAO,CAAA;CACf;AA0WD,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;IAC9D,SAAS,EAAE,oBAAoB,CAAA;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAChC,qBA4iBA"}
1
+ {"version":3,"file":"InvoiceFormView.d.ts","sourceRoot":"","sources":["../../src/views/InvoiceFormView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAc1D,OAAO,KAAK,EAAE,oBAAoB,EAAkE,MAAM,UAAU,CAAA;AAgBpH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,OAAO,CAAA;CACf;AAuHD,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;IAC9D,SAAS,EAAE,oBAAoB,CAAA;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAChC,qBA+mBA"}
@@ -1 +1 @@
1
- {"version":3,"file":"InvoiceListView.d.ts","sourceRoot":"","sources":["../../src/views/InvoiceListView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAA;AAQ3D,OAAO,KAAK,EAAE,oBAAoB,EAA2D,MAAM,UAAU,CAAA;AAmG7G,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;IAC5D,SAAS,EAAE,oBAAoB,CAAA;IAC/B,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;IAClB,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9B,qBAmNA"}
1
+ {"version":3,"file":"InvoiceListView.d.ts","sourceRoot":"","sources":["../../src/views/InvoiceListView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAA;AAO3D,OAAO,KAAK,EAAE,oBAAoB,EAA2D,MAAM,UAAU,CAAA;AAmG7G,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;IAC5D,SAAS,EAAE,oBAAoB,CAAA;IAC/B,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;IAClB,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9B,qBAwOA"}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { ViewIntent } from '../FinancialPage';
2
+ import type { ViewIntent } from './FinancialPage';
3
3
  export declare function PayablesView({ intent, onNavigate, previousView, back }: {
4
4
  intent: ViewIntent;
5
5
  onNavigate: (view: string) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"PayablesView.d.ts","sourceRoot":"","sources":["../../src/views/PayablesView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE;IACvE,MAAM,EAAE,UAAU,CAAA;IAClB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,yEAAyE;IACzE,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CACvC,qBAgCA"}
1
+ {"version":3,"file":"PayablesView.d.ts","sourceRoot":"","sources":["../../src/views/PayablesView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE;IACvE,MAAM,EAAE,UAAU,CAAA;IAClB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,yEAAyE;IACzE,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CACvC,qBAgCA"}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { ViewIntent } from '../FinancialPage';
2
+ import type { ViewIntent } from './FinancialPage';
3
3
  export declare function ReceivablesView({ intent, onNavigate, previousView, back }: {
4
4
  intent: ViewIntent;
5
5
  onNavigate: (view: string) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"ReceivablesView.d.ts","sourceRoot":"","sources":["../../src/views/ReceivablesView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE;IAC1E,MAAM,EAAE,UAAU,CAAA;IAClB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,yEAAyE;IACzE,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CACvC,qBAgCA"}
1
+ {"version":3,"file":"ReceivablesView.d.ts","sourceRoot":"","sources":["../../src/views/ReceivablesView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE;IAC1E,MAAM,EAAE,UAAU,CAAA;IAClB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,yEAAyE;IACzE,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CACvC,qBAgCA"}
@@ -1 +1 @@
1
- {"version":3,"file":"StatementsView.d.ts","sourceRoot":"","sources":["../../src/views/StatementsView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAA;AAuD3D,wBAAgB,cAAc,CAAC,EAAE,UAAU,EAAE,EAAE;IAAE,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,qBAuQrF"}
1
+ {"version":3,"file":"StatementsView.d.ts","sourceRoot":"","sources":["../../src/views/StatementsView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAA;AAuD3D,wBAAgB,cAAc,CAAC,EAAE,UAAU,EAAE,EAAE;IAAE,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,qBAgUrF"}
@@ -1,6 +1,6 @@
1
1
  import type { StoreApi } from 'zustand';
2
2
  import type { DashboardWidgetDef } from '@fayz-ai/core';
3
- import { type ResolvedFinancialConfig } from '../FinancialContext';
3
+ import { type ResolvedFinancialConfig } from '../context';
4
4
  import type { FinancialDataProvider } from '../data/types';
5
5
  import type { FinancialUIState } from '../store';
6
6
  export declare function createFinancialDashboardWidgets(ctx: {
@@ -1 +1 @@
1
- {"version":3,"file":"dashboardWidgets.d.ts","sourceRoot":"","sources":["../../src/views/dashboardWidgets.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAMvD,OAAO,EAAyG,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AACzK,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAgYhD,wBAAgB,+BAA+B,CAAC,GAAG,EAAE;IACnD,MAAM,EAAE,uBAAuB,CAAA;IAC/B,QAAQ,EAAE,qBAAqB,CAAA;IAC/B,KAAK,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAA;CAClC,GAAG,kBAAkB,EAAE,CAoCvB"}
1
+ {"version":3,"file":"dashboardWidgets.d.ts","sourceRoot":"","sources":["../../src/views/dashboardWidgets.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAMvD,OAAO,EAAyG,KAAK,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAChK,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAgYhD,wBAAgB,+BAA+B,CAAC,GAAG,EAAE;IACnD,MAAM,EAAE,uBAAuB,CAAA;IAC/B,QAAQ,EAAE,qBAAqB,CAAA;IAC/B,KAAK,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAA;CAClC,GAAG,kBAAkB,EAAE,CAoCvB"}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "fayz": {
4
4
  "status": "beta"
5
5
  },
6
- "version": "0.9.0",
6
+ "version": "0.9.2",
7
7
  "description": "Fayz SDK — plugin-financial plugin",
8
8
  "type": "module",
9
9
  "sideEffects": false,
@@ -12,37 +12,35 @@
12
12
  "types": "./dist/index.d.ts",
13
13
  "exports": {
14
14
  ".": {
15
- "source": "./src/index.ts",
16
15
  "types": "./dist/index.d.ts",
17
16
  "import": "./dist/index.js"
18
17
  }
19
18
  },
20
19
  "files": [
21
- "dist",
22
- "src"
20
+ "dist"
23
21
  ],
24
22
  "peerDependencies": {
23
+ "lucide-react": ">=0.400.0 <1.0.0",
25
24
  "react": "^18.0.0 || ^19.0.0",
26
25
  "react-dom": "^18.0.0 || ^19.0.0",
27
- "zustand": "^4.5.0 || ^5.0.0",
28
- "lucide-react": ">=0.400.0 <1.0.0"
26
+ "zustand": "^4.5.0 || ^5.0.0"
29
27
  },
30
28
  "dependencies": {
31
29
  "@tanstack/react-table": "^8.20.0",
32
- "@fayz-ai/ui": "^0.9.0",
33
- "@fayz-ai/core": "^0.9.0",
34
- "@fayz-ai/saas": "^0.9.0"
30
+ "@fayz-ai/admin": "^0.11.0",
31
+ "@fayz-ai/core": "^0.11.0",
32
+ "@fayz-ai/ui": "^0.11.0"
35
33
  },
36
34
  "devDependencies": {
37
35
  "@types/react": "^18.3.0",
36
+ "@types/react-dom": "^18.3.0",
37
+ "lucide-react": "^0.400.0",
38
38
  "react": "^18.3.0",
39
+ "react-dom": "^18.3.0",
39
40
  "tsup": "^8.2.0",
40
41
  "typescript": "^5.5.0",
41
- "@types/react-dom": "^18.3.0",
42
42
  "vitest": "^4.1.5",
43
- "react-dom": "^18.3.0",
44
- "zustand": "^4.5.0",
45
- "lucide-react": "^0.400.0"
43
+ "zustand": "^4.5.0"
46
44
  },
47
45
  "license": "MIT",
48
46
  "keywords": [
@@ -56,7 +54,7 @@
56
54
  "scripts": {
57
55
  "build": "tsup && tsc --emitDeclarationOnly --declaration --declarationMap --noEmit false",
58
56
  "dev": "tsup --watch",
59
- "typecheck": "tsc --noEmit",
57
+ "typecheck": "tsc --noEmit -p tsconfig.test.json",
60
58
  "test": "vitest run",
61
59
  "clean": "rm -rf dist"
62
60
  }
@@ -1 +0,0 @@
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;IACd,mGAAmG;IACnG,cAAc,EAAE,OAAO,CAAA;IACvB,sFAAsF;IACtF,YAAY,EAAE,OAAO,CAAA;CACtB;AAED,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAA;AAE9C,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,OAAO,CAAA;CACf;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,gBAAgB,CAAA;IACzB,oFAAoF;IACpF,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,qBAAqB,CAAA;IAC7B,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,SAAS,EAAE,cAAc,EAAE,CAAA;IAC3B,sBAAsB,EAAE,OAAO,CAAA;IAC/B,aAAa,EAAE;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IACvD,SAAS,EAAE,cAAc,EAAE,CAAA;IAC3B,aAAa,EAAE,eAAe,CAAA;IAC9B,aAAa,CAAC,EAAE,YAAY,CAAA;IAC5B,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C;;;;2CAIuC;IACvC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACtC;AAID,eAAO,MAAM,wBAAwB;;;;;EAAsB,CAAA;AAC3D,eAAO,MAAM,kBAAkB,+BAAgB,CAAA;AAC/C,eAAO,MAAM,oBAAoB,6BAAkB,CAAA;AACnD,eAAO,MAAM,iBAAiB,oDAAe,CAAA;AAE7C,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FinancialPage.d.ts","sourceRoot":"","sources":["../src/FinancialPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAA;AACxE,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;AAuBzE,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;AAuID,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,qBA8OA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=contract.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contract.test.d.ts","sourceRoot":"","sources":["../src/contract.test.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"quick-add.d.ts","sourceRoot":"","sources":["../src/quick-add.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEnD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,oBAAoB,CAAA;IAC1B,qEAAqE;IACrE,OAAO,EAAE,OAAO,CAAA;CACjB;AASD,oEAAoE;AACpE,wBAAgB,YAAY,CAAC,IAAI,GAAE,oBAAgC,EAAE,OAAO,UAAQ,GAAG,IAAI,CAG1F;AAED,mDAAmD;AACnD,wBAAgB,eAAe,IAAI,eAAe,GAAG,IAAI,CAIxD;AAaD,oEAAoE;AACpE,wBAAgB,kBAAkB,IAAI,eAAe,GAAG,IAAI,CAE3D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"registries.d.ts","sourceRoot":"","sources":["../src/registries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAwMtD,eAAO,MAAM,mBAAmB,EAAE,iBAAiB,EA2GlD,CAAA"}
@@ -1,59 +0,0 @@
1
- import { createPluginContext, formatCurrency, type CurrencyConfig, type EntityLookupMap, type EntityLookup } from '@fayz-ai/saas'
2
- import type { FinancialPluginLabels, ItemTypeOption } from './index'
3
- import type { FinancialDataProvider } from './data/types'
4
- import type { FinancialUIState } from './store'
5
-
6
- // ---------------------------------------------------------------------------
7
- // Resolved config — fully merged, no optionals
8
- // ---------------------------------------------------------------------------
9
-
10
- export interface FinancialModules {
11
- payables: boolean
12
- receivables: boolean
13
- cashRegisters: boolean
14
- statements: boolean
15
- commissions: boolean
16
- cards: boolean
17
- /** Bank reconciliation (conciliação). Opt-in — enable when a bank connector imports statements. */
18
- reconciliation: boolean
19
- /** Notas fiscais (NF-e/NFC-e/NFS-e). Opt-in — enable for fiscal-document tracking. */
20
- notasFiscais: boolean
21
- }
22
-
23
- export type FinancialCurrency = CurrencyConfig
24
-
25
- export interface LocationOption {
26
- id: string
27
- name: string
28
- isHQ?: boolean
29
- }
30
-
31
- export interface ResolvedFinancialConfig {
32
- modules: FinancialModules
33
- /** Show the plugin's own quick-add header buttons / FAB. Opt-in (default false). */
34
- quickAdd: boolean
35
- labels: FinancialPluginLabels
36
- currency: FinancialCurrency
37
- itemTypes: ItemTypeOption[]
38
- enableServiceExecution: boolean
39
- contactEntity: { archetypeKind: string; label: string }
40
- locations: LocationOption[]
41
- entityLookups: EntityLookupMap
42
- contactLookup?: EntityLookup
43
- onBookingClick?: (orderId: string) => void
44
- /** Internal nav item id → access feature id, exactly as the APP declared it
45
- * (`options.navFeatureMap`; empty when the app gates nothing — the plugin
46
- * ships no defaults). Drives BOTH the sub-module link paywall
47
- * (`useModuleNavAccess`) and the matching content gate, so the two can't
48
- * drift. Unmapped ids are ungated. */
49
- navFeatureMap: Record<string, string>
50
- }
51
-
52
- const ctx = createPluginContext<ResolvedFinancialConfig, FinancialDataProvider, FinancialUIState>('FinancialPage')
53
-
54
- export const FinancialContextProvider = ctx.ContextProvider
55
- export const useFinancialConfig = ctx.useConfig
56
- export const useFinancialProvider = ctx.useProvider
57
- export const useFinancialStore = ctx.useStore
58
-
59
- export { formatCurrency }