Heading towards 100% of renewable energy sources fraction. A critical overview on smart energy systems planning and flexibility measures