Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into github-action-deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
HAEKADI committed Feb 28, 2024
2 parents 07007da + 29846b4 commit aaf8bd1
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 1 deletion.
23 changes: 22 additions & 1 deletion aio/aio-proxy/aio_proxy/doc/open-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,16 @@ paths:
enum:
- true
- false
- name: est_siae
in: query
description: >-
Uniquement les structures d'insertion par l'activité économique (SIAE).
required: false
schema:
type: boolean
enum:
- true
- false
- name: est_service_public
in: query
description: >-
Expand Down Expand Up @@ -1216,6 +1226,12 @@ paths:
Entreprise ayant au moins un établissement RGE
(source : ADEME)
example: false
est_siae:
type: boolean
description: >-
Structure d'insertion par l'activité économique
(source : Marché de l'Inclusion)
example: false
est_service_public:
type: boolean
description: >-
Expand Down Expand Up @@ -1245,7 +1261,7 @@ paths:
example: null
description: >-
Numéro au Répertoire National des Associations (RNA)
(source : base SIRENE).
(source : base SIRENE)
statut_bio:
type: boolean
description: >-
Expand All @@ -1258,6 +1274,11 @@ paths:
Statut des établissements ayant fait une demande de
licence d'entrepreneur du spectacle
(source: Ministère de la Culture)
type_siae:
type: string
description: >-
Type de structure de l'inclusion
(source: Marché de l'Inclusion)
total_results:
type: integer
page:
Expand Down
2 changes: 2 additions & 0 deletions aio/aio-proxy/aio_proxy/request/search_params_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class SearchParams(BaseModel):
type_personne: str | None = None
etat_administratif_unite_legale: str | None = None
nature_juridique_unite_legale: list | None = None
est_siae: bool | None = None
matching_size: int = 10
lat: float | None = None
lon: float | None = None
Expand Down Expand Up @@ -209,6 +210,7 @@ def field_must_be_in_valid_list(cls, value: str, info) -> str:
"est_service_public",
"minimal",
"est_societe_mission",
"est_siae",
mode="before",
)
def convert_str_to_bool(cls, boolean: str, info) -> bool:
Expand Down
4 changes: 4 additions & 0 deletions aio/aio-proxy/aio_proxy/response/formatters/complements.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ def get_field(field, default=None):
liste_id_organisme_formation = get_field("liste_id_organisme_formation")
est_rge = get_field("est_rge")
est_service_public = get_field("est_service_public")
est_siae = get_field("est_siae")
est_societe_mission = format_insee_bool(get_field("est_societe_mission"))
est_uai = get_field("est_uai")
identifiant_association = get_field("identifiant_association_unite_legale")
statut_entrepreneur_spectacle = get_field(
"statut_entrepreneur_spectacle",
)
type_siae = get_field("type_siae")
return Complements(
collectivite_territoriale=collectivite_territoriale,
convention_collective_renseignee=convention_collective_renseignee,
Expand All @@ -50,9 +52,11 @@ def get_field(field, default=None):
est_qualiopi=est_qualiopi,
liste_id_organisme_formation=liste_id_organisme_formation,
est_rge=est_rge,
est_siae=est_siae,
est_service_public=est_service_public,
est_societe_mission=est_societe_mission,
est_uai=est_uai,
identifiant_association=identifiant_association,
statut_entrepreneur_spectacle=statut_entrepreneur_spectacle,
type_siae=type_siae,
)
2 changes: 2 additions & 0 deletions aio/aio-proxy/aio_proxy/response/unite_legale_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,12 @@ class Complements(BaseModel):
liste_id_organisme_formation: list | None = None
est_rge: bool = False
est_service_public: bool = False
est_siae: bool = False
est_societe_mission: bool = False
est_uai: bool = False
identifiant_association: str | None = None
statut_entrepreneur_spectacle: str | None = None
type_siae: str | None = None


class UniteLegaleResponse(BaseModel):
Expand Down
1 change: 1 addition & 0 deletions aio/aio-proxy/aio_proxy/search/text_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def build_es_search_text_query(es_search_builder):
"est_uai",
"etat_administratif_unite_legale",
"est_societe_mission",
"est_siae",
],
)

Expand Down
7 changes: 7 additions & 0 deletions aio/aio-proxy/aio_proxy/tests/e2e_tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,3 +600,10 @@ def test_epci(api_response_tester):
response.json()["results"][0]["matching_etablissements"][0]["epci"]
== "248100737"
)


def test_siae_filter(api_response_tester):
path = "search?est_siae=true"
api_response_tester.assert_api_response_code_200(path)
api_response_tester.test_number_of_results(path, 1)
api_response_tester.test_field_value(path, 0, "complements.est_siae", True)

0 comments on commit aaf8bd1

Please sign in to comment.