RealDevSquad / RealDevSquad/website-backend

Modify the data models for User Status

Open
#975 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The current datamodel for User Status is as follows

{
  "id": "String",
  "userId": "String",
  "currentStatus": {
    "state": "OOO | IDLE | ACTIVE",
    "updatedAt": "TimeStamp",
    "from": "TimeStamp",
    "until": "TimeStamp",
    "message": "String"
  },
  "futureStatus": {
    "state": "OOO | IDLE | ACTIVE",
    "updatedAt": "TimeStamp",
    "from": "TimeStamp",
    "until": "TimeStamp",
    "message": "String"
  },
  "monthlyHours": {
    "committed": "Number",
    "updatedAt": "TimeStamp"
  }
}

According to @ankushdharkar's comments here, we should change this as follows.

{
  "id": "String",
  "userId": "String",
  "status": {
    "current": {
      "state": "OOO | IDLE | ACTIVE",
      "updatedAt": "TimeStamp",
      "from": "TimeStamp",
      "until": "TimeStamp",
      "message": "String"
    },
    "future": {
      "state": "OOO | IDLE | ACTIVE",
      "updatedAt": "TimeStamp",
      "from": "TimeStamp",
      "until": "TimeStamp",
      "message": "String"
    }
  },
  "monthlyHours": {
    "committed": "Number",
    "updatedAt": "TimeStamp"
  }
}

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.

Research direction

Start by locating the User Status data model and its usages in the backend, then compare them with the proposed nested status structure in the issue. Done means the model and affected references consistently use status.current and status.future while preserving monthlyHours.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.