<?php

declare(strict_types=1);

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class CollectionDailyStat extends Model
{
    use HasFactory;

    protected $fillable = [
        'collection_id',
        'stat_date',
        'views_count',
        'likes_count',
        'follows_count',
        'saves_count',
        'comments_count',
        'shares_count',
        'submissions_count',
    ];

    protected $casts = [
        'stat_date' => 'date',
        'views_count' => 'integer',
        'likes_count' => 'integer',
        'follows_count' => 'integer',
        'saves_count' => 'integer',
        'comments_count' => 'integer',
        'shares_count' => 'integer',
        'submissions_count' => 'integer',
    ];

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