export interface UserSavedCard {
	id: string;
	square_card_id: string;
	brand: string;
	last_4: string;
	exp_month: number;
	exp_year: number;
	fingerprint: string;
	is_default: boolean;
}

export interface Payment {
	id: string;
	booking_id: string;
	payment_type: 'deposit' | 'full' | 'tip' | 'balance' | 'partial';
	payment_method: 'online_square' | 'in_person_card' | 'cash' | 'giftcard' | 'discount';
	vendor_code: string | null;
	invoice_number: number | null;
	status: 'pending' | 'completed' | 'failed' | 'refunded';
	amount: number;
	is_vat_applicable: boolean;
	vat_rate: number | null;
	vat_amount: number | null;
	net_amount: number | null;
	user_saved_card_id: string | null;
	square_payment_id: string | null;
	idempotency_key: string | null;
	fees: number;
	created_at: string;
	updated_at: string;
	created_by: string | null;
}

export interface Refund {
	id: string;
	payment_id: string;
	booking_id: string;
	amount: number;
	square_refund_id: string | null;
	status: 'pending' | 'completed' | 'failed' | 'refunded';
	reason: string;
	created_by: string | null;
	created_at: string;
}

export interface PaymentSummary {
	total_amount: number;
	paid_amount: number;
	refunded_amount: number;
	remaining_amount: number;
	total_vat_amount: number;
	total_net_amount: number;
	payments: Payment[];
	refunds: Refund[];
}

export interface CheckoutResponse {
	checkout_id: string;
	status: 'PENDING' | 'COMPLETED' | 'FAILED';
}
