You can follow this guide - https://docs.medusajs.com/resources/commerce-modules/cart/extend
This guide explains the same scenario as yours but for cart model.
You can use it for order model and consume orderCreated workflow hook to link your custom entity