❔ 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
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.11 Replies
you should have a core users table
a table of buyer statuses
a table of supplier statuses
a table of buyers
and a table of suppliers
I usually distinguish them by UserType, 1 = Buyer, 2 = Supplier
What is this approach named, do you know any articles/blogs that I could check out?
Or any github repo which implements it in similar matter?
uhhhh
you could call it "normalized" in general
or you could call it "table-per-type" in the context of EF
but what else is there to know?
that's the table structure you want
What do you think about storing it in "Resources" table, where all the other resources could live in?
Yes the downfall is querying it by resource name...
what is "Resources" table?
what does that look like
Something like this
Where the name would follow some sort table-related naming pattern
I would say that is not well-normalized
and that if you want a document store, you should use a document store
Great, thanks for the input
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.