-
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.
Remove duplicate schemas for indicateur source and valeur
- Loading branch information
Showing
58 changed files
with
463 additions
and
520 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
...ns.react/src/app/pages/collectivite/EtatDesLieux/Accueil/EtatDesLieux/IndicateursCard.tsx
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
20 changes: 9 additions & 11 deletions
20
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,14 @@ | ||
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 type CalculTrajectoireResponseDonneesType = z.infer< | ||
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 CalculTrajectoireResponseDonnees = z.infer< | ||
typeof calculTrajectoireResponseDonneesSchema | ||
>; |
25 changes: 11 additions & 14 deletions
25
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
import { extendApi } from '@anatine/zod-openapi'; | ||
import { z } from 'zod'; | ||
import { calculTrajectoireResponseDonneesSchema } from './calcul-trajectoire-response-donnees.dto'; | ||
import { CalculTrajectoireResultatMode } from './calcul-trajectoire.request'; | ||
|
||
export const calculTrajectoireResponseSchema = extendApi( | ||
z | ||
.object({ | ||
mode: z.nativeEnum(CalculTrajectoireResultatMode), | ||
sourcesDonneesEntree: z.string().array(), | ||
indentifiantsReferentielManquantsDonneesEntree: z.array(z.string()), | ||
trajectoire: calculTrajectoireResponseDonneesSchema, | ||
}) | ||
.describe('Réponse du calcul de la trajectoire SNBC') | ||
); | ||
export type CalculTrajectoireResponseType = z.infer< | ||
export const calculTrajectoireResponseSchema = z | ||
.object({ | ||
mode: z.nativeEnum(CalculTrajectoireResultatMode), | ||
sourcesDonneesEntree: z.string().array(), | ||
indentifiantsReferentielManquantsDonneesEntree: z.array(z.string()), | ||
trajectoire: calculTrajectoireResponseDonneesSchema, | ||
}) | ||
.describe('Réponse du calcul de la trajectoire SNBC'); | ||
|
||
export type CalculTrajectoireResponse = z.infer< | ||
typeof calculTrajectoireResponseSchema | ||
>; | ||
|
||
export interface CalculTrajectoireResultType | ||
extends CalculTrajectoireResponseType { | ||
export interface CalculTrajectoireResult extends CalculTrajectoireResponse { | ||
spreadsheetId: string; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
import { integer, pgTable, text } from 'drizzle-orm/pg-core'; | ||
import { InferInsertModel, InferSelectModel } from 'drizzle-orm'; | ||
import { integer, pgTable, text } from 'drizzle-orm/pg-core'; | ||
|
||
export const indicateurSourceTable = pgTable('indicateur_source', { | ||
id: text('id').primaryKey(), | ||
libelle: text('libelle').notNull(), | ||
ordreAffichage: integer('ordre_affichage'), | ||
}); | ||
export type IndicateurSourceType = InferSelectModel< | ||
typeof indicateurSourceTable | ||
>; | ||
export type CreateIndicateurSourceType = InferInsertModel< | ||
typeof indicateurSourceTable | ||
>; | ||
|
||
export type Source = InferSelectModel<typeof indicateurSourceTable>; | ||
|
||
export type SourceInsert = InferInsertModel<typeof indicateurSourceTable>; |
Oops, something went wrong.