Skip to content

Commit

Permalink
TEAMMANAGE-2784: Added digital post id filter on envelope list command
Browse files Browse the repository at this point in the history
  • Loading branch information
rimi-itk committed Oct 5, 2023
1 parent 4c32c96 commit 58d2e87
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Command/DigitalPostEnvelopeListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ protected function configure()
{
$this
->addOption('status', null, InputOption::VALUE_REQUIRED, 'Show only envelopes with this status')
->addOption('digital-post-id', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Digital post id')
->addOption('digital-post-subject', null, InputOption::VALUE_REQUIRED, 'Show only envelopes with subject matching this LIKE expression')
->addOption('max-results', null, InputOption::VALUE_REQUIRED, 'Show at most this many envelopes', 10)
->addOption('id', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Envelope id')
Expand Down Expand Up @@ -134,6 +135,14 @@ private function findEnvelopes(InputInterface $input): array
->setParameter('status', $status)
;
}
if ($digitalPostIds = $input->getOption('digital-post-id')) {
$digitalPostIds = array_map(static fn (string $id) => Uuid::fromString($id)->toBinary(), $digitalPostIds);
$qb
->join('e.digitalPost', 'p_id')
->andWhere('p_id.id IN (:digitalPostIds)')
->setParameter('digitalPostIds', $digitalPostIds)
;
}
if ($subject = $input->getOption('digital-post-subject')) {
$qb
->join('e.digitalPost', 'p')
Expand Down

0 comments on commit 58d2e87

Please sign in to comment.