Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

joaosousa3r4's avatar

What is the best way to seperate work zones? (not a languague specific question )

So i have a question, and i think the best way to explain it, is by using a supermarket as an example.

Imagine you have a supermarket, one that supermarket you have 2 checkout points, with that in mind you now need to build a web software for those cashiers, on the software you need to distinguish which checkout points assisted client 1, 2 and 3 and so on, to store each record correctly on the database.

Now the questions are:

  • What's all the ways this can be done?
  • What's the "best" way to do this?

The only ways i can think i can handle this problem is:

  • Using a custom url for each cashier like (supermarket.test/zone1/ and supermarket.test/zone2/), but on the begining i need somewhere where they choose the zone every single time and then retriving it from the uri for every action
  • Using the browser localstorage to store each zone without expiration date, on the first usage and then retriving it from the localstorage for every action

Thanks in advace, i hope you can give me some feedback

0 likes
9 replies
martinbean's avatar

@joaosousa3r4 Don’t over-complicate the problem. When you’re describing features, try and pick out the nouns and verbs, and these will find their way into your software as entities and the actions they can perform.

So, in your case, you’ve identified that there are different cashiers (operators) that work on different checkout points. So there are two entities: operators and checkout points. So when you’re creating records for say, a transaction, you can associate that transaction with the checkout point it was processed on, and which operator was signed in at that time.

joaosousa3r4's avatar

@martinbean Yes that's exacly what i want to accomplishe, the cashier information i have on their login to the system, so that's not a problem, but what about the checkout point? how can i differentiate that?

Tray2's avatar

@joaosousa3r4 You create a table where you store your checkout points, and then you associate it to the sale just like you do with the user.

martinbean's avatar

Yes that's exacly what i want to accomplishe, the cashier information i have on their login to the system, so that's not a problem, but what about the checkout point? how can i differentiate that?

@joaosousa3r4 It completely depends on how you actually distribute this app, and the hardware it’s running on. We have no knowledge about these points or how they’re installed.

martinbean's avatar

@joaosousa3r4 I’d seriously consider looking into building an offline-first PWA (progressive web app). The last thing you want is checkout point becoming unusable due to network connectivity issues. Surely you’re not installing a web server on each checkout point just to run POS?

Snapey's avatar

the transaction could be purely related to the cashier that served. If physical location is important then this can be stored when the cashier logs on to their till, there is no need to record it per transaction.

joaosousa3r4's avatar

@Snapey You are right, i can pick up the location from the login once and query for every transaction it happened until the log out, my problem is being it a simple website, how would i go about separating every till without using a button for the cashier to choose the which till he/she is on, cookies, or different uris even

Snapey's avatar

@joaosousa3r4 get them to login to the right till.

On the 'login screen, they first see an array of buttons and they choose the till and their login.

You can check if someone else is already on that till.

Or, Yes you could have a url like login/2 for till 2 and then set this as the bookmark on that till.

Please or to participate in this conversation.