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

Enhancing Seed Script with Minimum and Recommended Quantities #4500

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

grantmca
Copy link
Contributor

@grantmca grantmca commented Jul 6, 2024

Checklist:

  • I have performed a self-review of my own code,
  • I have commented my code, particularly in hard-to-understand areas,
  • I have made corresponding changes to the documentation,
  • I have added tests that prove my fix is effective or that my feature works,
  • New and existing unit tests pass locally with my changes ("bundle exec rake"),
  • Title include "WIP" if work is in progress.

Resolves #4475

Description

  • Added some logic to the seed script to populate half of the times from Pawnee Diaper Bank Org with a on_hand_minimum_quantity and a on_hand_recommended_quantity for demo and testing purposes

  • Originally was recommenced to keep the minimum between 0 and 1000 but after some testing with the existing base_item.json data there are no items that have a qty under 1000 so in order to make for a better demo of the low inventory tile on the dashboard page I went with 1500 for the minimum and 2000 for the recommended.

Type of change

Basic change of populating data for items to ensure an easier demo experience.

How Has This Been Tested?

  • Tested locally by dropping my database and re-seeding my dev environment with the updated script

Screenshots

Screenshot 2024-07-06 at 3 26 51 PM

…m Pawnee Diaper Bank Org with a on_hand_minimum_quantity and a on_hand_recommended_quantity for demo and testing purposes
Copy link
Collaborator

@cielf cielf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @grantmca -- Thanks for this! It is really nice to be able to see data in the bank low inventory section out of the gate.

Conceding the point about the minimum levels in the issue being too low, I'd still like to see some variety in the levels we have. Could you provide that, please?

@grantmca
Copy link
Contributor Author

grantmca commented Jul 9, 2024

Screenshot 2024-07-08 at 9 18 54 PM

@cielf Can do and done! It now assigns a random number based around the range of values for the tiems that are currently in inventory

@cielf
Copy link
Collaborator

cielf commented Jul 10, 2024

@grantmca I think you might not have the ranges quite right -- I'd like to see a set such that there will always be some items in the bank-wide low inventory. To check that out, I ran bin/setup and then checked the dashboard 3 times, and each time there was nothing in the bank-wide low inventory.

…l quantity and for each one assign a random minimum and recommended value based off the max and min values in the total quantity
@grantmca grantmca force-pushed the 4475-add-min-recomended-to-seed branch from 154674b to 381c7b8 Compare July 10, 2024 23:03
@grantmca
Copy link
Contributor Author

grantmca commented Jul 10, 2024

@grantmca I think you might not have the ranges quite right -- I'd like to see a set such that there will always be some items in the bank-wide low inventory. To check that out, I ran bin/setup and then checked the dashboard 3 times, and each time there was nothing in the bank-wide low inventory.

Sorry about that, I was just testing it by running the seed.rb file so I missed an error since I already had some data in my DB. I just fixed it and tested it locally using bin/setup sorry about that! @cielf

@cielf
Copy link
Collaborator

cielf commented Jul 11, 2024

@grantmca All good now! Thank you!

@cielf cielf merged commit a774ce0 into rubyforgood:main Jul 11, 2024
19 checks passed
Copy link
Contributor

@grantmca: Your PR Enhancing Seed Script with Minimum and Recommended Quantities is part of today's Human Essentials production release: 2024.07.21.
Thank you very much for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add some reasonable minimum and recommended inventory levels to items in the seed
2 participants