diff --git a/src/decoders/notebook-observation.ts b/src/decoders/notebook-observation.ts index a4f0794a..9ab0f049 100644 --- a/src/decoders/notebook-observation.ts +++ b/src/decoders/notebook-observation.ts @@ -16,8 +16,8 @@ export const decodeNotebookObservation = (observation: any): NotebookObservation opened: observation.estLue, shouldParentsJustify: observation.avecARObservation, - sectionName: observation.L, - sectionKind: observation.genreObservation, + name: observation.L, + kind: observation.genreObservation, sectionID: observation.rubrique.V.N, subject, diff --git a/src/models/index.ts b/src/models/index.ts index 6c675da5..31d374f2 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -49,6 +49,7 @@ export * from "./news-view"; export * from "./news"; export * from "./notebook-absence"; export * from "./notebook-delay"; +export * from "./notebook-observation-kind"; export * from "./notebook-observation"; export * from "./notebook-precautionary-measure"; export * from "./notebook-punishment"; diff --git a/src/models/notebook-observation-kind.ts b/src/models/notebook-observation-kind.ts new file mode 100644 index 00000000..7d079054 --- /dev/null +++ b/src/models/notebook-observation-kind.ts @@ -0,0 +1,15 @@ +export const NotebookObservationKind = { + /** @original `OVS_DefautCarnet` */ + LogBookIssue: 0, + + /** @original `OVS_ObservationParent` */ + Observation: 1, + + /** @original `OVS_Encouragement` */ + Encouragement: 2, + + /** @original `OVS_Autres` */ + Other: 3 +} as const; + +export type NotebookObservationKind = typeof NotebookObservationKind[keyof typeof NotebookObservationKind]; diff --git a/src/models/notebook-observation.ts b/src/models/notebook-observation.ts index 16689216..a908407e 100644 --- a/src/models/notebook-observation.ts +++ b/src/models/notebook-observation.ts @@ -1,3 +1,4 @@ +import type { NotebookObservationKind } from "./notebook-observation-kind"; import type { Subject } from "./subject"; export type NotebookObservation = Readonly<{ @@ -7,19 +8,8 @@ export type NotebookObservation = Readonly<{ opened: boolean; shouldParentsJustify: boolean; - sectionName: string - sectionKind: number // TOOD: enum, see below - // /** @original `OVS_DefautCarnet` */ - // LogBookIssue = 0, - - // /** @original `OVS_ObservationParent` */ - // Observation = 1, - - // /** @original `OVS_Encouragement` */ - // Encouragement = 2, - - // /** @original `OVS_Autres` */ - // Other = 3 + name: string + kind: NotebookObservationKind /** * ID of the observation section.