there so much going on, many user can be order same time so many edge cases.

to get straight incremental number, like 701, 702,703 … i had a same issue olce i was building a ordering system for a delivery app.

what. i did i used a backend workflow, and pass the current created order inside it also … then in backend i did a make change on it, and inside it, i did a search for all order and minus item the current order and then i use on count on list and plus one.

see if it work. you can also use your unix timestamp if its not important to be incremental but you want a unique integer. So it will be unique ea h time, as time stamps is like second , each second is passing by with time, so it will always be unique.