<?php
declare(strict_types=1);

/**
 * IVR consent digit mapping.
 * Business rule:
 * - 1 = approved (onayli)
 * - 2 = rejected (onaysiz)
 */
const CONSENT_DIGIT_APPROVED = '1';
const CONSENT_DIGIT_REJECTED = '2';

function consent_digit_approved(): string
{
  return CONSENT_DIGIT_APPROVED;
}

function consent_digit_rejected(): string
{
  return CONSENT_DIGIT_REJECTED;
}

function consent_is_approved_digit(string $digit): bool
{
  return trim($digit) === CONSENT_DIGIT_APPROVED;
}

function consent_is_rejected_digit(string $digit): bool
{
  return trim($digit) === CONSENT_DIGIT_REJECTED;
}

function consent_status_from_digit(string $digit): string
{
  if (consent_is_approved_digit($digit)) return 'onayli';
  if (consent_is_rejected_digit($digit)) return 'onaysiz';
  return '';
}
