-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(backend): remove extendApi not needed for documentation
- Loading branch information
Showing
49 changed files
with
536 additions
and
656 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
15 changes: 6 additions & 9 deletions
15
backend/src/collectivites/documents/models/document-lien.dto.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 |
---|---|---|
@@ -1,16 +1,13 @@ | ||
import { extendApi } from '@anatine/zod-openapi'; | ||
import { z } from 'zod'; | ||
|
||
export type lienType = { | ||
label: string; | ||
url: string; | ||
}; | ||
|
||
export const lienSchema = extendApi( | ||
z | ||
.object({ | ||
label: z.string().describe(`Nom descriptif du lien`), | ||
url: z.string().describe(`URL du lien`), | ||
}) | ||
.describe('Un lien URL.') | ||
); | ||
export const lienSchema = z | ||
.object({ | ||
label: z.string().describe(`Nom descriptif du lien`), | ||
url: z.string().describe(`URL du lien`), | ||
}) | ||
.describe('Un lien URL.'); |
17 changes: 7 additions & 10 deletions
17
backend/src/indicateurs/models/calcul-trajectoire-response-donnees.dto.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 |
---|---|---|
@@ -1,16 +1,13 @@ | ||
import { extendApi } from '@anatine/zod-openapi'; | ||
import { z } from 'zod'; | ||
import { indicateurAvecValeursSchema } from './indicateur-valeur.table'; | ||
|
||
export const calculTrajectoireResponseDonneesSchema = extendApi( | ||
z | ||
.object({ | ||
emissionsGes: z.array(indicateurAvecValeursSchema), | ||
consommationsFinales: z.array(indicateurAvecValeursSchema), | ||
sequestrations: z.array(indicateurAvecValeursSchema), | ||
}) | ||
.describe('Données de la trajectoire SNBC') | ||
); | ||
export const calculTrajectoireResponseDonneesSchema = z | ||
.object({ | ||
emissionsGes: z.array(indicateurAvecValeursSchema), | ||
consommationsFinales: z.array(indicateurAvecValeursSchema), | ||
sequestrations: z.array(indicateurAvecValeursSchema), | ||
}) | ||
.describe('Données de la trajectoire SNBC'); | ||
export type CalculTrajectoireResponseDonneesType = z.infer< | ||
typeof calculTrajectoireResponseDonneesSchema | ||
>; |
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
19 changes: 8 additions & 11 deletions
19
backend/src/indicateurs/models/calcul-trajectoire.response.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
43 changes: 20 additions & 23 deletions
43
backend/src/indicateurs/models/delete-indicateurs.request.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 |
---|---|---|
@@ -1,28 +1,25 @@ | ||
import { extendApi } from '@anatine/zod-openapi'; | ||
import { z } from 'zod'; | ||
|
||
export const deleteIndicateursValeursRequestSchema = extendApi( | ||
z | ||
.object({ | ||
collectiviteId: z.coerce | ||
.number() | ||
.int() | ||
.describe('Identifiant de la collectivité'), | ||
indicateurId: z.coerce | ||
.number() | ||
.int() | ||
.optional() | ||
.describe("Identifiant de l'indicateur"), | ||
metadonneeId: z.coerce | ||
.number() | ||
.int() | ||
.optional() | ||
.describe( | ||
'Identifiant de la métadonnée permettant de sélectionner une source' | ||
), | ||
}) | ||
.describe('Filtre de suppression des valeurs des indicateurs') | ||
); | ||
export const deleteIndicateursValeursRequestSchema = z | ||
.object({ | ||
collectiviteId: z.coerce | ||
.number() | ||
.int() | ||
.describe('Identifiant de la collectivité'), | ||
indicateurId: z.coerce | ||
.number() | ||
.int() | ||
.optional() | ||
.describe("Identifiant de l'indicateur"), | ||
metadonneeId: z.coerce | ||
.number() | ||
.int() | ||
.optional() | ||
.describe( | ||
'Identifiant de la métadonnée permettant de sélectionner une source' | ||
), | ||
}) | ||
.describe('Filtre de suppression des valeurs des indicateurs'); | ||
export type DeleteIndicateursValeursRequestType = z.infer< | ||
typeof deleteIndicateursValeursRequestSchema | ||
>; |
13 changes: 5 additions & 8 deletions
13
backend/src/indicateurs/models/delete-indicateurs.response.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
21 changes: 9 additions & 12 deletions
21
backend/src/indicateurs/models/donnees-a-remplir-result.dto.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 |
---|---|---|
@@ -1,13 +1,10 @@ | ||
import { extendApi } from "@anatine/zod-openapi"; | ||
import { z } from "zod"; | ||
import { donneesARemplirValeurSchema } from "./donnees-a-remplir-valeur.dto"; | ||
import { z } from 'zod'; | ||
import { donneesARemplirValeurSchema } from './donnees-a-remplir-valeur.dto'; | ||
|
||
export const donneesARemplirResultSchema = extendApi( | ||
z.object({ | ||
valeurs: z.array(donneesARemplirValeurSchema), | ||
identifiantsReferentielManquants: z.array(z.string()), | ||
}) | ||
); | ||
export type DonneesARemplirResultType = z.infer< | ||
typeof donneesARemplirResultSchema | ||
>; | ||
export const donneesARemplirResultSchema = z.object({ | ||
valeurs: z.array(donneesARemplirValeurSchema), | ||
identifiantsReferentielManquants: z.array(z.string()), | ||
}); | ||
export type DonneesARemplirResultType = z.infer< | ||
typeof donneesARemplirResultSchema | ||
>; |
23 changes: 10 additions & 13 deletions
23
backend/src/indicateurs/models/donnees-a-remplir-valeur.dto.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 |
---|---|---|
@@ -1,14 +1,11 @@ | ||
import { extendApi } from "@anatine/zod-openapi"; | ||
import { z } from "zod"; | ||
import { z } from 'zod'; | ||
|
||
export const donneesARemplirValeurSchema = extendApi( | ||
z.object({ | ||
identifiantsReferentiel: z.array(z.string()), | ||
valeur: z.number().nullable(), | ||
dateMin: z.string().nullable(), | ||
dateMax: z.string().nullable(), | ||
}) | ||
); | ||
export type DonneesARemplirValeurType = z.infer< | ||
typeof donneesARemplirValeurSchema | ||
>; | ||
export const donneesARemplirValeurSchema = z.object({ | ||
identifiantsReferentiel: z.array(z.string()), | ||
valeur: z.number().nullable(), | ||
dateMin: z.string().nullable(), | ||
dateMax: z.string().nullable(), | ||
}); | ||
export type DonneesARemplirValeurType = z.infer< | ||
typeof donneesARemplirValeurSchema | ||
>; |
15 changes: 6 additions & 9 deletions
15
backend/src/indicateurs/models/donnees-calcul-trajectoire-a-remplir.dto.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 |
---|---|---|
@@ -1,15 +1,12 @@ | ||
import { extendApi } from '@anatine/zod-openapi'; | ||
import { z } from 'zod'; | ||
import { donneesARemplirResultSchema } from './donnees-a-remplir-result.dto'; | ||
|
||
export const donneesCalculTrajectoireARemplirSchema = extendApi( | ||
z.object({ | ||
sources: z.string().array(), | ||
emissionsGes: donneesARemplirResultSchema, | ||
consommationsFinales: donneesARemplirResultSchema, | ||
sequestrations: donneesARemplirResultSchema, | ||
}) | ||
); | ||
export const donneesCalculTrajectoireARemplirSchema = z.object({ | ||
sources: z.string().array(), | ||
emissionsGes: donneesARemplirResultSchema, | ||
consommationsFinales: donneesARemplirResultSchema, | ||
sequestrations: donneesARemplirResultSchema, | ||
}); | ||
export type DonneesCalculTrajectoireARemplirType = z.infer< | ||
typeof donneesCalculTrajectoireARemplirSchema | ||
>; |
26 changes: 10 additions & 16 deletions
26
backend/src/indicateurs/models/export-indicateurs.request.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 |
---|---|---|
@@ -1,21 +1,15 @@ | ||
import { extendApi } from '@anatine/zod-openapi'; | ||
import { z } from 'zod'; | ||
|
||
export const exportIndicateursRequestSchema = extendApi( | ||
z | ||
.object({ | ||
collectiviteId: z | ||
.number() | ||
.int() | ||
.describe('Identifiant de la collectivité'), | ||
indicateurIds: z | ||
.number() | ||
.int() | ||
.array() | ||
.describe('Identifiants des indicateurs'), | ||
}) | ||
.describe('Export des indicateurs') | ||
); | ||
export const exportIndicateursRequestSchema = z | ||
.object({ | ||
collectiviteId: z.number().int().describe('Identifiant de la collectivité'), | ||
indicateurIds: z | ||
.number() | ||
.int() | ||
.array() | ||
.describe('Identifiants des indicateurs'), | ||
}) | ||
.describe('Export des indicateurs'); | ||
export type ExportIndicateursRequestType = z.infer< | ||
typeof exportIndicateursRequestSchema | ||
>; |
Oops, something went wrong.