cal/packages/lib/PaymentService.ts
Omar López 7c749299bb
Enforces explicit type imports (#7158)
* Enforces explicit type imports

* Upgrades typescript-eslint

* Upgrades eslint related dependencies

* Update config

* Sync packages mismatches

* Syncs prettier version

* Linting

* Relocks node version

* Fixes

* Locks @vitejs/plugin-react to 1.3.2

* Linting
2023-02-16 15:39:57 -07:00

26 lines
894 B
TypeScript

import type { Payment, Prisma, Booking } from "@prisma/client";
import type { CalendarEvent } from "@calcom/types/Calendar";
export interface IAbstractPaymentService {
create(
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>;
}