/*
 * This source file is subject to the license that is bundled with this package in the file LICENSE.
 */
package com.montealegreluis.yelpv3;

/**
 * Represents the approximate cost of a meal per person
 */
public enum PricingLevel {
    INEXPENSIVE("$", "Under $10"),
    MODERATE("$$", "$11-$30"),
    PRICEY("$$$", "$31-$60"),
    ULTRA_HIGH_END("$$$$", "Above $60");

    private final String symbol;
    private final String description;

    PricingLevel(String symbol, String description) {
        this.symbol = symbol;
        this.description = description;
    }

    public static PricingLevel fromSymbol(String symbol) {
        switch (symbol) {
            case "$":
                return INEXPENSIVE;
            case "$$":
                return MODERATE;
            case "$$$":
                return PRICEY;
            case "$$$$":
                return ULTRA_HIGH_END;
            default:
                throw UnknownPricingLevel.with(symbol);
        }
    }

    public String symbol() {
        return symbol;
    }

    public Integer value() {
        return ordinal() + 1;
    }

    public String description() {
        return description;
    }

    @Override
    public String toString() {
        return symbol;
    }
}

@@ -261,16 +261,31 @@
 der $10%22
+, %22Inexpensive%22
 ),%0A    M
@@ -307,16 +307,28 @@
 $11-$30%22
+, %22Moderate%22
 ),%0A    P
@@ -349,16 +349,26 @@
 $31-$60%22
+, %22Pricey%22
 ),%0A    U
@@ -400,16 +400,34 @@
 ove $60%22
+, %22Ultra High-End%22
 );%0A%0A    
@@ -492,16 +492,48 @@
 ription;
+%0A    private final String label;
 %0A%0A    Pr
@@ -576,16 +576,30 @@
 cription
+, String label
 ) %7B%0A    
@@ -656,32 +656,60 @@
  = description;%0A
+        this.label = label;%0A
     %7D%0A%0A    publi
@@ -1185,21 +1185,26 @@
 lic 
-Integer value
+String description
 () %7B
@@ -1223,21 +1223,19 @@
 urn 
-ordinal() + 1
+description
 ;%0A  
@@ -1253,35 +1253,87 @@
 blic String 
-description
+label() %7B%0A        return label;%0A    %7D%0A%0A    public Integer value
 () %7B%0A       
@@ -1336,35 +1336,37 @@
      return 
-description
+ordinal() + 1
 ;%0A    %7D%0A%0A   

Add label to PricingLevel enum