import { CreationOptional, InferAttributes, InferCreationAttributes, Transaction } from 'sequelize'; import type { LiteralUnion } from 'type-fest'; import { TenantModel } from '../tenant-model'; import { QuoteMetadata, QuoteStatus } from './types'; export declare const nextPriceQuoteId: (size?: number) => string; /** * Create Quote Input (Final Freeze Architecture) * * Quote is created only at Submit time, directly as 'used' status. * @see Intent: blocklets/core/ai/intent/20260112-dynamic-price.md */ export interface CreateQuoteInput { price_id: string; session_id?: string; invoice_id?: string; idempotency_key: string; base_currency?: string; base_amount: string; target_currency_id: string; rate_currency_symbol: string; exchange_rate: string; quoted_amount: string; rate_provider_id: string; rate_provider_name: string; rate_timestamp_ms: number; slippage_percent?: number; max_payable_token?: string; min_acceptable_rate?: string; metadata?: QuoteMetadata; } export declare class PriceQuote extends TenantModel, InferCreationAttributes> { id: CreationOptional; instance_did?: string; price_id: string; session_id?: string; invoice_id?: string; idempotency_key: string; base_currency: string; base_amount: string; target_currency_id: string; rate_currency_symbol: string; exchange_rate: string; quoted_amount: string; rate_provider_id: string; rate_provider_name: string; rate_timestamp_ms: number; expires_at: number; status: CreationOptional>; metadata: QuoteMetadata | null; slippage_percent?: number; max_payable_token?: string; min_acceptable_rate?: string; slippage_derived_at_ms?: number; created_at: CreationOptional; static initialize(sequelize: any): void; static associate(models: any): void; /** * Check if Quote is usable for payment * Final Freeze: 'used' status means Quote is ready for payment */ isUsable(): boolean; /** * Check if Quote can be retried (payment_failed can be retried) */ canRetry(): boolean; /** * Find Quote by idempotency key (for idempotent Submit) * Returns any Quote with the given key regardless of status */ static findByIdempotencyKey(idempotencyKey: string): Promise; /** * Create Quote directly as 'used' (Final Freeze architecture) * * This is the ONLY way to create Quotes in the new architecture. * Quotes are created at Submit time, never during Preview. */ static createUsedQuote(input: CreateQuoteInput, transaction?: Transaction): Promise; /** * Mark Quote as paid (payment completed successfully) * Idempotent: if already paid, returns silently */ markAsPaid(transaction?: any): Promise; /** * Mark Quote as payment_failed * Note: payment_failed does NOT mean Quote is invalid, can be retried */ markAsPaymentFailed(transaction?: any): Promise; } export type TPriceQuote = InferAttributes;