I would ask if there is a standard approach for automatic, reoccurring actions in Payload? For example, when user is inactive since 7 days, deactivate him or similar things.
We use node-cron in our public demo to clear the database and re-seed data every hour. Might be a good example to look at. https://github.com/payloadcms/public-demo/tree/master/src%2Fcron
I believe there's no built-in way to do that on Payload, however, since it's built on top of express and Node.js you are able to implement cron jobs and use the Payload Local API to achieve what you're looking for.
You can look into node-cron
for a simple cron job implementation in Node.js.
For the use case you mentioned, maybe you can run a cron job once at the beginning of every day to check for any inactive users since 7 days or more and suspend them using the Payload Local API.
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.