StarterOutlookCalendarService.php
148 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AmeliaBooking\Infrastructure\Services\Outlook; |
| 4 | |
| 5 | use AmeliaBooking\Domain\Collection\Collection; |
| 6 | use AmeliaBooking\Domain\Entity\Booking\Appointment\Appointment; |
| 7 | use AmeliaBooking\Domain\Entity\User\Provider; |
| 8 | use AmeliaBooking\Infrastructure\Common\Container; |
| 9 | use Interop\Container\Exception\ContainerException; |
| 10 | use WP_Error; |
| 11 | |
| 12 | /** |
| 13 | * Class StarterOutlookCalendarService |
| 14 | * |
| 15 | * @package AmeliaBooking\Infrastructure\Services\Outlook |
| 16 | */ |
| 17 | class StarterOutlookCalendarService extends AbstractOutlookCalendarService |
| 18 | { |
| 19 | /** |
| 20 | * StarterOutlookCalendarService constructor. |
| 21 | * |
| 22 | * @param Container $container |
| 23 | */ |
| 24 | public function __construct(Container $container) |
| 25 | { |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * Create a URL to obtain user authorization. |
| 30 | * |
| 31 | * @param $providerId |
| 32 | * |
| 33 | * @return string |
| 34 | * |
| 35 | * @throws ContainerException |
| 36 | */ |
| 37 | public function createAuthUrl($providerId) |
| 38 | { |
| 39 | return ''; |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * @return void |
| 44 | */ |
| 45 | public static function handleCallback() |
| 46 | { |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * @param $authCode |
| 51 | * @param $redirectUri |
| 52 | * |
| 53 | * @return array |
| 54 | */ |
| 55 | public function fetchAccessTokenWithAuthCode($authCode, $redirectUri) |
| 56 | { |
| 57 | return ['outcome' => true, 'result' => []]; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * @param Provider $provider |
| 62 | * |
| 63 | * @return void |
| 64 | */ |
| 65 | public function authorizeProvider($provider) |
| 66 | { |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * @param Provider $provider |
| 71 | * |
| 72 | * @return array |
| 73 | */ |
| 74 | public function listCalendarList($provider) |
| 75 | { |
| 76 | return []; |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Get Provider's Outlook Calendar ID. |
| 81 | * |
| 82 | * @param Provider $provider |
| 83 | * |
| 84 | * @return null|string |
| 85 | */ |
| 86 | public function getProviderOutlookCalendarId($provider) |
| 87 | { |
| 88 | return null; |
| 89 | } |
| 90 | |
| 91 | /** |
| 92 | * @param Appointment $appointment |
| 93 | * @param string $commandSlug |
| 94 | * @param null|string $oldStatus |
| 95 | * |
| 96 | * @return void |
| 97 | */ |
| 98 | public function handleEvent($appointment, $commandSlug, $oldStatus = null) |
| 99 | { |
| 100 | } |
| 101 | |
| 102 | /** |
| 103 | * @param \AmeliaBooking\Domain\Entity\Booking\Event\Event $event |
| 104 | * @param string $commandSlug |
| 105 | * @param Collection $periods |
| 106 | * |
| 107 | * @return void |
| 108 | */ |
| 109 | public function handleEventPeriod($event, $commandSlug, $periods, $newProviders = null, $removeProviders = null) |
| 110 | { |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * Get providers events within date range |
| 115 | * |
| 116 | * @param array $providerArr |
| 117 | * @param string $dateStart |
| 118 | * @param string $dateStartEnd |
| 119 | * @param string $dateEnd |
| 120 | * @param array $eventIds |
| 121 | * |
| 122 | * @return array |
| 123 | */ |
| 124 | public function getEvents($providerArr, $dateStart, $dateStartEnd, $dateEnd, $eventIds) |
| 125 | { |
| 126 | return []; |
| 127 | } |
| 128 | |
| 129 | |
| 130 | /** |
| 131 | * Create fake appointments in provider's list so that these slots will not be available for booking |
| 132 | * |
| 133 | * @param Collection $providers |
| 134 | * @param int $excludeAppointmentId |
| 135 | * @param \DateTime $startDateTime |
| 136 | * @param \DateTime $endDateTime |
| 137 | * |
| 138 | * @return void |
| 139 | */ |
| 140 | public function removeSlotsFromOutlookCalendar( |
| 141 | $providers, |
| 142 | $excludeAppointmentId, |
| 143 | $startDateTime, |
| 144 | $endDateTime |
| 145 | ) { |
| 146 | } |
| 147 | } |
| 148 |