package ai.decompile.workspace.model.specification;

import ai.decompile.workspace.model.entity.Workspace;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.springframework.data.jpa.domain.Specification;

@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class WorkspaceSpecification {
  public static Specification<Workspace> nameContains(String name) {
    return (root, _, cb) -> cb.like(cb.lower(root.get("name")), "%" + name.toLowerCase() + "%");
  }
}
