Skip to content

Instantly share code, notes, and snippets.

@thecodecafe
Created October 4, 2021 13:18
Show Gist options
  • Save thecodecafe/412c17d8043abeee1e40f433771f6a8c to your computer and use it in GitHub Desktop.
Save thecodecafe/412c17d8043abeee1e40f433771f6a8c to your computer and use it in GitHub Desktop.

Inventory Manager

Bluemoon Solutions is a software company tasked with working on an inventory management system, this system allows the users to list, add, edit, and delete inventory items. Your task is to create a react native app that utilises the async storage to store, update, retrieve, and delete data.

Notes

  • Design is not a requirement but can give extra points.
  • Use React Navigation 5 for the navigation.
  • Initialise a fresh react native project setup for Typescript.
  • Use the Async Sotrage as a data store for the items.

Screen Specifications

1. Inventory Listing

Create a screen that shows the list of items, this should show each item's name, price, and total stock, this will be the home screen displayed when the user launches the app. This should also have a button for adding more items.

2. Create Inventory

Create a screen that shows a form that allows users create new items and add them to the inventory, a user should be able to enter the item's name, total stock, price, and description. All fields should be validated to meet the following.

  • Name is required, and must be unique.
  • Total stock is required and must be a number.
  • Price is required and must be a number.
  • Description is required and must have at least three words.

3. Edit Inventory

Create a screen that shows a form that allows users edit an existing item in the inventory, a user should be able to edit the item's name, total stock, price, and description. All fields should be validated to meet the following.

  • Name is required and must be unique.
  • Total stock is required and must be a number.
  • Price is required and must be a number.
  • Description is required and must have at least three words.

4. Delete Inventory

On the edit screen show a button beneath the form that allows users delete the currently viewed item from their inventory, ensure the user confirms the action, before they continue.

Test Specifications

  1. Write tests to create snapshots of each screen.
  2. Write tests that ensure the confirmation pop up is shown when trying to delete an existing items.
  3. Write tests to ensure users are taken to the edit screen after tapping on an existing item in the inventory list.
  4. Write CRUD tests for your async storage operations to ensure Create, Update, Delete, and Get are all called accordingly.

Submission

Submit your work with a link to the project on Github.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment