help me find correct response model
Hi, here is my database schema for a shop. I want to build a page to display product details. Use can choose between attributes and based on their choice I want to display price and quantity in stock (select variant of product). Some attributes might be unavailable. What's response model (dto) should I create and return as a response for this page to make less calculations on the client (for example group attribute value)?
2 Replies
given your schema allows for an unlimited number of custom attributes, I'd probably do this like
let the view generate an attribute group for each key, add a button for each value under that key, and if a product variant is missing a key-value pair generate a "None" button to represent that
I'll try it, thanks