package beer.brew.vendingmachine.data.model;

import java.io.Serializable;

public class Beer implements Serializable {

    private static final String DESCRIPTION = "Beer";

    private final Size size;
    private final float price;

    public Beer(Size size) {
        this.size = size;
        this.price = size.getPrice();
    }

    public String getDescription() {
        return size.getDescription() + ", " + DESCRIPTION;
    }

    public float cost() {
        return this.price;
    }

    public enum Size implements Serializable {
        SMALL((float) 3, "Small Cup"),
        MIDDLE((float) 4, "Middle Cup"),
        BIG((float) 5, "Big Cup");

        private final String description;
        private final float price;

        Size(float price, String description) {
            this.price = price;
            this.description = description;
        }

        public float getPrice() {
            return this.price;
        }

        public String getDescription() {
            return this.description;
        }
    }
}

@@ -130,109 +130,70 @@
 ate 
-static final String DESCRIPTION = %22Beer%22;%0A%0A    private final Size size;%0A    private final float price
+final Size size;%0A    private final String description = %22Beer%22
 ;%0A%0A 
@@ -254,40 +254,58 @@
     
+%7D%0A%0A
     
-this.price = size.getPrice()
+public Size getSize() %7B%0A        return size
 ;%0A  
@@ -319,36 +319,33 @@
   public String 
-getD
+d
 escription() %7B%0A 
@@ -393,79 +393,19 @@
 %22 + 
-DESCRIPTION;%0A    %7D%0A%0A    public float cost() %7B%0A        return this.price
+description
 ;%0A  
@@ -474,19 +474,8 @@
 ALL(
-(float) 3, 
 %22Sma
@@ -503,19 +503,8 @@
 DLE(
-(float) 4, 
 %22Mid
@@ -530,19 +530,8 @@
 BIG(
-(float) 5, 
 %22Big
@@ -584,43 +584,8 @@
 ion;
-%0A        private final float price;
 %0A%0A  
@@ -599,21 +599,8 @@
 ize(
-float price, 
 Stri
@@ -638,141 +638,33 @@
 his.
-price = price;%0A            this.description = description;%0A        %7D%0A%0A        public float getPrice() %7B%0A            return this.price
+description = description
 ;%0A  

remove price attribute from Beer structure