added expiration date and helper to resolveTicket

This commit is contained in:
Caluera 2021-10-10 14:06:31 +02:00
parent 61ba02ccd9
commit e21aae4602

View file

@ -92,12 +92,20 @@ class TicketService {
$title = array_get($matrixTicketContent, "title", "Untitled");
$description = array_get($matrixTicketContent, "description", "");
$lastModified = $this->matrix->getLastEventDate($ticket->getMatrixRoom());
$matrixHelperUser = $ticket->getMatrixHelperUser();
$matrixHelperUserName = $matrixHelperUser ? "Helfer Name" : "nicht zugewiesen";
//FIXME : set $maxHelpTime somewhere as an option or at least available for other functions
$maxHelpTime = 7 * 24 * 60 * 60 * 1000;
$expirationDate = $lastModified + $maxHelpTime;
return array(
'ticketId' => $ticketId,
'status' => $ticket->getStatus(),
'lastModified' => $lastModified,
'title' => $title,
'description' => $description,
'matrixHelperUser' => $matrixHelperUser,
'matrixHelferName' => $matrixHelperUserName,
'expirationDate' => $expirationDate
);
} catch (MatrixException | RoomNotFoundException $e) {
return array(