-
Notifications
You must be signed in to change notification settings - Fork 5.6k
[APP] Visma eAccounting - new components #19510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import app from "../../eaccounting.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "eaccounting-create-attachment", | ||
| name: "Create Attachment", | ||
| description: "Creates a new attachment. [See the documentation](https://developer.vismaonline.com)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| data: { | ||
| type: "object", | ||
| label: "Attachment Data", | ||
| description: "The attachment data as a JSON object. [See the API documentation](https://developer.vismaonline.com) for the complete schema. Should include fileName, data (base64), and optional metadata.", | ||
| }, | ||
| }, | ||
| annotations: { | ||
| readOnlyHint: false, | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.createAttachment({ | ||
| $, | ||
| data: this.data, | ||
| }); | ||
| $.export("$summary", `Successfully created attachment with ID ${response.id || "N/A"}`); | ||
| return response; | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import app from "../../eaccounting.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "eaccounting-create-customer-invoice", | ||
| name: "Create Customer Invoice", | ||
| description: "Creates a new customer invoice. [See the documentation](https://developer.vismaonline.com)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| data: { | ||
| type: "object", | ||
| label: "Invoice Data", | ||
| description: "The customer invoice data as a JSON object. [See the API documentation](https://developer.vismaonline.com) for the complete schema.", | ||
| }, | ||
| rotReducedAutomaticDistribution: { | ||
| type: "boolean", | ||
| label: "ROT Reduced Automatic Distribution", | ||
| description: "Used for the automatic distribution per person of the ROT reduced invoicing amount", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| annotations: { | ||
| readOnlyHint: false, | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.createCustomerInvoice({ | ||
| $, | ||
| data: this.data, | ||
| params: { | ||
| rotReducedAutomaticDistribution: this.rotReducedAutomaticDistribution, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully created customer invoice with ID ${response.id || "N/A"}`); | ||
| return response; | ||
| }, | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| import app from "../../eaccounting.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "eaccounting-create-supplier-invoice", | ||
| name: "Create Supplier Invoice", | ||
| description: "Creates a new supplier invoice. [See the documentation](https://developer.vismaonline.com)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| data: { | ||
| type: "object", | ||
| label: "Invoice Data", | ||
| description: "The supplier invoice data as a JSON object. [See the API documentation](https://developer.vismaonline.com) for the complete schema.", | ||
| }, | ||
| useDefaultVatCodes: { | ||
| type: "boolean", | ||
| label: "Use Default VAT Codes", | ||
| description: "Use default VAT codes", | ||
| optional: true, | ||
| }, | ||
| calculateVatOnCostAccounts: { | ||
| type: "boolean", | ||
| label: "Calculate VAT on Cost Accounts", | ||
| description: "Calculate VAT on cost accounts automatically", | ||
| optional: true, | ||
| }, | ||
| duplicateCheckExtendedValidation: { | ||
| type: "boolean", | ||
| label: "Duplicate Check Extended Validation", | ||
| description: "Check if the invoice is duplicate", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| annotations: { | ||
| readOnlyHint: false, | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.createSupplierInvoice({ | ||
| $, | ||
| data: this.data, | ||
| params: { | ||
| useDefaultVatCodes: this.useDefaultVatCodes, | ||
| calculateVatOnCostAccounts: this.calculateVatOnCostAccounts, | ||
| duplicateCheckExtendedValidation: this.duplicateCheckExtendedValidation, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully created supplier invoice with ID ${response.id || "N/A"}`); | ||
| return response; | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| import app from "../../eaccounting.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "eaccounting-create-voucher", | ||
| name: "Create Voucher", | ||
| description: "Creates a new voucher. [See the documentation](https://developer.vismaonline.com)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| data: { | ||
| type: "object", | ||
| label: "Voucher Data", | ||
| description: "The voucher data as a JSON object. [See the API documentation](https://developer.vismaonline.com) for the complete schema.", | ||
| }, | ||
| useAutomaticVatCalculation: { | ||
| type: "boolean", | ||
| label: "Use Automatic VAT Calculation", | ||
| description: "Set to true and specify the sales or purchase gross amount and VAT rows will be added automatically. Default: false", | ||
| optional: true, | ||
| }, | ||
| useDefaultVatCodes: { | ||
| type: "boolean", | ||
| label: "Use Default VAT Codes", | ||
| description: "Set to false to override default VAT codes on all rows in the request. Default: true", | ||
| optional: true, | ||
| }, | ||
| useDefaultVoucherSeries: { | ||
| type: "boolean", | ||
| label: "Use Default Voucher Series", | ||
| description: "Set to false to override default voucher series. Default: true", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| annotations: { | ||
| readOnlyHint: false, | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.createVoucher({ | ||
| $, | ||
| data: this.data, | ||
| params: { | ||
| useAutomaticVatCalculation: this.useAutomaticVatCalculation, | ||
| useDefaultVatCodes: this.useDefaultVatCodes, | ||
| useDefaultVoucherSeries: this.useDefaultVoucherSeries, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully created voucher with ID ${response.id || "N/A"}`); | ||
| return response; | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import app from "../../eaccounting.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "eaccounting-get-account-balance-by-account-number", | ||
| name: "Get Account Balance by Account Number", | ||
| description: "Retrieves account balance by account number and date. [See the documentation](https://developer.vismaonline.com)", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Consider adding a more specific documentation URL. The documentation link points to the general developer portal. Consider linking to the specific account balances endpoint documentation. 🤖 Prompt for AI Agents |
||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| accountNumber: { | ||
| type: "integer", | ||
| label: "Account Number", | ||
| description: "The account number", | ||
| }, | ||
| date: { | ||
| type: "string", | ||
| label: "Date", | ||
| description: "Date in format yyyy-MM-dd", | ||
| }, | ||
| }, | ||
| annotations: { | ||
| readOnlyHint: true, | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.getAccountBalanceByAccountNumber({ | ||
| accountNumber: this.accountNumber, | ||
| date: this.date, | ||
| $, | ||
| }); | ||
| $.export("$summary", `Successfully retrieved account balance for account ${this.accountNumber} on ${this.date}`); | ||
| return response; | ||
| }, | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import app from "../../eaccounting.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "eaccounting-get-account-balances", | ||
| name: "Get Account Balances", | ||
| description: "Retrieves account balances by date. [See the documentation](https://developer.vismaonline.com)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| date: { | ||
| type: "string", | ||
| label: "Date", | ||
| description: "Date in format yyyy-MM-dd", | ||
| }, | ||
|
Comment on lines
+11
to
+15
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Add date format validation. The date prop specifies the format as "yyyy-MM-dd" in the description but lacks validation. Users could submit invalid formats, leading to API errors. Apply this diff to add format validation: date: {
type: "string",
label: "Date",
description: "Date in format yyyy-MM-dd",
+ pattern: "\\d{4}-\\d{2}-\\d{2}",
},Alternatively, consider using a date picker with |
||
| }, | ||
| annotations: { | ||
| readOnlyHint: true, | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.getAccountBalances({ | ||
| date: this.date, | ||
| $, | ||
| }); | ||
| $.export("$summary", `Successfully retrieved account balances for ${this.date}`); | ||
| return response; | ||
| }, | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import app from "../../eaccounting.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "eaccounting-get-attachments", | ||
| name: "Get Attachments", | ||
| description: "Retrieves a list of attachments. [See the documentation](https://developer.vismaonline.com)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| includeMatched: { | ||
| type: "boolean", | ||
| label: "Include Matched", | ||
| description: "When set to false, returns only unmatched attachments. Default: true", | ||
| optional: true, | ||
| default: true, | ||
| }, | ||
| includeTemporaryUrl: { | ||
| type: "boolean", | ||
| label: "Include Temporary URL", | ||
| description: "When set to false, returns attachments without the TemporaryUrl. Default: true", | ||
| optional: true, | ||
| default: true, | ||
| }, | ||
| }, | ||
| annotations: { | ||
| readOnlyHint: true, | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.getAttachments({ | ||
| $, | ||
| params: { | ||
| includeMatched: this.includeMatched, | ||
| includeTemporaryUrl: this.includeTemporaryUrl, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully retrieved ${response.data?.length || 0} attachments`); | ||
| return response; | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import app from "../../eaccounting.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "eaccounting-get-bank-accounts", | ||
| name: "Get Bank Accounts", | ||
| description: "Retrieves a list of bank accounts. [See the documentation](https://developer.vismaonline.com)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| }, | ||
| annotations: { | ||
| readOnlyHint: true, | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.getBankAccounts({ | ||
| $, | ||
| }); | ||
| $.export("$summary", `Successfully retrieved ${response.data?.length || 0} bank accounts`); | ||
| return response; | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import app from "../../eaccounting.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "eaccounting-get-company-settings", | ||
| name: "Get Company Settings", | ||
| description: "Retrieves company settings. [See the documentation](https://developer.vismaonline.com)", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Reference the specific Swagger API documentation instead of the generic developer portal. The documentation link should point to the interactive Swagger endpoint reference rather than the generic developer portal. Use https://eaccountingapi.vismaonline.com/swagger/ui/index for direct access to endpoint specifications, which helps developers find relevant API operations more efficiently. 🤖 Prompt for AI Agents |
||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| }, | ||
| annotations: { | ||
| readOnlyHint: true, | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.getCompanySettings({ | ||
| $, | ||
| }); | ||
| $.export("$summary", "Successfully retrieved company settings"); | ||
| return response; | ||
| }, | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import app from "../../eaccounting.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "eaccounting-get-customer-invoices", | ||
| name: "Get Customer Invoices", | ||
| description: "Retrieves all customer invoices. [See the documentation](https://developer.vismaonline.com)", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Consider adding a more specific documentation URL. The documentation link points to the general developer portal. Consider linking to the specific API endpoint documentation (e.g., 🤖 Prompt for AI Agents |
||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| modifiedSinceUtc: { | ||
| type: "string", | ||
| label: "Modified Since (UTC)", | ||
| description: "Get the invoices which have been modified since this date. Format: yyyy-MM-ddTHH:mm:ss", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| annotations: { | ||
| readOnlyHint: true, | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.getCustomerInvoices({ | ||
| $, | ||
| params: { | ||
| modifiedSinceUtc: this.modifiedSinceUtc, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully retrieved ${response.data?.length || 0} customer invoices`); | ||
| return response; | ||
| }, | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import app from "../../eaccounting.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "eaccounting-get-supplier-invoices", | ||
| name: "Get Supplier Invoices", | ||
| description: "Retrieves all supplier invoices. [See the documentation](https://developer.vismaonline.com)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| }, | ||
| annotations: { | ||
| readOnlyHint: true, | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.getSupplierInvoices({ | ||
| $, | ||
| }); | ||
| $.export("$summary", `Successfully retrieved ${response.data?.length || 0} supplier invoices`); | ||
| return response; | ||
| }, | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Consider providing a more specific documentation link.
The
dataprop's description references the generic documentation URL. Linking directly to the CustomerInvoice schema endpoint (e.g., the Swagger docs athttps://eaccountingapi.vismaonline.com/swagger/ui/index#/CustomerInvoicesV2) would improve user experience.data: { type: "object", label: "Invoice Data", - description: "The customer invoice data as a JSON object. [See the API documentation](https://developer.vismaonline.com) for the complete schema.", + description: "The customer invoice data as a JSON object. [See the API documentation](https://eaccountingapi.vismaonline.com/swagger/ui/index#/CustomerInvoicesV2) for the complete schema.", },📝 Committable suggestion
🤖 Prompt for AI Agents