package dto

import "time"

// PollingOverviewResp 轮询总览响应
type PollingOverviewResp struct {
	TotalCards        int64   `json:"total_cards" description:"总卡数"`
	InitializedCards  int64   `json:"initialized_cards" description:"已初始化卡数"`
	InitProgress      float64 `json:"init_progress" description:"初始化进度（0-100）"`
	IsInitializing    bool    `json:"is_initializing" description:"是否正在初始化"`
	RealnameQueueSize int64   `json:"realname_queue_size" description:"实名检查队列大小"`
	CarddataQueueSize int64   `json:"carddata_queue_size" description:"流量检查队列大小"`
	PackageQueueSize  int64   `json:"package_queue_size" description:"套餐检查队列大小"`
}

// PollingQueueStatusResp 队列状态响应
type PollingQueueStatusResp struct {
	TaskType      string  `json:"task_type" description:"任务类型"`
	TaskTypeName  string  `json:"task_type_name" description:"任务类型名称"`
	QueueSize     int64   `json:"queue_size" description:"队列大小"`
	ManualPending int64   `json:"manual_pending" description:"手动触发待处理数"`
	DueCount      int64   `json:"due_count" description:"到期待处理数"`
	AvgWaitTime   float64 `json:"avg_wait_time_s" description:"平均等待时间（秒）"`
}

// PollingQueueStatusListResp 队列状态列表响应
type PollingQueueStatusListResp struct {
	Items []*PollingQueueStatusResp `json:"items" description:"队列状态列表"`
}

// PollingTaskStatsResp 任务统计响应
type PollingTaskStatsResp struct {
	TaskType       string  `json:"task_type" description:"任务类型"`
	TaskTypeName   string  `json:"task_type_name" description:"任务类型名称"`
	SuccessCount1h int64   `json:"success_count_1h" description:"1小时成功数"`
	FailureCount1h int64   `json:"failure_count_1h" description:"1小时失败数"`
	TotalCount1h   int64   `json:"total_count_1h" description:"1小时总数"`
	SuccessRate    float64 `json:"success_rate" description:"成功率（0-100）"`
	AvgDurationMs  float64 `json:"avg_duration_ms" description:"平均耗时（毫秒）"`
}

// PollingTaskStatsListResp 任务统计列表响应
type PollingTaskStatsListResp struct {
	Items []*PollingTaskStatsResp `json:"items" description:"任务统计列表"`
}

// PollingInitProgressResp 初始化进度响应
type PollingInitProgressResp struct {
	TotalCards       int64     `json:"total_cards" description:"总卡数"`
	InitializedCards int64     `json:"initialized_cards" description:"已初始化卡数"`
	Progress         float64   `json:"progress" description:"进度百分比（0-100）"`
	IsComplete       bool      `json:"is_complete" description:"是否完成"`
	StartedAt        time.Time `json:"started_at" description:"开始时间"`
	EstimatedETA     string    `json:"estimated_eta" description:"预计完成时间"`
}
