forked from microservices-patterns/ftgo-application
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Restaurant.java
49 lines (38 loc) · 1.14 KB
/
Restaurant.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package net.chrisrichardson.ftgo.kitchenservice.domain;
import io.eventuate.tram.events.common.DomainEvent;
import net.chrisrichardson.ftgo.kitchenservice.api.TicketDetails;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.CollectionTable;
import javax.persistence.ElementCollection;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.List;
@Entity
@Table(name = "kitchen_service_restaurants")
@Access(AccessType.FIELD)
public class Restaurant {
@Id
private Long id;
@Embedded
@ElementCollection
@CollectionTable(name = "kitchen_service_restaurant_menu_items")
private List<MenuItem> menuItems;
private Restaurant() {
}
public Restaurant(long id, List<MenuItem> menuItems) {
this.id = id;
this.menuItems = menuItems;
}
public List<DomainEvent> reviseMenu(RestaurantMenu revisedMenu) {
throw new UnsupportedOperationException();
}
public void verifyRestaurantDetails(TicketDetails ticketDetails) {
// TODO - implement me
}
public Long getId() {
return id;
}
}