cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

feat: add booking date range filters and freeze GPT-4 version

Open DexterStorey opened this issue 2 years ago • 8 comments

What does this PR do?

This PR adds optional filtering by date to the Cal.com consumer API, and integration with cal.ai.

It fixes a problem where many accounts can't access the getBookings route since they have historical buggy data - and the consumer API previously fetched all booking ever, leading to errors.

We now add the option to fetch booking within a range.

Partially Fixes #11957 (issue)

Additionally, this pr freezes the GPT-4 model (gpt-4-0613) version in an attempt to prevent model degradation.

Requirement/Documentation

Type of change

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] Chore (refactoring code, technical debt, workflow improvements)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update

How should this be tested?

Mandatory Tasks

  • [x] Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

Checklist

  • ~I haven't read the contributing guide~
  • ~My code doesn't follow the style guidelines of this project~
  • I haven't commented my code, particularly in hard-to-understand areas
  • I haven't checked if my PR needs changes to the documentation
  • I haven't checked if my changes generate no new warnings
  • I haven't added tests that prove my fix is effective or that my feature works
  • I haven't checked if new and existing unit tests pass locally with my changes

DexterStorey avatar Nov 23 '23 05:11 DexterStorey

@DexterStorey is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Nov 23 '23 05:11 vercel[bot]

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.

github-actions[bot] avatar Nov 23 '23 05:11 github-actions[bot]

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

github-actions[bot] avatar Nov 23 '23 05:11 github-actions[bot]

This PR is being marked as stale due to inactivity.

github-actions[bot] avatar Dec 08 '23 00:12 github-actions[bot]

This PR is being closed due to inactivity. Please reopen if work is intended to be continued.

github-actions[bot] avatar Dec 15 '23 00:12 github-actions[bot]

Tested and fixed! This seems to work now.

When I go to: http://localhost:3002/bookings?dateFrom=2023-12-20T16:00:00Z&dateTo=2023-12-20T16:15:00Z&apiKey=API_KEY

I can see the booking:

Screenshot 2023-12-19 at 10 33 47 PM

But with: http://localhost:3002/bookings?dateFrom=2023-12-20T16:00:00Z&dateTo=2023-12-20T16:14:00Z&apiKey=API_KEY

It is hidden

Screenshot 2023-12-19 at 10 34 57 PM

With no dateFrom or dateTo passed, the api query responds normally, so in theory this is purely additive / optional.

http://localhost:3002/bookings?apiKey=API_KEY

Screenshot 2023-12-19 at 10 36 14 PM

DexterStorey avatar Dec 20 '23 03:12 DexterStorey

🚀 This should fix #11957 Docs should probably be updated as we now have a new feature for the getBookings API (dateFrom, dateTo) which filters bookings by date.

DexterStorey avatar Dec 20 '23 03:12 DexterStorey

This PR is being marked as stale due to inactivity.

github-actions[bot] avatar Jan 05 '24 00:01 github-actions[bot]