I am working on a SaaS product that I intend to have multiple plans for, I will have a limit of 50 of item A example and then a per user cust where I will have a base plan of 3 users.
I'm building this application primarily out of Node.js microservices. I was wondering where it makes sense to put in the controls for this type of limiting (the 50 items A not the per-user that seems simple enough).
Do I put it as its own service or is there a reasonable way to integrate it into say an API gateway or auth service?
Currently, the services I have that would be involved in item A are:
I'd like to do it in a way that I could remove the limiting per item later on as I have plans to change my pricing plan structure as the product develops.
I'm open to almost anything, I have a few poorly thought out ideas like adding a middleware that checks the user model and if the user's company/payment/plan data says that it exceeds the limit then I would return an error.