muni-logo

Task 01 - Typescript

In the first task, we will not be focusing on the frontend yet, but on typescript and writing clean and quality code. We have prepared an npm project in which we have included all the necessary dependencies, which include, among others, typecript, eslint and prettier. Your task will be to add several types and implement four functions.

If any of you are wondering how you can set up the same environment, check out this reference.

Maximum points10 points
Deadline
February 23, 2026

Project Overview

In the project you will find the following important files:

Tasks

Desired output

- getOpenJobs(db)

[
  {
    "jobId": 101,
    "title": "Fix Issue #1",
    "description": "...",
    "state": {
      "stateType": "open"
    }
  },
  {
    "jobId": 102,
    "title": "Fix Issue #2",
    "description": "...",
    "state": {
      "stateType": "open"
    }
  },
  {
    "jobId": 103,
    "title": "Fix Issue #3",
    "description": "...",
    "state": {
      "stateType": "open"
    }
  }
]
------------


- getUnassignedJobPersonPair(db)

[
  {
    "jobId": 103,
    "title": "Fix Issue #3",
    "description": "...",
    "state": {
      "stateType": "open"
    }
  },
  {
    "id": 2,
    "name": "Eve",
    "role": "employee",
    "jobs": []
  },
]
------------


- getEmployeeWithoutManager(db)

{
  "id": 4,
  "name": "Mallory",
  "role": "employee",
  "jobs": []
}
------------


- getAssignedJobs(db)

[
  {
    "jobId": 101,
    "assignedPerson": {
      "id": 1,
      "name": "Alice",
      "role": "employee",
      "jobs": [
        {
          "jobId": 101,
          "title": "Fix Issue #1",
          "description": "...",
          "state": {
            "stateType": "open"
          }
        },
        {
          "jobId": 102,
          "title": "Fix Issue #2",
          "description": "...",
          "state": {
            "stateType": "open"
          }
        }
      ]
    }
  },
  {
    "jobId": 102,
    "assignedPerson": {
      "id": 1,
      "name": "Alice",
      "role": "employee",
      "jobs": [
        {
          "jobId": 101,
          "title": "Fix Issue #1",
          "description": "...",
          "state": {
            "stateType": "open"
          }
        },
        {
          "jobId": 102,
          "title": "Fix Issue #2",
          "description": "...",
          "state": {
            "stateType": "open"
          }
        }
      ]
    }
  },
  {
    "jobId": 104,
    "assignedPerson": {
      "id": 3,
      "name": "Bob",
      "role": "manager",
      "jobs": [
        {
          "jobId": 104,
          "title": "Fixing issue #4...",
          "description": "...",
          "state": {
            "stateType": "inProgress",
            "startedDate": "2024-02-09T23:00:00.000Z"
          }
        },
        {
          "jobId": 105,
          "title": "Fixing issue #5...",
          "description": "...",
          "state": {
            "stateType": "inProgress",
            "startedDate": "2024-02-10T23:00:00.000Z"
          }
        }
      ],
      "employees": [
        1,
        2
      ]
    },
    "possibleEmployees": [
      {
        "id": 2,
        "name": "Eve",
        "role": "employee",
        "jobs": []
      }
    ]
  },
  {
    "jobId": 105,
    "assignedPerson": {
      "id": 3,
      "name": "Bob",
      "role": "manager",
      "jobs": [
        {
          "jobId": 104,
          "title": "Fixing issue #4...",
          "description": "...",
          "state": {
            "stateType": "inProgress",
            "startedDate": "2024-02-09T23:00:00.000Z"
          }
        },
        {
          "jobId": 105,
          "title": "Fixing issue #5...",
          "description": "...",
          "state": {
            "stateType": "inProgress",
            "startedDate": "2024-02-10T23:00:00.000Z"
          }
        }
      ],
      "employees": [
        1,
        2
      ]
    },
    "possibleEmployees": [
      {
        "id": 2,
        "name": "Eve",
        "role": "employee",
        "jobs": []
      }
    ]
  }
]
------------

Maximum points: 10

Deadline