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

refactor: move functions to separate files #15590

Merged
merged 6 commits into from
Jun 27, 2024

Conversation

Udit-takkar
Copy link
Contributor

@Udit-takkar Udit-takkar commented Jun 26, 2024

What does this PR do?

Continuing refactor of handleNewBooking

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • N/A I have added a Docs issue here if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • N/A I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

Copy link

vercel bot commented Jun 26, 2024

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 Jun 27, 2024 9:36pm
2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Jun 27, 2024 9:36pm
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Jun 27, 2024 9:36pm

@graphite-app graphite-app bot requested a review from a team June 26, 2024 21:04
@keithwillcode keithwillcode added consumer core area: core, team members only labels Jun 26, 2024
Copy link

graphite-app bot commented Jun 26, 2024

Graphite Automations

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

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

@dosubot dosubot bot added bookings area: bookings, availability, timezones, double booking 💻 refactor labels Jun 26, 2024
import { credentialForCalendarServiceSelect } from "@calcom/prisma/selects/credential";
import { EventTypeMetaDataSchema, customInputSchema } from "@calcom/prisma/zod-utils";

export const getEventTypesFromDB = async (eventTypeId: number) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No change in the code here

paymentAppData: PaymentAppData;
originalRescheduledBookingOrganizerId: number | undefined;
}) {
const requiresConfirmation = determineRequiresConfirmation(eventType, bookingStartTime);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

created smaller functions

eventTypeCustomInputs.forEach((etcInput) => {
if (etcInput.required) {
const input = reqCustomInputs.find((input) => input.label === etcInput.label);
validateInput(etcInput, input?.value);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved the logic to validateInput

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.

Nice work! Code looks good 🙏

@keithwillcode keithwillcode added this pull request to the merge queue Jun 27, 2024
@keithwillcode keithwillcode removed this pull request from the merge queue due to a manual request Jun 27, 2024
Copy link
Contributor

github-actions bot commented Jun 27, 2024

📦 Next.js Bundle Analysis for @calcom/web

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

Twenty-one Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/[user]/[type] 416.75 KB 644.46 KB 184.13% (🟡 +0.17%)
/[user]/[type]/embed 416.75 KB 644.46 KB 184.13% (🟡 +0.17%)
/apps/[slug]/[...pages] 593.44 KB 821.16 KB 234.62% (🟡 +0.22%)
/auth/saml-idp 12.22 KB 239.94 KB 68.55% (🟢 -20.80%)
/d/[link]/[slug] 416.55 KB 644.26 KB 184.08% (🟡 +0.16%)
/event-types 566.47 KB 794.18 KB 226.91% (🟡 +0.31%)
/event-types/[type] 442.12 KB 669.84 KB 191.38% (🟡 +0.17%)
/org/[orgSlug]/[user]/[type] 416.95 KB 644.66 KB 184.19% (🟡 +0.17%)
/org/[orgSlug]/[user]/[type]/embed 416.97 KB 644.69 KB 184.20% (🟡 +0.17%)
/org/[orgSlug]/instant-meeting/team/[slug]/[type] 416.57 KB 644.28 KB 184.08% (🟡 +0.17%)
/org/[orgSlug]/team/[slug]/[type] 416.76 KB 644.48 KB 184.14% (🟡 +0.17%)
/settings/admin/lockedSMS/UsersTable 79.98 KB 307.69 KB 87.91% (🟢 -0.14%)
/settings/admin/lockedSMS/lockedSMSView 119.46 KB 347.18 KB 99.19% (🟢 -0.17%)
/settings/admin/oAuth/oAuthView 95.5 KB 323.21 KB 92.35% (🟢 -0.18%)
/settings/organizations/[id]/about 159.67 KB 387.39 KB 110.68% (🟡 +0.48%)
/settings/organizations/[id]/add-teams 159.66 KB 387.38 KB 110.68% (🟡 +0.47%)
/settings/organizations/new 159.67 KB 387.39 KB 110.68% (🟡 +0.48%)
/settings/platform/new 120.72 KB 348.43 KB 99.55% (🟡 +0.52%)
/team/[slug]/[type] 416.73 KB 644.45 KB 184.13% (🟡 +0.17%)
/team/[slug]/[type]/embed 416.76 KB 644.48 KB 184.14% (🟡 +0.17%)
/video/[uid] 291.22 KB 518.94 KB 148.27% (🟢 -0.17%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

@keithwillcode keithwillcode enabled auto-merge (squash) June 27, 2024 22:02
@keithwillcode keithwillcode merged commit a52f7ef into main Jun 27, 2024
34 of 35 checks passed
@keithwillcode keithwillcode deleted the refactor/separate-functions branch June 27, 2024 22:05
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 consumer core area: core, team members only ready-for-e2e 💻 refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants