<?php

declare(strict_types=1);

namespace App\Infrastructure\Enrichment;

/**
 * Bridges per-provider MMDB record shapes to a common tuple.
 *
 * MaxMind / DB-IP nest country under `country.iso_code` and emit ASN as
 * `autonomous_system_number` / `_organization`. IPinfo Lite is flat:
 * `country_code`, plus `asn` as a string like "AS13335" and `as_name`.
 * The MMDB lookup returns the raw record; the adapter pulls fields out.
 */
interface RecordAdapter
{
    /**
     * @param array<string, mixed> $record
     */
    public function extractCountryCode(array $record): ?string;

    /**
     * @param array<string, mixed> $record
     */
    public function extractAsn(array $record): ?int;

    /**
     * @param array<string, mixed> $record
     */
    public function extractAsOrg(array $record): ?string;
}
