<?php

namespace App\Services\Drift;

class DriftEvidence
{
    /**
     * @param  array<string, mixed>  $payload
     * @return array<string, mixed>
     */
    public function sanitize(array $payload): array
    {
        $allowedKeys = [
            'change_type',
            'summary',
            'baseline',
            'current',
            'diff',
            'notes',
        ];

        $safe = [];
        foreach ($allowedKeys as $key) {
            if (array_key_exists($key, $payload)) {
                $safe[$key] = $payload[$key];
            }
        }

        return $safe;
    }
}
