diff --git a/src/main/kotlin/com/carbonara/core/order/OrderService.kt b/src/main/kotlin/com/carbonara/core/order/OrderService.kt index 341e35d..05a811f 100644 --- a/src/main/kotlin/com/carbonara/core/order/OrderService.kt +++ b/src/main/kotlin/com/carbonara/core/order/OrderService.kt @@ -123,7 +123,7 @@ class OrderService( val updatedOrder = order.copy( paymentDetails = order.paymentDetails.copy(internalPaymentStatus = InternalPaymentStatus.FAILED), updatedAt = OffsetDateTime.now().toString(), - orderStatus = OrderStatus.CANCELLED + orderStatus = OrderStatus.PAYMENT_FAILED ) orderRepository.save(updatedOrder).awaitSingleOrNull() ?: run { log.error("Failed to update payment status to failed for orderId={}", order.orderId) diff --git a/src/main/kotlin/com/carbonara/core/order/OrderStatus.kt b/src/main/kotlin/com/carbonara/core/order/OrderStatus.kt index 6a4ebec..9070b41 100644 --- a/src/main/kotlin/com/carbonara/core/order/OrderStatus.kt +++ b/src/main/kotlin/com/carbonara/core/order/OrderStatus.kt @@ -6,5 +6,6 @@ enum class OrderStatus { FINDING_AVAILABLE_RIDER, DELIVERY_IN_PROGRESS, DELIVERED, - CANCELLED + PAYMENT_FAILED, + CANCELLED, } diff --git a/src/test/kotlin/com/carbonara/core/order/OrderServiceTest.kt b/src/test/kotlin/com/carbonara/core/order/OrderServiceTest.kt index b683ee8..e667ae5 100644 --- a/src/test/kotlin/com/carbonara/core/order/OrderServiceTest.kt +++ b/src/test/kotlin/com/carbonara/core/order/OrderServiceTest.kt @@ -233,7 +233,7 @@ class OrderServiceTest { val ORDER_DAO_PAYMENT_FAILED = ORDER_DAO.copy( paymentDetails = ORDER_DAO.paymentDetails.copy( internalPaymentStatus = InternalPaymentStatus.FAILED), - orderStatus = OrderStatus.CANCELLED + orderStatus = OrderStatus.PAYMENT_FAILED ) } }