RealDevSquad / RealDevSquad/website-backend

[RFC] Implementation of User Status Update Script

Open
#1,226 2 comments 0 reactions 1 assignee View on GitHub

@heyrandhirs is already working on this.

Since Jul 4, 2023.

Dominant language
JavaScript
Stars
74
Forks
276
Avg merge
1d 26m
Merged PRs (30d)
14

Description

We need a script which will automatically mark user status based on the task assigned to them

Approach 1:

This approach directly queries the tasks collection for each user to determine if they have any assigned tasks. If no tasks are found, the user's status is updated to "idle" in the status collection.

The Steps are as follows :

  1. Retrieve all users from the Firestore "users" collection.
  2. For each user, query the "tasks" collection using their ID as the assignee field value to check if they have any assigned tasks.
  3. If the query result is empty, it means the user doesn't have a task assigned. Update their status to "idle" in the "status" collection.
  4. This approach directly checks each user's task assignments to identify idle users and update their status.

Approach 2:

In this approach, all tasks are retrieved from the tasks collection, and the assignees' user IDs are extracted. Then, for each user, their ID is checked against the assignees list. If the user's ID is not present, their status is updated to "idle" in the status collection.

  1. Retrieve all tasks from the Firestore "tasks" collection.
  2. Extract the assignees (user IDs) from the tasks.
  3. Loop through all users and check if their ID is not in the list of assignees.
  4. If a user's ID is not found in the assignees list, update their status to "idle" in the "status" collection.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.