-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(organization): display the libelle of NAF/APE again
- Loading branch information
1 parent
8ad99d8
commit 87c8d0a
Showing
12 changed files
with
218 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
packages/~/organizations/lib/src/usecase/GetFicheOrganizationById.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// | ||
|
||
import { NotFoundError } from "@~/app.core/error"; | ||
import type { MonCompteProDatabaseCradle } from "@~/moncomptepro.database"; | ||
|
||
export function GetFicheOrganizationById({ pg }: MonCompteProDatabaseCradle) { | ||
return async function get_fiche_organization_by_id(id: number) { | ||
const organization = await pg.query.organizations.findFirst({ | ||
columns: { | ||
cached_activite_principale: true, | ||
cached_adresse: true, | ||
cached_categorie_juridique: true, | ||
cached_code_officiel_geographique: true, | ||
cached_code_postal: true, | ||
cached_enseigne: true, | ||
cached_est_active: true, | ||
cached_etat_administratif: true, | ||
cached_libelle_activite_principale: true, | ||
cached_libelle_categorie_juridique: true, | ||
cached_libelle_tranche_effectif: true, | ||
cached_libelle: true, | ||
cached_nom_complet: true, | ||
cached_tranche_effectifs: true, | ||
created_at: true, | ||
id: true, | ||
siret: true, | ||
updated_at: true, | ||
}, | ||
where: (table, { eq }) => eq(table.id, id), | ||
}); | ||
|
||
if (!organization) throw new NotFoundError("Organization not found."); | ||
return organization; | ||
}; | ||
} | ||
|
||
export type GetFicheOrganizationByIdHandler = ReturnType< | ||
typeof GetFicheOrganizationById | ||
>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.