Make a customer type system like retail tycoon

I’m making a customer system where you are a cashier and npcs come to buy items. I have already made a very buggy and I think hacky way of creating an NPC line system, but I want to know what’s the best way to do it, because my method is very bad.

I currently have a table of the npcs, and once they pathfind to the last location, they get added to the table, and whatever position in the table they are, they move to that location in the line. This works partly, but I have made a max of 7 npcs allowed in a line, as there are only 7 parts. I made it where they stand still if the line is full. But they wont know the line is full until an npc gets to the line to make it full. When this happens, it makes weird bugs. I want the NPCS to whoever gets there first to be ahead in line, so they don’t wait for an npc that’s far away. Is there any other way to do this? Any help would be greatly appreciated. This has been bugging me for quite some time.