Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pablo Pissi
Excercise 1 - Add filter by technologyId for GET /courses endpoint
For the issue #1 the resolution was to add the technologyId in the filterFields of the Course model.
Excercise 2 - create a GET /admin/billing/getInvoices
For the issue #2 the resolution was to call the getChargeableStudents method and then use those students to generate an invoice using the AFIP api. After that, the invoiceId is attached to the response payload.
Excercise 3 - Add Middleware for caching GET requests
For the issue #3 I've created a middleware function which handle the requests. For GET requests, it uses the cache when available and for POST and PUT it removes elements from the cache. There are some GET requests that must be excluded, there is a list for that in the cacheMiddleware file, where you can list the URLs excluded from caching.
Excercise 4 - create GET /stats/failuresByStates
For the issue #4 I make a list of all the notes that are failed, using all the evaluations. Then I mapped the notes to their respective students and with this information, reduced the lists of students (which may contains duplicates) grouping by the state and counting only the different students.