Here is the example of what I have now. Just a restaurant menu with input number. JS allows me to change input number by clicking on + and - signs.
But how can I convert this to an OrderDto entity? It's hard for me to understand how can I input both Dish ID and it's quantity in DTO's map.
Here is an example of HTML menu ( just menu class div where multiple single-menu class divs are located ).
<div class="wrapper">
<div class="title">
<h4><span>Good food and great vibes</span>our menu</h4>
</div>
<div class="menu">
<div class="single-menu" th:each="dish : ${dishList}">
<img src="https://via.placeholder.com/150" alt="" />
<div class="menu-content">
<h4 th:text="${dish.nameEng}">chicken fried salad <span>$45</span></h4>
<p>
Aperiam tempore sit,perferendis numquam repudiandae porro
voluptate dicta saepe facilis.
</p>
<div class="myContainer m-1">
<button class="decrement" data-type="decrement" onclick="stepper(this)">-</button>
<input
type="number"
min="0"
max="100"
step="1"
value="0"
readonly
/>
<button class="increment" data-type="increment" onclick="stepper(this)">+</button>
</div>
</div>
</div>
Here is an example of DTO:
public class OrderDto {
private String userEmail;
private String userName;
Map<Dish, Integer> DishQuantityMap;
}