The solution was thought as an RPC interface over a Defect service which would be responsable of some CRUD operations.
src/defect.tsis ourDefectservicesrc/repositorycontains the functions which will interact with the databasesrc/middlewares/rpc.jswould be responsible for calling theDefectservice methods
No tests were written because the challenge itself is quite contrived and a lot of assumptions were made already.