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

Validation for empty Meal data #28

Open
cgalo opened this issue Mar 1, 2022 · 0 comments
Open

Validation for empty Meal data #28

cgalo opened this issue Mar 1, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@cgalo
Copy link
Member

cgalo commented Mar 1, 2022

Overview

Currently we can submit the Meal screen, without any FoodItem, nor carbs, nor meal name. The request is still getting to Firebase, even tho we are basically passing empty values of a Meal to our Firestore.

Objective

  1. Add validation in the Meal screen, that when we click Register Meal, that we actually have data to send to our backend
  2. Adjust Firebase security to deny meal requests that are missing required fields, such as:
    • Meal name
    • At least 1 FoodItem object in the foodItems field
    • Total Carbs
    • Total servings
    • Date created
    • Meal Type
    • Total times eaten

Note: For the Firebase security things we need this PR to be merged

Testing

  • Tests will be added inside the __tests__/firebase/meals.test.ts to cover for the firebase security rules
  • For now we will not make a UI test to check validation of the Meal screen
@cgalo cgalo added the enhancement New feature or request label Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant