Add check for Products and Sizes (delete, deactivate)
Closed this issue · 4 comments
/product/{productId}/unused
/product/{productId}/size/{sizeTypeId}/unused
For the sizes check you used deletable
:
/product/{productId}/size/{sizeTypeId}/deletable
I'd like to see the same wording in all those cases – either unsued
or deletable
. What do you think? @rweisse
Yes. The problem is that I need a second ressource for the deactivation-check of Sizes. /deletable
checks the occurances of product-sizetype-relations in event-transfers- and transactions-tables. /unused
just checks if the current inventory of this product or product-size is zero or not. That's a difference. Furthermore I need to address the same ressource twice because of this two types of checks :
/product/{productId}/size/{sizeTypeId}/unused
/product/{productId}/size/{sizeTypeId}/deletable
Therefore we need two different wordings.
I don't like that, too :-/ Do you have a better idea?
I understand the problem... what about offering unused
AND deletable
for all those cases? Then I could always use deletable
for delete actions and unused
for deactivation – even if they resolve to the same controller function.
Difficult thing...
Ok, then I will implement a second ressource next to /product/{productId}/unused
named /product/{productId}/deletable
which does the same backend-job like unused
. You are right. That's a cleaner way from the APIs point of view.