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

Improving the child functionality

Open cielf opened this issue 2 years ago • 21 comments

Summary

The current child functionality only allows one item per child. It should allow multiple. Show the items attached to the child on various lists.

Why change

This is a sticking point in the use of the child requests for at least some banks/partners. For instance, you might need both diapers and baby wipes, but you can't ask for that.

Details

When entering/editing a child, you should be able to choose multiple items [for example both Baby Wipes and Kids (Size 1)]. You currently can only choose one item.

There will obviously be model changes involved in implementing this, as the item is currently saved as an integer on the child model.

The children export will need to show the multiple items

The child index and the children information in the family should show the items -- for ease of review, as children age out of diaper sizes quickly

The child request index should show all the items attached to each child, and the child request functionality will need to be adjusted to take into account the multiple items.

Adding the ability to change the items needed from the child request page would also be grand, but it can be a followup issue

Notes

@cielf says: I took a look at the production data, and there are remarkably few cases where someone has used the loop hole of entering multiple kids with the same name. Our most engaged banks don't make a lot of use of the child functionality, but to some extent they don't because it isn't good enough - and the reason mentioned most is the lack of multiple items.

Criteria for completion

  • [ ] Multiple items can be attached to a child, with all the functionality around families, children and child requests working smoothly with that.
  • [ ] Can see the items in the child request index, and the children info in the family
  • [ ] tests to support the functionality

Bonus round

  • [ ] add the ability to change the items needed from the child request page as well

cielf avatar Jul 30 '23 14:07 cielf

I would love to explore this one.

patelkrunal31 avatar Aug 23 '23 17:08 patelkrunal31

Give it a shot!

dorner avatar Aug 23 '23 18:08 dorner

An idea for you @patelkrunal31 is to make the child's name linkable on the child-request page, so that they could go make quick-edits as needed there. For you to consider :)

awwaiid avatar Aug 27 '23 15:08 awwaiid

This issue is marked as stale due to no activity within 30 days. If no further activity is detected within 7 days, it will be unassigned.

github-actions[bot] avatar Sep 27 '23 00:09 github-actions[bot]

Automatically unassigned after 7 days of inactivity.

github-actions[bot] avatar Oct 04 '23 00:10 github-actions[bot]

@cielf Can you tell me if this issue is still open for contributions?

I wonder what happened to the other 2 more experienced developers than me on the path of arriving. Will default to "they gave up" if you don't enlighten me about what happened.

From the PR made by Mr. Isidzuki, I learned that it should follow a bit of a "clumpsy-looking" feature, instead of creating a fancy keyboard-activated multi-items selection capability.

cancelei avatar Mar 30 '24 14:03 cancelei

Yes it is. I believe that pr was very close to getting merged, but they chose to abandon it.

cielf avatar Mar 30 '24 18:03 cielf

And I think we need to migrate our has-one into this has-many list of per-child item requests.

awwaiid avatar Mar 31 '24 15:03 awwaiid

@cielf I can take this one. But with your support on bringing more clarity over what is expected also known as DoD, as we talked in the last meeting.

cancelei avatar Apr 02 '24 19:04 cancelei

I'm not familiar with the DoD abbreviation, other than as "Department of Defense".

As mentioned, I can add some wireframes -- but I won't get to that until later in the week. (Edit: Possibly later)

As wrritten, this was marked Difficulty-Advanced because it requires a lot of prior familiarity with the system -- the individual bits of coding that have to be done are not so very very hard, but the issue assumed the capacity to know what to do in the context of the system.

cielf avatar Apr 03 '24 15:04 cielf

@cielf DoD is a Scrum-related abbreviation for Definition of Done. But I will work with what I have and do my best to unstruck this issue that hasn't been handled for some time. I believe my "working unit" (me and the tech mentor) can handle this issue in 2 weeks starting from the day of attribution.

In regards to the front end/wireframe, what I understood from our last meeting was something like that:

image

If you think that's a good start, I can continue to build it out and present it next Sunday to the team.

cancelei avatar Apr 04 '24 13:04 cancelei

Looks like we still have a gap in understanding... The items should be chosen on the child, the child chosen on the request (as they are now).

cielf avatar Apr 05 '24 14:04 cielf

@cielf I recorded a 2min video pitch of what I built so far. I didn't change quantity of items per child when a request is made, so they appear as 50 units. When 1 item is selected for the child, it is implicitly choosing the child already, but I can implement front end features to reflect as if it had characteristics of what pre-existed, if that is desired. All those aspects would be clearer when the wireframe arrives.

Hope you like it. 🤓 Loom

cancelei avatar Apr 05 '24 14:04 cancelei

So the edit child screen would look something like this.... Screenshot 2024-04-05 at 10 53 35 AM The view child screen would be the same except for showing multiple items. (Label will say item(s) instead of item) The child request screen would be the same except for showing multiple items. (header will say item(s) instead of item) Of course, the multiple items will have to be added into the actual request.

cielf avatar Apr 05 '24 14:04 cielf

for clarity, we are choosing the child, not the items when we are making the request.

cielf avatar Apr 05 '24 14:04 cielf

A note on your choice for the selection of many items -- The drop-down select many might not work the same across browsers, so it may end up resulting in support issues. That is what drives the version in the wireframe.

cielf avatar Apr 05 '24 15:04 cielf

What about the quantity of items? should there be a new screen before completing the request and after choosing the child for the amount per item to be inserted? Or is this not relevant for now?

cancelei avatar Apr 05 '24 15:04 cancelei

The number of items per child is actually determined by the bank -- there is a field for that on the item itself. For the most part diapers happen to be 50 -- and I believe we default to that if the bank doesn't specify. So that should be handled the same way it is now.

cielf avatar Apr 05 '24 15:04 cielf

Check how it is calculated now for the single item per child case...

cielf avatar Apr 05 '24 15:04 cielf

For clarity, this is how I see the screen under Child Request looking.

Screenshot 2024-04-05 at 11 24 22 AM

cielf avatar Apr 05 '24 15:04 cielf

(of course you have to handle each item on the child when creating the actual request -- I would hope that goes without saying g)

cielf avatar Apr 05 '24 15:04 cielf

Automatically unassigned after 7 days of inactivity.

github-actions[bot] avatar Jul 08 '24 00:07 github-actions[bot]

@elasticspoon unfortunately in prod data there are children with a item_needed_diaperid set but no corresponding Item record. I'm not sure what caused those.

awwaiid avatar Jul 14 '24 14:07 awwaiid

er -- and the release is blocked until we fix or revert, FYI

awwaiid avatar Jul 14 '24 14:07 awwaiid

Mmmm. Interesting you should probably revert and I'll fix the migration later.

It should be an easy fix but I'm not at PC for a bit.

elasticspoon avatar Jul 14 '24 14:07 elasticspoon

FYI There was only one other, very minor, bank-facing thing on the release, so we're good with holding it to next week.

cielf avatar Jul 14 '24 16:07 cielf

Also there are only like 7 children records affected now that I dug in a bit, so likely outcome after an investigation is skipping those.

diaper_dev=# select count(distinct(children.id)) from children left join items on children.item_needed_diaperid = items.id where children.item_needed_diaperid is not null and items.id is null;
 count
-------
     7

awwaiid avatar Jul 14 '24 16:07 awwaiid

That's fair. I would also like to make sure those can't reappear in the future tho. ~~So I'll add tests for the case where the child has items and either the child or item is deleted.~~

Not sure tests actually make sense because there are no controller actions to delete children or items for partners.

elasticspoon avatar Jul 14 '24 16:07 elasticspoon

FWIW, after taking a look at the child records involved, skipping them does make sense to me. They haven't been updated in over a year.

cielf avatar Jul 15 '24 06:07 cielf