package com.gestoreasy.database.entities

import androidx.room.Entity
import androidx.room.PrimaryKey
import androidx.room.ForeignKey

@Entity(
    tableName = "checkins",
    foreignKeys = [
        ForeignKey(
            entity = Client::class,
            parentColumns = ["id"],
            childColumns = ["client_id"],
            onDelete = ForeignKey.SET_NULL
        )
    ]
)
data class CheckIn(
    @PrimaryKey(autoGenerate = true)
    val id: Long = 0,
    val client_id: Long?,
    val tipo: String, // "checkin" ou "checkout"
    val latitude: Double,
    val longitude: Double,
    val accuracy: Float?,
    val endereco: String?,
    val observacoes: String?,
    val created_at: Long = System.currentTimeMillis(),
    val synced: Boolean = false
)

