Files
calendar/packages/features/bookings/repositories/BookingPaymentRepository.interface.ts
Benny JooGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
96bec9f7b9 refactor: Move repositories from @calcom/lib to @calcom/features domain folders (#27570)
* refactor: move repositories from lib to features domain folders

- Move HolidayRepository to features/holidays/repositories
- Move PrismaTrackingRepository to features/bookings/repositories
- Move PrismaBookingPaymentRepository to features/bookings/repositories
- Move PrismaRoutingFormResponseRepository to features/routing-forms/repositories
- Move PrismaAssignmentReasonRepository to features/assignment-reason/repositories
- Move VerificationTokenRepository to features/auth/repositories
- Move WorkspacePlatformRepository to features/workspace-platform/repositories
- Move DTO files to their respective feature domains
- Merge lib DestinationCalendarRepository into features version
- Merge lib SelectedCalendarRepository into features version
- Update all import paths across the codebase

This follows the vertical slice architecture pattern by organizing
repositories by domain rather than by technical layer.

Co-Authored-By: [email protected] <[email protected]>

* fix: update VerificationTokenService import path to new location

Co-Authored-By: [email protected] <[email protected]>

* fix: update test file imports to use new repository locations

Co-Authored-By: [email protected] <[email protected]>

* mv

* fix structure

* fix

* refactor: merge unit tests for SelectedCalendarRepository into single file

Co-Authored-By: [email protected] <[email protected]>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-02-09 08:41:04 -03:00

53 lines
1.2 KiB
TypeScript

import type { Payment, PaymentOption, Prisma } from "@calcom/prisma/client";
import type { JsonValue } from "@calcom/types/Json";
export interface BookingPaymentWithCredentials {
id: number;
amount: number;
success: boolean;
bookingId: number;
booking: {
user: {
credentials: Array<{
key: JsonValue;
}>;
} | null;
} | null;
}
export interface CreatePaymentData {
uid: string;
app: { connect: { slug: string } };
booking: { connect: { id: number } };
amount: number;
fee: number;
externalId: string;
refunded: boolean;
success: boolean;
currency: string;
data: Prisma.InputJsonValue;
}
export interface PaymentForAwaitingEmail {
success: boolean;
externalId: string | null;
uid: string;
paymentOption: PaymentOption | null;
amount: number;
currency: string;
app: {
slug: string | null;
} | null;
}
export interface IBookingPaymentRepository {
findByExternalIdIncludeBookingUserCredentials(
externalId: string,
credentialType: string
): Promise<BookingPaymentWithCredentials | null>;
createPaymentRecord(data: CreatePaymentData): Promise<Payment>;
findByIdForAwaitingPaymentEmail(id: number): Promise<PaymentForAwaitingEmail | null>;
}