Brush the baking dish with oil, line with puff pastry and prick it with a fork. Then put the (cooked) spaghetti in the pan and sprinkle with peas and ham. Then sprinkle the grated cheese on top. Now pour a sauce made from the eggs, sour cream and spices over everything. Finally, put the tomatoes on top. Bake at 150 degrees for half an hour.