<?php

namespace App\Http\Requests\Families;

use App\Http\Requests\ApiFormRequest;

class FamilySetGuardianFlagsRequest extends ApiFormRequest
{
    public function authorize(): bool
    {
        return auth()->check();
    }

    public function rules(): array
    {
        return [
            'family_id' => ['required', 'integer', 'min:1'],
            'user_id' => ['required', 'integer', 'min:1'],
            'receive_emails' => ['nullable', 'boolean'],
            'is_primary' => ['nullable', 'boolean'],
            'receive_sms' => ['nullable', 'boolean'],
            'relation' => ['nullable', 'string', 'max:50'],
        ];
    }
}
