Skip to content

v5 endpoint to Jobs and multiple jobs support #5339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
8 of 15 tasks
carmenfan opened this issue Jan 9, 2025 · 0 comments
Open
8 of 15 tasks

v5 endpoint to Jobs and multiple jobs support #5339

carmenfan opened this issue Jan 9, 2025 · 0 comments
Assignees

Comments

@carmenfan
Copy link
Member

carmenfan commented Jan 9, 2025

Description

Product issue: https://github.com/3drepo/3D-Repo-Product-Team/issues/610

We want to implement v5 endpoints for jobs with the following changes:

  1. a user can have more than one job
  2. a user can have 0 job.

Endpoints

Additional endpoints

Add new job

Endpoint: POST /teamspaces/:teamspace/jobs
permissions: teamspace admin
payload:

{
  name: "job name",
  colour: "#000000", //RGB hex, optional
  users: ["user1"], //optional
}

response

{
  _id: "UUID string"
}
Edit an existing job

Endpoint: PATCH /teamspaces/:teamspace/jobs/:jobID
permissions: teamspace admin
payload:

{
  name: "new name",
  users: ["user1", "user2"]
}
Remove an existing job

Endpoint: Delete /teamspaces/:teamspace/jobs/:jobID
permissions: teamspace admin

Changes to existing endpoints

Teamspace members

URL: https://staging.dev.3drepo.io/docs/#/Teamspaces/getTeamspaceMembers
Changes: Should now return an array of "jobs" instead of "job"

Additional work

  • As specified above, we want to add an ID to job instead of using the name of the job as unique identification. We will have to do a migration on existing data, and also data that references jobs (i.e. tickets/issues/risks). We will also need to make adjustment on any associated endpoints.
  • Care needs to be taken with how jobs are used. We need to check everywhere that references/uses jobs logic and ensure they still work as intended. This includes endpoints within v4
  • We should also remove v4 job endpoints to avoid clashes (with approach described in Modify some old v4 endpoints that should no longer be used to respond differently #5317)

Goals

  • As ts admin I want to be able to do everything I need to do on the old interface
  • As ts admin I want the data within the old data is preserved and presented in this new interface
  • As a ts admin I want to be able to edit the name fo the job if necessary
  • As a ts admin I want to be able to assign a user to multiple jobs if they are involved in more than one type of work
  • As a system integrator I want to be able to support scenarios such as a user with no associated jobs if this is how it's setup on the other system.

Tasks

  • Create endpoint for adding job
  • Create endpoint for editing job
  • Create endpoint for removing job
  • Add documentation for endpoints
  • Add unit tests for endpoints
  • Add e2e tests for endpoints
  • Change getMembers endpoint to return multiple jobs
  • Write script for changing default jobs
  • Check logic that uses jobs and make sure it works
  • Remove old v4 endpoints
ChristosTsiotsias added a commit that referenced this issue Jan 14, 2025
route / processor / model methods for adding, edititng, removing jobs added
documentation added
ChristosTsiotsias added a commit that referenced this issue Jan 16, 2025
script to givce jobs names started
ChristosTsiotsias added a commit that referenced this issue Jan 23, 2025
ChristosTsiotsias added a commit that referenced this issue Jan 24, 2025
users ts access check
ChristosTsiotsias added a commit that referenced this issue Jan 29, 2025
middleware unit tests added
ChristosTsiotsias added a commit that referenced this issue Jan 29, 2025
ChristosTsiotsias added a commit that referenced this issue Jan 31, 2025
add/update/delete role e2e tests added
e2e test fixes
ChristosTsiotsias added a commit that referenced this issue Feb 2, 2025
ChristosTsiotsias added a commit that referenced this issue Feb 3, 2025
ChristosTsiotsias added a commit that referenced this issue Feb 10, 2025
ChristosTsiotsias added a commit that referenced this issue Feb 10, 2025
ChristosTsiotsias added a commit that referenced this issue Feb 10, 2025
ChristosTsiotsias added a commit that referenced this issue Feb 11, 2025
ChristosTsiotsias added a commit that referenced this issue Feb 11, 2025
ChristosTsiotsias added a commit that referenced this issue Feb 11, 2025
ChristosTsiotsias added a commit that referenced this issue Feb 12, 2025
ChristosTsiotsias added a commit that referenced this issue Feb 12, 2025
ChristosTsiotsias added a commit that referenced this issue Feb 13, 2025
ChristosTsiotsias added a commit that referenced this issue Feb 13, 2025
ChristosTsiotsias added a commit that referenced this issue Feb 13, 2025
ChristosTsiotsias added a commit that referenced this issue Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants