Skip to content
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

Update handleCancelBooking.ts #15017

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

siddharthji07
Copy link

tried to fix issue #14992

@graphite-app graphite-app bot requested a review from a team May 14, 2024 07:02
Copy link

vercel bot commented May 14, 2024

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

A member of the Team first needs to authorize it.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label May 14, 2024
@github-actions github-actions bot added bookings area: bookings, availability, timezones, double booking Medium priority Created by Linear-GitHub Sync payments Created by Linear-GitHub Sync 🧹 Improvements Improvements to existing features. Mostly UX/UI labels May 14, 2024
Copy link
Contributor

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

No release type found in pull request title "Update handleCancelBooking.ts". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

@dosubot dosubot bot added the 🐛 bug Something isn't working label May 14, 2024
Copy link

graphite-app bot commented May 14, 2024

Graphite Automations

"Add community label" took an action on this PR • (05/14/24)

1 label was added to this PR based on Keith Williams's automation.

"Add consumer team as reviewer" took an action on this PR • (05/14/24)

1 reviewer was added to this PR based on Keith Williams's automation.

Comment on lines +158 to +171
const cancellationTime = dayjs();
const bookingStartTime = dayjs(bookingToDelete.startTime);
const hoursDifference = bookingStartTime.diff(cancellationTime, 'hours');

if (hoursDifference >= 12 && hoursDifference <= 24) {
// Perform your cancellation charging logic here
}

// If the booking is a seated event and there is no seatReferenceUid we should validate that logged in user is host
if (bookingToDelete.eventType?.seatsPerTimeSlot && !seatReferenceUid) {
// Your existing validation logic here...
}

// Your existing code for webhooks, attendees, etc...
Copy link
Contributor

Choose a reason for hiding this comment

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

@siddharthji07 I think we should add this duration in settings because everyone wouldn't want to charge if a user cancels withing 12-24 hours.

Copy link
Author

Choose a reason for hiding this comment

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

i didn't understand its a kind of charge or penality for everyone who cancelled booking in that duration, please explain me bhaiya what can i do more changes to fix this issue

Copy link
Contributor

@Udit-takkar Udit-takkar left a comment

Choose a reason for hiding this comment

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

@siddharthji07 Thanks for taking up this issue but try to get any missing info by commenting on the issue first. Right now this PR is incomplete.

@Udit-takkar Udit-takkar marked this pull request as draft May 14, 2024 07:10
@keithwillcode keithwillcode added this to the v4.2 milestone May 15, 2024
Copy link
Contributor

This PR is being marked as stale due to inactivity.

@github-actions github-actions bot added the Stale label May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bookings area: bookings, availability, timezones, double booking 🐛 bug Something isn't working community Created by Linear-GitHub Sync 🧹 Improvements Improvements to existing features. Mostly UX/UI Medium priority Created by Linear-GitHub Sync payments Created by Linear-GitHub Sync Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Client Late Cancellation Fee
4 participants