package com.ys.bdtp.adm.mvvm.model.db.entity.task

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
import com.ys.bdtp.adm.mvvm.model.db.entity.BaseEntity
import com.google.gson.JsonElement

/**
 * 工作空间表
 */
@Entity(tableName = "job_space")
data class JobSpaceEntity(
    @PrimaryKey @ColumnInfo(name = "id") override val id: String,
    @ColumnInfo(name = "project_id") override val projectId: String?,
    @ColumnInfo(name = "building_id") override val buildingId: String?,
    @ColumnInfo(name = "floor_id") override val floorId: String?,
    @ColumnInfo(name = "state") override var state: Int = -1,
    @ColumnInfo(name = "valid") override var valid: Int = 1,
    @ColumnInfo(name = "ts") override val ts: Long = 0L,
    @ColumnInfo(name = "space_id") val spaceId: String,               // 空间id
    @ColumnInfo(name = "work_id") val workId: String?,                // 交付工作流程id
    @ColumnInfo(name = "space_type") val spaceType: String?,          // 任务空间类型(base|sub)
    @ColumnInfo(name = "parent_space_id") val parentSpaceId: String?, // 父级空间id(空间类型为sub时)
    @ColumnInfo(name = "arch_state") var archState: Int?,             // 建筑结构核查任务状态(0:待核查;1:核查中;2:核查完毕)
    @ColumnInfo(name = "equip_state") var equipState: Int?,           // 设备勘测任务状态(0:待勘测;1:勘测中;2:勘测完毕)
    @ColumnInfo(name = "outline") val outline: JsonElement? = null    // 空间边界，模型更新空间变化时，用来做匹配计算
) : BaseEntity