@powerhousedao/contributor-billing 0.1.53 → 1.0.0-dev.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/document-models/account-transactions/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/account-transactions/gen/schema/zod.js +3 -3
- package/dist/document-models/account-transactions/module.d.ts +1 -1
- package/dist/document-models/account-transactions/module.d.ts.map +1 -1
- package/dist/document-models/account-transactions/module.js +1 -1
- package/dist/document-models/accounts/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/accounts/module.d.ts +1 -1
- package/dist/document-models/accounts/module.d.ts.map +1 -1
- package/dist/document-models/accounts/module.js +1 -1
- package/dist/document-models/billing-statement/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/schema/zod.js +4 -4
- package/dist/document-models/billing-statement/module.d.ts +1 -1
- package/dist/document-models/billing-statement/module.d.ts.map +1 -1
- package/dist/document-models/billing-statement/module.js +1 -1
- package/dist/document-models/expense-report/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/schema/zod.js +38 -18
- package/dist/document-models/expense-report/module.d.ts +1 -1
- package/dist/document-models/expense-report/module.d.ts.map +1 -1
- package/dist/document-models/expense-report/module.js +1 -1
- package/dist/document-models/invoice/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/document-model.js +150 -150
- package/dist/document-models/invoice/gen/schema/types.d.ts +3 -6
- package/dist/document-models/invoice/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/schema/zod.d.ts +2 -8
- package/dist/document-models/invoice/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/schema/zod.js +14 -25
- package/dist/document-models/invoice/module.d.ts +1 -1
- package/dist/document-models/invoice/module.d.ts.map +1 -1
- package/dist/document-models/invoice/module.js +1 -1
- package/dist/document-models/invoice/src/reducers/general.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/general.js +8 -0
- package/dist/document-models/invoice/src/reducers/items.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/items.js +2 -1
- package/dist/document-models/invoice/src/reducers/parties.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/parties.js +6 -2
- package/dist/document-models/invoice/src/reducers/transitions.d.ts +0 -5
- package/dist/document-models/invoice/src/reducers/transitions.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/transitions.js +19 -6
- package/dist/document-models/invoice/tests/general.test.js +11 -2
- package/dist/document-models/invoice/tests/items.test.js +1 -1
- package/dist/document-models/invoice/tests/parties.test.js +1 -1
- package/dist/document-models/invoice/tests/transitions.test.js +7 -2
- package/dist/document-models/operational-hub-profile/module.d.ts +1 -1
- package/dist/document-models/operational-hub-profile/module.d.ts.map +1 -1
- package/dist/document-models/operational-hub-profile/module.js +1 -1
- package/dist/document-models/snapshot-report/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/snapshot-report/gen/schema/zod.js +12 -12
- package/dist/document-models/snapshot-report/module.d.ts +1 -1
- package/dist/document-models/snapshot-report/module.d.ts.map +1 -1
- package/dist/document-models/snapshot-report/module.js +1 -1
- package/dist/editors/accounts-editor/editor.d.ts.map +1 -1
- package/dist/editors/accounts-editor/editor.js +2 -2
- package/dist/editors/builder-team-admin/components/DriveExplorer.d.ts.map +1 -1
- package/dist/editors/builder-team-admin/components/DriveExplorer.js +64 -4
- package/dist/editors/builder-team-admin/module.js +1 -1
- package/dist/editors/contributor-billing/components/DashboardHome.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/DashboardHome.js +2 -8
- package/dist/editors/contributor-billing/components/DocumentDropZone.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/DocumentDropZone.js +37 -8
- package/dist/editors/contributor-billing/components/DriveContents.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/DriveContents.js +4 -1
- package/dist/editors/contributor-billing/components/DriveExplorer.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/DriveExplorer.js +54 -3
- package/dist/editors/contributor-billing/components/FolderTree.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/FolderTree.js +6 -15
- package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.d.ts +2 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.js +41 -6
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.d.ts +1 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.js +16 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableContainer.d.ts +3 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableContainer.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableContainer.js +13 -11
- package/dist/editors/contributor-billing/components/MonthReportCard.d.ts +11 -4
- package/dist/editors/contributor-billing/components/MonthReportCard.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/MonthReportCard.js +55 -6
- package/dist/editors/contributor-billing/components/MonthlyReportsOverview.d.ts +1 -1
- package/dist/editors/contributor-billing/components/MonthlyReportsOverview.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/MonthlyReportsOverview.js +104 -7
- package/dist/editors/contributor-billing/components/ReportingView.d.ts +0 -3
- package/dist/editors/contributor-billing/components/ReportingView.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/ReportingView.js +65 -8
- package/dist/editors/contributor-billing/components/ToastRenderer.d.ts +2 -0
- package/dist/editors/contributor-billing/components/ToastRenderer.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/ToastRenderer.js +14 -0
- package/dist/editors/contributor-billing/components/cbToast.d.ts +16 -0
- package/dist/editors/contributor-billing/components/cbToast.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/cbToast.js +29 -0
- package/dist/editors/contributor-billing/hooks/useDocumentAutoPlacement.d.ts.map +1 -1
- package/dist/editors/contributor-billing/hooks/useDocumentAutoPlacement.js +42 -2
- package/dist/editors/contributor-billing/hooks/useMonthlyReports.d.ts +4 -0
- package/dist/editors/contributor-billing/hooks/useMonthlyReports.d.ts.map +1 -1
- package/dist/editors/contributor-billing/hooks/useMonthlyReports.js +4 -0
- package/dist/editors/contributor-billing/module.js +1 -1
- package/dist/editors/invoice/InvoicePDF.d.ts.map +1 -1
- package/dist/editors/invoice/InvoicePDF.js +12 -9
- package/dist/editors/invoice/editor.d.ts.map +1 -1
- package/dist/editors/invoice/editor.js +6 -10
- package/dist/editors/invoice/exportUBL.d.ts.map +1 -1
- package/dist/editors/invoice/exportUBL.js +1 -2
- package/dist/editors/invoice/ingestPDF.js +1 -1
- package/dist/editors/invoice/invoiceToGnosis.d.ts.map +1 -1
- package/dist/editors/invoice/invoiceToGnosis.js +25 -22
- package/dist/editors/invoice/invoiceToast.d.ts +4 -0
- package/dist/editors/invoice/invoiceToast.d.ts.map +1 -0
- package/dist/editors/invoice/invoiceToast.js +6 -0
- package/dist/editors/invoice/legalEntity/legalEntity.d.ts +2 -1
- package/dist/editors/invoice/legalEntity/legalEntity.d.ts.map +1 -1
- package/dist/editors/invoice/legalEntity/legalEntity.js +3 -14
- package/dist/editors/invoice/legalEntity/walletSection.d.ts +1 -0
- package/dist/editors/invoice/legalEntity/walletSection.d.ts.map +1 -1
- package/dist/editors/invoice/legalEntity/walletSection.js +2 -2
- package/dist/editors/invoice/lineItems.js +1 -1
- package/dist/editors/invoice/requestFinance.d.ts +3 -2
- package/dist/editors/invoice/requestFinance.d.ts.map +1 -1
- package/dist/editors/invoice/requestFinance.js +38 -42
- package/dist/editors/invoice/validation/validationHandler.d.ts +1 -1
- package/dist/editors/invoice/validation/validationHandler.d.ts.map +1 -1
- package/dist/editors/invoice/validation/validationHandler.js +15 -2
- package/dist/editors/invoice/validation/validationManager.d.ts +1 -1
- package/dist/editors/invoice/validation/validationManager.d.ts.map +1 -1
- package/dist/editors/invoice/validation/validationManager.js +2 -1
- package/dist/editors/invoice/validation/validationRules.d.ts +1 -0
- package/dist/editors/invoice/validation/validationRules.d.ts.map +1 -1
- package/dist/editors/invoice/validation/validationRules.js +26 -1
- package/dist/editors/snapshot-report-editor/components/DateRangePicker.d.ts +19 -0
- package/dist/editors/snapshot-report-editor/components/DateRangePicker.d.ts.map +1 -0
- package/dist/editors/snapshot-report-editor/components/DateRangePicker.js +66 -0
- package/dist/editors/snapshot-report-editor/editor.d.ts.map +1 -1
- package/dist/editors/snapshot-report-editor/editor.js +72 -48
- package/dist/scripts/download-all-drive-documents/download-drive-documents.d.ts +33 -0
- package/dist/scripts/download-all-drive-documents/download-drive-documents.d.ts.map +1 -0
- package/dist/scripts/download-all-drive-documents/download-drive-documents.js +583 -0
- package/dist/scripts/invoice/requestFinance.d.ts +18 -1
- package/dist/scripts/invoice/requestFinance.d.ts.map +1 -1
- package/dist/scripts/invoice/requestFinance.js +17 -5
- package/dist/scripts/upload-phd-documents/upload-phd-documents.d.ts +20 -0
- package/dist/scripts/upload-phd-documents/upload-phd-documents.d.ts.map +1 -0
- package/dist/scripts/upload-phd-documents/upload-phd-documents.js +313 -0
- package/dist/style.css +201 -106
- package/dist/subgraphs/budget-statements/resolvers.d.ts +38 -0
- package/dist/subgraphs/budget-statements/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/budget-statements/resolvers.js +192 -62
- package/dist/subgraphs/budget-statements/resolvers.test.d.ts +2 -0
- package/dist/subgraphs/budget-statements/resolvers.test.d.ts.map +1 -0
- package/dist/subgraphs/budget-statements/resolvers.test.js +339 -0
- package/dist/subgraphs/budget-statements/schema.d.ts.map +1 -1
- package/dist/subgraphs/budget-statements/schema.js +8 -0
- package/dist/subgraphs/index.d.ts +0 -1
- package/dist/subgraphs/index.d.ts.map +1 -1
- package/dist/subgraphs/index.js +0 -1
- package/dist/subgraphs/invoice-addon/customResolvers.d.ts +70 -11
- package/dist/subgraphs/invoice-addon/customResolvers.d.ts.map +1 -1
- package/dist/subgraphs/invoice-addon/customResolvers.js +12 -27
- package/package.json +35 -28
- package/dist/document-models/invoice/src/tests/document-model.test.d.ts +0 -10
- package/dist/document-models/invoice/src/tests/document-model.test.d.ts.map +0 -1
- package/dist/document-models/invoice/src/tests/document-model.test.js +0 -104
- package/dist/document-models/invoice/src/tests/general.test.d.ts +0 -6
- package/dist/document-models/invoice/src/tests/general.test.d.ts.map +0 -1
- package/dist/document-models/invoice/src/tests/general.test.js +0 -49
- package/dist/document-models/invoice/src/tests/items.test.d.ts +0 -6
- package/dist/document-models/invoice/src/tests/items.test.d.ts.map +0 -1
- package/dist/document-models/invoice/src/tests/items.test.js +0 -59
- package/dist/document-models/invoice/src/tests/parties.test.d.ts +0 -6
- package/dist/document-models/invoice/src/tests/parties.test.d.ts.map +0 -1
- package/dist/document-models/invoice/src/tests/parties.test.js +0 -69
- package/dist/document-models/invoice/src/tests/transitions.test.d.ts +0 -6
- package/dist/document-models/invoice/src/tests/transitions.test.d.ts.map +0 -1
- package/dist/document-models/invoice/src/tests/transitions.test.js +0 -59
- package/dist/document-models/invoice/utils/statusTransitions.d.ts +0 -13
- package/dist/document-models/invoice/utils/statusTransitions.d.ts.map +0 -1
- package/dist/document-models/invoice/utils/statusTransitions.js +0 -13
- package/dist/editors/builder-team-admin/components/overview/SubscriptionsStats.d.ts +0 -15
- package/dist/editors/builder-team-admin/components/overview/SubscriptionsStats.d.ts.map +0 -1
- package/dist/editors/builder-team-admin/components/overview/SubscriptionsStats.js +0 -61
- package/dist/editors/contributor-billing/components/CreateHubProfileModal.d.ts +0 -12
- package/dist/editors/contributor-billing/components/CreateHubProfileModal.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/CreateHubProfileModal.js +0 -74
- package/dist/subgraphs/resources-services/index.d.ts +0 -11
- package/dist/subgraphs/resources-services/index.d.ts.map +0 -1
- package/dist/subgraphs/resources-services/index.js +0 -11
- package/dist/subgraphs/resources-services/resolvers.d.ts +0 -3
- package/dist/subgraphs/resources-services/resolvers.d.ts.map +0 -1
- package/dist/subgraphs/resources-services/resolvers.js +0 -462
- package/dist/subgraphs/resources-services/schema.d.ts +0 -3
- package/dist/subgraphs/resources-services/schema.d.ts.map +0 -1
- package/dist/subgraphs/resources-services/schema.js +0 -284
|
@@ -67,10 +67,12 @@ const InvoiceToGnosis = ({ docState, dispatch, }) => {
|
|
|
67
67
|
const networkTokens = TOKEN_ADDRESSES[chainName.toUpperCase()];
|
|
68
68
|
if (!networkTokens) {
|
|
69
69
|
console.error(`Network ${chainName} not supported`);
|
|
70
|
+
return undefined;
|
|
70
71
|
}
|
|
71
72
|
const tokenAddress = networkTokens[symbol];
|
|
72
73
|
if (!tokenAddress) {
|
|
73
74
|
console.error(`Token ${symbol} not supported on ${chainName}`);
|
|
75
|
+
return undefined;
|
|
74
76
|
}
|
|
75
77
|
return tokenAddress;
|
|
76
78
|
}
|
|
@@ -91,7 +93,7 @@ const InvoiceToGnosis = ({ docState, dispatch, }) => {
|
|
|
91
93
|
},
|
|
92
94
|
body: JSON.stringify({
|
|
93
95
|
query: `
|
|
94
|
-
mutation Invoice_processGnosisPayment($chainName: String!, $paymentDetails:
|
|
96
|
+
mutation Invoice_processGnosisPayment($chainName: String!, $paymentDetails: JSONObject!, $invoiceNo: String!) {
|
|
95
97
|
Invoice_processGnosisPayment(chainName: $chainName, paymentDetails: $paymentDetails, invoiceNo: $invoiceNo) {
|
|
96
98
|
success
|
|
97
99
|
data
|
|
@@ -106,56 +108,57 @@ const InvoiceToGnosis = ({ docState, dispatch, }) => {
|
|
|
106
108
|
},
|
|
107
109
|
}),
|
|
108
110
|
});
|
|
109
|
-
const result = await response.json();
|
|
110
|
-
const data = result.data
|
|
111
|
-
if (data
|
|
112
|
-
const dataObj = typeof data.data === "string"
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
const result = (await response.json());
|
|
112
|
+
const data = result.data?.Invoice_processGnosisPayment;
|
|
113
|
+
if (data?.success) {
|
|
114
|
+
const dataObj = typeof data.data === "string"
|
|
115
|
+
? JSON.parse(data.data)
|
|
116
|
+
: (data.data ?? {});
|
|
117
|
+
const txHash = typeof dataObj.txHash === "string" ? dataObj.txHash : "";
|
|
118
|
+
const responseSafeAddress = typeof dataObj.safeAddress === "string" ? dataObj.safeAddress : "";
|
|
119
|
+
setsafeTxHash(txHash);
|
|
120
|
+
setSafeAddress(responseSafeAddress);
|
|
115
121
|
if (invoiceStatus === "ACCEPTED") {
|
|
116
122
|
dispatch(actions.schedulePayment({
|
|
117
123
|
id: generateId(),
|
|
118
|
-
processorRef: `${
|
|
124
|
+
processorRef: `${responseSafeAddress}:${txHash}`,
|
|
119
125
|
}));
|
|
120
126
|
}
|
|
121
127
|
else {
|
|
122
128
|
dispatch(actions.addPayment({
|
|
123
129
|
id: generateId(),
|
|
124
|
-
processorRef: `${
|
|
130
|
+
processorRef: `${responseSafeAddress}:${txHash}`,
|
|
125
131
|
confirmed: false,
|
|
126
132
|
}));
|
|
127
133
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
amount: dataObj.paymentDetails[0].amount,
|
|
132
|
-
token: dataObj.paymentDetails[0].token.symbol,
|
|
133
|
-
chain: chainName,
|
|
134
|
-
};
|
|
135
|
-
setInvoiceStatusResponse(`Amount: ${formattedDetails.amount} ${formattedDetails.token} on ${formattedDetails.chain}`);
|
|
134
|
+
const paymentDetailsList = dataObj.paymentDetails;
|
|
135
|
+
if (paymentDetailsList?.[0]) {
|
|
136
|
+
setInvoiceStatusResponse(`Amount: ${paymentDetailsList[0].amount} ${paymentDetailsList[0].token.symbol} on ${chainName}`);
|
|
136
137
|
}
|
|
137
138
|
}
|
|
138
139
|
else {
|
|
139
|
-
|
|
140
|
+
const errorMsg = data?.error ?? "Unknown payment error";
|
|
141
|
+
setError(errorMsg);
|
|
140
142
|
dispatch(actions.addPayment({
|
|
141
143
|
id: generateId(),
|
|
142
144
|
processorRef: "",
|
|
143
145
|
confirmed: false,
|
|
144
|
-
issue:
|
|
146
|
+
issue: errorMsg,
|
|
145
147
|
}));
|
|
146
148
|
}
|
|
147
149
|
setIsLoading(false);
|
|
148
150
|
isProcessingRef.current = false;
|
|
149
151
|
}
|
|
150
|
-
catch (
|
|
152
|
+
catch (err) {
|
|
151
153
|
setIsLoading(false);
|
|
152
154
|
isProcessingRef.current = false;
|
|
153
|
-
|
|
155
|
+
const errorMsg = err instanceof Error ? err.message : "Unknown error";
|
|
156
|
+
console.error("Error during transfer:", err);
|
|
154
157
|
dispatch(actions.addPayment({
|
|
155
158
|
id: generateId(),
|
|
156
159
|
processorRef: "",
|
|
157
160
|
confirmed: false,
|
|
158
|
-
issue:
|
|
161
|
+
issue: errorMsg,
|
|
159
162
|
}));
|
|
160
163
|
}
|
|
161
164
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { toast, type ConnectToastOptions } from "@powerhousedao/design-system/connect";
|
|
2
|
+
export declare const INVOICE_TOAST_CONTAINER_ID = "invoice-editor-toast";
|
|
3
|
+
export declare const invoiceToast: (message: Parameters<typeof toast>[0], options?: ConnectToastOptions) => import("react-toastify").Id;
|
|
4
|
+
//# sourceMappingURL=invoiceToast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoiceToast.d.ts","sourceRoot":"","sources":["../../../editors/invoice/invoiceToast.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,KAAK,mBAAmB,EACzB,MAAM,sCAAsC,CAAC;AAE9C,eAAO,MAAM,0BAA0B,yBAAyB,CAAC;AAEjE,eAAO,MAAM,YAAY,GACvB,SAAS,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,EACpC,UAAU,mBAAmB,gCAKJ,CAAC"}
|
|
@@ -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,EAA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AG,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"}
|
|
@@ -92,18 +92,7 @@ export const LegalEntityMainSection = (props) => {
|
|
|
92
92
|
};
|
|
93
93
|
// Helper to flatten LegalEntity to EditLegalEntityInput
|
|
94
94
|
function flattenLegalEntityToEditInput(legalEntity) {
|
|
95
|
-
|
|
96
|
-
if (typeof legalEntity.id === "string") {
|
|
97
|
-
id = legalEntity.id;
|
|
98
|
-
}
|
|
99
|
-
else if (legalEntity.id && typeof legalEntity.id === "object") {
|
|
100
|
-
if (legalEntity.id && typeof legalEntity.id === "object") {
|
|
101
|
-
id =
|
|
102
|
-
"taxId" in legalEntity.id
|
|
103
|
-
? legalEntity.id.taxId
|
|
104
|
-
: legalEntity.id.corpRegId;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
95
|
+
const id = legalEntity.id?.taxId ?? legalEntity.id?.corpRegId ?? "";
|
|
107
96
|
return {
|
|
108
97
|
id,
|
|
109
98
|
name: legalEntity.name ?? "",
|
|
@@ -117,12 +106,12 @@ function flattenLegalEntityToEditInput(legalEntity) {
|
|
|
117
106
|
email: legalEntity.contactInfo?.email ?? "",
|
|
118
107
|
};
|
|
119
108
|
}
|
|
120
|
-
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, }) {
|
|
121
110
|
// Handler for main info section
|
|
122
111
|
const handleChangeInfo = (update) => {
|
|
123
112
|
if (!onChangeInfo)
|
|
124
113
|
return;
|
|
125
114
|
onChangeInfo(update);
|
|
126
115
|
};
|
|
127
|
-
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 }))] }));
|
|
128
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;
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { toast } from "
|
|
2
|
+
import { invoiceToast as toast } from "./invoiceToast.js";
|
|
3
3
|
import { RWAButton } from "@powerhousedao/design-system/rwa";
|
|
4
4
|
import {} from "../../document-models/invoice/index.js";
|
|
5
5
|
import { forwardRef, useState, useMemo, useRef, useEffect, } from "react";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import type { InvoiceAction, InvoiceState } from "../../document-models/invoice/index.js";
|
|
2
3
|
interface RequestFinanceProps {
|
|
3
|
-
docState:
|
|
4
|
-
dispatch:
|
|
4
|
+
docState: InvoiceState;
|
|
5
|
+
dispatch: React.Dispatch<InvoiceAction>;
|
|
5
6
|
}
|
|
6
7
|
declare const RequestFinance: React.FC<RequestFinanceProps>;
|
|
7
8
|
export default RequestFinance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestFinance.d.ts","sourceRoot":"","sources":["../../../editors/invoice/requestFinance.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"requestFinance.d.ts","sourceRoot":"","sources":["../../../editors/invoice/requestFinance.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EAEb,MAAM,wCAAwC,CAAC;AAyBhD,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;CACzC;AAED,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA4RjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -22,7 +22,7 @@ const RequestFinance = ({ docState, dispatch, }) => {
|
|
|
22
22
|
},
|
|
23
23
|
body: JSON.stringify({
|
|
24
24
|
query: `
|
|
25
|
-
mutation Invoice_createRequestFinancePayment($paymentData:
|
|
25
|
+
mutation Invoice_createRequestFinancePayment($paymentData: JSONObject!) {
|
|
26
26
|
Invoice_createRequestFinancePayment(paymentData: $paymentData) {
|
|
27
27
|
success
|
|
28
28
|
data
|
|
@@ -35,7 +35,7 @@ const RequestFinance = ({ docState, dispatch, }) => {
|
|
|
35
35
|
},
|
|
36
36
|
}),
|
|
37
37
|
});
|
|
38
|
-
const result = await response.json();
|
|
38
|
+
const result = (await response.json());
|
|
39
39
|
if (result.errors) {
|
|
40
40
|
throw new Error(result.errors[0].message);
|
|
41
41
|
}
|
|
@@ -60,21 +60,23 @@ const RequestFinance = ({ docState, dispatch, }) => {
|
|
|
60
60
|
setError(null);
|
|
61
61
|
setInvoiceLink(null);
|
|
62
62
|
setDirectPaymentStatus(null);
|
|
63
|
+
const bank = docState.issuer.paymentRouting?.bank;
|
|
64
|
+
if (!bank) {
|
|
65
|
+
setError("Missing bank payment routing details");
|
|
66
|
+
setIsLoading(false);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
63
69
|
const bankDetails = {
|
|
64
70
|
currency: docState.currency,
|
|
65
|
-
accountNumber:
|
|
66
|
-
country:
|
|
67
|
-
bankName:
|
|
68
|
-
firstName:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"Liberty",
|
|
72
|
-
bicSwift: docState.issuer.paymentRouting.bank.BIC ||
|
|
73
|
-
docState.issuer.paymentRouting.bank.SWIFT,
|
|
71
|
+
accountNumber: bank.accountNum,
|
|
72
|
+
country: bank.address.country?.toUpperCase() ?? "",
|
|
73
|
+
bankName: bank.name,
|
|
74
|
+
firstName: bank.beneficiary?.split(" ")[0] || "Liberuum",
|
|
75
|
+
lastName: bank.beneficiary?.split(" ")[1] || "Liberty",
|
|
76
|
+
bicSwift: bank.BIC || bank.SWIFT,
|
|
74
77
|
};
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
bankDetails.routingNumber = docState.issuer.paymentRouting.bank.ABA;
|
|
78
|
+
if (bank.ABA && bank.ABA.trim() !== "") {
|
|
79
|
+
bankDetails.routingNumber = bank.ABA;
|
|
78
80
|
}
|
|
79
81
|
const getDecimalPlaces = (currency) => {
|
|
80
82
|
const formatter = new Intl.NumberFormat("en-US", {
|
|
@@ -92,12 +94,12 @@ const RequestFinance = ({ docState, dispatch, }) => {
|
|
|
92
94
|
},
|
|
93
95
|
creationDate: docState.dateIssued,
|
|
94
96
|
invoiceItems: docState.lineItems.map((item) => {
|
|
95
|
-
const
|
|
96
|
-
const decimalPlaces = getDecimalPlaces(
|
|
97
|
+
const itemCurrency = bankDetails.currency;
|
|
98
|
+
const decimalPlaces = getDecimalPlaces(itemCurrency);
|
|
97
99
|
const multiplier = Math.pow(10, decimalPlaces);
|
|
98
100
|
const unitPriceInt = Math.round(item.unitPriceTaxIncl * multiplier);
|
|
99
101
|
return {
|
|
100
|
-
currency,
|
|
102
|
+
currency: itemCurrency,
|
|
101
103
|
name: item.description,
|
|
102
104
|
quantity: item.quantity,
|
|
103
105
|
unitPrice: unitPriceInt,
|
|
@@ -105,31 +107,29 @@ const RequestFinance = ({ docState, dispatch, }) => {
|
|
|
105
107
|
}),
|
|
106
108
|
invoiceNumber: docState.invoiceNo,
|
|
107
109
|
buyerInfo: {
|
|
108
|
-
// email: docState.payer.contactInfo.email,
|
|
109
110
|
email: "",
|
|
110
|
-
firstName: docState.payer.name,
|
|
111
|
-
|
|
112
|
-
businessName: docState.payer.name,
|
|
111
|
+
firstName: docState.payer.name ?? "",
|
|
112
|
+
businessName: docState.payer.name ?? "",
|
|
113
113
|
address: {
|
|
114
|
-
country: docState.payer.address
|
|
115
|
-
city: docState.payer.address
|
|
116
|
-
streetAddress: docState.payer.address
|
|
117
|
-
extendedAddress: docState.payer.address
|
|
118
|
-
postalCode: docState.payer.address
|
|
119
|
-
region: docState.payer.address
|
|
114
|
+
country: docState.payer.address?.country ?? "",
|
|
115
|
+
city: docState.payer.address?.city ?? "",
|
|
116
|
+
streetAddress: docState.payer.address?.streetAddress ?? "",
|
|
117
|
+
extendedAddress: docState.payer.address?.extendedAddress ?? "",
|
|
118
|
+
postalCode: docState.payer.address?.postalCode ?? "",
|
|
119
|
+
region: docState.payer.address?.stateProvince || "",
|
|
120
120
|
},
|
|
121
121
|
},
|
|
122
122
|
sellerInfo: {
|
|
123
|
-
email: docState.issuer.contactInfo
|
|
124
|
-
firstName: docState.issuer.name,
|
|
123
|
+
email: docState.issuer.contactInfo?.email ?? "",
|
|
124
|
+
firstName: docState.issuer.name ?? "",
|
|
125
125
|
lastName: "",
|
|
126
126
|
address: {
|
|
127
|
-
country: docState.issuer.address
|
|
128
|
-
city: docState.issuer.address
|
|
129
|
-
streetAddress: docState.issuer.address
|
|
130
|
-
extendedAddress: docState.issuer.address
|
|
131
|
-
postalCode: docState.issuer.address
|
|
132
|
-
region: docState.issuer.address
|
|
127
|
+
country: docState.issuer.address?.country ?? "",
|
|
128
|
+
city: docState.issuer.address?.city ?? "",
|
|
129
|
+
streetAddress: docState.issuer.address?.streetAddress ?? "",
|
|
130
|
+
extendedAddress: docState.issuer.address?.extendedAddress ?? "",
|
|
131
|
+
postalCode: docState.issuer.address?.postalCode ?? "",
|
|
132
|
+
region: docState.issuer.address?.stateProvince || "",
|
|
133
133
|
},
|
|
134
134
|
},
|
|
135
135
|
paymentOptions: [
|
|
@@ -166,15 +166,11 @@ const RequestFinance = ({ docState, dispatch, }) => {
|
|
|
166
166
|
}));
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
setResponseData(directPaymentResult);
|
|
169
|
+
setResponseData(directPaymentResult ?? null);
|
|
170
170
|
setDirectPaymentStatus("Direct payment created successfully");
|
|
171
171
|
}
|
|
172
172
|
catch (err) {
|
|
173
|
-
|
|
174
|
-
let errorMessage = "An error occurred";
|
|
175
|
-
if (err instanceof Error) {
|
|
176
|
-
errorMessage = err.message;
|
|
177
|
-
}
|
|
173
|
+
const errorMessage = err instanceof Error ? err.message : "An error occurred";
|
|
178
174
|
setError(errorMessage);
|
|
179
175
|
dispatch(actions.addPayment({
|
|
180
176
|
id: generateId(),
|
|
@@ -195,6 +191,6 @@ const RequestFinance = ({ docState, dispatch, }) => {
|
|
|
195
191
|
: "Reschedule Payment in Request Finance" }), invoiceLink && (_jsxs("div", { children: [_jsx("div", { className: "direct-payment-status", children: _jsx("p", { children: directPaymentStatus }) }), _jsx("div", { className: "invoice-link text-blue-900 hover:text-blue-600", children: _jsx("a", { href: invoiceLink, target: "_blank", rel: "noopener noreferrer", className: "view-invoice-button", children: liktText }) })] })), !invoiceLink &&
|
|
196
192
|
invoiceStatus === "PAYMENTSCHEDULED" &&
|
|
197
193
|
docState.payments?.length > 0 && (_jsx(_Fragment, { children: docState.payments[docState.payments.length - 1].issue !== "" ? (_jsx("div", { className: "mt-4", children: _jsxs("p", { className: "text-red-700 font-medium", children: ["Issue: ", docState.payments[docState.payments.length - 1].issue] }) })) : (_jsx("div", { className: "mt-4", children: _jsx("div", { className: "invoice-link text-blue-900 hover:text-blue-600", children: _jsx("a", { className: "view-invoice-button", href: docState.payments[docState.payments.length - 1]
|
|
198
|
-
.processorRef, target: "_blank", rel: "noopener noreferrer", children: liktText }) }) })) }))] }));
|
|
194
|
+
.processorRef ?? "", target: "_blank", rel: "noopener noreferrer", children: liktText }) }) })) }))] }));
|
|
199
195
|
};
|
|
200
196
|
export default RequestFinance;
|
|
@@ -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,IA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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,EAAE,gBAAgB,KAAK,IAAI,EAClE,uBAAuB,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EAC7D,4BAA4B,CAAC,UAAU,EAAE,gBAAgB,KAAK,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
|
-
import { toast } from "
|
|
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;
|
|
1
|
+
{"version":3,"file":"validationManager.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/validation/validationManager.ts"],"names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
|
|
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, walletChainRule, } from "./validationRules.js";
|
|
3
3
|
// Validation rules registry
|
|
4
4
|
const validationRules = [];
|
|
5
5
|
// Register rules
|
|
@@ -18,6 +18,7 @@ validationRules.push(payerEmailRule);
|
|
|
18
18
|
validationRules.push(lineItemRule);
|
|
19
19
|
validationRules.push(routingNumberRule);
|
|
20
20
|
validationRules.push(accountNumberRule);
|
|
21
|
+
validationRules.push(walletChainRule);
|
|
21
22
|
// Helper to check if a rule applies to the current context
|
|
22
23
|
function ruleAppliesToContext(rule, context) {
|
|
23
24
|
const { currencies, statusTransitions } = rule.appliesTo;
|
|
@@ -2,6 +2,7 @@ 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;
|
|
5
6
|
export declare const currencyRule: ValidationRule;
|
|
6
7
|
export declare const mainCountryRule: ValidationRule;
|
|
7
8
|
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,E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+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"}
|
|
@@ -67,7 +67,32 @@ export const ethereumAddressRule = {
|
|
|
67
67
|
};
|
|
68
68
|
},
|
|
69
69
|
appliesTo: {
|
|
70
|
-
currencies: ["USDS", "DAI"], // Only apply for crypto currencies
|
|
70
|
+
currencies: ["USDS", "DAI", "USDC"], // Only apply for crypto currencies
|
|
71
|
+
statusTransitions: {
|
|
72
|
+
from: ["DRAFT"],
|
|
73
|
+
to: ["ISSUED"],
|
|
74
|
+
},
|
|
75
|
+
},
|
|
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: ["USDS", "DAI", "USDC"],
|
|
71
96
|
statusTransitions: {
|
|
72
97
|
from: ["DRAFT"],
|
|
73
98
|
to: ["ISSUED"],
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface DateRangePickerProps {
|
|
2
|
+
/** ISO date string or YYYY-MM-DD for the start of the range */
|
|
3
|
+
fromDate: string;
|
|
4
|
+
/** ISO date string or YYYY-MM-DD for the end of the range */
|
|
5
|
+
toDate: string;
|
|
6
|
+
/** Called when either date changes. Both values are ISO date strings. */
|
|
7
|
+
onChange: (fromDate: string, toDate: string) => void;
|
|
8
|
+
/** Optional label for the whole range picker */
|
|
9
|
+
label?: string;
|
|
10
|
+
/** Optional className for the container */
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Unified date range picker rendered as a single row with two date inputs
|
|
15
|
+
* joined visually. Enforces from <= to.
|
|
16
|
+
*/
|
|
17
|
+
export declare function DateRangePicker({ fromDate, toDate, onChange, label, className, }: DateRangePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=DateRangePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateRangePicker.d.ts","sourceRoot":"","sources":["../../../../editors/snapshot-report-editor/components/DateRangePicker.tsx"],"names":[],"mappings":"AAEA,UAAU,oBAAoB;IAC5B,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAgBD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,KAAK,EACL,SAAS,GACV,EAAE,oBAAoB,2CAsFtB"}
|