package com.example;

import org.springframework.data.annotation.Id;

import java.math.BigDecimal;

public class Widget {
    @Id
    private String id;

    private String product_id;
    private String name;
    private String color;
    private String size;
    private BigDecimal price;
    private Integer inventory;

    public String getProduct_id() {
        return product_id;
    }

    public void setProduct_id(String product_id) {
        this.product_id = product_id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getSize() {
        return size;
    }

    public void setSize(String size) {
        this.size = size;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getInventory() {
        return inventory;
    }

    public void setInventory(Integer inventory) {
        this.inventory = inventory;
    }

    public Widget() {
    }

    public Widget(String product_id, String name, String color,
                  String size, BigDecimal price, Integer inventory) {
        this.product_id = product_id;
        this.name = name;
        this.color = color;
        this.size = size;
        this.price = price;
        this.inventory = inventory;
    }
}

@@ -66,38 +66,81 @@
 Id;%0A
-%0A
 import 
-java.math.BigDecimal;%0A
+org.springframework.data.mongodb.core.mapping.Document;%0A%0A@Document
 %0Apub
@@ -309,26 +309,23 @@
 private 
-BigDecimal
+Integer
  price;%0A
@@ -354,16 +354,441 @@
 ventory;
+%0A    private String preview;%0A%0A    public Widget() %7B%0A    %7D%0A%0A    public Widget(String product_id, String name, String color, String size,%0A                  Integer price, Integer inventory, String preview) %7B%0A        this.product_id = product_id;%0A        this.name = name;%0A        this.color = color;%0A        this.size = size;%0A        this.price = price;%0A        this.inventory = inventory;%0A        this.preview = preview;%0A    %7D
 %0A%0A    pu
@@ -1354,26 +1354,23 @@
  public 
-BigDecimal
+Integer
  getPric
@@ -1429,26 +1429,23 @@
 etPrice(
-BigDecimal
+Integer
  price) 
@@ -1658,340 +1658,136 @@
 lic 
-Widget() %7B%0A    %7D%0A%0A    public Widget(String product_id, String name, String color,%0A                  String size, BigDecimal price, Integer inventory) %7B
+String getPreview() %7B%0A        return preview;
 %0A    
+%7D%0A%0A
     
-this.product_id = product_id;%0A        this.name = name;%0A        this.color = color;%0A        this.size = size;%0A        this.price = price;%0A        this.inventory = inventory
+public void setPreview(String preview) %7B%0A        this.preview = preview
 ;%0A  

Refactor Widget Schema