Add `lastDuoActivityOn` field to UserGraphQL type

Summmary

As part of #501462 (closed) we need to introduce new field lastDuoActivityOn for user GraphQL type which should return last time a user used any Duo feature. The scope of this issue is to introduce new field and provide tracking interface which can be used by other teams to trigger lastDuoActivityOn refresh when needed.

Technical proposal

  1. Create Ai::UserMetrics model which is simple (user_id, last_duo_activity_on) pair. last_duo_activity_on can be a date only.
  2. Create LastDuoActivityTracker class which should be responsible for storing and tracking duo activity values. Proposed interface: LastDuoActivityTracker#update(user). The tracker should NOT write directly to postgres but rather use Redis buffer approach to pile up updates.
  3. Create LastDuoActivityRefreshWorker background worker which should be responsible for taking data from Redis buffer and upserting data to UserDuoActivity model. The worker can run every 10 minutes or so.
  4. Create lastDuoActivityOn field for GraphQL AddOnUserType which exposes data from UserDuoActivity.
  5. Access should be controlled by parent object. so no new access rules are needed.
Edited by Pavel Shutsin