Skip to content

Commit

Permalink
feat: GET organization broker by fiscal code (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElisKina-dev authored Dec 18, 2024
1 parent 9d84bd8 commit e96d51f
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 26 deletions.
84 changes: 58 additions & 26 deletions openapi/generated.openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,38 @@
}
}
},
"/brokers/search/findByOrgFiscalCode": {
"get": {
"tags": [
"broker-search-controller"
],
"operationId": "executeSearch-broker-get",
"parameters": [
{
"name": "orgFiscalCode",
"in": "query",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/hal+json": {
"schema": {
"$ref": "#/components/schemas/EntityModelBroker"
}
}
}
},
"404": {
"description": "Not Found"
}
}
}
},
"/brokers/{id}": {
"get": {
"tags": [
Expand Down Expand Up @@ -861,32 +893,6 @@
}
}
},
"PersonalisationFe": {
"type": "object",
"properties": {
"headerAssistanceUrl": {
"type": "string"
},
"logoFooterImg": {
"type": "string"
},
"footerDescText": {
"type": "string"
},
"footerPrivacyInfoUrl": {
"type": "string"
},
"footerGDPRUrl": {
"type": "string"
},
"footerTermsCondUrl": {
"type": "string"
},
"footerAccessibilityUrl": {
"type": "string"
}
}
},
"EntityModelBroker": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -940,6 +946,32 @@
}
}
},
"PersonalisationFe": {
"type": "object",
"properties": {
"headerAssistanceUrl": {
"type": "string"
},
"logoFooterImg": {
"type": "string"
},
"footerDescText": {
"type": "string"
},
"footerPrivacyInfoUrl": {
"type": "string"
},
"footerGDPRUrl": {
"type": "string"
},
"footerTermsCondUrl": {
"type": "string"
},
"footerAccessibilityUrl": {
"type": "string"
}
}
},
"PagedModelEntityModelBroker": {
"type": "object",
"properties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@

import it.gov.pagopa.pu.organization.model.Broker;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

import java.util.Optional;

@RepositoryRestResource(collectionResourceRel = "broker", path = "brokers")
public interface BrokerRepository extends JpaRepository<Broker,Long> {

@Query("select b from broker b join Organization o on b.brokerId = o.brokerId " +
"where o.orgFiscalCode = :orgFiscalCode")
Optional<Broker> findByOrgFiscalCode(String orgFiscalCode);

}

0 comments on commit e96d51f

Please sign in to comment.