<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class PackingSlipRequest extends FormRequest
{
    /**
     * @return string<array<string>>
     */
    public function rules(): array
    {
        return [
            'date_received' => ['required|date'],
            'customer_id'   => ['required|exists:customers,id'],
            'order_id'      => ['string|nullable'],
            'amount'        => ['required|string'],
            'contents'      => ['required|string'],
            'from_customer' => ['required|bool'],
        ];
    }

    public function authorize(): bool
    {
        return true;
    }
}