I have a situation : Category - Master data with different types. Order - Has a reference to Category. It is a one-to-one mapping from Order to Category. Order table has a foreign key column to Category. Now api to get Orders
/users/orders
Will the return type as
{ "name: "abc", "categoryId" : 23 }
will be fine or should we return the json as
{ "name: "abc", "category" : "CAT-A" }
We also have a create/update Order use case with client knowing the category. We need a api to post new Order with a Category. Should it be something like this?
1. post /api/orders { "categoryId" : 23, ....}
Or something like this?
2. post /api/orders/category/23/order