package com.gestoreasy.database.entities

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

@Entity(
    tableName = "commissions",
    foreignKeys = [
        ForeignKey(
            entity = Order::class,
            parentColumns = ["id"],
            childColumns = ["order_id"],
            onDelete = ForeignKey.SET_NULL
        )
    ]
)
data class Commission(
    @PrimaryKey
    val id: Long,
    val order_id: Long?,
    val vendedor_id: Long?,
    val valor_pedido: Double,
    val percentual_comissao: Double,
    val valor_comissao: Double,
    val status: String, // "pendente", "paga", "cancelada"
    val data_calculo: Long,
    val data_pagamento: Long?,
    val last_sync: Long = System.currentTimeMillis()
)

