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

Sean inventory #148

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Sean inventory #148

wants to merge 4 commits into from

Conversation

s-j-cunningham
Copy link
Collaborator

How to Test
Postman:

  • Pantries > Pantry Update Inventory
    • Test with a food that already exists in food table and with one that doesn't

Change Summary
Updated the pantry update inventory endpoint so that it automatically checks whether a food exists in the food table and adds it if it doesn't. Also updated the route from /pantries/:pantry_id/:food_id to /pantries/:pantry_id/:food_name as new foods do not have a food_id.

Updated existing test and added a new test.

Developer Checklist

  • This PR includes appropriate automated tests for touched features.
  • Thorough manual testing was done.
  • Code was commented and documentation was updated with the change.

@s-j-cunningham s-j-cunningham requested a review from klmui April 16, 2021 18:18
@s-j-cunningham s-j-cunningham linked an issue Apr 16, 2021 that may be closed by this pull request
@github-actions
Copy link

Total Coverage: 39.67%

Coverage Report
FileBranchesFuncsLinesUncovered Lines
src/components
   CartView.js100%88.89%95.83%77
   DashboardDescriptionCard.js10%30%36.36%106, 107, 119, 133, 286, 42, 43, 43, 46, 46, 46, 47, 48, 49, 50, 51, 52, 53, 62, 64, 64, 64, 69, 84, 94, 95, 98, 98, 98, 99
   DashboardMessages.js55.26%48%73.24%100, 154, 157, 176, 180, 186, 190, 196, 197, 215, 215, 215, 216, 222, 242, 242, 242, 243, 249, 269, 269, 269, 270, 276, 300, 300, 300, 301, 307, 318, 327, 365, 375, 399, 47, 57
   DashboardOpenHourCard.js40%45.45%51.43%102, 116, 133, 137, 214, 37, 38, 38, 41, 41, 41, 42, 43, 44, 52, 53, 55, 55, 55, 60, 68, 74, 75, 78, 78, 78, 79, 90, 91
   DashboardView.js25%40.91%36.11%109, 110, 112, 113, 120, 134, 135, 137, 138, 143, 158, 178, 179, 179, 179, 180, 181, 182, 185, 295, 57, 89, 91, 93, 94, 99
   DashboardViewAllMessage.js100%0%0%10, 12, 15
   FoodItemCard.js59.38%59.26%50.75%100, 100, 100, 101, 105, 107, 114, 123, 124, 126, 126, 126, 129, 138, 139, 141, 141, 141, 142, 146, 147, 151, 154, 154, 154, 155, 166, 168, 174, 182, 184, 185, 193, 311, 329, 466, 467, 474, 79, 80, 81, 82, 98, 98, 98, 99
   FoodSearchView.js33.33%50%47.73%101, 102, 104, 121, 125, 126, 133, 134, 151, 55, 56, 57, 67, 71, 71, 71, 72, 73, 75, 76, 85, 86, 87, 88, 89, 90, 92
   HomeView.js100%0%0%12, 16
   InventoryView.js66.67%78.95%83.33%103, 108, 110, 115, 147, 56, 57, 58
   ListView.js0%0%0%100, 100, 100, 100, 100, 102, 102, 102, 103, 103, 103, 104, 106, 108, 108, 108, 109, 109, 109, 110, 112, 116, 120, 125, 126, 126, 126, 126, 126, 127, 128, 157, 160, 167, 183, 189, 193, 25, 26, 30, 31, 35, 39, 39, 39, 39, 39, 40, 42, 43, 46, 46, 46, 48, 49, 53, 57, 59, 59, 59, 62, 64, 65, 66, 68, 75, 76, 77, 79, 80, 81, 82, 83, 83, 83, 84, 85, 86, 89, 90, 91, 93, 94, 95, 97, 97, 97, 97, 97, 99
   Map.js0%0%0%101, 103, 103, 103, 104, 104, 104, 105, 107, 111, 115, 119, 120, 121, 128, 135, 136, 137, 141, 148, 156, 160, 161, 162, 169, 169, 169, 170, 173, 177, 178, 188, 190, 20, 201, 205, 205, 217, 217, 22, 28, 35, 36, 49, 50, 51, 52, 53, 54, 56, 60, 61, 63, 70, 71, 72, 74, 75, 76, 77, 78, 78, 78, 79, 80, 81, 84, 85, 86, 88, 89, 90, 92, 92, 92, 92, 92, 94, 95, 95, 95, 95, 95, 97, 97, 97, 98, 98, 98, 99
   MyReservationsView.js0%0%0%30, 31, 35, 38, 50, 51, 53, 58, 67, 67, 67, 68, 70
   Navigation.js93.33%83.33%91.30%29, 47, 63
   PantryAdminView.js100%20%45.45%28, 36, 37, 41, 43, 47
   PantryCard.js0%0%0%16, 18, 22, 23, 37, 38, 39, 40, 41, 43, 47, 47, 47, 48, 50, 51
   PantryDetailView.js12.50%10%28.57%100, 102, 103, 108, 116, 128, 130, 132, 156, 157, 167, 168, 169, 179, 194, 206, 208, 225, 34, 42, 43, 53, 54, 55, 55, 55, 56, 56, 56, 57, 59, 68, 69, 73, 75, 90, 90, 90, 91, 94, 98, 99
   ProfileView.js19.23%13.33%12.24%100, 103, 103, 103, 104, 107, 110, 118, 119, 137, 14, 155, 16, 17, 171, 18, 187, 19, 20, 203, 21, 219, 22, 23, 235, 251, 261, 275, 292, 293, 31, 33, 46, 46, 46, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 59, 60, 61, 62, 65, 67, 67, 67, 68, 71, 71, 71, 72, 75, 75, 75, 76, 79, 79, 79, 80, 83, 83, 83, 84, 87, 87, 87, 88, 91, 91, 91, 92, 95, 95, 95, 96, 99, 99, 99
src/components/Authentication
   LoginView.js87.50%100%100%31
   SignupView.js0%0%0%101, 109, 109, 109, 110, 113, 127, 145, 161, 179, 195, 211, 227, 24, 243, 253, 267, 28, 30, 43, 45, 45, 45, 46, 49, 49, 49, 51, 54, 54, 54, 56, 59, 59, 59, 61, 64, 64, 64, 66, 69, 69, 69, 70, 73, 73, 73, 74, 77, 77, 77, 78, 8, 81, 81, 81, 82, 85, 85, 85, 86, 89, 89, 89, 9, 90, 93, 93, 93, 95, 98, 99, 99, 99
src/components/modals
   AddItemModal.js100%100%100%
   OneClickReserveModal.js100%40%57.14%26, 29, 34
   ViewRsvnMsgModal.js50%50%75%40, 43

@klmui
Copy link
Member

klmui commented Apr 27, 2021

Since this PR would break functionality in the frontend, I think it's best to hold off on this until we demo. Is that alright?

@s-j-cunningham
Copy link
Collaborator Author

Yes that is definitely fine. Realistically it's not even required. If we were going to keep improving this app over a longer period it's something we would want, but if we don't want to spend FE time making changes for this that's fine by me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Inventory Add Endpoint
2 participants