Skip to content

Conversation

@luancazarine
Copy link
Collaborator

@luancazarine luancazarine commented Nov 24, 2025

Resolves #19182

Summary by CodeRabbit

  • New Features

    • Added Fortnox actions to list accounts, articles, customers, financial years, invoices, supplier invoices, suppliers, and to retrieve a supplier invoice; added listing/fetch endpoints in the Fortnox app and a supplier-invoice selector.
  • Bug Fixes

    • Removed several invoice-payment inputs and removed terms-of-delivery/payment props; clarified due/payment date formats (YYYY-MM-DD).
  • Chores

    • Bumped Fortnox package and multiple action metadata versions.

✏️ Tip: You can customize this high-level summary in your review settings.

- Added new actions: `listAccounts`, `listFinancialYears`, `listSupplierInvoices`, `getSupplierInvoice`, `listArticles`, `listCustomers`, `listInvoices`, `listSuppliers`, and `sendInvoice`.
- Introduced a new property for `supplierInvoiceNumber` in the Fortnox app.
- Updated existing actions to version 0.0.2 and incremented the package version to 0.2.0 in package.json.
- Improved request headers for better API compatibility.

This update expands the functionality of the Fortnox component, allowing users to manage and retrieve various financial records more effectively.
@luancazarine luancazarine linked an issue Nov 24, 2025 that may be closed by this pull request
@vercel
Copy link

vercel bot commented Nov 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Dec 11, 2025 9:00pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Dec 11, 2025 9:00pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 24, 2025

Walkthrough

Adds multiple Fortnox read/list actions and a supplier-invoice get action, extends the Fortnox app with new propDefinitions and list/get methods, updates HTTP request headers, removes several props/fields from invoice-payment and invoice actions, bumps many action versions, and increments the Fortnox package version.

Changes

Cohort / File(s) Summary
New read/list actions
components/fortnox/actions/list-accounts/list-accounts.mjs, components/fortnox/actions/list-articles/list-articles.mjs, components/fortnox/actions/list-customers/list-customers.mjs, components/fortnox/actions/list-financial-years/list-financial-years.mjs, components/fortnox/actions/list-invoices/list-invoices.mjs, components/fortnox/actions/list-supplier-invoices/list-supplier-invoices.mjs, components/fortnox/actions/list-suppliers/list-suppliers.mjs
Added actions that call corresponding this.app.* list methods, export a $summary with result counts, and return resource arrays.
New get action
components/fortnox/actions/get-supplier-invoice/get-supplier-invoice.mjs
Added action to retrieve a supplier invoice by number; defines supplierInvoiceNumber prop (propDefinition) and calls this.app.getSupplierInvoice.
Action version bumps
components/fortnox/actions/create-article/create-article.mjs, components/fortnox/actions/create-customer/create-customer.mjs, components/fortnox/actions/send-invoice/send-invoice.mjs, components/fortnox/actions/update-article/update-article.mjs, components/fortnox/actions/update-customer/update-customer.mjs, components/fortnox/actions/create-invoice/create-invoice.mjs, components/fortnox/actions/create-invoice-payment/create-invoice-payment.mjs
Updated exported action version metadata from 0.0.10.0.2.
create-invoice & create-invoice-payment changes
components/fortnox/actions/create-invoice/create-invoice.mjs, components/fortnox/actions/create-invoice-payment/create-invoice-payment.mjs
create-invoice: removed termsOfDelivery & termsOfPayment props and omitted those fields from request data; updated dueDate description to include Format: YYYY-MM-DD; summary now references response.Invoice.DocumentNumber. create-invoice-payment: removed props booked, customerNumber, dueDate, invoiceTotal, modeOfPayment and removed corresponding payload fields; updated Payment Date description to Format YYYY-MM-DD.
Fortnox app updates
components/fortnox/fortnox.app.mjs
Added propDefinitions.supplierInvoiceNumber with async options, added methods listAccounts, listFinancialYears, listSupplierInvoices, getSupplierInvoice, and updated _makeRequest headers to include Content-Type: application/json and Accept: application/json.
Package version
components/fortnox/package.json
Bumped package version from 0.1.00.2.0.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Action as Action Module
  participant App as Fortnox App
  participant API as Fortnox API

  Action->>App: call this.app.list*/getSupplierInvoice({ $, params or supplierInvoiceNumber })
  App->>API: HTTP request (Authorization, Content-Type: application/json, Accept: application/json)
  API-->>App: JSON response (resource(s))
  App-->>Action: return parsed resource(s)
  Action-->>User: export $summary and return resource(s)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Review focus:
    • components/fortnox/fortnox.app.mjs — new methods, propDefinition async options, and _makeRequest header changes.
    • components/fortnox/actions/list-invoices/list-invoices.mjs — many filter-to-param mappings.
    • components/fortnox/actions/create-invoice-payment/create-invoice-payment.mjs — removed public props/payload fields; verify callers and payload shape.
    • New action files — ensure consistent propDefinitions usage, response handling, and summaries.

Possibly related PRs

Suggested labels

User submitted, prioritized

Suggested reviewers

  • michelle0927
  • GTFalcao

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete and fails to follow the required template structure. It only contains 'Resolves #19182' without any WHY section or detailed explanation of changes. Complete the PR description by adding a WHY section that explains the rationale for the changes and summarizes the key modifications made to the Fortnox component.
Out of Scope Changes check ❓ Inconclusive While most changes align with issue #19182 objectives, some modifications appear tangential: removing non-critical props from create-invoice-payment/create-invoice, changing response field references, and updating HTTP headers may exceed the scope of adding new list/get endpoints. Clarify whether property removals and HTTP header updates in existing actions are necessary for the linked issue objectives or should be addressed separately.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'Enhance Fortnox component with new actions and properties' accurately describes the main changeset, which adds multiple new actions and updates properties across the Fortnox integration.
Linked Issues check ✅ Passed The PR implements all requested endpoints from issue #19182: list accounts [1], list articles [2], list customers [3], list suppliers [4], list financial years [5], list invoices [6], get/list supplier invoices [7-8], plus version bumps and property refinements to existing actions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 19182-app-fortnox---add-more-useful-endpoints

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c09cc0d and bcea79e.

📒 Files selected for processing (1)
  • components/fortnox/actions/create-invoice-payment/create-invoice-payment.mjs (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-10-08T16:42:59.225Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 14229
File: components/americommerce/actions/update-customer/update-customer.mjs:89-94
Timestamp: 2024-10-08T16:42:59.225Z
Learning: When defining boolean properties in AmeriCommerce components (e.g., in `update-customer.mjs`), ensure that the label and description are consistent and clearly indicate the intent, especially when using negations like "No Account", to avoid confusion.

Applied to files:

  • components/fortnox/actions/create-invoice-payment/create-invoice-payment.mjs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Verify TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (3)
components/fortnox/actions/create-invoice-payment/create-invoice-payment.mjs (3)

28-33: Date format correctly updated to ISO 8601.

The payment date description now correctly specifies YYYY-MM-DD format, which aligns with the Fortnox API requirements for ISO 8601 date formatting. This addresses the previous review feedback.

Based on previous review comments, this was correctly updated from the incorrect DD/MM/YYYY format.


14-40: Verify that the minimal field set is intentional and sufficient for invoice payment scenarios.

The action exposes only 4 fields (invoiceNumber, amount, paymentDate, voucherNumber), while the Fortnox API supports significantly more optional fields including ModeOfPayment, ModeOfPaymentAccount, ExternalInvoiceReference1/2, InvoiceOCR, VoucherSeries, VoucherYear, WriteOffs, Currency, CurrencyRate, and AmountCurrency.

Before merging, confirm that:

  1. This minimal field set intentionally represents an MVP approach
  2. Users do not need access to the additional optional fields for common payment scenarios
  3. The implementation aligns with the Fortnox API documentation

7-7: The claimed removal of fields (booked, customerNumber, dueDate, invoiceTotal, modeOfPayment) cannot be verified. These fields do not appear in the current codebase or in any git history, and no other Fortnox payment or invoice actions reference them. The version bump to 0.0.2 appears appropriate for the current working implementation.

Likely an incorrect or invalid review comment.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
components/fortnox/actions/create-article/create-article.mjs (1)

108-135: Numeric fields treat "0" as “not set” due to truthy checks

Using this.directCost ? +this.directCost : undefined (same pattern for other numeric fields) prevents sending an explicit 0 value, since "0" is falsy. If 0 is a valid value for any of these fields, consider checking for null/undefined instead of truthiness, e.g.:

-          DirectCost: this.directCost
-            ? +this.directCost
-            : undefined,
+          DirectCost: this.directCost === undefined || this.directCost === null
+            ? undefined
+            : +this.directCost,

and similarly for FreightCost, PurchasePrice, SalesPrice, QuantityInStock, Weight, Width, and Height.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a1fdb8c and 603ba20.

📒 Files selected for processing (17)
  • components/fortnox/actions/create-article/create-article.mjs (1 hunks)
  • components/fortnox/actions/create-customer/create-customer.mjs (1 hunks)
  • components/fortnox/actions/create-invoice-payment/create-invoice-payment.mjs (1 hunks)
  • components/fortnox/actions/create-invoice/create-invoice.mjs (1 hunks)
  • components/fortnox/actions/get-supplier-invoice/get-supplier-invoice.mjs (1 hunks)
  • components/fortnox/actions/list-accounts/list-accounts.mjs (1 hunks)
  • components/fortnox/actions/list-articles/list-articles.mjs (1 hunks)
  • components/fortnox/actions/list-customers/list-customers.mjs (1 hunks)
  • components/fortnox/actions/list-financial-years/list-financial-years.mjs (1 hunks)
  • components/fortnox/actions/list-invoices/list-invoices.mjs (1 hunks)
  • components/fortnox/actions/list-supplier-invoices/list-supplier-invoices.mjs (1 hunks)
  • components/fortnox/actions/list-suppliers/list-suppliers.mjs (1 hunks)
  • components/fortnox/actions/send-invoice/send-invoice.mjs (1 hunks)
  • components/fortnox/actions/update-article/update-article.mjs (1 hunks)
  • components/fortnox/actions/update-customer/update-customer.mjs (1 hunks)
  • components/fortnox/fortnox.app.mjs (3 hunks)
  • components/fortnox/package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.

Applied to files:

  • components/fortnox/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (13)
components/fortnox/package.json (1)

3-3: Package version bump is consistent and dependency set is clean

Bumping the Fortnox package to 0.2.0 matches the expanded app surface and action updates, and you haven’t introduced any unnecessary dependencies (e.g., built‑in Node modules), which aligns with prior guidance. Based on learnings, this manifest looks good as‑is.

components/fortnox/actions/create-invoice-payment/create-invoice-payment.mjs (1)

7-7: Action version metadata updated appropriately

The version bump to "0.0.2" for fortnox-create-invoice-payment is consistent with the Fortnox package upgrade and other action version increments; no runtime behavior change is introduced here.

components/fortnox/actions/create-customer/create-customer.mjs (1)

7-7: Create Customer action version bump is consistent

Updating this action to version "0.0.2" keeps it in sync with the Fortnox package and related actions; no further changes needed here.

components/fortnox/actions/send-invoice/send-invoice.mjs (1)

7-7: Send Invoice action version updated in line with the package

The fortnox-send-invoice action’s version bump to "0.0.2" is consistent with the rest of the Fortnox changes and doesn’t alter runtime behavior.

components/fortnox/actions/create-invoice/create-invoice.mjs (1)

2-8: Import reordering and version bump look safe

Bringing the fortnox import alongside parseObject and bumping the action version to "0.0.2" don’t change runtime behavior and keep this action consistent with the rest of the Fortnox package.

components/fortnox/actions/update-customer/update-customer.mjs (1)

7-7: Update Customer action version bump is aligned

The change to version "0.0.2" for fortnox-update-customer matches the other Fortnox actions and the package version; no functional changes here.

components/fortnox/actions/update-article/update-article.mjs (1)

7-7: Update Article action version increment is consistent

Setting the fortnox-update-article action’s version to "0.0.2" is in line with the rest of the Fortnox integration changes and doesn’t affect the existing update logic.

components/fortnox/actions/create-article/create-article.mjs (1)

7-7: Version bump is consistent with other Fortnox actions

Bumping the action version to "0.0.2" is straightforward and aligns with the broader package version update.

components/fortnox/actions/list-financial-years/list-financial-years.mjs (1)

16-21: Verify query parameter name for financial year date

You’re sending the date as params: { Date: this.date }, while the linked issue example mentions GET /financialyears?date=<today>. If listFinancialYears forwards params directly, a casing mismatch (Date vs date) could break filtering.

Please double‑check the Fortnox docs / fortnox.app.mjs implementation and adjust either the key or the app method mapping if needed.

Also applies to: 24-29

components/fortnox/actions/list-suppliers/list-suppliers.mjs (1)

3-26: List Suppliers action looks consistent and minimal

The action cleanly wraps listSuppliers, returns the Suppliers array, and exposes a clear summary with correct pluralization. No issues from this file alone.

components/fortnox/actions/list-accounts/list-accounts.mjs (1)

3-26: Straightforward wrapper around listAccounts

Assuming this.app.listAccounts returns an array, the action and summary wiring are correct and match the pattern used by other list actions.

Ensure fortnox.app.mjs:listAccounts indeed returns an array of accounts (not an object with a nested property) so accounts.length behaves as expected.

components/fortnox/actions/get-supplier-invoice/get-supplier-invoice.mjs (1)

3-31: Get Supplier Invoice action is wired correctly

Props and run logic correctly delegate to getSupplierInvoice and return the SupplierInvoice, with a clear summary based on the selected invoice number.

components/fortnox/actions/list-articles/list-articles.mjs (1)

14-85: List Articles filters and params are consistently wired

All defined filter/sort props are correctly passed into the params object, and the summary logic is consistent with other list actions. No functional issues evident here.

Also applies to: 87-108

luancazarine and others added 2 commits November 24, 2025 11:24
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Introduced `gln`, `glndelivery`, `lastmodified`, and `sortby` properties to enhance customer data handling.
- This update improves the functionality and flexibility of the list-customers action.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cc19f4f and 9dfa75d.

📒 Files selected for processing (1)
  • components/fortnox/actions/list-customers/list-customers.mjs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (3)
components/fortnox/actions/list-customers/list-customers.mjs (3)

1-13: LGTM! Action metadata and annotations are correctly configured.

The action is properly configured as a read-only list operation with appropriate annotations and version.


97-114: LGTM! Previous issue has been resolved.

All filter props (including gln, glndelivery, lastmodified, and sortby) are now correctly included in the params object passed to listCustomers. The implementation properly handles all the filter parameters.


116-119: LGTM! Summary generation and return value are correct.

The summary correctly handles singular/plural grammar, and the function appropriately returns the Customers array.

Copy link
Collaborator

@GTFalcao GTFalcao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made some description suggestions and questions, moving it to QA since they don't impact functionality

@vunguyenhung
Copy link
Collaborator

Hello everyone, I have tested this PR and there're some test cases failed or needed improvement.

Please check test reports below for more information:

- Removed the `booked` property from the `create-invoice-payment` action.
- Updated descriptions in the `list-supplier-invoices` action to clarify invoice filtering options, correcting grammatical errors for better readability.

These changes enhance the usability and accuracy of the Fortnox component.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (2)
components/fortnox/actions/list-supplier-invoices/list-supplier-invoices.mjs (2)

6-6: Description suggests per‑supplier listing, but action doesn’t accept a supplier identifier

This action lists all supplier invoices (optionally filtered by status), not “all invoices for a supplier”. To avoid confusion, align the description with the actual behavior.

-  description: "List all invoices for a supplier. [See the documentation](https://api.fortnox.se/apidocs#tag/fortnox_SupplierInvoices/operation/list_39)",
+  description: "List supplier invoices, optionally filtered by status. [See the documentation](https://api.fortnox.se/apidocs#tag/fortnox_SupplierInvoices/operation/list_39)",

16-51: filter prop is never sent to the API

The filter prop is defined but not passed into listSupplierInvoices, so user input has no effect. This breaks the status filtering behavior and was already raised in a previous review.

-  props: {
-    app,
-    filter: {
+  props: {
+    app,
+    filter: {
@@
-      optional: true,
-    },
-  },
-  async run({ $ }) {
-    const { SupplierInvoices } = await this.app.listSupplierInvoices({
-      $,
-    });
+      optional: true,
+    },
+  },
+  async run({ $ }) {
+    const params = {};
+    if (this.filter) {
+      params.filter = this.filter;
+    }
+
+    const { SupplierInvoices } = await this.app.listSupplierInvoices({
+      $,
+      params,
+    });

Also applies to: 53-56

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9dfa75d and ac32c62.

📒 Files selected for processing (2)
  • components/fortnox/actions/create-invoice-payment/create-invoice-payment.mjs (2 hunks)
  • components/fortnox/actions/list-supplier-invoices/list-supplier-invoices.mjs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Lint Code Base
  • GitHub Check: pnpm publish
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
🔇 Additional comments (1)
components/fortnox/actions/create-invoice-payment/create-invoice-payment.mjs (1)

7-7: Version bump matches the behavior change

Bumping the action version after removing the Booked prop and payload field is appropriate; no issues with this change.

@vunguyenhung
Copy link
Collaborator

Hello everyone, I have tested this PR and there're some test cases failed or needed improvement.

Please check test reports below for more information:

luancazarine and others added 2 commits November 27, 2025 12:44
…r-invoices.mjs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Introduced `termsOfDeliveries` and `termsOfPayments` properties in the Fortnox app for invoice handling.
- Added corresponding methods to fetch delivery and payment terms asynchronously.
- Updated `create-invoice` action to utilize the new properties.

This enhancement improves the invoice creation process by allowing users to specify terms of delivery and payment more effectively.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (2)
components/fortnox/fortnox.app.mjs (2)

109-120: Paginate supplierInvoiceNumber options to handle large datasets

Unlike the other ID props, this options loader doesn’t accept { page } or forward it to listSupplierInvoices, so the dropdown can’t paginate and may only expose a subset of invoices (or fetch a large page at once).

To align with customerNumber / articleNumber and keep the UI responsive, consider:

-    supplierInvoiceNumber: {
+    supplierInvoiceNumber: {
       type: "string",
       label: "Supplier Invoice Number",
       description: "The number of the supplier invoice",
-      async options() {
-        const { SupplierInvoices: supplierInvoices } = await this.listSupplierInvoices();
+      async options({ page }) {
+        const { SupplierInvoices: supplierInvoices } = await this.listSupplierInvoices({
+          params: {
+            page: page + 1,
+          },
+        });
         return supplierInvoices?.map((invoice) => ({
           label: `${invoice.InvoiceNumber} - ${invoice.Total}`,
           value: invoice.GivenNumber,
         })) || [];
       },
     },

This mirrors the existing pagination pattern used for customers, articles, etc.


313-315: Merge custom headers with defaults to avoid dropping Authorization

Right now, any caller that passes opts.headers will overwrite the entire headers object, potentially dropping Authorization and making it harder to override just Accept/Content-Type.

Prefer merging custom headers into the defaults while ensuring Authorization remains correct:

-    _makeRequest({
-      $ = this, path, ...opts
-    }) {
-      return axios($, {
-        url: `${this._baseUrl()}${path}`,
-        headers: {
-          "Authorization": `Bearer ${this.$auth.oauth_access_token}`,
-          "Content-Type": "application/json",
-          "Accept": "application/json",
-        },
-        ...opts,
-      });
-    },
+    _makeRequest({
+      $ = this, path, ...opts
+    }) {
+      const {
+        headers: customHeaders,
+        ...restOpts
+      } = opts;
+
+      const headers = {
+        "Authorization": `Bearer ${this.$auth.oauth_access_token}`,
+        "Content-Type": "application/json",
+        "Accept": "application/json",
+        ...customHeaders,
+      };
+
+      return axios($, {
+        url: `${this._baseUrl()}${path}`,
+        headers,
+        ...restOpts,
+      });
+    },

This keeps JSON defaults while still allowing per-call overrides.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3c0c68d and 105a3e4.

📒 Files selected for processing (3)
  • components/fortnox/actions/create-invoice/create-invoice.mjs (2 hunks)
  • components/fortnox/actions/list-accounts/list-accounts.mjs (1 hunks)
  • components/fortnox/fortnox.app.mjs (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (1)
components/fortnox/fortnox.app.mjs (1)

420-457: New list/get helpers are consistent with existing patterns

The new helpers (listAccounts, listFinancialYears, listSupplierInvoices, getSupplierInvoice, listTermsOfPayments, listTermsOfDeliveries) follow the same shape as existing list/get methods and keep concerns centralized in _makeRequest. No issues from a structural/API-usage perspective.

@vunguyenhung
Copy link
Collaborator

Hello everyone, I have tested this PR and there're some test cases failed or needed improvement.

Please check test reports below for more information:

…te property from create-invoice-payment action

- Enhanced the description for the due date in the create-invoice action to specify the required format (YYYY-MM-DD).
- Removed the dueDate property from the create-invoice-payment action to streamline the payment process.

These changes improve clarity and usability in the Fortnox component.
@vunguyenhung
Copy link
Collaborator

Hello everyone, I have tested this PR and there're some test cases failed or needed improvement.

Please check test reports below for more information:

- Eliminated `termsOfDeliveries` and `termsOfPayments` properties from the Fortnox app and the create-invoice action to streamline the invoice creation process.
- Updated the create-invoice action to reflect these changes, ensuring a more focused and simplified interface.

This refactor enhances the clarity and usability of the Fortnox component.
@vunguyenhung
Copy link
Collaborator

Hello everyone, I have tested this PR and there're some test cases failed or needed improvement.

Please check test reports below for more information:

- Removed unnecessary properties: `customerNumber`, `invoiceTotal`, and `modeOfPayment` from the create-invoice-payment action to simplify the payment process.
- Updated the action's payload structure to reflect these changes, enhancing clarity and usability.

This refactor streamlines the invoice payment process within the Fortnox component.
@vunguyenhung
Copy link
Collaborator

Hello everyone, I have tested this PR and there're some test cases failed or needed improvement.

Please check test reports below for more information:

- Changed the description of the paymentDate property to specify the required format as YYYY-MM-DD, enhancing clarity for users.

This update improves the usability of the Fortnox component by providing clear formatting instructions.
@vunguyenhung
Copy link
Collaborator

Hi everyone, all test cases are passed! Ready for release!

Test reports

@luancazarine
Copy link
Collaborator Author

/approve

@luancazarine luancazarine merged commit 43d05d0 into master Dec 12, 2025
9 checks passed
@luancazarine luancazarine deleted the 19182-app-fortnox---add-more-useful-endpoints branch December 12, 2025 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[APP] Fortnox - Add more useful endpoints

4 participants