<?php

namespace App\Filament\Resources\AssessmentAttempts\Schemas;

use Filament\Forms\Components\DateTimePicker;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Textarea;
use Filament\Schemas\Schema;

class AssessmentAttemptForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                TextInput::make('uuid')
                    ->label('UUID')
                    ->required(),
                Select::make('assessment_id')
                    ->relationship('assessment', 'title')
                    ->required(),
                Select::make('user_id')
                    ->relationship('user', 'name')
                    ->default(null),
                Select::make('band_id')
                    ->relationship('band', 'id')
                    ->default(null),
                TextInput::make('guest_name')
                    ->default(null),
                TextInput::make('guest_email')
                    ->email()
                    ->default(null),
                TextInput::make('status')
                    ->required()
                    ->default('in_progress'),
                Textarea::make('answers')
                    ->default(null)
                    ->columnSpanFull(),
                TextInput::make('score')
                    ->numeric()
                    ->default(null),
                TextInput::make('max_score')
                    ->numeric()
                    ->default(null),
                TextInput::make('percent')
                    ->numeric()
                    ->default(null),
                Textarea::make('dimension_percents')
                    ->default(null)
                    ->columnSpanFull(),
                DateTimePicker::make('started_at'),
                DateTimePicker::make('completed_at'),
            ]);
    }
}
