import { CreationOptional, DataTypes, FindOptions, InferAttributes, InferCreationAttributes } from 'sequelize'; import type { LiteralUnion } from 'type-fest'; import { TenantModel } from '../tenant-model'; import type { TPaymentCurrency } from './payment-currency'; import type { CustomUnitAmount, LineItem, PriceCurrency, PriceRecurring, PriceTier, TransformQuantity } from './types'; import { type TMeter } from './meter'; export declare const nextPriceId: (size?: number) => string; type TPriceExpanded = TPrice & { object: 'price'; product: any; currency: TPaymentCurrency; upsell?: { upsells_to: TPriceExpanded; upsells_to_id: string; }; meter?: TMeter; }; type TLineItemExpanded = LineItem & { price: TPriceExpanded; upsell_price: TPriceExpanded; }; export declare class Price extends TenantModel, InferCreationAttributes> { id: CreationOptional; product_id: string; nickname: string | null; active: boolean; livemode: boolean; instance_did?: string; locked: CreationOptional; type: LiteralUnion<'one_time' | 'recurring', string>; billing_scheme: LiteralUnion<'per_unit' | 'tiered', string>; unit_amount: string; recurring: PriceRecurring | null; tiers_mode: LiteralUnion<'graduated' | 'volume', string> | null; tiers: PriceTier[] | null; custom_unit_amount: CustomUnitAmount | null; lookup_key: string | null; metadata: Record; transform_quantity: TransformQuantity | null; currency_id: string; currency_options: PriceCurrency[]; upsell?: { upsells_to_id: string; } | null; created_at: CreationOptional; created_via: LiteralUnion<'api' | 'dashboard' | 'portal', string>; updated_at: CreationOptional; quantity_available: number; quantity_sold: number; quantity_limit_per_checkout: number; tax_behavior?: LiteralUnion<'inclusive' | 'exclusive', string>; pricing_type: LiteralUnion<'fixed' | 'dynamic', string>; base_currency: string | null; base_amount: string | null; dynamic_pricing_config: { lock_duration?: number; } | null; static readonly GENESIS_ATTRIBUTES: { id: { type: DataTypes.StringDataType; primaryKey: boolean; allowNull: boolean; defaultValue: (size?: number) => string; }; product_id: { type: DataTypes.StringDataType; allowNull: boolean; }; nickname: { type: DataTypes.StringDataType; }; active: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; livemode: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; locked: { type: DataTypes.AbstractDataTypeConstructor; defaultValue: boolean; }; type: { type: DataTypes.EnumDataType<"recurring" | "one_time">; allowNull: boolean; }; billing_scheme: { type: DataTypes.EnumDataType<"per_unit" | "tiered">; allowNull: boolean; }; unit_amount: { type: DataTypes.StringDataType; allowNull: boolean; }; recurring: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; tiers_mode: { type: DataTypes.EnumDataType<"graduated" | "volume">; allowNull: boolean; }; tiers: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; custom_unit_amount: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; lookup_key: { type: DataTypes.StringDataType; allowNull: boolean; }; metadata: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; transform_quantity: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; currency_id: { type: DataTypes.StringDataType; }; currency_options: { type: DataTypes.AbstractDataTypeConstructor; defaultValue: never[]; }; created_at: { type: DataTypes.DateDataTypeConstructor; defaultValue: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; created_via: { type: DataTypes.EnumDataType<"api" | "dashboard" | "portal">; }; updated_at: { type: DataTypes.DateDataTypeConstructor; defaultValue: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; }; static initialize(sequelize: any): void; static associate(models: any): void; static getModel(price: TPrice): "standard" | LiteralUnion<"graduated" | "volume", string> | "package" | null; transformQuantity(quantity: number): number; static formatBeforeSave(price: Partial): Partial & { model: string; }>; static formatAfterRead(doc: TPrice, currencies: TPaymentCurrency[]): InferAttributes; static formatCurrencies(options: PriceCurrency[], currencies: TPaymentCurrency[]): any[]; static expand(items: LineItem[], { product, upsell }?: { product?: boolean; upsell?: boolean; }): Promise; static insert(price: TPrice & { model: string; }): Promise; static findByPkOrLookupKey(id: string, options?: FindOptions): Promise; isUsed(checkProduct?: boolean): Promise; } export type TPrice = InferAttributes; export {};