sharp
sharp
CC#
Created by sharp on 6/6/2023 in #help
❔ Storing data which is different per user type
Hi there! I'm working on a project where I have two types of users. Buyer and Suppler. When the buyer is making a purchase of some items, I'm having some statuses of the purchase which he can track. Since the status is and integer in the database, both of those users should see different value on UI based on that integer
+---+----------+----------+
| # | Buyer | Supplier |
+---+----------+----------+
| 1 | Status A | Status X |
| 2 | Status B | Status Y |
| 3 | Status C | Status Y |
| 4 | Status D | Status Z |
+---+----------+----------+
+---+----------+----------+
| # | Buyer | Supplier |
+---+----------+----------+
| 1 | Status A | Status X |
| 2 | Status B | Status Y |
| 3 | Status C | Status Y |
| 4 | Status D | Status Z |
+---+----------+----------+
My current table has only ID and Name, but should I add type and maybe a separate Resources table where I'm gonna localised the status or? The main reason I'm asking is because I need to be able to show the statuses on the list and order by them (Alphabetically). Currently they are being ordered by ID, which is not the correct way.
22 replies