<?php

namespace App\DTOs\ProductOwner;

class LicenseValidationResponseData
{
    public function __construct(
        public bool $valid,
        public ?string $status = null,
        public ?string $message = null,
        public ?string $expiresAt = null,
    ) {}

    public static function fromArray(array $data): self
    {
        return new self(
            valid: (bool) ($data['valid'] ?? false),
            status: $data['status'] ?? null,
            message: $data['message'] ?? null,
            expiresAt: $data['expires_at'] ?? null,
        );
    }
}
