Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
feat: Handle uploads on new conversation from SS. (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
wadedvsa authored Mar 12, 2024
1 parent 3db9256 commit 67bcb0c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ private function assignUploadsToMessage(MessagingMessage $message, string $corre
continue;
}

$doc->setMessagingConversation($message->getMessagingConversation());
$doc->setMessagingMessage($message);
$doc->setLicence($message->getMessagingConversation()->getRelatedLicence());
$doc->setApplication($message->getMessagingConversation()->getTask()->getApplication());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ public function isValid($dto)
$this->setIsValid($this->canAccessConversation($dto->getMessagingConversation()));
}

if (!$dto->getMessagingConversation() && $dto->getCorrelationId()) {
$this->setIsValid($this->getUser()->getRelatedOrganisation()->getIsMessagingFileUploadEnabled());
}

return $this->getIsValid();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public function testIsValidNoChecks()
$dto->shouldReceive('getSubmission')->andReturn(null);
$dto->shouldReceive('getContinuationDetail')->andReturn(null);
$dto->shouldReceive('getMessagingConversation')->andReturn(null);
$dto->shouldReceive('getCorrelationId')->andReturn(null);

$this->assertFalse($this->sut->isValid($dto));
}
Expand Down Expand Up @@ -230,6 +231,7 @@ public function testIsValidExtensionExternal($valid, $extension)
$dto->shouldReceive('getSubmission')->andReturn(null);
$dto->shouldReceive('getContinuationDetail')->andReturn(null);
$dto->shouldReceive('getMessagingConversation')->andReturn(null);
$dto->shouldReceive('getCorrelationId')->andReturn(null);

$this->setIsValid('canAccessLicence', [176], true);

Expand Down

0 comments on commit 67bcb0c

Please sign in to comment.