ecamp / ecamp3

eCamp v3 is a web-based app for camp and course planning. The application is specialized for camps and courses of youth associations and for Y+S offers in the sport of camp sports/trekking.
https://ecamp3.ch
GNU Affero General Public License v3.0
111 stars 49 forks source link

Reusable material #4280

Open loelismurf opened 9 months ago

loelismurf commented 9 months ago

Ziel: Das selbe Material das an mehreren Tagen verwendet wird nur 1 mal angezeigt wird.

Vorschlag der Umsetzung Die aktuelle Materialliste mit der Option Share erweitern die Standartmässig gesetzt ist. Share = heisst das Material darf/kann an anderen Blöcken verwendet werden. Das gibt die Option Material das zum Beispiel Verbaut ist das Flag Share zu entfernen und dieses Exklusiv zu nenne (Alternative Option Exklusiv einfügen)

Danach wird auf der Materialliste die Artikel zusammen gefasst. (case non sensitiv und ignored space) Menge Einheit Artikel Materialliste Aktivität / Abschnitt
1 Stück Artikel1 Liste Aktivität 1
1 Stück Artikel1 Liste Aktivität 2
1 Bund Artikel1 Liste Aktivität 3
Wird zu Menge Einheit Artikel Materialliste Aktivität / Abschnitt
1 Stück Artikel1 Liste Aktivität 1
Aktivität 2
1 Bund Artikel1 Liste Aktivität 3

auto translated Target: The same material that is used on several days is only displayed once.

Proposal for implementation Extend the current material list with the Share option, which is set by default. Share = means the material may/can be used on other blocks. This gives the option to remove the Share flag from material that is installed, for example, and to name it Exclusive (alternative option Insert Exclusive).

The items are then summarized on the material list. (case non sensitive and ignored space)

carlobeltrame commented 9 months ago

Thanks for reporting this in an issue! Reusing materials is a very complicated topic. Let me present you some scenarios which we commonly use to illustrate the various dilemmas.

Scenario 1: Partial material reusability

Suppose there are three activities, each of which require 1kg of sugar. In the first activity, the sugar might be used up to bake some cookies. In the second activity, part of the sugar might be used to lay down a track which the kids have to follow, and another part of the sugar is the treasure which they find at the end of the treasure hunt. The third activity needs a full kg of sugar for some reason. How much sugar do we need to bring to the camp?

Scenario 2: Parallel material usage

Suppose a camp where two groups (e.g. Wölfli and Pfadis) have some programme together, and sometimes they have parallel programme. Now suppose two parallel activities both need 10 Blachen. Both activities mark their Blachen as reusable in the material list for other activities, as is normally the case with Blachen. How many Blachen should we bring to the camp? What if the two parallel activities only overlap partially? What if they happen one after the other instead of in parallel, but in the first activity a temporary tent is built which isn't immediately torn down and returned to the camp after the first activity?

Scenario 3: Unpredictable reusability

In a course, we divide the participants into groups using smarties or other colored sweets. Later in the same course, we need some smarties again. Will the smarties have been eaten in the meantime, or will enough of them return to the material room? What about if it isn't a course but a camp instead? How would eCamp (or even you as camp leader) know in advance how many of the smarties are reusable?

Scenario 4: Material transformation

In one activity, an old rope is cut into pieces (e.g. a bad guy breaks free from his shackles). In a later activity, the pieces of the rope are used to create lanyards (Schlüsselbänder). How would eCamp offer the user to re-use the rope pieces which aren't on the material list of the earlier activity?

Scenario 5: Spelling issues

The material item name is currently free text, so there might be multiple spellings for the same thing or the same spelling for different things. Here are some real examples of material items from eCamp v2. Assuming all of these appear in the same camp, try to determine from their names alone which ones you would combine and which of them should be brought separately:

"Seil", "Statikseil", "Seil & Schnurr", "Polypropylenseil", "Strike" (meaning "Stricke"), "Material für Seilbahn", "längere Seile (nicht seilbahnmat.)", "Tau", "Manipulier seile", "Fanfseil" (meaning "Hanfseil")

Also consider that the unit of the material is free text, so 1kg might be written as "1kg", "1KG", "1000g", "800+200g", "1 Kilo", "1 Pack" and many more, including variations for languages other than German. It is impossible for eCamp to deduce the real-world amounts and sum them up.

How to tackle this problem?

So as you can see, there is a lot of complexity here. We would like to implement reusable material items in eCamp v3, but we also want the solution to be well thought-out, easy to understand for users, future-proof and extensible. To acheive this we see a few options:

Approach Solves scenarios Remarks
1: Sort material lists alphabetically by default, leaving the task of combining material items to the users none
2a: Make material items manually markable as reusable. Write some kind of auto-detection algorithm (e.g. with case insensitivity and ignoring spaces) none this solution was proposed in this issue's description
2b: Make material items manually markable as reusable. Offer the reusable material items when adding material to other activities in the same period, so they can be manually "accepted" (via a kind of search or autocomplete) 5 search would have to be a fuzzy search or semantic search using domain-specific knowledge (or trained on a domain-specific dataset)
2c: Without adding any "reusable" flag, offer any material items when adding material to other activities in the same period, so they can be manually "accepted" (via a kind of search or autocomplete) 5 like approach 2b, but without the "reusable" flag, simply widening the search space
3: Use an LLM to parse the amounts from multiple activities and sum them 5 calculations may be non-deterministic and inaccurate, LLMs might have problems with Swiss German slang and scouting-specific terms
4: Add another optional field to material items, where you can specify how much of each material item is left over after the activity 1 scenario 5 gets worse, because there is one more place where users have to type amounts correctly and consistently
5: Add a booking system, where activities can "book" material items (like booking rooms or resources in Google Calendar) which are gathered in a period-global material list, optionally specifying a different time frame than the schedule entry. Additionally, allow material items in the period list to specify an earliest date and time when they are available, to e.g. handle items which are bought in a shop during the camp 2 Bonus: We could generate shopping lists based on this data
6: Add a "produced material" or "outputs" list to each activity, where users can specify which materials are newly available after this activity 1, 4 could also be used for shopping lists, treasure hunts (e.g. in the story we find the magic amulet and can use it from then on), etc.

Other options and ideas are welcome... We might have to combine multiple of the above approaches to create a truly useful material reuse feature.

We aren't even sure that the above scenarios account for most or all of the complexity, or whether there is even more hidden complexity to be found. Given this amount of uncertainity and things to discuss, I would expect this feature to be implemented some time after the course features.

bb1950328 commented 4 months ago

My idea 1

Example

LA 01.1

Amount Unit List Material
5 Stk J+S Statikseil
2 kg Coop Zucker

LA 01.2

Amount Unit List Material
2 Stk J+S Statikseil
1 Stk Coop Apfel

LS 02.1

Amount Unit List Material
6 Stk J+S Statikseil
2 Stk Coop Apfel

List J+S

Max Amount Actual Amount Unit Reusable Material
100 7 Stk yes Statikseil

List Coop

Max Amount Actual Amount Unit Reusable Material
2 kg no Zucker
3 Stk no Apfel
bb1950328 commented 4 months ago

My idea 2

Similar to idea 1, but there's no boolean reusable attribute. Instead, each material usage in an activity has two attributes "Bezug" and "Rückgabe". I'm not sure how to translate them to english, probably "take" and "give" or "take" and "return". For non-reusable items the return is usually 0, but for scenarios like using sugar as the trophy of a treasure hunt it would be equal to the take amount. This approach would also cover a scenario where at the beginning of a camp you have an activity to build a tent and at the end of the camp you have an activity to disassemble it.