<?php

namespace App\Services\Platforms\Support;

/** Everything the audit log needs to know about a call before it is made. */
readonly class CallContext
{
    public function __construct(
        public string $transport,          // graph | mcp
        public string $method,
        public string $endpoint,
        public ?string $adAccountId = null,
        public array $request = [],
        public bool $mutating = false,
        public bool $dryRun = false,
        /** Deletion skips the allow list: whatever we created, we must be able to remove. */
        public bool $guarded = true,
        /**
         * Which platform's account id this is.
         *
         * The allow list holds ids from every platform, and they are not
         * written the same way: Meta's carry an `act_` prefix and Google's are
         * ten digits. Without knowing which, the check prefixed everything and
         * a Google customer id was compared as `act_9876543210`, which matches
         * nothing an admin would ever have put in the list.
         *
         * Defaults to meta so the existing Meta call sites, which are
         * positional, keep their meaning unchanged.
         */
        public string $platform = 'meta',
    ) {}
}
