@startuml
Participant ControlHub
Participant "Pilot Team"
Participant "Ticket Creator"
Participant GitHub
Participant Redmine
Participant ODA
Participant "Management Team"
Participant "Development Team"
Participant "External resource"
group new ticket
    "Ticket Creator" -> ODA : New Feedback
    "Ticket Creator" -> Redmine : Manually inserted ticket
end
group Ticket update service
    ControlHub -> ODA : New feedback request
    ODA -> ControlHub : Return feedback data
    ControlHub -> Redmine : Push ticket requests
    Redmine -> ControlHub : Return status OK
end
group Pilot Team
    "Pilot Team" -> ControlHub : Access ticket management
    ControlHub -> Redmine : Query project tickets
    Redmine -> ControlHub : Return project tickets
    "Pilot Team" -> ControlHub : Update ticket status 
    "Pilot Team" -> ControlHub : Assign person in charge
    ControlHub -> Redmine : Change task status
    "Pilot Team" -> ControlHub : Create and handle necessary tasks
    "Pilot Team" -> "External resource" : Ask for support
    alt Ticket Closed
        "Pilot Team" -> ControlHub : Add close resolution for ticket
        "Pilot Team" -> ControlHub : Close ticket
        ControlHub -> Redmine: Close ticket
    else Ticket appoved 
        "Pilot Team" -> ControlHub : Add definitions of ready documents to ticket
        "Pilot Team" -> ControlHub : Move ticket to Management Team for approval
        ControlHub -> Redmine : Move ticket to Management Team
    end
end

group Management Team
    "Management Team" -> ControlHub : Access ticket management
    ControlHub -> Redmine : Query management tickets
    Redmine -> ControlHub : Return management tickets
    "Management Team" <-> "Development Team" : Verify DoR Documentation for readiness
    alt insufficient DoR Documentation
        "Management Team" -> ControlHub : Return ticket to Pilot Team
        ControlHub -> Redmine : Move ticket back to Pilot Team project
    else DoR documents sufficient
        "Management Team" -> ControlHub : Approve ticket for management team
        "Management Team" -> ControlHub : Assign person in charge
        "Management Team" -> ControlHub : Assign correct sub project for new ticket in need of development
        ControlHub -> Redmine : Ticket status and project updated
    end
end

group GitHub
    Redmine -> GitHub : New issue created
    "Development Team" -> GitHub : on new commit
    GitHub -> Redmine : Update ticket data
    "Development Team" -> GitHub : on change
    GitHub -> Redmine : Change ticket data
    "Development Team" -> GitHub : on close
    GitHub -> Redmine : Change ticket status
    Redmine -> "Management Team" : Notify on ticket close
end

@enduml
