When you start, the code will generate an 8-digit barcode, this will be added to the list if it is unique (not created yet). I don't know if the list works yet so if you could tell me in the comments that would be great.
I made it all by myself.