Refactor the code as it stands and introduce a service layer that services as glue between the dal and controller. Goal is to make the layers more independent and responsible for less, making it easier to change things out and increasing testability. DAL code should just be to fetch data from in/out of store. Controller ideally should just be dealing with input / decoding and basic type validation. Service layer should be glue code and business validation.
[db] -> [dal] -> |service| -> [controller] -> user
Refactor the code as it stands and introduce a service layer that services as glue between the dal and controller. Goal is to make the layers more independent and responsible for less, making it easier to change things out and increasing testability. DAL code should just be to fetch data from in/out of store. Controller ideally should just be dealing with input / decoding and basic type validation. Service layer should be glue code and business validation.
[db] -> [dal] -> |service| -> [controller] -> user