This commit is contained in:
Bhumi Shah
2025-12-05 20:55:19 +03:00
parent 9f437b83e2
commit 884adb5d6e
7 changed files with 0 additions and 29 deletions

View File

@@ -9,13 +9,11 @@ import com.example.nto.repository.PlaceRepository;
import com.example.nto.service.BookingService;
import com.example.nto.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDate;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

View File

@@ -1,20 +1,12 @@
package com.example.nto.controller;
import com.example.nto.entity.Booking;
import com.example.nto.entity.Employee;
import com.example.nto.excepation.EmployeeNotFoundException;
import com.example.nto.repository.BookingRepository;
import com.example.nto.repository.EmployeeRepository;
import com.example.nto.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* TODO: ДОРАБОТАТЬ в рамках задания
* =================================

View File

@@ -1,7 +0,0 @@
package com.example.nto.excepation;
public class ConflictException extends RuntimeException {
public ConflictException(String message) {
super(message);
}
}

View File

@@ -1,8 +1,6 @@
package com.example.nto.service;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service

View File

@@ -7,7 +7,6 @@ import org.springframework.stereotype.Service;
@Service
public class PlaceServise {
private final PlaceRepository placeRepository;
public PlaceServise(PlaceRepository placeRepository) {
this.placeRepository = placeRepository;
}

View File

@@ -35,7 +35,6 @@ public class BookingServiceImpl implements BookingService {
if (employee == null) {
throw new EmployeeNotFoundException("Employee not found with code: " + employeeCode);
}
LocalDate today = LocalDate.now();
LocalDate endDate = today.plusDays(3);
List<Booking> bookings = bookingRepository.findByDateBetween(today, endDate);

View File

@@ -1,5 +1,4 @@
package com.example.nto.service.impl;
import com.example.nto.entity.Booking;
import com.example.nto.entity.Employee;
import com.example.nto.excepation.EmployeeNotFoundException;
import com.example.nto.repository.BookingRepository;
@@ -8,8 +7,6 @@ import com.example.nto.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* TODO: ДОРАБОТАТЬ в рамках задания
@@ -19,13 +16,8 @@ import java.util.List;
*/
@Service
public class EmployeeServiceImpl implements EmployeeService {
@Autowired
private EmployeeRepository employeeRepository;
@Autowired
private BookingRepository bookingRepository;
@Override
public Employee getEmployeeWithBookings(String code) {
if (code == null || code.isEmpty()) {