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

feat: Add rescheduledBy & canceledBy fields in the DB #15337

Merged

Conversation

Amit91848
Copy link
Contributor

@Amit91848 Amit91848 commented Jun 5, 2024

What does this PR do?

Steps:
After creating a booking, a bunch of places I have covered from where you can reschedule / cancel bookings and then it is updated in the db:

  • booking/{bookingUid} page - Reschedule or Cancel links.
  • CTA of email of all hosts and attendees
  • Request Reschedule in booking tab
    Screenshot 2024-08-21 191510

Host:

host.mp4

Attendee:

attendee.mp4

Imp for context:
As per the discussion I had with @alishaz-polymath , in its current form this only populates the rescheduledBy and cancelledBy field in the db. It is not shown anywhere yet, but it sent as a part of webhook payload. It lacks validations and guards which makes it susceptible to misuse, so at some point as a follow up, we would have to introduce it.

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected)
  • I have added a Docs issue here if this PR makes changes that would require a documentation change
  • I have added or modified automated tests that prove my fix is effective or that my feature works (PRs might be rejected if logical changes are not properly tested)

Copy link

vercel bot commented Jun 5, 2024

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

A member of the Team first needs to authorize it.

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Jun 5, 2024
@graphite-app graphite-app bot requested a review from a team June 5, 2024 17:20
@github-actions github-actions bot added the ❗️ migrations contains migration files label Jun 5, 2024
Copy link
Contributor

github-actions bot commented Jun 5, 2024

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

@github-actions github-actions bot added bookings area: bookings, availability, timezones, double booking Medium priority Created by Linear-GitHub Sync ⚡ Quick Wins A collection of quick wins/quick fixes that are less than 30 minutes of work ✅ good first issue Good for newcomers ✨ feature New feature or request labels Jun 5, 2024
@dosubot dosubot bot added this to the v4.3 milestone Jun 5, 2024
Copy link

graphite-app bot commented Jun 5, 2024

Graphite Automations

"Add community label" took an action on this PR • (06/05/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 • (06/05/24)

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

"Add foundation team as reviewer" took an action on this PR • (08/06/24)

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

@dosubot dosubot bot modified the milestones: v4.3, v4.4 Jun 11, 2024
Copy link
Contributor

This PR is being marked as stale due to inactivity.

@github-actions github-actions bot added the Stale label Jun 26, 2024
Copy link
Contributor

@anikdhabal anikdhabal left a comment

Choose a reason for hiding this comment

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

Type checks and unit test both are failing . Could you fix them?

@keithwillcode keithwillcode added the community-interns The team responsible for reviewing, testing and shipping low/medium community PRs label Jul 4, 2024
@github-actions github-actions bot removed the Stale label Jul 5, 2024
@Amit91848 Amit91848 marked this pull request as draft July 16, 2024 15:15
@dosubot dosubot bot modified the milestones: v4.4, v4.5 Jul 17, 2024
Copy link
Contributor

github-actions bot commented Aug 1, 2024

This PR is being marked as stale due to inactivity.

@github-actions github-actions bot added the Stale label Aug 1, 2024
@anoniz
Copy link

anoniz commented Aug 1, 2024

did someone fixed this? can i work on it?

@github-actions github-actions bot removed the Stale label Aug 2, 2024
@@ -163,6 +163,7 @@ export default function Success(props: PageProps) {
const [calculatedDuration, setCalculatedDuration] = useState<number | undefined>(undefined);
const [comment, setComment] = useState("");
const parsedRating = rating ? parseInt(rating, 10) : 3;
const currentUserEmail = searchParams?.get("email") ?? session?.user?.email ?? undefined;
Copy link
Member

Choose a reason for hiding this comment

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

when coming from the email cancel button then we don't have an email param but the cancelledBy param

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be both actually. When a booking is made, the booker is redirected to booking page where it also has email param. Forgot to include the cancelledBy for the email

Copy link
Member

@CarinaWolli CarinaWolli left a comment

Choose a reason for hiding this comment

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

Let's wait for @alishaz-polymath for final approval. It looks good to me 👍

@alishaz-polymath
Copy link
Member

Requesting Platform Review as it touches Platform 🙏

Copy link
Member

@alishaz-polymath alishaz-polymath left a comment

Choose a reason for hiding this comment

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

Code looks good,
tested locally and works as well 🚀
Just waiting on Platform to clear it before we ship.

Copy link
Contributor

github-actions bot commented Aug 22, 2024

E2E results are ready!

@PeerRich PeerRich merged commit b6d3112 into calcom:main Aug 25, 2024
31 of 38 checks passed
zomars pushed a commit that referenced this pull request Aug 29, 2024
* feat: Add rescheduledBy & canceledBy fields in the DB

* fix: type check

* fix: type check

* fix: use session user email for reschedule

* fix: unit test

* feat: db field email validation

* feat: rescheduledBy and cancelledBy in webhooks

* revert unrelated changes.

* make session user secondary, default to Anonymous

* if condition not required

* Make cancelledBy optional

Co-authored-by: Syed Ali Shahbaz <52925846+alishaz-polymath@users.noreply.github.com>

* update cancel booking type

* fix: update cancelledBy in db when requesting reschedule

* remove default value for fields

* fix: type check

* feat: manage fields via api v1

* fix: add fields in booking read api v1

* test: expand to cover new fields

* fix: use cancelledBy param on booking page

---------

Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
Co-authored-by: Syed Ali Shahbaz <52925846+alishaz-polymath@users.noreply.github.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
zomars pushed a commit that referenced this pull request Aug 29, 2024
* feat: Add rescheduledBy & canceledBy fields in the DB

* fix: type check

* fix: type check

* fix: use session user email for reschedule

* fix: unit test

* feat: db field email validation

* feat: rescheduledBy and cancelledBy in webhooks

* revert unrelated changes.

* make session user secondary, default to Anonymous

* if condition not required

* Make cancelledBy optional

Co-authored-by: Syed Ali Shahbaz <52925846+alishaz-polymath@users.noreply.github.com>

* update cancel booking type

* fix: update cancelledBy in db when requesting reschedule

* remove default value for fields

* fix: type check

* feat: manage fields via api v1

* fix: add fields in booking read api v1

* test: expand to cover new fields

* fix: use cancelledBy param on booking page

---------

Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
Co-authored-by: Syed Ali Shahbaz <52925846+alishaz-polymath@users.noreply.github.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
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 community Created by Linear-GitHub Sync community-interns The team responsible for reviewing, testing and shipping low/medium community PRs ✨ feature New feature or request ✅ good first issue Good for newcomers Medium priority Created by Linear-GitHub Sync ❗️ migrations contains migration files ⚡ Quick Wins A collection of quick wins/quick fixes that are less than 30 minutes of work ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-3860] Add rescheduledBy & canceledBy fields in the DB
7 participants