<?php

declare(strict_types=1);

namespace App\Filament\Resources\DberpOtherStockInOrders\Pages;

use App\Business\Inventory\Enums\InventoryDocumentStatus;
use App\Filament\Resources\DberpOtherStockInOrders\DberpOtherStockInOrderResource;
use App\Filament\Resources\Pages\CreateRecord;

class CreateDberpOtherStockInOrder extends CreateRecord
{
    protected static string $resource = DberpOtherStockInOrderResource::class;

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

        return $data;
    }
}