<?php

namespace App\Enums;

use BenSampo\Enum\Enum;

/**
 * @method static static OptionOne()
 * @method static static OptionTwo()
 * @method static static OptionThree()
 */
final class ServiceStatus extends Enum
{
    const Pending =   0;
    const Processing =   1;
    const Approved = 2;
    const Cancel = 3;
    const CompletedAppointment = 4;
    const ConvertedToSalesOnly = 5;
    const ConvertedToMemberOnly = 6;
    const ConvertedToMemberWithSales = 7;

    /**
     * Get the enum word based on the status number.
     *
     * @param int $value
     * @return string|null
     */
    public static function wordFromValue(int $value): ?string
    {
        switch ($value) {
            case self::Pending:
                return 'Pending';
            case self::Processing:
                return 'Processing';
            case self::Approved:
                return 'Approved';
            case self::Cancel:
                return 'Cancel';
            case self::CompletedAppointment:
                return 'Completed Appointment';
            case self::ConvertedToSalesOnly:
                return 'Converted to Sales Only';
            case self::ConvertedToMemberOnly:
                return 'Converted to Member Only';
            case self::ConvertedToMemberWithSales:
                return 'Converted to Member with Sales';
            default:
                return null;
        }
    }
}
