Associate multiple items and commit later

0
Hi everyone, I’m new to Mendix and need some help.  I’m developing a food delivery app. This is my domain model: Order, Product and Bag entities. This is the scenario: The user clicks to see the Restaurants, after that, the user selects a restaurant and a page opens with all it’s products per category. I need to click on a product and add it to the Bag temporarily, and do it multiple times, associating it with the same Bag, without saving in the database. How can I first add products to the same bag, and finally associate this bag to a Order(Pedido), finally creating the Order? 
asked
1 answers
1

Hi Daniel,

It is better to have an order line object to add products to your order: Order (1 – *) OrderLine (* – 1) Product.

Then you can manage quantities of the product in the order line.

I don’t recommend a transient object for your bag. You might want to keep track of orders which were never submitted.

You can add a status to your order to manage this.

Hope this helps,

Nico

answered