human-essentials icon indicating copy to clipboard operation
human-essentials copied to clipboard

Allow a hard limit on number of specific items per request

Open embarnard opened this issue 3 months ago • 0 comments

Resolves #5269

Description

  • Adds request_limit to ItemUnit and unit_request_limit to Item fields to models
  • Adds these request limit options for units in the bank's item edit page including for custom units
  • Request limit form fields will be disabled if the unit is disabled
  • Adds validation to the partners/request page if amount requested is higher than the request limit and will display flash error: "[Item name]: You requested [amount requested] [units if applicable], but are limited to [request limit] [units if applicable].
  • Removed ambiguous error message on partners/request page
  • Removed some duplicate error messages for the same thing on the partner/request page so it wouldn't much up the flash message

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • unit tests for adding an item with request units and request limits
  • feature tests that test what displays in the error message on the request page if request quantity exceeds the limit

Screenshots

items/:id/edit page Screenshot 2025-09-13 at 11 18 36 AM

/partners/requests page Screenshot 2025-09-13 at 11 10 55 AM

removed this error message from /partners/requests page Screenshot 2025-09-13 at 10 27 44 AM

embarnard avatar Sep 12 '25 19:09 embarnard