I'd suggest turning this all into a class that can be instantiated with a db session, library, libraryId, etc. This makes it a bit easier to interact with since I believe that it is only called from a single file. It simplifies the calls then because for each method here the only parameter that would be passed in would be the array of resources. This should make maintenance easier in the future as well, otherwise this potentially exposes a bunch of methods needing to be changed individually if something basic changes above.
I'd suggest turning this all into a class that can be instantiated with a db session, library, libraryId, etc. This makes it a bit easier to interact with since I believe that it is only called from a single file. It simplifies the calls then because for each method here the only parameter that would be passed in would be the array of resources. This should make maintenance easier in the future as well, otherwise this potentially exposes a bunch of methods needing to be changed individually if something basic changes above.
_Originally posted by @mwbenowitz in https://github.com/BookOps-CAT/NightShift/pull/14#discussion_r799848745_