import { Model, InferAttributes, InferCreationAttributes, CreationOptional, NonAttribute, ModelStatic } from "vr-migrations"; import type { Product } from "./product.models"; import type { DevicePaymentPlan } from "./devicePaymentPlan.models"; export type DeviceStatus = "locked" | "unlocked" | "disabled"; export type DeviceDedication = "PASSENGER" | "RIDER" | "N/A"; export declare const DEVICE_STATUS: readonly ["locked", "unlocked", "disabled"]; export declare const DEVICE_DEDICATION: readonly ["PASSENGER", "RIDER", "N/A"]; export interface DeviceAttributes { id: string; serialNumber: string; pairId: string; productId: string; devicePaymentPlanId: string | null; status: DeviceStatus; isPermanentlyUnlocked: boolean; dedicatedUser: DeviceDedication; activatedAt: Date | null; createdAt: Date; updatedAt: Date; product?: Product; paymentPlan?: DevicePaymentPlan; } export interface DeviceCreationAttributes extends Omit { id?: string; status?: DeviceStatus; isPermanentlyUnlocked?: boolean; devicePaymentPlanId?: string | null; } export declare class Device extends Model, InferCreationAttributes> implements DeviceAttributes { id: CreationOptional; serialNumber: string; pairId: string; productId: string; devicePaymentPlanId: CreationOptional; status: CreationOptional; isPermanentlyUnlocked: CreationOptional; dedicatedUser: DeviceDedication; activatedAt: CreationOptional; readonly createdAt: CreationOptional; readonly updatedAt: CreationOptional; product?: NonAttribute; paymentPlan?: NonAttribute; static initialize(sequelize: any): void; static associate(models: Record>): void; activate(): Promise; lock(): Promise; unlock(): Promise; disable(): Promise; makePermanent(): Promise; isActive(): boolean; canBeActivated(): boolean; isAssigned(): boolean; getPaymentPlan(): Promise; /** * Check if device can be unlocked by user */ canBeUnlocked(userId: string): Promise<{ canUnlock: boolean; reason?: string; details?: any; }>; } export type DeviceModel = typeof Device;