Skip to content

[BUG]: Disallow Saving Purchase with a Quantity of 0 #5507

@janeewheatley

Description

@janeewheatley

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Users should not be able to save a purchase that is empty.
We checked production to make sure that our users were not currently doing this to preserve comments and they are not. See slack conversation here.

Expected Behavior

  • User should not be able to save a New Purchase with 0 quantity
  • User should still be able to save a purchase with greater than 0 quantity

Steps To Reproduce

Steps to Reproduce:

  1. Click on Purchases in side bar
  2. Click on New Purchase
  3. Fill out the new purchase form and either leave out the quantity or explicitly enter a 0 quantity.
  4. Notice that the purchase can be saved

Environment

Criteria for Completion

  • User should not be able to save a New Purchase with 0 quantity
  • Error should show up in the red banner that calls out that this purchase cannot be saved. An additional comment should say "Quantity must be greater than 0". See current implementation of red banner:
  • User should still be able to save a purchase with greater than 0 quantity
Image

Anything else?

No response

Code of Conduct

  • I've read the Code of Conduct and understand my responsibilities as a member of the Ruby for Good community

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions