feat: Custom Fields OR Add-Ons with a fee associated
What does this PR do?
Custom Fields OR Add-Ons with a fee associated
- Fixes #7075
- Fixes CAL-3967
/claim 7075
Visual Demo (For contributors especially)
Video Demo (if applicable):
https://www.loom.com/share/c4fb241826874cc894837e85534cfd7d?sid=389aae54-dc26-428d-a902-6f4ae72bc25e
Right now pricing is supported for Number, Select, MultiSelect, Checkbox, Checkbox group and Radio group input type
Mandatory Tasks (DO NOT REMOVE)
- [x] I have self-reviewed the code (A decent size PR without self-review might be rejected).
- [x] I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
- [x] I confirm automated tests are in place that prove my fix is effective or that my feature works.
How should this be tested?
Check the Video Demo
@asadath1395 is attempting to deploy a commit to the cal Team on Vercel.
A member of the Team first needs to authorize it.
Graphite Automations
"Add consumer team as reviewer" took an action on this PR • (03/12/25)
1 reviewer was added to this PR based on Keith Williams's automation.
"Add community label" took an action on this PR • (03/12/25)
1 label was added to this PR based on Keith Williams's automation.
hey some type checks are failing, good pr nonetheless
@retrogtx Types should be fixed now
@keithwillcode Can we get this merged? Thanks
@keithwillcode Anything to be done here to get this reviewed?
@asadath1395 it will be reviewed soon
@retrogtx
I understand, this needs a review from the foundation which usually takes time as they are occupied with other stuff :)
@asadath1395 I will review this today! Sorry for keeping you waiting.
@hbjORbj Thanks for reviewing this PR, appreciate you taking the time. I have made the changes as you suggested, could you review this once more.
There's some good suggestions from mrge
You should look into it, and close the ones that don't apply!
This PR is being marked as stale due to inactivity.
@hbjORbj any update on this when this PR will get merged?
Hey @asadath1395. There are some merge conflicts and cubic comments. Could you please address them? Making it draft until then. Feel free to rfr once the comments are addressed.
Hey @asadath1395, pls address the cubic comments.
@kart1ka All cubic comments are addressed, please review. @hbjORbj Could you please take sometime to review this PR? I have addressed all your comments. I would appreciate if we could get this merged.
Thanks!
@hbjORbj Could you take some of your precious time this week to review this PR? Thanks
@hbjORbj Could you take some of your precious time this week to review this PR? Thanks
Yes, we will review it soon.
@asadath1395 can you please resolve conflicts?
[!NOTE]
Other AI code review bot(s) detected
CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.
Walkthrough
Adds end-to-end add-on pricing: schema and field-type configs now support field- and option-level prices; FormBuilder UI (Options, FieldEditDialog) renders and edits prices with currency context using a new getCurrencySymbol utility; BookingFields/BookEventForm/EventAdvancedTab propagate isPaidEvent and paymentCurrency; handlePayment accepts bookingFields and locale and aggregates addon totals (converted to smallest currency unit) into the payment payload; tests for form-builder UI and handlePayment pricing were added.
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
| Allow defining prices on custom fields and per-option add-ons (CAL-3967, #7075) | ✅ | |
| Show and edit add-on prices in the form builder UI with currency context (CAL-3967, #7075) | ✅ | |
| Include selected add-on prices in total payment calculation during booking (CAL-3967, #7075) | ✅ | |
| Propagate bookingFields and locale/currency through booking → payment flow (CAL-3967, #7075) | ✅ |
Assessment against linked issues: Out-of-scope changes
| Code Change | Explanation |
|---|---|
Payment display fallback to payment?.amount ?? paymentAppData.price (packages/features/ee/payments/components/PaymentPage.tsx) |
UI display fallback change — not required by add-on pricing objectives. |
Exported Fields type made public (packages/features/bookings/lib/getBookingFields.ts) |
Type visibility/API surface expansion unrelated to feature behavior or calculations. |
Possibly related PRs
- calcom/cal.com#23408 — Modifies packages/lib/payment/handlePayment.ts; likely overlaps with payment-handling and import changes introduced here.
- calcom/cal.com#23277 — Modifies packages/features/bookings/lib/handleNewBooking.ts; touches booking flow wiring that now passes bookingFields/locale to payment handling.
📜 Recent review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📥 Commits
Reviewing files that changed from the base of the PR and between ace97337f34f412d6ad99a41237e3c9057ece928 and bed2dd4a4af4ca66e98e77b3d978ec64c4731d61.
📒 Files selected for processing (1)
packages/features/bookings/lib/handleNewBooking.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/features/bookings/lib/handleNewBooking.ts
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Install dependencies / Yarn install & cache
✨ Finishing Touches
- [ ] 📝 Generate Docstrings
🧪 Generate unit tests
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. - PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
Support
Need help? Create a ticket on our support page for assistance with any issues or questions.
CodeRabbit Commands (Invoked using PR/Issue comments)
Type @coderabbitai help to get the list of available commands.
Other keywords and placeholders
- Add
@coderabbitai ignoreor@coderabbit ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
Status, Documentation and Community
- Visit our Status Page to check the current availability of CodeRabbit.
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
@volnei I have resolved the conflicts. Could you please review this PR?. Thanks!
Could you please resolve the failing tests.
@Devanshusharma2005 Fixed
still the e2e test failing.
still the e2e test failing.
Not sure it was related to my changes
I'm a complete GitHub newbie, but I want this @asadath1395 's feature SO DAMN BAD. Is this real life? Could this actually be happening?
There is still a merge conflict. Could you please address it.
Fixed!