Steam the onion cubes in the fat until translucent, add the ham cubes. Then add the minced meat and fry in it. Stir in the tomato paste. Season everything with salt, pepper, thyme and red wine and season to taste.
In the meantime, bring 500 ml of water with a 1/2 teaspoon of salt to the boil, stir in the mashed potatoes (e.g. from Aldi) and add 15 g of butter.
Now layer everything in a baking dish as follows: minced meat, sauerkraut, minced meat, mashed potatoes. Finally sprinkle with parmesan cheese.
Cook in a preheated oven at 180 ° C for about 45 minutes.