Britain has condemned the sentencing of the fighters as an "egregious breach" of the Geneva Convention, under which prisoners of war are entitled to combatant immunity and should not be prosecuted for participation in hostilities.
Ukraine, which has dismissed the Donetsk court's ruling as having no authority, says the fighters had signed contracts with the Ukrainian armed forces.
Does this mean that, by definition, it is impossible for there to be any mercenaries in the Ukrainian armed forces? Since even if they are fighting entirely for personal profit (the definition of "mercenary"), Ukraine can still sign a contract with them and call them Ukrainian soldiers.
Nothing specific to Ukraine about this question; it could equally apply to e.g. Wagner Group soldiers fighting in Syria (becoming officially Syrian soldiers).
If the answer to the title question is "yes", what is the point of having separate rules for mercenaries since if the rules are sufficiently harsh then all mercenaries will magically become soldiers?