Additional relations

Hall class

Create a computed seatCounter attribute. It counts the total number of seats in a hall. Specify a ["$query","count","seat",null,{"hall":".$key"}] value in the Calculated expression field. For more details see node_modules/evado-meta-document/calc/Calc.js.

Create a multiple back reference seats attribute. It displays a list of seats in a hall. Select seat in the Reference class field. Select hall in the Reference attribute field. This attribute stores the link between a seat and a cinema hall.

Create a multiple back reference screenings attribute. It displays a list of film screenings in a hall. Select screening in the Reference class field. Select hall in the Reference attribute field. This attribute stores the link between a screening and a hall.

Create a multiple back reference prices attribute. It displays a list of pricing in a hall. Select pricing in the Reference class field. Select hall in the Reference attribute field. This attribute stores the link between a pricing and a hall.

Movie class

Create a multiple back reference screenings attribute. It displays a list of movie screenings. Select screening in the Reference class field. Select movie in the Reference attribute field. This attribute stores the link between a screening and a movie.

Create a multiple back reference tickets attribute. It displays a list of movie tickets. Select ticket in the Reference class field. Select screening in the Reference attribute field. This attribute stores the link between a ticket and a screening. Create an Intermediate link to associate a ticket with a movie. Select screening in the Reference class field. Select movie in the Reference attribute field.

If a reference attribute has an intermediate link, then you cannot change its values. Check Read only box.

Pricing class

Create a multiple back reference prices attribute. It displays a list of special prices. Select seatPrice in the Reference class field. Select pricing in the Reference attribute field..

Screening class

Create a multiple back reference tickets attribute. It displays a list of tickets of a movie screening. Select ticket in the Reference class field. Select screening in the Reference attribute field.

Create a multiple back reference freeSeats attribute. It displays a list of free tickets of a movie screening. Select ticket in the Reference class field. If a relation requires non-standard functionality, then use the Finder field. Define a configuration that will be used to fetch related objects {"Class":"component/meta/relation/FreeSeatsFinder"} (source code).

Export metadata and check created relations in Office.