import { CreationOptional, DataTypes, InferAttributes, InferCreationAttributes } from 'sequelize'; import type { LiteralUnion } from 'type-fest'; import { TenantModel } from '../tenant-model'; import type { TPaymentCurrency } from './payment-currency'; export declare class Coupon extends TenantModel, InferCreationAttributes> { id: CreationOptional; livemode: boolean; instance_did?: string; locked: CreationOptional; amount_off: string; percent_off: number; currency_id: string; duration: LiteralUnion<'forever' | 'once' | 'repeating', string>; duration_in_months: number; name: string; description?: string; metadata: Record; applies_to?: { products: string[]; }; currency_options?: Record; max_redemptions?: number; redeem_by?: number; times_redeemed?: number; valid?: boolean; created_via: LiteralUnion<'api' | 'dashboard' | 'portal', string>; created_at: CreationOptional; updated_at: CreationOptional; static readonly GENESIS_ATTRIBUTES: { id: { type: DataTypes.StringDataType; primaryKey: boolean; allowNull: boolean; defaultValue: (size?: number) => string; }; livemode: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; locked: { type: DataTypes.AbstractDataTypeConstructor; defaultValue: boolean; }; amount_off: { type: DataTypes.StringDataType; defaultValue: string; }; percent_off: { type: DataTypes.IntegerDataTypeConstructor; defaultValue: number; }; currency_id: { type: DataTypes.StringDataType; allowNull: boolean; defaultValue: string; }; duration: { type: DataTypes.EnumDataType<"forever" | "once" | "repeating">; allowNull: boolean; }; duration_in_months: { type: DataTypes.IntegerDataTypeConstructor; allowNull: boolean; defaultValue: number; }; name: { type: DataTypes.StringDataType; allowNull: boolean; }; description: { type: DataTypes.TextDataTypeConstructor; allowNull: boolean; }; applies_to: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; currency_options: { type: DataTypes.AbstractDataTypeConstructor; defaultValue: {}; }; max_redemptions: { type: DataTypes.IntegerDataTypeConstructor; allowNull: boolean; }; redeem_by: { type: DataTypes.IntegerDataTypeConstructor; allowNull: boolean; }; times_redeemed: { type: DataTypes.IntegerDataTypeConstructor; defaultValue: number; }; valid: { type: DataTypes.AbstractDataTypeConstructor; defaultValue: boolean; }; metadata: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; created_via: { type: DataTypes.EnumDataType<"api" | "dashboard" | "portal">; allowNull: boolean; }; created_at: { type: DataTypes.DateDataTypeConstructor; defaultValue: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; updated_at: { type: DataTypes.DateDataTypeConstructor; defaultValue: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; }; static initialize(sequelize: any): void; static associate(models: any): void; static formatBeforeSave(coupon: Partial): Partial>; static insert(coupon: Partial): Promise; isUsed(): Promise; getAppliedProducts(): Promise; /** * Format currency options for storage - convert unit amounts to token amounts */ static formatCurrencyOptions(currencyOptions: Record, currencies: TPaymentCurrency[]): Record; } export type TCoupon = InferAttributes;