Skip to content

Commit

Permalink
feat: add notebook observation kind enum
Browse files Browse the repository at this point in the history
  • Loading branch information
Vexcited committed Aug 23, 2024
1 parent 6cf7d06 commit e1fa8d1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/decoders/notebook-observation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
15 changes: 15 additions & 0 deletions src/models/notebook-observation-kind.ts
Original file line number Diff line number Diff line change
@@ -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];
16 changes: 3 additions & 13 deletions src/models/notebook-observation.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { NotebookObservationKind } from "./notebook-observation-kind";
import type { Subject } from "./subject";

export type NotebookObservation = Readonly<{
Expand All @@ -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.
Expand Down

0 comments on commit e1fa8d1

Please sign in to comment.