Booking package refactored
This commit is contained in:
parent
8c61634698
commit
dc5404c33d
|
|
@ -37,7 +37,15 @@ class Booking
|
|||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected $daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
||||
protected $daysOfWeek = [
|
||||
'Sunday',
|
||||
'Monday',
|
||||
'Tuesday',
|
||||
'Wednesday',
|
||||
'Thursday',
|
||||
'Friday',
|
||||
'Saturday',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new helper instance.
|
||||
|
|
@ -222,6 +230,7 @@ class Booking
|
|||
|
||||
foreach ($slots as $index => $slot) {
|
||||
$slots[$index]['from'] = Carbon::createFromTimeString($slot['from'])->format("h:i a");
|
||||
|
||||
$slots[$index]['to'] = Carbon::createFromTimeString($slot['to'])->format("h:i a");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class DefaultSlot extends Booking
|
|||
protected $daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
||||
|
||||
/**
|
||||
* Returns slots for a perticular day
|
||||
* Returns slots for a particular day
|
||||
*
|
||||
* @param \Webkul\BookingProduct\Contracts\BookingProduct $bookingProduct
|
||||
* @param string $date
|
||||
|
|
@ -52,7 +52,7 @@ class DefaultSlot extends Booking
|
|||
|
||||
return $bookingProductSlot->booking_type == 'one'
|
||||
? $this->getOneBookingForManyDaysSlots($bookingProductSlot, $requestedDate)
|
||||
: $this->getManyBookingsforOneDaySlots($bookingProductSlot, $requestedDate);
|
||||
: $this->getManyBookingsForOneDaySlots($bookingProductSlot, $requestedDate);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -98,7 +98,7 @@ class DefaultSlot extends Booking
|
|||
* @param string $requestedDate
|
||||
* @return array
|
||||
*/
|
||||
public function getManyBookingsforOneDaySlots($bookingProductSlot, $requestedDate)
|
||||
public function getManyBookingsForOneDaySlots($bookingProductSlot, $requestedDate)
|
||||
{
|
||||
$bookingProduct = $bookingProductSlot->booking_product;
|
||||
|
||||
|
|
|
|||
|
|
@ -187,7 +187,15 @@ class EventTicket extends Booking
|
|||
{
|
||||
return $ticket->special_price !== null
|
||||
&& $ticket->special_price > 0.0
|
||||
&& ($ticket->special_price_from === null || $ticket->special_price_from === '0000-00-00 00:00:00' || $ticket->special_price_from <= Carbon::now())
|
||||
&& ($ticket->special_price_to === null || $ticket->special_price_to === '0000-00-00 00:00:00' || $ticket->special_price_to > Carbon::now());
|
||||
&& (
|
||||
$ticket->special_price_from === null
|
||||
|| $ticket->special_price_from === '0000-00-00 00:00:00'
|
||||
|| $ticket->special_price_from <= Carbon::now()
|
||||
)
|
||||
&& (
|
||||
$ticket->special_price_to === null
|
||||
|| $ticket->special_price_to === '0000-00-00 00:00:00'
|
||||
|| $ticket->special_price_to > Carbon::now()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -21,11 +21,11 @@ class BookingProductController extends Controller
|
|||
* Create a new controller instance.
|
||||
*
|
||||
* @param \Webkul\BookingProduct\Repositories\BookingProductRepository $bookingProductRepository
|
||||
* @param \Webkul\BookingProduct\Helpers\DefaultSlot $defaultSlotHelper
|
||||
* @param \Webkul\BookingProduct\Helpers\AppointmentSlot $appointmentSlotHelper
|
||||
* @param \Webkul\BookingProduct\Helpers\RentalSlot $rentalSlotHelper
|
||||
* @param \Webkul\BookingProduct\Helpers\EventTicket $EventTicketHelper
|
||||
* @param \Webkul\BookingProduct\Helpers\TableSlot $tableSlotHelper
|
||||
* @param \Webkul\BookingProduct\Helpers\DefaultSlot $defaultSlotHelper
|
||||
* @param \Webkul\BookingProduct\Helpers\AppointmentSlot $appointmentSlotHelper
|
||||
* @param \Webkul\BookingProduct\Helpers\RentalSlot $rentalSlotHelper
|
||||
* @param \Webkul\BookingProduct\Helpers\EventTicket $EventTicketHelper
|
||||
* @param \Webkul\BookingProduct\Helpers\TableSlot $tableSlotHelper
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
|
|||
|
|
@ -19,9 +19,8 @@ class BookingProductEventTicketRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param \Webkul\BookingProduct\Contracts\BookingProduct $bookingProduct
|
||||
*
|
||||
* @param array $data
|
||||
* @param \Webkul\BookingProduct\Contracts\BookingProduct $bookingProduct
|
||||
* @return void
|
||||
* @throws \Prettus\Validator\Exceptions\ValidatorException
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -40,14 +40,14 @@ class Booking extends Virtual
|
|||
/**
|
||||
* Create a new product type instance.
|
||||
*
|
||||
* @param \Webkul\Attribute\Repositories\AttributeRepository $attributeRepository
|
||||
* @param \Webkul\Product\Repositories\ProductRepository $productRepository
|
||||
* @param \Webkul\Product\Repositories\ProductAttributeValueRepository $attributeValueRepository
|
||||
* @param \Webkul\Product\Repositories\ProductInventoryRepository $productInventoryRepository
|
||||
* @param \Webkul\Product\Repositories\ProductImageRepository $productImageRepository
|
||||
* @param \Webkul\Attribute\Repositories\AttributeRepository $attributeRepository
|
||||
* @param \Webkul\Product\Repositories\ProductRepository $productRepository
|
||||
* @param \Webkul\Product\Repositories\ProductAttributeValueRepository $attributeValueRepository
|
||||
* @param \Webkul\Product\Repositories\ProductInventoryRepository $productInventoryRepository
|
||||
* @param \Webkul\Product\Repositories\ProductImageRepository $productImageRepository
|
||||
* @param \Webkul\BookingProduct\Repositories\BookingProductRepository $bookingProductRepository
|
||||
* @param \Webkul\BookingProduct\Helpers\BookingHelper $bookingHelper
|
||||
* @param \Webkul\Product\Repositories\ProductVideoRepository $productVideoRepository
|
||||
* @param \Webkul\BookingProduct\Helpers\BookingHelper $bookingHelper
|
||||
* @param \Webkul\Product\Repositories\ProductVideoRepository $productVideoRepository
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
|
|||
Loading…
Reference in New Issue