In a large pot, heat the olive oil over medium heat. Add the diced onion and sauté for about 5 minutes until translucent.
Stir in the minced garlic, diced carrot, and celery. Cook for another 5 minutes until the vegetables are tender.
Add the dried oregano and red pepper flakes (if using) to the pot, stirring to combine.
Add the cannellini beans and vegetable broth. Bring the mixture to a boil.
Once boiling, add the pasta and cook according to package instructions until al dente, usually about 8-10 minutes.
Stir in the chopped kale or spinach and heavy cream. Cook for an additional 2-3 minutes until the greens are wilted and the soup is heated through.
Season with salt and pepper to taste. Serve hot, garnished with fresh parsley and grated Parmesan cheese.