<?php

namespace App\Modules\Inventory\Reservation\Support;

final class ReservationAdvisoryLockKey
{
    public static function build(int $tenantId, ?string $idempotencyKey, string $source): ?string
    {
        if ($idempotencyKey === null || $idempotencyKey === '') {
            return null;
        }

        return 'resv:'.$tenantId.':'.$source.':'.$idempotencyKey;
    }
}
