/**
 * 工作台模块类型定义
 */

// 列表项
export type WorkItem = {
    id: number
    title: string
    description: string
    status: 'pending' | 'processing' | 'completed'
    createTime: number
    updateTime: number
    creator: string
}

// 列表查询参数
export type WorkListParams = {
    page: number
    pageSize: number
    keyword?: string
    status?: string
    startTime?: number
    endTime?: number
}

// 分页响应
export type PageResult<T> = {
    list: T[]
    total: number
    page: number
    pageSize: number
    hasMore: boolean
}

// 表单数据
export type FormData = {
    title: string
    description: string
    category: string
    amount: number | null
    date: number | null
    files: FileItem[]
    images: string[]
    videos: VideoItem[]
}

// 文件项
export type FileItem = {
    name: string
    url: string
    size: number
    type: string
}

// 视频项（包含上传响应信息和视频元数据）
export type VideoItem = {
    url: string
    fileId: string
    fileName: string
    filePath: string
    fileSize: number
    fileExt: string
    businessType: string
    thumbnail: string
    duration: number
}

// 上传文件信息
export type UploadFileInfo = {
    fileId: string
    fileName: string
    filePath: string
    fileExt: string
    fileSize: number
    fileType: string | null
    createTime: string
    createBy: string
    downloadCount: number
    businessType: string
    isDeleted: number
}

// 上传响应
export type UploadResponse = {
    url: string
    fileId: string
    fileName: string
    filePath: string
    fileSize: number
    fileExt: string
    businessType: string
}

// 承包商信息
export type ContractorInfo = {
    id: string
    createBy: string
    createTime: string
    updateBy: string | null
    updateTime: string | null
    isDeleted: number
    remark: string
    creditCode: string
    contractorName: string
    companyAddress: string
    legalRepresentative: string
    contactPhone: string
    qualificationLevel: string
    qualificationCertNo: string
    businessScope: string
    bankName: string
    bankAccount: string
}

// 承包商列表响应
export type ContractorListResponse = {
    code: number
    msg: string | null
    total: number
    data: ContractorInfo[]
    success: boolean
}

