In a large pot or saucepan, heat oil over medium-high heat. Add onion, carrots and celery. Cook until onions are softened (5 minutes). Sauté the garlic until fragrant (30 seconds - 1 minute).
Add the ham and cook for a further 2 minutes, then pour in the stock. Add the bay leaves (or thyme) and parsley. Bring to a boil, reduce heat and simmer for 5 minutes to combine all of the flavours together.
Stir in beans and season with pepper. Let simmer for 2 minutes, taste test and season with salt if needed.