I dont think anyone has done this yet so youll need to read a bit about the available tags and build the automation. You may be able to adapt some of what i did in this post
Also have a look here, this topic involves setting product levels at the start of the day, this isnt linked to actual inventory at all, its based on the figures you input at the start
Answer probably in those tutorials but expect you will need to evaluate stock via a report expression in an order added rule which cancels the order and shows a message.