fix: menu items CRUD #44
@@ -18,5 +18,5 @@ public class AddMenuItem implements MenuItemInterface {
|
||||
|
||||
private String name;
|
||||
|
||||
private double price;
|
||||
private Double price;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.eclipse.microprofile.graphql.Input;
|
||||
import org.eclipse.microprofile.graphql.NonNull;
|
||||
|
||||
@Input
|
||||
@Getter
|
||||
@@ -18,9 +19,10 @@ import org.eclipse.microprofile.graphql.Input;
|
||||
@RegisterForReflection
|
||||
public class UpdateMenuItem implements EntityInterface, MenuItemInterface {
|
||||
|
||||
@NonNull
|
||||
UUID id;
|
||||
|
||||
String name;
|
||||
|
||||
double price;
|
||||
Double price;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ public class MenuItemEntity extends BaseEntity implements MenuItemInterface {
|
||||
public String name;
|
||||
|
||||
@Column(nullable = false)
|
||||
public double price;
|
||||
public Double price;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "eatery_id")
|
||||
|
||||
@@ -306,8 +306,7 @@ public class EateryServiceTest {
|
||||
.when()
|
||||
.post("/graphql")
|
||||
.then()
|
||||
.body("", is("lmao"))
|
||||
// .body("data.updateMenuItem.name", is(newValue))
|
||||
.body("data.updateMenuItem.name", is(newValue))
|
||||
.body("data.updateMenuItem.id", is(lastSavedId))
|
||||
.statusCode(200);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,6 @@ package com.drinkool.interfaces;
|
||||
public interface MenuItemInterface {
|
||||
String getName();
|
||||
void setName(String x);
|
||||
double getPrice();
|
||||
void setPrice(double x);
|
||||
Double getPrice();
|
||||
void setPrice(Double x);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user