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

Implement Handler for ProcessTicketReview #1999

Closed
4 tasks
Tracked by #1967
humansinstitute opened this issue Nov 28, 2024 · 5 comments
Closed
4 tasks
Tracked by #1967

Implement Handler for ProcessTicketReview #1999

humansinstitute opened this issue Nov 28, 2024 · 5 comments
Assignees
Labels

Comments

@humansinstitute
Copy link
Contributor

humansinstitute commented Nov 28, 2024

Ticket Name: Implement Ticket Review Processing Handler

Context

As part of the ticket review workflow, we need to implement a handler that processes incoming ticket review data and updates the corresponding ticket information in the database. This handler is a crucial component in maintaining ticket state and ensuring that review feedback is properly persisted.

The handler will be triggered after receiving data at the /bounty/ticket/review endpoint and needs to extract specific fields from the workflow object before updating the database.

Task

  1. Create a new handler function named ProcessTicketReview
  2. Implement data extraction from the workflow object
  3. Integrate with the database upsert function to update ticket information
  4. Implement error handling and validation
  5. Return appropriate response based on update success/failure

Outcome

A working handler that successfully processes ticket review data and updates the ticket description in the database, maintaining data integrity and workflow continuity.

Design

Function Specification

  • Handler Name: ProcessTicketReview

  • Input: Workflow object containing:

    {
        "featureUUID": "string",
        "phaseUUID": "string",
        "ticketUUID": "string",
        "ticketDescription": "string"
    }
  • Required fields to extract:

    • featureUUID
    • ticketDescription

Database Integration

Data Flow

  1. Receive workflow object at /bounty/ticket/review
  2. Extract required fields
  3. Validate field presence and format
  4. Call database upsert function
  5. Handle response

Error Handling Requirements

  • Validate presence of required fields
  • Handle database connection errors
  • Handle upsert failures
  • Provide appropriate error messages

Acceptance Criteria

  • Handler successfully extracts featureUUID and ticketDescription from workflow object
  • bounty/ticket/{UUID} endpoint is called with correct parameters
  • Handler properly handles missing or invalid data
  • Code follows team's style guide and naming conventions
@saithsab877
Copy link
Contributor

@humansinstitute Please assign me

1 similar comment
@MuhammadUmer44
Copy link
Contributor

@humansinstitute Please assign me

@aliraza556
Copy link
Contributor

hi @humansinstitute I have already implemented this Handler function You see here #1995

@humansinstitute
Copy link
Contributor Author

@aliraza556 @saithsab877 - Does #1995 cover functionality to update the ticket in the DB?

@aliraza556
Copy link
Contributor

aliraza556 commented Nov 28, 2024

Hi @humansinstitute, Yes

You can review the changes here:

https://github.com/stakwork/sphinx-tribes/blob/1fa7fbc1d30fac000ef6d8d5eb939e7f3357a95b/handlers/ticket.go#L199C1-L206C68

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants