PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.20
Booking for Appointments and Events Calendar – Amelia v1.2.20
2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / src / Application / Services / Bookable / AbstractPackageApplicationService.php
ameliabooking / src / Application / Services / Bookable Last commit date
AbstractPackageApplicationService.php 2 years ago BasicPackageApplicationService.php 2 years ago BookableApplicationService.php 1 year ago
AbstractPackageApplicationService.php
139 lines
1 <?php
2
3 namespace AmeliaBooking\Application\Services\Bookable;
4
5 use AmeliaBooking\Domain\Collection\Collection;
6 use AmeliaBooking\Domain\Common\Exceptions\InvalidArgumentException;
7 use AmeliaBooking\Domain\Entity\Bookable\Service\Package;
8 use AmeliaBooking\Infrastructure\Common\Container;
9 use AmeliaBooking\Infrastructure\Common\Exceptions\QueryExecutionException;
10 use Exception;
11 use Slim\Exception\ContainerValueNotFoundException;
12
13 /**
14 * Class AbstractPackageApplicationService
15 *
16 * @package AmeliaBooking\Application\Services\Booking
17 */
18 abstract class AbstractPackageApplicationService
19 {
20 /** @var Container $container */
21 public $container;
22
23 /**
24 * AbstractPackageApplicationService constructor.
25 *
26 * @param Container $container
27 */
28 public function __construct(Container $container)
29 {
30 $this->container = $container;
31 }
32
33 /**
34 * @param Collection $packageCustomerServices
35 *
36 * @return boolean
37 *
38 * @throws ContainerValueNotFoundException
39 */
40 abstract public function deletePackageCustomer($packageCustomerServices);
41
42 /**
43 * @param Collection $appointments
44 *
45 * @return void
46 */
47 abstract public function setPackageBookingsForAppointments($appointments);
48
49 /**
50 * @param int $packageCustomerServiceId
51 * @param int $customerId
52 * @param bool $isCabinetBooking
53 *
54 * @return boolean
55 */
56 abstract public function isBookingAvailableForPurchasedPackage($packageCustomerServiceId, $customerId, $isCabinetBooking);
57
58 /**
59 * @param array $params
60 *
61 * @return array
62 */
63 abstract public function getPackageStatsData($params);
64
65 /**
66 * @param array $packageDatesData
67 * @param Collection $appointmentsPackageCustomerServices
68 * @param int $packageCustomerServiceId
69 * @param string $date
70 * @param int $occupiedDuration
71 *
72 * @return void
73 */
74 abstract public function updatePackageStatsData(
75 &$packageDatesData,
76 $appointmentsPackageCustomerServices,
77 $packageCustomerServiceId,
78 $date,
79 $occupiedDuration
80 );
81
82 /**
83 * @param Collection $appointments
84 *
85 * @return Collection
86 *
87 * @throws Exception
88 */
89 abstract public function getPackageCustomerServicesForAppointments($appointments);
90
91 /**
92 * @param Collection $appointments
93 * @param array $params
94 *
95 * @return array
96 */
97 abstract public function getPackageAvailability($appointments, $params);
98
99 /**
100 * @return array
101 */
102 abstract public function getPackagesArray();
103
104 /**
105 * @param array $paymentsData
106 * @return void
107 *
108 * @throws InvalidArgumentException
109 * @throws QueryExecutionException
110 */
111 abstract public function setPaymentData(&$paymentsData);
112
113 /**
114 * @param Collection $appointments
115 * @param Collection $packageCustomerServices
116 * @param array $packageData
117 *
118 * @return void
119 */
120 abstract protected function fixPurchase($appointments, $packageCustomerServices, $packageData);
121
122 /**
123 * @param Collection $packageCustomerServices
124 * @param Collection $appointments
125 *
126 * @return array
127 *
128 * @throws ContainerValueNotFoundException
129 */
130 abstract public function getPackageUnusedBookingsCount($packageCustomerServices, $appointments);
131
132 /**
133 * @param array $package
134 *
135 * @return array
136 */
137 abstract public function getOnlyOneEmployee($package);
138 }
139