__eva('Pending payment'), self::ACTIVE => __eva('Active'), self::REDEEMED => __eva('Redeemed'), self::EXPIRED => __eva('Expired'), self::CANCELLED => __eva('Cancelled'), ]; } public static function label($status) { $list = self::listing(); return isset($list[$status]) ? $list[$status] : ucfirst($status); } /** * Statuses where the voucher can still be redeemed * (subject to remaining balance and expiry checks). */ public static function redeemable() { return [ self::ACTIVE, ]; } /** * Statuses that count as "sold" for reporting / outstanding-liability. * A voucher only reaches these after its payment is confirmed. */ public static function sold() { return [ self::ACTIVE, self::REDEEMED, self::EXPIRED, ]; } /** * Statuses that still hold value the restaurant may owe * (active with remaining balance). Used for the liability report. */ public static function outstanding() { return [ self::ACTIVE, ]; } }