Merged
Conversation
* feat: Add get route for tasks requests for Super User
* feat: Add createTaskRequest model function
* feat: Add controller for adding task request
* feat: Edit assign task flow to create task reques instead
Earlier in the task flow the user would automatically be assigned
the task, in this change the flow is changed to create a task
request first which will be approved by superuser
* feat: Add controllers and model functions for task tasksRequests
Update create task request model function
Add approve task controller and model fucntion
Add fetch tasks for user controller and model function
* fix: Call createTaskRequest model function in task controller
* feat: Add function to validate task request payload
toFirestoreData for task request has been added
This function validates the payload and returns a valid firestore
object.
* feat: Make create task request a working implementation from stub
* feat: Add endpoint for task requests
* feat: Make fetch requests working from stub
* feat: Make approve task route working from stub
* test: Add test for put request in task request
* fix: Task request when a already existed task is requested by another user
* test: Add test for already existing tasks requests
* fix: task requests cached response is fetched to unauthorized users
* tests: add tests for fetch request
* test: Add test for approve task request
* feat: Add more test for approve tasks
* fix: Return response instead of throwing error in controllers
* feat: update task request controller added
* refactor: Add different controller for updating task request requestor
Earlier createTaskRequest handled updation and creation of
task request, this controller had been deconstructed into two
controllers i.e createTaskRequest and addRequestor
* fix: Make one function for updating and creating task request
* fix: change create controller name to addOrUpdate
add sinon stubs in test
* fix: remove mock verify function that wraps sinon stub
* Delete empty file
* fix: Change createTaskRequest to addOrUpdate
* fix: Task request error message for task does not exist
* refactor(tasksRequests): Review comments
Use shorthand firestore methode `docs` for
creating array of tasksRequests
Fix server errors
* feat: send user to task request fetch api
* fix: Check user status before creating task request
Check if the user status exists before creating task request
* fix: Review changes
- Use array.some for requestors
- Store taskId in the taskrequest obj
- Fix test description for approve route on 400 request status
* fix: Review comments
- Fixed variable name from requestorExists to already requesting
- Restrict OOO and active users to request for tasks
* fix: Review comments
- Remove redundant `.limit()`
- Remove redundant if statement
* fix: match task request data with the data-model
* refactor: code restructure for taskrequests controller and models
* feat: Fix visited users bug mentioned in review comments
* fix: fetchTaskRequest task request requestors data
* fix: Review comments
* fix: Use Promise.all to fetch task requests
* fix: Generic Object Sink
* test: Improve test coverage
Covering all test cases for controllers, improving it from 86.95 to
89.18
* docs: made the prerequisites setup more clear * docs: fixed an unwanted change * feat: initial setup for 100ms * fix: private variable issue * feat: rooms apis * feat: added jsdoc comments to the controller and model * fix: added object destructuring to payloads * test: added unit tests for models * test: added integration tests for room APIs * fix: removed logs * fix: added constant and refresh token function. * fix: replaced uuid with crypto package to generate the unique ids. * fix: unit test for event update API * fix: removed crypto module * fix: rooms to events * fix: fallback for env variables in prod * fix: changed the endActiveRoom from delete to patch * fix: env variables in prod * feat: added removeUnwantedProperties utility function * fix: added env in test config * fix: getAllRooms controller * chore: added env variables to the config * fix: sinon variable naming * fix: added www-authenticate header check and removed payload check in post method * fix: added config default value and removed extra expiration check in isTokenExpired method * fix: changed naming from rooms to events everywhere * fix: integration and unit tests according to the changes * add: added validators for response * fix: added a constant and updated the imports * fix: joinEvent API * fix: integration test for event apis * fix: utility function * fix: integration tests for events
* add unverified role to all users who have not linked their discord id * add unit tests * add integration tests * move generate auth token for cloudflare to a util * beautify addRoleToUser function in services * add role id to test config * add unverified role id to configs * change the url from discord actions to post users
| const { validateUser } = require("../middlewares/taskRequests"); | ||
|
|
||
| router.get("/", authenticate, authorizeRoles([SUPERUSER]), cache(), taskRequests.fetchTaskRequests); | ||
| router.post("/addOrUpdate", authenticate, validateUser, taskRequests.addOrUpdate); |
Check failure
Code scanning / CodeQL
Missing rate limiting
|
|
||
| router.get("/", authenticate, authorizeRoles([SUPERUSER]), cache(), taskRequests.fetchTaskRequests); | ||
| router.post("/addOrUpdate", authenticate, validateUser, taskRequests.addOrUpdate); | ||
| router.patch("/approve", authenticate, authorizeRoles([SUPERUSER]), validateUser, taskRequests.approveTaskRequest); |
Check failure
Code scanning / CodeQL
Missing rate limiting
| const authenticate = require("../middlewares/authenticate"); | ||
| const eventsValidator = require("../middlewares/validators/events"); | ||
|
|
||
| router.post("/", authenticate, eventsValidator.createEvent, events.createEvent); |
Check failure
Code scanning / CodeQL
Missing rate limiting
| router.get("/", eventsValidator.getAllEvents, events.getAllEvents); | ||
| router.post("/join", eventsValidator.joinEvent, events.joinEvent); | ||
| router.get("/:id", eventsValidator.getEventById, events.getEventById); | ||
| router.patch("/", authenticate, eventsValidator.updateEvent, events.updateEvent); |
Check failure
Code scanning / CodeQL
Missing rate limiting
| router.post("/join", eventsValidator.joinEvent, events.joinEvent); | ||
| router.get("/:id", eventsValidator.getEventById, events.getEventById); | ||
| router.patch("/", authenticate, eventsValidator.updateEvent, events.updateEvent); | ||
| router.patch("/end", authenticate, eventsValidator.endActiveEvent, events.endActiveEvent); |
Check failure
Code scanning / CodeQL
Missing rate limiting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Date: 21 June 2023
Developer Name: @RitikJaiswal75 @TanishqSingla @prerana1821
PR Number(s):-
Backend changes
Frontend Changes
Database changes
Breaking changes (If your feature is breaking/missing something please mention pending tickets)
Deployment notes
Any special instructions for the deployment
Tested in staging
List of PRs going in this Sync.
Also, attach their screenshots.