From db431571bf81591c720d15a8f9c76566285158f9 Mon Sep 17 00:00:00 2001
From: Sebastian Karlsson <sebka991@student.liu.se>
Date: Wed, 26 May 2021 10:44:40 +0200
Subject: [PATCH] Add comments to interfaces

---
 client/src/interfaces/ApiModels.ts     | 6 ++++++
 client/src/interfaces/ApiRichModels.ts | 6 ++++++
 client/src/interfaces/Components.ts    | 3 +++
 client/src/interfaces/FilterParams.ts  | 3 +++
 client/src/interfaces/FormModels.ts    | 3 +++
 client/src/interfaces/Timer.ts         | 3 +++
 client/src/interfaces/ViewParams.ts    | 3 +++
 7 files changed, 27 insertions(+)

diff --git a/client/src/interfaces/ApiModels.ts b/client/src/interfaces/ApiModels.ts
index d32cd65a..c613477e 100644
--- a/client/src/interfaces/ApiModels.ts
+++ b/client/src/interfaces/ApiModels.ts
@@ -1,3 +1,9 @@
+/**
+ * This file contains interfaces used by the API when getting tables from the database.
+ * Some of these interfaces are lightweight versions used when getting all data is unneccesary.
+ * The full versions of these interfaces are found in ApiRichModels.
+ */
+
 export interface NameID {
   id: number
   name: string
diff --git a/client/src/interfaces/ApiRichModels.ts b/client/src/interfaces/ApiRichModels.ts
index 4251f2e6..853a6afb 100644
--- a/client/src/interfaces/ApiRichModels.ts
+++ b/client/src/interfaces/ApiRichModels.ts
@@ -1,3 +1,9 @@
+/**
+ * This file contains interfaces used by the API when getting full tables from the database.
+ * These interfaces also have more lightweight versions used when getting all data is unneccesary,
+ * found in ApiModels.
+ */
+
 import { Component, Media, QuestionAlternative, QuestionAlternativeAnswer, QuestionScore } from './ApiModels'
 
 export interface RichCompetition {
diff --git a/client/src/interfaces/Components.ts b/client/src/interfaces/Components.ts
index 864b987d..d0f4842f 100644
--- a/client/src/interfaces/Components.ts
+++ b/client/src/interfaces/Components.ts
@@ -1,3 +1,6 @@
+/**
+ * This file contains interfaces used by components.
+ */
 export interface Position {
   x: number
   y: number
diff --git a/client/src/interfaces/FilterParams.ts b/client/src/interfaces/FilterParams.ts
index eca6551f..06cc1569 100644
--- a/client/src/interfaces/FilterParams.ts
+++ b/client/src/interfaces/FilterParams.ts
@@ -1,3 +1,6 @@
+/**
+ * This file contains interfaces used when filtering.
+ */
 export interface CompetitionFilterParams {
   name?: string
   year?: number
diff --git a/client/src/interfaces/FormModels.ts b/client/src/interfaces/FormModels.ts
index dd51f32b..002f45e1 100644
--- a/client/src/interfaces/FormModels.ts
+++ b/client/src/interfaces/FormModels.ts
@@ -1,3 +1,6 @@
+/**
+ * This file contains interfaces used by form models.
+ */
 export interface ServerResponse {
   code: number
   message: string
diff --git a/client/src/interfaces/Timer.ts b/client/src/interfaces/Timer.ts
index 03704c83..f8d2e298 100644
--- a/client/src/interfaces/Timer.ts
+++ b/client/src/interfaces/Timer.ts
@@ -1,3 +1,6 @@
+/**
+ * This file contains interfaces used by the timer.
+ */
 export interface TimerState {
   value: number | null
   enabled: boolean
diff --git a/client/src/interfaces/ViewParams.ts b/client/src/interfaces/ViewParams.ts
index b8114216..b41671ab 100644
--- a/client/src/interfaces/ViewParams.ts
+++ b/client/src/interfaces/ViewParams.ts
@@ -1,3 +1,6 @@
+/**
+ * This file contains interfaces used by ViewParams.
+ */
 export interface ViewParams {
   competitionId: string
 }
-- 
GitLab