coopcycle-web icon indicating copy to clipboard operation
coopcycle-web copied to clipboard

Improve UX for exports: one single export with all relevant information

Open AdrienSICKLO opened this issue 3 years ago • 1 comments

  • [ ] @Titooo94 Provide an example spreadsheet of what is expected

Right now, there are 2 places in which you can export information from the platform:

Export of tasks from the dashboard

  • Task number
  • Type
  • Address Name
  • Address
  • GPS Coordinates
  • Address description
  • After
  • Before
  • Status
  • Comments
  • Eventdone notes
  • Eventfailed notes
  • Finished at
  • Courier
  • Tag
  • Address contact name
  • Organisation

Export of deliveries

  • Organisation
  • Pick up address
  • Pick up after
  • Drop Off Address
  • Drop off before
  • Weight
  • Distance
  • Order Number
  • Order total
  • Packages

It looks like it is also missing an alias to identify deliveries.

Having all important information in one single export would be very helpful

AdrienSICKLO avatar Jan 19 '22 17:01 AdrienSICKLO

Maybe this issus and the "Introducing Import/Export of multipoint deliveries #3046" are connected. If you are able to link two task (dropoff and deliveries with the number linked (#4545 and #4546))- or one dropoff and multiple task with the number linked- of an export and make them belong to a store. Then there no "Task" and "Deliveries", there is task within a deliveries, and then you do just ONE export files.

livraison-stains avatar Jan 21 '22 15:01 livraison-stains

Generally speaking, it would be smart to move this extract to Cube. This way, we can benefit from Cube's caching capabilities, and also it's almost already available via the API.

alexsegura avatar Mar 02 '23 08:03 alexsegura

image Here we can see two issues that should be resolved in this improvement

  1. that order codes that use the letter E are understood in excel as a representation of thousands, which makes data cleaning, ordering, and cleaning impossible
  2. the date / time format is inoperable

Possible solutions: 1.A: do something about excel formats that I don´t know how to do so that it understands all orders as text 1.A: Disallow the letter E from order codes 2.A: have a date column with standarized format and no time (DD/MM/YYYY) (if it is this way, than its not month "6" its month "06" and another column with hour done the same way (HH:MM:SS or HH:MM) 2.B: something else about excel formats that I don´t know how to do

Paul-Eraman-CoopCycle avatar Mar 17 '23 11:03 Paul-Eraman-CoopCycle

Hey, so I have reviewed the deployed feature. There are a few issues.

  1. We have at minimum, every pickup and dropoff duplicated, and sometimes in triplicate

Image

  1. It appears there are no comments being registered, since I know that riders have been making comments for all the pickup orders

Image

  1. At the end there are a number of tasks with no "ordernumber" or order ID code (not sure about vocabulary, its the 2nd and 3rd columns) and strangely, in this orders there are two comments.

Image

photos attached. I will move the issue out of "done" in projects given these issues

Lastly, there was some confusion on the subject but I thought it was addressed. It is vital that we have the dynamic price for a store delivery, and the price for the cooperative for food delivery orders as well. Specifically, it should include the following: Stores: Total price charged to the store; names of pricing rules or products that have created this price Restaurants: Total cart amount, total paid, total for coopcycle cooperative (all with IVAs)

otherwise, this cannot be used for economic control as we talked about. That said, maybe we can turn this into 2 issues, 1 about implementing all relevant nonprice information, and another issue about adding all relevant pricing issue, given that the pricing is related to the separate issue about multi-dropoff and multi-pickup orders and dynamic pricing

Paul-Eraman-CoopCycle avatar Apr 16 '23 18:04 Paul-Eraman-CoopCycle

Sorry, I need to edit point 2

It does have the correct comments in event.DONE.notes, but i couldn't see them because the "comments" column had been made 25 cm wide due to a formatting issue and I thought the excel was empty from there to the right. Once I resized the column, all good. Can we change the way the export is formatted so that this doesn't happen somehow?

Image

Paul-Eraman-CoopCycle avatar Apr 16 '23 18:04 Paul-Eraman-CoopCycle

Working on reported bugs

lucasferraro avatar Apr 24 '23 15:04 lucasferraro

Still getting repeating tasks ☹

Image

Paul-Eraman-CoopCycle avatar May 24 '23 09:05 Paul-Eraman-CoopCycle

For an unknown reason, a missing Content-Type header was causing empty files, only in production

Should be fixed in df74398e21659e288ff717638dcd1bde5b23a2c9

alexsegura avatar Jun 20 '23 13:06 alexsegura

Actually, the problem persists in production. Cube server only returns results on the 2nd HTTP call 🤔

alexsegura avatar Jul 05 '23 09:07 alexsegura

Found the problem. In production, sometimes the Cube server responds with "Continue wait":

< HTTP/1.1 200 OK

<
* Connection #0 to host cubejs.coopcycle.org left intact
{"error":"Continue wait","stage":{"stage":"Executing query","timeElapsed":4985}}

A solution is to implement a retry mechanism inside the CubeJs HTTP client.

alexsegura avatar Jul 05 '23 12:07 alexsegura

Here says that we can adjust a config called continueWaitTimeout in order to change the time Cube waits before returning Continue wait message.

Also, could be helpful check logs and see how long it took for Postgres to execute the query. Seems like we could significantly speed the query up by adding a pre-aggregation layer in Cube. More info here

lucasferraro avatar Jul 05 '23 13:07 lucasferraro

@lucasferraro yep, pre-aggregation should definitely be setup. For the moment, I'm just implementing a retry mechanism to hotfix the issue.

alexsegura avatar Jul 05 '23 13:07 alexsegura

Retry strategy implemented in a66fdb31c38cf1f92a66bb2ca37c9bf52c72b58f

alexsegura avatar Jul 05 '23 15:07 alexsegura

Test version currently has a column that has income for the coop IVA incluido if a store task (flowers) and total cart value if a platform shop order

We need a column that shows the cooperatives final income for each delivery. So price of the store task if a store task, OR the commission of a platform order minus stripe fees if a platform shop order

Remember, the point here is to have one column with the real life actually income of the cooperative for calculating income vs costs

Paul-Eraman-CoopCycle avatar Oct 03 '23 22:10 Paul-Eraman-CoopCycle

🥳

Paul-Eraman-CoopCycle avatar Oct 05 '23 15:10 Paul-Eraman-CoopCycle