team-monite / monite-sdk

Monite SDK: Embed invoicing and payables into your app
https://docs.monite.com
MIT License
15 stars 8 forks source link

Potential API Query Parameter Discrepancy: `is_overdue` in Payables #295

Closed radist2s closed 1 month ago

radist2s commented 2 months ago

During the migration of the Monite repository to the OpenAPI Qraft v2, I noticed a recent commit in main where Vitaliy added a filter for the is_overdue field in Payables. However, according to our OpenAPI documentation, the GET /payables endpoint does not support a is_overdue query parameter.

Details:

Possible Scenarios:

  1. The API has recently been updated to include this query parameter, but schema.json hasn't been updated.
  2. The parameter doesn’t actually exist in the API, indicating a potential error in the implementation.

Action Required:

Additional Note: There was an issue with the implementation of the getQueryData(…) function in Qraft, which has been fixed in the new version. This issue caused an incorrect type realization, which might be related.

vkuprin commented 2 months ago

Thank you for highlighting this.

Clarification: Currently, the is_overdue filter is not supported by the GET /payables endpoint, as the implementation of filters is still in progress by the backend team. At this stage, only the overdue label tag is available, and the full filter functionality, including is_overdue, will be added in a future update.

Impact:

• This issue is not critical and does not affect the app’s functionality. The main objective of adding the overdue label has been achieved, and no breaking changes have been introduced.

Next Steps:

• The backend team is aware of this and is actively working to complete the filter implementation. • The OpenAPI documentation (schema.json) will be updated once these features are fully supported.

Thanks again for catching this. We’ll continue to ensure the implementation aligns with our documentation. Please let me know if there are any other questions or concerns.

radist2s commented 2 months ago

@vkuprin, thanks a lot for the clarification, will keep an eye out for updates.

radist2s commented 1 month ago

Yo, have you solved the issue with the is_overdue field in the filter?

vkuprin commented 1 month ago

@radist2s Yes, it’s covered by custom filters that you can create, and the ‘isOverdue’ feature has been removed

For instance you can pass now from our customisation monite.ts

 MonitePayableTable: {
    defaultProps: {
      summaryCardFilters: {
        Unpaid: {
          status__in: ['draft', 'new', 'approve_in_progress', 'rejected'],
        },
        Scheduled: {
          tag_ids: ['f4031683-7605-48c6-969c-dcfc5397935b'],
          status__in: [
            'draft',
            'new',
            'approve_in_progress',
            'waiting_to_be_paid',
            'partially_paid',
          ],
        },
        Paid: {
          status__in: ['paid'],
        },
      /// you can put here logic for overdue based on what our payables query support as parametor and build even your own overdue logic
      },
    },

Then, it will be rendered as

Screenshot 2024-09-25 at 21 26 13