The UK has agreed a trade deal with the EU just days before the end of the transitional period on December 31.