<?php

declare(strict_types=1);

namespace App\Models;

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

class NovaCardChallengeEntry extends Model
{
    public const STATUS_ACTIVE = 'active';
    public const STATUS_HIDDEN = 'hidden';
    public const STATUS_REJECTED = 'rejected';

    public const STATUS_SUBMITTED = 'submitted';
    public const STATUS_FEATURED = 'featured';
    public const STATUS_WINNER = 'winner';

    protected $fillable = [
        'challenge_id',
        'card_id',
        'user_id',
        'status',
        'note',
    ];

    public function challenge(): BelongsTo
    {
        return $this->belongsTo(NovaCardChallenge::class, 'challenge_id');
    }

    public function card(): BelongsTo
    {
        return $this->belongsTo(NovaCard::class, 'card_id');
    }

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