ida-arbeitszeit / arbeitszeitapp

A webapp for labour-time calculation.
https://arbeitszeitapp.readthedocs.io
GNU Affero General Public License v3.0
35 stars 4 forks source link

RFC: Change productive consumption user flow #1053

Open sloschert opened 2 months ago

sloschert commented 2 months ago

I propose to change our productive consumption user flow, please let me know what you think about this.

Current user flow

For registering of productive consumption we currently have one route, where companies are registering productive consumption: company/register_productive_consumption. This route accepts GET and POST requests. The POST request requires three inputs: plan_id, amount and type_of_consumption. Companies have to make sure to specify the correct plan_id, because at no point of this flow the plan name or the "price" of the product is shown, which is error prone.

Proposed user flow

I propose to split the process of registering productive consumption into two stages:

STAGE 1: Selection of plan


In this stage, the company specifies the plan_id of the product that it wants to consume.

We can have different implementations of this stage. For example, the selection of the plan_id might be carried out by scanning a plan-specific QR-Code, by clicking a link somewhere in our web app or by manually entering the plan_id in a form. For now, I propose to add a new route, that lets the company specify the plan_id (see below for details).

If the selected plan is eligible, the company gets directed to stage two.

STAGE 2: Selection of amount and type of consumption

The user gets provided with information on the previously selected plan/product. This information might be the "price" of the product, name and description, and potentially many more.

The company then specifies amount and type_of_consumption and actually registers the consumption.

Technical implementation:

STAGE 1

GET:

POST:

STAGE 2

GET:

POST:

4lm commented 1 month ago

Thank you for this detailed RFC issue. I appreciate the idea of improving the productive consumption user flow.

I believe Stage 1 should pivot a little bit and could introduce a plan filter list view that displays all available plans from various companies and allows users to filter (search) for the correct plan. This way, users wouldn’t need to know the plan id beforehand, which is currently a cumbersome part of the productive consumption user flow. Additionally, Stage 1 wouldn't require any redirect flow to /company/register_productive_consumption; using simple links is in my opinion more native to the web and, therefore, the better choice. Here’s a structured breakdown of my suggestion:

STAGE 1: Plan Filter List View

STAGE 2

Implementing these suggestions would further improve the productive consumption user flow and help users make informed decisions when selecting plans for consumption. It would also instantly enable the creation of other methods of selection, mentioned in the RFC.), without changing a line of code in /company/register_productive_consumption.

What do you think?

If these concepts are too numerous or not clearly explained, I am available for assistance and would by happy to further discuss and help to implement these concepts during the development process of the concerning PR.

seppeljordan commented 1 month ago

I prefer @sloschert approach as it is much more focused on the problem that he outlined in the OP of this thread. I disagree though with the choice to have the amount selection and the kind of consumption selection in phase 2 and would prefer it if phase 2 was a simple confirmation step. Generating a pre-filled form (for example via a QR code) could "easily" be done via query parameters when rendering the form from phase 1.

4lm commented 1 month ago

I prefer @sloschert approach as it is much more focused on the problem that he outlined in the OP of this thread. [...] Generating a pre-filled form (for example via a QR code) could "easily" be done via query parameters when rendering the form from phase 1.

Maybe my suggestion tried to pack too much in there at once and therefore my actual point did not come across, sorry for that. Because what you propose essentially aligns with what I suggest we should do. Let me explain. QR codes can contain links as data that can be scanned and by this enable the user to browse to a page via a GET request, similar to how clicking a link on a page directs to another page (which is basically the same thing and just has a different user interface). @sloschert also discusses using links with various examples in the original post but then shifts in his implementation steps to a POST redirect workflow. This involves redirecting to another page to fill out another form, perform another POST, and then process and save data. This approach is unconventional. Normally, you wouldn’t use POST redirects just to fill out another form on a different page. Instead, you’d use links with parameters to autofill the form on the target page (in our case: /company/register_productive_consumption).

Therefore, my suggestion is to stick with the initial idea (of the given examples) in the original post and use links with parameters (stage 1) to fill a form on a POST page (stage 2). These links should at minimum carry the plan_id, and optionally amount (preferably) and type_of_consumption. This links are then used to pre-fill the form on the target page. My other suggestion was, to somehow improve the search- and select-ability of plans in stage 1. Which I think should be a filterable, paginated list of all available plans. But I'm OK with taking a more minimal approach implement the first iteration of such a (list, search and) select page.

sloschert commented 1 month ago

As discussed, we will keep it simple for now and implement the following steps:

Amittai-Aviram commented 1 month ago

FWIW, I think both Sebas's OP and Alexis's suggestions have a lot of value. The user may already know the plan ID, but is likely not to know, at least on the first "order" (transfer), and I think the number of hours that the consumable product is worth is also likely to be unknown to the user — and may also change, right? So a UI that facilitates searching and browsing makes sense to me. But I am worried that a logic of presenting all plans and then offering the user filters is not very scalable. Surely, the initial results should be pre-filtered and only show active plans, for instance. Also, shouldn't the initial query, and therefore both the GET and the POST requests, specify the type of product the user (company) needs to consume? Are there other ways of pre-filtering to ensure that the initial view is scalable, both technically and from a UX perspective?

The proposal also raises further questions for me. Is a scenario possible in which the list of plans to produce a given commodity includes two different plans from different companies to produce the same (or roughly the same) commodity, but where hours worked per product (the "price") differs substantially? This puts the user in the position of "shopping for a bargain." Presumably, producers of the same or similar products would belong to the same cooperation, which would set a rational rate of hours per product (based on the average of actual experiences), but there is nothing to compel a company to join a cooperation. Or should the response page in Stage 1 actually be organized by cooperations that offer the desired commodity — a list of cooperations, with the plans under each cooperation?

In the real world, I would expect an employee of company A to need product X either as machinery or a raw material. So he/she goes online to look for a source of product X, both to look up how many hours would need to be transferred from company A to that producer (for internal planning) and to arrange to exchange the hours for the product. So I would expect the app's workflow to follow that logic. That's where Alexis's suggestions make sense to me. Am I missing something?

sloschert commented 4 weeks ago

Adding this flow chart by @4lm after talking about this issue on our last dev meeting. productive_consumption