From fdd489345db8ea3931a623d0150bdbf01ea38e2f Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Fri, 10 Jun 2022 10:45:20 -0700 Subject: [PATCH 1/7] Update DOCUMENTATION.md --- DOCUMENTATION.md | 363 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 360 insertions(+), 3 deletions(-) diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index e997e2f..89e6d79 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -37,9 +37,9 @@ The School Management API Documentation, defining all functions and their purpos * [Name](#update-teacher-name) - **(Not Documented)** * [Homeroom](#update-teacher-homeroom) - **(Not Documented)** * [Password](#update-teacher-password) - **(Not Documented)** + * [Email](#update-teacher-email) - **(Not Documented)** * [Address](#update-teacher-address) - **(Not Documented)** * [Photo](#update-teacher-photo) - **(Not Documented)** - * [Email](#update-teacher-email) - **(Not Documented)**

* **Update Admin...** * [Name](#update-admin-name) - **(Coming Soon)** @@ -367,7 +367,7 @@ There are several account that can be registered into the system. As you may gue { "success": true, "message": "successfully logged into teacher", - "admin:" + "teacher:" } ``` @@ -389,9 +389,366 @@ There are several account that can be registered into the system. As you may gue { "success": true, "message": "successfully logged into teacher", - "admin:" + "student:" } ```
+## Updating Account Information + ++ ### Update Student Name + **Method:** `POST` + ``` + /student/updateName + ``` + + **Required:** + * Logged into an admin account + * JSON: + ``` + { + "sid": "123456", + "firstname": "Lisa", + "middlename": "Marie", // (OPTIONAL) + "lastname": "Simpson" + } + ``` + + **Returns:** + * Status 200: `OK` + * JSON: + ``` + { + "success": true, + "message": "successfully updated student" + } + ``` + +

+ ++ ### Update Student Grade Level + **Method:** `POST` + ``` + /student/updateGradeLevel + ``` + + **Required:** + * Logged into an admin account + * JSON": + ``` + { + "sid": "123456", + "gradelevel": 11 + } + ``` + + **Returns:** + * Status 200: `OK` + * JSON: + ``` + { + "success": true, + "message": "successfully updated student" + } + ``` + +

+ ++ ### Update Student Homeroom + **Method:** `POST` + ``` + /student/updateHomeroom + ``` + + **Required:** + * Logged into an admin account + * JSON: + ``` + { + "sid": "123456", + "homeroom": "A123" + } + ``` + + **Returns:** + * Status 200: `OK` + * JSON: + ``` + { + "success": true, + "message": "successfully updated student" + } + ``` + +

+ ++ ### Update Student Locker + **Method:** `POST` + ``` + /student/updateLocker + ``` + + **Required:** + * Logged into an admin account + * JSON: + ``` + { + "sid": "123456", + "lockernumber": "B123" + } + ``` + + **Returns:** + * Status 200: `OK` + * JSON: + ``` + { + "success": true, + "message": "successfully updated student" + } + ``` + +

+ ++ ### Update Student Year of Graduation + **Method:** `POST` + ``` + /student/updateYOG + ``` + + **Required:** + * Logged into an admin account + * JSON: + ``` + { + "sid": "123456", + "yog": 2020 + } + ``` + + **Returns:** + * Status 200: `OK` + * JSON: + ``` + { + "success": true, + "message": "successfully updated student" + } + ``` + +

+ ++ ### Update Student Password + **Method:** `POST` + ``` + /student/updatePassword + ``` + + **Required:** + * Logged into an admin account + + **Returns:** + * Status 200: `OK` + * JSON: + ``` + { + "success": true, + "message": "successfully updated" + } + ``` + +

+ ++ ### Update Student Email + **Method:** `POST` + ``` + /student/ + ``` + + **Required:** + * Logged into an admin account + + **Returns:** + * Status 200: `OK` + * JSON: + ``` + { + "success": true, + "message": "successfully updated" + } + ``` + +

+ ++ ### Update Student Address + **Method:** `POST` + ``` + /student/ + ``` + + **Required:** + * Logged into an admin account + + **Returns:** + * Status 200: `OK` + * JSON: + ``` + { + "success": true, + "message": "successfully updated" + } + ``` + +

+ ++ ### Update Student Photo + **Method:** `POST` + ``` + /student/ + ``` + + **Required:** + * Logged into an admin account + + **Returns:** + * Status 200: `OK` + * JSON: + ``` + { + "success": true, + "message": "successfully updated" + } + ``` + +

+ ++ ### Update Teacher Name + **Method:** `POST` + ``` + /teacher/ + ``` + + **Required:** + * Logged into an admin account + + **Returns:** + * Status 200: `OK` + * JSON: + ``` + { + "success": true, + "message": "successfully updated" + } + ``` + +

+ ++ ### Update Teacher Homeroom + **Method:** `POST` + ``` + /teacher/ + ``` + + **Required:** + * Logged into an admin account + + **Returns:** + * Status 200: `OK` + * JSON: + ``` + { + "success": true, + "message": "successfully updated" + } + ``` + +

+ ++ ### Update Teacher Password + **Method:** `POST` + ``` + /teacher/ + ``` + + **Required:** + * Logged into an admin account + + **Returns:** + * Status 200: `OK` + * JSON: + ``` + { + "success": true, + "message": "successfully updated" + } + ``` + +

+ ++ ### Update Teacher Email + **Method:** `POST` + ``` + /teacher/ + ``` + + **Required:** + * Logged into an admin account + + **Returns:** + * Status 200: `OK` + * JSON: + ``` + { + "success": true, + "message": "successfully updated" + } + ``` + +

+ ++ ### Update Teacher Address + **Method:** `POST` + ``` + /teacher/ + ``` + + **Required:** + * Logged into an admin account + + **Returns:** + * Status 200: `OK` + * JSON: + ``` + { + "success": true, + "message": "successfully updated" + } + ``` + +

+ ++ ### Update Teacher Photo + **Coming Soon...** + +

+ ++ ### Update Admin Name + **Coming Soon...** + +

+ ++ ### Update Admin Password + **Coming Soon...** + +

+ ++ ### Update Admin Email + **Coming Soon...** + +

+ ++ ### Update Admin Photo + **Coming Soon...** + +

From e97f185e22e026c795ced844cb7dedd9f4ffa09a Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Fri, 10 Jun 2022 10:45:56 -0700 Subject: [PATCH 2/7] remove deprecated test code --- controllers/updateController.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/controllers/updateController.go b/controllers/updateController.go index b130408..8513bad 100644 --- a/controllers/updateController.go +++ b/controllers/updateController.go @@ -145,7 +145,7 @@ func UpdateStudentGradeLevel(c *fiber.Ctx) error { }, } - result, updateErr := studentCollection.UpdateOne( + _, updateErr := studentCollection.UpdateOne( ctx, bson.M{"schooldata.sid": data["sid"].(string)}, update, @@ -162,8 +162,7 @@ func UpdateStudentGradeLevel(c *fiber.Ctx) error { return c.Status(fiber.StatusOK).JSON(fiber.Map{ "success": true, - "message": "successfully updated student", - "result": result, + "message": "successfully updated student" }) } @@ -217,7 +216,7 @@ func UpdateStudentHomeroom(c *fiber.Ctx) error { }, } - result, updateErr := studentCollection.UpdateOne( + _, updateErr := studentCollection.UpdateOne( ctx, bson.M{"schooldata.sid": data["sid"]}, update, @@ -235,7 +234,6 @@ func UpdateStudentHomeroom(c *fiber.Ctx) error { return c.Status(fiber.StatusOK).JSON(fiber.Map{ "success": true, "message": "successfully updated student", - "result": result, }) } @@ -491,7 +489,7 @@ func UpdateStudentLocker(c *fiber.Ctx) error { }, } - result, updateErr := studentCollection.UpdateOne( + _, updateErr := studentCollection.UpdateOne( ctx, bson.M{"schooldata.sid": data["sid"]}, update, @@ -509,7 +507,6 @@ func UpdateStudentLocker(c *fiber.Ctx) error { return c.Status(fiber.StatusOK).JSON(fiber.Map{ "success": true, "message": "successfully updated student", - "result": result, }) } From 596533753c6aeae175abde68e86ea794fb771e31 Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Fri, 10 Jun 2022 12:28:50 -0700 Subject: [PATCH 3/7] remove deprecated test response --- controllers/updateController.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/controllers/updateController.go b/controllers/updateController.go index 8513bad..76a7e02 100644 --- a/controllers/updateController.go +++ b/controllers/updateController.go @@ -320,7 +320,7 @@ func UpdateStudentPassword(c *fiber.Ctx) error { }, } - result, updateErr := studentCollection.UpdateOne( + _, updateErr := studentCollection.UpdateOne( ctx, bson.M{"schooldata.sid": claims.Issuer}, update, @@ -350,7 +350,6 @@ func UpdateStudentPassword(c *fiber.Ctx) error { return c.Status(fiber.StatusOK).JSON(fiber.Map{ "success": true, "message": "successfully updated student password", - "result": result, }) } @@ -935,6 +934,14 @@ func UpdateStudentEmail(c *fiber.Ctx) error { }) } + if verifiedAdmin && data["sid"] == "" { + cancel() + return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{ + "success": false, + "message": "missing required fields", + }) + } + // Check required fields are included if data["email"] == "" { cancel() From ca4020f0ee1232925a4d086725664b1f3b3adbe6 Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Fri, 10 Jun 2022 12:29:29 -0700 Subject: [PATCH 4/7] Update DOCUMENTATION.md --- DOCUMENTATION.md | 114 +++++++++++++++++++++++++++-------------------- 1 file changed, 65 insertions(+), 49 deletions(-) diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 89e6d79..eeb9a6e 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -1,5 +1,3 @@ - - # School Management API Documentation The School Management API Documentation, defining all functions and their purpose. As well as how to use the API, how to properly call functions and provide the necessary fields. @@ -23,12 +21,12 @@ The School Management API Documentation, defining all functions and their purpos * [Get Student Account](#get-student-account) * [Updating Account information](#updating-accounts) - **(Not Documented)** * **Update Student...** - * [Name](#update-student-name) - **(Not Documented)** - * [Grade Level](#update-student-grade-level) - **(Not Documented)** - * [Homeroom](#update-student-homeroom) - **(Not Documented)** - * [Locker](#update-student-locker) - **(Not Documented)** - * [YOG](#update-student-year-of-graduation) - **(Not Documented)** - * [Password](#update-student-password) - **(Not Documented)** + * [Name](#update-student-name) + * [Grade Level](#update-student-grade-level) + * [Homeroom](#update-student-homeroom) + * [Locker](#update-student-locker) + * [YOG](#update-student-year-of-graduation) + * [Password](#update-student-password) * [Email](#update-student-email) - **(Not Documented)** * [Address](#update-student-address) - **(Not Documented)** * [Photo](#update-student-photo) - **(Not Documented)** @@ -55,7 +53,7 @@ The School Management API Documentation, defining all functions and their purpos The API is an all in one package and is simple and easy to deploy. Eliminating any long unforgiving configurations you may face in other software. 1. Clone the repo - ``` + ```bash $ git clone https://github.com/SowinskiBraeden/school-management-api $ cd school-management-api ``` @@ -63,7 +61,7 @@ The School Management API Documentation, defining all functions and their purpos 2. Rename `.env.example` to `.env` 3. Enter desired values into `.env` - ``` + ```bash mongoURI='your mongo URI' dbo='school' secret='your 256 bit secret' @@ -78,14 +76,14 @@ The School Management API Documentation, defining all functions and their purpos ``` 4. Run the system in your terminal - ``` + ```bash $ go run main.go ``` Or... 5. Build and compile the system into an executable - ``` + ```bash $ go build ``` @@ -113,7 +111,7 @@ The School Management API Documentation, defining all functions and their purpos **Returns:** * Status 200: `OK` * JSON: - ``` + ```jsonc { "success": true, "message": "the API is active" @@ -139,7 +137,7 @@ There are several account that can be registered into the system. As you may gue **Required:** + Logged into an existing Admin account + JSON: - ``` + ```jsonc { "firstname": "John", "lastname": "Doe", @@ -151,7 +149,7 @@ There are several account that can be registered into the system. As you may gue **Returns:** + Status 200: `OK` + JSON: - ``` + ```jsonc { "success": true, "message": "successfully inserted admin" @@ -171,7 +169,7 @@ There are several account that can be registered into the system. As you may gue **Required:** + Logged into an existing Admin account + JSON: - ``` + ```jsonc { "firstname": "Homer", "middlename": "Jay", @@ -184,7 +182,7 @@ There are several account that can be registered into the system. As you may gue **Returns:** + Status 200: `OK` + JSON: - ``` + ```jsonc { "success": true, "message": "successfully inserted teacher" @@ -202,7 +200,7 @@ There are several account that can be registered into the system. As you may gue **Required:** + Logged into an existing Admin account + JSON: - ``` + ```jsonc { "firstname": "Bart", "middlename": "JoJo", @@ -220,7 +218,7 @@ There are several account that can be registered into the system. As you may gue **Returns:** + Status 200: `OK` + JSON: - ``` + ```jsonc { "success": true, "successfully inserted student" @@ -254,7 +252,7 @@ There are several account that can be registered into the system. As you may gue **Required:** * JSON: - ``` + ```jsonc { "tid": "123456", "password": "myawesomepassword123" @@ -281,7 +279,7 @@ There are several account that can be registered into the system. As you may gue **Required:** * JSON: - ``` + ```jsonc { "tid": "123456", "password": "myawesomepassword123" @@ -291,7 +289,7 @@ There are several account that can be registered into the system. As you may gue **Returns:** * Status 200: `OK` * JSON: - ``` + ```jsonc { "success": true, "message": "correct password" @@ -308,7 +306,7 @@ There are several account that can be registered into the system. As you may gue **Required:** * JSON: - ``` + ```jsonc { "sid": "123456", "password": "myawesomepassword123" @@ -318,7 +316,7 @@ There are several account that can be registered into the system. As you may gue **Returns:** * Status 200: `OK` * JSON: - ``` + ```jsonc { "success": true, "message": "correct password" @@ -341,7 +339,7 @@ There are several account that can be registered into the system. As you may gue **Returns:** * Status 200: `OK` * JSON: - ``` + ```jsonc { "success": true, "message": "successfully logged into admin", @@ -363,7 +361,7 @@ There are several account that can be registered into the system. As you may gue **Returns:** * Status 200: `OK` * JSON: - ``` + ```jsonc { "success": true, "message": "successfully logged into teacher", @@ -385,7 +383,7 @@ There are several account that can be registered into the system. As you may gue **Returns:** * Status 200: `OK` * JSON: - ``` + ```jsonc { "success": true, "message": "successfully logged into teacher", @@ -406,7 +404,7 @@ There are several account that can be registered into the system. As you may gue **Required:** * Logged into an admin account * JSON: - ``` + ```jsonc { "sid": "123456", "firstname": "Lisa", @@ -418,7 +416,7 @@ There are several account that can be registered into the system. As you may gue **Returns:** * Status 200: `OK` * JSON: - ``` + ```jsonc { "success": true, "message": "successfully updated student" @@ -436,7 +434,7 @@ There are several account that can be registered into the system. As you may gue **Required:** * Logged into an admin account * JSON": - ``` + ```jsonc { "sid": "123456", "gradelevel": 11 @@ -446,7 +444,7 @@ There are several account that can be registered into the system. As you may gue **Returns:** * Status 200: `OK` * JSON: - ``` + ```jsonc { "success": true, "message": "successfully updated student" @@ -464,7 +462,7 @@ There are several account that can be registered into the system. As you may gue **Required:** * Logged into an admin account * JSON: - ``` + ```jsonc { "sid": "123456", "homeroom": "A123" @@ -474,7 +472,7 @@ There are several account that can be registered into the system. As you may gue **Returns:** * Status 200: `OK` * JSON: - ``` + ```jsonc { "success": true, "message": "successfully updated student" @@ -492,7 +490,7 @@ There are several account that can be registered into the system. As you may gue **Required:** * Logged into an admin account * JSON: - ``` + ```jsonc { "sid": "123456", "lockernumber": "B123" @@ -502,7 +500,7 @@ There are several account that can be registered into the system. As you may gue **Returns:** * Status 200: `OK` * JSON: - ``` + ```jsonc { "success": true, "message": "successfully updated student" @@ -520,7 +518,7 @@ There are several account that can be registered into the system. As you may gue **Required:** * Logged into an admin account * JSON: - ``` + ```jsonc { "sid": "123456", "yog": 2020 @@ -530,7 +528,7 @@ There are several account that can be registered into the system. As you may gue **Returns:** * Status 200: `OK` * JSON: - ``` + ```jsonc { "success": true, "message": "successfully updated student" @@ -546,33 +544,51 @@ There are several account that can be registered into the system. As you may gue ``` **Required:** - * Logged into an admin account + * Logged into students account + * JSON: + ```jsonc + { + "password": "myOldPassword", + "newpassword1": "myNewPassword", + "newpassword2": "myNewPassword" + } + ``` **Returns:** * Status 200: `OK` * JSON: - ``` + ```jsonc { "success": true, - "message": "successfully updated" + "message": "successfully updated student password" } ``` + * Emails student an alert of password change

+ ### Update Student Email **Method:** `POST` ``` - /student/ + /student/updateEmail ``` **Required:** * Logged into an admin account + __or__ + * Logged into students account + * JSON: + ```jsonc + { + "sid": "123456", // (Only required if signed in as admin) + "email": "BartSimpsonsCoolEmail@example.com" + } + ``` **Returns:** * Status 200: `OK` * JSON: - ``` + ```jsonc { "success": true, "message": "successfully updated" @@ -593,7 +609,7 @@ There are several account that can be registered into the system. As you may gue **Returns:** * Status 200: `OK` * JSON: - ``` + ```jsonc { "success": true, "message": "successfully updated" @@ -614,7 +630,7 @@ There are several account that can be registered into the system. As you may gue **Returns:** * Status 200: `OK` * JSON: - ``` + ```jsonc { "success": true, "message": "successfully updated" @@ -635,7 +651,7 @@ There are several account that can be registered into the system. As you may gue **Returns:** * Status 200: `OK` * JSON: - ``` + ```jsonc { "success": true, "message": "successfully updated" @@ -656,7 +672,7 @@ There are several account that can be registered into the system. As you may gue **Returns:** * Status 200: `OK` * JSON: - ``` + ```jsonc { "success": true, "message": "successfully updated" @@ -677,7 +693,7 @@ There are several account that can be registered into the system. As you may gue **Returns:** * Status 200: `OK` * JSON: - ``` + ```jsonc { "success": true, "message": "successfully updated" @@ -698,7 +714,7 @@ There are several account that can be registered into the system. As you may gue **Returns:** * Status 200: `OK` * JSON: - ``` + ```jsonc { "success": true, "message": "successfully updated" @@ -719,7 +735,7 @@ There are several account that can be registered into the system. As you may gue **Returns:** * Status 200: `OK` * JSON: - ``` + ```jsonc { "success": true, "message": "successfully updated" From 84b8c1ae5e4a2186584733eaefc8a6b22db2e3d1 Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Fri, 10 Jun 2022 13:19:58 -0700 Subject: [PATCH 5/7] Finish updating documentation --- DOCUMENTATION.md | 118 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 99 insertions(+), 19 deletions(-) diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index eeb9a6e..8b822ca 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -27,7 +27,7 @@ The School Management API Documentation, defining all functions and their purpos * [Locker](#update-student-locker) * [YOG](#update-student-year-of-graduation) * [Password](#update-student-password) - * [Email](#update-student-email) - **(Not Documented)** + * [Email](#update-student-email) * [Address](#update-student-address) - **(Not Documented)** * [Photo](#update-student-photo) - **(Not Documented)**

@@ -600,11 +600,21 @@ There are several account that can be registered into the system. As you may gue + ### Update Student Address **Method:** `POST` ``` - /student/ + /student/updateAddress ``` **Required:** * Logged into an admin account + * JSON: + ```jsonc + { + "sid": "123456", + "address": "742 Evergreen Terrace", + "city": "Springfield", + "province": "...", + "postal": "..." + } + ``` **Returns:** * Status 200: `OK` @@ -612,7 +622,7 @@ There are several account that can be registered into the system. As you may gue ```jsonc { "success": true, - "message": "successfully updated" + "message": "successfully updated student" } ``` @@ -621,19 +631,24 @@ There are several account that can be registered into the system. As you may gue + ### Update Student Photo **Method:** `POST` ``` - /student/ + /student/updatePhoto ``` **Required:** * Logged into an admin account - + * Form Submission: + ``` + sid: "123456" + image: newStudentPhoto.png + ``` + **Returns:** * Status 200: `OK` * JSON: ```jsonc { "success": true, - "message": "successfully updated" + "message": "successfully updated student photo" } ``` @@ -642,19 +657,28 @@ There are several account that can be registered into the system. As you may gue + ### Update Teacher Name **Method:** `POST` ``` - /teacher/ + /teacher/updateName ``` **Required:** * Logged into an admin account - + * JSON: + ```jsonc + { + "tid": "123456", + "firstname": "Marjorie", + "middlename": "Jacqueline", // (Optional) + "lastname": "Simpson" + } + ``` + **Returns:** * Status 200: `OK` * JSON: ```jsonc { "success": true, - "message": "successfully updated" + "message": "successfully updated teacher" } ``` @@ -663,11 +687,18 @@ There are several account that can be registered into the system. As you may gue + ### Update Teacher Homeroom **Method:** `POST` ``` - /teacher/ + /teacher/updateHomeroom ``` **Required:** * Logged into an admin account + * JSON: + ``` + { + "tid": "123456", + "homeroom": "A123" + } + ``` **Returns:** * Status 200: `OK` @@ -675,7 +706,7 @@ There are several account that can be registered into the system. As you may gue ```jsonc { "success": true, - "message": "successfully updated" + "message": "successfully updated teacher" } ``` @@ -684,11 +715,19 @@ There are several account that can be registered into the system. As you may gue + ### Update Teacher Password **Method:** `POST` ``` - /teacher/ + /teacher/updatePassword ``` **Required:** - * Logged into an admin account + * Logged into teacher account + * JSON: + ```jsonc + { + "password": "myOldPassword", + "newpassword1": "myNewPassword", + "newpassword2": "myNewPassword" + } + ``` **Returns:** * Status 200: `OK` @@ -696,20 +735,30 @@ There are several account that can be registered into the system. As you may gue ```jsonc { "success": true, - "message": "successfully updated" + "message": "successfully updated teacher password" } ``` + * Emails teacher an alert of password change

+ ### Update Teacher Email **Method:** `POST` ``` - /teacher/ + /teacher/updateEmail ``` **Required:** * Logged into an admin account + **or** + * Logged into teachers account + * JSON: + ```jsonc + { + "tid": "123456", // (Only required if igned in as admin) + "email": "MargeSimpson@example.com" + } + ``` **Returns:** * Status 200: `OK` @@ -717,7 +766,7 @@ There are several account that can be registered into the system. As you may gue ```jsonc { "success": true, - "message": "successfully updated" + "message": "successfully updated teacher" } ``` @@ -726,11 +775,21 @@ There are several account that can be registered into the system. As you may gue + ### Update Teacher Address **Method:** `POST` ``` - /teacher/ + /teacher/updateAddress ``` **Required:** * Logged into an admin account + * JSON: + ```jsonc + { + "tid": "123456", + "address": "742 Evergreen Terrace", + "city": "Springfield", + "province": "...", + "postal": "..." + } + ``` **Returns:** * Status 200: `OK` @@ -738,14 +797,35 @@ There are several account that can be registered into the system. As you may gue ```jsonc { "success": true, - "message": "successfully updated" + "message": "successfully updated teacher" } ```

+ ### Update Teacher Photo - **Coming Soon...** + **Method:** `POST` + ``` + /teacher/updatePhoto + ``` + + **Required:** + * Logged into an admin + * Form Submission: + ``` + tid: "123456" + image: newTeacherPhoto.png + ``` + + **Returns:** + * Status 200: `OK` + * JSON: + ```jsonc + { + "success": true, + "message": "successfully updated teacher photo" + } + ```

From 7e85215fcc6bcc415443b514661366676ed3f1af Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Fri, 10 Jun 2022 13:20:54 -0700 Subject: [PATCH 6/7] remove deprecated messages --- DOCUMENTATION.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 8b822ca..e358480 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -19,7 +19,7 @@ The School Management API Documentation, defining all functions and their purpos * [Get Admin Account](#get-admin-account) * [Get Teacher Account](#get-teacher-account) * [Get Student Account](#get-student-account) -* [Updating Account information](#updating-accounts) - **(Not Documented)** +* [Updating Account information](#updating-accounts) * **Update Student...** * [Name](#update-student-name) * [Grade Level](#update-student-grade-level) @@ -28,16 +28,16 @@ The School Management API Documentation, defining all functions and their purpos * [YOG](#update-student-year-of-graduation) * [Password](#update-student-password) * [Email](#update-student-email) - * [Address](#update-student-address) - **(Not Documented)** - * [Photo](#update-student-photo) - **(Not Documented)** + * [Address](#update-student-address) + * [Photo](#update-student-photo)

* **Update Teacher...** - * [Name](#update-teacher-name) - **(Not Documented)** - * [Homeroom](#update-teacher-homeroom) - **(Not Documented)** - * [Password](#update-teacher-password) - **(Not Documented)** - * [Email](#update-teacher-email) - **(Not Documented)** - * [Address](#update-teacher-address) - **(Not Documented)** - * [Photo](#update-teacher-photo) - **(Not Documented)** + * [Name](#update-teacher-name) + * [Homeroom](#update-teacher-homeroom) + * [Password](#update-teacher-password) + * [Email](#update-teacher-email) + * [Address](#update-teacher-address) + * [Photo](#update-teacher-photo)

* **Update Admin...** * [Name](#update-admin-name) - **(Coming Soon)** From 255ea25edf4655dd18fae8a9e01fd8e42a473e03 Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Fri, 10 Jun 2022 14:04:45 -0700 Subject: [PATCH 7/7] Continue Documentation --- DOCUMENTATION.md | 138 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 114 insertions(+), 24 deletions(-) diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index e358480..93987ec 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -44,6 +44,15 @@ The School Management API Documentation, defining all functions and their purpos * [Password](#update-admin-password) - **(Coming Soon)** * [Email](#update-admin-email) - **(Coming Soon)** * [Photo](#update-admin-photo) - **(Coming Soon)** +* [Managing Contacts](#managing-contacts) - **(Not Documented)** + * [Create Contact](#create-contact) - **(Not Documented)** + * [Update Contact Name](#update-contact-name) - **(Not Documented)** + * [Update Contact Address](#update-contact-address) - **(Not Documented)** + * [Update Contact Home Phone](#update-contact-home-phone) - **(Not Documented)** + * [Update Contact Work Phone](#update-contact-work-phone) - **(Not Documented)** + * [Update Contact Email](#update-contact-email) - **(Not Documented)** + * [Update Contact Priority](#update-contact-priority) - **(Not Documented)** + * [Delete Contact](#delete-contact) - **(Not Documented)**
@@ -131,7 +140,7 @@ There are several account that can be registered into the system. As you may gue **Method:** `POST` ``` - /admin/create + /api/v1/admin/create ``` **Required:** @@ -163,7 +172,7 @@ There are several account that can be registered into the system. As you may gue **Method:** `POST` ``` - /teacher/register + /api/v1/teacher/register ``` **Required:** @@ -194,7 +203,7 @@ There are several account that can be registered into the system. As you may gue **Method:** `POST` ``` - /student/enroll + /api/v1/student/enroll ``` **Required:** @@ -247,7 +256,7 @@ There are several account that can be registered into the system. As you may gue + ### Logging into Admin **Method:** `POST` ``` - /admin/login + /api/v1/admin/login ``` **Required:** @@ -274,7 +283,7 @@ There are several account that can be registered into the system. As you may gue + ### Logging into Teacher **Method:** `POST` ``` - /teacher/login + /api/v1/teacher/login ``` **Required:** @@ -301,7 +310,7 @@ There are several account that can be registered into the system. As you may gue + ### Logging into Student **Method:** `POST` ``` - /student/login + /api/v1/student/login ``` **Required:** @@ -330,7 +339,7 @@ There are several account that can be registered into the system. As you may gue + ### Get Admin Account **Method:** `GET` ``` - /admin + /api/v1/admin ``` **Required:** @@ -352,7 +361,7 @@ There are several account that can be registered into the system. As you may gue + ### Get Teacher Account **Method:** `GET` ``` - /teacher + /api/v1/teacher ``` **Required:** @@ -374,7 +383,7 @@ There are several account that can be registered into the system. As you may gue + ### Get Student Account **Method:** `GET` ``` - /student + /api/v1/student ``` **Required:** @@ -398,7 +407,7 @@ There are several account that can be registered into the system. As you may gue + ### Update Student Name **Method:** `POST` ``` - /student/updateName + /api/v1/student/updateName ``` **Required:** @@ -428,7 +437,7 @@ There are several account that can be registered into the system. As you may gue + ### Update Student Grade Level **Method:** `POST` ``` - /student/updateGradeLevel + /api/v1/student/updateGradeLevel ``` **Required:** @@ -456,7 +465,7 @@ There are several account that can be registered into the system. As you may gue + ### Update Student Homeroom **Method:** `POST` ``` - /student/updateHomeroom + /api/v1/student/updateHomeroom ``` **Required:** @@ -484,7 +493,7 @@ There are several account that can be registered into the system. As you may gue + ### Update Student Locker **Method:** `POST` ``` - /student/updateLocker + /api/v1/student/updateLocker ``` **Required:** @@ -512,7 +521,7 @@ There are several account that can be registered into the system. As you may gue + ### Update Student Year of Graduation **Method:** `POST` ``` - /student/updateYOG + /api/v1/student/updateYOG ``` **Required:** @@ -540,7 +549,7 @@ There are several account that can be registered into the system. As you may gue + ### Update Student Password **Method:** `POST` ``` - /student/updatePassword + /api/v1/student/updatePassword ``` **Required:** @@ -570,7 +579,7 @@ There are several account that can be registered into the system. As you may gue + ### Update Student Email **Method:** `POST` ``` - /student/updateEmail + /api/v1/student/updateEmail ``` **Required:** @@ -600,7 +609,7 @@ There are several account that can be registered into the system. As you may gue + ### Update Student Address **Method:** `POST` ``` - /student/updateAddress + /api/v1/student/updateAddress ``` **Required:** @@ -631,7 +640,7 @@ There are several account that can be registered into the system. As you may gue + ### Update Student Photo **Method:** `POST` ``` - /student/updatePhoto + /api/v1/student/updatePhoto ``` **Required:** @@ -657,7 +666,7 @@ There are several account that can be registered into the system. As you may gue + ### Update Teacher Name **Method:** `POST` ``` - /teacher/updateName + /api/v1/teacher/updateName ``` **Required:** @@ -687,7 +696,7 @@ There are several account that can be registered into the system. As you may gue + ### Update Teacher Homeroom **Method:** `POST` ``` - /teacher/updateHomeroom + /api/v1/teacher/updateHomeroom ``` **Required:** @@ -715,7 +724,7 @@ There are several account that can be registered into the system. As you may gue + ### Update Teacher Password **Method:** `POST` ``` - /teacher/updatePassword + /api/v1/teacher/updatePassword ``` **Required:** @@ -745,7 +754,7 @@ There are several account that can be registered into the system. As you may gue + ### Update Teacher Email **Method:** `POST` ``` - /teacher/updateEmail + /api/v1/teacher/updateEmail ``` **Required:** @@ -775,7 +784,7 @@ There are several account that can be registered into the system. As you may gue + ### Update Teacher Address **Method:** `POST` ``` - /teacher/updateAddress + /api/v1/teacher/updateAddress ``` **Required:** @@ -806,7 +815,7 @@ There are several account that can be registered into the system. As you may gue + ### Update Teacher Photo **Method:** `POST` ``` - /teacher/updatePhoto + /api/v1/teacher/updatePhoto ``` **Required:** @@ -848,3 +857,84 @@ There are several account that can be registered into the system. As you may gue **Coming Soon...**

+ +## Managing Conacts +**To be Documented...** + ++ ### Creating Contact + **To be Documented...** + +

+ ++ ### Update Contact Name + **To be Documented...** + +

+ ++ ### Update Contact Address + **To be Documented...** + +

+ ++ ### Update Contact Home Phone + **To be Documented...** + +

+ ++ ### Update Contact Work Phone + **To be Documented...** + +

+ ++ ### Update Contact Email + **To be Documented...** + +

+ ++ ### Update Contact Priority + **To be Documented...** + +

+ ++ ### Delete Conotact + **To be Documented...** + +

+ +## Remove Users +**To be Documented...** + ++ ### Remove Admin + **To be Documented...** + +

+ ++ ### Remove Teacher + **To be Documented...** + +

+ ++ ### Remove Student + **To be Documented...** + +

+ +### Admin Commands +Administrators play a very important role in managing a school, they do much work behind the scenes to make sure that everything is correctly organized and working. + ++ ### Update Locker Combination + **To be Documented...** + +

+ ++ ### Enable Student Account + In the case a students acount has been disabled, an admin would require to enable the account. + + **To be Documented...** +

+ ++ ### Enable Teacher Account + In the case a teachers acount has been disabled, an admin would require to enable the account. + + **To be Documented...** +