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

Resolves #4686 add another bank to seed #4826

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

Benjamin-Couey
Copy link
Contributor

Resolves #4685

Description

This PR modifies the db/seeds.rb file to add another diaper bank with a partner and other associated records. CONTRIBUTING.md was also updated to include the login information for the new diaper bank and partner.

In total, the following records were added to the seed:

  • The new Organization Second City Essentials Bank
  • Four items unique to the new bank, each based on a random BaseItem, named "Second City Item 1"
  • New Users for the new bank, "[email protected]" and "[email protected]"
  • 20 Donations and Distributions for the new bank
  • 25 Purchases for the new bank
  • DonationSites for the new bank, based on the city and state of the bank.
  • Two StorageLocations for the new bank.
  • Request Units, ProductDrives, ProductDriveParticipants, Manufacturers, and 'Vendor's for the new bank.
  • The new Partner "Second City Senior Center"
  • Several Requests made by the new partner to the new bank (this was handled by exiting Partner seeding code).

The seed uses both hand-written values and the Faker library to populate addresses, emails, etc. When creating entirely new records, I favored Faker for the sake of better looking demos but didn't update existing hand-written values.

For most of the records associated with an Organization, the seed only created records for the Pawnee Diaper Bank. I updated these sections to only create records for the new bank and not the existing SF Diaper Bank as they was not requested by the issue. I tried to modify the code so that it would be easy to define a list of banks for which these records should be created.

Type of change

  • New feature
  • Documentation update

How Has This Been Tested?

As far as I could tell, there were no automated tests associated with the seed and so relied on manual verification. I verified that rake db:reset runs without issues with the modified seed and manually verified that the database contained the new records associated with the new bank.

I created a unit test for a utility function added to Organization.

Benjamin-Couey and others added 19 commits November 22, 2024 09:19
…all orgs, removed redundant Product Drives section
…storage locations are selected to accommodate there being storage locations for multiple orgs
@cielf
Copy link
Collaborator

cielf commented Dec 3, 2024

Hey @Benjamin-Couey - I'm liking what I'm seeing from a functional pov. With the second city items, I have one question, though.

Are we guaranteed to have at least one each of donation, purchase, distribution, and request among those 4 items?

My concern is false positives when we are using them for manual testing -- that, with these extra items, we would rely on there being instances with them, and if there aren't, we might assume that everything is fine.

@cielf cielf requested a review from dorner December 3, 2024 17:58
@Benjamin-Couey
Copy link
Contributor Author

@cielf There is currently no guarantee that the second city items will be used for the donations, purchases, distributions, and requests.

I can work on explicitly adding examples of those records using the second city items.

@cielf
Copy link
Collaborator

cielf commented Dec 3, 2024

(Nods) Yes please.
I haven't checked, but could you also make sure at least one of them has an inventory level that is less than its recommended quantity?

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 another fully set up bank to the seed.
2 participants