<?php

namespace App\Domains\AI\Models;

use App\Domains\Tenancy\Models\Tenant;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class AiUsageDaily extends Model
{
    use HasFactory;
    use HasUuids;

    protected $table = 'ai_usage_daily';

    protected $fillable = [
        'tenant_id',
        'feature_key',
        'usage_date',
        'requests_count',
        'tokens_input',
        'tokens_output',
        'estimated_cost',
    ];

    protected $casts = [
        'usage_date' => 'date',
    ];

    public function tenant(): BelongsTo
    {
        return $this->belongsTo(Tenant::class);
    }
}
