Last active
July 21, 2018 16:27
-
-
Save geomagilles/90d2b16723aa27cb1efe75e64349accc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
... | |
public function handle() | |
{ | |
... | |
// if no response received in 3 days | |
if (0 == count($this->quotations)) { | |
(new NotifyUserOfNoResponse($this->request))->execute(); | |
return; | |
} | |
// notify quotation to user | |
(new NotifyQuotationsToUser($this->request, $this->quotations))->execute(); | |
// wait user choice | |
$event = (new Wait(QuotationChosenByUserEvent::class))->execute(); | |
// notify user choice to providers | |
foreach ($this->quotations as $providerId => $quotation) { | |
if ($providerId == $selected) { | |
(new NotifiyChosenProvider($providerId, $this->request))->dispatch(); | |
} else { | |
(new NotifiyNotChosenProvider($providerId, $this->request))->dispatch(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment