From 42ae446f857aa27158e3aa4db66cdfb895020961 Mon Sep 17 00:00:00 2001 From: Arthi-chaud Date: Sat, 13 Aug 2022 09:56:29 +0200 Subject: [PATCH] Front: Add 'Lesson' Model --- front/models/Competency.ts | 15 +++++++++++++++ front/models/Lesson.ts | 26 ++++++++++++++++++++++++++ front/models/Model.ts | 6 ++++++ 3 files changed, 47 insertions(+) create mode 100644 front/models/Competency.ts create mode 100644 front/models/Lesson.ts create mode 100644 front/models/Model.ts diff --git a/front/models/Competency.ts b/front/models/Competency.ts new file mode 100644 index 0000000..9d90d23 --- /dev/null +++ b/front/models/Competency.ts @@ -0,0 +1,15 @@ +type Competency = 'rhythm' + | 'two-hands' + | 'combos' + | 'arpeggio' + | 'distance' + | 'left-hand' + | 'right-hand' + | 'lead-head-change' + | 'chord-complexity' + | 'chord-timing' + | 'pedal' + | 'precision' + + +export default Competency; \ No newline at end of file diff --git a/front/models/Lesson.ts b/front/models/Lesson.ts new file mode 100644 index 0000000..41bf16f --- /dev/null +++ b/front/models/Lesson.ts @@ -0,0 +1,26 @@ +import Competency from "./Competency"; +import Model from "./Model"; + +/** + * A Lesson is an exercice that the user can try to practice a competency + */ +interface Lesson extends Model { + /** + * The title of the lesson + */ + title: string, + /** + * Short description of the lesson + */ + description: string; + /** + * The minimum level required for the user to access this lesson + */ + requiredLevel: number; + /** + * The main competency learnt in this lesson + */ + mainCompetency: Competency; +} + +export default Lesson; \ No newline at end of file diff --git a/front/models/Model.ts b/front/models/Model.ts new file mode 100644 index 0000000..05496c4 --- /dev/null +++ b/front/models/Model.ts @@ -0,0 +1,6 @@ +interface Model { + id: number; + slug: string; +} + +export default Model; \ No newline at end of file