<?php

namespace App\Http\Requests\Admin;

use App\Models\EmailMarketingList;
use Illuminate\Foundation\Http\FormRequest;

class EmailMarketingStoreRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user()->can('create', EmailMarketingList::class);
    }

    public function rules(): array
    {
        return [
            'name' => 'required|string|max:255',
            'description' => 'nullable|string|max:500',
            'provider' => 'nullable|string|in:mailchimp,mailerlite,local',
            'default_from_name' => 'nullable|string|max:255',
            'default_from_email' => 'nullable|email|max:255',
            'default_reply_to' => 'nullable|email|max:255',
            'status' => 'boolean',
        ];
    }
}
