I have a German employment contract which stipulates that if I was to leave the company before a certain time, I would have to pay back (some of) the cost of training to the employer. In this case, there was not really any "training" provided, apart from some online course material that I can complete in my own time. My working time was spent actively contributing to the company, and not "training" per-se.
My question is this, what is the actual legality of such as clause in the first place? Would the clause be invalidated if I was to make a legal case that there was no actual training provided apart from what is mentioned above?