// Path: count-stats/src/main/java/uk/ac/ebi/eva/countstats/model/Count.java
// @Data
// @NoArgsConstructor
// @RequiredArgsConstructor
// @Entity
// @Table(name = "count_stats")
// @TypeDefs({@TypeDef(name = "StringJsonObject", typeClass = StringJsonUserType.class)})
// public class Count {
//     @Id
//     @GeneratedValue(strategy = GenerationType.IDENTITY)
//     private Long id;
// 
//     @NonNull
//     @Column(nullable = false)
//     private String process;
// 
//     @NonNull
//     @Column(nullable = false)
//     @Type(type = "StringJsonObject")
//     private String identifier;
// 
//     @NonNull
//     @Column(nullable = false)
//     private String metric;
// 
//     @NonNull
//     @Column(nullable = false)
//     private long count;
// 
//     @Column(nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
//     private LocalDateTime timestamp;
// }
// 
// Path: count-stats/src/main/java/uk/ac/ebi/eva/countstats/repository/CountRepository.java
// public interface CountRepository extends CrudRepository<Count, Long> {
//     @Query(value = "SELECT sum(cs.count) FROM count_stats cs WHERE cs.process=?1 and cs.identifier->>'study'=?2", nativeQuery = true)
//     Long getCountForProcess(String process, String study);
// }


import org.springframework.stereotype.Service;
import uk.ac.ebi.eva.countstats.model.Count;
import uk.ac.ebi.eva.countstats.repository.CountRepository;
import java.util.List;
package uk.ac.ebi.eva.countstats.service;



@Service
public class CountService {
    private CountRepository countRepository;

// Path: count-stats/src/main/java/uk/ac/ebi/eva/countstats/model/Count.java
// @Data
// @NoArgsConstructor
// @RequiredArgsConstructor
// @Entity
// @Table(name = "count_stats")
// @TypeDefs({@TypeDef(name = "StringJsonObject", typeClass = StringJsonUserType.class)})
// public class Count {
//     @Id
//     @GeneratedValue(strategy = GenerationType.IDENTITY)
//     private Long id;
// 
//     @NonNull
//     @Column(nullable = false)
//     private String process;
// 
//     @NonNull
//     @Column(nullable = false)
//     @Type(type = "StringJsonObject")
//     private String identifier;
// 
//     @NonNull
//     @Column(nullable = false)
//     private String metric;
// 
//     @NonNull
//     @Column(nullable = false)
//     private long count;
// 
//     @Column(nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
//     private LocalDateTime timestamp;
// }
// 
// Path: count-stats/src/main/java/uk/ac/ebi/eva/countstats/repository/CountRepository.java
// public interface CountRepository extends CrudRepository<Count, Long> {
//     @Query(value = "SELECT sum(cs.count) FROM count_stats cs WHERE cs.process=?1 and cs.identifier->>'study'=?2", nativeQuery = true)
//     Long getCountForProcess(String process, String study);
// }


// Path: count-stats/src/main/java/uk/ac/ebi/eva/countstats/service/CountService.java
import org.springframework.stereotype.Service;
import uk.ac.ebi.eva.countstats.model.Count;
import uk.ac.ebi.eva.countstats.repository.CountRepository;
import java.util.List;

package uk.ac.ebi.eva.countstats.service;



@Service
public class CountService {
    private CountRepository countRepository;

    public CountService(CountRepository countRepository) {