Skip to content

Commit

Permalink
updated entity
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksiybozhykntt committed Dec 20, 2024
1 parent 0e3a953 commit 165654b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package it.gov.pagopa.pu.organization.controller;

import it.gov.pagopa.pu.organization.dto.DistinctOrganizationTypeDTO;
import it.gov.pagopa.pu.organization.model.DistinctOrganizationTypeDTO;
import it.gov.pagopa.pu.organization.service.TaxonomyService;
import java.util.List;
import org.springframework.http.HttpStatusCode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package it.gov.pagopa.pu.organization.dto;
package it.gov.pagopa.pu.organization.model;

import it.gov.pagopa.pu.organization.model.Taxonomy;
import org.springframework.data.rest.core.config.Projection;

@Projection(name = "distinctOrganizationType", types = { Taxonomy.class })
@Projection(name = "dataView", types = Taxonomy.class)
public interface DistinctOrganizationTypeDTO {
String getOrganizationType();
String getOrganizationTypeDescription();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package it.gov.pagopa.pu.organization.repository;

import it.gov.pagopa.pu.organization.dto.DistinctCollectionReasonDTO;
import it.gov.pagopa.pu.organization.dto.DistinctMacroAreaDTO;
import it.gov.pagopa.pu.organization.dto.DistinctOrganizationTypeDTO;
import it.gov.pagopa.pu.organization.dto.DistinctServiceTypeDTO;
import it.gov.pagopa.pu.organization.dto.DistinctTaxonomyCodeDTO;
import it.gov.pagopa.pu.organization.model.DistinctOrganizationTypeDTO;
import it.gov.pagopa.pu.organization.model.Taxonomy;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
Expand All @@ -13,15 +9,17 @@

@RepositoryRestResource(collectionResourceRel = "taxonomy", path = "taxonomy")
public interface TaxonomyRepository extends JpaRepository<Taxonomy, Long> {
@Query("SELECT DISTINCT t.organizationType,t.organizationTypeDescription FROM Taxonomy t")
List<DistinctOrganizationTypeDTO> findDistinctOrganizationType();

List<DistinctMacroAreaDTO> findDistinctMacroAreaCodeByOrganizationType(String organizationType);
@Query("select distinct t.organizationType as organizationType, t.organizationTypeDescription as organizationTypeDescription from Taxonomy t")
List<Taxonomy> findDistinctOrganizationTypeAndOrganizationTypeDescriptionBy();
List<Taxonomy> findDistinctOrganizationTypeBy();

List<DistinctServiceTypeDTO> findDistinctServiceTypeCodeByOrganizationTypeAndMacroAreaCode(String organizationType,String macroAreaCode);
List<Taxonomy> findDistinctMacroAreaCodeByOrganizationType(String organizationType);

List<DistinctCollectionReasonDTO> findDistinctCollectionReasonByOrganizationTypeAndMacroAreaCodeAndServiceTypeCode(String organizationType,String macroAreaCode,String serviceTypeCode);
List<Taxonomy> findDistinctServiceTypeCodeByOrganizationTypeAndMacroAreaCode(String organizationType,String macroAreaCode);

List<DistinctTaxonomyCodeDTO> findDistinctTaxonomyCodeByOrganizationTypeAndMacroAreaCodeAndServiceTypeCodeAndCollectionReason(String organizationType,String macroAreaName,String serviceType,String collectionReason);
List<Taxonomy> findDistinctCollectionReasonByOrganizationTypeAndMacroAreaCodeAndServiceTypeCode(String organizationType,String macroAreaCode,String serviceTypeCode);

List<Taxonomy> findDistinctTaxonomyCodeByOrganizationTypeAndMacroAreaCodeAndServiceTypeCodeAndCollectionReason(String organizationType,String macroAreaName,String serviceType,String collectionReason);

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package it.gov.pagopa.pu.organization.service;

import it.gov.pagopa.pu.organization.dto.DistinctOrganizationTypeDTO;
import it.gov.pagopa.pu.organization.model.DistinctOrganizationTypeDTO;
import it.gov.pagopa.pu.organization.repository.TaxonomyRepository;
import java.util.List;
import org.springframework.stereotype.Service;
Expand Down

0 comments on commit 165654b

Please sign in to comment.