Error: Cannot redeclare class becuase of entity self reference
Ok so the problem was in the namespace:

namespace Drupal\mymodule;


From my observation (can't find this in the Entity API documentation entities are supposed to be placed in the src/Entity (which I did) which imposes the Entity namespace. So fixing the namespace solved my issue.

namespace Drupal\mymodule\Entity;


What a stupid way to spend a half of a day. Looks like I'm too used to class loaders that will simply not find the class if you place it in the wrong directory.