Best Cosmetic Hospitals Near You

Compare top cosmetic hospitals, aesthetic clinics & beauty treatments by city.

Trusted • Verified • Best-in-Class Care

Explore Best Hospitals

Unified Booking Workflow

Here’s the combined workflow integrating the Booking State Transitions with Auto-Cancellation and the Payment Screenshot Submission and Vendor Confirmation process. This unified flow ensures seamless booking, payment handling, and state transitions with notifications for renters and vendors.


Unified Booking Workflow


Booking States

StateDescription
PendingBooking created but awaiting Partner confirmation.
Auto-CancelledBooking automatically cancelled due to Partner’s inaction within 1 hour.
ConfirmedPartner has confirmed the booking but awaiting payment verification.
Awaiting PaymentRenter has uploaded payment screenshot but awaiting Vendor confirmation.
PaidVendor has verified payment and confirmed it as paid.
Vehicle ReadyPartner has prepared the vehicle for pick-up/delivery.
In ProgressVehicle has been handed over to the Renter.
CompletedBooking successfully completed, and the vehicle is returned.
CancelledBooking cancelled manually by Renter or Partner.
RefundedBooking refunded after cancellation (if applicable).
Issue ReportedAn issue (damage, delay, etc.) has been flagged for resolution.

Workflow Steps

Step 1: Booking Creation

  • State: Pending
  • Trigger: Renter creates a booking.
  • Time Constraint: If Partner does not confirm within 1 hour, the booking transitions to Auto-Cancelled.

Step 2: Partner Confirmation

  • State: Confirmed
  • Trigger: Partner confirms the booking.
  • Time Constraint: If Renter does not pay or upload a payment screenshot within 1 hour, the booking transitions to Auto-Cancelled.

Step 3: Payment Proof Submission

  • State: Awaiting Payment
  • Trigger: Renter uploads payment screenshot.
  • Action: Booking transitions to Awaiting Payment, and the Vendor is notified.

Step 4: Payment Verification by Vendor

  • State: Paid
  • Trigger: Vendor confirms payment screenshot.
  • Next State:
    • Approved: Booking transitions to Paid.
    • Rejected: Booking transitions to Cancelled.

Step 5: Vehicle Preparation

  • State: Vehicle Ready
  • Trigger: Vendor prepares the vehicle for delivery/pick-up.
  • Next State: Booking progresses to Vehicle Ready.

Step 6: Vehicle Handover

  • State: In Progress
  • Trigger: Renter picks up the vehicle.
  • Action: Booking transitions to In Progress.

Step 7: Booking Completion

  • State: Completed
  • Trigger: Renter returns the vehicle.
  • Action: Booking transitions to Completed.

Auto-Cancellation Logic

Current StateTrigger/ActionNext StateTime ConstraintDescription
PendingSystem checks timeoutAuto-CancelledExceeds 1 hourBooking is auto-cancelled if not confirmed.
ConfirmedSystem checks timeoutAuto-CancelledExceeds 1 hourBooking is auto-cancelled if payment isn’t made or proof isn’t uploaded.

Notifications

Renter Notifications

  • UI, Email, SMS, WhatsApp:
    • Pending → Auto-Cancelled: “Your booking was cancelled because the Partner did not confirm within 1 hour.”
    • Confirmed → Auto-Cancelled: “Your booking was cancelled because payment was not completed on time.”
    • Awaiting Payment → Paid: “Your payment has been confirmed. The booking is now active.”

Vendor Notifications

  • UI, Email, SMS, WhatsApp:
    • Payment Proof Submitted: “A payment proof has been uploaded for your confirmation.”
    • Pending → Auto-Cancelled: “The booking request was cancelled as you did not confirm within 1 hour.”
    • Payment Verified: “You have successfully confirmed the payment.”

Database Structure

Additions to the bookings Table:

Schema::table('bookings', function (Blueprint $table) {
    $table->enum('status', ['Pending', 'Auto-Cancelled', 'Confirmed', 'Awaiting Payment', 'Paid', 'Vehicle Ready', 'In Progress', 'Completed', 'Cancelled', 'Refunded', 'Issue Reported'])->default('Pending');
    $table->timestamp('auto_cancel_at')->nullable();
});

Create payment_screenshots Table:

Schema::create('payment_screenshots', function (Blueprint $table) {
    $table->id();
    $table->unsignedBigInteger('booking_id');
    $table->unsignedBigInteger('user_id');
    $table->string('screenshot_path');
    $table->timestamps();
});

Backend Implementation

Payment Proof Submission

public function storePaymentProof(Request $request)
{
    $request->validate([
        'booking_id' => 'required|exists:bookings,id',
        'screenshot' => 'required|image|max:2048',
    ]);

    $screenshotPath = $request->file('screenshot')->store('payment_screenshots', 'public');

    PaymentScreenshot::create([
        'booking_id' => $request->booking_id,
        'user_id' => Auth::id(),
        'screenshot_path' => $screenshotPath,
    ]);

    $booking = Booking::find($request->booking_id);
    $booking->update(['status' => 'Awaiting Payment']);

    $booking->vendor->notify(new PaymentScreenshotSubmittedNotification($booking));

    return redirect()->back()->with('success', 'Payment proof submitted successfully.');
}

Auto-Cancellation Job

namespace App\Jobs;

use App\Models\Booking;

class AutoCancelBookings extends Job
{
    public function handle()
    {
        $now = now();
        $bookings = Booking::whereIn('status', ['Pending', 'Confirmed'])
            ->where('auto_cancel_at', '<=', $now)
            ->get();

        foreach ($bookings as $booking) {
            if ($booking->status === 'Pending') {
                $booking->update(['status' => 'Auto-Cancelled']);
                $booking->renter->notify(new BookingAutoCancelledNotification($booking));
                $booking->vendor->notify(new BookingAutoCancelledNotification($booking));
            } elseif ($booking->status === 'Confirmed' && $booking->payment_status !== 'Paid') {
                $booking->update(['status' => 'Auto-Cancelled']);
                $booking->renter->notify(new BookingAutoCancelledNotification($booking));
                $booking->vendor->notify(new BookingAutoCancelledNotification($booking));
            }
        }
    }
}

Vendor Payment Verification

public function verifyPayment(Request $request, Booking $booking)
{
    $request->validate(['action' => 'required|in:approve,reject']);

    if ($request->action === 'approve') {
        $booking->update(['status' => 'Paid']);
        $booking->renter->notify(new PaymentApprovedNotification($booking));
    } elseif ($request->action === 'reject') {
        $booking->update(['status' => 'Cancelled']);
        $booking->renter->notify(new PaymentRejectedNotification($booking));
    }

    return redirect()->back()->with('success', 'Payment verification processed.');
}

Frontend Implementation

Renter Payment Proof Submission

<form method="POST" action="{{ route('payment.screenshot.store') }}" enctype="multipart/form-data">
    @csrf
    <input type="hidden" name="booking_id" value="{{ $booking->id }}">
    <input type="file" name="screenshot" required>
    <button type="submit">Submit Payment Proof</button>
</form>

Vendor Payment Review

<table>
    <thead>
        <tr>
            <th>Booking ID</th>
            <th>Screenshot</th>
            <th>Action</th>
        </tr>
    </thead>
    <tbody>
        @foreach($bookings as $booking)
            <tr>
                <td>{{ $booking->id }}</td>
                <td><a href="{{ asset('storage/' . $booking->paymentScreenshot->screenshot_path) }}" target="_blank">View Screenshot</a></td>
                <td>
                    <form method="POST" action="{{ route('payment.verify', $booking->id) }}">
                        @csrf
                        @method('PUT')
                        <button name="action" value="approve">Approve</button>
                        <button name="action" value="reject">Reject</button>
                    </form>
                </td>
            </tr>
        @endforeach
    </tbody>
</table>

This workflow provides a robust system for managing bookings, handling payments, and ensuring automated and manual transitions. Notifications across UI, email, SMS, and WhatsApp keep all parties informed.

Best Cardiac Hospitals Near You

Discover top heart hospitals, cardiology centers & cardiac care services by city.

Advanced Heart Care • Trusted Hospitals • Expert Teams

View Best Hospitals
<p data-start="140" data-end="435">I’m Abhishek, a DevOps, SRE, DevSecOps, and Cloud expert with a passion for sharing knowledge and real-world experiences. I’ve had the opportunity to work with <a class="decorated-link" href="https://www.cotocus.com/" target="_new" rel="noopener" data-start="300" data-end="335">Cotocus</a> and continue to contribute to multiple platforms where I share insights across different domains:</p> <ul data-start="437" data-end="922"> <li data-start="437" data-end="514"> <p data-start="439" data-end="514"><a class="decorated-link" href="https://www.devopsschool.com/" target="_new" rel="noopener" data-start="439" data-end="485">DevOps School</a> – Tech blogs and tutorials</p> </li> <li data-start="515" data-end="599"> <p data-start="517" data-end="599"><a class="decorated-link" href="https://www.holidaylandmark.com/" target="_new" rel="noopener" data-start="517" data-end="569">Holiday Landmark</a> – Travel stories and guides</p> </li> <li data-start="600" data-end="684"> <p data-start="602" data-end="684"><a class="decorated-link" href="https://www.stocksmantra.in/" target="_new" rel="noopener" data-start="602" data-end="647">Stocks Mantra</a> – Stock market strategies and tips</p> </li> <li data-start="685" data-end="764"> <p data-start="687" data-end="764"><a class="decorated-link" href="https://www.mymedicplus.com/" target="_new" rel="noopener" data-start="687" data-end="732">My Medic Plus</a> – Health and fitness guidance</p> </li> <li data-start="765" data-end="841"> <p data-start="767" data-end="841"><a class="decorated-link" href="https://www.truereviewnow.com/" target="_new" rel="noopener" data-start="767" data-end="814">TrueReviewNow</a> – Honest product reviews</p> </li> <li data-start="842" data-end="922"> <p data-start="844" data-end="922"><a class="decorated-link" href="https://www.wizbrand.com/" target="_new" rel="noopener" data-start="844" data-end="881">Wizbrand</a> – SEO and digital tools for businesses</p> </li> </ul> <p data-start="924" data-end="1021">I’m also exploring the fascinating world of <a class="decorated-link" href="https://www.quantumuting.com/" target="_new" rel="noopener" data-start="968" data-end="1018">Quantum Computing</a>.</p>

Related Posts

Bridging Dev and Ops With Consulting Best Practices

Introduction Picture a mid-sized software engineering organization. The development team has spent the last three months building a new customer-facing analytics service. The code is polished, the…

Read More

Discovering Your Community: The Everyday Guide to Sourcing Nearby Goods and Services

Households constantly look for merchandise and professional assistance right in their immediate districts. While global shipping networks frequently command widespread attention, countless individuals still appreciate the instant…

Read More

Finding Clarity in Cancer Care: A Practical Guide for Patients and Families

Receiving a malignant diagnosis instantly disrupts a family’s normal rhythm, bringing immense emotional pressure right alongside urgent healthcare choices. Because contemporary oncology depends heavily on specialized clinical…

Read More

Choosing the Right Care Center: A Practical Approach to Neurosurgical Treatment and Hospital Selection

Facing a medical condition or a recommended treatment involving the brain, spine, or central nervous system can be a profound turning point. Because procedures targeting delicate neural…

Read More

The Kitchen Table Archive: Recovering Family Recipes and Culinary Roots

Cooking has always served as an unspoken chronicle of human life. Every meal carries an invisible narrative, linking us to previous eras through familiar aromas and grounding…

Read More

How DevOps Consulting Enhances Customer Experience

A customer adds items to a shopping cart, proceeds to checkout, and clicks submit. The screen freezes, spins for twenty seconds, and returns a blank page or…

Read More
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x