From 45c38bcf59a587bee23f8ef4aaee7c1a8a59f177 Mon Sep 17 00:00:00 2001
From: "hamza.bouslama" <hamza.bouslama@marketingconfort.com>
Date: Thu, 3 Apr 2025 08:14:51 +0000
Subject: [PATCH] fix bug in restor sale session functionality

---
 CHANGELOG.md                                                   | 1 +
 .../mydressin/services/impl/SaleSessionServiceImp.java         | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 45c4b44..a321b68 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,7 @@
 
 ### Fixed
 - fix item count
+- Restor a sale session fixed
 
 ### Security
 - Any security improvements.
diff --git a/src/main/java/com/marketingconfort/mydressin/services/impl/SaleSessionServiceImp.java b/src/main/java/com/marketingconfort/mydressin/services/impl/SaleSessionServiceImp.java
index 2bcc906..367cc1f 100644
--- a/src/main/java/com/marketingconfort/mydressin/services/impl/SaleSessionServiceImp.java
+++ b/src/main/java/com/marketingconfort/mydressin/services/impl/SaleSessionServiceImp.java
@@ -240,7 +240,6 @@ public class SaleSessionServiceImp implements SaleSessionService {
     public boolean deleteSaleSessionById(Long sessionId) {
         SaleSession saleSession = saleSessionRepository.findById(sessionId)
                 .orElseThrow(() -> new SaleSessionNotFoundException("Sale session not found for id: " + sessionId));
-
         saleSession.setStatus("DELETED");
         saleSessionRepository.save(saleSession);
         return true;
@@ -252,7 +251,7 @@ public class SaleSessionServiceImp implements SaleSessionService {
     public SaleSessionDTO restockSaleSession(Long sessionId) {
         SaleSession saleSession = saleSessionRepository.findById(sessionId)
                 .orElseThrow(() -> new SaleSessionNotFoundException("Sale session not found for id: " + sessionId));
-        saleSession.setStatus(null);
+        saleSession.setStatus("ACTIVE");
         SaleSession updatedSaleSession = saleSessionRepository.save(saleSession);
         return saleSessionMapper.toDTO(updatedSaleSession);
     }
-- 
GitLab