<?php

declare(strict_types=1);

namespace App\Filament\Resources\DberpOtherStockOutOrders\Pages;

use App\Business\Inventory\Enums\InventoryDocumentStatus;
use App\Filament\Resources\DberpOtherStockOutOrders\DberpOtherStockOutOrderResource;
use App\Filament\Resources\Pages\CreateRecord;

class CreateDberpOtherStockOutOrder extends CreateRecord
{
    protected static string $resource = DberpOtherStockOutOrderResource::class;

    protected function mutateFormDataBeforeCreate(array $data): array
    {
        $data['status'] = InventoryDocumentStatus::Draft->value;
        $data['business_time'] = $data['business_time'] ?? now();

        return $data;
    }
}