<?php

namespace App\Services\Mail;

/**
 * What CluPilot sends, as a fixed list.
 *
 * Code and not data, for the same reason SecretVault::REGISTRY is curated: a
 * mapping that can name anything cannot be checked, and a purpose without a
 * sender would only be noticed at runtime — as a mail that did not arrive.
 *
 * SYSTEM is the fallback. Not a separate "which is the default" switch, which
 * could contradict the mapping; it is a row of the same table and is edited
 * like any other.
 */
final class MailPurpose
{
    public const MAINTENANCE = 'maintenance';
    public const PROVISIONING = 'provisioning';
    public const SUPPORT = 'support';
    public const BILLING = 'billing';
    public const SYSTEM = 'system';

    /** @var array<int, string> */
    public const ALL = [
        self::MAINTENANCE,
        self::PROVISIONING,
        self::SUPPORT,
        self::BILLING,
        self::SYSTEM,
    ];

    /** The settings key holding the mailbox key for a purpose. */
    public static function settingKey(string $purpose): string
    {
        return 'mail.purpose.'.$purpose;
    }
}
