I have three tables, and the relationship is as below.

The object that I generate in the frontend and that I pass to the backend:
{
name: "Model1",
model_2: [
{
name: "Model2",
model_3: [
{
name: "Model3"
}
]
}
]
}
I need to know how to make the relationships and how to pass the object to create in the module_1 controller so that it inserts the values.
How can I do it?