<?php

namespace Modules\Identity\Enums;

enum TokenAbility: string
{
    case RouteRead = 'route:read';
    case BookingCreate = 'booking:create';
    case BookingRead = 'booking:read';
    case BookingCancel = 'booking:cancel';
    case PaymentInitiate = 'payment:initiate';

    /**
     * Full ability set granted to customer channel tokens (mini app / mobile app).
     *
     * @return list<string>
     */
    public static function customerAbilities(): array
    {
        return [
            self::RouteRead->value,
            self::BookingCreate->value,
            self::BookingRead->value,
            self::BookingCancel->value,
            self::PaymentInitiate->value,
        ];
    }

    /**
     * Restricted ability set granted to the FastAPI AI agent token — it must
     * never be able to refund, cancel someone else's booking, or write
     * catalog/pricing data.
     *
     * @return list<string>
     */
    public static function fastApiAgentAbilities(): array
    {
        return [
            self::RouteRead->value,
            self::BookingCreate->value,
            self::BookingRead->value,
        ];
    }
}
