Heat the olive oil in a large pot over medium heat. Add the onion, carrots, celery, salt, and a few grinds of black pepper. Cook, stirring occasionally, until the vegetables begin to soften, about 8 minutes.
Stir in the garlic, bay leaves, oregano, and thyme and cook for about 30 seconds, just until fragrant.
Add the diced tomatoes, vegetable broth, beans, and green beans. Bring the soup to a gentle simmer, cover, and cook for about 20 minutes to allow the flavors to come together.
Stir in the pasta and continue cooking uncovered for another 10 minutes, or until the pasta is tender.
Remove the bay leaves, taste, and adjust seasoning as needed. Serve warm, topped with fresh parsley, red pepper flakes, and grated Parmesan if desired.