-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
base: main
Are you sure you want to change the base?
Conversation
try to fix issue calcom#14992
@siddharthji07 is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
|
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:
|
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. |
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... |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this 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.
This PR is being marked as stale due to inactivity. |
tried to fix issue #14992