<?php

namespace App\Filament\Resources\Bonuses\Schemas;

use App\Enums\BonusType;
use App\Filament\Support\HrForm;
use Filament\Forms\Components\DatePicker;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Textarea;
use Filament\Schemas\Schema;

class BonusForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                HrForm::employeeSelect(),
                DatePicker::make('bonus_date')
                    ->label(__('hr.fields.bonus_date'))
                    ->required()
                    ->default(now())
                    ->native(false),
                Select::make('bonus_type')
                    ->label(__('hr.fields.bonus_type'))
                    ->options(BonusType::class)
                    ->required()
                    ->native(false),
                TextInput::make('amount')
                    ->label(__('hr.fields.amount'))
                    ->required()
                    ->numeric()
                    ->prefix('TMT')
                    ->minValue(0)
                    ->step(0.01),
                Textarea::make('reason')
                    ->label(__('hr.fields.reason'))
                    ->rows(3)
                    ->columnSpanFull(),
            ]);
    }
}
