<?php

declare(strict_types=1);

namespace ApiModel\Shared\Dto\Auth;

final readonly class LoginInput
{
    public function __construct(
        public string $email,
        public string $password,
    ) {}

    /** @param array<string,mixed> $data */
    public static function fromArray(array $data): self
    {
        return new self(
            email: trim((string) ($data['email'] ?? '')),
            password: (string) ($data['password'] ?? ''),
        );
    }
}
