PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.32
Booking for Appointments and Events Calendar – Amelia v1.2.32
2.4.9 2.4.8 2.4.7 2.4.6 2.4.5 2.4.4 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 / Infrastructure / Licence / Lite / Licence.php
ameliabooking / src / Infrastructure / Licence / Lite Last commit date
ApplicationService.php 1 year ago DataModifier.php 1 year ago DomainService.php 2 years ago EventListener.php 1 year ago InfrastructureService.php 1 year ago Licence.php 1 year ago
Licence.php
220 lines
1 <?php
2
3 namespace AmeliaBooking\Infrastructure\Licence\Lite;
4
5 use AmeliaBooking\Application\Commands;
6 use AmeliaBooking\Domain\Collection\Collection;
7 use AmeliaBooking\Domain\Common\Exceptions\InvalidArgumentException;
8 use AmeliaBooking\Infrastructure\Common\Container;
9 use AmeliaBooking\Infrastructure\Routes;
10 use AmeliaBooking\Infrastructure\WP\Translations\BackendStrings;
11 use Slim\App;
12
13 /**
14 * Class Licence
15 *
16 * @package AmeliaBooking\Infrastructure\Licence\Lite
17 */
18 class Licence
19 {
20 public static $premium = false;
21
22 public static $licence = 'Lite';
23
24 /**
25 * @param Container $c
26 */
27 public static function getCommands($c)
28 {
29 return [
30 // Test
31 Commands\Test\TestCommand::class => new Commands\Test\TestCommandHandler($c),
32 // Stash
33 Commands\Stash\UpdateStashCommand::class => new Commands\Stash\UpdateStashCommandHandler($c),
34 // Bookable/Category
35 Commands\Bookable\Category\AddCategoryCommand::class => new Commands\Bookable\Category\AddCategoryCommandHandler($c),
36 Commands\Bookable\Category\DeleteCategoryCommand::class => new Commands\Bookable\Category\DeleteCategoryCommandHandler($c),
37 Commands\Bookable\Category\GetCategoriesCommand::class => new Commands\Bookable\Category\GetCategoriesCommandHandler($c),
38 Commands\Bookable\Category\GetCategoryCommand::class => new Commands\Bookable\Category\GetCategoryCommandHandler($c),
39 Commands\Bookable\Category\UpdateCategoriesPositionsCommand::class => new Commands\Bookable\Category\UpdateCategoriesPositionsCommandHandler($c),
40 Commands\Bookable\Category\UpdateCategoryCommand::class => new Commands\Bookable\Category\UpdateCategoryCommandHandler($c),
41 // Bookable/Service
42 Commands\Bookable\Service\AddServiceCommand::class => new Commands\Bookable\Service\AddServiceCommandHandler($c),
43 Commands\Bookable\Service\DeleteServiceCommand::class => new Commands\Bookable\Service\DeleteServiceCommandHandler($c),
44 Commands\Bookable\Service\GetServiceCommand::class => new Commands\Bookable\Service\GetServiceCommandHandler($c),
45 Commands\Bookable\Service\GetServiceDeleteEffectCommand::class => new Commands\Bookable\Service\GetServiceDeleteEffectCommandHandler($c),
46 Commands\Bookable\Service\GetServicesCommand::class => new Commands\Bookable\Service\GetServicesCommandHandler($c),
47 Commands\Bookable\Service\UpdateServiceCommand::class => new Commands\Bookable\Service\UpdateServiceCommandHandler($c),
48 Commands\Bookable\Service\UpdateServiceStatusCommand::class => new Commands\Bookable\Service\UpdateServiceStatusCommandHandler($c),
49 Commands\Bookable\Service\UpdateServicesPositionsCommand::class => new Commands\Bookable\Service\UpdateServicesPositionsCommandHandler($c),
50 // Booking/Event
51 Commands\Booking\Event\AddEventCommand::class => new Commands\Booking\Event\AddEventCommandHandler($c),
52 Commands\Booking\Event\GetEventCommand::class => new Commands\Booking\Event\GetEventCommandHandler($c),
53 Commands\Booking\Event\GetEventsCommand::class => new Commands\Booking\Event\GetEventsCommandHandler($c),
54 Commands\Booking\Event\GetEventBookingsCommand::class => new Commands\Booking\Event\GetEventBookingsCommandHandler($c),
55 Commands\Booking\Event\UpdateEventCommand::class => new Commands\Booking\Event\UpdateEventCommandHandler($c),
56 Commands\Booking\Event\UpdateEventStatusCommand::class => new Commands\Booking\Event\UpdateEventStatusCommandHandler($c),
57 Commands\Booking\Event\DeleteEventBookingCommand::class => new Commands\Booking\Event\DeleteEventBookingCommandHandler($c),
58 Commands\Booking\Event\UpdateEventBookingCommand::class => new Commands\Booking\Event\UpdateEventBookingCommandHandler($c),
59 Commands\Booking\Event\DeleteEventCommand::class => new Commands\Booking\Event\DeleteEventCommandHandler($c),
60 Commands\Booking\Event\GetEventDeleteEffectCommand::class => new Commands\Booking\Event\GetEventDeleteEffectCommandHandler($c),
61 Commands\Booking\Event\GetCalendarEventsCommand::class => new Commands\Booking\Event\GetCalendarEventsCommandHandler($c),
62 // Booking/Appointment
63 Commands\Booking\Appointment\AddAppointmentCommand::class => new Commands\Booking\Appointment\AddAppointmentCommandHandler($c),
64 Commands\Booking\Appointment\AddBookingCommand::class => new Commands\Booking\Appointment\AddBookingCommandHandler($c),
65 Commands\Booking\Appointment\DeleteBookingCommand::class => new Commands\Booking\Appointment\DeleteBookingCommandHandler($c),
66 Commands\Booking\Appointment\UpdateBookingStatusCommand::class => new Commands\Booking\Appointment\UpdateBookingStatusCommandHandler($c),
67 Commands\Booking\Appointment\CancelBookingCommand::class => new Commands\Booking\Appointment\CancelBookingCommandHandler($c),
68 Commands\Booking\Appointment\CancelBookingRemotelyCommand::class => new Commands\Booking\Appointment\CancelBookingRemotelyCommandHandler($c),
69 Commands\Booking\Appointment\RejectBookingRemotelyCommand::class => new Commands\Booking\Appointment\RejectBookingRemotelyCommandHandler($c),
70 Commands\Booking\Appointment\ApproveBookingRemotelyCommand::class => new Commands\Booking\Appointment\ApproveBookingRemotelyCommandHandler($c),
71 Commands\Booking\Appointment\DeleteAppointmentCommand::class => new Commands\Booking\Appointment\DeleteAppointmentCommandHandler($c),
72 Commands\Booking\Appointment\GetAppointmentCommand::class => new Commands\Booking\Appointment\GetAppointmentCommandHandler($c),
73 Commands\Booking\Appointment\GetAppointmentsCommand::class => new Commands\Booking\Appointment\GetAppointmentsCommandHandler($c),
74 Commands\Booking\Appointment\GetPackageAppointmentsCommand::class => new Commands\Booking\Appointment\GetPackageAppointmentsCommandHandler($c),
75 Commands\Booking\Appointment\GetIcsCommand::class => new Commands\Booking\Appointment\GetIcsCommandHandler($c),
76 Commands\Booking\Appointment\GetTimeSlotsCommand::class => new Commands\Booking\Appointment\GetTimeSlotsCommandHandler($c),
77 Commands\Booking\Appointment\UpdateAppointmentCommand::class => new Commands\Booking\Appointment\UpdateAppointmentCommandHandler($c),
78 Commands\Booking\Appointment\UpdateAppointmentStatusCommand::class => new Commands\Booking\Appointment\UpdateAppointmentStatusCommandHandler($c),
79 Commands\Booking\Appointment\UpdateAppointmentTimeCommand::class => new Commands\Booking\Appointment\UpdateAppointmentTimeCommandHandler($c),
80 Commands\Booking\Appointment\ReassignBookingCommand::class => new Commands\Booking\Appointment\ReassignBookingCommandHandler($c),
81 Commands\Booking\Appointment\SuccessfulBookingCommand::class => new Commands\Booking\Appointment\SuccessfulBookingCommandHandler($c),
82 // Entities
83 Commands\Entities\GetEntitiesCommand::class => new Commands\Entities\GetEntitiesCommandHandler($c),
84 // Notification
85 Commands\Notification\GetNotificationsCommand::class => new Commands\Notification\GetNotificationsCommandHandler($c),
86 Commands\Notification\SendUndeliveredNotificationsCommand::class => new Commands\Notification\SendUndeliveredNotificationsCommandHandler($c),
87 Commands\Notification\SendTestEmailCommand::class => new Commands\Notification\SendTestEmailCommandHandler($c),
88 Commands\Notification\UpdateNotificationCommand::class => new Commands\Notification\UpdateNotificationCommandHandler($c),
89 Commands\Notification\UpdateNotificationStatusCommand::class => new Commands\Notification\UpdateNotificationStatusCommandHandler($c),
90 Commands\Notification\SendAmeliaSmsApiRequestCommand::class => new Commands\Notification\SendAmeliaSmsApiRequestCommandHandler($c),
91 Commands\Notification\UpdateSMSNotificationHistoryCommand::class => new Commands\Notification\UpdateSMSNotificationHistoryCommandHandler($c),
92 Commands\Notification\GetSMSNotificationsHistoryCommand::class => new Commands\Notification\GetSMSNotificationsHistoryCommandHandler($c),
93 // Payment
94 Commands\Payment\AddPaymentCommand::class => new Commands\Payment\AddPaymentCommandHandler($c),
95 Commands\Payment\DeletePaymentCommand::class => new Commands\Payment\DeletePaymentCommandHandler($c),
96 Commands\Payment\GetPaymentCommand::class => new Commands\Payment\GetPaymentCommandHandler($c),
97 Commands\Payment\GetPaymentsCommand::class => new Commands\Payment\GetPaymentsCommandHandler($c),
98 Commands\Payment\UpdatePaymentCommand::class => new Commands\Payment\UpdatePaymentCommandHandler($c),
99 Commands\Payment\CalculatePaymentAmountCommand::class => new Commands\Payment\CalculatePaymentAmountCommandHandler($c),
100 Commands\Square\SquarePaymentCommand::class => new Commands\Square\SquarePaymentCommandHandler($c),
101 Commands\Square\SquarePaymentNotifyCommand::class => new Commands\Square\SquarePaymentNotifyCommandHandler($c),
102 //Square
103 Commands\Square\DisconnectFromSquareAccountCommand::class => new Commands\Square\DisconnectFromSquareAccountCommandHandler($c),
104 Commands\Square\FetchAccessTokenSquareCommand::class => new Commands\Square\FetchAccessTokenSquareCommandHandler($c),
105 Commands\Square\GetSquareAuthURLCommand::class => new Commands\Square\GetSquareAuthURLCommandHandler($c),
106 Commands\Square\SquareRefundWebhookCommand::class => new Commands\Square\SquareRefundWebhookCommandHandler($c),
107 // Settings
108 Commands\Settings\GetSettingsCommand::class => new Commands\Settings\GetSettingsCommandHandler($c),
109 Commands\Settings\UpdateSettingsCommand::class => new Commands\Settings\UpdateSettingsCommandHandler($c),
110 // Status
111 Commands\Stats\AddStatsCommand::class => new Commands\Stats\AddStatsCommandHandler($c),
112 Commands\Stats\GetStatsCommand::class => new Commands\Stats\GetStatsCommandHandler($c),
113 // User/Customer
114 Commands\User\Customer\AddCustomerCommand::class => new Commands\User\Customer\AddCustomerCommandHandler($c),
115 Commands\User\Customer\GetCustomerCommand::class => new Commands\User\Customer\GetCustomerCommandHandler($c),
116 Commands\User\Customer\GetCustomersCommand::class => new Commands\User\Customer\GetCustomersCommandHandler($c),
117 Commands\User\Customer\UpdateCustomerCommand::class => new Commands\User\Customer\UpdateCustomerCommandHandler($c),
118 // User
119 Commands\User\DeleteUserCommand::class => new Commands\User\DeleteUserCommandHandler($c),
120 Commands\User\GetCurrentUserCommand::class => new Commands\User\GetCurrentUserCommandHandler($c),
121 Commands\User\GetUserDeleteEffectCommand::class => new Commands\User\GetUserDeleteEffectCommandHandler($c),
122 Commands\User\GetWPUsersCommand::class => new Commands\User\GetWPUsersCommandHandler($c),
123 // User/Provider
124 Commands\User\Provider\AddProviderCommand::class => new Commands\User\Provider\AddProviderCommandHandler($c),
125 Commands\User\Provider\UpdateProviderCommand::class => new Commands\User\Provider\UpdateProviderCommandHandler($c),
126 // What's new
127 Commands\WhatsNew\GetWhatsNewCommand::class => new Commands\WhatsNew\GetWhatsNewCommandHandler($c),
128 ];
129 }
130
131 /**
132 * @param App $app
133 * @param Container $container
134 */
135 public static function setRoutes(App $app, Container $container)
136 {
137 Routes\Booking\Booking::routes($app);
138
139 Routes\Booking\Appointment\Appointment::routes($app);
140
141 Routes\Booking\Event\Event::routes($app);
142
143 Routes\Bookable\Category::routes($app);
144
145 Routes\Entities\Entities::routes($app);
146
147 Routes\Stash\Stash::routes($app);
148
149 Routes\Notification\Notification::routes($app);
150
151 Routes\Payment\Payment::routes($app);
152
153 Routes\Square\Square::routes($app);
154
155 Routes\Import\Import::routes($app);
156
157 Routes\Bookable\Service::routes($app);
158
159 Routes\Settings\Settings::routes($app);
160
161 Routes\Stats\Stats::routes($app);
162
163 Routes\TimeSlots\TimeSlots::routes($app);
164
165 Routes\User\User::routes($app);
166
167 Routes\WhatsNew\WhatsNew::routes($app);
168
169 Routes\Test\Test::routes($app);
170 }
171
172 /**
173 * @return array
174 */
175 public static function getLiteMenuItem()
176 {
177 return [
178 'parentSlug' => 'amelia',
179 'pageTitle' => 'Lite vs Premium',
180 'menuTitle' => BackendStrings::getCommonStrings()['lite_vs_premium'],
181 'capability' => 'amelia_read_lite_vs_premium',
182 'menuSlug' => 'wpamelia-lite-vs-premium',
183 ];
184 }
185
186 /**
187 * @return array
188 */
189 public static function getEmployeesMenuItem()
190 {
191 return [];
192 }
193
194 /**
195 * @param Collection $providers
196 *
197 * @return Collection
198 * @throws InvalidArgumentException
199 */
200 public static function getEmployees($providers)
201 {
202 /** @var Collection $availableProviders */
203 $availableProviders = new Collection();
204
205 if ($providers->length()) {
206 $availableProviders->addItem($providers->getItem($providers->keys()[0]), $providers->keys()[0]);
207 }
208
209 return $availableProviders;
210 }
211
212 /**
213 * @return string
214 */
215 public static function getPaddleUrl()
216 {
217 return AMELIA_URL . 'public/js/paddle/paddle.js';
218 }
219 }
220