Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: GET organization broker by fiscal code #7

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);

}
Loading