Daughter flung yogurt at cousin

Ok tell me if I should have reprimanded my daughter.

My niece is 12. She is always bothering my daughter whose 3. My daughter is really not overly affectionate generally doesn’t like to be hugged or kisses or touched. My niece is always all over her. Trying to fix her hair, trying to pick her up. My daughter hates it.

I taught my daughter if someone is doing something that you don’t like, say please stop it, I don’t like that.

My niece was over today and my daughter was eating yogurt. My niece starts playing with my daughters hair, and my daughter is getting upset saying please stop touching my hair, please don’t touch me I don’t like that. I was in the kitchen which is right next to the dining room and i said “hey, just leave her hair alone she’s eating.” My niece tells me that her hair is messy and she just wants to fix the ponytail. Two seconds later my niece starts yelling at my daughter “SAY YOUR SORRY, SAY YOUR SORRY” and I go in, and my niece has yogurt in her sweat shirt. I give her a wet paper towel to clean it up.

I didn’t really know how to handle it. My daughter knows not to fling food and not to hit and all that, but at the same time, my daughter really did handle it how she was taught- she told my niece not to touch her hair, and my niece did anyway.

I am not sure if my daughter flung the yogurt on purpose since I wasn’t there. My niece says it was intentional, but my daughter was screaming pretty badly so I have a feeling she did it on accident while she was flailing around.

I was in the kitchen washing dishes obviously I can’t leave them alone together.

My niece told me my daughter should be punished, but I told her— VERY nicely the next time my daughter tells her to stop touching her, she has to stop.