Skip to content

fix: booking limits#12172

Merged
keithwillcode merged 13 commits intomainfrom
fix/booking-limits
Nov 7, 2023
Merged

fix: booking limits#12172
keithwillcode merged 13 commits intomainfrom
fix/booking-limits

Conversation

@CarinaWolli
Copy link
Copy Markdown
Member

@CarinaWolli CarinaWolli commented Oct 31, 2023

What does this PR do?

Fixes availability with booking limits when booking falls on a different day in UTC.

Fixes the following example:

  • Availability (Australia/Brisbane):
    Screenshot 2023-11-02 at 15 36 06

  • Create event type with booking limit 1 per day

  • Book any day at 16:00 (Australia/Brisbane)

  • Check availability:
    Before: Availability on that day + next day partially blocked
    After: Full day of the day of the booking is shown as unavailable, next day is not effected

@vercel
Copy link
Copy Markdown

vercel Bot commented Oct 31, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 2, 2023 11:41pm
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 2, 2023 11:41pm
dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 2, 2023 11:41pm
4 Ignored Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Nov 2, 2023 11:41pm
cal-demo ⬜️ Ignored (Inspect) Visit Preview Nov 2, 2023 11:41pm
qa ⬜️ Ignored (Inspect) Visit Preview Nov 2, 2023 11:41pm
ui ⬜️ Ignored (Inspect) Visit Preview Nov 2, 2023 11:41pm

@CarinaWolli CarinaWolli changed the title fix booking limits fix: booking limits Oct 31, 2023
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 31, 2023

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

@zomars zomars added the core area: core, team members only label Oct 31, 2023
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 31, 2023

📦 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! 🙌

@deploysentinel
Copy link
Copy Markdown

deploysentinel Bot commented Oct 31, 2023

Current Playwright Test Results Summary

✅ 251 Passing - ⚠️ 2 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 11/02/2023 11:41:01pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 4d8ef80

Started: 11/02/2023 11:36:29pm UTC

⚠️ Flakes

📄   apps/web/playwright/teams.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Teams - NonOrg Non admin team members cannot create team in org
Retry 1Initial Attempt
0% (0) 0 / 203 runs
failed over last 7 days
30.05% (61) 61 / 203 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Popup Tests should be able to reschedule
Retry 1Initial Attempt
19.93% (60) 60 / 301 runs
failed over last 7 days
77.08% (232) 232 / 301 runs
flaked over last 7 days

View Detailed Build Results


Comment thread packages/lib/server/checkBookingLimits.ts Outdated
{
dateFrom: reqBody.start,
dateTo: reqBody.end,
dateFrom: dayjs(reqBody.start).tz(reqBody.timeZone).format(),
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

reqBody.start is in system timezone. We need to have it in the correct timezone, needs to be the same as when we call that function for calculating available slots

z.number().int(),
]);

export const stringToDayjs = z.string().transform((val) => dayjs(val));
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

string was in correct timezone but dayjs(val) returned the result in system timezone

Copy link
Copy Markdown
Contributor

@exception exception left a comment

Choose a reason for hiding this comment

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

Looks ok to me, works as intended locally following PR description.

@keithwillcode keithwillcode merged commit 7bb42ba into main Nov 7, 2023
@keithwillcode keithwillcode deleted the fix/booking-limits branch November 7, 2023 17:17
@Udit-takkar
Copy link
Copy Markdown
Contributor

Screenshot 2023-11-08 at 5 28 39 PM

@CarinaWolli tests are failing

zomars pushed a commit that referenced this pull request Jan 29, 2024
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core area: core, team members only High priority Created by Linear-GitHub Sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants