Booking cancellation and rescheduling on website

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1214
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    852
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    823
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    815

Booking Cancellation and Rescheduling

Ability to self-cancel or reschedule appointment reduces admin load and improves customer experience. Key task is correct logic: cancellations N hours before allowed, last-minute cancellations — not allowed or with penalty.

Cancellation Rules

class BookingCancellationPolicy
{
    public function canCancel(Booking $booking): CancellationResult
    {
        $hoursUntilBooking = now()->diffInHours($booking->starts_at, absolute: false);

        if ($hoursUntilBooking < 0) {
            return CancellationResult::denied('Booking already passed');
        }

        $policy = $booking->service->cancellation_policy;

        if ($hoursUntilBooking < $policy->free_cancel_hours) {
            return CancellationResult::withPenalty(
                "Cancellation less than {$policy->free_cancel_hours} hours: " .
                "penalty {$policy->penalty_percent}%",
                penaltyPercent: $policy->penalty_percent
            );
        }

        return CancellationResult::free();
    }
}

Token Links for Cancellation Without Authorization

Customer can cancel booking via email link without account login:

class Booking extends Model
{
    protected static function booted(): void
    {
        static::creating(function (Booking $booking) {
            $booking->cancel_token    = Str::random(64);
            $booking->reschedule_token = Str::random(64);
        });
    }
}

// Cancellation route
Route::get('/bookings/cancel/{token}', function (string $token) {
    $booking = Booking::where('cancel_token', $token)
                      ->where('status', 'confirmed')
                      ->firstOrFail();

    $policy = app(BookingCancellationPolicy::class)->canCancel($booking);

    return Inertia::render('Booking/Cancel', [
        'booking' => $booking->load('service'),
        'policy'  => $policy,
    ]);
});

Rescheduling Form

When rescheduling, full new date/time selection opens (same AvailabilityCalendar component), but old slot freed only after new confirmation:

public function reschedule(Request $request, string $token): JsonResponse
{
    $booking = Booking::where('reschedule_token', $token)->firstOrFail();

    DB::transaction(function () use ($booking, $request) {
        $newSlot = TimeSlot::findOrFail($request->new_slot_id);

        // Check new slot availability
        if (!$newSlot->available) {
            throw new SlotUnavailableException();
        }

        // Free old slot
        TimeSlot::where('booking_id', $booking->id)->update(['booking_id' => null]);

        // Book new slot
        $newSlot->update(['booking_id' => $booking->id]);
        $booking->update([
            'starts_at' => $newSlot->datetime,
            'status'    => 'rescheduled',
        ]);
    });

    // Send reschedule confirmation
    Mail::to($booking->customer_email)->send(new BookingRescheduledMail($booking));

    return response()->json(['success' => true]);
}

Timeframe

Booking cancellation and rescheduling with policies and token links: 3–5 working days.