The day before, soak the salt cod in the refrigerator in plenty of water for 16–24 hours, changing the water 3–4 times.
Drain and rinse the cod, place it in a pot, and cover with water by about 2.5 cm. Bring to a boil, then simmer for about 20 minutes until the fish flakes easily with a fork. Drain well and flake the fish coarsely, removing any skin or bones.
Boil the potatoes in their skins until a fork pierces them but they aren't fully soft. Cool, peel, and slice into about 6 mm slices.
Heat half the olive oil in a heavy frying pan, add the onion, and fry for about 6–7 minutes until translucent and lightly browned. Stir in the garlic and remove from the heat.
Layer half the potatoes in the bottom of a baking dish, top with half the fish, then half the onion. Repeat with the rest, and drizzle the remaining olive oil over the top.
Bake at 200°C for about 20 minutes, until lightly browned on top.
Garnish with the olives and the egg slices, and sprinkle with parsley.
Serve straight from the dish, with olive oil and vinegar on the side.