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

The Complete Roadmap to Becoming a Certified MLOps Manager: Skills, Tracks, and Real-World Impact

Introduction The transition from traditional software development to machine learning requires a robust operational framework that ensures reliability and scalability. A Certified MLOps Manager plays a pivotal…

Read More

Certified MLOps Architect: A Step-by-Step Guide for Engineering Professionals

Introduction The Certified MLOps Architect is a comprehensive professional program designed to bridge the gap between data science experimentation and production-grade software engineering. This guide is crafted…

Read More

Mastering Production AI: The Complete Guide to the Certified MLOps Professional

Introduction The transition from experimental data science to production-grade machine learning is one of the most significant challenges facing modern enterprises. While building a model in a…

Read More

Mastering the Certified MLOps Engineer Path: A Comprehensive Career Roadmap

The transition from experimental machine learning models to scalable, production-grade systems is currently the most significant challenge in the technology landscape. As organizations move beyond the initial…

Read More

Certified AIOps Professional Roadmap: A Guide to the Certified AIOps Professional

The transition from traditional IT operations to AI-driven environments is no longer a choice but a necessity for modern enterprises. This guide focuses on the Certified AIOps…

Read More

Top 10 Federated Learning Platforms: Features, Pros, Cons & Comparison

Introduction Federated Learning (FL) represents a paradigm shift in how machine learning models are trained, moving away from centralized data silos toward a distributed approach. In a…

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