She's a year and a half old, she should know better.
No, YOU Should know better.
She is an animal.
She had to go, she was locked up, she went.
Either she wasn't taken out before you left, or you were gone too long, but no matter what the reason was, to let yourself lose it and hit an animal is simply not OK.
I don't know why you posted this here, but you have to get control of yourself next time. You were lucky your dog didn't bite you.