Soak the dried chickpeas overnight and boil them for 45 minutes; boil the lentils separately for 20 minutes.
Slice the onions into thin half-moons and fry them in a little over half of the vegetable oil for 15 minutes until deep brown and crisp; remove.
Stir the rice in about a quarter of the vegetable oil for 2 minutes, add the lentils, 2½ cups of water and half of the salt and cook on low heat for 18 minutes.
Boil the pasta in plenty of salted water for 9 minutes and drain.
For the sauce, cook the garlic in the remaining oil for 1 minute, add the grated tomatoes, tomato paste, cumin, cayenne and remaining salt and cook for 15 minutes; stir in the white vinegar.
Layer the lentil rice, pasta and chickpeas in a bowl.
Pour the tomato sauce over and top with the fried onions.