/**
* Shared Store Interfaces
*
* Common interfaces satisfied by both in-memory stores (local dev)
* and DynamoDB-backed stores (Lambda production).
*
* Return types use `T | Promise<T>` so sync in-memory implementations
* and async DynamoDB implementations both conform. Callers MUST use
* `await` on all calls to remain agnostic.
*/
import type {
CheckoutSession,
CheckoutStatus,
Mandate,
} from './types.js';
import type { CheckoutSessionUpdate } from './ucp/checkout-session.js';
// ─── Session Manager ───
export interface ISessionManager {
create(currency?: string): CheckoutSession | Promise<CheckoutSession>;
update(id: string, updates: CheckoutSessionUpdate): CheckoutSession | Promise<CheckoutSession>;
getStatus(id: string): CheckoutStatus | Promise<CheckoutStatus>;
transition(id: string, target: CheckoutStatus): CheckoutSession | Promise<CheckoutSession>;
get(id: string): CheckoutSession | undefined | Promise<CheckoutSession | undefined>;
}
// ─── Mandate Store ───
export interface IMandateStore {
store(mandate: Mandate): Promise<void>;
get(id: string): Promise<Mandate | null>;
getByCheckout(checkoutId: string): Promise<Mandate[]>;
revoke(id: string): Promise<void>;
cleanup(): Promise<number>;
}