Place the ham into a lidded saucepan large enough to fit it comfortably. Add the onions, carrot, bay leaves and peppercorns, then cover with cold water. Bring to the boil, skimming off any scum that rises to the top of the water using a slotted spoon, then reduce the heat until the water is simmering, cover the pan with a lid and simmer for about 20 minutes per 500g/1lb 2oz (about 3-4 hours in total, depending on size of the ham).
To check the ham is cooked, insert a skewer into its centre, then run it against the inside of your wrist. If the skewer feels piping hot, the ham is cooked. When cooked, remove the pan from the heat and allow the ham to cool completely in its cooking liquid.
For the spelt bread, put the flour, sugar and salt into a large bowl or a food mixer fitted with a dough hook. Pour 200ml/7fl oz of the water into a jug and sprinkle over the yeast, mixing to combine. Gradually add the yeasted water to the dry ingredients, mixing continuously, until all of the yeasted water has been incorporated. Add another 500ml/18fl oz water and mix until the mixture comes together as a dough.
Turn the dough out onto a lightly floured work surface and knead well for 5-10 minutes, or until smooth and elastic. Place the dough in a large bowl, cover with cling film and set aside in a warm room until it has doubled in size (about 2 hours).
When the ham has cooled, preheat the oven to 180C/160C Fan/Gas 4. Remove the ham from the cooking liquid. Carefully peel off the ham skin and discard. Strain the cooking liquid (stock) through a fine sieve into a clean pan, discarding the vegetables.
Place the potatoes, spring onions, beans, peas, mint and parsley in a large ovenproof casserole big enough to fit the ham. Pour over 1.25 litres/2¼ pints of the strained stock, then place the ham on top with the bone resting against the lip of the casserole. Brush the outside lip of the casserole with the beaten egg.
Turn the proved dough out onto a lightly floured work surface, then stretch it into a shape large enough to cover the casserole and ham with a little overhang. Carefully cover the casserole and ham with the dough, pinching the edges all the way round to seal it against the casserole. Leave the dough loose around the ham bone so that steam can escape.
Bake the casserole in the oven for an hour, or until the spelt crust is golden-brown and sounds hollow when tapped lightly. Remove the casserole from the oven and set aside to cool for 15 minutes, then bring it to the table. Break the bread crust, lift out the ham and carve at the table, serving the ham with the bread crust and the casserole vegetables.