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

Donor Lookup Feature -- Edit Donation Functionality #233

Open
9 tasks
jayrevolinskyjr opened this issue May 9, 2023 · 0 comments
Open
9 tasks

Donor Lookup Feature -- Edit Donation Functionality #233

jayrevolinskyjr opened this issue May 9, 2023 · 0 comments
Labels
feature New feature or request Urgent Need everyone's attention

Comments

@jayrevolinskyjr
Copy link
Contributor

jayrevolinskyjr commented May 9, 2023

This is an issue spawned from #193

More specifically, spawned from the original 'Edit Button' task.

  • When a user hits the 'Edit' button on a given 'Donor View' page, the 'Edit' button will disappear from the corresponding row and be replaced by a '-' button, a '+' button, a 'Delete' button, and a 'Confirm/Cancel' button.
  • Given that the row is assigned a specific index/key, pass the index/key that corresponds to the newly-edited column to the list/map used to populate 'Donor View' page.
  • Retrieve the Date, Name, and Quantity returned from the object located within the list used to populate the 'Donor View' page.
  • Store those values into a 'prototype' JSON that tracks the Date, Name, Quantity, and original index/key.
  • When the user presses the '-' button reduce the quantity of the given item by one in the 'prototype' JSON.
  • When the user presses the '+' button increase the quantity of the given item by one in the 'prototype' JSON.
  • When the user presses the 'Delete' button, prompt the user that 'This will remove the item from the Database, are you sure?'
    - If the user presses 'Yes' on the prompt:
    - Issue a Sequelize DELETE request/route on the item based on the attributes found within the 'prototype' JSON.
    - Re-populate the map/list used to display the 'Donor View' page.
    - Dump the current 'prototype' JSON.
    - If the user presses 'No' on the prompt, simply close the prompt window.
  • If the 'Prototype' JSON is different from the Item Quantity and Availability,
    - Then the 'Confirm/Cancel' button will display 'Confirm'
    - If pressed as a 'Confirm' Button
    - Issue a Sequelize UPDATE request/route on the donation based on the attributes found within the 'prototype' JSON.
    - Revert to the original 'Edit' button state.
    - Re-populate the 'Donor View' page with the appropriate backend call.
  • If the 'Prototype' JSON is NOT different from the Item Quantity and Availability
    - Then the 'Confirm/Cancel' button renders as a 'Cancel' button
    - If pressed as the 'Cancel' button, the 'Donor View' page reverts to the 'Edit' button state.

Note: The Sequelize API endpoints will need to match up with the Item's Date, Name, and Quantity exactly in order to work properly.

The list above can be copy-pasted into tasks if necessary. 'Prototype' ER Diagram is WIP.

Original UML Diagram from #193 included for reference to 'Donor Lookup' and 'Donor View' pages.

UpdatedDonorLookup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request Urgent Need everyone's attention
Projects
None yet
Development

No branches or pull requests

1 participant