did you open hood at any time and sorry unlikey it was their fault you was driving it you have to walk by hood more than once cant really not see hood up while one is driving so make one think you didnt look or shut hood
I would take it back to where I purchased it and explained what happened. Any reputable place would do the repairs for free since you just purchased it. It sounds like they did a repair and forgot to re-secure the hood.
as alreayd asked, did you open the hood yourself at any point? i would take it there to make sure the latch wasn't faulty. that's going to be a very expensive fix if it doesn't total the car.