@powerhousedao/contributor-billing 0.1.54 → 1.0.0-dev.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.
Files changed (83) hide show
  1. package/dist/document-models/account-transactions/gen/schema/zod.d.ts.map +1 -1
  2. package/dist/document-models/account-transactions/gen/schema/zod.js +3 -3
  3. package/dist/document-models/account-transactions/module.d.ts +1 -1
  4. package/dist/document-models/account-transactions/module.d.ts.map +1 -1
  5. package/dist/document-models/account-transactions/module.js +1 -1
  6. package/dist/document-models/accounts/gen/schema/zod.d.ts.map +1 -1
  7. package/dist/document-models/accounts/module.d.ts +1 -1
  8. package/dist/document-models/accounts/module.d.ts.map +1 -1
  9. package/dist/document-models/accounts/module.js +1 -1
  10. package/dist/document-models/billing-statement/gen/schema/zod.d.ts.map +1 -1
  11. package/dist/document-models/billing-statement/gen/schema/zod.js +4 -4
  12. package/dist/document-models/billing-statement/module.d.ts +1 -1
  13. package/dist/document-models/billing-statement/module.d.ts.map +1 -1
  14. package/dist/document-models/billing-statement/module.js +1 -1
  15. package/dist/document-models/expense-report/gen/schema/zod.d.ts.map +1 -1
  16. package/dist/document-models/expense-report/gen/schema/zod.js +38 -18
  17. package/dist/document-models/expense-report/module.d.ts +1 -1
  18. package/dist/document-models/expense-report/module.d.ts.map +1 -1
  19. package/dist/document-models/expense-report/module.js +1 -1
  20. package/dist/document-models/invoice/gen/schema/zod.js +11 -11
  21. package/dist/document-models/invoice/module.d.ts +1 -1
  22. package/dist/document-models/invoice/module.d.ts.map +1 -1
  23. package/dist/document-models/invoice/module.js +1 -1
  24. package/dist/document-models/invoice/src/reducers/general.d.ts.map +1 -1
  25. package/dist/document-models/invoice/src/reducers/general.js +8 -0
  26. package/dist/document-models/invoice/src/reducers/transitions.d.ts.map +1 -1
  27. package/dist/document-models/invoice/src/reducers/transitions.js +4 -0
  28. package/dist/document-models/operational-hub-profile/module.d.ts +1 -1
  29. package/dist/document-models/operational-hub-profile/module.d.ts.map +1 -1
  30. package/dist/document-models/operational-hub-profile/module.js +1 -1
  31. package/dist/document-models/snapshot-report/gen/schema/zod.d.ts.map +1 -1
  32. package/dist/document-models/snapshot-report/gen/schema/zod.js +12 -12
  33. package/dist/document-models/snapshot-report/module.d.ts +1 -1
  34. package/dist/document-models/snapshot-report/module.d.ts.map +1 -1
  35. package/dist/document-models/snapshot-report/module.js +1 -1
  36. package/dist/editors/builder-team-admin/components/DriveExplorer.d.ts.map +1 -1
  37. package/dist/editors/builder-team-admin/components/DriveExplorer.js +64 -4
  38. package/dist/editors/builder-team-admin/module.js +1 -1
  39. package/dist/editors/contributor-billing/components/DashboardHome.d.ts.map +1 -1
  40. package/dist/editors/contributor-billing/components/DashboardHome.js +2 -8
  41. package/dist/editors/contributor-billing/components/DriveExplorer.d.ts.map +1 -1
  42. package/dist/editors/contributor-billing/components/DriveExplorer.js +52 -1
  43. package/dist/editors/contributor-billing/components/FolderTree.d.ts.map +1 -1
  44. package/dist/editors/contributor-billing/components/FolderTree.js +6 -15
  45. package/dist/editors/contributor-billing/components/MonthReportCard.d.ts +8 -1
  46. package/dist/editors/contributor-billing/components/MonthReportCard.d.ts.map +1 -1
  47. package/dist/editors/contributor-billing/components/MonthReportCard.js +6 -3
  48. package/dist/editors/contributor-billing/components/MonthlyReportsOverview.d.ts +1 -1
  49. package/dist/editors/contributor-billing/components/MonthlyReportsOverview.d.ts.map +1 -1
  50. package/dist/editors/contributor-billing/components/MonthlyReportsOverview.js +56 -3
  51. package/dist/editors/contributor-billing/components/cbToast.d.ts.map +1 -1
  52. package/dist/editors/contributor-billing/hooks/useDocumentAutoPlacement.d.ts.map +1 -1
  53. package/dist/editors/contributor-billing/hooks/useDocumentAutoPlacement.js +42 -2
  54. package/dist/editors/contributor-billing/module.js +1 -1
  55. package/dist/editors/invoice/editor.d.ts.map +1 -1
  56. package/dist/editors/invoice/editor.js +3 -2
  57. package/dist/editors/invoice/legalEntity/legalEntity.d.ts +2 -1
  58. package/dist/editors/invoice/legalEntity/legalEntity.d.ts.map +1 -1
  59. package/dist/editors/invoice/legalEntity/legalEntity.js +2 -2
  60. package/dist/editors/invoice/legalEntity/walletSection.d.ts +1 -0
  61. package/dist/editors/invoice/legalEntity/walletSection.d.ts.map +1 -1
  62. package/dist/editors/invoice/legalEntity/walletSection.js +2 -2
  63. package/dist/editors/invoice/validation/validationHandler.d.ts +1 -1
  64. package/dist/editors/invoice/validation/validationHandler.d.ts.map +1 -1
  65. package/dist/editors/invoice/validation/validationHandler.js +14 -1
  66. package/dist/editors/invoice/validation/validationManager.d.ts.map +1 -1
  67. package/dist/editors/invoice/validation/validationManager.js +3 -1
  68. package/dist/editors/invoice/validation/validationRules.d.ts +2 -0
  69. package/dist/editors/invoice/validation/validationRules.d.ts.map +1 -1
  70. package/dist/editors/invoice/validation/validationRules.js +50 -0
  71. package/dist/style.css +96 -3
  72. package/dist/subgraphs/budget-statements/resolvers.d.ts +38 -0
  73. package/dist/subgraphs/budget-statements/resolvers.d.ts.map +1 -1
  74. package/dist/subgraphs/budget-statements/resolvers.js +151 -44
  75. package/dist/subgraphs/budget-statements/resolvers.test.d.ts +2 -0
  76. package/dist/subgraphs/budget-statements/resolvers.test.d.ts.map +1 -0
  77. package/dist/subgraphs/budget-statements/resolvers.test.js +329 -0
  78. package/dist/subgraphs/budget-statements/schema.d.ts.map +1 -1
  79. package/dist/subgraphs/budget-statements/schema.js +8 -0
  80. package/package.json +33 -26
  81. package/dist/editors/contributor-billing/components/CreateHubProfileModal.d.ts +0 -12
  82. package/dist/editors/contributor-billing/components/CreateHubProfileModal.d.ts.map +0 -1
  83. package/dist/editors/contributor-billing/components/CreateHubProfileModal.js +0 -74
@@ -82,6 +82,7 @@ export default function Editor() {
82
82
  const [bankCountryValidation, setBankCountryValidation] = useState(null);
83
83
  const [routingNumberValidation, setRoutingNumberValidation] = useState(null);
84
84
  const [accountNumberValidation, setAccountNumberValidation] = useState(null);
85
+ const [chainValidation, setChainValidation] = useState(null);
85
86
  // Replace showConfirmationModal and pendingStatus with a single modal state
86
87
  const [activeModal, setActiveModal] = useState(null);
87
88
  // Track warning state for modal
@@ -318,7 +319,7 @@ export default function Editor() {
318
319
  }
319
320
  // Replace handleStatusChange logic for opening modals
320
321
  const handleStatusChange = (newStatus) => {
321
- const validationResult = validateStatusBeforeContinue(newStatus, state, setInvoiceValidation, setWalletValidation, setCurrencyValidation, setMainCountryValidation, setBankCountryValidation, setIbanValidation, setBicValidation, setAccountNumberValidation, setBankNameValidation, setStreetAddressValidation, setCityValidation, setPostalCodeValidation, setPayerEmailValidation, setLineItemValidation, setRoutingNumberValidation, isFiatCurrency);
322
+ const validationResult = validateStatusBeforeContinue(newStatus, state, setInvoiceValidation, setWalletValidation, setCurrencyValidation, setMainCountryValidation, setBankCountryValidation, setIbanValidation, setBicValidation, setAccountNumberValidation, setBankNameValidation, setStreetAddressValidation, setCityValidation, setPostalCodeValidation, setPayerEmailValidation, setLineItemValidation, setRoutingNumberValidation, isFiatCurrency, setChainValidation);
322
323
  if (validationResult) {
323
324
  return;
324
325
  }
@@ -440,7 +441,7 @@ export default function Editor() {
440
441
  if (datetime !== state.dateDelivered) {
441
442
  dispatch(actions.editInvoice({ dateDelivered: datetime }));
442
443
  }
443
- }, value: datetimeToDate(state.dateDelivered) })] })] }), _jsx(LegalEntityForm, { legalEntity: state.issuer, onChangeInfo: (input) => dispatch(actions.editIssuer(input)), onChangeBank: (input) => dispatch(actions.editIssuerBank(input)), onChangeWallet: (input) => dispatch(actions.editIssuerWallet(input)), basicInfoDisabled: false, bankDisabled: !fiatMode, walletDisabled: fiatMode, currency: state.currency, status: state.status, walletvalidation: walletValidation, mainCountryValidation: mainCountryValidation, bankCountryValidation: bankCountryValidation, ibanvalidation: ibanValidation, bicvalidation: bicValidation, banknamevalidation: bankNameValidation, streetaddressvalidation: streetAddressValidation, cityvalidation: cityValidation, postalcodevalidation: postalCodeValidation, payeremailvalidation: payerEmailValidation, routingNumbervalidation: routingNumberValidation, accountNumbervalidation: accountNumberValidation })] }), _jsxs("div", { className: "border border-gray-200 rounded-lg p-4 min-w-0", children: [_jsx("h3", { className: "text-lg font-semibold mb-4", children: "Payer" }), _jsxs("div", { className: "mb-2 w-64", children: [_jsx("label", { className: "block mb-1 text-sm", children: "Due Date:" }), _jsx(DatePicker, { name: "dateDue", className: String.raw `w-full p-0 bg-white`, onChange: (e) => {
444
+ }, value: datetimeToDate(state.dateDelivered) })] })] }), _jsx(LegalEntityForm, { legalEntity: state.issuer, onChangeInfo: (input) => dispatch(actions.editIssuer(input)), onChangeBank: (input) => dispatch(actions.editIssuerBank(input)), onChangeWallet: (input) => dispatch(actions.editIssuerWallet(input)), basicInfoDisabled: false, bankDisabled: !fiatMode, walletDisabled: fiatMode, currency: state.currency, status: state.status, walletvalidation: walletValidation, chainvalidation: chainValidation, mainCountryValidation: mainCountryValidation, bankCountryValidation: bankCountryValidation, ibanvalidation: ibanValidation, bicvalidation: bicValidation, banknamevalidation: bankNameValidation, streetaddressvalidation: streetAddressValidation, cityvalidation: cityValidation, postalcodevalidation: postalCodeValidation, payeremailvalidation: payerEmailValidation, routingNumbervalidation: routingNumberValidation, accountNumbervalidation: accountNumberValidation })] }), _jsxs("div", { className: "border border-gray-200 rounded-lg p-4 min-w-0", children: [_jsx("h3", { className: "text-lg font-semibold mb-4", children: "Payer" }), _jsxs("div", { className: "mb-2 w-64", children: [_jsx("label", { className: "block mb-1 text-sm", children: "Due Date:" }), _jsx(DatePicker, { name: "dateDue", className: String.raw `w-full p-0 bg-white`, onChange: (e) => {
444
445
  const dateOnly = e.target.value.split("T")[0];
445
446
  const datetime = dateToDatetime(dateOnly);
446
447
  dispatch(actions.editInvoice({
@@ -31,6 +31,7 @@ type LegalEntityFormProps = {
31
31
  readonly currency: string;
32
32
  readonly status: string;
33
33
  readonly walletvalidation?: ValidationResult | null;
34
+ readonly chainvalidation?: ValidationResult | null;
34
35
  readonly mainCountryValidation?: ValidationResult | null;
35
36
  readonly bankCountryValidation?: ValidationResult | null;
36
37
  readonly ibanvalidation?: ValidationResult | null;
@@ -43,6 +44,6 @@ type LegalEntityFormProps = {
43
44
  readonly routingNumbervalidation?: ValidationResult | null;
44
45
  readonly accountNumbervalidation?: ValidationResult | null;
45
46
  };
46
- export declare function LegalEntityForm({ legalEntity, onChangeInfo, onChangeBank, onChangeWallet, basicInfoDisabled, bankDisabled, walletDisabled, currency, status, walletvalidation, mainCountryValidation, bankCountryValidation, ibanvalidation, bicvalidation, banknamevalidation, streetaddressvalidation, cityvalidation, postalcodevalidation, payeremailvalidation, routingNumbervalidation, accountNumbervalidation, }: LegalEntityFormProps): import("react/jsx-runtime").JSX.Element;
47
+ export declare function LegalEntityForm({ legalEntity, onChangeInfo, onChangeBank, onChangeWallet, basicInfoDisabled, bankDisabled, walletDisabled, currency, status, walletvalidation, chainvalidation, mainCountryValidation, bankCountryValidation, ibanvalidation, bicvalidation, banknamevalidation, streetaddressvalidation, cityvalidation, postalcodevalidation, payeremailvalidation, routingNumbervalidation, accountNumbervalidation, }: LegalEntityFormProps): import("react/jsx-runtime").JSX.Element;
47
48
  export {};
48
49
  //# sourceMappingURL=legalEntity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"legalEntity.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/legalEntity/legalEntity.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,WAAW,EACZ,MAAM,2CAA2C,CAAC;AACnD,OAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAK1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAI3E,MAAM,MAAM,0BAA0B,GAClC,qBAAqB,GACrB,oBAAoB,CAAC;AAEzB,MAAM,MAAM,wBAAwB,GAAG,mBAAmB,GAAG,kBAAkB,CAAC;AAChF,MAAM,MAAM,oBAAoB,GAA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gBAAgB,GAAG,IAAI,CAAC;IAClD,QAAQ,CAAC,oBAAoB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACxD,QAAQ,CAAC,oBAAoB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACxD,QAAQ,CAAC,uBAAuB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC3D,QAAQ,CAAC,uBAAuB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC5D,CAAC;AAqBF,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,MAAM,EACN,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,GACxB,EAAE,oBAAoB,2CA6CtB"}
@@ -106,12 +106,12 @@ function flattenLegalEntityToEditInput(legalEntity) {
106
106
  email: legalEntity.contactInfo?.email ?? "",
107
107
  };
108
108
  }
109
- export function LegalEntityForm({ legalEntity, onChangeInfo, onChangeBank, onChangeWallet, basicInfoDisabled, bankDisabled, walletDisabled, currency, status, walletvalidation, mainCountryValidation, bankCountryValidation, ibanvalidation, bicvalidation, banknamevalidation, streetaddressvalidation, cityvalidation, postalcodevalidation, payeremailvalidation, routingNumbervalidation, accountNumbervalidation, }) {
109
+ export function LegalEntityForm({ legalEntity, onChangeInfo, onChangeBank, onChangeWallet, basicInfoDisabled, bankDisabled, walletDisabled, currency, status, walletvalidation, chainvalidation, mainCountryValidation, bankCountryValidation, ibanvalidation, bicvalidation, banknamevalidation, streetaddressvalidation, cityvalidation, postalcodevalidation, payeremailvalidation, routingNumbervalidation, accountNumbervalidation, }) {
110
110
  // Handler for main info section
111
111
  const handleChangeInfo = (update) => {
112
112
  if (!onChangeInfo)
113
113
  return;
114
114
  onChangeInfo(update);
115
115
  };
116
- return (_jsxs("div", { className: "space-y-8", children: [!basicInfoDisabled && !!onChangeInfo && (_jsx(LegalEntityMainSection, { onChange: handleChangeInfo, value: flattenLegalEntityToEditInput(legalEntity), mainCountryValidation: mainCountryValidation, streetaddressvalidation: streetaddressvalidation, cityvalidation: cityvalidation, postalcodevalidation: postalcodevalidation, payeremailvalidation: payeremailvalidation })), !walletDisabled && !!onChangeWallet && (_jsx(LegalEntityWalletSection, { onChange: onChangeWallet, value: legalEntity.paymentRouting?.wallet || {}, currency: currency, status: status, walletvalidation: walletvalidation })), !bankDisabled && !!onChangeBank && (_jsx(LegalEntityBankSection, { onChange: onChangeBank, currency: currency, value: legalEntity.paymentRouting?.bank || {}, countryvalidation: bankCountryValidation, ibanvalidation: ibanvalidation, bicvalidation: bicvalidation, routingNumbervalidation: routingNumbervalidation, banknamevalidation: banknamevalidation, accountNumbervalidation: accountNumbervalidation }))] }));
116
+ return (_jsxs("div", { className: "space-y-8", children: [!basicInfoDisabled && !!onChangeInfo && (_jsx(LegalEntityMainSection, { onChange: handleChangeInfo, value: flattenLegalEntityToEditInput(legalEntity), mainCountryValidation: mainCountryValidation, streetaddressvalidation: streetaddressvalidation, cityvalidation: cityvalidation, postalcodevalidation: postalcodevalidation, payeremailvalidation: payeremailvalidation })), !walletDisabled && !!onChangeWallet && (_jsx(LegalEntityWalletSection, { onChange: onChangeWallet, value: legalEntity.paymentRouting?.wallet || {}, currency: currency, status: status, walletvalidation: walletvalidation, chainvalidation: chainvalidation })), !bankDisabled && !!onChangeBank && (_jsx(LegalEntityBankSection, { onChange: onChangeBank, currency: currency, value: legalEntity.paymentRouting?.bank || {}, countryvalidation: bankCountryValidation, ibanvalidation: ibanvalidation, bicvalidation: bicvalidation, routingNumbervalidation: routingNumbervalidation, banknamevalidation: banknamevalidation, accountNumbervalidation: accountNumbervalidation }))] }));
117
117
  }
@@ -8,6 +8,7 @@ export type LegalEntityWalletSectionProps = Omit<ComponentProps<"div">, "childre
8
8
  readonly currency: string;
9
9
  readonly status: string;
10
10
  readonly walletvalidation?: ValidationResult | null;
11
+ readonly chainvalidation?: ValidationResult | null;
11
12
  };
12
13
  export declare const LegalEntityWalletSection: (props: LegalEntityWalletSectionProps) => import("react/jsx-runtime").JSX.Element;
13
14
  //# sourceMappingURL=walletSection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"walletSection.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/legalEntity/walletSection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAuB,MAAM,OAAO,CAAC;AAEjE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAEnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAI3E,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAC9C,cAAc,CAAC,KAAK,CAAC,EACrB,UAAU,GAAG,UAAU,CACxB,GAAG;IACF,QAAQ,CAAC,KAAK,EAAE,0BAA0B,CAAC;IAC3C,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,CAAC;IAC/D,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACrD,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,OAAO,6BAA6B,4CAyGrC,CAAC"}
1
+ {"version":3,"file":"walletSection.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/legalEntity/walletSection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAuB,MAAM,OAAO,CAAC;AAEjE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAEnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAI3E,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAC9C,cAAc,CAAC,KAAK,CAAC,EACrB,UAAU,GAAG,UAAU,CACxB,GAAG;IACF,QAAQ,CAAC,KAAK,EAAE,0BAA0B,CAAC;IAC3C,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,CAAC;IAC/D,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACpD,QAAQ,CAAC,eAAe,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACpD,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,OAAO,6BAA6B,4CAiHrC,CAAC"}
@@ -5,7 +5,7 @@ import { InputField } from "../components/inputField.js";
5
5
  import { Select } from "@powerhousedao/document-engineering";
6
6
  import { getAllChainConfigs } from "../utils/utils.js";
7
7
  export const LegalEntityWalletSection = (props) => {
8
- const { value, onChange, disabled, currency, status, walletvalidation, ...divProps } = props;
8
+ const { value, onChange, disabled, currency, status, walletvalidation, chainvalidation, ...divProps } = props;
9
9
  const [localState, setLocalState] = useState(value);
10
10
  useEffect(() => {
11
11
  setLocalState(value);
@@ -50,5 +50,5 @@ export const LegalEntityWalletSection = (props) => {
50
50
  });
51
51
  }
52
52
  };
53
- return (_jsxs("div", { ...divProps, className: twMerge("rounded-lg border border-gray-200 bg-white p-6", props.className), children: [_jsxs("div", { className: "grid grid-cols-2 gap-4 items-center", children: [_jsx("h3", { className: "mb-4 text-lg font-semibold text-black-200", children: "Wallet Information" }), _jsx(Select, { style: { width: "100%" }, options: chainOptions, value: selectedChain || "", onChange: handleChainChange, placeholder: "Select Chain" })] }), _jsx("div", { className: "space-y-6", children: _jsx("div", { className: "space-y-4", children: _jsx(InputField, { value: localState.address ?? "", label: "Wallet Address", placeholder: "0x...", onBlur: (e) => handleBlur("address", e), handleInputChange: (e) => handleInputChange("address", e), validation: walletvalidation }) }) })] }));
53
+ return (_jsxs("div", { ...divProps, className: twMerge("rounded-lg border border-gray-200 bg-white p-6", props.className), children: [_jsxs("div", { className: "grid grid-cols-2 gap-4 items-center", children: [_jsx("h3", { className: "mb-4 text-lg font-semibold text-black-200", children: "Wallet Information" }), _jsxs("div", { children: [_jsx(Select, { style: { width: "100%" }, options: chainOptions, value: selectedChain || "", onChange: handleChainChange, placeholder: "Select Chain" }), chainvalidation && !chainvalidation.isValid && (_jsx("p", { className: "mt-1 text-xs text-yellow-600", children: chainvalidation.message }))] })] }), _jsx("div", { className: "space-y-6", children: _jsx("div", { className: "space-y-4", children: _jsx(InputField, { value: localState.address ?? "", label: "Wallet Address", placeholder: "0x...", onBlur: (e) => handleBlur("address", e), handleInputChange: (e) => handleInputChange("address", e), validation: walletvalidation }) }) })] }));
54
54
  };
@@ -1,4 +1,4 @@
1
1
  import { type ValidationResult } from "./validationManager.js";
2
- declare const validateStatusBeforeContinue: (newStatus: string, state: any, setInvoiceValidation: (validation: ValidationResult) => void, setWalletValidation: (validation: ValidationResult) => void, setCurrencyValidation: (validation: ValidationResult) => void, setMainCountryValidation: (validation: ValidationResult) => void, setBankCountryValidation: (validation: ValidationResult) => void, setIbanValidation: (validation: ValidationResult) => void, setBicValidation: (validation: ValidationResult) => void, setAccountNumberValidation: (validation: ValidationResult) => void, setBankNameValidation: (validation: ValidationResult) => void, setStreetAddressValidation: (validation: ValidationResult) => void, setCityValidation: (validation: ValidationResult) => void, setPostalCodeValidation: (validation: ValidationResult) => void, setPayerEmailValidation: (validation: ValidationResult) => void, setLineItemValidation: (validation: ValidationResult) => void, setRoutingNumberValidation: (validation: ValidationResult) => void, isFiatCurrency: (currency: string) => boolean) => boolean | undefined;
2
+ declare const validateStatusBeforeContinue: (newStatus: string, state: any, setInvoiceValidation: (validation: ValidationResult) => void, setWalletValidation: (validation: ValidationResult) => void, setCurrencyValidation: (validation: ValidationResult) => void, setMainCountryValidation: (validation: ValidationResult) => void, setBankCountryValidation: (validation: ValidationResult) => void, setIbanValidation: (validation: ValidationResult) => void, setBicValidation: (validation: ValidationResult) => void, setAccountNumberValidation: (validation: ValidationResult) => void, setBankNameValidation: (validation: ValidationResult) => void, setStreetAddressValidation: (validation: ValidationResult) => void, setCityValidation: (validation: ValidationResult) => void, setPostalCodeValidation: (validation: ValidationResult) => void, setPayerEmailValidation: (validation: ValidationResult) => void, setLineItemValidation: (validation: ValidationResult) => void, setRoutingNumberValidation: (validation: ValidationResult) => void, isFiatCurrency: (currency: string) => boolean, setChainValidation?: (validation: ValidationResult | null) => void) => boolean | undefined;
3
3
  export default validateStatusBeforeContinue;
4
4
  //# sourceMappingURL=validationHandler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validationHandler.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/validation/validationHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,wBAAwB,CAAC;AAIhC,QAAA,MAAM,4BAA4B,GAChC,WAAW,MAAM,EACjB,OAAO,GAAG,EACV,sBAAsB,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EAC5D,qBAAqB,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EAC3D,uBAAuB,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EAC7D,0BAA0B,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EAChE,0BAA0B,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EAChE,mBAAmB,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EACzD,kBAAkB,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EACxD,4BAA4B,CAAC,UAAU,EAA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IAAI,EAClE,mBAAmB,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EACzD,yBAAyB,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EAC/D,yBAAyB,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EAC/D,uBAAuB,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EAC7D,4BAA4B,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EAClE,gBAAgB,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,EAC7C,qBAAqB,CAAC,UAAU,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI,wBAyPnE,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { validateField, } from "./validationManager.js";
2
2
  import { invoiceToast as toast } from "../invoiceToast.js";
3
3
  import { isValidIBAN } from "./validationRules.js";
4
- const validateStatusBeforeContinue = (newStatus, state, setInvoiceValidation, setWalletValidation, setCurrencyValidation, setMainCountryValidation, setBankCountryValidation, setIbanValidation, setBicValidation, setAccountNumberValidation, setBankNameValidation, setStreetAddressValidation, setCityValidation, setPostalCodeValidation, setPayerEmailValidation, setLineItemValidation, setRoutingNumberValidation, isFiatCurrency) => {
4
+ const validateStatusBeforeContinue = (newStatus, state, setInvoiceValidation, setWalletValidation, setCurrencyValidation, setMainCountryValidation, setBankCountryValidation, setIbanValidation, setBicValidation, setAccountNumberValidation, setBankNameValidation, setStreetAddressValidation, setCityValidation, setPostalCodeValidation, setPayerEmailValidation, setLineItemValidation, setRoutingNumberValidation, isFiatCurrency, setChainValidation) => {
5
5
  if (newStatus === "PAYMENTSCHEDULED" || newStatus === "ISSUED") {
6
6
  const context = {
7
7
  currency: state.currency,
@@ -30,6 +30,19 @@ const validateStatusBeforeContinue = (newStatus, state, setInvoiceValidation, se
30
30
  if (currencyValidation && !currencyValidation.isValid) {
31
31
  validationErrors.push(currencyValidation);
32
32
  }
33
+ // Validate wallet address and chain (required for all currencies)
34
+ const walletAddressValidation = validateField("walletAddress", state.issuer.paymentRouting?.wallet?.address ?? "", context);
35
+ setWalletValidation(walletAddressValidation);
36
+ if (walletAddressValidation && !walletAddressValidation.isValid) {
37
+ validationErrors.push(walletAddressValidation);
38
+ }
39
+ const walletChainValidation = validateField("walletChain", state.issuer.paymentRouting?.wallet?.chainName ||
40
+ state.issuer.paymentRouting?.wallet?.chainId ||
41
+ "", context);
42
+ setChainValidation?.(walletChainValidation);
43
+ if (walletChainValidation && !walletChainValidation.isValid) {
44
+ validationErrors.push(walletChainValidation);
45
+ }
33
46
  // Validate main country
34
47
  const mainCountry = state.issuer.country ?? "";
35
48
  const mainCountryValidation = validateField("mainCountry", mainCountry, context);
@@ -1 +1 @@
1
- {"version":3,"file":"validationManager.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/validation/validationManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAoBxE,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAE9D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,kBAAkB,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,gBAAgB,CAAC;IAC1D,SAAS,EAAE;QACT,UAAU,EAAE,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;QAClC,iBAAiB,EAAE;YACjB,IAAI,EAAE,MAAM,EAAE,CAAC;YACf,EAAE,EAAE,MAAM,EAAE,CAAC;SACd,CAAC;KACH,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAsCF,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,iBAAiB,GACzB,gBAAgB,GAAG,IAAI,CAqBzB;AAGD,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,OAAO,EAAE,iBAAiB,GACzB,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAalC;AAGD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAE5D;AAGD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAKxD"}
1
+ {"version":3,"file":"validationManager.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/validation/validationManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAsBxE,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAE9D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,kBAAkB,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,gBAAgB,CAAC;IAC1D,SAAS,EAAE;QACT,UAAU,EAAE,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;QAClC,iBAAiB,EAAE;YACjB,IAAI,EAAE,MAAM,EAAE,CAAC;YACf,EAAE,EAAE,MAAM,EAAE,CAAC;SACd,CAAC;KACH,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAwCF,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,iBAAiB,GACzB,gBAAgB,GAAG,IAAI,CAqBzB;AAGD,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,OAAO,EAAE,iBAAiB,GACzB,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAalC;AAGD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAE5D;AAGD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAKxD"}
@@ -1,5 +1,5 @@
1
1
  import {} from "../../../document-models/invoice/index.js";
2
- import { accountIbanRule, bicNumberRule, bankNameRule, currencyRule, ethereumAddressRule, invoiceNumberRule, issuerPostalCodeRule, issuerStreetAddressRule, issuerCityRule, payerEmailRule, lineItemRule, mainCountryRule, bankCountryRule, routingNumberRule, accountNumberRule, } from "./validationRules.js";
2
+ import { accountIbanRule, bicNumberRule, bankNameRule, currencyRule, ethereumAddressRule, invoiceNumberRule, issuerPostalCodeRule, issuerStreetAddressRule, issuerCityRule, payerEmailRule, lineItemRule, mainCountryRule, bankCountryRule, routingNumberRule, accountNumberRule, walletAddressRule, walletChainRule, } from "./validationRules.js";
3
3
  // Validation rules registry
4
4
  const validationRules = [];
5
5
  // Register rules
@@ -18,6 +18,8 @@ validationRules.push(payerEmailRule);
18
18
  validationRules.push(lineItemRule);
19
19
  validationRules.push(routingNumberRule);
20
20
  validationRules.push(accountNumberRule);
21
+ validationRules.push(walletAddressRule);
22
+ validationRules.push(walletChainRule);
21
23
  // Helper to check if a rule applies to the current context
22
24
  function ruleAppliesToContext(rule, context) {
23
25
  const { currencies, statusTransitions } = rule.appliesTo;
@@ -2,6 +2,8 @@ import type { ValidationRule } from "./validationManager.js";
2
2
  export declare function isValidIBAN(iban: string): boolean;
3
3
  export declare const invoiceNumberRule: ValidationRule;
4
4
  export declare const ethereumAddressRule: ValidationRule;
5
+ export declare const walletChainRule: ValidationRule;
6
+ export declare const walletAddressRule: ValidationRule;
5
7
  export declare const currencyRule: ValidationRule;
6
8
  export declare const mainCountryRule: ValidationRule;
7
9
  export declare const bankCountryRule: ValidationRule;
@@ -1 +1 @@
1
- {"version":3,"file":"validationRules.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/validation/validationRules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAQ7D,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAajD;AAQD,eAAO,MAAM,iBAAiB,EAAE,cAuB/B,CAAC;AAGF,eAAO,MAAM,mBAAmB,EAAE,cA8BjC,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,cAuB1B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cAuB7B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cAuB7B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cA+B7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,cAgC/B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,cAiC3B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,cAuB1B,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,cAuBrC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cAuB5B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,cAuBlC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cA8B5B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,cAuB1B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,cAqC/B,CAAC"}
1
+ {"version":3,"file":"validationRules.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/validation/validationRules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAQ7D,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAajD;AAQD,eAAO,MAAM,iBAAiB,EAAE,cAuB/B,CAAC;AAGF,eAAO,MAAM,mBAAmB,EAAE,cA8BjC,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,cAuB7B,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,cAuB/B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,cAuB1B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cAuB7B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cAuB7B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cA+B7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,cAgC/B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,cAiC3B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,cAuB1B,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,cAuBrC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cAuB5B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,cAuBlC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cA8B5B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,cAuB1B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,cAqC/B,CAAC"}
@@ -74,6 +74,56 @@ export const ethereumAddressRule = {
74
74
  },
75
75
  },
76
76
  };
77
+ // Wallet chain validation rule - chain must be set for all currencies
78
+ export const walletChainRule = {
79
+ field: "walletChain",
80
+ validate: (value) => {
81
+ if (!value || value.trim() === "") {
82
+ return {
83
+ isValid: false,
84
+ message: "Wallet chain is required before issuing",
85
+ severity: "warning",
86
+ };
87
+ }
88
+ return {
89
+ isValid: true,
90
+ message: "",
91
+ severity: "none",
92
+ };
93
+ },
94
+ appliesTo: {
95
+ currencies: ["ALL"],
96
+ statusTransitions: {
97
+ from: ["DRAFT"],
98
+ to: ["ISSUED"],
99
+ },
100
+ },
101
+ };
102
+ // Wallet address validation rule - address must be set for all currencies
103
+ export const walletAddressRule = {
104
+ field: "walletAddress",
105
+ validate: (value) => {
106
+ if (!value || value.trim() === "") {
107
+ return {
108
+ isValid: false,
109
+ message: "Wallet address is required before issuing",
110
+ severity: "warning",
111
+ };
112
+ }
113
+ return {
114
+ isValid: true,
115
+ message: "",
116
+ severity: "none",
117
+ };
118
+ },
119
+ appliesTo: {
120
+ currencies: ["ALL"],
121
+ statusTransitions: {
122
+ from: ["DRAFT"],
123
+ to: ["ISSUED"],
124
+ },
125
+ },
126
+ };
77
127
  export const currencyRule = {
78
128
  field: "currency",
79
129
  validate: (value) => {
package/dist/style.css CHANGED
@@ -720,9 +720,6 @@
720
720
  .w-\[250px\] {
721
721
  width: 250px;
722
722
  }
723
- .w-\[400px\] {
724
- width: 400px;
725
- }
726
723
  .w-full {
727
724
  width: 100%;
728
725
  }
@@ -1425,6 +1422,21 @@
1425
1422
  --tw-gradient-from: var(--color-purple-400);
1426
1423
  --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
1427
1424
  }
1425
+ .from-purple-400\/20 {
1426
+ --tw-gradient-from: color-mix(in srgb, hsl(264 77% 81%) 20%, transparent);
1427
+ @supports (color: color-mix(in lab, red, red)) {
1428
+ --tw-gradient-from: color-mix(in oklab, var(--color-purple-400) 20%, transparent);
1429
+ }
1430
+ --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
1431
+ }
1432
+ .from-purple-600 {
1433
+ --tw-gradient-from: var(--color-purple-600);
1434
+ --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
1435
+ }
1436
+ .from-purple-700 {
1437
+ --tw-gradient-from: var(--color-purple-700);
1438
+ --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
1439
+ }
1428
1440
  .from-slate-50 {
1429
1441
  --tw-gradient-from: var(--color-slate-50);
1430
1442
  --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
@@ -1449,6 +1461,14 @@
1449
1461
  --tw-gradient-via-stops: var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);
1450
1462
  --tw-gradient-stops: var(--tw-gradient-via-stops);
1451
1463
  }
1464
+ .via-purple-50\/30 {
1465
+ --tw-gradient-via: color-mix(in srgb, oklch(97.7% 0.014 308.299) 30%, transparent);
1466
+ @supports (color: color-mix(in lab, red, red)) {
1467
+ --tw-gradient-via: color-mix(in oklab, var(--color-purple-50) 30%, transparent);
1468
+ }
1469
+ --tw-gradient-via-stops: var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);
1470
+ --tw-gradient-stops: var(--tw-gradient-via-stops);
1471
+ }
1452
1472
  .to-blue-50\/30 {
1453
1473
  --tw-gradient-to: color-mix(in srgb, oklch(97% 0.014 254.604) 30%, transparent);
1454
1474
  @supports (color: color-mix(in lab, red, red)) {
@@ -1797,6 +1817,9 @@
1797
1817
  .text-blue-900 {
1798
1818
  color: var(--color-blue-900);
1799
1819
  }
1820
+ .text-emerald-500 {
1821
+ color: var(--color-emerald-500);
1822
+ }
1800
1823
  .text-emerald-600 {
1801
1824
  color: var(--color-emerald-600);
1802
1825
  }
@@ -1941,6 +1964,11 @@
1941
1964
  color: var(--color-gray-500);
1942
1965
  }
1943
1966
  }
1967
+ .placeholder-slate-400 {
1968
+ &::placeholder {
1969
+ color: var(--color-slate-400);
1970
+ }
1971
+ }
1944
1972
  .opacity-0 {
1945
1973
  opacity: 0%;
1946
1974
  }
@@ -2037,6 +2065,18 @@
2037
2065
  --tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-indigo-400) 30%, transparent) var(--tw-shadow-alpha), transparent);
2038
2066
  }
2039
2067
  }
2068
+ .shadow-purple-500\/30 {
2069
+ --tw-shadow-color: color-mix(in srgb, hsl(264 77% 77%) 30%, transparent);
2070
+ @supports (color: color-mix(in lab, red, red)) {
2071
+ --tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-purple-500) 30%, transparent) var(--tw-shadow-alpha), transparent);
2072
+ }
2073
+ }
2074
+ .shadow-purple-500\/40 {
2075
+ --tw-shadow-color: color-mix(in srgb, hsl(264 77% 77%) 40%, transparent);
2076
+ @supports (color: color-mix(in lab, red, red)) {
2077
+ --tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-purple-500) 40%, transparent) var(--tw-shadow-alpha), transparent);
2078
+ }
2079
+ }
2040
2080
  .shadow-slate-200\/50 {
2041
2081
  --tw-shadow-color: color-mix(in srgb, hsl(210 9% 48%) 50%, transparent);
2042
2082
  @supports (color: color-mix(in lab, red, red)) {
@@ -2696,6 +2736,16 @@
2696
2736
  }
2697
2737
  }
2698
2738
  }
2739
+ .hover\:shadow-purple-500\/50 {
2740
+ &:hover {
2741
+ @media (hover: hover) {
2742
+ --tw-shadow-color: color-mix(in srgb, hsl(264 77% 77%) 50%, transparent);
2743
+ @supports (color: color-mix(in lab, red, red)) {
2744
+ --tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-purple-500) 50%, transparent) var(--tw-shadow-alpha), transparent);
2745
+ }
2746
+ }
2747
+ }
2748
+ }
2699
2749
  .focus\:border-blue-500 {
2700
2750
  &:focus {
2701
2751
  border-color: var(--color-blue-500);
@@ -2706,6 +2756,11 @@
2706
2756
  border-color: var(--color-gray-500);
2707
2757
  }
2708
2758
  }
2759
+ .focus\:border-purple-500 {
2760
+ &:focus {
2761
+ border-color: var(--color-purple-500);
2762
+ }
2763
+ }
2709
2764
  .focus\:border-transparent {
2710
2765
  &:focus {
2711
2766
  border-color: transparent;
@@ -2758,6 +2813,14 @@
2758
2813
  --tw-ring-color: var(--color-blue-500);
2759
2814
  }
2760
2815
  }
2816
+ .focus\:ring-blue-500\/20 {
2817
+ &:focus {
2818
+ --tw-ring-color: color-mix(in srgb, hsl(209 100% 70%) 20%, transparent);
2819
+ @supports (color: color-mix(in lab, red, red)) {
2820
+ --tw-ring-color: color-mix(in oklab, var(--color-blue-500) 20%, transparent);
2821
+ }
2822
+ }
2823
+ }
2761
2824
  .focus\:ring-gray-200 {
2762
2825
  &:focus {
2763
2826
  --tw-ring-color: var(--color-gray-200);
@@ -2768,6 +2831,14 @@
2768
2831
  --tw-ring-color: var(--color-green-500);
2769
2832
  }
2770
2833
  }
2834
+ .focus\:ring-purple-500\/20 {
2835
+ &:focus {
2836
+ --tw-ring-color: color-mix(in srgb, hsl(264 77% 77%) 20%, transparent);
2837
+ @supports (color: color-mix(in lab, red, red)) {
2838
+ --tw-ring-color: color-mix(in oklab, var(--color-purple-500) 20%, transparent);
2839
+ }
2840
+ }
2841
+ }
2771
2842
  .focus\:ring-red-500 {
2772
2843
  &:focus {
2773
2844
  --tw-ring-color: var(--color-red-500);
@@ -2897,6 +2968,28 @@
2897
2968
  opacity: 50%;
2898
2969
  }
2899
2970
  }
2971
+ .disabled\:hover\:scale-100 {
2972
+ &:disabled {
2973
+ &:hover {
2974
+ @media (hover: hover) {
2975
+ --tw-scale-x: 100%;
2976
+ --tw-scale-y: 100%;
2977
+ --tw-scale-z: 100%;
2978
+ scale: var(--tw-scale-x) var(--tw-scale-y);
2979
+ }
2980
+ }
2981
+ }
2982
+ }
2983
+ .disabled\:hover\:shadow-lg {
2984
+ &:disabled {
2985
+ &:hover {
2986
+ @media (hover: hover) {
2987
+ --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
2988
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
2989
+ }
2990
+ }
2991
+ }
2992
+ }
2900
2993
  .sm\:inline {
2901
2994
  @media (width >= 40rem) {
2902
2995
  display: inline;
@@ -1,3 +1,41 @@
1
1
  import { type ISubgraph } from "@powerhousedao/reactor-api";
2
+ export declare const extractIsoDate: (dateStr: string) => string | null;
3
+ export declare const getPeriodKey: (periodStart: string | null | undefined, periodEnd: string | null | undefined) => string | null;
4
+ export declare const getMonthKey: (dateStr: string | null) => string | null;
2
5
  export declare const getResolvers: (subgraph: ISubgraph) => Record<string, unknown>;
6
+ type AmountCurrency = {
7
+ unit: string;
8
+ value: string;
9
+ };
10
+ type ExpenseReportData = {
11
+ wallets: Array<{
12
+ lineItems: Array<{
13
+ actuals: AmountCurrency;
14
+ }>;
15
+ }>;
16
+ };
17
+ type SnapshotReportData = {
18
+ accounts: Array<{
19
+ type: string;
20
+ transactions: Array<{
21
+ direction: string;
22
+ flowType: string;
23
+ amount: {
24
+ value: AmountCurrency;
25
+ unit: string;
26
+ };
27
+ }>;
28
+ }>;
29
+ };
30
+ /**
31
+ * Sum of all line item actuals from expense report wallets
32
+ */
33
+ export declare function computeReportedActuals(expenseReportData: ExpenseReportData): AmountCurrency;
34
+ /**
35
+ * Sum of outbound USD stablecoin transactions that leave the Internal wallet grouping.
36
+ * Excludes Swap (token conversion) and Internal (inter-wallet transfers) flowTypes.
37
+ * Only counts USDS, USDC, and DAI — excludes sUSDS, EURe, SKY, MKR, etc.
38
+ */
39
+ export declare function computeNetExpenseTxns(snapshotReportData: SnapshotReportData): AmountCurrency;
40
+ export {};
3
41
  //# sourceMappingURL=resolvers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/budget-statements/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,4BAA4B,CAAC;AA0E5D,eAAO,MAAM,YAAY,GAAI,UAAU,SAAS,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAmSxE,CAAC"}
1
+ {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/budget-statements/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAoB5D,eAAO,MAAM,cAAc,GAAI,SAAS,MAAM,KAAG,MAAM,GAAG,IAGzD,CAAC;AAGF,eAAO,MAAM,YAAY,GACvB,aAAa,MAAM,GAAG,IAAI,GAAG,SAAS,EACtC,WAAW,MAAM,GAAG,IAAI,GAAG,SAAS,KACnC,MAAM,GAAG,IAMX,CAAC;AASF,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,GAAG,IAAI,KAAG,MAAM,GAAG,IAQ7D,CAAC;AA0BF,eAAO,MAAM,YAAY,GAAI,UAAU,SAAS,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAgXxE,CAAC;AA6JF,KAAK,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtD,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,KAAK,CAAC;QACb,SAAS,EAAE,KAAK,CAAC;YAAE,OAAO,EAAE,cAAc,CAAA;SAAE,CAAC,CAAC;KAC/C,CAAC,CAAC;CACJ,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,KAAK,CAAC;QAC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