In a bowl, combine the beans, salt, the juice of one lemon, and enough water to cover.
Soak for 8–12 hours.
When it's time to prepare the dish, drain and rinse thoroughly.
Chop the celery, the carrots, and the onion, and mince the garlic. Set aside.
In a cool pot over medium heat, add olive oil and the vegetables. Sauté for 15–20 minutes, stirring occasionally.
Once it looks a bit dry, add the tomato paste, and sauté for 2-3 minutes, stirring continuously so it doesn't burn.
Add the drained beans and the bay leaves. Season with fresh rosemary and incorporate the vegetable cube.
Now it's time to add the whole apple (with its skin, which you have previously washed).
Cover the pot, and simmer for one to one and a half hours, checking occasionally and adding more boiling water if needed.
A few minutes before serving, check the seasoning and add more salt and freshly-grounded pepper if needed.
Remove the apple and the bay leaves.
Serve with a drizzle of olive oil and chili flakes.