Heat the olive oil in a sauté or frying pan over a medium-low fire and add the onions. Cook the onions, stirring frequently, until they’re golden. (Cook the potatoes and cod while the onions are caramelizing. If the eggs aren't already boiled, you can boil them too.) Add the chopped garlic in the last three minutes of cooking the onions. Cook the garlic until just fragrant. The onions should be done in about 35 to 45 minutes. Once the onions are cooked, remove them from the heat and set aside for the casserole assembly.
While the onions cook, bring water to a boil with the salt, bay leaf, white peppercorns and whole garlic clove in a 4-quart saucepan. Add the potatoes and boil for about 8 to 10 minutes until just tender. Remove the potatoes with a slotted spoon.
Place water in a 2-quart saucepan and add the salt cod, the same bay leaf, the white peppercorns and the same garlic clove. Place over a medium fire and cook for four to five minutes at just under a boil until the cod is flaky.
Remove the cod from the water and separate the flesh from the bones and skin. Discard the bones and skin. Set the flaked salt cod aside.
Build the casserole in an ovenproof round or rectangular baking dish. Layer half of the onions first, followed by the potatoes, salt cod and then the remaining onions. Add a small dash of salt and pepper to taste.
Place in the oven and cook for about 8 to 10 minutes until it's lightly caramelized on top.
Remove the baking dish from the oven. Garnish with black olives, the hard-boiled eggs and chopped parsley.
Notes
The nutrition is estimated using fresh haddock in place of soaked salt cod.