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