I’m building a reporting tool that will allow users to define categories and tags for their products and then build custom sales reports through the UI for sorting and filtering against these tags/categories and sales data.
I understand that I can use Ecto “field” and “dynamics” to compose these queries, but I was wondering if anyone has advice for the ergonomic way to setup the table/schemas.
Specifically, I’m wondering if it would it be better to, say, add a discrete number of category fields to each product. Or, if it is reasonable to allow the user to define custom categories through something like JSONB. I’m just worried that the latter approach will add complexity to the query composition and isn’t worth the added flexibility.
Also, if anyone has suggestions for a library they’ve used that makes this easier please let me know!
Thanks for your advice!