Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiple extension request #1563

Merged
merged 9 commits into from
Oct 14, 2023

Conversation

MayurLund
Copy link
Contributor

@MayurLund MayurLund commented Sep 26, 2023

Issue Ticket Number:-

Backend changes

  • Yes
  • No

Frontend Changes

  • Yes - On mysite and Dashboard
  • No

Database changes

  • Yes - Addition of the request number field in extension request data.
  • No

Deployment notes

Creating an index is necessary before merging it into the main branch.

Merging these frontend pull requests simultaneously is crucial for completing this feature:

Dashboard PR : Real-Dev-Squad/website-dashboard#519
Mysite PR : Real-Dev-Squad/website-my#496

Workflow

Previously, the API did not allow the creation of more than one request at a time. To address this limitation, modifications were made under the 'dev' flag. A new function, fetchLatestExtensionRequest, was introduced. When triggered, this function retrieves the latest extension request and checks its status. If the status is either 'Approved' or 'Denied,' it allows users to create another extension request.

Additionally, a new field, requestNumber, was introduced. This field increments each time a user submits a new request. This increment is reflected both on the user's end within my site and on the dashboard site for super users.

Here is the demo video of it:

screen-capture.10.webm

Here is the workflow of it :
ExtensionRequest

Changes required in backend :
1.Creation of index so as to get the latest extension by descending timestamp when multiple extensions are present for a particular user and task.
2.Addition of requestNumber field and its increment and its handling (since its not present and undefined as per current DB fields).

Test Stats :

image
image

Copy link
Member

@iamitprakash iamitprakash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convert all date into UTC while saving to database

@Ajeyakrishna-k Ajeyakrishna-k changed the title allow multiple extension request Allow multiple extension request Sep 27, 2023
@MayurLund
Copy link
Contributor Author

convert all date into UTC while saving to database

Hi @iamitprakash Thank you for raising this concern. I understand that there's an issue with the storage of dates .If I just convert extension dates to UTC, it might cause problems with the "taskEndsOn" field and discrepancies on other pages.

Copy link
Contributor

@shubhamsinghbundela shubhamsinghbundela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work @MayurLund and Thank you for video and test cases

@MayurLund
Copy link
Contributor Author

Good work @MayurLund and Thank you for video and test cases
Thanks @shubhamsigdar1!

@MayurLund
Copy link
Contributor Author

convert all date into UTC while saving to database
Hi @iamitprakash its converting into UTC only. I verified it.

utils/extensionRequests.js Outdated Show resolved Hide resolved
controllers/extensionRequests.js Outdated Show resolved Hide resolved
controllers/extensionRequests.js Outdated Show resolved Hide resolved
models/extensionRequests.js Outdated Show resolved Hide resolved
@prakashchoudhary07
Copy link
Contributor

NIT: Please break controller in small code, and move that to service or utils

shreya-mishra
shreya-mishra previously approved these changes Oct 12, 2023
Copy link
Member

@iamitprakash iamitprakash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please update SS or Delete this if not needed

Copy link
Member

@iamitprakash iamitprakash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change error message as discussed

controllers/extensionRequests.js Show resolved Hide resolved
@MayurLund
Copy link
Contributor Author

Please change error message as discussed

Hi @iamitprakash I have fixed and changed the error messages as discussed (under dev flag block). Let me know if any more modifications are required. If not kindly approve it.

@iamitprakash iamitprakash merged commit 1293578 into develop Oct 14, 2023
3 checks passed
@iamitprakash iamitprakash deleted the feat/allow-multiple-extension-requests branch October 14, 2023 19:40
@prakashchoudhary07 prakashchoudhary07 mentioned this pull request Oct 16, 2023
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants