<?php

namespace App\Models;

use App\Modules\Users\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

/**
 * @property int $id
 * @property int $user_id
 * @property string $activity_date
 */
class DailyUserActivity extends Model
{
    protected $table = 'daily_user_activity';

    protected $fillable = [
        'user_id',
        'activity_date',
    ];

    /**
     * @return array<string, string>
     */
    protected function casts(): array
    {
        return [
            'activity_date' => 'date',
        ];
    }

    /** @return BelongsTo<User, DailyUserActivity> */
    public function user(): BelongsTo
    {
        return $this->belongsTo(User::class);
    }
}
