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

[PACKS] #8 New / Edit Distribution for the banks shows custom request units, if applicable #4403

Closed
2 tasks
cielf opened this issue May 30, 2024 · 2 comments · Fixed by #4586
Closed
2 tasks

Comments

@cielf
Copy link
Collaborator

cielf commented May 30, 2024

Summary

Add custom request units to new distribution.

Why

This is step #8 of adding the ability to specify "packs" versus "individual" for requests

Details

If the distribution is from a request, add a"Requested" column beside the current item fields

The # of requested items and the requested units will be shown beside the corresponding item in the distribution entry.

If the request is using a custom request unit (not the default units), the quantity for the distribution of the item will not be initially filled in. The purpose of this is to reduce the likelihood of errors of the "leaving the number that was there because we fulfilled what they wanted" type. If the item doesn't have custom request units, or the item request uses the default units, the quantity for the distribution will be filled in.

Visual Aid

Image

Identified rules

In all cases:

May put 0 as a quantity
Saving with blank quantities will give an error
May remove any item
May add more items. This functionality will work as it does currently, except for the 0/blank behavior as noted above

On new or edit, not-from-request:

Do not show the requested column

On new, from request

Show the requested column, including units if any
Quantities for items requested with custom units are initially blanks
Quantities from items requested without a custom unit are initialized to the amount requested
Items that were NOT from the request show "n/a" in the requested column

On edit, from request

Quantities for items requested, that are not included in the current distribution, are initialized to 0.
Show the requested column, including units if any. (even for the items that are not included in the current distribution)
Item selection for requested items is frozen (i.e. only display the item name)
Item selection for not-requested items is not frozen (should be like the current distribution, barcodes and all)
may remove

N.B.

All of the changes for PACKS must be implemented behind a flipper flag "enable_packs"
1/ Flipper works by enabling or disabling a tag (for the PACKS issues, that is enable_packs)
2/ Here is a code snippet illustrating how to use it in your code, with enable_packs as the example tag:
if Flipper.enabled?(:enable_packs)
// do the thing we are guarding with the tag
end
3/ How to check out if it works manually (with the example tag: enable_packs ):
You have to enable the flipper tag on your localhost (note - the tag is stored in your db, so if you reset your db you have to do it again)

localhost:3000/flipper

userid: admin
password: password
Sign In

Click: Add feature
enable_packs
Click: Add feature

Click: Fully enable

To set it back (to check that your nifty changes haven’t broken anything when the flag is off)
Sign in as above:
click on “enable_packs”
click “Delete”
type enable_packs in the “Are you sure” dialog and click ok

Criteria for completion

  • functionality as described above
  • tests that support the functionality as described above

Background

The following sections have been identified as required for the PACKS implementation. These should be implemented in numerical order.

Image

@cielf cielf added the Ruby for Good 2024 DC Issues for RFG 2024 DC label May 30, 2024
@awwaiid awwaiid added this to the Packs milestone May 31, 2024
@cielf cielf added Help Wanted Groomed + open to all! Difficulty—Advanced and removed Ruby for Good 2024 DC Issues for RFG 2024 DC labels Jul 7, 2024
@dorner dorner self-assigned this Jul 26, 2024
@github-actions github-actions bot removed the Help Wanted Groomed + open to all! label Jul 26, 2024
@dorner
Copy link
Collaborator

dorner commented Jul 26, 2024

@cielf two questions:

Item selection for requested items is frozen (i.e. only display the item name)

This is only in the "edit" section - but this should be true for "new" as well, no? They can always remove the item if they don't want to fulfill it.

If the item doesn't have custom request units, or the item request uses the default units

To clarify - we removed the concept of a "default unit", correct? So if the item has any unit that isn't blank, we should follow the logic (e.g. blank out the quantity) - correct?

@cielf
Copy link
Collaborator Author

cielf commented Jul 27, 2024

1/ That sounds right.
2/ If they pick "units" (instead of any custom unit) when requesting, we don't save the unit, right? If that's the case, then if the item request (not the item, per se) has any unit that isn't blank, we should blank out the quantity.

@awwaiid awwaiid linked a pull request Aug 25, 2024 that will close this issue
awwaiid added a commit that referenced this issue Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants