Currently there is a separate function to connect to the ERP system just for powerJobs. ConnectToConfiguredErpServer
This function is stored in ProgramData\coolOrange\powerGate*, which vialotes separation of concerns.
It also throws errors which makes the jobs harder to debug.
The content of the functions could be moved directly into the jobs.
Else can be cut completely, because if throws an errror.
This way to code is stored where it is needed and it also makes the job easier to understand and debug.
Description
Currently there is a separate function to connect to the ERP system just for powerJobs. ConnectToConfiguredErpServer This function is stored in ProgramData\coolOrange\powerGate*, which vialotes separation of concerns. It also throws errors which makes the jobs harder to debug.
The content of the functions could be moved directly into the jobs. Else can be cut completely, because if throws an errror.
This way to code is stored where it is needed and it also makes the job easier to understand and debug.