import type { PaymentEvent, PaymentIntent, PaymentTransaction } from './payment.js';

export interface PaymentProvider {
  createIntent(input: {
    orderId: string;
    amountCents: number;
    currency: 'EUR';
  }): Promise<PaymentIntent>;
  verifyWebhook(rawBody: string, signature: string | undefined): PaymentEvent;
}

export interface PaymentRepository {
  findByProviderEvent(
    provider: string,
    providerEventId: string,
  ): Promise<PaymentTransaction | undefined>;
  recordEvent(input: {
    provider: string;
    event: PaymentEvent;
  }): Promise<PaymentTransaction | undefined>;
  listByOrderId(orderId: string): Promise<PaymentTransaction[]>;
}
