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

Rethink order codes to reduce chance of similar codes

Open Paul-Eraman-CoopCycle opened this issue 1 year ago • 4 comments

With high volume we get confusing codes. For some reason, there is a significant amount of chronology in the way the codes are created.

I would propose that instead of the 1st two digits almost being 100% chronological, randomizing all 4 letter/digits and removing letters that often can be confusing. these would include the letters i, L, e, o, v or u, q, p or f, and m or n, and leave all the numbers

instead of getting what is seen in the photo below, we should have more like

3W10 7N8B 5RNU

etc

image

Paul-Eraman-CoopCycle avatar Oct 27 '23 21:10 Paul-Eraman-CoopCycle

The idea is to use Crockford's Base32 instead of Base36

alexsegura avatar Nov 08 '23 15:11 alexsegura

I think this is where the change may take place https://github.com/coopcycle/coopcycle-web/blob/57549ee25157b6289928f94b0de85ba30fba1c27/src/Sylius/Order/OrderNumberAssigner.php

r0xsh avatar Nov 10 '23 12:11 r0xsh

Also worth looking at

https://github.com/maksverver/key-encoding

alexsegura avatar Nov 21 '23 11:11 alexsegura

So...it's still basically the same

image

We eliminated some letters that seem similar to numbers, but the main thing would be to make the first two digits also change. right now we effectively only use the 3rd and 4th digits because the others are useless.

I took a look, other platforms use 3 digit codes, but the codes actually are different The number of B and E in that photo seems a bit nuts too

Paul-Eraman-CoopCycle avatar Jan 28 '24 14:01 Paul-Eraman-CoopCycle

repeat of #3770 closing

Paul-Eraman-CoopCycle avatar Apr 17 '24 16:04 Paul-Eraman-CoopCycle