Repository: Learnathon-By-Geeky-Solutions/byte-breeze
Pull request #252: Feat/main sd 13 rider accept parcel delivery request
Author: login: KhairulBasharbd
Labels: name: feature
name: Pull Request
description: Pull request
Created: 2025-03-29T17:21:39Z | Merged: 2025-03-29T17:37:47Z



Diff:
diff --git a/src/main/java/com/bytebreeze/quickdrop/controller/RiderController.java b/src/main/java/com/bytebreeze/quickdrop/controller/RiderController.java
index 8acdc33..5ed24e8 100644
--- a/src/main/java/com/bytebreeze/quickdrop/controller/RiderController.java
+++ b/src/main/java/com/bytebreeze/quickdrop/controller/RiderController.java
@@ -3,6 +3,7 @@
 import com.bytebreeze.quickdrop.dto.RiderOnboardingDTO;
 import com.bytebreeze.quickdrop.dto.RiderRegistrationRequestDTO;
 import com.bytebreeze.quickdrop.dto.response.RiderViewCurrentParcelsResponseDTO;
+import com.bytebreeze.quickdrop.model.Parcel;
 import com.bytebreeze.quickdrop.model.Rider;
 import com.bytebreeze.quickdrop.service.RiderService;
 import jakarta.validation.Valid;
@@ -10,12 +11,14 @@
 import java.util.UUID;
 import java.util.stream.Collectors;
 import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
+@Slf4j
 @Controller
 @RequestMapping("/rider")
 @RequiredArgsConstructor
@@ -144,13 +147,45 @@ public String updateStatus(@RequestParam Boolean status) {
 		return "redirect:/rider/dashboard";
 	}
 
-	@GetMapping("/available-parcels")
+	@GetMapping("/current-parcels")
 	public String showCurrentParcelsRequest(Model model) {
 
-		List<RiderViewCurrentParcelsResponseDTO> currentParcels = riderService.CurrentParcelsForRider();
+		Rider rider = riderService.getAuthenticatedRider();
+		if (rider.getIsAssigned()) {
 
-		model.addAttribute("parcels", currentParcels);
+			try {
 
-		return "rider/view-current-parcels";
+				List<Parcel> parcels = riderService.getAssignedParcelByRider(rider);
+				if (parcels != null) {
+					// log.info("Get assigned parcel by rider: {}", parcels.getCategory());
+					model.addAttribute("parcels", parcels);
+				} else {
+					model.addAttribute("error", "No parcel assigned despite rider being marked as assigned");
+				}
+
+			} catch (Exception e) {
+				model.addAttribute("error", "Failed to load parcel : " + e.getMessage());
+			}
+			return "rider/view-assigned-parcels";
+		} else {
+
+			List<RiderViewCurrentParcelsResponseDTO> currentParcels = riderService.CurrentParcelsForRider();
+			model.addAttribute("parcels", currentParcels);
+
+			return "rider/view-current-parcels";
+		}
+	}
+
+	@PostMapping("/Accept/{parcelId}")
+	public String acceptParcel(@PathVariable UUID parcelId, RedirectAttributes redirectAttributes) {
+
+		try {
+			riderService.acceptParcelDelivery(parcelId);
+			redirectAttributes.addFlashAttribute("success", "Parcel accepted successfully!");
+		} catch (Exception e) {
+			redirectAttributes.addFlashAttribute("error", "Failed to accept parcel: " + e.getMessage());
+		}
+
+		return "redirect:/rider/current-parcels";
 	}
 }
diff --git a/src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelAlreadyAssignedException.java b/src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelAlreadyAssignedException.java
index 8b13789..2578dbe 100644
--- a/src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelAlreadyAssignedException.java
+++ b/src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelAlreadyAssignedException.java
@@ -1 +1,11 @@
+package com.bytebreeze.quickdrop.exception.custom;
 
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.ResponseStatus;
+
+@ResponseStatus(value = HttpStatus.NOT_ACCEPTABLE)
+public class ParcelAlreadyAssignedException extends RuntimeException {
+	public ParcelAlreadyAssignedException(String message) {
+		super(message);
+	}
+}
diff --git a/src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelNotFoundException.java b/src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelNotFoundException.java
index 8b13789..1436a07 100644
--- a/src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelNotFoundException.java
+++ b/src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelNotFoundException.java
@@ -1 +1,12 @@
+package com.bytebreeze.quickdrop.exception.custom;
 
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.ResponseStatus;
+
+@ResponseStatus(value = HttpStatus.NOT_FOUND)
+public class ParcelNotFoundException extends RuntimeException {
+
+	public ParcelNotFoundException(String message) {
+		super(message);
+	}
+}
diff --git a/src/main/java/com/bytebreeze/quickdrop/repository/ParcelRepository.java b/src/main/java/com/bytebreeze/quickdrop/repository/ParcelRepository.java
index ba34635..e16077e 100644
--- a/src/main/java/com/bytebreeze/quickdrop/repository/ParcelRepository.java
+++ b/src/main/java/com/bytebreeze/quickdrop/repository/ParcelRepository.java
@@ -2,6 +2,7 @@
 
 import com.bytebreeze.quickdrop.enums.ParcelStatus;
 import com.bytebreeze.quickdrop.model.Parcel;
+import com.bytebreeze.quickdrop.model.User;
 import java.util.List;
 import java.util.UUID;
 import org.springframework.data.jpa.repository.JpaRepository;
@@ -19,4 +20,6 @@ public interface ParcelRepository extends JpaRepository<Parcel, UUID> {
 	List<Parcel> getAllBySender(UUID senderId);
 
 	List<Parcel> findByStatusAndRiderIsNull(ParcelStatus status);
+
+	List<Parcel> findByStatusAndRider(ParcelStatus status, User rider);
 }
diff --git a/src/main/java/com/bytebreeze/quickdrop/service/RiderService.java b/src/main/java/com/bytebreeze/quickdrop/service/RiderService.java
index 87cebdb..2f8c378 100644
--- a/src/main/java/com/bytebreeze/quickdrop/service/RiderService.java
+++ b/src/main/java/com/bytebreeze/quickdrop/service/RiderService.java
@@ -10,6 +10,8 @@
 import com.bytebreeze.quickdrop.enums.Role;
 import com.bytebreeze.quickdrop.enums.VerificationStatus;
 import com.bytebreeze.quickdrop.exception.custom.AlreadyExistsException;
+import com.bytebreeze.quickdrop.exception.custom.ParcelAlreadyAssignedException;
+import com.bytebreeze.quickdrop.exception.custom.ParcelNotFoundException;
 import com.bytebreeze.quickdrop.exception.custom.UserNotFoundException;
 import com.bytebreeze.quickdrop.mapper.RegisterRiderMapper;
 import com.bytebreeze.quickdrop.model.Parcel;
@@ -18,6 +20,8 @@
 import com.bytebreeze.quickdrop.repository.RiderRepository;
 import com.bytebreeze.quickdrop.repository.UserRepository;
 import com.bytebreeze.quickdrop.util.AuthUtil;
+import jakarta.transaction.Transactional;
+import java.time.LocalDateTime;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
@@ -191,6 +195,40 @@ public List<RiderViewCurrentParcelsResponseDTO> CurrentParcelsForRider() {
 				.collect(Collectors.toList());
 	}
 
+	@Transactional
+	public void acceptParcelDelivery(UUID parcelId) {
+
+		Rider rider = getAuthenticatedRider();
+		Parcel parcel = parcelRepository
+				.findById(parcelId)
+				.orElseThrow(() -> new ParcelNotFoundException("Parcel not found with ID: " + parcelId));
+
+		if (parcel.getRider() != null) {
+			throw new AlreadyExistsException("Parcel already assigned to another rider");
+		}
+
+		if (rider.getIsAssigned()) {
+			throw new ParcelAlreadyAssignedException("You have already assigned to a parcel");
+		}
+		rider.setIsAssigned(true);
+
+		parcel.setRider(rider);
+		parcel.setStatus(ParcelStatus.ASSIGNED);
+		parcel.setAssignedAt(LocalDateTime.now());
+		parcelRepository.save(parcel);
+	}
+
+	public List<Parcel> getAssignedParcelByRider(Rider rider) {
+
+		List<Parcel> parcels = parcelRepository.findByStatusAndRider(ParcelStatus.ASSIGNED, rider);
+
+		log.info(
+				"Found {} available assigned parcels with status: Assigned and rider email {}",
+				parcels.size(),
+				rider.getEmail());
+		return parcels;
+	}
+
 	public RiderDetailsResponseDto getRiderDetails(UUID riderId) {
 		Rider rider = riderRepository.findById(riderId).orElseThrow(() -> new UserNotFoundException("Rider not found"));
 		return mapToDto(rider);
diff --git a/src/main/resources/db/migration/V5__Add_isAssigned_to_Rider.sql b/src/main/resources/db/migration/V5__Add_isAssigned_to_Rider.sql
new file mode 100644
index 0000000..055178b
--- /dev/null
+++ b/src/main/resources/db/migration/V5__Add_isAssigned_to_Rider.sql
@@ -0,0 +1 @@
+ALTER TABLE riders ADD COLUMN is_assigned BOOLEAN DEFAULT FALSE;
diff --git a/src/main/resources/templates/fragments/sidebar-rider.html b/src/main/resources/templates/fragments/sidebar-rider.html
index 96effee..d61729b 100644
--- a/src/main/resources/templates/fragments/sidebar-rider.html
+++ b/src/main/resources/templates/fragments/sidebar-rider.html
@@ -11,8 +11,8 @@ <h2 class="text-xl font-semibold text-gray-700 dark:text-gray-200">Dashboard</h2
             </li>
 
             <li>
-                <a th:href="@{/rider/available-parcels}" class="block px-6 py-3 text-gray-600 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded">
-                    Current Parcel Request
+                <a th:href="@{/rider/current-parcels}" class="block px-6 py-3 text-gray-600 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded">
+                    Current Parcels
                 </a>
             </li>
 
diff --git a/src/main/resources/templates/rider/view-assigned-parcels.html b/src/main/resources/templates/rider/view-assigned-parcels.html
new file mode 100644
index 0000000..b862e84
--- /dev/null
+++ b/src/main/resources/templates/rider/view-assigned-parcels.html
@@ -0,0 +1,112 @@
+<!DOCTYPE html>
+<html lang="en" xmlns:th="http://www.thymeleaf.org">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="_csrf" th:content="${_csrf.token}"/>
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Rider Dashboard - Assigned Parcel</title>
+    <script src="https://cdn.tailwindcss.com"></script>
+    <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
+</head>
+
+<body class="bg-gray-50 min-h-screen flex">
+<div th:replace="~{fragments/sidebar-rider.html}"></div>
+
+<div class="flex-1 flex flex-col">
+    <div th:replace="~{fragments/navbar-rider.html}"></div>
+
+    <!-- Main content -->
+    <main class="flex-1 p-6">
+        <!-- Messages -->
+        <div th:if="${success}" class="mb-4 p-2 bg-green-100 text-green-700 rounded">
+            <span th:text="${success}"></span>
+        </div>
+        <div th:if="${error}" class="mb-4 p-2 bg-red-100 text-red-700 rounded">
+            <span th:text="${error}"></span>
+        </div>
+
+
+
+
+        <!-- Page Header -->
+        <div class="flex justify-between items-center mb-6">
+            <h1 class="text-2xl font-bold text-gray-800">Assigned Parcels</h1>
+            <p class="text-sm text-gray-600" th:text="'Showing ' + ${parcels.size()} + ' available parcels'"></p>
+        </div>
+
+        <!-- Empty State -->
+        <div th:if="${parcels.isEmpty()}" class="bg-white rounded-lg shadow p-8 text-center">
+            <svg xmlns="http://www.w3.org/2000/svg" class="h-16 w-16 mx-auto text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4" />
+            </svg>
+            <h3 class="mt-4 text-lg font-medium text-gray-900">No Assigned parcels available</h3>
+            <p class="mt-1 text-sm text-gray-500">There are currently no parcels assigned to you.</p>
+        </div>
+
+        <!-- Parcel Cards Grid -->
+        <div th:unless="${parcels.isEmpty()}" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
+            <!-- Parcel Card -->
+            <div th:each="parcel : ${parcels}" class="bg-white rounded-lg shadow-md overflow-hidden border border-gray-100 hover:shadow-lg transition-shadow duration-300">
+                <!-- Card Header -->
+                <div class="bg-blue-600 px-4 py-3">
+                    <h3 class="text-lg font-semibold text-white">
+                        Tracking #<span th:text="${parcel.trackingId}"></span>
+                    </h3>
+                </div>
+
+                <!-- Card Body -->
+                <div class="p-4">
+                    <!-- Pickup Info -->
+                    <div class="mb-4">
+                        <h4 class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Pickup Location</h4>
+                        <p class="mt-1 text-sm text-gray-700">
+                            <span th:text="${parcel.pickupUpazila}"></span>,
+                            <span th:text="${parcel.pickupDistrict}"></span>
+                        </p>
+                        <p class="text-xs text-gray-500" th:text="${parcel.pickupVillage}"></p>
+                    </div>
+
+                    <!-- Delivery Info -->
+                    <div class="mb-4">
+                        <h4 class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Delivery Location</h4>
+                        <p class="mt-1 text-sm text-gray-700">
+                            <span th:text="${parcel.receiverUpazila}"></span>,
+                            <span th:text="${parcel.receiverDistrict}"></span>
+                        </p>
+                        <p class="text-xs text-gray-500" th:text="${parcel.receiverVillage}"></p>
+                    </div>
+
+                    <!-- Price -->
+                    <div class="flex items-center justify-between border-t pt-3">
+                        <span class="text-sm font-medium text-gray-500">Your Earnings</span>
+                        <span class="text-lg font-bold text-blue-600" th:text="'$' + ${parcel.price}"></span>
+                    </div>
+                </div>
+
+
+                <div class="max-w-md mx-auto bg-white p-6 rounded-lg shadow-md">
+                    <h1 class="text-2xl font-bold mb-4">Update Parcel Status</h1>
+                    <form th:action="@{parcels/{id}/update-status(id=${parcel.id})}" method="post">
+                        <div class="mb-4">
+                            <label for="status" class="block text-gray-700 font-medium mb-2">Parcel Status</label>
+                            <select id="status" name="status" class="w-full p-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
+                                <option value="PICKED_UP" th:selected="${parcel.status == 'PICKED_UP'}">PICKED_UP</option>
+                                <option value="IN_TRANSIT" th:selected="${parcel.status == 'IN_TRANSIT'}">IN_TRANSIT</option>
+                                <option value="DELIVERED" th:selected="${parcel.status == 'DELIVERED'}">DELIVERED</option>
+                                <option value="POSTPONED" th:selected="${parcel.status == 'POSTPONED'}">POSTPONED</option>
+                            </select>
+                        </div>
+                        <button type="submit" class="w-full bg-blue-500 text-white p-2 rounded-md hover:bg-blue-600">Update Status</button>
+                    </form>
+                </div>
+
+            </div>
+        </div>
+
+
+
+    </main>
+</div>
+</body>
+</html>
\ No newline at end of file
diff --git a/src/main/resources/templates/rider/view-current-parcels.html b/src/main/resources/templates/rider/view-current-parcels.html
index 7a098a7..a5e3011 100644
--- a/src/main/resources/templates/rider/view-current-parcels.html
+++ b/src/main/resources/templates/rider/view-current-parcels.html
@@ -20,8 +20,8 @@
     <main class="flex-1 p-6">
 
         <!-- Messages -->
-        <div th:if="${message}" class="mb-4 p-2 bg-green-100 text-green-700 rounded">
-            <span th:text="${message}"></span>
+        <div th:if="${success}" class="mb-4 p-2 bg-green-100 text-green-700 rounded">
+            <span th:text="${success}"></span>
         </div>
         <div th:if="${error}" class="mb-4 p-2 bg-red-100 text-red-700 rounded">
             <span th:text="${error}"></span>


Reviews:
user: login: coderabbitai[bot]
body: **Actionable comments posted: 12**

<details>
<summary>🔭 Outside diff range comments (2)</summary><blockquote>

<details>
<summary>src/main/resources/templates/rider/view-current-parcels.html (1)</summary><blockquote>

`87-92`: _🧹 Nitpick (assertive)_

**VERIFY CORRECT CAPITALIZATION IN ENDPOINT URL.**

INCONSISTENT CAPITALIZATION DETECTED IN FORM ACTION URL: `/rider/Accept/${parcelId}`

RECOMMENDATION: MODIFY URL TO LOWERCASE FORMAT FOR CONSISTENCY WITH REST CONVENTIONS.


```diff
<div class="bg-gray-50 px-4 py-3 text-right">
    <button th:data-id="${parcel.id}"
            class="accept-btn px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors duration-200">
        Accept Delivery
    </button>
</div>
```

CORRESPONDING JAVASCRIPT MODIFICATION NEEDED AT LINE 117:
```diff
- form.action = `/rider/Accept/${parcelId}`;
+ form.action = `/rider/accept/${parcelId}`;
```

</blockquote></details>
<details>
<summary>src/main/java/com/bytebreeze/quickdrop/controller/RiderController.java (1)</summary><blockquote>

`1-1`: _💡 Verification agent_

<details>
<summary>❓ Verification inconclusive</summary>

**BEEP BOOP. Formatting issues spotted.**  
Please address the Spotless formatting errors to pass the pipeline. Run your build tool’s Spotless fix command (e.g., `./gradlew spotlessApply` or `mvn spotless:apply`) locally.

---

🏁 Script executed:

```shell
#!/bin/bash
# Attempt automatic Spotless formatting fix
./gradlew spotlessApply
```

Length of output: 125

---



</details>

**BEEP BOOP. Attention Required: Gradle Executable Permission Issue Detected.**  
It appears that the automatic Spotless formatting fix did not run because the `gradlew` file lacks execute permissions. Please update the file permissions (e.g., using `chmod +x gradlew`) and then re-run the Spotless fix command (`./gradlew spotlessApply`) locally to resolve the formatting issues.

- **Action Needed:**  
  - Update the `gradlew` file to be executable.
  - Re-run the formatting fix command and verify Spotless passes successfully.

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 GitHub Actions: Spotless Check</summary>

[error] 1-1: Spotless formatting check failed. The following files had format violations: src/main/java/com/bytebreeze/quickdrop/controller/RiderController.java.

</details>

</details>

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: ASSERTIVE**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 3007d9ad44a0ad6872ce7fcd7ef39d42f8c9f9ca and eb52fdcbae06c3bb26aef5f641fa4715b14fd22f.

</details>

<details>
<summary>📒 Files selected for processing (9)</summary>

* `src/main/java/com/bytebreeze/quickdrop/controller/RiderController.java` (1 hunks)
* `src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelAlreadyAssignedException.java` (1 hunks)
* `src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelNotFoundException.java` (1 hunks)
* `src/main/java/com/bytebreeze/quickdrop/repository/ParcelRepository.java` (2 hunks)
* `src/main/java/com/bytebreeze/quickdrop/service/RiderService.java` (3 hunks)
* `src/main/resources/db/migration/V5__Add_isAssigned_to_Rider.sql` (1 hunks)
* `src/main/resources/templates/fragments/sidebar-rider.html` (1 hunks)
* `src/main/resources/templates/rider/view-assigned-parcels.html` (1 hunks)
* `src/main/resources/templates/rider/view-current-parcels.html` (1 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧬 Code Definitions (3)</summary>

<details>
<summary>src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelNotFoundException.java (1)</summary><blockquote>

<details>
<summary>src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelAlreadyAssignedException.java (1)</summary>

* `ResponseStatus` (7-12)

</details>

</blockquote></details>
<details>
<summary>src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelAlreadyAssignedException.java (1)</summary><blockquote>

<details>
<summary>src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelNotFoundException.java (1)</summary>

* `ResponseStatus` (8-16)

</details>

</blockquote></details>
<details>
<summary>src/main/java/com/bytebreeze/quickdrop/controller/RiderController.java (1)</summary><blockquote>

<details>
<summary>src/main/java/com/bytebreeze/quickdrop/service/RiderService.java (1)</summary>

* `RequiredArgsConstructor` (37-231)

</details>

</blockquote></details>

</details><details>
<summary>🪛 GitHub Actions: Spotless Check</summary>

<details>
<summary>src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelNotFoundException.java</summary>

[error] 1-1: Spotless formatting check failed. Violations also present in: src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelNotFoundException.java.

</details>
<details>
<summary>src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelAlreadyAssignedException.java</summary>

[error] 1-1: Spotless formatting check failed. Violations also present in: src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelAlreadyAssignedException.java.

</details>
<details>
<summary>src/main/java/com/bytebreeze/quickdrop/repository/ParcelRepository.java</summary>

[error] 1-1: Spotless formatting check failed. Violations also present in: src/main/java/com/bytebreeze/quickdrop/repository/ParcelRepository.java.

</details>
<details>
<summary>src/main/java/com/bytebreeze/quickdrop/controller/RiderController.java</summary>

[error] 1-1: Spotless formatting check failed. The following files had format violations: src/main/java/com/bytebreeze/quickdrop/controller/RiderController.java.

</details>
<details>
<summary>src/main/java/com/bytebreeze/quickdrop/service/RiderService.java</summary>

[error] 1-1: Spotless formatting check failed. Violations also present in: src/main/java/com/bytebreeze/quickdrop/service/RiderService.java.

</details>

</details>

</details>

<details>
<summary>🔇 Additional comments (19)</summary><blockquote>

<details>
<summary>src/main/resources/db/migration/V5__Add_isAssigned_to_Rider.sql (1)</summary>

`1-1`: **SCHEMA CHANGE DETECTED. PROCESSING ANALYSIS.**

ADDITION OF BOOLEAN COLUMN `is_assigned` TO `riders` TABLE WITH DEFAULT VALUE: FALSE. THIS MODIFICATION SUPPORTS TRACKING RIDER ASSIGNMENT STATUS.

QUERY SYNTAX: CORRECT.
COLUMN NAMING: FOLLOWS SNAKE_CASE CONVENTION.
DEFAULT VALUE: APPROPRIATE FOR INITIALIZATION.

</details>
<details>
<summary>src/main/resources/templates/fragments/sidebar-rider.html (1)</summary>

`14-15`: **NAVIGATION ENDPOINT MODIFIED. ANALYZING CHANGES.**

PREVIOUS CONFIGURATION: LINK TO "/rider/available-parcels" WITH TEXT "Current Parcel Request"
UPDATED CONFIGURATION: LINK TO "/rider/current-parcels" WITH TEXT "Current Parcels"

MODIFICATION ALIGNS WITH FEATURE IMPLEMENTATION FOR VIEWING ASSIGNED PARCELS.

</details>
<details>
<summary>src/main/resources/templates/rider/view-current-parcels.html (1)</summary>

`23-24`: **MESSAGE VARIABLE REFERENCE UPDATED.**

PREVIOUS IMPLEMENTATION: UTILIZED ${message} VARIABLE FOR SUCCESS NOTIFICATIONS.
CURRENT IMPLEMENTATION: UTILIZES ${success} VARIABLE FOR SUCCESS NOTIFICATIONS.

MODIFICATION ESTABLISHES CONSISTENT MESSAGING PATTERN ACROSS APPLICATION.

</details>
<details>
<summary>src/main/java/com/bytebreeze/quickdrop/repository/ParcelRepository.java (1)</summary>

`27-27`: **IMPLEMENTATION APPROVED: QUERY METHOD ADDITION IS LOGICAL.**

NEW REPOSITORY METHOD FOLLOWS SPRING DATA JPA NAMING CONVENTIONS AND SERVES CLEAR PURPOSE FOR RETRIEVING RIDER-ASSIGNED PARCELS.

</details>
<details>
<summary>src/main/resources/templates/rider/view-assigned-parcels.html (1)</summary>

`14-109`: **WELL-STRUCTURED UI IMPLEMENTATION.**

PAGE LAYOUT FOLLOWS LOGICAL STRUCTURE WITH APPROPRIATE EMPTY STATE HANDLING, RESPONSIVE GRID DESIGN, AND CARD-BASED PRESENTATION. INTEGRATION WITH FRAGMENTS FOR SIDEBAR AND NAVBAR PROMOTES CODE REUSE.

</details>
<details>
<summary>src/main/java/com/bytebreeze/quickdrop/service/RiderService.java (2)</summary>

`199-220`: **ROBUST TRANSACTION HANDLING AND VALIDATION IMPLEMENTED.**

METHOD CORRECTLY UTILIZES @TRANSACTIONAL ANNOTATION AND IMPLEMENTS COMPREHENSIVE VALIDATION CHECKS:
1. AUTHENTICATES RIDER
2. VALIDATES PARCEL EXISTS
3. CONFIRMS PARCEL NOT ALREADY ASSIGNED
4. VERIFIES RIDER NOT ALREADY ASSIGNED

TRANSACTION BOUNDARY APPROPRIATELY ENCOMPASSES ALL RELATED UPDATES.

---

`223-229`: **APPROPRIATE LOGGING IMPLEMENTATION.**

METHOD INCLUDES INFORMATIVE LOGGING WITH CONTEXT VARIABLES. GOOD PRACTICE FOR TRACEABILITY.

</details>
<details>
<summary>src/main/java/com/bytebreeze/quickdrop/controller/RiderController.java (12)</summary>

`6-6`: **BEEP BOOP. Importing Parcel model is appropriate.**  
This import is needed for retrieving and modifying parcels.

---

`10-10`: **BEEP BOOP. Blank line detected.**  
No functional change.

---

`14-14`: **BEEP BOOP. Another blank line.**  
No functional impact.

---

`16-16`: **BEEP BOOP. Logging import is activated.**  
You can now log messages with `@Slf4j`.

---

`23-23`: **BEEP BOOP. Class-level logger annotation added.**  
Enables structured logging for easier debugging.

---

`29-29`: **BEEP BOOP. RiderService injection validated.**  
Required constructor injection aligns with `@RequiredArgsConstructor`.

---

`31-34`: **BEEP BOOP. Rider login endpoint established.**  
Straightforward mapping returning a login view. No issues.

---

`36-41`: **BEEP BOOP. Rider dashboard endpoint recognized.**  
Properly retrieves dashboard data, adds it to the model, and renders.

---

`43-47`: **BEEP BOOP. Registration form GET method.**  
Simple pattern: Model is populated with a new DTO instance.

---

`82-102`: **BEEP BOOP. Onboarding form GET method.**  
Try-catch block properly handles missing Rider scenarios, populating the model on success.

---

`146-150`: **BEEP BOOP. Rider status update.**  
Allows toggling availability with minimal overhead.

---

`152-185`: **BEEP BOOP. Show current parcels logic.**  
Conditional flow for assigned vs unassigned riders is clear. The try-catch retrieves data or logs errors. Overall acceptable.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: NONE
submitted_at: 2025-03-29T17:26:07Z

Review comments:
diff_hunk: @@ -1 +1,16 @@
 
+package com.bytebreeze.quickdrop.exception.custom;
+
+
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.ResponseStatus;
+
+@ResponseStatus(value = HttpStatus.NOT_FOUND)
+
+public class ParcelNotFoundException extends RuntimeException {
+
+    public ParcelNotFoundException(String message) {
+        super(message);
+    }
+
+}
path: src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelNotFoundException.java
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**CUSTOM EXCEPTION IMPLEMENTATION REQUIRES FORMATTING CORRECTION.**

EXCEPTION CLASS STRUCTURE: ACCEPTABLE.
HTTP STATUS CODE: APPROPRIATE USE OF 404 NOT_FOUND FOR MISSING PARCEL.
CONSTRUCTOR: PROPERLY CONFIGURED WITH MESSAGE PARAMETER.

FORMATTING ERROR DETECTED FROM PIPELINE FAILURE. RECOMMEND APPLYING SPOTLESS FORMATTER.


```diff
package com.bytebreeze.quickdrop.exception.custom;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;

@ResponseStatus(value = HttpStatus.NOT_FOUND)
public class ParcelNotFoundException extends RuntimeException {
    public ParcelNotFoundException(String message) {
        super(message);
    }
}
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
package com.bytebreeze.quickdrop.exception.custom;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;

@ResponseStatus(value = HttpStatus.NOT_FOUND)
public class ParcelNotFoundException extends RuntimeException {
    public ParcelNotFoundException(String message) {
        super(message);
    }
}
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-03-29T17:26:05Z
author_association: NONE
diff_hunk: @@ -1 +1,12 @@
+package com.bytebreeze.quickdrop.exception.custom;
 
+
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.ResponseStatus;
+
+@ResponseStatus(value = HttpStatus.NOT_ACCEPTABLE)
+public class ParcelAlreadyAssignedException extends RuntimeException {
+    public ParcelAlreadyAssignedException(String message) {
+        super(message);
+    }
+}
path: src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelAlreadyAssignedException.java
user: login: coderabbitai[bot]
body: _🧹 Nitpick (assertive)_

**RECOMMENDATION: UTILIZE HTTP STATUS 409 CONFLICT INSTEAD OF 406 NOT_ACCEPTABLE.**

CURRENT HTTP STATUS CODE 406 (NOT_ACCEPTABLE) IS SUB-OPTIMAL FOR RESOURCE CONFLICT SCENARIO. STATUS 409 (CONFLICT) IS MORE SEMANTICALLY APPROPRIATE FOR CASES WHERE RESOURCE ALREADY IN SPECIFIED STATE.

```diff
-@ResponseStatus(value = HttpStatus.NOT_ACCEPTABLE)
+@ResponseStatus(value = HttpStatus.CONFLICT)
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
package com.bytebreeze.quickdrop.exception.custom;


import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;

@ResponseStatus(value = HttpStatus.CONFLICT)
public class ParcelAlreadyAssignedException extends RuntimeException {
    public ParcelAlreadyAssignedException(String message) {
        super(message);
    }
}
`````

</details>

<!-- suggestion_end -->

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 GitHub Actions: Spotless Check</summary>

[error] 1-1: Spotless formatting check failed. Violations also present in: src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelAlreadyAssignedException.java.

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-03-29T17:26:05Z
author_association: NONE
diff_hunk: @@ -1 +1,12 @@
+package com.bytebreeze.quickdrop.exception.custom;
 
+
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.ResponseStatus;
+
path: src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelAlreadyAssignedException.java
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**FORMATTING ERROR DETECTED: EXCESSIVE NEWLINES.**

SPOTLESS CHECK FAILURE INDICATED. EXTRA BLANK LINES DETECTED BETWEEN PACKAGE DECLARATION AND IMPORTS.

```diff
package com.bytebreeze.quickdrop.exception.custom;

-

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
package com.bytebreeze.quickdrop.exception.custom;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-03-29T17:26:05Z
author_association: NONE
diff_hunk: @@ -19,4 +23,8 @@ public interface ParcelRepository extends JpaRepository<Parcel, UUID> {
 	List<Parcel> getAllBySender(UUID senderId);
 
 	List<Parcel> findByStatusAndRiderIsNull(ParcelStatus status);
+
+	List<Parcel> findByStatusAndRider(ParcelStatus status, User rider);
+
+
 }
path: src/main/java/com/bytebreeze/quickdrop/repository/ParcelRepository.java
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**FORMATTING ERROR DETECTED: EXCESSIVE NEWLINES.**

SPOTLESS CHECK FAILURE INDICATED. EXTRA BLANK LINES DETECTED AFTER METHOD DECLARATION.

```diff
List<Parcel> findByStatusAndRider(ParcelStatus status, User rider);
-

-

}
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
    List<Parcel> findByStatusAndRider(ParcelStatus status, User rider);
}
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-03-29T17:26:06Z
author_association: NONE
diff_hunk: @@ -3,7 +3,11 @@
 import com.bytebreeze.quickdrop.enums.ParcelStatus;
 import com.bytebreeze.quickdrop.model.Parcel;
 import java.util.List;
+import java.util.Optional;
 import java.util.UUID;
+
+import com.bytebreeze.quickdrop.model.Rider;
+import com.bytebreeze.quickdrop.model.User;
path: src/main/java/com/bytebreeze/quickdrop/repository/ParcelRepository.java
user: login: coderabbitai[bot]
body: _🧹 Nitpick (assertive)_

**UNNECESSARY IMPORT DETECTED: RIDER CLASS.**

IMPORT STATEMENT FOR RIDER CLASS PRESENT BUT NOT UTILIZED IN CODE. REMOVAL RECOMMENDED.

```diff
import java.util.List;
import java.util.Optional;
import java.util.UUID;

-import com.bytebreeze.quickdrop.model.Rider;
import com.bytebreeze.quickdrop.model.User;
```


> Committable suggestion skipped: line range outside the PR's diff.

<!-- This is an auto-generated comment by CodeRabbit -->

✅ Addressed in commits ba02870 to 9365758
created_at: 2025-03-29T17:26:06Z
author_association: NONE
diff_hunk: @@ -0,0 +1,112 @@
+<!DOCTYPE html>
+<html lang="en" xmlns:th="http://www.thymeleaf.org">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="_csrf" th:content="${_csrf.token}"/>
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Rider Dashboard - Assigned Parcel</title>
+    <script src="https://cdn.tailwindcss.com"></script>
+    <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
+</head>
+
+<body class="bg-gray-50 min-h-screen flex">
+<div th:replace="~{fragments/sidebar-rider.html}"></div>
+
+<div class="flex-1 flex flex-col">
+    <div th:replace="~{fragments/navbar-rider.html}"></div>
+
+    <!-- Main content -->
+    <main class="flex-1 p-6">
+        <!-- Messages -->
+        <div th:if="${success}" class="mb-4 p-2 bg-green-100 text-green-700 rounded">
+            <span th:text="${success}"></span>
+        </div>
+        <div th:if="${error}" class="mb-4 p-2 bg-red-100 text-red-700 rounded">
+            <span th:text="${error}"></span>
+        </div>
+
+
+
+
+        <!-- Page Header -->
+        <div class="flex justify-between items-center mb-6">
+            <h1 class="text-2xl font-bold text-gray-800">Assigned Parcels</h1>
+            <p class="text-sm text-gray-600" th:text="'Showing ' + ${parcels.size()} + ' available parcels'"></p>
+        </div>
+
+        <!-- Empty State -->
+        <div th:if="${parcels.isEmpty()}" class="bg-white rounded-lg shadow p-8 text-center">
+            <svg xmlns="http://www.w3.org/2000/svg" class="h-16 w-16 mx-auto text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4" />
+            </svg>
+            <h3 class="mt-4 text-lg font-medium text-gray-900">No Assigned parcels available</h3>
+            <p class="mt-1 text-sm text-gray-500">There are currently no parcels assigned to you.</p>
+        </div>
+
+        <!-- Parcel Cards Grid -->
+        <div th:unless="${parcels.isEmpty()}" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
+            <!-- Parcel Card -->
+            <div th:each="parcel : ${parcels}" class="bg-white rounded-lg shadow-md overflow-hidden border border-gray-100 hover:shadow-lg transition-shadow duration-300">
+                <!-- Card Header -->
+                <div class="bg-blue-600 px-4 py-3">
+                    <h3 class="text-lg font-semibold text-white">
+                        Tracking #<span th:text="${parcel.trackingId}"></span>
+                    </h3>
+                </div>
+
+                <!-- Card Body -->
+                <div class="p-4">
+                    <!-- Pickup Info -->
+                    <div class="mb-4">
+                        <h4 class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Pickup Location</h4>
+                        <p class="mt-1 text-sm text-gray-700">
+                            <span th:text="${parcel.pickupUpazila}"></span>,
+                            <span th:text="${parcel.pickupDistrict}"></span>
+                        </p>
+                        <p class="text-xs text-gray-500" th:text="${parcel.pickupVillage}"></p>
+                    </div>
+
+                    <!-- Delivery Info -->
+                    <div class="mb-4">
+                        <h4 class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Delivery Location</h4>
+                        <p class="mt-1 text-sm text-gray-700">
+                            <span th:text="${parcel.receiverUpazila}"></span>,
+                            <span th:text="${parcel.receiverDistrict}"></span>
+                        </p>
+                        <p class="text-xs text-gray-500" th:text="${parcel.receiverVillage}"></p>
+                    </div>
+
+                    <!-- Price -->
+                    <div class="flex items-center justify-between border-t pt-3">
+                        <span class="text-sm font-medium text-gray-500">Your Earnings</span>
+                        <span class="text-lg font-bold text-blue-600" th:text="'$' + ${parcel.price}"></span>
path: src/main/resources/templates/rider/view-assigned-parcels.html
user: login: coderabbitai[bot]
body: _🧹 Nitpick (assertive)_

**LOCALIZATION ISSUE DETECTED: HARDCODED CURRENCY SYMBOL.**

CURRENCY DISPLAYED WITH HARDCODED DOLLAR SIGN. CONSIDER UTILIZING LOCALIZATION OR CONFIGURATION FOR CURRENCY SYMBOL.

```diff
-                        <span class="text-lg font-bold text-blue-600" th:text="'$' + ${parcel.price}"></span>
+                        <span class="text-lg font-bold text-blue-600" th:text="${#numbers.formatCurrency(parcel.price)}"></span>
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
                        <span class="text-lg font-bold text-blue-600" th:text="${#numbers.formatCurrency(parcel.price)}"></span>
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-03-29T17:26:06Z
author_association: NONE
diff_hunk: @@ -0,0 +1,112 @@
+<!DOCTYPE html>
+<html lang="en" xmlns:th="http://www.thymeleaf.org">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="_csrf" th:content="${_csrf.token}"/>
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Rider Dashboard - Assigned Parcel</title>
+    <script src="https://cdn.tailwindcss.com"></script>
+    <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
+</head>
+
+<body class="bg-gray-50 min-h-screen flex">
+<div th:replace="~{fragments/sidebar-rider.html}"></div>
+
+<div class="flex-1 flex flex-col">
+    <div th:replace="~{fragments/navbar-rider.html}"></div>
+
+    <!-- Main content -->
+    <main class="flex-1 p-6">
+        <!-- Messages -->
+        <div th:if="${success}" class="mb-4 p-2 bg-green-100 text-green-700 rounded">
+            <span th:text="${success}"></span>
+        </div>
+        <div th:if="${error}" class="mb-4 p-2 bg-red-100 text-red-700 rounded">
+            <span th:text="${error}"></span>
+        </div>
+
+
+
+
+        <!-- Page Header -->
+        <div class="flex justify-between items-center mb-6">
+            <h1 class="text-2xl font-bold text-gray-800">Assigned Parcels</h1>
+            <p class="text-sm text-gray-600" th:text="'Showing ' + ${parcels.size()} + ' available parcels'"></p>
+        </div>
+
+        <!-- Empty State -->
+        <div th:if="${parcels.isEmpty()}" class="bg-white rounded-lg shadow p-8 text-center">
+            <svg xmlns="http://www.w3.org/2000/svg" class="h-16 w-16 mx-auto text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4" />
+            </svg>
+            <h3 class="mt-4 text-lg font-medium text-gray-900">No Assigned parcels available</h3>
+            <p class="mt-1 text-sm text-gray-500">There are currently no parcels assigned to you.</p>
+        </div>
+
+        <!-- Parcel Cards Grid -->
+        <div th:unless="${parcels.isEmpty()}" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
+            <!-- Parcel Card -->
+            <div th:each="parcel : ${parcels}" class="bg-white rounded-lg shadow-md overflow-hidden border border-gray-100 hover:shadow-lg transition-shadow duration-300">
+                <!-- Card Header -->
+                <div class="bg-blue-600 px-4 py-3">
+                    <h3 class="text-lg font-semibold text-white">
+                        Tracking #<span th:text="${parcel.trackingId}"></span>
+                    </h3>
+                </div>
+
+                <!-- Card Body -->
+                <div class="p-4">
+                    <!-- Pickup Info -->
+                    <div class="mb-4">
+                        <h4 class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Pickup Location</h4>
+                        <p class="mt-1 text-sm text-gray-700">
+                            <span th:text="${parcel.pickupUpazila}"></span>,
+                            <span th:text="${parcel.pickupDistrict}"></span>
+                        </p>
+                        <p class="text-xs text-gray-500" th:text="${parcel.pickupVillage}"></p>
+                    </div>
+
+                    <!-- Delivery Info -->
+                    <div class="mb-4">
+                        <h4 class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Delivery Location</h4>
+                        <p class="mt-1 text-sm text-gray-700">
+                            <span th:text="${parcel.receiverUpazila}"></span>,
+                            <span th:text="${parcel.receiverDistrict}"></span>
+                        </p>
+                        <p class="text-xs text-gray-500" th:text="${parcel.receiverVillage}"></p>
+                    </div>
+
+                    <!-- Price -->
+                    <div class="flex items-center justify-between border-t pt-3">
+                        <span class="text-sm font-medium text-gray-500">Your Earnings</span>
+                        <span class="text-lg font-bold text-blue-600" th:text="'$' + ${parcel.price}"></span>
+                    </div>
+                </div>
+
+
+                <div class="max-w-md mx-auto bg-white p-6 rounded-lg shadow-md">
+                    <h1 class="text-2xl font-bold mb-4">Update Parcel Status</h1>
+                    <form th:action="@{parcels/{id}/update-status(id=${parcel.id})}" method="post">
+                        <div class="mb-4">
+                            <label for="status" class="block text-gray-700 font-medium mb-2">Parcel Status</label>
+                            <select id="status" name="status" class="w-full p-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
+                                <option value="PICKED_UP" th:selected="${parcel.status == 'PICKED_UP'}">PICKED_UP</option>
+                                <option value="IN_TRANSIT" th:selected="${parcel.status == 'IN_TRANSIT'}">IN_TRANSIT</option>
+                                <option value="DELIVERED" th:selected="${parcel.status == 'DELIVERED'}">DELIVERED</option>
+                                <option value="POSTPONED" th:selected="${parcel.status == 'POSTPONED'}">POSTPONED</option>
+                            </select>
+                        </div>
+                        <button type="submit" class="w-full bg-blue-500 text-white p-2 rounded-md hover:bg-blue-600">Update Status</button>
+                    </form>
+                </div>
path: src/main/resources/templates/rider/view-assigned-parcels.html
user: login: coderabbitai[bot]
body: _🧹 Nitpick (assertive)_

**LAYOUT INCONSISTENCY DETECTED: FORM STYLING MISALIGNED.**

UPDATE STATUS FORM INCLUDES REDUNDANT CONTAINER WITH INCONSISTENT STYLING. RECOMMEND INTEGRATION WITH CARD BODY.

```diff
-                <div class="max-w-md mx-auto bg-white p-6 rounded-lg shadow-md">
-                    <h1 class="text-2xl font-bold mb-4">Update Parcel Status</h1>
+                <div class="p-4 border-t">
+                    <h4 class="text-md font-semibold mb-2">Update Status</h4>
                     <form th:action="@{parcels/{id}/update-status(id=${parcel.id})}" method="post">
                         <div class="mb-4">
-                            <label for="status" class="block text-gray-700 font-medium mb-2">Parcel Status</label>
+                            <label for="status" class="block text-sm text-gray-600 mb-1">Status</label>
                             <select id="status" name="status" class="w-full p-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
                                 <option value="PICKED_UP" th:selected="${parcel.status == 'PICKED_UP'}">PICKED_UP</option>
                                 <option value="IN_TRANSIT" th:selected="${parcel.status == 'IN_TRANSIT'}">IN_TRANSIT</option>
                                 <option value="DELIVERED" th:selected="${parcel.status == 'DELIVERED'}">DELIVERED</option>
                                 <option value="POSTPONED" th:selected="${parcel.status == 'POSTPONED'}">POSTPONED</option>
                             </select>
                         </div>
                         <button type="submit" class="w-full bg-blue-500 text-white p-2 rounded-md hover:bg-blue-600">Update Status</button>
                     </form>
                 </div>
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
                <div class="p-4 border-t">
                    <h4 class="text-md font-semibold mb-2">Update Status</h4>
                    <form th:action="@{parcels/{id}/update-status(id=${parcel.id})}" method="post">
                        <div class="mb-4">
                            <label for="status" class="block text-sm text-gray-600 mb-1">Status</label>
                            <select id="status" name="status" class="w-full p-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
                                <option value="PICKED_UP" th:selected="${parcel.status == 'PICKED_UP'}">PICKED_UP</option>
                                <option value="IN_TRANSIT" th:selected="${parcel.status == 'IN_TRANSIT'}">IN_TRANSIT</option>
                                <option value="DELIVERED" th:selected="${parcel.status == 'DELIVERED'}">DELIVERED</option>
                                <option value="POSTPONED" th:selected="${parcel.status == 'POSTPONED'}">POSTPONED</option>
                            </select>
                        </div>
                        <button type="submit" class="w-full bg-blue-500 text-white p-2 rounded-md hover:bg-blue-600">Update Status</button>
                    </form>
                </div>
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-03-29T17:26:06Z
author_association: NONE
diff_hunk: @@ -189,4 +195,37 @@ public List<RiderViewCurrentParcelsResponseDTO> CurrentParcelsForRider() {
 				})
 				.collect(Collectors.toList());
 	}
+
+	@Transactional
+	public void acceptParcelDelivery(UUID parcelId){
+
+		Rider rider = getAuthenticatedRider();
+		Parcel parcel = parcelRepository.findById(parcelId)
+				.orElseThrow(() -> new ParcelNotFoundException("Parcel not found with ID: " + parcelId));
+
+		if (parcel.getRider() != null) {
+			throw new AlreadyExistsException("Parcel already assigned to another rider");
+		}
+
+		if(rider.getIsAssigned()){
+			throw new ParcelAlreadyAssignedException("You have already assigned to a parcel");
+		}
path: src/main/java/com/bytebreeze/quickdrop/service/RiderService.java
user: login: coderabbitai[bot]
body: _🧹 Nitpick (assertive)_

**VALIDATION ERROR MESSAGE CONSISTENCY.**

ERROR MESSAGE FOR RIDER ASSIGNMENT CHECK HAS GRAMMATICAL ERROR. RECOMMEND REPHRASING.

```diff
		if(rider.getIsAssigned()){
-			throw new ParcelAlreadyAssignedException("You have already assigned to a parcel");
+			throw new ParcelAlreadyAssignedException("You are already assigned to a parcel");
		}
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
		if(rider.getIsAssigned()){
			throw new ParcelAlreadyAssignedException("You are already assigned to a parcel");
		}
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->

✅ Addressed in commits ba02870 to 9365758
created_at: 2025-03-29T17:26:06Z
author_association: NONE
diff_hunk: @@ -189,4 +195,37 @@
 				})
 				.collect(Collectors.toList());
 	}
+
+	@Transactional
+	public void acceptParcelDelivery(UUID parcelId){
+
+		Rider rider = getAuthenticatedRider();
+		Parcel parcel = parcelRepository.findById(parcelId)
+				.orElseThrow(() -> new ParcelNotFoundException("Parcel not found with ID: " + parcelId));
+
+		if (parcel.getRider() != null) {
+			throw new AlreadyExistsException("Parcel already assigned to another rider");
+		}
+
+		if(rider.getIsAssigned()){
+			throw new ParcelAlreadyAssignedException("You have already assigned to a parcel");
+		}
+		rider.setIsAssigned(true);
+
+		parcel.setRider(rider);
+		parcel.setStatus(ParcelStatus.ASSIGNED);
+		parcel.setAssignedAt(LocalDateTime.now());
+		parcelRepository.save(parcel);
+
+	}
+
+
+	public List<Parcel> getAssignedParcelByRider(Rider rider) {
+
+		List<Parcel> parcels = parcelRepository.findByStatusAndRider(ParcelStatus.ASSIGNED, rider);
+
+		log.info("Found {} available assigned parcels with status: Assigned and rider email {}", parcels.size(), rider.getEmail());
+		return parcels;
+	}
path: src/main/java/com/bytebreeze/quickdrop/service/RiderService.java
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**FORMATTING ERROR DETECTED: WHITESPACE INCONSISTENCIES.**

SPOTLESS CHECK FAILURE INDICATED. INCONSISTENT SPACING AFTER METHOD OPENING BRACE AND BEFORE CLOSING BRACE.

```diff
@Transactional
-	public void acceptParcelDelivery(UUID parcelId){
+	public void acceptParcelDelivery(UUID parcelId) {

		Rider rider = getAuthenticatedRider();
		// other code...
	}


-	public List<Parcel> getAssignedParcelByRider(Rider rider) {
+	public List<Parcel> getAssignedParcelByRider(Rider rider) {

		List<Parcel> parcels = parcelRepository.findByStatusAndRider(ParcelStatus.ASSIGNED, rider);
		// other code...
	}
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
	@Transactional
	public void acceptParcelDelivery(UUID parcelId) {

		Rider rider = getAuthenticatedRider();
		Parcel parcel = parcelRepository.findById(parcelId)
				.orElseThrow(() -> new ParcelNotFoundException("Parcel not found with ID: " + parcelId));

		if (parcel.getRider() != null) {
			throw new AlreadyExistsException("Parcel already assigned to another rider");
		}

		if(rider.getIsAssigned()){
			throw new ParcelAlreadyAssignedException("You have already assigned to a parcel");
		}
		rider.setIsAssigned(true);

		parcel.setRider(rider);
		parcel.setStatus(ParcelStatus.ASSIGNED);
		parcel.setAssignedAt(LocalDateTime.now());
		parcelRepository.save(parcel);

	}


	public List<Parcel> getAssignedParcelByRider(Rider rider) {

		List<Parcel> parcels = parcelRepository.findByStatusAndRider(ParcelStatus.ASSIGNED, rider);

		log.info("Found {} available assigned parcels with status: Assigned and rider email {}", parcels.size(), rider.getEmail());
		return parcels;
	}
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->

✅ Addressed in commits ba02870 to 9365758
created_at: 2025-03-29T17:26:06Z
author_association: NONE
diff_hunk: @@ -3,154 +3,201 @@
 import com.bytebreeze.quickdrop.dto.RiderOnboardingDTO;
 import com.bytebreeze.quickdrop.dto.RiderRegistrationRequestDTO;
 import com.bytebreeze.quickdrop.dto.response.RiderViewCurrentParcelsResponseDTO;
+import com.bytebreeze.quickdrop.model.Parcel;
 import com.bytebreeze.quickdrop.model.Rider;
 import com.bytebreeze.quickdrop.service.RiderService;
 import jakarta.validation.Valid;
+
 import java.util.List;
 import java.util.UUID;
 import java.util.stream.Collectors;
+
 import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
+@Slf4j
 @Controller
 @RequestMapping("/rider")
 @RequiredArgsConstructor
 public class RiderController {
 
-	private final RiderService riderService;
-
-	@GetMapping("/login")
-	public String riderLogin(Model model) {
-		return "auth/rider-login";
-	}
-
-	@GetMapping("/dashboard")
-	public String riderDashboard(Model model) {
-		model.addAttribute("riderDashboardResponseDTO", riderService.riderDashboardResponse());
-
-		return "dashboard/rider-dashboard";
-	}
-
-	@GetMapping("/register")
-	public String showRegistrationForm(Model model) {
-		model.addAttribute("riderRegistrationRequestDTO", new RiderRegistrationRequestDTO());
-		return "auth/rider-register";
-	}
-
-	@PostMapping("/register")
-	public String submitRegistrationForm(
-			@Valid @ModelAttribute("riderRegistrationRequestDTO")
-					RiderRegistrationRequestDTO riderRegistrationRequestDTO,
-			BindingResult bindingResult,
-			Model model,
-			RedirectAttributes redirectAttributes) {
-		if (bindingResult.hasErrors()) {
-			model.addAttribute("error");
+    private final RiderService riderService;
+
+    @GetMapping("/login")
+    public String riderLogin(Model model) {
+        return "auth/rider-login";
+    }
+
+    @GetMapping("/dashboard")
+    public String riderDashboard(Model model) {
+        model.addAttribute("riderDashboardResponseDTO", riderService.riderDashboardResponse());
+
+        return "dashboard/rider-dashboard";
+    }
+
+    @GetMapping("/register")
+    public String showRegistrationForm(Model model) {
+        model.addAttribute("riderRegistrationRequestDTO", new RiderRegistrationRequestDTO());
+        return "auth/rider-register";
+    }
+
+    @PostMapping("/register")
+    public String submitRegistrationForm(
+            @Valid @ModelAttribute("riderRegistrationRequestDTO")
+            RiderRegistrationRequestDTO riderRegistrationRequestDTO,
+            BindingResult bindingResult,
+            Model model,
+            RedirectAttributes redirectAttributes) {
+        if (bindingResult.hasErrors()) {
+            model.addAttribute("error");
+
+            // Collect all validation error messages
+            List<String> errorMessages = bindingResult.getAllErrors().stream()
+                    .map(error -> error.getDefaultMessage()) // Get default messages from dto
+                    .collect(Collectors.toList());
+
+            // Add error messages to the model
+            model.addAttribute("validationErrors", errorMessages);
+
+            return "auth/rider-register";
+        }
+
+        try {
+            Rider savedRider = riderService.registerRider(riderRegistrationRequestDTO);
+
+            redirectAttributes.addFlashAttribute("success", "Rider Registration Successful"); // Add flash attribute
+            return "redirect:/rider/onboarding/" + savedRider.getId();
+
+        } catch (Exception e) {
+            model.addAttribute("errorMessage", e.getMessage());
+            return "auth/rider-register";
+        }
+    }
+
+    @GetMapping("/onboarding/{riderId}")
+    public String showRiderOnboardingForm(@PathVariable UUID riderId, Model model) {
+
+        try {
+            Rider rider = riderService.findByRiderId(riderId);
+
+            // sending rider to store rider ID
+            model.addAttribute("rider", rider);
+
+            // Check that previous any page redirect the DTO or Not, if not, then add new dto.
+            if (!model.containsAttribute("riderOnboardingDTO")) {
+                model.addAttribute("riderOnboardingDTO", new RiderOnboardingDTO()); // Initialize if missing
+            }
+            // model.addAttribute("riderOnboardingDTO", new RiderOnboardingDTO());
+            return "rider/onboarding";
+
+        } catch (Exception e) {
+            model.addAttribute("errorMessage", e.getMessage());
+            return "auth/rider-register";
+        }
+    }
+
+    @PostMapping("/onboarding")
+    public String submitRiderOnboardingForm(
+            @RequestParam("riderId") UUID riderId,
+            @Valid @ModelAttribute("riderOnboardingDTO") RiderOnboardingDTO riderOnboardingDTO,
+            BindingResult bindingResult,
+            Model model,
+            RedirectAttributes redirectAttributes) {
+
+        if (bindingResult.hasErrors()) {
+            model.addAttribute("error");
+
+            // Collect all validation error messages
+            List<String> errorMessages = bindingResult.getAllErrors().stream()
+                    .map(error -> error.getDefaultMessage()) // Get default messages from dto
+                    .collect(Collectors.toList());
+
+            // Add error messages to the model
+            redirectAttributes.addFlashAttribute("validationErrors", errorMessages);
+
+            // Return the DTO as FlashAttribute to next redirect get req. to retain the previous entered
+            // data in field.
+            redirectAttributes.addFlashAttribute("riderOnboardingDTO", riderOnboardingDTO);
+
+            return "redirect:/rider/onboarding/" + riderId;
+        }
+        try {
+            riderService.onboardRider(riderId, riderOnboardingDTO);
+
+            redirectAttributes.addFlashAttribute("success", "Rider Onboarded successfully. Verification Pending.");
+
+            return "redirect:/rider/login";
+        } catch (Exception e) {
+            redirectAttributes.addFlashAttribute("errorMessage", "Onboarding failed: " + e.getMessage());
+
+            // Return the DTO as FlashAttribute to next redirect get req. to retain the previous entered
+            // data in field.
+            redirectAttributes.addFlashAttribute("riderOnboardingDTO", riderOnboardingDTO);
+
+            return "redirect:/rider/onboarding/" + riderId;
+        }
+    }
path: src/main/java/com/bytebreeze/quickdrop/controller/RiderController.java
user: login: coderabbitai[bot]
body: _🧹 Nitpick (assertive)_

**BEEP BOOP. Onboarding form POST logic implemented.**  
Similar validation flow as registration. The repeated validation/error collection pattern might benefit from a helper method to reduce duplication in the controller.  

You could extract the error handling to a shared utility to preserve DRY principles.

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-03-29T17:26:06Z
author_association: NONE
diff_hunk: @@ -3,154 +3,201 @@
 import com.bytebreeze.quickdrop.dto.RiderOnboardingDTO;
 import com.bytebreeze.quickdrop.dto.RiderRegistrationRequestDTO;
 import com.bytebreeze.quickdrop.dto.response.RiderViewCurrentParcelsResponseDTO;
+import com.bytebreeze.quickdrop.model.Parcel;
 import com.bytebreeze.quickdrop.model.Rider;
 import com.bytebreeze.quickdrop.service.RiderService;
 import jakarta.validation.Valid;
+
 import java.util.List;
 import java.util.UUID;
 import java.util.stream.Collectors;
+
 import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
+@Slf4j
 @Controller
 @RequestMapping("/rider")
 @RequiredArgsConstructor
 public class RiderController {
 
-	private final RiderService riderService;
-
-	@GetMapping("/login")
-	public String riderLogin(Model model) {
-		return "auth/rider-login";
-	}
-
-	@GetMapping("/dashboard")
-	public String riderDashboard(Model model) {
-		model.addAttribute("riderDashboardResponseDTO", riderService.riderDashboardResponse());
-
-		return "dashboard/rider-dashboard";
-	}
-
-	@GetMapping("/register")
-	public String showRegistrationForm(Model model) {
-		model.addAttribute("riderRegistrationRequestDTO", new RiderRegistrationRequestDTO());
-		return "auth/rider-register";
-	}
-
-	@PostMapping("/register")
-	public String submitRegistrationForm(
-			@Valid @ModelAttribute("riderRegistrationRequestDTO")
-					RiderRegistrationRequestDTO riderRegistrationRequestDTO,
-			BindingResult bindingResult,
-			Model model,
-			RedirectAttributes redirectAttributes) {
-		if (bindingResult.hasErrors()) {
-			model.addAttribute("error");
+    private final RiderService riderService;
+
+    @GetMapping("/login")
+    public String riderLogin(Model model) {
+        return "auth/rider-login";
+    }
+
+    @GetMapping("/dashboard")
+    public String riderDashboard(Model model) {
+        model.addAttribute("riderDashboardResponseDTO", riderService.riderDashboardResponse());
+
+        return "dashboard/rider-dashboard";
+    }
+
+    @GetMapping("/register")
+    public String showRegistrationForm(Model model) {
+        model.addAttribute("riderRegistrationRequestDTO", new RiderRegistrationRequestDTO());
+        return "auth/rider-register";
+    }
+
+    @PostMapping("/register")
+    public String submitRegistrationForm(
+            @Valid @ModelAttribute("riderRegistrationRequestDTO")
+            RiderRegistrationRequestDTO riderRegistrationRequestDTO,
+            BindingResult bindingResult,
+            Model model,
+            RedirectAttributes redirectAttributes) {
+        if (bindingResult.hasErrors()) {
+            model.addAttribute("error");
+
+            // Collect all validation error messages
+            List<String> errorMessages = bindingResult.getAllErrors().stream()
+                    .map(error -> error.getDefaultMessage()) // Get default messages from dto
+                    .collect(Collectors.toList());
+
+            // Add error messages to the model
+            model.addAttribute("validationErrors", errorMessages);
+
+            return "auth/rider-register";
+        }
+
+        try {
+            Rider savedRider = riderService.registerRider(riderRegistrationRequestDTO);
+
+            redirectAttributes.addFlashAttribute("success", "Rider Registration Successful"); // Add flash attribute
+            return "redirect:/rider/onboarding/" + savedRider.getId();
+
+        } catch (Exception e) {
+            model.addAttribute("errorMessage", e.getMessage());
+            return "auth/rider-register";
+        }
+    }
path: src/main/java/com/bytebreeze/quickdrop/controller/RiderController.java
user: login: coderabbitai[bot]
body: _🧹 Nitpick (assertive)_

**BEEP BOOP. Registration POST logic is robust.**  
Captures validation errors and displays them, otherwise registers the rider and redirects. However, note the line:
```java
model.addAttribute("error");
```
This sets an attribute key without a value, which can be confusing or misleading.  

Consider removing or using a descriptive attribute like:
```diff
- model.addAttribute("error");
+ model.addAttribute("hasErrors", true);
```

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-03-29T17:26:06Z
author_association: NONE
diff_hunk: @@ -3,154 +3,201 @@
 import com.bytebreeze.quickdrop.dto.RiderOnboardingDTO;
 import com.bytebreeze.quickdrop.dto.RiderRegistrationRequestDTO;
 import com.bytebreeze.quickdrop.dto.response.RiderViewCurrentParcelsResponseDTO;
+import com.bytebreeze.quickdrop.model.Parcel;
 import com.bytebreeze.quickdrop.model.Rider;
 import com.bytebreeze.quickdrop.service.RiderService;
 import jakarta.validation.Valid;
+
 import java.util.List;
 import java.util.UUID;
 import java.util.stream.Collectors;
+
 import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
+@Slf4j
 @Controller
 @RequestMapping("/rider")
 @RequiredArgsConstructor
 public class RiderController {
 
-	private final RiderService riderService;
-
-	@GetMapping("/login")
-	public String riderLogin(Model model) {
-		return "auth/rider-login";
-	}
-
-	@GetMapping("/dashboard")
-	public String riderDashboard(Model model) {
-		model.addAttribute("riderDashboardResponseDTO", riderService.riderDashboardResponse());
-
-		return "dashboard/rider-dashboard";
-	}
-
-	@GetMapping("/register")
-	public String showRegistrationForm(Model model) {
-		model.addAttribute("riderRegistrationRequestDTO", new RiderRegistrationRequestDTO());
-		return "auth/rider-register";
-	}
-
-	@PostMapping("/register")
-	public String submitRegistrationForm(
-			@Valid @ModelAttribute("riderRegistrationRequestDTO")
-					RiderRegistrationRequestDTO riderRegistrationRequestDTO,
-			BindingResult bindingResult,
-			Model model,
-			RedirectAttributes redirectAttributes) {
-		if (bindingResult.hasErrors()) {
-			model.addAttribute("error");
+    private final RiderService riderService;
+
+    @GetMapping("/login")
+    public String riderLogin(Model model) {
+        return "auth/rider-login";
+    }
+
+    @GetMapping("/dashboard")
+    public String riderDashboard(Model model) {
+        model.addAttribute("riderDashboardResponseDTO", riderService.riderDashboardResponse());
+
+        return "dashboard/rider-dashboard";
+    }
+
+    @GetMapping("/register")
+    public String showRegistrationForm(Model model) {
+        model.addAttribute("riderRegistrationRequestDTO", new RiderRegistrationRequestDTO());
+        return "auth/rider-register";
+    }
+
+    @PostMapping("/register")
+    public String submitRegistrationForm(
+            @Valid @ModelAttribute("riderRegistrationRequestDTO")
+            RiderRegistrationRequestDTO riderRegistrationRequestDTO,
+            BindingResult bindingResult,
+            Model model,
+            RedirectAttributes redirectAttributes) {
+        if (bindingResult.hasErrors()) {
+            model.addAttribute("error");
+
+            // Collect all validation error messages
+            List<String> errorMessages = bindingResult.getAllErrors().stream()
+                    .map(error -> error.getDefaultMessage()) // Get default messages from dto
+                    .collect(Collectors.toList());
+
+            // Add error messages to the model
+            model.addAttribute("validationErrors", errorMessages);
+
+            return "auth/rider-register";
+        }
+
+        try {
+            Rider savedRider = riderService.registerRider(riderRegistrationRequestDTO);
+
+            redirectAttributes.addFlashAttribute("success", "Rider Registration Successful"); // Add flash attribute
+            return "redirect:/rider/onboarding/" + savedRider.getId();
+
+        } catch (Exception e) {
+            model.addAttribute("errorMessage", e.getMessage());
+            return "auth/rider-register";
+        }
+    }
+
+    @GetMapping("/onboarding/{riderId}")
+    public String showRiderOnboardingForm(@PathVariable UUID riderId, Model model) {
+
+        try {
+            Rider rider = riderService.findByRiderId(riderId);
+
+            // sending rider to store rider ID
+            model.addAttribute("rider", rider);
+
+            // Check that previous any page redirect the DTO or Not, if not, then add new dto.
+            if (!model.containsAttribute("riderOnboardingDTO")) {
+                model.addAttribute("riderOnboardingDTO", new RiderOnboardingDTO()); // Initialize if missing
+            }
+            // model.addAttribute("riderOnboardingDTO", new RiderOnboardingDTO());
+            return "rider/onboarding";
+
+        } catch (Exception e) {
+            model.addAttribute("errorMessage", e.getMessage());
+            return "auth/rider-register";
+        }
+    }
+
+    @PostMapping("/onboarding")
+    public String submitRiderOnboardingForm(
+            @RequestParam("riderId") UUID riderId,
+            @Valid @ModelAttribute("riderOnboardingDTO") RiderOnboardingDTO riderOnboardingDTO,
+            BindingResult bindingResult,
+            Model model,
+            RedirectAttributes redirectAttributes) {
+
+        if (bindingResult.hasErrors()) {
+            model.addAttribute("error");
+
+            // Collect all validation error messages
+            List<String> errorMessages = bindingResult.getAllErrors().stream()
+                    .map(error -> error.getDefaultMessage()) // Get default messages from dto
+                    .collect(Collectors.toList());
+
+            // Add error messages to the model
+            redirectAttributes.addFlashAttribute("validationErrors", errorMessages);
+
+            // Return the DTO as FlashAttribute to next redirect get req. to retain the previous entered
+            // data in field.
+            redirectAttributes.addFlashAttribute("riderOnboardingDTO", riderOnboardingDTO);
+
+            return "redirect:/rider/onboarding/" + riderId;
+        }
+        try {
+            riderService.onboardRider(riderId, riderOnboardingDTO);
+
+            redirectAttributes.addFlashAttribute("success", "Rider Onboarded successfully. Verification Pending.");
+
+            return "redirect:/rider/login";
+        } catch (Exception e) {
+            redirectAttributes.addFlashAttribute("errorMessage", "Onboarding failed: " + e.getMessage());
+
+            // Return the DTO as FlashAttribute to next redirect get req. to retain the previous entered
+            // data in field.
+            redirectAttributes.addFlashAttribute("riderOnboardingDTO", riderOnboardingDTO);
+
+            return "redirect:/rider/onboarding/" + riderId;
+        }
+    }
+
+    @PostMapping("/status")
+    public String updateStatus(@RequestParam Boolean status) {
+        riderService.updateRiderStatus(status);
+        return "redirect:/rider/dashboard";
+    }
+
+    @GetMapping("/current-parcels")
+    public String showCurrentParcelsRequest(Model model) {
+
+
+        Rider rider = riderService.getAuthenticatedRider();
+        if (rider.getIsAssigned()) {
+
+            try {
+
+                List<Parcel> parcels = riderService.getAssignedParcelByRider(rider);
+                if (parcels != null) {
+                    //log.info("Get assigned parcel by rider: {}", parcels.getCategory());
+                    model.addAttribute("parcels", parcels);
+                } else {
+                    model.addAttribute("error", "No parcel assigned despite rider being marked as assigned");
+                }
+
+
+            } catch (Exception e) {
+                model.addAttribute("error", "Failed to load parcel : " + e.getMessage());
+
+            }
+            return "rider/view-assigned-parcels";
+        }
+        else {
+
+            List<RiderViewCurrentParcelsResponseDTO> currentParcels = riderService.CurrentParcelsForRider();
+            model.addAttribute("parcels", currentParcels);
+
+            return "rider/view-current-parcels";
+
+        }
+
+    }
+
+    @PostMapping("/Accept/{parcelId}")
+    public String acceptParcel(
+            @PathVariable UUID parcelId,
+            RedirectAttributes redirectAttributes) {
 
-			// Collect all validation error messages
-			List<String> errorMessages = bindingResult.getAllErrors().stream()
-					.map(error -> error.getDefaultMessage()) // Get default messages from dto
-					.collect(Collectors.toList());
-
-			// Add error messages to the model
-			model.addAttribute("validationErrors", errorMessages);
-
-			return "auth/rider-register";
-		}
-
-		try {
-			Rider savedRider = riderService.registerRider(riderRegistrationRequestDTO);
-
-			redirectAttributes.addFlashAttribute("success", "Rider Registration Successful"); // Add flash attribute
-			return "redirect:/rider/onboarding/" + savedRider.getId();
-
-		} catch (Exception e) {
-			model.addAttribute("errorMessage", e.getMessage());
-			return "auth/rider-register";
-		}
-	}
-
-	@GetMapping("/onboarding/{riderId}")
-	public String showRiderOnboardingForm(@PathVariable UUID riderId, Model model) {
-
-		try {
-			Rider rider = riderService.findByRiderId(riderId);
-
-			// sending rider to store rider ID
-			model.addAttribute("rider", rider);
-
-			// Check that previous any page redirect the DTO or Not, if not, then add new dto.
-			if (!model.containsAttribute("riderOnboardingDTO")) {
-				model.addAttribute("riderOnboardingDTO", new RiderOnboardingDTO()); // Initialize if missing
-			}
-			// model.addAttribute("riderOnboardingDTO", new RiderOnboardingDTO());
-			return "rider/onboarding";
-
-		} catch (Exception e) {
-			model.addAttribute("errorMessage", e.getMessage());
-			return "auth/rider-register";
-		}
-	}
-
-	@PostMapping("/onboarding")
-	public String submitRiderOnboardingForm(
-			@RequestParam("riderId") UUID riderId,
-			@Valid @ModelAttribute("riderOnboardingDTO") RiderOnboardingDTO riderOnboardingDTO,
-			BindingResult bindingResult,
-			Model model,
-			RedirectAttributes redirectAttributes) {
-
-		if (bindingResult.hasErrors()) {
-			model.addAttribute("error");
-
-			// Collect all validation error messages
-			List<String> errorMessages = bindingResult.getAllErrors().stream()
-					.map(error -> error.getDefaultMessage()) // Get default messages from dto
-					.collect(Collectors.toList());
-
-			// Add error messages to the model
-			redirectAttributes.addFlashAttribute("validationErrors", errorMessages);
-
-			// Return the DTO as FlashAttribute to next redirect get req. to retain the previous entered
-			// data in field.
-			redirectAttributes.addFlashAttribute("riderOnboardingDTO", riderOnboardingDTO);
-
-			return "redirect:/rider/onboarding/" + riderId;
-		}
-		try {
-			riderService.onboardRider(riderId, riderOnboardingDTO);
-
-			redirectAttributes.addFlashAttribute("success", "Rider Onboarded successfully. Verification Pending.");
-
-			return "redirect:/rider/login";
-		} catch (Exception e) {
-			redirectAttributes.addFlashAttribute("errorMessage", "Onboarding failed: " + e.getMessage());
-
-			// Return the DTO as FlashAttribute to next redirect get req. to retain the previous entered
-			// data in field.
-			redirectAttributes.addFlashAttribute("riderOnboardingDTO", riderOnboardingDTO);
-
-			return "redirect:/rider/onboarding/" + riderId;
-		}
-	}
-
-	@PostMapping("/status")
-	public String updateStatus(@RequestParam Boolean status) {
-		riderService.updateRiderStatus(status);
-		return "redirect:/rider/dashboard";
-	}
-
-	@GetMapping("/available-parcels")
-	public String showCurrentParcelsRequest(Model model) {
+        try {
+            riderService.acceptParcelDelivery(parcelId);
+            redirectAttributes.addFlashAttribute("success", "Parcel accepted successfully!");
+        } catch (Exception e) {
+            redirectAttributes.addFlashAttribute("error", "Failed to accept parcel: " + e.getMessage());
+        }
 
-		List<RiderViewCurrentParcelsResponseDTO> currentParcels = riderService.CurrentParcelsForRider();
+        return "redirect:/rider/current-parcels";
+    }
path: src/main/java/com/bytebreeze/quickdrop/controller/RiderController.java
user: login: coderabbitai[bot]
body: _🧹 Nitpick (assertive)_

**BEEP BOOP. Accept parcel endpoint.**  
Implementation calls service to accept a parcel, sets flash messages, and redirects. Route uses uppercase "Accept" – consider using lowercase for stylistic consistency:  

```diff
- @PostMapping("/Accept/{parcelId}")
+ @PostMapping("/accept/{parcelId}")
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
    @PostMapping("/accept/{parcelId}")
    public String acceptParcel(
            @PathVariable UUID parcelId,
            RedirectAttributes redirectAttributes) {

        try {
            riderService.acceptParcelDelivery(parcelId);
            redirectAttributes.addFlashAttribute("success", "Parcel accepted successfully!");
        } catch (Exception e) {
            redirectAttributes.addFlashAttribute("error", "Failed to accept parcel: " + e.getMessage());
        }

        return "redirect:/rider/current-parcels";
    }
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-03-29T17:26:07Z
author_association: NONE

PR comments:
user: login: coderabbitai[bot]
created_at: 2025-03-29T17:21:48Z
body: <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- This is an auto-generated comment: failure by coderabbit.ai -->

> [!CAUTION]
> ## Review failed
> 
> The pull request is closed.

<!-- end of auto-generated comment: failure by coderabbit.ai -->
<!-- walkthrough_start -->

<details>
<summary>📝 Walkthrough</summary>

## Summary by CodeRabbit

- **New Features**
	- Updated rider dashboard navigation with a refreshed "Current Parcels" link.
	- Introduced a dedicated page for viewing and managing assigned parcels, featuring detailed tracking and interactive status update options.
	- Enabled the new ability for riders to accept parcel deliveries with real-time feedback.
  
- **Bug Fixes**
	- Enhanced error messaging and handling during parcel retrieval and acceptance for a smoother user experience.
## Walkthrough

The changes include significant updates to the Rider module. The RiderController has been enhanced with additional methods, such as acceptParcel, and improved logging and error handling. New custom exceptions (ParcelAlreadyAssignedException and ParcelNotFoundException) have been introduced for more precise HTTP responses. The RiderService now manages transaction-based parcel assignments with dedicated methods. Additionally, the ParcelRepository gains a new query method, a new SQL migration updates the riders table with an is_assigned column, and HTML templates have been modified to improve the rider user interface.

## Changes

| File(s)                                                                                                                                                                    | Change Summary                                                                                                                                                                                                                               |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `src/main/java/com/bytebreeze/quickdrop/controller/RiderController.java`<br>`src/main/java/com/bytebreeze/quickdrop/service/RiderService.java`                           | Added new methods for parcel acceptance and retrieval; enhanced error handling, logging, and transactional behavior.                                                                                                                         |
| `src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelAlreadyAssignedException.java`<br>`src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelNotFoundException.java` | Introduced two custom exceptions with annotated HTTP statuses for better error responses.                                                                                                                                                   |
| `src/main/java/com/bytebreeze/quickdrop/repository/ParcelRepository.java`                                                                                                  | Added new method `findByStatusAndRider` to query parcels by status and rider.                                                                                                                                                               |
| `src/main/resources/db/migration/V5__Add_isAssigned_to_Rider.sql`                                                                                                           | Added new BOOLEAN column `is_assigned` with a default value of FALSE to the riders table.                                                                                                                                                    |
| `src/main/resources/templates/fragments/sidebar-rider.html`<br>`src/main/resources/templates/rider/view-current-parcels.html`<br>`src/main/resources/templates/rider/view-assigned-parcels.html`           | Updated navigation link in sidebar; introduced a new view for assigned parcels; modified success message variable for consistency in the rider UI.                                                                                        |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant Rider as Rider
    participant RC as RiderController
    participant RS as RiderService
    participant Repo as ParcelRepository
    participant Ex as ExceptionHandler

    Rider->>RC: Request acceptParcel(parcelId)
    RC->>RS: Process acceptParcelDelivery(parcelId)
    RS->>Repo: Query parcel by ID
    alt Parcel not found
        Repo-->>RS: null
        RS->>Ex: Throw ParcelNotFoundException
    else Parcel exists
        alt Parcel already assigned or rider already assigned
            RS->>Ex: Throw ParcelAlreadyAssignedException
        else
            RS->>Repo: Update parcel with rider info and status
            Repo-->>RS: Confirmation
            RS-->>RC: Success response
        end
    end
    RC-->>Rider: Flash message with result
```

## Possibly related issues

- **Learnathon-By-Geeky-Solutions/byte-breeze#85:** The introduction of the `acceptParcel` method and improved error handling directly address the parcel acceptance functionality described in this issue.

## Possibly related PRs

- **Learnathon-By-Geeky-Solutions/byte-breeze#248:** The changes in the main PR are related to those in the retrieved PR as both involve modifications to the `RiderController` class, specifically the introduction of the `acceptParcel` method and enhancements to parcel handling logic.
- **Learnathon-By-Geeky-Solutions/byte-breeze#225:** Updates to the RiderController for method handling and logical improvements align with this PR’s modifications.
- **Learnathon-By-Geeky-Solutions/byte-breeze#222:** The changes in the main PR, particularly the updates to the `RiderController` class and the introduction of new methods in the `RiderService`, are related to the modifications made in the retrieved PR.

## Poem

> 🤖 In circuits deep, new methods gleam,  
> Data flows swiftly like a laser beam.  
> Controllers and services now unite,  
> Handling parcels with logic bright.  
> Code updated—beep boop, system delight!  
> 🚀 01001000 01100001 01110000 01110000 01111001 coding!

</details>

<!-- walkthrough_end -->
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEejqANiS4AxEtQD0zbVkT0AjAGZIFeEr5oDAwk3Lg8aBTBFpBKFpKU8hQkAI7Y0rgGAHLYzAKUXABMAKwFBgCqiPmQANKw2hTYFgBCaIh1FAK0RvrG4FBk9PgAZjgExGTKNPRMrOxcvPzCouJSMvJM/ipqmtq6YIYmUHCoqJijhKTkVFMKsxicPmgA7pCIOc4U8nIKm6rqWjoer1TAZEJEnC4HEI0BI0A4Zg45DQBEkSAAvEgOVLwBgAa1oFHw3Hh+HuhIsVgoDgASn5KABhUm4cmUjTQ2EcAwAIh5BgAxHzIABBACS4yu1Dor3eEXkw0YdQwpEQZlgJEgAANaf5GWT8BTKBrGBZWsg6jISGRINhuLRJfQnupYK8SFIqNEhtgMGJ4KS0NEyIrgmx7shMPRKIS+IraHElShmLx8FIQ7hEBphZByC94In8BQwohcJLU5AhvnILg1ZqAAoRKJG5iKEjRc2QPJWtC0JS0AA06AspKIkEdVcr1Y1AAEAMoWIYAFiERswGHwxfEpLLFcHRCI8HjDDQ3BU8Di4mkGdV6rYVcUmra+Ce9OwFCS9zrkRbiGpKTSRaNbYdlgb5oGw9BDISzCag4MLaCaAhWGAx6fhYiBGgQ0EMC+b64Eh9ZfsuGD0G2Xr+EQpLqog8BEBg8BDDimBhDuOIKpgyoZiKYSri8STMvArrSOO6poHgar3AxNy+P46BEQqoi4sgdFCT4dJ8KciBUTRdAcSMVbqlJlAoGGGnUeQfYoGE1A0ImaaVvgZ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ecdwcGecAAdncCKAEHcHnAr4KAKBGCBH9/D/UEz+z9z6Znz4GGL6AA=== -->

<!-- internal state end -->

---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: ASSERTIVE**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between eb52fdcbae06c3bb26aef5f641fa4715b14fd22f and 936575806ed5f0cecd331946bf096e59207f367f.

</details>

<details>
<summary>📒 Files selected for processing (5)</summary>

* `src/main/java/com/bytebreeze/quickdrop/controller/RiderController.java` (2 hunks)
* `src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelAlreadyAssignedException.java` (1 hunks)
* `src/main/java/com/bytebreeze/quickdrop/exception/custom/ParcelNotFoundException.java` (1 hunks)
* `src/main/java/com/bytebreeze/quickdrop/repository/ParcelRepository.java` (2 hunks)
* `src/main/java/com/bytebreeze/quickdrop/service/RiderService.java` (3 hunks)

</details>

</details>
<!-- finishing_touch_checkbox_start -->

<details>
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---



<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=Learnathon-By-Geeky-Solutions/byte-breeze&utm_content=252):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Generate unit testing code for this file.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai generate unit testing code for this file.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and generate unit testing code.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai plan` to trigger planning for file edits and PR creation.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->
author_association: NONE
user: login: Warhammer4000
created_at: 2025-03-29T17:37:09Z
body: ![](https://res.cloudinary.com/snyk/image/upload/r-d/scm-platform/snyk-pull-requests/pr-banner-default.svg)

### :tada: **Snyk checks have passed. No issues have been found so far.**

:white_check_mark: **security/snyk** check is complete. No issues have been found. [(View Details)](https://app.snyk.io/org/warhammer4000/pr-checks/7ab8dcb7-f408-4023-b460-5f339d2cd353?refs=eb52fdcbae06c3bb26aef5f641fa4715b14fd22f&source=prChecksComment)



author_association: CONTRIBUTOR