Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
PierpaoloSpadafora committed Dec 16, 2024
1 parent 30abfac commit 6bf0da9
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,4 @@

@Repository
public interface JobRepository extends JpaRepository<Job, Long> {
Optional<Job> findByTitle(String title);
List<Job> findByStatus(JobStatus status);
List<Job> findByAssignee_Id(String assigneeId);
List<Job> findByAssigneeEmail(String email);
List<Job> findByPriority(JobPriority priority);
List<Job> findByDurationGreaterThan(java.time.Duration duration);
List<Job> findByRequiredMachineType_Id(Long machineTypeId);
List<Job> findByPriorityAndStatus(JobPriority priority, JobStatus status);
List<Job> findByDurationBetween(java.time.Duration minDuration, java.time.Duration maxDuration);
List<Job> findByAssignee_IdAndPriority(String assigneeId, JobPriority priority);
List<Job> findByStatusAndRequiredMachineType_IdAndAssignee_Id(JobStatus status, Long machineTypeId, String assigneeId);
void deleteByRequiredMachineType_Id(Long machineTypeId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
import java.util.Optional;

public interface MachineRepository extends JpaRepository<Machine, Long> {
Optional<Machine> findById(Long id);
Optional<Machine> findByName(String name);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

@Repository
public interface MachineTypeRepository extends JpaRepository<MachineType, Long> {
Optional<MachineType> findById(Long id);
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,7 @@

@Repository
public interface ScheduleRepository extends JpaRepository<Schedule, Long> {
List<Schedule> findByStatus(ScheduleStatus status);
List<Schedule> findByJob_Id(Long jobId);
List<Schedule> findByMachineType_Id(long machineTypeId);
List<Schedule> findByStartTimeAfter(LocalDateTime startTime);
List<Schedule> findByStartTimeBefore(LocalDateTime endTime);
List<Schedule> findByStartTimeBetween(LocalDateTime start, LocalDateTime end);

List<Schedule> findByMachineType_IdAndStatus(long machineTypeId, ScheduleStatus scheduleStatus);
List<Schedule> findByStatusNotInAndStartTimeBefore(List<ScheduleStatus> statuses, LocalDateTime dateTime);
List<Schedule> findAll();

@Query(value = "SELECT MAX(start_time + (duration * INTERVAL '1 second')) " +
"FROM schedules WHERE machine_id = :machineType",
nativeQuery = true)
Optional<LocalDateTime> findLatestEndTimeForMachine(@Param("machineType") String machineType);

List<Schedule> findByDueDateBefore(LocalDateTime date);
List<Schedule> findByDueDateAfter(LocalDateTime date);
}

0 comments on commit 6bf0da9

Please sign in to comment.