perf: tRPC procedures and middleware refactor (#8419)
* trpc procedures an middleware refactor * allow use sessionMiddleware without a req object * sync with the new tRPC structure * tRPC refactor on routing form app * import Prisma from @prisma/client * Lazy load apps from appstore * remove unrelated changes * Add types for PaymentService * type fixes * Merge branch 'main' into roae85/cal-1514-set-the-user-session-only-on-the * fix typo * remove console.log * remove explicit types from apstore object * linter fixes --------- Co-authored-by: Keith Williams <[email protected]> Co-authored-by: Hariom Balhara <[email protected]>
This commit is contained in:
63 files changed
+1818
-1019
No files matched your search
Vendored
+39
@@ -0,0 +1,39 @@
|
||||
import type { Payment, Prisma, Booking, PaymentOption } from "@prisma/client";
|
||||
|
||||
import type { CalendarEvent } from "@calcom/types/Calendar";
|
||||
|
||||
export interface IAbstractPaymentService {
|
||||
/* This method is for creating charges at the time of booking */
|
||||
create(
|
||||
payment: Pick<Prisma.PaymentUncheckedCreateInput, "amount" | "currency">,
|
||||
bookingId: Booking["id"],
|
||||
bookerEmail: string,
|
||||
paymentOption: PaymentOption
|
||||
): Promise<Payment>;
|
||||
/* This method is to collect card details to charge at a later date ex. no-show fees */
|
||||
collectCard(
|
||||
payment: Pick<Prisma.PaymentUncheckedCreateInput, "amount" | "currency">,
|
||||
bookingId: Booking["id"],
|
||||
bookerEmail: string,
|
||||
paymentOption: PaymentOption
|
||||
): Promise<Payment>;
|
||||
chargeCard(
|
||||
payment: Pick<Prisma.PaymentUncheckedCreateInput, "amount" | "currency">,
|
||||
bookingId?: Booking["id"]
|
||||
): Promise<Payment>;
|
||||
update(paymentId: Payment["id"], data: Partial<Prisma.PaymentUncheckedCreateInput>): Promise<Payment>;
|
||||
refund(paymentId: Payment["id"]): Promise<Payment>;
|
||||
getPaymentPaidStatus(): Promise<string>;
|
||||
getPaymentDetails(): Promise<Payment>;
|
||||
afterPayment(
|
||||
event: CalendarEvent,
|
||||
booking: {
|
||||
user: { email: string | null; name: string | null; timeZone: string } | null;
|
||||
id: number;
|
||||
startTime: { toISOString: () => string };
|
||||
uid: string;
|
||||
},
|
||||
paymentData: Payment
|
||||
): Promise<void>;
|
||||
deletePayment(paymentId: Payment["id"]): Promise<boolean>;
|
||||
}
|
||||
Reference in new issue
Block a user