package com.example.computers.repository;

import com.example.computers.entity.Repair;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.util.List;

public interface RepairRepository extends JpaRepository<Repair, Long> {
    @Query("SELECT r FROM Repair r WHERE " +
            "LOWER(r.description) LIKE LOWER(CONCAT('%', :q, '%'))")
    List<Repair> search(@Param("q") String query);
}