trade_permits populate and join task refactor