Skip to content
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

Close ticket function block #6

Open
uttahb opened this issue Oct 6, 2023 · 4 comments · May be fixed by #37
Open

Close ticket function block #6

uttahb opened this issue Oct 6, 2023 · 4 comments · May be fixed by #37

Comments

@uttahb
Copy link
Contributor

uttahb commented Oct 6, 2023

Add Function block for Closing Tickets in TMS

Issue:
Create a new endpoint open_tms_close_ticket in the backend under the directory backend/open_tms_close_ticket to handle ticket closing in the Ticket Management System (TMS).

Tables:

  • tickets
  • ticket_revisions
  • ticket_activity

Input Signature:

  • Request Method: POST
  • Body:
    {
      "ticket_id": "<ticket id>"
    }
  • Is Authenticated: Yes

Response Signature:

  • Success:

    {
      "meta": {
        "status": 200,
        "message": "Ticket closed successfully"
      }
    }
  • Error in Authentication:

    {
      "meta": {
        "status": 401,
        "message": "Unauthorized access"
      },
      "errors": [
        {
          "code": "AUTH_FAILED",
          "message": "Authentication failed for the request."
        }
      ]
    }
  • Error with invalid next stage or assignee data:

    {
      "meta": {
        "status": 400,
        "message": "Bad Request"
      },
      "errors": [
        {
          "code": "BAD_REQUESt",
          "message": "Next stage or assignee is invalid."
        }
      ]
    }
  • Any Other Internal Error:

    {
      "meta": {
        "status": 500,
        "message": "Something went wrong."
      },
      "errors": [
        {
          "code": "INTERNAL_ERROR",
          "message": "Something went wrong."
        }
      ]
    }

Expected Workflow:

  1. Authenticate the request and build the user context in the middleware.
  2. Fetch the latest ticket_revision from the ticket_id
  3. Validate the to stage and assignee with the available process path from current stage
  4. If validated successfully update the ticket table with closed status
  5. Create a new entry in the ticket_activity table with current_stage as "ticket_closed" id from stage table
  6. If validation fails, send proper error message
  7. Capture errors and send appropriate error messages based on the response structure to the frontend.
  8. If the workflow completes successfully, send a success message as per response signature to the frontend.
@SrijanSahaySrivastava
Copy link

@uttahb Please look into my PR.

@uttahb
Copy link
Contributor Author

uttahb commented Oct 11, 2023

@SrijanSahaySrivastava Sure, will update you.

@ittyjose
Copy link
Contributor

Hey @uttahb, I would like to work on this too.

@uttahb
Copy link
Contributor Author

uttahb commented Oct 30, 2023

Hey @ittyjose sure, please go ahead.

@ittyjose ittyjose linked a pull request Nov 1, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants