# Fixture is from yesterday - activate yesterday fixture first to play remaining matches, create today fixture for later
logger.info(f"Fixture {fixture_id} is from yesterday and has remaining matches - activating yesterday fixture first, will create today fixture after completion")
new_fixture_id=self._initialize_new_fixture()
ifnew_fixture_id:
# Store the today fixture ID for later use
self.pending_today_fixture_id=new_fixture_id
logger.info(f"Created today fixture {new_fixture_id} - will play yesterday matches first, then switch to today")
# Activate yesterday fixture to play remaining matches
self._activate_fixture(fixture_id,message)
return
else:
logger.warning("Could not create today fixture - activating yesterday fixture as fallback")
self._activate_fixture(fixture_id,message)
return
else:
# Not enough matches, create new ones from templates
matches_needed=5-non_completed_count
logger.info(f"Fixture {fixture_id} needs {matches_needed} more matches - creating from templates")
# Fixture is from today - check if enough matches are available
logger.info(f"Fixture {fixture_id} has active matches - activating")