msupply-foundation / open-msupply

Open mSupply represents our most recent advancement in the Logistics Management Information System (LMIS), expanding on more than two decades of development inherited from the well-established legacy of the original mSupply.
https://msupply.foundation/open-msupply/
Other
20 stars 12 forks source link

GAPS: Specify item variants that should be bundled with other item variants #3923

Open mark-prins opened 4 months ago

mark-prins commented 4 months ago

Part of epic #3662

Acceptance criteria

Describe the solution you'd like 🎁

On central server, add another tab to the item detail page. This lists all items which should be bundled with the current item. Have the options to

If possible, build this as a front end plugin - and store the data in the plugin_data table as JSON. this can be the serialised list of structs which have

struct BundledItem {
  item_link_id: String,
  quantity: i32
}

which can then be stored in plugin_data against a particular item.id as the related_record_id

Additional context 💌

User story B.2.9
As a… National EPI manager
I want… to specify that each type of vaccine should be 'bundled' with diluents and / or syringes in certain ratios
So that… any additional cold storage requirements can be taken into account if the diluents need to be stored cold too (and any additional dry storage requirements for syringes can be known too)

Solution B.2.9

The system will allow central users to specify ‘Bundling’ rates for vaccines in the Master Data product catalogue. An unlimited number of other products from the Master Data product catalogue may be ‘bundled’ with vaccines. For each ‘bundled’ product the central user will specify the ratio in which they are bundled. The default ratio will be 1:1

Moneyworks Jobcode 🧰

CCEIDEV

adamdewey commented 4 months ago

So here the quantity should be a ratio, which could be < or > than 1:1

Example 1

1 vial of Vaccine B should be bundled with 10 units of Syringe 1 - Ratio: 1:10 (assuming base units of each are vial and unit respectively)

Example 2

1 vial of Vaccine B should be bundled with 0.5 bottles of Diluent 1 - Ratio = 2:1 (assuming base units of each are vial and bottle respectively)

The idea being that these ratios could be used for:

mark-prins commented 4 months ago

Yes, I was thinking to have a decimal value, so you would enter 10 for the first example and 0.5 in the second.

Do you think entering as a ratio would be easier to understand though? Me, I'm mentally converting the ratio to a fraction / decimal.. so I find it easier to enter it as numbers, like you have in the initial part of the example:

Vaccine B Bundled with Item Quantity Unit
Syringe 1 10 Unit
Diluent 1 0.5 Bottle

would you rather something like this?

Vaccine B Bundled with Item Ratio Unit
Syringe 1 1:10 Unit
Diluent 1 2:1 Bottle
adamdewey commented 4 months ago

Ah, no I think your decimal idea is clearer!

Just as long as they know they can enter decimals :)

jmbrunskill commented 3 months ago

@mark-prins is this one ready to go? Or more design needed?

mark-prins commented 3 months ago

I think it's ready to go - should be enough detail in here to begin.

adamdewey commented 2 months ago

I'm looking through the WHO PQS vaccines list and the bundling actually needs to occur at the item variant level..

See example:

image

So we would need to bundle item variants to item variants.

mark-prins commented 2 days ago

Refinement: we'll leave up to the implementing team to refine further and report back to the refinement team if there are decisions to confirm