<?php

namespace App\Domain\Pricing\Enums;

enum PricingRuleType: string
{
    case Age = 'age';
    case MembershipDuration = 'membership_duration';

    /**
     * Member vs non-member. Distinct from MembershipDuration, which is tenure
     * in months and says nothing about whether the participant is a member at
     * all.
     */
    case MembershipType = 'membership_type';

    case FamilySize = 'family_size';
    case SiblingOrder = 'sibling_order';
    case Classification = 'classification';
    case EnrollmentTiming = 'enrollment_timing';
    case EnrollmentVolume = 'enrollment_volume';
    case Seasonal = 'seasonal';
    case Gender = 'gender';
    case Branch = 'branch';
    case DayTime = 'day_time';
    case Loyalty = 'loyalty';
    case Custom = 'custom';

    public function label(): string
    {
        return match ($this) {
            self::Age => 'العمر',
            self::MembershipDuration => 'مدة ' . term('membership'),
            // "عضو / غير عضو" in a club, "مقيم / غير مقيم" in a compound — the
            // branch names its own people, so the label is composed, not typed.
            self::MembershipType => term('member') . ' / ' . term('non_member'),
            self::FamilySize => 'حجم الأسرة',
            self::SiblingOrder => 'ترتيب الأخوة',
            self::Classification => 'التصنيف',
            self::EnrollmentTiming => 'توقيت التسجيل',
            self::EnrollmentVolume => 'حجم التسجيل',
            self::Seasonal => 'موسمي',
            self::Gender => 'الجنس',
            self::Branch => 'الفرع',
            self::DayTime => 'اليوم والوقت',
            self::Loyalty => 'الولاء',
            self::Custom => 'مخصص',
        };
    }
}
