Nothing insurmountable, and when you buy a fifteen year old car, irrespective of that being a dealer or privately, you need to go in with your eyes open.
If there was evidence of water ingress prior to sale, this should have been a bargaining chip, not something to expect your average bombsite car dealer to address satisfactorily, generally speaking cars of this ilk are most likely to have been bought at auction for buttons for a quick turnaround.
I don't think you paid over the odds for a low mileage diesel, so my advice is to source a new carpet, fix the sunroof drains, and all of the other leaks that will be evident once the main one is sorted out, and enjoy the car
The other option is to attempt to get a refund, and buy something completely different.
The choice is entirely yours, but I would simply get on with sorting it out, these are brilliant cars in bangernomic terms
Have fun
Brian