C19-BayShield / bayshield

App - This is a clone of the app from my private repository
3 stars 0 forks source link

Implement inventory backend #65

Closed emily-zhu closed 4 years ago

emily-zhu commented 4 years ago

TIPS FOR TESTING THIS PART: Most Collection Hub accounts won't have any inventory, which means that there are no inventory fields in Firebase for that user either. This makes it difficult to test since nothing displays in the inventory page, so first you can first add to inventory from the Incoming Orders page (press add button). After the first write, all inventory fields will be populated in Firebase. From there, you can manipulate values in Firebase to display more items.

Overview: Implement inventory backend; includes 'add to inventory' feature (orders page) + inventory tab (profile page)

Screenshots:

Screen Shot 2020-06-23 at 8 25 39 PM Screen Shot 2020-06-23 at 8 26 08 PM Screen Shot 2020-06-23 at 8 28 02 PM Screen Shot 2020-06-23 at 8 32 34 PM

Edited screens: hub_screen.dart: connect Add To Inventory feature on orders page (incoming) to backend, connect inventory tab to backend **NOTE: a to-do is to delete incoming orders cards after done adding to inventory, but since orders back-end isn't done, the card will just remain

Edited files: state_widget.dart: added InventoryPage widget

Edited util: firestore_users.dart: added more API to connect inventory edits to firebase

Edited data model: user.dart: added CollectionHub class and related methods