fix: uncaught PaymentService typings in payment utils (#16107)

* fix: uncaught errors in PaymentService

* fix: uncaught errors in WebhookService

* fix: uncaught errors in sendPayload

* fix: uncaught PaymentService typings in payment utils

* fix: Remove missing users from assignment (#16115)

* remove missing users from assignment

* early return

* fix: use organization default fixedPrice if self-serve/default price is passed in (#15966)

* Use fixed price if default (selfserve) is used

* fix conditional

* use .env instead of hard coded values

* feedback

* fix: display skeleton loader (#16114)

* fix: display loader

* fix: updated skelton loader

* feat: create new markNoShow endpoint (#15738)

* feat: create new markNoShow endpoint

* chore: add schema

* chore: update name

* chore: save progress

* refactor: improve code and types

* fix: unit test

* chore: improvements

* chore: move query to booking repository

* fix: type error

* chore: Remove cal.ai email assistant (#16003)

* Delete apps/ai directory

* removed cal-ai app from app store

---------

Co-authored-by: Anik Dhabal Babu <[email protected]>
Co-authored-by: Carina Wollendorfer <[email protected]>
Co-authored-by: Hariom Balhara <[email protected]>

* feat: Add upcoming bookings feature to GET /api/bookings endpoint (#16060)

* feat: Add upcoming bookings feature to GET /api/bookings endpoint

- Added support for filtering upcoming bookings by adding the `upcoming` query parameter to the GET /api/bookings endpoint.
- When `upcoming` is set to "true", only upcoming bookings are returned.
- Regular users can now retrieve only their upcoming bookings by setting `upcoming` to "true".
- System-wide admins and organization admins can also retrieve only upcoming bookings by setting `upcoming` to "true".

* feat: Add status filter to booking API endpoint

This commit adds a new `status` filter to the booking API endpoint. The `status` filter allows filtering bookings by their status, overriding the `dateFrom` and `dateTo` filters. The only valid value for the `status` filter is "upcoming".

* Update _get.ts

---------

Co-authored-by: Anik Dhabal Babu <[email protected]>

* fix: Hide personal booking theme when in an organization (#16117)

Co-authored-by: Peer Richelsen <[email protected]>

* fix: uncaught errors in WebhookService

* fix: uncaught errors in sendPayload

---------

Co-authored-by: Syed Ali Shahbaz <[email protected]>
Co-authored-by: sean-brydon <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: Anik Dhabal Babu <[email protected]>
Co-authored-by: Carina Wollendorfer <[email protected]>
Co-authored-by: Hariom Balhara <[email protected]>
Co-authored-by: Imamuzzaki Abu Salam <[email protected]>
Co-authored-by: Joe Au-Yeung <[email protected]>
This commit is contained in:
1 file changed
+6 -7
@@ -9,6 +9,7 @@ import { getTranslation } from "@calcom/lib/server/i18n";
import sendPayload from "@calcom/lib/server/webhooks/sendPayload";
import { WebhookTriggerEvents } from "@calcom/prisma/enums";
import type { CalendarEvent } from "@calcom/types/Calendar";
import type { PaymentApp } from "@calcom/types/PaymentService";
import { TRPCError } from "@trpc/server";
@@ -25,7 +26,7 @@ export const paymentsRouter = router({
.mutation(async ({ ctx, input }) => {
const { prisma } = ctx;
const booking = await prisma.booking.findFirst({
const booking = await prisma.booking.findFirstOrThrow({
where: {
id: input.bookingId,
},
@@ -46,10 +47,6 @@ export const paymentsRouter = router({
const payment = booking.payment[0];
if (!booking) {
throw new Error("Booking not found");
}
if (payment.success) {
throw new TRPCError({
code: "BAD_REQUEST",
@@ -110,9 +107,11 @@ export const paymentsRouter = router({
throw new TRPCError({ code: "BAD_REQUEST", message: "Invalid payment credential" });
}
const paymentApp = await appStore[paymentCredential?.app?.dirName as keyof typeof appStore];
const paymentApp = (await appStore[
paymentCredential?.app?.dirName as keyof typeof appStore
]?.()) as PaymentApp | null;
if (!("lib" in paymentApp && "PaymentService" in paymentApp.lib)) {
if (!(paymentApp && paymentApp.lib && "lib" in paymentApp && "PaymentService" in paymentApp.lib)) {
throw new TRPCError({ code: "BAD_REQUEST", message: "Payment service not found" });
}