diff --git a/(azurite)/__azurite_db_blob__.json b/(azurite)/__azurite_db_blob__.json
index 88452534..d5c0e748 100644
--- a/(azurite)/__azurite_db_blob__.json
+++ b/(azurite)/__azurite_db_blob__.json
@@ -1 +1,420 @@
-{"filename":"C:\\Users\\Ivyla\\Documents\\GitHub\\COMP0067_2025_Team1\\__azurite_db_blob__.json","collections":[{"name":"$SERVICES_COLLECTION$","data":[],"idIndex":null,"binaryIndices":{},"constraints":null,"uniqueNames":["accountName"],"transforms":{},"objType":"$SERVICES_COLLECTION$","dirty":false,"cachedIndex":null,"cachedBinaryIndex":null,"cachedData":null,"adaptiveBinaryIndices":true,"transactional":false,"cloneObjects":false,"cloneMethod":"parse-stringify","asyncListeners":false,"disableMeta":false,"disableChangesApi":true,"disableDeltaChangesApi":true,"autoupdate":false,"serializableIndices":true,"disableFreeze":true,"ttl":null,"maxId":0,"DynamicViews":[],"events":{"insert":[],"update":[],"pre-insert":[],"pre-update":[],"close":[],"flushbuffer":[],"error":[],"delete":[null],"warning":[null]},"changes":[],"dirtyIds":[]},{"name":"$CONTAINERS_COLLECTION$","data":[{"accountName":"devstoreaccount1","name":"course-files","properties":{"etag":"\"0x20C1223A3927D00\"","lastModified":"2025-03-13T21:12:40.981Z","leaseStatus":"unlocked","leaseState":"available","publicAccess":"blob","hasImmutabilityPolicy":false,"hasLegalHold":false},"meta":{"revision":0,"created":1741900361031,"version":0},"$loki":1}],"idIndex":null,"binaryIndices":{"accountName":{"name":"accountName","dirty":false,"values":[0]},"name":{"name":"name","dirty":false,"values":[0]}},"constraints":null,"uniqueNames":[],"transforms":{},"objType":"$CONTAINERS_COLLECTION$","dirty":false,"cachedIndex":null,"cachedBinaryIndex":null,"cachedData":null,"adaptiveBinaryIndices":true,"transactional":false,"cloneObjects":false,"cloneMethod":"parse-stringify","asyncListeners":false,"disableMeta":false,"disableChangesApi":true,"disableDeltaChangesApi":true,"autoupdate":false,"serializableIndices":true,"disableFreeze":true,"ttl":null,"maxId":1,"DynamicViews":[],"events":{"insert":[],"update":[],"pre-insert":[],"pre-update":[],"close":[],"flushbuffer":[],"error":[],"delete":[null],"warning":[null]},"changes":[],"dirtyIds":[]},{"name":"$BLOBS_COLLECTION$","data":[{"deleted":false,"accountName":"devstoreaccount1","containerName":"course-files","name":"1741900361039-2_ML_LinearRegression.pdf","properties":{"creationTime":"2025-03-13T21:12:41.041Z","lastModified":"2025-03-13T21:12:41.041Z","etag":"\"0x23001DFC0318BA0\"","contentLength":559669,"contentType":"application/pdf","contentMD5":{"type":"Buffer","data":[43,85,103,175,186,209,77,26,185,37,42,228,191,54,193,79]},"blobType":"BlockBlob","leaseStatus":"unlocked","leaseState":"available","serverEncrypted":true,"accessTier":"Hot","accessTierInferred":true,"accessTierChangeTime":"2025-03-13T21:12:41.041Z"},"snapshot":"","isCommitted":true,"persistency":{"id":"99073389-333d-4a24-928c-1b7f3c3eb14d","offset":0,"count":559669},"meta":{"revision":0,"created":1741900361061,"version":0},"$loki":1},{"deleted":false,"accountName":"devstoreaccount1","containerName":"course-files","name":"1741900784863-2_ML_LinearRegression.pdf","properties":{"creationTime":"2025-03-13T21:19:44.865Z","lastModified":"2025-03-13T21:19:44.865Z","etag":"\"0x1E403531A477810\"","contentLength":559669,"contentType":"application/pdf","contentMD5":{"type":"Buffer","data":[212,29,140,217,143,0,178,4,233,128,9,152,236,248,66,126]},"blobType":"BlockBlob","leaseStatus":"unlocked","leaseState":"available","serverEncrypted":true,"accessTier":"Hot","accessTierInferred":true,"accessTierChangeTime":"2025-03-13T21:19:44.865Z"},"snapshot":"","isCommitted":true,"persistency":{"id":"99073389-333d-4a24-928c-1b7f3c3eb14d","offset":559669,"count":559669},"meta":{"revision":0,"created":1741900784878,"version":0},"$loki":2},{"deleted":false,"accountName":"devstoreaccount1","containerName":"course-files","name":"1742576429640-2.png","properties":{"creationTime":"2025-03-21T17:00:29.643Z","lastModified":"2025-03-21T17:00:29.643Z","etag":"\"0x2640C69A152EB40\"","contentLength":145000,"contentType":"image/png","contentMD5":{"type":"Buffer","data":[212,29,140,217,143,0,178,4,233,128,9,152,236,248,66,126]},"blobType":"BlockBlob","leaseStatus":"unlocked","leaseState":"available","serverEncrypted":true,"accessTier":"Hot","accessTierInferred":true,"accessTierChangeTime":"2025-03-21T17:00:29.643Z"},"snapshot":"","isCommitted":true,"persistency":{"id":"99073389-333d-4a24-928c-1b7f3c3eb14d","offset":1119338,"count":145000},"meta":{"revision":0,"created":1742576429663,"version":0},"$loki":3},{"deleted":false,"accountName":"devstoreaccount1","containerName":"course-files","name":"1742576498970-2.png","properties":{"creationTime":"2025-03-21T17:01:38.972Z","lastModified":"2025-03-21T17:01:38.972Z","etag":"\"0x1F192B26835AAB0\"","contentLength":145000,"contentType":"image/png","contentMD5":{"type":"Buffer","data":[212,29,140,217,143,0,178,4,233,128,9,152,236,248,66,126]},"blobType":"BlockBlob","leaseStatus":"unlocked","leaseState":"available","serverEncrypted":true,"accessTier":"Hot","accessTierInferred":true,"accessTierChangeTime":"2025-03-21T17:01:38.972Z"},"snapshot":"","isCommitted":true,"persistency":{"id":"99073389-333d-4a24-928c-1b7f3c3eb14d","offset":1264338,"count":145000},"meta":{"revision":0,"created":1742576498979,"version":0},"$loki":4},{"deleted":false,"accountName":"devstoreaccount1","containerName":"course-files","name":"1742837780842-VideoGuidelines.pdf","properties":{"creationTime":"2025-03-24T17:36:20.845Z","lastModified":"2025-03-24T17:36:20.845Z","etag":"\"0x1C3BAAE80804D40\"","contentLength":66340,"contentType":"application/pdf","contentMD5":{"type":"Buffer","data":[156,65,134,189,250,50,119,92,163,208,86,150,92,167,71,27]},"blobType":"BlockBlob","leaseStatus":"unlocked","leaseState":"available","serverEncrypted":true,"accessTier":"Hot","accessTierInferred":true,"accessTierChangeTime":"2025-03-24T17:36:20.845Z"},"snapshot":"","isCommitted":true,"persistency":{"id":"2d2beeb0-d433-4b1f-831b-ebdb9288f708","offset":0,"count":66340},"meta":{"revision":0,"created":1742837780853,"version":0},"$loki":5}],"idIndex":null,"binaryIndices":{"accountName":{"name":"accountName","dirty":false,"values":[4,3,2,1,0]},"containerName":{"name":"containerName","dirty":false,"values":[4,3,2,1,0]},"name":{"name":"name","dirty":false,"values":[0,1,2,3,4]},"snapshot":{"name":"snapshot","dirty":false,"values":[4,3,2,1,0]}},"constraints":null,"uniqueNames":[],"transforms":{},"objType":"$BLOBS_COLLECTION$","dirty":false,"cachedIndex":null,"cachedBinaryIndex":null,"cachedData":null,"adaptiveBinaryIndices":true,"transactional":false,"cloneObjects":false,"cloneMethod":"parse-stringify","asyncListeners":false,"disableMeta":false,"disableChangesApi":true,"disableDeltaChangesApi":true,"autoupdate":false,"serializableIndices":true,"disableFreeze":true,"ttl":null,"maxId":5,"DynamicViews":[],"events":{"insert":[],"update":[],"pre-insert":[],"pre-update":[],"close":[],"flushbuffer":[],"error":[],"delete":[null],"warning":[null]},"changes":[],"dirtyIds":[]},{"name":"$BLOCKS_COLLECTION$","data":[],"idIndex":null,"binaryIndices":{"accountName":{"name":"accountName","dirty":false,"values":[]},"containerName":{"name":"containerName","dirty":false,"values":[]},"blobName":{"name":"blobName","dirty":false,"values":[]},"name":{"name":"name","dirty":false,"values":[]}},"constraints":null,"uniqueNames":[],"transforms":{},"objType":"$BLOCKS_COLLECTION$","dirty":false,"cachedIndex":null,"cachedBinaryIndex":null,"cachedData":null,"adaptiveBinaryIndices":true,"transactional":false,"cloneObjects":false,"cloneMethod":"parse-stringify","asyncListeners":false,"disableMeta":false,"disableChangesApi":true,"disableDeltaChangesApi":true,"autoupdate":false,"serializableIndices":true,"disableFreeze":true,"ttl":null,"maxId":0,"DynamicViews":[],"events":{"insert":[],"update":[],"pre-insert":[],"pre-update":[],"close":[],"flushbuffer":[],"error":[],"delete":[null],"warning":[null]},"changes":[],"dirtyIds":[]}],"databaseVersion":1.5,"engineVersion":1.5,"autosave":true,"autosaveInterval":5000,"autosaveHandle":null,"throttledSaves":true,"options":{"persistenceMethod":"fs","autosave":true,"autosaveInterval":5000,"serializationMethod":"normal","destructureDelimiter":"$<\n"},"persistenceMethod":"fs","persistenceAdapter":null,"verbose":false,"events":{"init":[null],"loaded":[],"flushChanges":[],"close":[],"changes":[],"warning":[]},"ENV":"NODEJS"}
\ No newline at end of file
+{
+ "filename": "C:\\Users\\Ivyla\\Documents\\GitHub\\COMP0067_2025_Team1\\__azurite_db_blob__.json",
+ "collections": [
+ {
+ "name": "$SERVICES_COLLECTION$",
+ "data": [],
+ "idIndex": null,
+ "binaryIndices": {},
+ "constraints": null,
+ "uniqueNames": ["accountName"],
+ "transforms": {},
+ "objType": "$SERVICES_COLLECTION$",
+ "dirty": false,
+ "cachedIndex": null,
+ "cachedBinaryIndex": null,
+ "cachedData": null,
+ "adaptiveBinaryIndices": true,
+ "transactional": false,
+ "cloneObjects": false,
+ "cloneMethod": "parse-stringify",
+ "asyncListeners": false,
+ "disableMeta": false,
+ "disableChangesApi": true,
+ "disableDeltaChangesApi": true,
+ "autoupdate": false,
+ "serializableIndices": true,
+ "disableFreeze": true,
+ "ttl": null,
+ "maxId": 0,
+ "DynamicViews": [],
+ "events": {
+ "insert": [],
+ "update": [],
+ "pre-insert": [],
+ "pre-update": [],
+ "close": [],
+ "flushbuffer": [],
+ "error": [],
+ "delete": [null],
+ "warning": [null]
+ },
+ "changes": [],
+ "dirtyIds": []
+ },
+ {
+ "name": "$CONTAINERS_COLLECTION$",
+ "data": [
+ {
+ "accountName": "devstoreaccount1",
+ "name": "course-files",
+ "properties": {
+ "etag": "\"0x20C1223A3927D00\"",
+ "lastModified": "2025-03-13T21:12:40.981Z",
+ "leaseStatus": "unlocked",
+ "leaseState": "available",
+ "publicAccess": "blob",
+ "hasImmutabilityPolicy": false,
+ "hasLegalHold": false
+ },
+ "meta": { "revision": 0, "created": 1741900361031, "version": 0 },
+ "$loki": 1
+ }
+ ],
+ "idIndex": null,
+ "binaryIndices": {
+ "accountName": { "name": "accountName", "dirty": false, "values": [0] },
+ "name": { "name": "name", "dirty": false, "values": [0] }
+ },
+ "constraints": null,
+ "uniqueNames": [],
+ "transforms": {},
+ "objType": "$CONTAINERS_COLLECTION$",
+ "dirty": false,
+ "cachedIndex": null,
+ "cachedBinaryIndex": null,
+ "cachedData": null,
+ "adaptiveBinaryIndices": true,
+ "transactional": false,
+ "cloneObjects": false,
+ "cloneMethod": "parse-stringify",
+ "asyncListeners": false,
+ "disableMeta": false,
+ "disableChangesApi": true,
+ "disableDeltaChangesApi": true,
+ "autoupdate": false,
+ "serializableIndices": true,
+ "disableFreeze": true,
+ "ttl": null,
+ "maxId": 1,
+ "DynamicViews": [],
+ "events": {
+ "insert": [],
+ "update": [],
+ "pre-insert": [],
+ "pre-update": [],
+ "close": [],
+ "flushbuffer": [],
+ "error": [],
+ "delete": [null],
+ "warning": [null]
+ },
+ "changes": [],
+ "dirtyIds": []
+ },
+ {
+ "name": "$BLOBS_COLLECTION$",
+ "data": [
+ {
+ "deleted": false,
+ "accountName": "devstoreaccount1",
+ "containerName": "course-files",
+ "name": "1741900361039-2_ML_LinearRegression.pdf",
+ "properties": {
+ "creationTime": "2025-03-13T21:12:41.041Z",
+ "lastModified": "2025-03-13T21:12:41.041Z",
+ "etag": "\"0x23001DFC0318BA0\"",
+ "contentLength": 559669,
+ "contentType": "application/pdf",
+ "contentMD5": {
+ "type": "Buffer",
+ "data": [
+ 43, 85, 103, 175, 186, 209, 77, 26, 185, 37, 42, 228, 191, 54,
+ 193, 79
+ ]
+ },
+ "blobType": "BlockBlob",
+ "leaseStatus": "unlocked",
+ "leaseState": "available",
+ "serverEncrypted": true,
+ "accessTier": "Hot",
+ "accessTierInferred": true,
+ "accessTierChangeTime": "2025-03-13T21:12:41.041Z"
+ },
+ "snapshot": "",
+ "isCommitted": true,
+ "persistency": {
+ "id": "99073389-333d-4a24-928c-1b7f3c3eb14d",
+ "offset": 0,
+ "count": 559669
+ },
+ "meta": { "revision": 0, "created": 1741900361061, "version": 0 },
+ "$loki": 1
+ },
+ {
+ "deleted": false,
+ "accountName": "devstoreaccount1",
+ "containerName": "course-files",
+ "name": "1741900784863-2_ML_LinearRegression.pdf",
+ "properties": {
+ "creationTime": "2025-03-13T21:19:44.865Z",
+ "lastModified": "2025-03-13T21:19:44.865Z",
+ "etag": "\"0x1E403531A477810\"",
+ "contentLength": 559669,
+ "contentType": "application/pdf",
+ "contentMD5": {
+ "type": "Buffer",
+ "data": [
+ 212, 29, 140, 217, 143, 0, 178, 4, 233, 128, 9, 152, 236, 248,
+ 66, 126
+ ]
+ },
+ "blobType": "BlockBlob",
+ "leaseStatus": "unlocked",
+ "leaseState": "available",
+ "serverEncrypted": true,
+ "accessTier": "Hot",
+ "accessTierInferred": true,
+ "accessTierChangeTime": "2025-03-13T21:19:44.865Z"
+ },
+ "snapshot": "",
+ "isCommitted": true,
+ "persistency": {
+ "id": "99073389-333d-4a24-928c-1b7f3c3eb14d",
+ "offset": 559669,
+ "count": 559669
+ },
+ "meta": { "revision": 0, "created": 1741900784878, "version": 0 },
+ "$loki": 2
+ },
+ {
+ "deleted": false,
+ "accountName": "devstoreaccount1",
+ "containerName": "course-files",
+ "name": "1742576429640-2.png",
+ "properties": {
+ "creationTime": "2025-03-21T17:00:29.643Z",
+ "lastModified": "2025-03-21T17:00:29.643Z",
+ "etag": "\"0x2640C69A152EB40\"",
+ "contentLength": 145000,
+ "contentType": "image/png",
+ "contentMD5": {
+ "type": "Buffer",
+ "data": [
+ 212, 29, 140, 217, 143, 0, 178, 4, 233, 128, 9, 152, 236, 248,
+ 66, 126
+ ]
+ },
+ "blobType": "BlockBlob",
+ "leaseStatus": "unlocked",
+ "leaseState": "available",
+ "serverEncrypted": true,
+ "accessTier": "Hot",
+ "accessTierInferred": true,
+ "accessTierChangeTime": "2025-03-21T17:00:29.643Z"
+ },
+ "snapshot": "",
+ "isCommitted": true,
+ "persistency": {
+ "id": "99073389-333d-4a24-928c-1b7f3c3eb14d",
+ "offset": 1119338,
+ "count": 145000
+ },
+ "meta": { "revision": 0, "created": 1742576429663, "version": 0 },
+ "$loki": 3
+ },
+ {
+ "deleted": false,
+ "accountName": "devstoreaccount1",
+ "containerName": "course-files",
+ "name": "1742576498970-2.png",
+ "properties": {
+ "creationTime": "2025-03-21T17:01:38.972Z",
+ "lastModified": "2025-03-21T17:01:38.972Z",
+ "etag": "\"0x1F192B26835AAB0\"",
+ "contentLength": 145000,
+ "contentType": "image/png",
+ "contentMD5": {
+ "type": "Buffer",
+ "data": [
+ 212, 29, 140, 217, 143, 0, 178, 4, 233, 128, 9, 152, 236, 248,
+ 66, 126
+ ]
+ },
+ "blobType": "BlockBlob",
+ "leaseStatus": "unlocked",
+ "leaseState": "available",
+ "serverEncrypted": true,
+ "accessTier": "Hot",
+ "accessTierInferred": true,
+ "accessTierChangeTime": "2025-03-21T17:01:38.972Z"
+ },
+ "snapshot": "",
+ "isCommitted": true,
+ "persistency": {
+ "id": "99073389-333d-4a24-928c-1b7f3c3eb14d",
+ "offset": 1264338,
+ "count": 145000
+ },
+ "meta": { "revision": 0, "created": 1742576498979, "version": 0 },
+ "$loki": 4
+ },
+ {
+ "deleted": false,
+ "accountName": "devstoreaccount1",
+ "containerName": "course-files",
+ "name": "1742837780842-VideoGuidelines.pdf",
+ "properties": {
+ "creationTime": "2025-03-24T17:36:20.845Z",
+ "lastModified": "2025-03-24T17:36:20.845Z",
+ "etag": "\"0x1C3BAAE80804D40\"",
+ "contentLength": 66340,
+ "contentType": "application/pdf",
+ "contentMD5": {
+ "type": "Buffer",
+ "data": [
+ 156, 65, 134, 189, 250, 50, 119, 92, 163, 208, 86, 150, 92, 167,
+ 71, 27
+ ]
+ },
+ "blobType": "BlockBlob",
+ "leaseStatus": "unlocked",
+ "leaseState": "available",
+ "serverEncrypted": true,
+ "accessTier": "Hot",
+ "accessTierInferred": true,
+ "accessTierChangeTime": "2025-03-24T17:36:20.845Z"
+ },
+ "snapshot": "",
+ "isCommitted": true,
+ "persistency": {
+ "id": "2d2beeb0-d433-4b1f-831b-ebdb9288f708",
+ "offset": 0,
+ "count": 66340
+ },
+ "meta": { "revision": 0, "created": 1742837780853, "version": 0 },
+ "$loki": 5
+ }
+ ],
+ "idIndex": null,
+ "binaryIndices": {
+ "accountName": {
+ "name": "accountName",
+ "dirty": false,
+ "values": [4, 3, 2, 1, 0]
+ },
+ "containerName": {
+ "name": "containerName",
+ "dirty": false,
+ "values": [4, 3, 2, 1, 0]
+ },
+ "name": { "name": "name", "dirty": false, "values": [0, 1, 2, 3, 4] },
+ "snapshot": {
+ "name": "snapshot",
+ "dirty": false,
+ "values": [4, 3, 2, 1, 0]
+ }
+ },
+ "constraints": null,
+ "uniqueNames": [],
+ "transforms": {},
+ "objType": "$BLOBS_COLLECTION$",
+ "dirty": false,
+ "cachedIndex": null,
+ "cachedBinaryIndex": null,
+ "cachedData": null,
+ "adaptiveBinaryIndices": true,
+ "transactional": false,
+ "cloneObjects": false,
+ "cloneMethod": "parse-stringify",
+ "asyncListeners": false,
+ "disableMeta": false,
+ "disableChangesApi": true,
+ "disableDeltaChangesApi": true,
+ "autoupdate": false,
+ "serializableIndices": true,
+ "disableFreeze": true,
+ "ttl": null,
+ "maxId": 5,
+ "DynamicViews": [],
+ "events": {
+ "insert": [],
+ "update": [],
+ "pre-insert": [],
+ "pre-update": [],
+ "close": [],
+ "flushbuffer": [],
+ "error": [],
+ "delete": [null],
+ "warning": [null]
+ },
+ "changes": [],
+ "dirtyIds": []
+ },
+ {
+ "name": "$BLOCKS_COLLECTION$",
+ "data": [],
+ "idIndex": null,
+ "binaryIndices": {
+ "accountName": { "name": "accountName", "dirty": false, "values": [] },
+ "containerName": {
+ "name": "containerName",
+ "dirty": false,
+ "values": []
+ },
+ "blobName": { "name": "blobName", "dirty": false, "values": [] },
+ "name": { "name": "name", "dirty": false, "values": [] }
+ },
+ "constraints": null,
+ "uniqueNames": [],
+ "transforms": {},
+ "objType": "$BLOCKS_COLLECTION$",
+ "dirty": false,
+ "cachedIndex": null,
+ "cachedBinaryIndex": null,
+ "cachedData": null,
+ "adaptiveBinaryIndices": true,
+ "transactional": false,
+ "cloneObjects": false,
+ "cloneMethod": "parse-stringify",
+ "asyncListeners": false,
+ "disableMeta": false,
+ "disableChangesApi": true,
+ "disableDeltaChangesApi": true,
+ "autoupdate": false,
+ "serializableIndices": true,
+ "disableFreeze": true,
+ "ttl": null,
+ "maxId": 0,
+ "DynamicViews": [],
+ "events": {
+ "insert": [],
+ "update": [],
+ "pre-insert": [],
+ "pre-update": [],
+ "close": [],
+ "flushbuffer": [],
+ "error": [],
+ "delete": [null],
+ "warning": [null]
+ },
+ "changes": [],
+ "dirtyIds": []
+ }
+ ],
+ "databaseVersion": 1.5,
+ "engineVersion": 1.5,
+ "autosave": true,
+ "autosaveInterval": 5000,
+ "autosaveHandle": null,
+ "throttledSaves": true,
+ "options": {
+ "persistenceMethod": "fs",
+ "autosave": true,
+ "autosaveInterval": 5000,
+ "serializationMethod": "normal",
+ "destructureDelimiter": "$<\n"
+ },
+ "persistenceMethod": "fs",
+ "persistenceAdapter": null,
+ "verbose": false,
+ "events": {
+ "init": [null],
+ "loaded": [],
+ "flushChanges": [],
+ "close": [],
+ "changes": [],
+ "warning": []
+ },
+ "ENV": "NODEJS"
+}
diff --git a/(azurite)/__azurite_db_blob_extent__.json b/(azurite)/__azurite_db_blob_extent__.json
index 3a1741b7..e5876802 100644
--- a/(azurite)/__azurite_db_blob_extent__.json
+++ b/(azurite)/__azurite_db_blob_extent__.json
@@ -1 +1,98 @@
-{"filename":"C:\\Users\\Ivyla\\Documents\\GitHub\\COMP0067_2025_Team1\\__azurite_db_blob_extent__.json","collections":[{"name":"$EXTENTS_COLLECTION$","data":[{"id":"99073389-333d-4a24-928c-1b7f3c3eb14d","locationId":"Default","path":"99073389-333d-4a24-928c-1b7f3c3eb14d","size":1409338,"lastModifiedInMS":1741900361055,"meta":{"revision":3,"created":1741900361055,"version":0,"updated":1742576498978},"$loki":1,"LastModifyInMS":1742576498978},{"id":"2d2beeb0-d433-4b1f-831b-ebdb9288f708","locationId":"Default","path":"2d2beeb0-d433-4b1f-831b-ebdb9288f708","size":66340,"lastModifiedInMS":1742837780851,"meta":{"revision":0,"created":1742837780851,"version":0},"$loki":2}],"idIndex":null,"binaryIndices":{"id":{"name":"id","dirty":false,"values":[1,0]}},"constraints":null,"uniqueNames":[],"transforms":{},"objType":"$EXTENTS_COLLECTION$","dirty":false,"cachedIndex":null,"cachedBinaryIndex":null,"cachedData":null,"adaptiveBinaryIndices":true,"transactional":false,"cloneObjects":false,"cloneMethod":"parse-stringify","asyncListeners":false,"disableMeta":false,"disableChangesApi":true,"disableDeltaChangesApi":true,"autoupdate":false,"serializableIndices":true,"disableFreeze":true,"ttl":null,"maxId":2,"DynamicViews":[],"events":{"insert":[],"update":[],"pre-insert":[],"pre-update":[],"close":[],"flushbuffer":[],"error":[],"delete":[null],"warning":[null]},"changes":[],"dirtyIds":[]}],"databaseVersion":1.5,"engineVersion":1.5,"autosave":true,"autosaveInterval":5000,"autosaveHandle":null,"throttledSaves":true,"options":{"persistenceMethod":"fs","autosave":true,"autosaveInterval":5000,"serializationMethod":"normal","destructureDelimiter":"$<\n"},"persistenceMethod":"fs","persistenceAdapter":null,"verbose":false,"events":{"init":[null],"loaded":[],"flushChanges":[],"close":[],"changes":[],"warning":[]},"ENV":"NODEJS"}
\ No newline at end of file
+{
+ "filename": "C:\\Users\\Ivyla\\Documents\\GitHub\\COMP0067_2025_Team1\\__azurite_db_blob_extent__.json",
+ "collections": [
+ {
+ "name": "$EXTENTS_COLLECTION$",
+ "data": [
+ {
+ "id": "99073389-333d-4a24-928c-1b7f3c3eb14d",
+ "locationId": "Default",
+ "path": "99073389-333d-4a24-928c-1b7f3c3eb14d",
+ "size": 1409338,
+ "lastModifiedInMS": 1741900361055,
+ "meta": {
+ "revision": 3,
+ "created": 1741900361055,
+ "version": 0,
+ "updated": 1742576498978
+ },
+ "$loki": 1,
+ "LastModifyInMS": 1742576498978
+ },
+ {
+ "id": "2d2beeb0-d433-4b1f-831b-ebdb9288f708",
+ "locationId": "Default",
+ "path": "2d2beeb0-d433-4b1f-831b-ebdb9288f708",
+ "size": 66340,
+ "lastModifiedInMS": 1742837780851,
+ "meta": { "revision": 0, "created": 1742837780851, "version": 0 },
+ "$loki": 2
+ }
+ ],
+ "idIndex": null,
+ "binaryIndices": {
+ "id": { "name": "id", "dirty": false, "values": [1, 0] }
+ },
+ "constraints": null,
+ "uniqueNames": [],
+ "transforms": {},
+ "objType": "$EXTENTS_COLLECTION$",
+ "dirty": false,
+ "cachedIndex": null,
+ "cachedBinaryIndex": null,
+ "cachedData": null,
+ "adaptiveBinaryIndices": true,
+ "transactional": false,
+ "cloneObjects": false,
+ "cloneMethod": "parse-stringify",
+ "asyncListeners": false,
+ "disableMeta": false,
+ "disableChangesApi": true,
+ "disableDeltaChangesApi": true,
+ "autoupdate": false,
+ "serializableIndices": true,
+ "disableFreeze": true,
+ "ttl": null,
+ "maxId": 2,
+ "DynamicViews": [],
+ "events": {
+ "insert": [],
+ "update": [],
+ "pre-insert": [],
+ "pre-update": [],
+ "close": [],
+ "flushbuffer": [],
+ "error": [],
+ "delete": [null],
+ "warning": [null]
+ },
+ "changes": [],
+ "dirtyIds": []
+ }
+ ],
+ "databaseVersion": 1.5,
+ "engineVersion": 1.5,
+ "autosave": true,
+ "autosaveInterval": 5000,
+ "autosaveHandle": null,
+ "throttledSaves": true,
+ "options": {
+ "persistenceMethod": "fs",
+ "autosave": true,
+ "autosaveInterval": 5000,
+ "serializationMethod": "normal",
+ "destructureDelimiter": "$<\n"
+ },
+ "persistenceMethod": "fs",
+ "persistenceAdapter": null,
+ "verbose": false,
+ "events": {
+ "init": [null],
+ "loaded": [],
+ "flushChanges": [],
+ "close": [],
+ "changes": [],
+ "warning": []
+ },
+ "ENV": "NODEJS"
+}
diff --git a/(azurite)/__azurite_db_queue__.json b/(azurite)/__azurite_db_queue__.json
index a5bcb523..72eb050e 100644
--- a/(azurite)/__azurite_db_queue__.json
+++ b/(azurite)/__azurite_db_queue__.json
@@ -1 +1,161 @@
-{"filename":"C:\\Users\\Ivyla\\Documents\\GitHub\\COMP0067_2025_Team1\\__azurite_db_queue__.json","collections":[{"name":"$SERVICES_COLLECTION$","data":[],"idIndex":null,"binaryIndices":{},"constraints":null,"uniqueNames":["accountName"],"transforms":{},"objType":"$SERVICES_COLLECTION$","dirty":false,"cachedIndex":null,"cachedBinaryIndex":null,"cachedData":null,"adaptiveBinaryIndices":true,"transactional":false,"cloneObjects":false,"cloneMethod":"parse-stringify","asyncListeners":false,"disableMeta":false,"disableChangesApi":true,"disableDeltaChangesApi":true,"autoupdate":false,"serializableIndices":true,"disableFreeze":true,"ttl":null,"maxId":0,"DynamicViews":[],"events":{"insert":[],"update":[],"pre-insert":[],"pre-update":[],"close":[],"flushbuffer":[],"error":[],"delete":[null],"warning":[null]},"changes":[],"dirtyIds":[]},{"name":"$QUEUES_COLLECTION$","data":[],"idIndex":null,"binaryIndices":{"accountName":{"name":"accountName","dirty":false,"values":[]},"name":{"name":"name","dirty":false,"values":[]}},"constraints":null,"uniqueNames":[],"transforms":{},"objType":"$QUEUES_COLLECTION$","dirty":false,"cachedIndex":null,"cachedBinaryIndex":null,"cachedData":null,"adaptiveBinaryIndices":true,"transactional":false,"cloneObjects":false,"cloneMethod":"parse-stringify","asyncListeners":false,"disableMeta":false,"disableChangesApi":true,"disableDeltaChangesApi":true,"autoupdate":false,"serializableIndices":true,"disableFreeze":true,"ttl":null,"maxId":0,"DynamicViews":[],"events":{"insert":[],"update":[],"pre-insert":[],"pre-update":[],"close":[],"flushbuffer":[],"error":[],"delete":[null],"warning":[null]},"changes":[],"dirtyIds":[]},{"name":"$MESSAGES_COLLECTION$","data":[],"idIndex":null,"binaryIndices":{"accountName":{"name":"accountName","dirty":false,"values":[]},"queueName":{"name":"queueName","dirty":false,"values":[]},"messageId":{"name":"messageId","dirty":false,"values":[]},"visibleTime":{"name":"visibleTime","dirty":false,"values":[]}},"constraints":null,"uniqueNames":[],"transforms":{},"objType":"$MESSAGES_COLLECTION$","dirty":false,"cachedIndex":null,"cachedBinaryIndex":null,"cachedData":null,"adaptiveBinaryIndices":true,"transactional":false,"cloneObjects":false,"cloneMethod":"parse-stringify","asyncListeners":false,"disableMeta":false,"disableChangesApi":true,"disableDeltaChangesApi":true,"autoupdate":false,"serializableIndices":true,"disableFreeze":true,"ttl":null,"maxId":0,"DynamicViews":[],"events":{"insert":[],"update":[],"pre-insert":[],"pre-update":[],"close":[],"flushbuffer":[],"error":[],"delete":[null],"warning":[null]},"changes":[],"dirtyIds":[]}],"databaseVersion":1.5,"engineVersion":1.5,"autosave":true,"autosaveInterval":5000,"autosaveHandle":null,"throttledSaves":true,"options":{"persistenceMethod":"fs","autosave":true,"autosaveInterval":5000,"serializationMethod":"normal","destructureDelimiter":"$<\n"},"persistenceMethod":"fs","persistenceAdapter":null,"verbose":false,"events":{"init":[null],"loaded":[],"flushChanges":[],"close":[],"changes":[],"warning":[]},"ENV":"NODEJS"}
\ No newline at end of file
+{
+ "filename": "C:\\Users\\Ivyla\\Documents\\GitHub\\COMP0067_2025_Team1\\__azurite_db_queue__.json",
+ "collections": [
+ {
+ "name": "$SERVICES_COLLECTION$",
+ "data": [],
+ "idIndex": null,
+ "binaryIndices": {},
+ "constraints": null,
+ "uniqueNames": ["accountName"],
+ "transforms": {},
+ "objType": "$SERVICES_COLLECTION$",
+ "dirty": false,
+ "cachedIndex": null,
+ "cachedBinaryIndex": null,
+ "cachedData": null,
+ "adaptiveBinaryIndices": true,
+ "transactional": false,
+ "cloneObjects": false,
+ "cloneMethod": "parse-stringify",
+ "asyncListeners": false,
+ "disableMeta": false,
+ "disableChangesApi": true,
+ "disableDeltaChangesApi": true,
+ "autoupdate": false,
+ "serializableIndices": true,
+ "disableFreeze": true,
+ "ttl": null,
+ "maxId": 0,
+ "DynamicViews": [],
+ "events": {
+ "insert": [],
+ "update": [],
+ "pre-insert": [],
+ "pre-update": [],
+ "close": [],
+ "flushbuffer": [],
+ "error": [],
+ "delete": [null],
+ "warning": [null]
+ },
+ "changes": [],
+ "dirtyIds": []
+ },
+ {
+ "name": "$QUEUES_COLLECTION$",
+ "data": [],
+ "idIndex": null,
+ "binaryIndices": {
+ "accountName": { "name": "accountName", "dirty": false, "values": [] },
+ "name": { "name": "name", "dirty": false, "values": [] }
+ },
+ "constraints": null,
+ "uniqueNames": [],
+ "transforms": {},
+ "objType": "$QUEUES_COLLECTION$",
+ "dirty": false,
+ "cachedIndex": null,
+ "cachedBinaryIndex": null,
+ "cachedData": null,
+ "adaptiveBinaryIndices": true,
+ "transactional": false,
+ "cloneObjects": false,
+ "cloneMethod": "parse-stringify",
+ "asyncListeners": false,
+ "disableMeta": false,
+ "disableChangesApi": true,
+ "disableDeltaChangesApi": true,
+ "autoupdate": false,
+ "serializableIndices": true,
+ "disableFreeze": true,
+ "ttl": null,
+ "maxId": 0,
+ "DynamicViews": [],
+ "events": {
+ "insert": [],
+ "update": [],
+ "pre-insert": [],
+ "pre-update": [],
+ "close": [],
+ "flushbuffer": [],
+ "error": [],
+ "delete": [null],
+ "warning": [null]
+ },
+ "changes": [],
+ "dirtyIds": []
+ },
+ {
+ "name": "$MESSAGES_COLLECTION$",
+ "data": [],
+ "idIndex": null,
+ "binaryIndices": {
+ "accountName": { "name": "accountName", "dirty": false, "values": [] },
+ "queueName": { "name": "queueName", "dirty": false, "values": [] },
+ "messageId": { "name": "messageId", "dirty": false, "values": [] },
+ "visibleTime": { "name": "visibleTime", "dirty": false, "values": [] }
+ },
+ "constraints": null,
+ "uniqueNames": [],
+ "transforms": {},
+ "objType": "$MESSAGES_COLLECTION$",
+ "dirty": false,
+ "cachedIndex": null,
+ "cachedBinaryIndex": null,
+ "cachedData": null,
+ "adaptiveBinaryIndices": true,
+ "transactional": false,
+ "cloneObjects": false,
+ "cloneMethod": "parse-stringify",
+ "asyncListeners": false,
+ "disableMeta": false,
+ "disableChangesApi": true,
+ "disableDeltaChangesApi": true,
+ "autoupdate": false,
+ "serializableIndices": true,
+ "disableFreeze": true,
+ "ttl": null,
+ "maxId": 0,
+ "DynamicViews": [],
+ "events": {
+ "insert": [],
+ "update": [],
+ "pre-insert": [],
+ "pre-update": [],
+ "close": [],
+ "flushbuffer": [],
+ "error": [],
+ "delete": [null],
+ "warning": [null]
+ },
+ "changes": [],
+ "dirtyIds": []
+ }
+ ],
+ "databaseVersion": 1.5,
+ "engineVersion": 1.5,
+ "autosave": true,
+ "autosaveInterval": 5000,
+ "autosaveHandle": null,
+ "throttledSaves": true,
+ "options": {
+ "persistenceMethod": "fs",
+ "autosave": true,
+ "autosaveInterval": 5000,
+ "serializationMethod": "normal",
+ "destructureDelimiter": "$<\n"
+ },
+ "persistenceMethod": "fs",
+ "persistenceAdapter": null,
+ "verbose": false,
+ "events": {
+ "init": [null],
+ "loaded": [],
+ "flushChanges": [],
+ "close": [],
+ "changes": [],
+ "warning": []
+ },
+ "ENV": "NODEJS"
+}
diff --git a/(azurite)/__azurite_db_queue_extent__.json b/(azurite)/__azurite_db_queue_extent__.json
index 099acac7..a3253368 100644
--- a/(azurite)/__azurite_db_queue_extent__.json
+++ b/(azurite)/__azurite_db_queue_extent__.json
@@ -1 +1,71 @@
-{"filename":"C:\\Users\\Ivyla\\Documents\\GitHub\\COMP0067_2025_Team1\\__azurite_db_queue_extent__.json","collections":[{"name":"$EXTENTS_COLLECTION$","data":[],"idIndex":null,"binaryIndices":{"id":{"name":"id","dirty":false,"values":[]}},"constraints":null,"uniqueNames":[],"transforms":{},"objType":"$EXTENTS_COLLECTION$","dirty":false,"cachedIndex":null,"cachedBinaryIndex":null,"cachedData":null,"adaptiveBinaryIndices":true,"transactional":false,"cloneObjects":false,"cloneMethod":"parse-stringify","asyncListeners":false,"disableMeta":false,"disableChangesApi":true,"disableDeltaChangesApi":true,"autoupdate":false,"serializableIndices":true,"disableFreeze":true,"ttl":null,"maxId":0,"DynamicViews":[],"events":{"insert":[],"update":[],"pre-insert":[],"pre-update":[],"close":[],"flushbuffer":[],"error":[],"delete":[null],"warning":[null]},"changes":[],"dirtyIds":[]}],"databaseVersion":1.5,"engineVersion":1.5,"autosave":true,"autosaveInterval":5000,"autosaveHandle":null,"throttledSaves":true,"options":{"persistenceMethod":"fs","autosave":true,"autosaveInterval":5000,"serializationMethod":"normal","destructureDelimiter":"$<\n"},"persistenceMethod":"fs","persistenceAdapter":null,"verbose":false,"events":{"init":[null],"loaded":[],"flushChanges":[],"close":[],"changes":[],"warning":[]},"ENV":"NODEJS"}
\ No newline at end of file
+{
+ "filename": "C:\\Users\\Ivyla\\Documents\\GitHub\\COMP0067_2025_Team1\\__azurite_db_queue_extent__.json",
+ "collections": [
+ {
+ "name": "$EXTENTS_COLLECTION$",
+ "data": [],
+ "idIndex": null,
+ "binaryIndices": { "id": { "name": "id", "dirty": false, "values": [] } },
+ "constraints": null,
+ "uniqueNames": [],
+ "transforms": {},
+ "objType": "$EXTENTS_COLLECTION$",
+ "dirty": false,
+ "cachedIndex": null,
+ "cachedBinaryIndex": null,
+ "cachedData": null,
+ "adaptiveBinaryIndices": true,
+ "transactional": false,
+ "cloneObjects": false,
+ "cloneMethod": "parse-stringify",
+ "asyncListeners": false,
+ "disableMeta": false,
+ "disableChangesApi": true,
+ "disableDeltaChangesApi": true,
+ "autoupdate": false,
+ "serializableIndices": true,
+ "disableFreeze": true,
+ "ttl": null,
+ "maxId": 0,
+ "DynamicViews": [],
+ "events": {
+ "insert": [],
+ "update": [],
+ "pre-insert": [],
+ "pre-update": [],
+ "close": [],
+ "flushbuffer": [],
+ "error": [],
+ "delete": [null],
+ "warning": [null]
+ },
+ "changes": [],
+ "dirtyIds": []
+ }
+ ],
+ "databaseVersion": 1.5,
+ "engineVersion": 1.5,
+ "autosave": true,
+ "autosaveInterval": 5000,
+ "autosaveHandle": null,
+ "throttledSaves": true,
+ "options": {
+ "persistenceMethod": "fs",
+ "autosave": true,
+ "autosaveInterval": 5000,
+ "serializationMethod": "normal",
+ "destructureDelimiter": "$<\n"
+ },
+ "persistenceMethod": "fs",
+ "persistenceAdapter": null,
+ "verbose": false,
+ "events": {
+ "init": [null],
+ "loaded": [],
+ "flushChanges": [],
+ "close": [],
+ "changes": [],
+ "warning": []
+ },
+ "ENV": "NODEJS"
+}
diff --git a/(azurite)/__azurite_db_table__.json b/(azurite)/__azurite_db_table__.json
index 10c20a92..750337c9 100644
--- a/(azurite)/__azurite_db_table__.json
+++ b/(azurite)/__azurite_db_table__.json
@@ -1 +1,115 @@
-{"filename":"C:\\Users\\Ivyla\\Documents\\GitHub\\COMP0067_2025_Team1\\__azurite_db_table__.json","collections":[{"name":"$TABLES_COLLECTION$","data":[],"idIndex":null,"binaryIndices":{"account":{"name":"account","dirty":false,"values":[]},"table":{"name":"table","dirty":false,"values":[]}},"constraints":null,"uniqueNames":[],"transforms":{},"objType":"$TABLES_COLLECTION$","dirty":false,"cachedIndex":null,"cachedBinaryIndex":null,"cachedData":null,"adaptiveBinaryIndices":true,"transactional":false,"cloneObjects":false,"cloneMethod":"parse-stringify","asyncListeners":false,"disableMeta":false,"disableChangesApi":true,"disableDeltaChangesApi":true,"autoupdate":false,"serializableIndices":true,"disableFreeze":true,"ttl":null,"maxId":0,"DynamicViews":[],"events":{"insert":[],"update":[],"pre-insert":[],"pre-update":[],"close":[],"flushbuffer":[],"error":[],"delete":[null],"warning":[null]},"changes":[],"dirtyIds":[]},{"name":"$SERVICES_COLLECTION$","data":[],"idIndex":null,"binaryIndices":{},"constraints":null,"uniqueNames":["accountName"],"transforms":{},"objType":"$SERVICES_COLLECTION$","dirty":false,"cachedIndex":null,"cachedBinaryIndex":null,"cachedData":null,"adaptiveBinaryIndices":true,"transactional":false,"cloneObjects":false,"cloneMethod":"parse-stringify","asyncListeners":false,"disableMeta":false,"disableChangesApi":true,"disableDeltaChangesApi":true,"autoupdate":false,"serializableIndices":true,"disableFreeze":true,"ttl":null,"maxId":0,"DynamicViews":[],"events":{"insert":[],"update":[],"pre-insert":[],"pre-update":[],"close":[],"flushbuffer":[],"error":[],"delete":[null],"warning":[null]},"changes":[],"dirtyIds":[]}],"databaseVersion":1.5,"engineVersion":1.5,"autosave":true,"autosaveInterval":5000,"autosaveHandle":null,"throttledSaves":true,"options":{"persistenceMethod":"fs","autosave":true,"autosaveInterval":5000,"serializationMethod":"normal","destructureDelimiter":"$<\n"},"persistenceMethod":"fs","persistenceAdapter":null,"verbose":false,"events":{"init":[null],"loaded":[],"flushChanges":[],"close":[],"changes":[],"warning":[]},"ENV":"NODEJS"}
\ No newline at end of file
+{
+ "filename": "C:\\Users\\Ivyla\\Documents\\GitHub\\COMP0067_2025_Team1\\__azurite_db_table__.json",
+ "collections": [
+ {
+ "name": "$TABLES_COLLECTION$",
+ "data": [],
+ "idIndex": null,
+ "binaryIndices": {
+ "account": { "name": "account", "dirty": false, "values": [] },
+ "table": { "name": "table", "dirty": false, "values": [] }
+ },
+ "constraints": null,
+ "uniqueNames": [],
+ "transforms": {},
+ "objType": "$TABLES_COLLECTION$",
+ "dirty": false,
+ "cachedIndex": null,
+ "cachedBinaryIndex": null,
+ "cachedData": null,
+ "adaptiveBinaryIndices": true,
+ "transactional": false,
+ "cloneObjects": false,
+ "cloneMethod": "parse-stringify",
+ "asyncListeners": false,
+ "disableMeta": false,
+ "disableChangesApi": true,
+ "disableDeltaChangesApi": true,
+ "autoupdate": false,
+ "serializableIndices": true,
+ "disableFreeze": true,
+ "ttl": null,
+ "maxId": 0,
+ "DynamicViews": [],
+ "events": {
+ "insert": [],
+ "update": [],
+ "pre-insert": [],
+ "pre-update": [],
+ "close": [],
+ "flushbuffer": [],
+ "error": [],
+ "delete": [null],
+ "warning": [null]
+ },
+ "changes": [],
+ "dirtyIds": []
+ },
+ {
+ "name": "$SERVICES_COLLECTION$",
+ "data": [],
+ "idIndex": null,
+ "binaryIndices": {},
+ "constraints": null,
+ "uniqueNames": ["accountName"],
+ "transforms": {},
+ "objType": "$SERVICES_COLLECTION$",
+ "dirty": false,
+ "cachedIndex": null,
+ "cachedBinaryIndex": null,
+ "cachedData": null,
+ "adaptiveBinaryIndices": true,
+ "transactional": false,
+ "cloneObjects": false,
+ "cloneMethod": "parse-stringify",
+ "asyncListeners": false,
+ "disableMeta": false,
+ "disableChangesApi": true,
+ "disableDeltaChangesApi": true,
+ "autoupdate": false,
+ "serializableIndices": true,
+ "disableFreeze": true,
+ "ttl": null,
+ "maxId": 0,
+ "DynamicViews": [],
+ "events": {
+ "insert": [],
+ "update": [],
+ "pre-insert": [],
+ "pre-update": [],
+ "close": [],
+ "flushbuffer": [],
+ "error": [],
+ "delete": [null],
+ "warning": [null]
+ },
+ "changes": [],
+ "dirtyIds": []
+ }
+ ],
+ "databaseVersion": 1.5,
+ "engineVersion": 1.5,
+ "autosave": true,
+ "autosaveInterval": 5000,
+ "autosaveHandle": null,
+ "throttledSaves": true,
+ "options": {
+ "persistenceMethod": "fs",
+ "autosave": true,
+ "autosaveInterval": 5000,
+ "serializationMethod": "normal",
+ "destructureDelimiter": "$<\n"
+ },
+ "persistenceMethod": "fs",
+ "persistenceAdapter": null,
+ "verbose": false,
+ "events": {
+ "init": [null],
+ "loaded": [],
+ "flushChanges": [],
+ "close": [],
+ "changes": [],
+ "warning": []
+ },
+ "ENV": "NODEJS"
+}
diff --git a/.eslintrc.json b/.eslintrc.json
deleted file mode 100644
index 9bafd79d..00000000
--- a/.eslintrc.json
+++ /dev/null
@@ -1 +0,0 @@
-{"extends":"next/core-web-vitals","rules":{"@typescript-eslint/no-explicit-any":"off","@typescript-eslint/no-unused-vars":"off","react/display-name":"off","react/no-unescaped-entities":"off","@next/next/no-img-element":"off","react-hooks/exhaustive-deps":"off"}}
diff --git a/eslint.config.mjs b/eslint.config.mjs
index c85fb67c..29a3424b 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -11,6 +11,16 @@ const compat = new FlatCompat({
const eslintConfig = [
...compat.extends("next/core-web-vitals", "next/typescript"),
+ {
+ rules: {
+ "@typescript-eslint/no-explicit-any": "warn",
+ "@typescript-eslint/no-unused-vars": "warn",
+ "react/display-name": "warn",
+ "react/no-unescaped-entities": "warn",
+ "@next/next/no-img-element": "warn",
+ "react-hooks/exhaustive-deps": "warn"
+ }
+ }
];
export default eslintConfig;
diff --git a/next.config.js b/next.config.ts
similarity index 61%
rename from next.config.js
rename to next.config.ts
index f08491de..ad2d180d 100644
--- a/next.config.js
+++ b/next.config.ts
@@ -1,31 +1,30 @@
-/** @type {import('next').NextConfig} */
-const nextConfig = {
+import type { NextConfig } from "next";
+const nextConfig: NextConfig = {
// todo: this need to set to true or remove it as default is true. set false as chart was giving error when first render
// https://github.com/apexcharts/apexcharts.js/issues/3652
reactStrictMode: false,
modularizeImports: {
- '@mui/material': {
- transform: '@mui/material/{{member}}'
+ "@mui/material": {
+ transform: "@mui/material/{{member}}",
},
- '@mui/lab': {
- transform: '@mui/lab/{{member}}'
+ "@mui/lab": {
+ transform: "@mui/lab/{{member}}",
+ },
+ "@mui/icons-material": {
+ transform: "@mui/icons-material/{{member}}",
},
- '@mui/icons-material': {
- transform: '@mui/icons-material/{{member}}'
- }
},
images: {
remotePatterns: [
{
- protocol: 'https',
- hostname: 'flagcdn.com',
- pathname: '**'
+ protocol: "https",
+ hostname: "flagcdn.com",
+ pathname: "**",
},
- ]
+ ],
},
-
eslint: {
// Warning: This allows production builds to successfully complete even if
// your project has ESLint errors.
@@ -36,9 +35,6 @@ const nextConfig = {
// your project has type errors.
ignoreBuildErrors: true,
},
-}
-
-
-
-module.exports = nextConfig
+};
+export default nextConfig;
diff --git a/prisma/seed.mjs b/prisma/seed.mjs
index 7a13a760..f39babd6 100644
--- a/prisma/seed.mjs
+++ b/prisma/seed.mjs
@@ -1,212 +1,228 @@
-import { PrismaClient, Appointment_Type } from '@prisma/client'
-import bcrypt from 'bcrypt';
+import { PrismaClient, Appointment_Type } from "@prisma/client";
+import bcrypt from "bcrypt";
// Initialise Prisma Client
export const db = new PrismaClient();
-
-async function cleanDatabase(){
- await db.user.deleteMany();
- await db.attendance.deleteMany();
- await db.message.deleteMany();
- await db.supportTicket.deleteMany();
- await db.grade.deleteMany();
- await db.forum.deleteMany();
- await db.courseContent.deleteMany();
- await db.assignment.deleteMany();
- await db.course.deleteMany();
- await db.appointment.deleteMany();
- await db.account.deleteMany();
- await db.session.deleteMany();
+async function cleanDatabase() {
+ await db.user.deleteMany();
+ await db.attendance.deleteMany();
+ await db.message.deleteMany();
+ await db.supportTicket.deleteMany();
+ await db.grade.deleteMany();
+ await db.forum.deleteMany();
+ await db.courseContent.deleteMany();
+ await db.assignment.deleteMany();
+ await db.course.deleteMany();
+ await db.appointment.deleteMany();
+ await db.account.deleteMany();
+ await db.session.deleteMany();
}
async function seedData() {
- const passwordHash = await bcrypt.hash('123456', 10);
+ const passwordHash = await bcrypt.hash("123456", 10);
// First create a tutor
const tutor1 = await db.user.create({
- data: {
- email: 'tutor@medefine.com',
- type: 'TUTORS',
- password: passwordHash,
- name: 'Dr. Smith',
- dateOfBirth: '1980-01-01',
- address: '789 Education Road',
- phoneNumber: '5555555555',
- prefferedMeansOfContact: 'email',
- location: 'Berlin, Germany',
- timezone: 'Germany/Europe'
-
- }
+ data: {
+ email: "tutor@medefine.com",
+ type: "TUTORS",
+ password: passwordHash,
+ name: "Dr. Smith",
+ dateOfBirth: "1980-01-01",
+ address: "789 Education Road",
+ phoneNumber: "5555555555",
+ prefferedMeansOfContact: "email",
+ location: "Berlin, Germany",
+ timezone: "Germany/Europe",
+ },
});
// Then create students (and another tutor)
const tutor2 = await db.user.create({
- data: {
- email: 'petermontigue6@gmail.com',
- type: 'TUTORS',
- name: 'Peter Montigue',
- enabled: true,
- dateOfBirth: '1972-05-07',
- phoneNumber: '0987654321',
- password: passwordHash,
- location: 'London, UK',
- timezone: 'London/Europe'
- }
+ data: {
+ email: "petermontigue6@gmail.com",
+ type: "TUTORS",
+ name: "Peter Montigue",
+ enabled: true,
+ dateOfBirth: "1972-05-07",
+ phoneNumber: "0987654321",
+ password: passwordHash,
+ location: "London, UK",
+ timezone: "London/Europe",
+ },
});
const student1 = await db.user.create({
- data: {
- email: 'student1@medefine.com',
- type: 'STUDENTS',
- name: 'John Doe',
- enabled: true,
- dateOfBirth: '1995-01-01',
- address: '123 Medical Street',
- phoneNumber: '1234567890',
- prefferedMeansOfContact: 'email',
- school: 'Medical School',
- yearOfGraduation: new Date('2025-06-01'),
- location: 'New York, USA',
- timezone: 'USA',
- tutorId: tutor2.id,
- year: 9,
- password: passwordHash
- }
+ data: {
+ email: "student1@medefine.com",
+ type: "STUDENTS",
+ name: "John Doe",
+ enabled: true,
+ dateOfBirth: "1995-01-01",
+ address: "123 Medical Street",
+ phoneNumber: "1234567890",
+ prefferedMeansOfContact: "email",
+ school: "Medical School",
+ yearOfGraduation: new Date("2025-06-01"),
+ location: "New York, USA",
+ timezone: "USA",
+ tutorId: tutor2.id,
+ year: 9,
+ password: passwordHash,
+ },
});
const student2 = await db.user.create({
- data: {
- email: 'student2@medefine.com',
- type: 'STUDENTS',
- password: passwordHash,
- name: 'Jane Smith',
- enabled: true,
- dateOfBirth: '1996-02-02',
- address: '456 Health Avenue',
- phoneNumber: '0987654321',
- prefferedMeansOfContact: 'phone',
- school: 'Medical School',
- yearOfGraduation: new Date('2025-06-01'),
- location: 'London, UK',
- timezone: 'London/Europe',
- tutorId: tutor1.id,
- year: 10
- },})
-
+ data: {
+ email: "student2@medefine.com",
+ type: "STUDENTS",
+ password: passwordHash,
+ name: "Jane Smith",
+ enabled: true,
+ dateOfBirth: "1996-02-02",
+ address: "456 Health Avenue",
+ phoneNumber: "0987654321",
+ prefferedMeansOfContact: "phone",
+ school: "Medical School",
+ yearOfGraduation: new Date("2025-06-01"),
+ location: "London, UK",
+ timezone: "London/Europe",
+ tutorId: tutor1.id,
+ year: 10,
+ },
+ });
+
const student3 = await db.user.create({
- data: {
- email: 'henrystevenson506@gmail.com',
- type: 'STUDENTS',
- name: 'Henry Stevenson',
- enabled: true,
- dateOfBirth: '2008-06-14',
- phoneNumber: '0987654321',
- prefferedMeansOfContact: 'phone',
- school: 'Medical School',
- yearOfGraduation: new Date('2025-06-01'),
- tutorId: tutor2.id,
- year: 11,
- password: passwordHash,
- location: 'London, UK',
- timezone: 'London/Europe'
- }
+ data: {
+ email: "henrystevenson506@gmail.com",
+ type: "STUDENTS",
+ name: "Henry Stevenson",
+ enabled: true,
+ dateOfBirth: "2008-06-14",
+ phoneNumber: "0987654321",
+ prefferedMeansOfContact: "phone",
+ school: "Medical School",
+ yearOfGraduation: new Date("2025-06-01"),
+ tutorId: tutor2.id,
+ year: 11,
+ password: passwordHash,
+ location: "London, UK",
+ timezone: "London/Europe",
+ },
});
-
- const admin1 = await db.user.create({
- data: {
- email: 'admin@medefine.com',
- password: passwordHash,
- type: 'ADMIN',
- name: 'Admin',
- enabled: true,
- dateOfBirth: '1972-05-07',
- phoneNumber: '0987654321',
- },})
+ const admin1 = await db.user.create({
+ data: {
+ email: "admin@medefine.com",
+ password: passwordHash,
+ type: "ADMIN",
+ name: "Admin",
+ enabled: true,
+ dateOfBirth: "1972-05-07",
+ phoneNumber: "0987654321",
+ },
+ });
-
// Create courses and internships
await db.course.createMany({
- data: [
- {
- title: 'Fundamentals of Medical Terminology',
- description: 'Learn the basic terminology used in medicine and healthcare. This course covers root words, prefixes, suffixes, and common medical terms.',
- imageUrl: 'https://images.unsplash.com/photo-1486312338219-ce68d2c6f44d',
- headerImage: 'https://plus.unsplash.com/premium_photo-1661432427982-844655e5fa8a?q=80&w=3132&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
- year: 1,
- courseCode: 'MED101',
- duration: '12 weeks',
- type: 'course',
- tags: ['Year 10']
- },
- {
- title: 'Introduction to Human Anatomy',
- description: 'A comprehensive introduction to human anatomy, covering all major body systems and their functions.',
- imageUrl: 'https://plus.unsplash.com/premium_photo-1672759455907-bdaef741cd88?q=80&w=3216&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
- headerImage: 'https://plus.unsplash.com/premium_photo-1661698939645-8c8690757830?q=80&w=3270&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
- year: 1,
- courseCode: 'MED102',
- duration: '16 weeks',
- type: 'course',
- tags: ['Year 9']
- },
- {
- title: 'Pathophysiology for Health Professionals',
- description: 'Study of disease processes and their effects on human body systems.',
- imageUrl: 'https://plus.unsplash.com/premium_photo-1676325101835-f2e4214eff5b?q=80&w=3271&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
- headerImage: 'https://plus.unsplash.com/premium_photo-1723867439555-d6f2be9675d5?q=80&w=3270&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
- year: 2,
- courseCode: 'MED201',
- duration: '14 weeks',
- type: 'course',
- tags: ['Year 11']
- },
- // Internships
- {
- title: 'Clinical Research Internship',
- description: 'Gain hands-on experience in clinical research at a leading medical center. Work on ongoing research projects and learn about research methodologies.',
- imageUrl: 'https://plus.unsplash.com/premium_photo-1661432427982-844655e5fa8a?q=80&w=3132&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
- headerImage: 'https://plus.unsplash.com/premium_photo-1661432427982-844655e5fa8a?q=80&w=3132&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
- year: 2,
- courseCode: 'INT201',
- duration: '12 weeks',
- type: 'internship',
- tags: ['Year 12']
- },
- {
- title: 'Hospital Administration Internship',
- description: 'Learn about healthcare management and hospital operations. Work with administrators on various projects and gain insights into healthcare systems.',
- imageUrl: 'https://plus.unsplash.com/premium_photo-1661698939645-8c8690757830?q=80&w=3270&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
- headerImage: 'https://plus.unsplash.com/premium_photo-1661698939645-8c8690757830?q=80&w=3270&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
- year: 3,
- courseCode: 'INT301',
- duration: '16 weeks',
- type: 'internship',
- tags: ['Year 9', 'Year 10', 'Year 11', 'Year 12']
- },
- {
- title: 'Medical Technology Internship',
- description: 'Work with cutting-edge medical technology and learn about its implementation in healthcare settings. Gain practical experience with medical devices and software.',
- imageUrl: 'https://plus.unsplash.com/premium_photo-1672759455907-bdaef741cd88?q=80&w=3216&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
- headerImage: 'https://plus.unsplash.com/premium_photo-1672759455907-bdaef741cd88?q=80&w=3216&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
- year: 3,
- courseCode: 'INT302',
- duration: '14 weeks',
- type: 'internship',
- tags: ['Year 11']
- }
- ]
+ data: [
+ {
+ title: "Fundamentals of Medical Terminology",
+ description:
+ "Learn the basic terminology used in medicine and healthcare. This course covers root words, prefixes, suffixes, and common medical terms.",
+ imageUrl:
+ "https://images.unsplash.com/photo-1486312338219-ce68d2c6f44d",
+ headerImage:
+ "https://plus.unsplash.com/premium_photo-1661432427982-844655e5fa8a?q=80&w=3132&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
+ year: 1,
+ courseCode: "MED101",
+ duration: "12 weeks",
+ type: "course",
+ tags: ["Year 10"],
+ },
+ {
+ title: "Introduction to Human Anatomy",
+ description:
+ "A comprehensive introduction to human anatomy, covering all major body systems and their functions.",
+ imageUrl:
+ "https://plus.unsplash.com/premium_photo-1672759455907-bdaef741cd88?q=80&w=3216&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
+ headerImage:
+ "https://plus.unsplash.com/premium_photo-1661698939645-8c8690757830?q=80&w=3270&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
+ year: 1,
+ courseCode: "MED102",
+ duration: "16 weeks",
+ type: "course",
+ tags: ["Year 9"],
+ },
+ {
+ title: "Pathophysiology for Health Professionals",
+ description:
+ "Study of disease processes and their effects on human body systems.",
+ imageUrl:
+ "https://plus.unsplash.com/premium_photo-1676325101835-f2e4214eff5b?q=80&w=3271&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
+ headerImage:
+ "https://plus.unsplash.com/premium_photo-1723867439555-d6f2be9675d5?q=80&w=3270&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
+ year: 2,
+ courseCode: "MED201",
+ duration: "14 weeks",
+ type: "course",
+ tags: ["Year 11"],
+ },
+ // Internships
+ {
+ title: "Clinical Research Internship",
+ description:
+ "Gain hands-on experience in clinical research at a leading medical center. Work on ongoing research projects and learn about research methodologies.",
+ imageUrl:
+ "https://plus.unsplash.com/premium_photo-1661432427982-844655e5fa8a?q=80&w=3132&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
+ headerImage:
+ "https://plus.unsplash.com/premium_photo-1661432427982-844655e5fa8a?q=80&w=3132&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
+ year: 2,
+ courseCode: "INT201",
+ duration: "12 weeks",
+ type: "internship",
+ tags: ["Year 12"],
+ },
+ {
+ title: "Hospital Administration Internship",
+ description:
+ "Learn about healthcare management and hospital operations. Work with administrators on various projects and gain insights into healthcare systems.",
+ imageUrl:
+ "https://plus.unsplash.com/premium_photo-1661698939645-8c8690757830?q=80&w=3270&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
+ headerImage:
+ "https://plus.unsplash.com/premium_photo-1661698939645-8c8690757830?q=80&w=3270&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
+ year: 3,
+ courseCode: "INT301",
+ duration: "16 weeks",
+ type: "internship",
+ tags: ["Year 9", "Year 10", "Year 11", "Year 12"],
+ },
+ {
+ title: "Medical Technology Internship",
+ description:
+ "Work with cutting-edge medical technology and learn about its implementation in healthcare settings. Gain practical experience with medical devices and software.",
+ imageUrl:
+ "https://plus.unsplash.com/premium_photo-1672759455907-bdaef741cd88?q=80&w=3216&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
+ headerImage:
+ "https://plus.unsplash.com/premium_photo-1672759455907-bdaef741cd88?q=80&w=3216&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
+ year: 3,
+ courseCode: "INT302",
+ duration: "14 weeks",
+ type: "internship",
+ tags: ["Year 11"],
+ },
+ ],
});
- //==========================FORUM-TIM=============================
-
- // create posts data
- await db.forum.createMany({
- data: [
- {
- title: 'Understanding Medical Terminology Basics',
- details: 'A comprehensive guide to medical terminology fundamentals.',
- body: `
+ //==========================FORUM-TIM=============================
+
+ // create posts data
+ await db.forum.createMany({
+ data: [
+ {
+ title: "Understanding Medical Terminology Basics",
+ details: "A comprehensive guide to medical terminology fundamentals.",
+ body: `
Welcome to Medical Terminology 101!
Today we'll cover the essential basics that every medical student needs to know. Here's what we'll discuss:
@@ -217,42 +233,42 @@ async function seedData() {
Key Points to Remember:
Medical terminology follows a specific pattern that, once understood, makes learning new terms much easier.
`,
- createTime: new Date('2024-01-15T10:30:00Z'),
- updateTime: new Date('2024-01-16T15:45:00Z'),
- userId: tutor1.id,
- courseId: 1,
- courseCode: 'MED101',
- username: tutor1.name,
- courseContentId: 6,
- avatar: '/assets/images/users/avatar-1.png',
- pro: tutor1.type === 'TUTORS',
- img: 'blog-1',
- likeCount: 55,
- replyCount: 45,
- isAnnouncement: false
- },
- {
- title: 'Quick Question about Lab Equipment',
- details: 'Need help identifying this tool.',
- body: `Hi everyone! I came across this tool in the lab today and I'm not sure what it's called or used for. Can anyone help?
`,
- createTime: new Date('2024-01-16T09:15:00Z'),
- updateTime: new Date('2024-01-16T09:15:00Z'),
- userId: student1.id,
- courseId: 1,
- courseCode: 'MED101',
- username: student1.name,
- courseContentId: 6,
- avatar: '/assets/images/users/avatar-2.png',
- pro: student1.type === 'TUTORS',
- img: 'blog-2',
- likeCount: 52,
- replyCount: 40,
- isAnnouncement: false
- },
- {
- title: 'Pathophysiology Case Study: Diabetes Mellitus',
- details: 'Detailed analysis of a Type 2 Diabetes case.',
- body: `
+ createTime: new Date("2024-01-15T10:30:00Z"),
+ updateTime: new Date("2024-01-16T15:45:00Z"),
+ userId: tutor1.id,
+ courseId: 1,
+ courseCode: "MED101",
+ username: tutor1.name,
+ courseContentId: 6,
+ avatar: "/assets/images/users/avatar-1.png",
+ pro: tutor1.type === "TUTORS",
+ img: "blog-1",
+ likeCount: 55,
+ replyCount: 45,
+ isAnnouncement: false,
+ },
+ {
+ title: "Quick Question about Lab Equipment",
+ details: "Need help identifying this tool.",
+ body: `Hi everyone! I came across this tool in the lab today and I'm not sure what it's called or used for. Can anyone help?
`,
+ createTime: new Date("2024-01-16T09:15:00Z"),
+ updateTime: new Date("2024-01-16T09:15:00Z"),
+ userId: student1.id,
+ courseId: 1,
+ courseCode: "MED101",
+ username: student1.name,
+ courseContentId: 6,
+ avatar: "/assets/images/users/avatar-2.png",
+ pro: student1.type === "TUTORS",
+ img: "blog-2",
+ likeCount: 52,
+ replyCount: 40,
+ isAnnouncement: false,
+ },
+ {
+ title: "Pathophysiology Case Study: Diabetes Mellitus",
+ details: "Detailed analysis of a Type 2 Diabetes case.",
+ body: `
Case Presentation
Patient Profile:
@@ -276,24 +292,24 @@ async function seedData() {
- What lifestyle modifications would you recommend?
`,
- createTime: new Date('2024-01-17T14:20:00Z'),
- updateTime: new Date('2024-01-17T16:30:00Z'),
- userId: tutor2.id,
- courseId: 1,
- courseCode: 'MED101',
- username: tutor2.name,
- courseContentId: 6,
- avatar: '/assets/images/users/avatar-3.png',
- pro: tutor2.type === 'TUTORS',
- img: 'blog-3',
- likeCount: 57,
- replyCount: 43,
- isAnnouncement: false
- },
- {
- title: 'Clinical Research Experience',
- details: 'Sharing my summer research project insights.',
- body: `
+ createTime: new Date("2024-01-17T14:20:00Z"),
+ updateTime: new Date("2024-01-17T16:30:00Z"),
+ userId: tutor2.id,
+ courseId: 1,
+ courseCode: "MED101",
+ username: tutor2.name,
+ courseContentId: 6,
+ avatar: "/assets/images/users/avatar-3.png",
+ pro: tutor2.type === "TUTORS",
+ img: "blog-3",
+ likeCount: 57,
+ replyCount: 43,
+ isAnnouncement: false,
+ },
+ {
+ title: "Clinical Research Experience",
+ details: "Sharing my summer research project insights.",
+ body: `
I wanted to share my experience from the summer research program. Here are the key takeaways:
Research Focus:
We studied the effects of mindfulness meditation on stress levels in medical students.
@@ -305,42 +321,43 @@ async function seedData() {
Results were quite interesting!
`,
- createTime: new Date('2024-01-18T11:45:00Z'),
- updateTime: new Date('2024-01-18T11:45:00Z'),
- userId: student2.id,
- courseId: 1,
- courseCode: 'MED101',
- username: student2.name,
- courseContentId: 6,
- avatar: '/assets/images/users/avatar-4.png',
- pro: student2.type === 'TUTORS',
- img: 'blog-4',
- likeCount: 50,
- replyCount: 41,
- isAnnouncement: false
- },
- {
- title: 'Quick Question about Medical Imaging',
- details: 'Need clarification on MRI sequences.',
- body: `Could someone explain the difference between T1 and T2 weighted images? I'm a bit confused about when to use each one.
`,
- createTime: new Date('2024-01-19T16:20:00Z'),
- updateTime: new Date('2024-01-19T16:20:00Z'),
- userId: student3.id,
- courseId: 1,
- courseCode: 'MED101',
- username: student3.name,
- courseContentId: 6,
- avatar: '/assets/images/users/avatar-5.png',
- pro: student3.type === 'TUTORS',
- img: 'blog-5',
- likeCount: 56,
- replyCount: 45,
- isAnnouncement: false
- },
- {
- title: '[Important] Changes to Course Schedule',
- details: 'Updates regarding next week\'s lectures and practical sessions.',
- body: `
+ createTime: new Date("2024-01-18T11:45:00Z"),
+ updateTime: new Date("2024-01-18T11:45:00Z"),
+ userId: student2.id,
+ courseId: 1,
+ courseCode: "MED101",
+ username: student2.name,
+ courseContentId: 6,
+ avatar: "/assets/images/users/avatar-4.png",
+ pro: student2.type === "TUTORS",
+ img: "blog-4",
+ likeCount: 50,
+ replyCount: 41,
+ isAnnouncement: false,
+ },
+ {
+ title: "Quick Question about Medical Imaging",
+ details: "Need clarification on MRI sequences.",
+ body: `Could someone explain the difference between T1 and T2 weighted images? I'm a bit confused about when to use each one.
`,
+ createTime: new Date("2024-01-19T16:20:00Z"),
+ updateTime: new Date("2024-01-19T16:20:00Z"),
+ userId: student3.id,
+ courseId: 1,
+ courseCode: "MED101",
+ username: student3.name,
+ courseContentId: 6,
+ avatar: "/assets/images/users/avatar-5.png",
+ pro: student3.type === "TUTORS",
+ img: "blog-5",
+ likeCount: 56,
+ replyCount: 45,
+ isAnnouncement: false,
+ },
+ {
+ title: "[Important] Changes to Course Schedule",
+ details:
+ "Updates regarding next week's lectures and practical sessions.",
+ body: `
Important Announcement for All Students
Due to the upcoming medical conference, there will be some changes to our regular schedule:
@@ -352,24 +369,25 @@ async function seedData() {
Please confirm your attendance for the online lecture through the course portal by Friday.
Note: All lecture materials will be available on the platform 24 hours before the session.
`,
- createTime: new Date('2024-01-20T09:00:00Z'),
- updateTime: new Date('2024-01-20T09:00:00Z'),
- userId: tutor1.id,
- courseId: 1,
- courseCode: 'MED101',
- username: tutor1.name,
- courseContentId: 7,
- avatar: '/assets/images/users/avatar-1.png',
- pro: tutor1.type === 'TUTORS',
- img: 'blog-6',
- likeCount: 75,
- replyCount: 32,
- isAnnouncement: true
- },
- {
- title: '[Announcement] End of Term Assessment Details',
- details: 'Important information about final examinations and submissions.',
- body: `
+ createTime: new Date("2024-01-20T09:00:00Z"),
+ updateTime: new Date("2024-01-20T09:00:00Z"),
+ userId: tutor1.id,
+ courseId: 1,
+ courseCode: "MED101",
+ username: tutor1.name,
+ courseContentId: 7,
+ avatar: "/assets/images/users/avatar-1.png",
+ pro: tutor1.type === "TUTORS",
+ img: "blog-6",
+ likeCount: 75,
+ replyCount: 32,
+ isAnnouncement: true,
+ },
+ {
+ title: "[Announcement] End of Term Assessment Details",
+ details:
+ "Important information about final examinations and submissions.",
+ body: `
End of Term Assessment Information
Please review the following important details about your final assessments:
Final Examination:
@@ -386,570 +404,578 @@ async function seedData() {
All submissions must be made through the course portal. Late submissions will require proper documentation.
`,
- createTime: new Date('2024-01-21T11:30:00Z'),
- updateTime: new Date('2024-01-21T11:30:00Z'),
- userId: tutor2.id,
- courseId: 1,
- courseCode: 'MED101',
- username: tutor2.name,
- courseContentId: 7,
- avatar: '/assets/images/users/avatar-3.png',
- pro: tutor2.type === 'TUTORS',
- img: 'blog-7',
- likeCount: 82,
- replyCount: 28,
- isAnnouncement: true
- }
- ]
- });
+ createTime: new Date("2024-01-21T11:30:00Z"),
+ updateTime: new Date("2024-01-21T11:30:00Z"),
+ userId: tutor2.id,
+ courseId: 1,
+ courseCode: "MED101",
+ username: tutor2.name,
+ courseContentId: 7,
+ avatar: "/assets/images/users/avatar-3.png",
+ pro: tutor2.type === "TUTORS",
+ img: "blog-7",
+ likeCount: 82,
+ replyCount: 28,
+ isAnnouncement: true,
+ },
+ ],
+ });
- //==============================================================
+ //==============================================================
// Get the created courses for reference
const allCourses = await db.course.findMany();
// Create course content for each course
for (const course of allCourses) {
- // Create sections
- const section1 = await db.courseContent.create({
- data: {
- title: 'Introduction',
- description: 'Course overview and basic concepts',
- type: 'SECTION',
- order: 1,
- courseId: course.id
- }
- });
+ // Create sections
+ const section1 = await db.courseContent.create({
+ data: {
+ title: "Introduction",
+ description: "Course overview and basic concepts",
+ type: "SECTION",
+ order: 1,
+ courseId: course.id,
+ },
+ });
- const section2 = await db.courseContent.create({
- data: {
- title: 'Core Concepts',
- description: 'Main topics and fundamental principles',
- type: 'SECTION',
- order: 2,
- courseId: course.id
- }
- });
+ const section2 = await db.courseContent.create({
+ data: {
+ title: "Core Concepts",
+ description: "Main topics and fundamental principles",
+ type: "SECTION",
+ order: 2,
+ courseId: course.id,
+ },
+ });
- // Create content items under sections
- await db.courseContent.createMany({
- data: [
- {
- title: 'Welcome Video',
- description: 'Introduction to the course',
- type: 'VIDEO',
- url: 'https://example.com/video1',
- order: 1,
- courseId: course.id,
- parentId: section1.id
- },
- {
- title: 'Course Materials',
- description: 'Required reading materials',
- type: 'PDF',
- url: 'https://example.com/materials.pdf',
- order: 2,
- courseId: course.id,
- parentId: section1.id
- },
- {
- title: 'Lecture Notes',
- description: 'Week 1 lecture notes',
- type: 'TEXT',
- content: 'Detailed notes from the first lecture...',
- order: 1,
- courseId: course.id,
- parentId: section2.id
- },
- {
- title: 'Lecture Notes',
- description: 'Discussions for all participants',
- type: 'FORUM',
- content: 'Discussions for all participants',
- order: 2,
- courseId: course.id,
- parentId: section2.id
- }
- ]
- });
+ // Create content items under sections
+ await db.courseContent.createMany({
+ data: [
+ {
+ title: "Welcome Video",
+ description: "Introduction to the course",
+ type: "VIDEO",
+ url: "https://example.com/video1",
+ order: 1,
+ courseId: course.id,
+ parentId: section1.id,
+ },
+ {
+ title: "Course Materials",
+ description: "Required reading materials",
+ type: "PDF",
+ url: "https://example.com/materials.pdf",
+ order: 2,
+ courseId: course.id,
+ parentId: section1.id,
+ },
+ {
+ title: "Lecture Notes",
+ description: "Week 1 lecture notes",
+ type: "TEXT",
+ content: "Detailed notes from the first lecture...",
+ order: 1,
+ courseId: course.id,
+ parentId: section2.id,
+ },
+ {
+ title: "Lecture Notes",
+ description: "Discussions for all participants",
+ type: "FORUM",
+ content: "Discussions for all participants",
+ order: 2,
+ courseId: course.id,
+ parentId: section2.id,
+ },
+ ],
+ });
- // Create assignments
- await db.assignment.createMany({
- data: [
- {
- title: 'Week 1 Quiz',
- description: 'Basic concepts assessment',
- dueDate: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000), // 1 week from now
- courseId: course.id
- },
- {
- title: 'Midterm Assignment',
- description: 'Comprehensive midterm assessment',
- dueDate: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000), // 30 days from now
- courseId: course.id
- }
- ]
- });
+ // Create assignments
+ await db.assignment.createMany({
+ data: [
+ {
+ title: "Week 1 Quiz",
+ description: "Basic concepts assessment",
+ dueDate: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000), // 1 week from now
+ courseId: course.id,
+ },
+ {
+ title: "Midterm Assignment",
+ description: "Comprehensive midterm assessment",
+ dueDate: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000), // 30 days from now
+ courseId: course.id,
+ },
+ ],
+ });
- // Get assignments for the course
- const courseAssignments = await db.assignment.findMany({
- where: { courseId: course.id }
- });
+ // Get assignments for the course
+ const courseAssignments = await db.assignment.findMany({
+ where: { courseId: course.id },
+ });
- // Create sample grades for each assignment
- for (const assignment of courseAssignments) {
- await db.grade.createMany({
- data: [
- {
- score: 85.5,
- feedback: 'Good work! Shows understanding of core concepts.',
- courseId: course.id,
- assignmentId: assignment.id,
- userId: student1.id // Reference to first test user
- },
- {
- score: 92.0,
- feedback: 'Excellent analysis and presentation.',
- courseId: course.id,
- assignmentId: assignment.id,
- userId: student2.id // Reference to second test user
- },
- {
- score: 65.0,
- feedback: 'Excellent analysis and presentation.',
- courseId: course.id,
- assignmentId: assignment.id,
- userId: student3.id // Reference to second test user
- }
- ]
- });
- }
+ // Create sample grades for each assignment
+ for (const assignment of courseAssignments) {
+ await db.grade.createMany({
+ data: [
+ {
+ score: 85.5,
+ feedback: "Good work! Shows understanding of core concepts.",
+ courseId: course.id,
+ assignmentId: assignment.id,
+ userId: student1.id, // Reference to first test user
+ },
+ {
+ score: 92.0,
+ feedback: "Excellent analysis and presentation.",
+ courseId: course.id,
+ assignmentId: assignment.id,
+ userId: student2.id, // Reference to second test user
+ },
+ {
+ score: 65.0,
+ feedback: "Excellent analysis and presentation.",
+ courseId: course.id,
+ assignmentId: assignment.id,
+ userId: student3.id, // Reference to second test user
+ },
+ ],
+ });
+ }
}
// Create tutor notes after users and courses are created
await seedTutorNotes(tutor1, tutor2, student1, student2, student3);
-
+
// Create more diverse appointments for different users
const additionalAppointments = await Promise.all([
// March Module Appointments
db.appointment.create({
data: {
- datetime: new Date('2025-03-15T09:00:00Z'),
+ datetime: new Date("2025-03-15T09:00:00Z"),
type: Appointment_Type.MODULE,
- name: 'Introduction to Medical Terminology',
+ name: "Introduction to Medical Terminology",
attendance: {
create: [
{
userId: student1.id,
- Attended: true
+ Attended: true,
},
{
userId: tutor2.id,
- Attended: true
- }
- ]
- }
- }
+ Attended: true,
+ },
+ ],
+ },
+ },
}),
db.appointment.create({
data: {
- datetime: new Date('2025-03-22T09:00:00Z'),
+ datetime: new Date("2025-03-22T09:00:00Z"),
type: Appointment_Type.MODULE,
- name: 'Human Anatomy Basics',
+ name: "Human Anatomy Basics",
attendance: {
create: [
{
userId: student2.id,
- Attended: false
+ Attended: false,
},
{
userId: tutor2.id,
- Attended: false
- }
- ]
- }
- }
+ Attended: false,
+ },
+ ],
+ },
+ },
}),
// March Tutor Appointments
db.appointment.create({
data: {
- datetime: new Date('2025-03-15T14:00:00Z'),
+ datetime: new Date("2025-03-15T14:00:00Z"),
type: Appointment_Type.TUTOR,
name: student2.name,
attendance: {
create: [
{
userId: tutor2.id,
- Attended: true
+ Attended: true,
},
{
userId: student2.id,
- Attended: true
- }
- ]
- }
- }
+ Attended: true,
+ },
+ ],
+ },
+ },
}),
db.appointment.create({
data: {
- datetime: new Date('2025-03-22T14:00:00Z'),
+ datetime: new Date("2025-03-22T14:00:00Z"),
type: Appointment_Type.TUTOR,
name: student1.name,
attendance: {
create: [
{
userId: tutor2.id,
- Attended: false
+ Attended: false,
},
{
userId: student1.id,
- Attended: false
- }
- ]
- }
- }
+ Attended: false,
+ },
+ ],
+ },
+ },
}),
// April Module Appointments
db.appointment.create({
data: {
- datetime: new Date('2025-04-05T10:00:00Z'),
+ datetime: new Date("2025-04-05T10:00:00Z"),
type: Appointment_Type.MODULE,
- name: 'Pathophysiology Fundamentals',
+ name: "Pathophysiology Fundamentals",
attendance: {
create: [
{
userId: student3.id,
- Attended: false
+ Attended: false,
},
{
userId: tutor2.id,
- Attended: false
- }
- ]
- }
- }
+ Attended: false,
+ },
+ ],
+ },
+ },
}),
db.appointment.create({
data: {
- datetime: new Date('2025-04-12T10:00:00Z'),
+ datetime: new Date("2025-04-12T10:00:00Z"),
type: Appointment_Type.MODULE,
- name: 'Medical Ethics Workshop',
+ name: "Medical Ethics Workshop",
attendance: {
create: [
{
userId: student2.id,
- Attended: false
+ Attended: false,
},
{
userId: tutor2.id,
- Attended: false
- }
- ]
- }
- }
+ Attended: false,
+ },
+ ],
+ },
+ },
}),
// April Tutor Appointments
db.appointment.create({
data: {
- datetime: new Date('2025-04-05T15:00:00Z'),
+ datetime: new Date("2025-04-05T15:00:00Z"),
type: Appointment_Type.TUTOR,
name: student3.name,
attendance: {
create: [
{
userId: tutor2.id,
- Attended: false
+ Attended: false,
},
{
userId: student3.id,
- Attended: false
- }
- ]
- }
- }
+ Attended: false,
+ },
+ ],
+ },
+ },
}),
db.appointment.create({
data: {
- datetime: new Date('2025-04-12T15:00:00Z'),
+ datetime: new Date("2025-04-12T15:00:00Z"),
type: Appointment_Type.TUTOR,
name: student1.name,
attendance: {
create: [
{
userId: tutor2.id,
- Attended: false
+ Attended: false,
},
{
userId: student1.id,
- Attended: false
- }
- ]
- }
- }
+ Attended: false,
+ },
+ ],
+ },
+ },
}),
// May Module Appointments
db.appointment.create({
data: {
- datetime: new Date('2025-05-03T11:00:00Z'),
+ datetime: new Date("2025-05-03T11:00:00Z"),
type: Appointment_Type.MODULE,
- name: 'Clinical Skills Workshop',
+ name: "Clinical Skills Workshop",
attendance: {
create: [
{
userId: student1.id,
- Attended: false
+ Attended: false,
},
{
userId: tutor2.id,
- Attended: false
- }
- ]
- }
- }
+ Attended: false,
+ },
+ ],
+ },
+ },
}),
db.appointment.create({
data: {
- datetime: new Date('2025-05-10T11:00:00Z'),
+ datetime: new Date("2025-05-10T11:00:00Z"),
type: Appointment_Type.MODULE,
- name: 'Patient Communication Skills',
+ name: "Patient Communication Skills",
attendance: {
create: [
{
userId: student2.id,
- Attended: false
+ Attended: false,
},
{
userId: tutor2.id,
- Attended: false
- }
- ]
- }
- }
+ Attended: false,
+ },
+ ],
+ },
+ },
}),
// May Tutor Appointments
db.appointment.create({
data: {
- datetime: new Date('2025-05-03T16:00:00Z'),
+ datetime: new Date("2025-05-03T16:00:00Z"),
type: Appointment_Type.TUTOR,
name: student3.name,
attendance: {
create: [
{
userId: tutor2.id,
- Attended: false
+ Attended: false,
},
{
userId: student3.id,
- Attended: false
- }
- ]
- }
- }
+ Attended: false,
+ },
+ ],
+ },
+ },
}),
db.appointment.create({
data: {
- datetime: new Date('2025-05-10T16:00:00Z'),
+ datetime: new Date("2025-05-10T16:00:00Z"),
type: Appointment_Type.TUTOR,
name: student1.name,
attendance: {
create: [
{
userId: tutor2.id,
- Attended: false
+ Attended: false,
},
{
userId: student1.id,
- Attended: false
- }
- ]
- }
- }
+ Attended: false,
+ },
+ ],
+ },
+ },
}),
// June Module Appointments
db.appointment.create({
data: {
- datetime: new Date('2025-06-07T12:00:00Z'),
+ datetime: new Date("2025-06-07T12:00:00Z"),
type: Appointment_Type.MODULE,
- name: 'Research Methods in Medicine',
+ name: "Research Methods in Medicine",
attendance: {
create: [
{
userId: student2.id,
- Attended: false
+ Attended: false,
},
{
userId: tutor2.id,
- Attended: false
- }
- ]
- }
- }
+ Attended: false,
+ },
+ ],
+ },
+ },
}),
db.appointment.create({
data: {
- datetime: new Date('2025-06-14T12:00:00Z'),
+ datetime: new Date("2025-06-14T12:00:00Z"),
type: Appointment_Type.MODULE,
- name: 'Healthcare Systems Overview',
+ name: "Healthcare Systems Overview",
attendance: {
create: [
{
userId: student3.id,
- Attended: false
+ Attended: false,
},
{
userId: tutor2.id,
- Attended: false
- }
- ]
- }
- }
+ Attended: false,
+ },
+ ],
+ },
+ },
}),
// June Tutor Appointments
db.appointment.create({
data: {
- datetime: new Date('2025-06-07T17:00:00Z'),
+ datetime: new Date("2025-06-07T17:00:00Z"),
type: Appointment_Type.TUTOR,
name: student1.name,
attendance: {
create: [
{
userId: tutor2.id,
- Attended: false
+ Attended: false,
},
{
userId: student1.id,
- Attended: false
- }
- ]
- }
- }
+ Attended: false,
+ },
+ ],
+ },
+ },
}),
db.appointment.create({
data: {
- datetime: new Date('2025-06-14T17:00:00Z'),
+ datetime: new Date("2025-06-14T17:00:00Z"),
type: Appointment_Type.TUTOR,
name: student2.name,
attendance: {
create: [
{
userId: tutor2.id,
- Attended: false
+ Attended: false,
},
{
userId: student2.id,
- Attended: false
- }
- ]
- }
- }
- })
+ Attended: false,
+ },
+ ],
+ },
+ },
+ }),
]);
-
- console.log('Database has been seeded! 🌱');
+
+ console.log("Database has been seeded! 🌱");
}
// Add this new function to seed tutor notes
async function seedTutorNotes(tutor1, tutor2, student1, student2, student3) {
- console.log('Seeding tutor notes...');
-
+ console.log("Seeding tutor notes...");
+
// Add tutor notes for student1
await db.tutorNote.createMany({
- data: [
- {
- title: 'Good progress in Anatomy',
- content: 'John has shown significant improvement in understanding anatomical concepts. His latest assignment demonstrated a thorough understanding of musculoskeletal systems.',
- userId: student1.id,
- authorId: tutor2.id,
- createdAt: new Date('2024-04-10T10:30:00'),
- updatedAt: new Date('2024-04-10T10:30:00')
- },
- {
- title: 'Missed tutorial session',
- content: 'John missed our scheduled tutorial session on Tuesday. I have sent a follow-up email to reschedule and check if everything is alright.',
- userId: student1.id,
- authorId: tutor2.id,
- createdAt: new Date('2024-03-15T14:45:00'),
- updatedAt: new Date('2024-03-15T14:45:00')
- },
- {
- title: 'Needs help with medical terminology',
- content: 'During our last session, I noticed John struggling with some advanced medical terminology. Recommended additional practice resources.',
- userId: student1.id,
- authorId: tutor1.id,
- createdAt: new Date('2024-02-28T09:15:00'),
- updatedAt: new Date('2024-02-28T09:15:00')
- }
- ]
+ data: [
+ {
+ title: "Good progress in Anatomy",
+ content:
+ "John has shown significant improvement in understanding anatomical concepts. His latest assignment demonstrated a thorough understanding of musculoskeletal systems.",
+ userId: student1.id,
+ authorId: tutor2.id,
+ createdAt: new Date("2024-04-10T10:30:00"),
+ updatedAt: new Date("2024-04-10T10:30:00"),
+ },
+ {
+ title: "Missed tutorial session",
+ content:
+ "John missed our scheduled tutorial session on Tuesday. I have sent a follow-up email to reschedule and check if everything is alright.",
+ userId: student1.id,
+ authorId: tutor2.id,
+ createdAt: new Date("2024-03-15T14:45:00"),
+ updatedAt: new Date("2024-03-15T14:45:00"),
+ },
+ {
+ title: "Needs help with medical terminology",
+ content:
+ "During our last session, I noticed John struggling with some advanced medical terminology. Recommended additional practice resources.",
+ userId: student1.id,
+ authorId: tutor1.id,
+ createdAt: new Date("2024-02-28T09:15:00"),
+ updatedAt: new Date("2024-02-28T09:15:00"),
+ },
+ ],
});
-
+
// Add tutor notes for student2
await db.tutorNote.createMany({
- data: [
- {
- title: 'Excellent research presentation',
- content: 'Jane delivered an outstanding presentation on her research project. Demonstrated strong analytical skills and clear communication of complex concepts.',
- userId: student2.id,
- authorId: tutor2.id,
- createdAt: new Date('2024-04-05T11:20:00'),
- updatedAt: new Date('2024-04-05T11:20:00')
- },
- {
- title: 'Concerns about workload',
- content: 'Jane expressed concerns about managing her course workload this semester. We discussed time management strategies and prioritization techniques.',
- userId: student2.id,
- authorId: tutor1.id,
- createdAt: new Date('2024-03-22T16:30:00'),
- updatedAt: new Date('2024-03-22T16:30:00')
- }
- ]
+ data: [
+ {
+ title: "Excellent research presentation",
+ content:
+ "Jane delivered an outstanding presentation on her research project. Demonstrated strong analytical skills and clear communication of complex concepts.",
+ userId: student2.id,
+ authorId: tutor2.id,
+ createdAt: new Date("2024-04-05T11:20:00"),
+ updatedAt: new Date("2024-04-05T11:20:00"),
+ },
+ {
+ title: "Concerns about workload",
+ content:
+ "Jane expressed concerns about managing her course workload this semester. We discussed time management strategies and prioritization techniques.",
+ userId: student2.id,
+ authorId: tutor1.id,
+ createdAt: new Date("2024-03-22T16:30:00"),
+ updatedAt: new Date("2024-03-22T16:30:00"),
+ },
+ ],
});
-
+
// Add tutor notes for student3
await db.tutorNote.createMany({
- data: [
- {
- title: 'Addressing attendance issues',
- content: 'Henry has missed several classes in the past month. We had a discussion about the importance of regular attendance and its impact on academic performance.',
- userId: student3.id,
- authorId: tutor2.id,
- createdAt: new Date('2024-04-12T09:45:00'),
- updatedAt: new Date('2024-04-12T09:45:00')
- },
- {
- title: 'Great improvement in clinical skills',
- content: "I've observed significant improvement in Henry's clinical assessment skills. Particularly impressed with his patient communication approach.",
- userId: student3.id,
- authorId: tutor2.id,
- createdAt: new Date('2024-03-28T13:15:00'),
- updatedAt: new Date('2024-03-28T13:15:00')
- },
- {
- title: 'Study group recommendation',
- content: 'Suggested Henry join the Tuesday study group for additional support with biochemistry concepts. Connected him with the group leader.',
- userId: student3.id,
- authorId: tutor1.id,
- createdAt: new Date('2024-02-15T10:30:00'),
- updatedAt: new Date('2024-02-15T10:30:00')
- }
- ]
+ data: [
+ {
+ title: "Addressing attendance issues",
+ content:
+ "Henry has missed several classes in the past month. We had a discussion about the importance of regular attendance and its impact on academic performance.",
+ userId: student3.id,
+ authorId: tutor2.id,
+ createdAt: new Date("2024-04-12T09:45:00"),
+ updatedAt: new Date("2024-04-12T09:45:00"),
+ },
+ {
+ title: "Great improvement in clinical skills",
+ content:
+ "I've observed significant improvement in Henry's clinical assessment skills. Particularly impressed with his patient communication approach.",
+ userId: student3.id,
+ authorId: tutor2.id,
+ createdAt: new Date("2024-03-28T13:15:00"),
+ updatedAt: new Date("2024-03-28T13:15:00"),
+ },
+ {
+ title: "Study group recommendation",
+ content:
+ "Suggested Henry join the Tuesday study group for additional support with biochemistry concepts. Connected him with the group leader.",
+ userId: student3.id,
+ authorId: tutor1.id,
+ createdAt: new Date("2024-02-15T10:30:00"),
+ updatedAt: new Date("2024-02-15T10:30:00"),
+ },
+ ],
});
-
- console.log('Tutor notes seeded successfully');
+
+ console.log("Tutor notes seeded successfully");
}
async function main() {
- await cleanDatabase();
- await seedData();
+ await cleanDatabase();
+ await seedData();
}
main()
- .catch((e) => {
- console.error(e);
- process.exit(1);
- })
- .finally(async () => {
- await db.$disconnect();
- });
+ .catch((e) => {
+ console.error(e);
+ process.exit(1);
+ })
+ .finally(async () => {
+ await db.$disconnect();
+ });
diff --git a/seedCourses.js b/seedCourses.js
index 51e7e258..09cf5086 100644
--- a/seedCourses.js
+++ b/seedCourses.js
@@ -1,4 +1,4 @@
-import { PrismaClient } from '@prisma/client';
+import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
@@ -8,35 +8,35 @@ async function main() {
data: [
{
title: "Fundamentals of Medical Terminology",
- description:
- "MED 2025",
- imageUrl: "https://images.unsplash.com/photo-1486312338219-ce68d2c6f44d?q=80&w=2972&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
+ description: "MED 2025",
+ imageUrl:
+ "https://images.unsplash.com/photo-1486312338219-ce68d2c6f44d?q=80&w=2972&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
},
{
title: "Introduction to Human Anatomy",
- description:
- "MED 2025",
- imageUrl: "https://plus.unsplash.com/premium_photo-1661761151437-a5f7fbe5753b?q=80&w=2970&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
+ description: "MED 2025",
+ imageUrl:
+ "https://plus.unsplash.com/premium_photo-1661761151437-a5f7fbe5753b?q=80&w=2970&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
},
{
title: "Pathophysiology for Health Professionals",
- description:
- "MED 2025",
- imageUrl: "https://plus.unsplash.com/premium_photo-1661745711599-7f3f3544b579?q=80&w=2970&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
+ description: "MED 2025",
+ imageUrl:
+ "https://plus.unsplash.com/premium_photo-1661745711599-7f3f3544b579?q=80&w=2970&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
},
{
title: "Medical Ethics and Law",
- description:
- "MED 2025",
- imageUrl: "https://images.unsplash.com/photo-1511174511562-5f7f18b874f8?q=80&w=2970&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
+ description: "MED 2025",
+ imageUrl:
+ "https://images.unsplash.com/photo-1511174511562-5f7f18b874f8?q=80&w=2970&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
},
{
title: "Public Health and Epidemiology",
- description:
- "MED 2025",
- imageUrl: "https://images.unsplash.com/photo-1532187863486-abf9dbad1b69?q=80&w=2970&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
- }
- ]
+ description: "MED 2025",
+ imageUrl:
+ "https://images.unsplash.com/photo-1532187863486-abf9dbad1b69?q=80&w=2970&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
+ },
+ ],
});
}
@@ -48,6 +48,3 @@ main()
.finally(async () => {
await prisma.$disconnect();
});
-
-
-
\ No newline at end of file
diff --git a/src/actions/index.ts b/src/actions/index.ts
index 43555976..061bc822 100644
--- a/src/actions/index.ts
+++ b/src/actions/index.ts
@@ -1,17 +1,17 @@
-'use server';
+"use server";
-// imports all the named exports from the @/auth module and groups them under the namespace
+// imports all the named exports from the @/auth module and groups them under the namespace
//auth
-import * as auth from 'app/auth';
+import * as auth from "app/auth";
-export async function githubSignIn(){
- return auth.signIn('github');
+export async function githubSignIn() {
+ return auth.signIn("github");
}
-export async function googleSignIn(){
- return auth.signIn('google');
+export async function googleSignIn() {
+ return auth.signIn("google");
}
-export async function signOut(){
- return auth.signOut();
-}
\ No newline at end of file
+export async function signOut() {
+ return auth.signOut();
+}
diff --git a/src/api/menu.ts b/src/api/menu.ts
index 61edef93..eefe3aa0 100644
--- a/src/api/menu.ts
+++ b/src/api/menu.ts
@@ -1,30 +1,34 @@
-import useSWR, { mutate } from 'swr';
-import { useMemo } from 'react';
+import useSWR, { mutate } from "swr";
+import { useMemo } from "react";
// project imports
-import { fetcher } from 'utils/axios';
+import { fetcher } from "utils/axios";
// types
-import { MenuProps } from 'types/menu';
-import { NavItemType } from 'types';
+import { MenuProps } from "types/menu";
+import { NavItemType } from "types";
const initialState: MenuProps = {
- openedItem: 'dashboard',
- isDashboardDrawerOpened: false
+ openedItem: "dashboard",
+ isDashboardDrawerOpened: false,
};
const endpoints = {
- key: 'api/menu',
- master: 'master',
- widget: '/widget' // server URL
+ key: "api/menu",
+ master: "master",
+ widget: "/widget", // server URL
};
export function useGetMenu() {
- const { data, isLoading, error, isValidating } = useSWR(endpoints.key + endpoints.widget, fetcher, {
- revalidateIfStale: false,
- revalidateOnFocus: false,
- revalidateOnReconnect: false
- });
+ const { data, isLoading, error, isValidating } = useSWR(
+ endpoints.key + endpoints.widget,
+ fetcher,
+ {
+ revalidateIfStale: false,
+ revalidateOnFocus: false,
+ revalidateOnReconnect: false,
+ },
+ );
const memoizedValue = useMemo(
() => ({
@@ -32,27 +36,31 @@ export function useGetMenu() {
menuLoading: isLoading,
menuError: error,
menuValidating: isValidating,
- menuEmpty: !isLoading && !data?.length
+ menuEmpty: !isLoading && !data?.length,
}),
- [data, error, isLoading, isValidating]
+ [data, error, isLoading, isValidating],
);
return memoizedValue;
}
export function useGetMenuMaster() {
- const { data, isLoading } = useSWR(endpoints.key + endpoints.master, () => initialState, {
- revalidateIfStale: false,
- revalidateOnFocus: false,
- revalidateOnReconnect: false
- });
+ const { data, isLoading } = useSWR(
+ endpoints.key + endpoints.master,
+ () => initialState,
+ {
+ revalidateIfStale: false,
+ revalidateOnFocus: false,
+ revalidateOnReconnect: false,
+ },
+ );
const memoizedValue = useMemo(
() => ({
menuMaster: data as MenuProps,
- menuMasterLoading: isLoading
+ menuMasterLoading: isLoading,
}),
- [data, isLoading]
+ [data, isLoading],
);
return memoizedValue;
@@ -62,9 +70,11 @@ export function handlerDrawerOpen(isDashboardDrawerOpened: boolean) {
mutate(
endpoints.key + endpoints.master,
(currentMenuMaster) => {
- return currentMenuMaster ? { ...currentMenuMaster, isDashboardDrawerOpened } : initialState;
+ return currentMenuMaster
+ ? { ...currentMenuMaster, isDashboardDrawerOpened }
+ : initialState;
},
- false
+ false,
);
}
@@ -72,8 +82,10 @@ export function handlerActiveItem(openedItem: string) {
mutate(
endpoints.key + endpoints.master,
(currentMenuMaster) => {
- return currentMenuMaster ? { ...currentMenuMaster, openedItem } : initialState;
+ return currentMenuMaster
+ ? { ...currentMenuMaster, openedItem }
+ : initialState;
},
- false
+ false,
);
}
diff --git a/src/app/(application)/calendar/calendar/CalendarStyled.tsx b/src/app/(application)/calendar/calendar/CalendarStyled.tsx
index 1e474313..8726d88d 100644
--- a/src/app/(application)/calendar/calendar/CalendarStyled.tsx
+++ b/src/app/(application)/calendar/calendar/CalendarStyled.tsx
@@ -1,107 +1,129 @@
-'use client';
+"use client";
// material-ui
-import { styled } from '@mui/material/styles';
-import { blue } from '@mui/material/colors';
+import { styled } from "@mui/material/styles";
+import { blue } from "@mui/material/colors";
// project imports
-import { ThemeMode } from 'config';
+import { ThemeMode } from "config";
-const ExperimentalStyled = styled('div')(({ theme }) => ({
+const ExperimentalStyled = styled("div")(({ theme }) => ({
// hide license message
- '& .fc-license-message': {
- display: 'none'
+ "& .fc-license-message": {
+ display: "none",
},
// basic style
- '& .fc': {
- '--fc-bg-event-opacity': 1,
- '--fc-border-color': theme.palette.divider,
- '--fc-daygrid-event-dot-width': '10px',
- '--fc-today-bg-color': theme.palette.mode === ThemeMode.DARK
- ? theme.palette.dark[800]
- : blue[50],
- '--fc-list-event-dot-width': '10px',
- '--fc-event-border-color': theme.palette.primary.dark,
- '--fc-now-indicator-color': theme.palette.error.main,
+ "& .fc": {
+ "--fc-bg-event-opacity": 1,
+ "--fc-border-color": theme.palette.divider,
+ "--fc-daygrid-event-dot-width": "10px",
+ "--fc-today-bg-color":
+ theme.palette.mode === ThemeMode.DARK
+ ? theme.palette.dark[800]
+ : blue[50],
+ "--fc-list-event-dot-width": "10px",
+ "--fc-event-border-color": theme.palette.primary.dark,
+ "--fc-now-indicator-color": theme.palette.error.main,
color: theme.palette.text.primary,
- fontFamily: theme.typography.fontFamily
+ fontFamily: theme.typography.fontFamily,
},
// date text
- '& .fc .fc-daygrid-day-top': {
- display: 'grid',
- '& .fc-daygrid-day-number': {
- textAlign: 'center',
+ "& .fc .fc-daygrid-day-top": {
+ display: "grid",
+ "& .fc-daygrid-day-number": {
+ textAlign: "center",
marginTop: 12,
- marginBottom: 12
- }
+ marginBottom: 12,
+ },
},
// weekday
- '& .fc .fc-col-header-cell': {
- backgroundColor: theme.palette.mode === ThemeMode.DARK ? theme.palette.dark.main : theme.palette.grey[50]
+ "& .fc .fc-col-header-cell": {
+ backgroundColor:
+ theme.palette.mode === ThemeMode.DARK
+ ? theme.palette.dark.main
+ : theme.palette.grey[50],
},
- '& .fc .fc-col-header-cell-cushion': {
+ "& .fc .fc-col-header-cell-cushion": {
color: theme.palette.grey[900],
- padding: 16
+ padding: 16,
},
- '& .fc-theme-standard .fc-list': {
- overflowX: 'auto'
+ "& .fc-theme-standard .fc-list": {
+ overflowX: "auto",
},
// events
- '& .fc-direction-ltr .fc-daygrid-event.fc-event-end, .fc-direction-rtl .fc-daygrid-event.fc-event-start': {
- marginLeft: 4,
- marginBottom: 6,
- borderRadius: '6px'
- },
-
- '& .fc-direction-ltr .fc-daygrid-event.fc-event-start, .fc-direction-rtl .fc-daygrid-event.fc-event-end': {
- marginLeft: 4,
- marginBottom: 6,
- borderRadius: '6px'
- },
-
- '& .fc-h-event .fc-event-main': {
+ "& .fc-direction-ltr .fc-daygrid-event.fc-event-end, .fc-direction-rtl .fc-daygrid-event.fc-event-start":
+ {
+ marginLeft: 4,
+ marginBottom: 6,
+ borderRadius: "6px",
+ },
+
+ "& .fc-direction-ltr .fc-daygrid-event.fc-event-start, .fc-direction-rtl .fc-daygrid-event.fc-event-end":
+ {
+ marginLeft: 4,
+ marginBottom: 6,
+ borderRadius: "6px",
+ },
+
+ "& .fc-h-event .fc-event-main": {
padding: 4,
- paddingLeft: 8
+ paddingLeft: 8,
},
// popover when multiple events
- '& .fc .fc-more-popover': {
- border: 'none',
- borderRadius: '14px'
+ "& .fc .fc-more-popover": {
+ border: "none",
+ borderRadius: "14px",
},
- '& .fc .fc-more-popover .fc-popover-body': {
- backgroundColor: theme.palette.mode === ThemeMode.DARK ? theme.palette.dark[800] : theme.palette.grey[200],
- borderBottomLeftRadius: '12px',
- borderBottomRightRadius: '12px'
+ "& .fc .fc-more-popover .fc-popover-body": {
+ backgroundColor:
+ theme.palette.mode === ThemeMode.DARK
+ ? theme.palette.dark[800]
+ : theme.palette.grey[200],
+ borderBottomLeftRadius: "12px",
+ borderBottomRightRadius: "12px",
},
- '& .fc .fc-popover-header': {
+ "& .fc .fc-popover-header": {
padding: 12,
- borderTopLeftRadius: '12px',
- borderTopRightRadius: '12px',
- backgroundColor: theme.palette.mode === ThemeMode.DARK ? theme.palette.dark[800] : theme.palette.grey[200],
- color: theme.palette.mode === ThemeMode.DARK ? theme.palette.dark.light : theme.palette.text.primary
+ borderTopLeftRadius: "12px",
+ borderTopRightRadius: "12px",
+ backgroundColor:
+ theme.palette.mode === ThemeMode.DARK
+ ? theme.palette.dark[800]
+ : theme.palette.grey[200],
+ color:
+ theme.palette.mode === ThemeMode.DARK
+ ? theme.palette.dark.light
+ : theme.palette.text.primary,
},
// agenda view
- '& .fc-theme-standard .fc-list-day-cushion': {
- backgroundColor: theme.palette.mode === ThemeMode.DARK ? theme.palette.dark.main : theme.palette.grey[100]
+ "& .fc-theme-standard .fc-list-day-cushion": {
+ backgroundColor:
+ theme.palette.mode === ThemeMode.DARK
+ ? theme.palette.dark.main
+ : theme.palette.grey[100],
},
- '& .fc .fc-list-event:hover td': {
- backgroundColor: theme.palette.mode === ThemeMode.DARK ? theme.palette.dark[800] : theme.palette.grey[100]
+ "& .fc .fc-list-event:hover td": {
+ backgroundColor:
+ theme.palette.mode === ThemeMode.DARK
+ ? theme.palette.dark[800]
+ : theme.palette.grey[100],
},
- '& .fc-timegrid-event-harness-inset .fc-timegrid-event, .fc-timegrid-event.fc-event-mirror, .fc-timegrid-more-link': {
- padding: 8,
- margin: 2
- }
+ "& .fc-timegrid-event-harness-inset .fc-timegrid-event, .fc-timegrid-event.fc-event-mirror, .fc-timegrid-more-link":
+ {
+ padding: 8,
+ margin: 2,
+ },
}));
export default ExperimentalStyled;
diff --git a/src/app/(application)/calendar/calendar/ColorPalette.tsx b/src/app/(application)/calendar/calendar/ColorPalette.tsx
index 6dda8902..9223f367 100644
--- a/src/app/(application)/calendar/calendar/ColorPalette.tsx
+++ b/src/app/(application)/calendar/calendar/ColorPalette.tsx
@@ -1,18 +1,22 @@
// material-ui
-import FormControlLabel from '@mui/material/FormControlLabel';
-import Radio from '@mui/material/Radio';
+import FormControlLabel from "@mui/material/FormControlLabel";
+import Radio from "@mui/material/Radio";
// project imports
-import { ColorPaletteProps } from 'types';
+import { ColorPaletteProps } from "types";
// ==============================|| CALENDAR COLOR PALETTE ||============================== //
-export default function ColorPalette({ color, label, value }: ColorPaletteProps) {
+export default function ColorPalette({
+ color,
+ label,
+ value,
+}: ColorPaletteProps) {
return (
}
- label={label || ''}
+ control={}
+ label={label || ""}
sx={{ pr: label ? 1 : 0 }}
/>
);
diff --git a/src/app/(application)/calendar/calendar/EventModal.tsx b/src/app/(application)/calendar/calendar/EventModal.tsx
index c33f8d46..796357a0 100644
--- a/src/app/(application)/calendar/calendar/EventModal.tsx
+++ b/src/app/(application)/calendar/calendar/EventModal.tsx
@@ -1,6 +1,6 @@
-'use client';
+"use client";
-import React, { useState, useEffect } from 'react';
+import React, { useState, useEffect } from "react";
import {
Dialog,
DialogTitle,
@@ -11,10 +11,10 @@ import {
Stack,
DialogContentText,
Box,
- Checkbox
-} from '@mui/material';
-import { FormikValues } from 'formik';
-import { CalendarEvent } from '../../../types/calendar';
+ Checkbox,
+} from "@mui/material";
+import { FormikValues } from "formik";
+import { CalendarEvent } from "../../../types/calendar";
interface EventModalProps {
open: boolean;
@@ -43,13 +43,15 @@ export default function EventModal({
onBook,
isTutor,
isStudent,
- isParent
+ isParent,
}: EventModalProps) {
const [isLoading, setIsLoading] = useState(false);
const [error, setError] = useState(null);
const [showAttendanceDialog, setShowAttendanceDialog] = useState(false);
const [showCompleteDialog, setShowCompleteDialog] = useState(false);
- const [studentAttendance, setStudentAttendance] = useState([]);
+ const [studentAttendance, setStudentAttendance] = useState<
+ StudentAttendance[]
+ >([]);
// Fetch student attendance when opening the dialog
useEffect(() => {
@@ -60,15 +62,17 @@ export default function EventModal({
const fetchStudentAttendance = async () => {
try {
- const response = await fetch(`/api/calendar/GetAttendance?appointmentId=${event.id}`);
+ const response = await fetch(
+ `/api/calendar/GetAttendance?appointmentId=${event.id}`,
+ );
if (!response.ok) {
- throw new Error('Failed to fetch attendance');
+ throw new Error("Failed to fetch attendance");
}
const data = await response.json();
setStudentAttendance(data.students);
} catch (err) {
- console.error('Error fetching attendance:', err);
- setError('Failed to fetch attendance records');
+ console.error("Error fetching attendance:", err);
+ setError("Failed to fetch attendance records");
}
};
@@ -79,7 +83,9 @@ export default function EventModal({
await onBook(event.id);
handleClose();
} catch (err) {
- setError(err instanceof Error ? err.message : 'Failed to book appointment');
+ setError(
+ err instanceof Error ? err.message : "Failed to book appointment",
+ );
} finally {
setIsLoading(false);
}
@@ -89,26 +95,26 @@ export default function EventModal({
try {
setIsLoading(true);
setError(null);
- const response = await fetch('/api/calendar/CancelBooking', {
- method: 'POST',
+ const response = await fetch("/api/calendar/CancelBooking", {
+ method: "POST",
headers: {
- 'Content-Type': 'application/json',
+ "Content-Type": "application/json",
},
body: JSON.stringify({
- appointmentId: event.id
+ appointmentId: event.id,
}),
});
if (!response.ok) {
const errorData = await response.json();
- throw new Error(errorData.error || 'Failed to cancel booking');
+ throw new Error(errorData.error || "Failed to cancel booking");
}
// Call onUpdate to refresh the event data
- await onUpdate(event.id, { status: 'available' });
+ await onUpdate(event.id, { status: "available" });
handleClose();
} catch (err) {
- setError(err instanceof Error ? err.message : 'Failed to cancel booking');
+ setError(err instanceof Error ? err.message : "Failed to cancel booking");
} finally {
setIsLoading(false);
}
@@ -116,14 +122,14 @@ export default function EventModal({
const handleDelete = async () => {
if (!onDelete) return;
-
+
try {
setIsLoading(true);
setError(null);
await onDelete(event.id);
handleClose();
} catch (err) {
- setError(err instanceof Error ? err.message : 'Failed to delete slot');
+ setError(err instanceof Error ? err.message : "Failed to delete slot");
} finally {
setIsLoading(false);
}
@@ -133,28 +139,30 @@ export default function EventModal({
try {
setIsLoading(true);
setError(null);
- const response = await fetch('/api/calendar/MarkCompleted', {
- method: 'POST',
+ const response = await fetch("/api/calendar/MarkCompleted", {
+ method: "POST",
headers: {
- 'Content-Type': 'application/json',
+ "Content-Type": "application/json",
},
body: JSON.stringify({
- appointmentId: event.id
+ appointmentId: event.id,
}),
});
if (!response.ok) {
- throw new Error('Failed to mark as completed');
+ throw new Error("Failed to mark as completed");
}
// Call onUpdate to refresh the event data
- await onUpdate(event.id, {
- status: 'completed',
- title: `Completed - ${event.bookedBy?.name || 'Student'}`
+ await onUpdate(event.id, {
+ status: "completed",
+ title: `Completed - ${event.bookedBy?.name || "Student"}`,
});
handleClose();
} catch (err) {
- setError(err instanceof Error ? err.message : 'Failed to mark as completed');
+ setError(
+ err instanceof Error ? err.message : "Failed to mark as completed",
+ );
} finally {
setIsLoading(false);
setShowCompleteDialog(false);
@@ -165,71 +173,83 @@ export default function EventModal({
try {
setIsLoading(true);
setError(null);
- const response = await fetch('/api/calendar/MarkAttendance', {
- method: 'POST',
+ const response = await fetch("/api/calendar/MarkAttendance", {
+ method: "POST",
headers: {
- 'Content-Type': 'application/json',
+ "Content-Type": "application/json",
},
body: JSON.stringify({
appointmentId: event.id,
- studentAttendance: studentAttendance.map(student => ({
+ studentAttendance: studentAttendance.map((student) => ({
studentId: student.id,
- attended: student.attended
- }))
+ attended: student.attended,
+ })),
}),
});
if (!response.ok) {
- throw new Error('Failed to mark attendance');
+ throw new Error("Failed to mark attendance");
}
// Call onUpdate to refresh the event data
- await onUpdate(event.id, {
- title: `Attendance marked - ${studentAttendance.filter(s => s.attended).length} attended`
+ await onUpdate(event.id, {
+ title: `Attendance marked - ${studentAttendance.filter((s) => s.attended).length} attended`,
});
handleClose();
} catch (err) {
- setError(err instanceof Error ? err.message : 'Failed to mark attendance');
+ setError(
+ err instanceof Error ? err.message : "Failed to mark attendance",
+ );
} finally {
setIsLoading(false);
setShowAttendanceDialog(false);
}
};
- const handleStudentAttendanceChange = (studentId: string, attended: boolean) => {
- setStudentAttendance(prev =>
- prev.map(student =>
- student.id === studentId
- ? { ...student, attended }
- : student
- )
+ const handleStudentAttendanceChange = (
+ studentId: string,
+ attended: boolean,
+ ) => {
+ setStudentAttendance((prev) =>
+ prev.map((student) =>
+ student.id === studentId ? { ...student, attended } : student,
+ ),
);
};
const isPastEvent = new Date(event.start) < new Date();
- const showCompleteButton = isTutor && event.status === 'booked' && isPastEvent;
- const showCancelButton = isStudent && event.status === 'booked' && !isPastEvent && event.isOwnBooking;
- const showAttendanceButton = isTutor && event.status === 'completed' && isPastEvent;
- const isModuleSession = event.type === 'MODULE';
+ const showCompleteButton =
+ isTutor && event.status === "booked" && isPastEvent;
+ const showCancelButton =
+ isStudent &&
+ event.status === "booked" &&
+ !isPastEvent &&
+ event.isOwnBooking;
+ const showAttendanceButton =
+ isTutor && event.status === "completed" && isPastEvent;
+ const isModuleSession = event.type === "MODULE";
return (
<>
-
);
-}
\ No newline at end of file
+}
diff --git a/src/views/dashboard/admin/BajajAreaChartCard.tsx b/src/views/dashboard/admin/BajajAreaChartCard.tsx
index 82ad953e..a248d6d9 100644
--- a/src/views/dashboard/admin/BajajAreaChartCard.tsx
+++ b/src/views/dashboard/admin/BajajAreaChartCard.tsx
@@ -1,20 +1,20 @@
-'use client';
+"use client";
-import React from 'react';
+import React from "react";
// material-ui
-import { useTheme } from '@mui/material/styles';
-import Card from '@mui/material/Card';
-import Grid from '@mui/material/Grid2';
-import Typography from '@mui/material/Typography';
+import { useTheme } from "@mui/material/styles";
+import Card from "@mui/material/Card";
+import Grid from "@mui/material/Grid2";
+import Typography from "@mui/material/Typography";
// third party
-import ApexCharts from 'apexcharts';
-import Chart from 'react-apexcharts';
+import ApexCharts from "apexcharts";
+import Chart from "react-apexcharts";
// project imports
-import useConfig from 'hooks/useConfig';
-import chartData from './chart-data/bajaj-area-chart';
+import useConfig from "hooks/useConfig";
+import chartData from "./chart-data/bajaj-area-chart";
// ===========================|| DASHBOARD DEFAULT - BAJAJ AREA CHART CARD ||=========================== //
@@ -28,30 +28,33 @@ export default function BajajAreaChartCard() {
const newSupportChart = {
...chartData.options,
colors: [orangeDark],
- tooltip: { theme: mode }
+ tooltip: { theme: mode },
};
- ApexCharts.exec(`support-chart`, 'updateOptions', newSupportChart);
+ ApexCharts.exec(`support-chart`, "updateOptions", newSupportChart);
}, [mode, orangeDark]);
return (
-
-
+
+
-
+
-
+
Bajaj Finery
-
+
$1839.00
-
+
10% Profit
diff --git a/src/views/dashboard/admin/EarningCard.tsx b/src/views/dashboard/admin/EarningCard.tsx
index a4e09785..b61e6bf8 100644
--- a/src/views/dashboard/admin/EarningCard.tsx
+++ b/src/views/dashboard/admin/EarningCard.tsx
@@ -1,23 +1,23 @@
-'use client';
+"use client";
-import React from 'react';
+import React from "react";
// material-ui
-import { useTheme } from '@mui/material/styles';
-import Avatar from '@mui/material/Avatar';
-import Button from '@mui/material/Button';
-import Grid from '@mui/material/Grid2';
-import Typography from '@mui/material/Typography';
-import Box from '@mui/material/Box';
+import { useTheme } from "@mui/material/styles";
+import Avatar from "@mui/material/Avatar";
+import Button from "@mui/material/Button";
+import Grid from "@mui/material/Grid2";
+import Typography from "@mui/material/Typography";
+import Box from "@mui/material/Box";
// project imports
-import { ThemeMode } from 'config';
-import MainCard from 'ui-component/cards/MainCard';
-import SkeletonEarningCard from 'ui-component/cards/Skeleton/EarningCard';
+import { ThemeMode } from "config";
+import MainCard from "ui-component/cards/MainCard";
+import SkeletonEarningCard from "ui-component/cards/Skeleton/EarningCard";
// assets
-import VideoCameraFrontIcon from '@mui/icons-material/VideoCameraFront';
-import ArrowUpwardIcon from '@mui/icons-material/ArrowUpward';
+import VideoCameraFrontIcon from "@mui/icons-material/VideoCameraFront";
+import ArrowUpwardIcon from "@mui/icons-material/ArrowUpward";
// ===========================|| DASHBOARD - TOTAL SESSIONS CARD ||=========================== //
@@ -29,14 +29,17 @@ export default function SessionsCard({ isLoading }: SessionsCardProps) {
const theme = useTheme();
const [timeValue, setTimeValue] = React.useState(false);
- const handleChangeTime = (event: React.MouseEvent, newValue: boolean) => {
+ const handleChangeTime = (
+ event: React.MouseEvent,
+ newValue: boolean,
+ ) => {
setTimeValue(newValue);
};
// Hardcoded data for now
const sessionsData = {
month: 180,
- year: 2160
+ year: 2160,
};
return (
@@ -48,56 +51,62 @@ export default function SessionsCard({ isLoading }: SessionsCardProps) {
border={false}
content={false}
sx={{
- bgcolor: theme.palette.mode === ThemeMode.DARK ? 'dark.dark' : 'secondary.dark',
- color: '#fff',
- overflow: 'hidden',
- position: 'relative',
- '&>div': {
- position: 'relative',
- zIndex: 5
+ bgcolor:
+ theme.palette.mode === ThemeMode.DARK
+ ? "dark.dark"
+ : "secondary.dark",
+ color: "#fff",
+ overflow: "hidden",
+ position: "relative",
+ "&>div": {
+ position: "relative",
+ zIndex: 5,
},
- '&:after': {
+ "&:after": {
content: '""',
- position: 'absolute',
+ position: "absolute",
width: 210,
height: 210,
background:
theme.palette.mode === ThemeMode.DARK
? `linear-gradient(210.04deg, ${theme.palette.secondary.dark} -50.94%, rgba(144, 202, 249, 0) 95.49%)`
: theme.palette.secondary[800],
- borderRadius: '50%',
+ borderRadius: "50%",
top: { xs: -85 },
- right: { xs: -95 }
+ right: { xs: -95 },
},
- '&:before': {
+ "&:before": {
content: '""',
- position: 'absolute',
+ position: "absolute",
width: 210,
height: 210,
background:
theme.palette.mode === ThemeMode.DARK
? `linear-gradient(140.9deg, ${theme.palette.secondary.dark} -14.02%, rgba(144, 202, 249, 0) 85.50%)`
: theme.palette.secondary[800],
- borderRadius: '50%',
+ borderRadius: "50%",
top: { xs: -125 },
right: { xs: -15 },
- opacity: 0.5
- }
+ opacity: 0.5,
+ },
}}
>
-
+
@@ -106,16 +115,16 @@ export default function SessionsCard({ isLoading }: SessionsCardProps) {
handleChangeTime(e, true)}
>
@@ -123,16 +132,16 @@ export default function SessionsCard({ isLoading }: SessionsCardProps) {
handleChangeTime(e, false)}
>
@@ -142,11 +151,19 @@ export default function SessionsCard({ isLoading }: SessionsCardProps) {
-
+
-
+
-
+
{timeValue ? sessionsData.month : sessionsData.year}
@@ -154,9 +171,9 @@ export default function SessionsCard({ isLoading }: SessionsCardProps) {
@@ -165,9 +182,12 @@ export default function SessionsCard({ isLoading }: SessionsCardProps) {
Total Sessions
diff --git a/src/views/dashboard/admin/PopularCard.tsx b/src/views/dashboard/admin/PopularCard.tsx
index 8c86b0ae..479e4c96 100644
--- a/src/views/dashboard/admin/PopularCard.tsx
+++ b/src/views/dashboard/admin/PopularCard.tsx
@@ -1,28 +1,28 @@
-'use client';
+"use client";
-import React from 'react';
+import React from "react";
// material-ui
-import Avatar from '@mui/material/Avatar';
-import Button from '@mui/material/Button';
-import CardActions from '@mui/material/CardActions';
-import CardContent from '@mui/material/CardContent';
-import Divider from '@mui/material/Divider';
-import Grid from '@mui/material/Grid2';
-import IconButton from '@mui/material/IconButton';
-import Menu from '@mui/material/Menu';
-import MenuItem from '@mui/material/MenuItem';
-import Typography from '@mui/material/Typography';
+import Avatar from "@mui/material/Avatar";
+import Button from "@mui/material/Button";
+import CardActions from "@mui/material/CardActions";
+import CardContent from "@mui/material/CardContent";
+import Divider from "@mui/material/Divider";
+import Grid from "@mui/material/Grid2";
+import IconButton from "@mui/material/IconButton";
+import Menu from "@mui/material/Menu";
+import MenuItem from "@mui/material/MenuItem";
+import Typography from "@mui/material/Typography";
// project imports
-import MainCard from 'ui-component/cards/MainCard';
-import SkeletonPopularCard from 'ui-component/cards/Skeleton/PopularCard';
-import { gridSpacing } from 'store/constant';
+import MainCard from "ui-component/cards/MainCard";
+import SkeletonPopularCard from "ui-component/cards/Skeleton/PopularCard";
+import { gridSpacing } from "store/constant";
// assets
-import MoreHorizOutlinedIcon from '@mui/icons-material/MoreHorizOutlined';
-import KeyboardArrowUpOutlinedIcon from '@mui/icons-material/KeyboardArrowUpOutlined';
-import KeyboardArrowDownOutlinedIcon from '@mui/icons-material/KeyboardArrowDownOutlined';
+import MoreHorizOutlinedIcon from "@mui/icons-material/MoreHorizOutlined";
+import KeyboardArrowUpOutlinedIcon from "@mui/icons-material/KeyboardArrowUpOutlined";
+import KeyboardArrowDownOutlinedIcon from "@mui/icons-material/KeyboardArrowDownOutlined";
// ==============================|| DASHBOARD DEFAULT - POPULAR CARD ||============================== //
@@ -31,7 +31,9 @@ interface PopularCardProps {
}
export default function PopularCard({ isLoading }: PopularCardProps) {
- const [anchorEl, setAnchorEl] = React.useState Element) | null | undefined>(null);
+ const [anchorEl, setAnchorEl] = React.useState<
+ Element | (() => Element) | null | undefined
+ >(null);
const handleClick = (event: React.SyntheticEvent) => {
setAnchorEl(event.currentTarget);
@@ -44,30 +46,30 @@ export default function PopularCard({ isLoading }: PopularCardProps) {
// Mock data for popular courses
const popularCourses = [
{
- name: 'MED001 - Anatomy and Physiology',
+ name: "MED001 - Anatomy and Physiology",
students: 250,
- trend: 'up'
+ trend: "up",
},
{
- name: 'MED002 - Medical Ethics',
+ name: "MED002 - Medical Ethics",
students: 180,
- trend: 'up'
+ trend: "up",
},
{
- name: 'MED003 - Clinical Skills',
+ name: "MED003 - Clinical Skills",
students: 150,
- trend: 'down'
+ trend: "down",
},
{
- name: 'MED004 - Patient Care',
+ name: "MED004 - Patient Care",
students: 120,
- trend: 'up'
+ trend: "up",
},
{
- name: 'MED005 - Healthcare Management',
+ name: "MED005 - Healthcare Management",
students: 100,
- trend: 'up'
- }
+ trend: "up",
+ },
];
return (
@@ -75,11 +77,17 @@ export default function PopularCard({ isLoading }: PopularCardProps) {
{isLoading ? (
) : (
-
+
-
+
Popular Courses
@@ -87,7 +95,7 @@ export default function PopularCard({ isLoading }: PopularCardProps) {
@@ -122,8 +130,12 @@ export default function PopularCard({ isLoading }: PopularCardProps) {
-
-
+
+
{course.students} students
- {course.trend === 'up' ? (
-
+ {course.trend === "up" ? (
+
) : (
-
+
)}
- {index < popularCourses.length - 1 && }
+ {index < popularCourses.length - 1 && (
+
+ )}
))}
-
+
View All
diff --git a/src/views/dashboard/admin/StudentDistributionCard.tsx b/src/views/dashboard/admin/StudentDistributionCard.tsx
index 1e1be3ff..d1d24b73 100644
--- a/src/views/dashboard/admin/StudentDistributionCard.tsx
+++ b/src/views/dashboard/admin/StudentDistributionCard.tsx
@@ -1,69 +1,69 @@
-'use client';
+"use client";
-import React from 'react';
-import { Card, CardContent, Typography, Box, Grid } from '@mui/material';
-import { useTheme } from '@mui/material/styles';
-import Chart from 'react-apexcharts';
-import { Props } from 'react-apexcharts';
+import React from "react";
+import { Card, CardContent, Typography, Box, Grid } from "@mui/material";
+import { useTheme } from "@mui/material/styles";
+import Chart from "react-apexcharts";
+import { Props } from "react-apexcharts";
const StudentDistributionCard = () => {
const theme = useTheme();
const studentData = [
- { country: 'UAE', value: 28, color: '#1976d2' }, // blue
- { country: 'Saudi Arabia', value: 18, color: '#9c27b0' }, // purple
- { country: 'Hong Kong', value: 22, color: '#ed6c02' }, // orange
- { country: 'Singapore', value: 12, color: '#2e7d32' }, // green
- { country: 'Malaysia', value: 8, color: '#d32f2f' }, // red
- { country: 'Qatar', value: 12, color: '#0288d1' } // light blue
+ { country: "UAE", value: 28, color: "#1976d2" }, // blue
+ { country: "Saudi Arabia", value: 18, color: "#9c27b0" }, // purple
+ { country: "Hong Kong", value: 22, color: "#ed6c02" }, // orange
+ { country: "Singapore", value: 12, color: "#2e7d32" }, // green
+ { country: "Malaysia", value: 8, color: "#d32f2f" }, // red
+ { country: "Qatar", value: 12, color: "#0288d1" }, // light blue
];
const chartData: Props = {
height: 380,
width: 380,
- type: 'pie',
+ type: "pie",
options: {
chart: {
- background: 'transparent'
+ background: "transparent",
},
- labels: studentData.map(item => item.country),
+ labels: studentData.map((item) => item.country),
legend: {
- show: false
+ show: false,
},
- colors: studentData.map(item => item.color),
+ colors: studentData.map((item) => item.color),
plotOptions: {
pie: {
donut: {
- size: '0%'
- }
- }
+ size: "0%",
+ },
+ },
},
dataLabels: {
enabled: true,
- formatter: function(val: number) {
- return val.toFixed(0) + '%';
+ formatter: function (val: number) {
+ return val.toFixed(0) + "%";
},
style: {
- fontSize: '14px',
+ fontSize: "14px",
fontFamily: theme.typography.fontFamily,
- fontWeight: 500
+ fontWeight: 500,
},
dropShadow: {
- enabled: false
- }
+ enabled: false,
+ },
},
tooltip: {
theme: theme.palette.mode,
y: {
- formatter: (value: number) => `${value}% of students`
- }
- }
+ formatter: (value: number) => `${value}% of students`,
+ },
+ },
},
- series: studentData.map(item => item.value)
+ series: studentData.map((item) => item.value),
};
return (
-
+
Student Distribution
@@ -75,23 +75,23 @@ const StudentDistributionCard = () => {
-
+
{item.country}
@@ -104,12 +104,14 @@ const StudentDistributionCard = () => {
-
+
@@ -119,4 +121,4 @@ const StudentDistributionCard = () => {
);
};
-export default StudentDistributionCard;
\ No newline at end of file
+export default StudentDistributionCard;
diff --git a/src/views/dashboard/admin/StudentGeographyCard.tsx b/src/views/dashboard/admin/StudentGeographyCard.tsx
index aceffa2a..db1a6b76 100644
--- a/src/views/dashboard/admin/StudentGeographyCard.tsx
+++ b/src/views/dashboard/admin/StudentGeographyCard.tsx
@@ -1,46 +1,46 @@
-'use client';
+"use client";
-import React from 'react';
-import { Card, CardContent, Typography, Box } from '@mui/material';
-import { useTheme } from '@mui/material/styles';
-import Chart from 'react-apexcharts';
-import { Props } from 'react-apexcharts';
+import React from "react";
+import { Card, CardContent, Typography, Box } from "@mui/material";
+import { useTheme } from "@mui/material/styles";
+import Chart from "react-apexcharts";
+import { Props } from "react-apexcharts";
const StudentDistributionCard = () => {
const theme = useTheme();
const studentData = [
- { country: 'UAE', value: 25 },
- { country: 'Saudi Arabia', value: 15 },
- { country: 'Hong Kong', value: 20 },
- { country: 'Singapore', value: 10 },
- { country: 'Malaysia', value: 8 },
- { country: 'Qatar', value: 12 }
+ { country: "UAE", value: 25 },
+ { country: "Saudi Arabia", value: 15 },
+ { country: "Hong Kong", value: 20 },
+ { country: "Singapore", value: 10 },
+ { country: "Malaysia", value: 8 },
+ { country: "Qatar", value: 12 },
];
const chartData: Props = {
height: 300,
- type: 'pie',
+ type: "pie",
options: {
chart: {
- background: 'transparent'
+ background: "transparent",
},
- labels: studentData.map(item => item.country),
+ labels: studentData.map((item) => item.country),
legend: {
- position: 'bottom',
+ position: "bottom",
fontFamily: theme.typography.fontFamily,
- fontSize: '14px',
+ fontSize: "14px",
markers: {
size: 12,
strokeWidth: 0,
- shape: 'circle',
+ shape: "circle",
offsetX: 0,
- offsetY: 0
+ offsetY: 0,
},
itemMargin: {
horizontal: 10,
- vertical: 5
- }
+ vertical: 5,
+ },
},
colors: [
theme.palette.primary.dark,
@@ -48,37 +48,37 @@ const StudentDistributionCard = () => {
theme.palette.primary.main,
theme.palette.secondary.main,
theme.palette.primary[700],
- theme.palette.secondary[700]
+ theme.palette.secondary[700],
],
plotOptions: {
pie: {
donut: {
- size: '0%'
- }
- }
+ size: "0%",
+ },
+ },
},
dataLabels: {
enabled: true,
- formatter: function(val: number) {
- return val.toFixed(0) + '%';
+ formatter: function (val: number) {
+ return val.toFixed(0) + "%";
},
style: {
- fontSize: '14px',
+ fontSize: "14px",
fontFamily: theme.typography.fontFamily,
- fontWeight: 500
+ fontWeight: 500,
},
dropShadow: {
- enabled: false
- }
+ enabled: false,
+ },
},
tooltip: {
theme: theme.palette.mode,
y: {
- formatter: (value: number) => `${value}% of students`
- }
- }
+ formatter: (value: number) => `${value}% of students`,
+ },
+ },
},
- series: studentData.map(item => item.value)
+ series: studentData.map((item) => item.value),
};
return (
@@ -87,13 +87,15 @@ const StudentDistributionCard = () => {
Where are your students?
-
+
@@ -101,4 +103,4 @@ const StudentDistributionCard = () => {
);
};
-export default StudentDistributionCard;
\ No newline at end of file
+export default StudentDistributionCard;
diff --git a/src/views/dashboard/admin/TotalGrowthBarChart.tsx b/src/views/dashboard/admin/TotalGrowthBarChart.tsx
index 87049fb1..1d63bf2f 100644
--- a/src/views/dashboard/admin/TotalGrowthBarChart.tsx
+++ b/src/views/dashboard/admin/TotalGrowthBarChart.tsx
@@ -1,37 +1,37 @@
-'use client';
+"use client";
-import React from 'react';
+import React from "react";
// material-ui
-import { alpha, useTheme } from '@mui/material/styles';
-import Grid from '@mui/material/Grid2';
-import MenuItem from '@mui/material/MenuItem';
-import TextField from '@mui/material/TextField';
-import Typography from '@mui/material/Typography';
+import { alpha, useTheme } from "@mui/material/styles";
+import Grid from "@mui/material/Grid2";
+import MenuItem from "@mui/material/MenuItem";
+import TextField from "@mui/material/TextField";
+import Typography from "@mui/material/Typography";
// third party
-import ApexCharts from 'apexcharts';
-import Chart from 'react-apexcharts';
+import ApexCharts from "apexcharts";
+import Chart from "react-apexcharts";
// project imports
-import { ThemeMode } from 'config';
-import useConfig from 'hooks/useConfig';
-import SkeletonTotalGrowthBarChart from 'ui-component/cards/Skeleton/TotalGrowthBarChart';
-import MainCard from 'ui-component/cards/MainCard';
-import { gridSpacing } from 'store/constant';
+import { ThemeMode } from "config";
+import useConfig from "hooks/useConfig";
+import SkeletonTotalGrowthBarChart from "ui-component/cards/Skeleton/TotalGrowthBarChart";
+import MainCard from "ui-component/cards/MainCard";
+import { gridSpacing } from "store/constant";
// chart data
-import chartData from './chart-data/total-growth-bar-chart';
+import chartData from "./chart-data/total-growth-bar-chart";
const status = [
{
- value: 'month',
- label: 'This Month'
+ value: "month",
+ label: "This Month",
},
{
- value: 'year',
- label: 'This Year'
- }
+ value: "year",
+ label: "This Year",
+ },
];
// ==============================|| DASHBOARD DEFAULT - TOTAL GROWTH BAR CHART ||============================== //
@@ -40,8 +40,10 @@ interface TotalGrowthBarChartProps {
isLoading: boolean;
}
-export default function TotalGrowthBarChart({ isLoading }: TotalGrowthBarChartProps) {
- const [value, setValue] = React.useState('today');
+export default function TotalGrowthBarChart({
+ isLoading,
+}: TotalGrowthBarChartProps) {
+ const [value, setValue] = React.useState("today");
const theme = useTheme();
const { mode } = useConfig();
@@ -61,24 +63,35 @@ export default function TotalGrowthBarChart({ isLoading }: TotalGrowthBarChartPr
colors: [primary200, primaryDark, secondaryMain, secondaryLight],
xaxis: {
labels: {
- style: { colors: primary }
- }
+ style: { colors: primary },
+ },
},
yaxis: {
labels: {
- style: { colors: primary }
- }
+ style: { colors: primary },
+ },
},
grid: { borderColor: divider },
tooltip: { theme: mode },
- legend: { labels: { colors: grey500 } }
+ legend: { labels: { colors: grey500 } },
};
// do not load chart when loading
if (!isLoading) {
- ApexCharts.exec(`bar-chart`, 'updateOptions', newChartData);
+ ApexCharts.exec(`bar-chart`, "updateOptions", newChartData);
}
- }, [mode, primary200, primaryDark, secondaryMain, secondaryLight, primary, darkLight, divider, isLoading, grey500]);
+ }, [
+ mode,
+ primary200,
+ primaryDark,
+ secondaryMain,
+ secondaryLight,
+ primary,
+ darkLight,
+ divider,
+ isLoading,
+ grey500,
+ ]);
return (
<>
@@ -88,7 +101,10 @@ export default function TotalGrowthBarChart({ isLoading }: TotalGrowthBarChartPr
-
+
@@ -100,7 +116,12 @@ export default function TotalGrowthBarChart({ isLoading }: TotalGrowthBarChartPr
- setValue(e.target.value)}>
+ setValue(e.target.value)}
+ >
{status.map((option) => (
) : (
@@ -210,9 +228,11 @@ const ContentEditor: React.FC = ({ content, onUpdate, onDele
{content.title}
{content.description && (
- {content.description}
+
+ {content.description}
+
)}
- {content.type === 'TEXT' && content.content && (
+ {content.type === "TEXT" && content.content && (
{content.content}
)}
{content.url && (
@@ -249,69 +269,84 @@ function TabPanel({ children, value, index, ...other }: TabPanelProps) {
aria-labelledby={`internship-tab-${index}`}
{...other}
>
- {value === index && (
-
- {children}
-
- )}
+ {value === index && {children}}
);
}
-export default function InternshipEditor({ internshipId }: InternshipEditorProps) {
+export default function InternshipEditor({
+ internshipId,
+}: InternshipEditorProps) {
const router = useRouter();
const [internship, setInternship] = React.useState(null);
const [tabValue, setTabValue] = React.useState(0);
- const [isNewSectionDialogOpen, setIsNewSectionDialogOpen] = React.useState(false);
- const [isNewContentDialogOpen, setIsNewContentDialogOpen] = React.useState(false);
+ const [isNewSectionDialogOpen, setIsNewSectionDialogOpen] =
+ React.useState(false);
+ const [isNewContentDialogOpen, setIsNewContentDialogOpen] =
+ React.useState(false);
const [isDeleteDialogOpen, setIsDeleteDialogOpen] = React.useState(false);
- const [isNewAssignmentDialogOpen, setIsNewAssignmentDialogOpen] = React.useState(false);
+ const [isNewAssignmentDialogOpen, setIsNewAssignmentDialogOpen] =
+ React.useState(false);
const [isNewGradeDialogOpen, setIsNewGradeDialogOpen] = React.useState(false);
- const [selectedSectionId, setSelectedSectionId] = React.useState(null);
- const [selectedAssignmentId, setSelectedAssignmentId] = React.useState(null);
+ const [selectedSectionId, setSelectedSectionId] = React.useState<
+ number | null
+ >(null);
+ const [selectedAssignmentId, setSelectedAssignmentId] = React.useState<
+ number | null
+ >(null);
const [assignments, setAssignments] = React.useState([]);
const [grades, setGrades] = React.useState([]);
- const [newSectionTitle, setNewSectionTitle] = React.useState('');
- const [newSectionDescription, setNewSectionDescription] = React.useState('');
- const [newContentTitle, setNewContentTitle] = React.useState('');
- const [newContentDescription, setNewContentDescription] = React.useState('');
- const [newContentType, setNewContentType] = React.useState('TEXT');
- const [newContentUrl, setNewContentUrl] = React.useState('');
- const [newContentText, setNewContentText] = React.useState('');
- const [newAssignmentTitle, setNewAssignmentTitle] = React.useState('');
- const [newAssignmentDescription, setNewAssignmentDescription] = React.useState('');
- const [newAssignmentDueDate, setNewAssignmentDueDate] = React.useState(null);
- const [newAssignmentFileUrl, setNewAssignmentFileUrl] = React.useState('');
- const [newAssignmentFileType, setNewAssignmentFileType] = React.useState<'PDF' | 'DOC' | 'DOCX' | 'ZIP' | 'OTHER'>('PDF');
- const [newGradeScore, setNewGradeScore] = React.useState('');
- const [newGradeFeedback, setNewGradeFeedback] = React.useState('');
- const [newGradeUserId, setNewGradeUserId] = React.useState('');
+ const [newSectionTitle, setNewSectionTitle] = React.useState("");
+ const [newSectionDescription, setNewSectionDescription] = React.useState("");
+ const [newContentTitle, setNewContentTitle] = React.useState("");
+ const [newContentDescription, setNewContentDescription] = React.useState("");
+ const [newContentType, setNewContentType] =
+ React.useState("TEXT");
+ const [newContentUrl, setNewContentUrl] = React.useState("");
+ const [newContentText, setNewContentText] = React.useState("");
+ const [newAssignmentTitle, setNewAssignmentTitle] = React.useState("");
+ const [newAssignmentDescription, setNewAssignmentDescription] =
+ React.useState("");
+ const [newAssignmentDueDate, setNewAssignmentDueDate] =
+ React.useState(null);
+ const [newAssignmentFileUrl, setNewAssignmentFileUrl] = React.useState("");
+ const [newAssignmentFileType, setNewAssignmentFileType] = React.useState<
+ "PDF" | "DOC" | "DOCX" | "ZIP" | "OTHER"
+ >("PDF");
+ const [newGradeScore, setNewGradeScore] = React.useState("");
+ const [newGradeFeedback, setNewGradeFeedback] = React.useState("");
+ const [newGradeUserId, setNewGradeUserId] = React.useState("");
// Fetch internship data, assignments, and grades
React.useEffect(() => {
const fetchData = async () => {
try {
- const [internshipResponse, assignmentsResponse, gradesResponse] = await Promise.all([
- fetch(`/api/courses/${internshipId}`),
- fetch(`/api/courses/${internshipId}/assignments`),
- fetch(`/api/courses/${internshipId}/grades`)
- ]);
-
- if (!internshipResponse.ok) throw new Error('Failed to fetch internship');
- if (!assignmentsResponse.ok) throw new Error('Failed to fetch assignments');
- if (!gradesResponse.ok) throw new Error('Failed to fetch grades');
-
- const [internshipData, assignmentsData, gradesData] = await Promise.all([
- internshipResponse.json(),
- assignmentsResponse.json(),
- gradesResponse.json()
- ]);
+ const [internshipResponse, assignmentsResponse, gradesResponse] =
+ await Promise.all([
+ fetch(`/api/courses/${internshipId}`),
+ fetch(`/api/courses/${internshipId}/assignments`),
+ fetch(`/api/courses/${internshipId}/grades`),
+ ]);
+
+ if (!internshipResponse.ok)
+ throw new Error("Failed to fetch internship");
+ if (!assignmentsResponse.ok)
+ throw new Error("Failed to fetch assignments");
+ if (!gradesResponse.ok) throw new Error("Failed to fetch grades");
+
+ const [internshipData, assignmentsData, gradesData] = await Promise.all(
+ [
+ internshipResponse.json(),
+ assignmentsResponse.json(),
+ gradesResponse.json(),
+ ],
+ );
setInternship(internshipData);
setAssignments(assignmentsData);
setGrades(gradesData);
} catch (error) {
- console.error('Failed to fetch data:', error);
+ console.error("Failed to fetch data:", error);
}
};
fetchData();
@@ -322,18 +357,18 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
try {
const response = await fetch(`/api/courses/${internshipId}`, {
- method: 'PUT',
+ method: "PUT",
headers: {
- 'Content-Type': 'application/json',
+ "Content-Type": "application/json",
},
body: JSON.stringify(internship),
});
- if (!response.ok) throw new Error('Failed to update internship');
+ if (!response.ok) throw new Error("Failed to update internship");
router.push(`/internships/${internshipId}`);
} catch (error) {
- console.error('Error updating internship:', error);
+ console.error("Error updating internship:", error);
}
};
@@ -344,18 +379,18 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
id: Date.now(), // Temporary ID
title: newSectionTitle,
description: newSectionDescription || undefined,
- type: 'SECTION',
+ type: "SECTION",
order: internship.sections.length,
- contents: []
+ contents: [],
};
setInternship({
...internship,
- sections: [...internship.sections, newSection]
+ sections: [...internship.sections, newSection],
});
- setNewSectionTitle('');
- setNewSectionDescription('');
+ setNewSectionTitle("");
+ setNewSectionDescription("");
setIsNewSectionDialogOpen(false);
};
@@ -369,24 +404,26 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
type: newContentType,
url: newContentUrl || undefined,
content: newContentText || undefined,
- order: internship.sections.find(s => s.id === selectedSectionId)?.contents.length || 0,
- courseId: parseInt(internshipId)
+ order:
+ internship.sections.find((s) => s.id === selectedSectionId)?.contents
+ .length || 0,
+ courseId: parseInt(internshipId),
};
setInternship({
...internship,
- sections: internship.sections.map(section =>
+ sections: internship.sections.map((section) =>
section.id === selectedSectionId
? { ...section, contents: [...section.contents, newContent] }
- : section
- )
+ : section,
+ ),
});
- setNewContentTitle('');
- setNewContentDescription('');
- setNewContentType('TEXT');
- setNewContentUrl('');
- setNewContentText('');
+ setNewContentTitle("");
+ setNewContentDescription("");
+ setNewContentType("TEXT");
+ setNewContentUrl("");
+ setNewContentText("");
setIsNewContentDialogOpen(false);
};
@@ -395,9 +432,9 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
setInternship({
...internship,
- sections: internship.sections.map(section =>
- section.id === updatedSection.id ? updatedSection : section
- )
+ sections: internship.sections.map((section) =>
+ section.id === updatedSection.id ? updatedSection : section,
+ ),
});
};
@@ -406,25 +443,30 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
setInternship({
...internship,
- sections: internship.sections.filter(section => section.id !== sectionId)
+ sections: internship.sections.filter(
+ (section) => section.id !== sectionId,
+ ),
});
};
- const handleUpdateContent = (sectionId: number, updatedContent: CourseContent) => {
+ const handleUpdateContent = (
+ sectionId: number,
+ updatedContent: CourseContent,
+ ) => {
if (!internship) return;
setInternship({
...internship,
- sections: internship.sections.map(section =>
+ sections: internship.sections.map((section) =>
section.id === sectionId
? {
...section,
- contents: section.contents.map(content =>
- content.id === updatedContent.id ? updatedContent : content
- )
+ contents: section.contents.map((content) =>
+ content.id === updatedContent.id ? updatedContent : content,
+ ),
}
- : section
- )
+ : section,
+ ),
});
};
@@ -433,14 +475,16 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
setInternship({
...internship,
- sections: internship.sections.map(section =>
+ sections: internship.sections.map((section) =>
section.id === sectionId
? {
...section,
- contents: section.contents.filter(content => content.id !== contentId)
+ contents: section.contents.filter(
+ (content) => content.id !== contentId,
+ ),
}
- : section
- )
+ : section,
+ ),
});
};
@@ -451,14 +495,14 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
const handleDeleteConfirm = async () => {
try {
const response = await fetch(`/api/courses/${internshipId}`, {
- method: 'DELETE',
+ method: "DELETE",
});
- if (!response.ok) throw new Error('Failed to delete internship');
+ if (!response.ok) throw new Error("Failed to delete internship");
- router.push('/internships');
+ router.push("/internships");
} catch (error) {
- console.error('Error deleting internship:', error);
+ console.error("Error deleting internship:", error);
}
};
@@ -469,9 +513,9 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
const handleAddAssignment = async () => {
try {
const response = await fetch(`/api/courses/${internshipId}/assignments`, {
- method: 'POST',
+ method: "POST",
headers: {
- 'Content-Type': 'application/json',
+ "Content-Type": "application/json",
},
body: JSON.stringify({
title: newAssignmentTitle,
@@ -479,65 +523,68 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
dueDate: newAssignmentDueDate,
courseId: parseInt(internshipId),
fileUrl: newAssignmentFileUrl || undefined,
- fileType: newAssignmentFileType || undefined
+ fileType: newAssignmentFileType || undefined,
}),
});
- if (!response.ok) throw new Error('Failed to create assignment');
+ if (!response.ok) throw new Error("Failed to create assignment");
const newAssignment = await response.json();
setAssignments([...assignments, newAssignment]);
- setNewAssignmentTitle('');
- setNewAssignmentDescription('');
+ setNewAssignmentTitle("");
+ setNewAssignmentDescription("");
setNewAssignmentDueDate(null);
- setNewAssignmentFileUrl('');
- setNewAssignmentFileType('PDF');
+ setNewAssignmentFileUrl("");
+ setNewAssignmentFileType("PDF");
setIsNewAssignmentDialogOpen(false);
} catch (error) {
- console.error('Error creating assignment:', error);
+ console.error("Error creating assignment:", error);
}
};
const handleDeleteAssignment = async (assignmentId: number) => {
try {
- const response = await fetch(`/api/courses/${internshipId}/assignments/${assignmentId}`, {
- method: 'DELETE',
- });
+ const response = await fetch(
+ `/api/courses/${internshipId}/assignments/${assignmentId}`,
+ {
+ method: "DELETE",
+ },
+ );
- if (!response.ok) throw new Error('Failed to delete assignment');
+ if (!response.ok) throw new Error("Failed to delete assignment");
- setAssignments(assignments.filter(a => a.id !== assignmentId));
+ setAssignments(assignments.filter((a) => a.id !== assignmentId));
} catch (error) {
- console.error('Error deleting assignment:', error);
+ console.error("Error deleting assignment:", error);
}
};
const handleAddGrade = async () => {
try {
const response = await fetch(`/api/courses/${internshipId}/grades`, {
- method: 'POST',
+ method: "POST",
headers: {
- 'Content-Type': 'application/json',
+ "Content-Type": "application/json",
},
body: JSON.stringify({
score: parseFloat(newGradeScore),
feedback: newGradeFeedback || null,
courseId: parseInt(internshipId),
assignmentId: selectedAssignmentId,
- userId: parseInt(newGradeUserId)
+ userId: parseInt(newGradeUserId),
}),
});
- if (!response.ok) throw new Error('Failed to create grade');
+ if (!response.ok) throw new Error("Failed to create grade");
const newGrade = await response.json();
setGrades([...grades, newGrade]);
- setNewGradeScore('');
- setNewGradeFeedback('');
- setNewGradeUserId('');
+ setNewGradeScore("");
+ setNewGradeFeedback("");
+ setNewGradeUserId("");
setIsNewGradeDialogOpen(false);
} catch (error) {
- console.error('Error creating grade:', error);
+ console.error("Error creating grade:", error);
}
};
@@ -545,7 +592,7 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
return (
-
+
Loading internship...
@@ -557,7 +604,12 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
-
+
Edit Internship
setInternship({ ...internship, courseCode: e.target.value })}
+ onChange={(e) =>
+ setInternship({ ...internship, courseCode: e.target.value })
+ }
/>
setInternship({ ...internship, title: e.target.value })}
+ onChange={(e) =>
+ setInternship({ ...internship, title: e.target.value })
+ }
/>
setInternship({ ...internship, description: e.target.value })}
+ value={internship.description || ""}
+ onChange={(e) =>
+ setInternship({ ...internship, description: e.target.value })
+ }
multiline
rows={3}
/>
@@ -601,29 +659,44 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
label="Year"
type="number"
value={internship.year}
- onChange={(e) => setInternship({ ...internship, year: parseInt(e.target.value) })}
+ onChange={(e) =>
+ setInternship({
+ ...internship,
+ year: parseInt(e.target.value),
+ })
+ }
/>
setInternship({ ...internship, duration: e.target.value })}
+ value={internship.duration || ""}
+ onChange={(e) =>
+ setInternship({ ...internship, duration: e.target.value })
+ }
/>
setInternship({ ...internship, imageUrl: e.target.value })}
+ value={internship.imageUrl || ""}
+ onChange={(e) =>
+ setInternship({ ...internship, imageUrl: e.target.value })
+ }
/>
setInternship({ ...internship, headerImage: e.target.value })}
+ value={internship.headerImage || ""}
+ onChange={(e) =>
+ setInternship({ ...internship, headerImage: e.target.value })
+ }
/>
{/* Tabs */}
-
-
+
+
@@ -633,7 +706,12 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
{/* Content Tab */}
-
+
Internship Content
}
@@ -656,8 +734,12 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
handleUpdateContent(section.id, updatedContent)}
- onDelete={() => handleDeleteContent(section.id, content.id)}
+ onUpdate={(updatedContent) =>
+ handleUpdateContent(section.id, updatedContent)
+ }
+ onDelete={() =>
+ handleDeleteContent(section.id, content.id)
+ }
/>
))}
-
+
Assignments
}
@@ -693,10 +780,16 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
{assignments.map((assignment) => (
-
+
{assignment.title}
- {assignment.description}
+
+ {assignment.description}
+
{assignment.dueDate && (
Due: {new Date(assignment.dueDate).toLocaleString()}
@@ -704,7 +797,11 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
)}
{assignment.fileUrl && (
-
+
View File ({assignment.fileType})
@@ -737,7 +834,12 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
{/* Grades Tab */}
-
+
Grades
@@ -771,8 +873,8 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
{/* New Section Dialog */}
- setIsNewSectionDialogOpen(false)}
maxWidth="lg"
fullWidth
@@ -797,7 +899,9 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
- setIsNewSectionDialogOpen(false)}>Cancel
+ setIsNewSectionDialogOpen(false)}>
+ Cancel
+
Add Section
@@ -805,8 +909,8 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
{/* New Content Dialog */}
- setIsNewContentDialogOpen(false)}
maxWidth="lg"
fullWidth
@@ -833,7 +937,9 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
- {newContentType !== 'TEXT' && (
+ {newContentType !== "TEXT" && (
)}
- {newContentType === 'TEXT' && (
+ {newContentType === "TEXT" && (
- setIsNewContentDialogOpen(false)}>Cancel
+ setIsNewContentDialogOpen(false)}>
+ Cancel
+
Add Content
@@ -877,7 +985,8 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
Delete Internship
- Are you sure you want to delete this internship? This action cannot be undone.
+ Are you sure you want to delete this internship? This action
+ cannot be undone.
@@ -920,7 +1029,9 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
setNewAssignmentDueDate(newValue)}
+ onChange={(newValue: Date | null) =>
+ setNewAssignmentDueDate(newValue)
+ }
slotProps={{ textField: { fullWidth: true } }}
/>
@@ -937,7 +1048,16 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
- setIsNewAssignmentDialogOpen(false)}>Cancel
+ setIsNewAssignmentDialogOpen(false)}>
+ Cancel
+
Add Assignment
@@ -992,7 +1114,9 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
- setIsNewGradeDialogOpen(false)}>Cancel
+ setIsNewGradeDialogOpen(false)}>
+ Cancel
+
Add Grade
@@ -1001,4 +1125,4 @@ export default function InternshipEditor({ internshipId }: InternshipEditorProps
);
-}
\ No newline at end of file
+}
diff --git a/src/views/internships/InternshipsPage.tsx b/src/views/internships/InternshipsPage.tsx
index b03862ae..922252c5 100644
--- a/src/views/internships/InternshipsPage.tsx
+++ b/src/views/internships/InternshipsPage.tsx
@@ -1,23 +1,23 @@
-'use client';
+"use client";
-import React from 'react';
+import React from "react";
import {
Grid,
Box,
Button,
Dialog,
IconButton,
- Typography
-} from '@mui/material';
-import AddIcon from '@mui/icons-material/Add';
-import CloseIcon from '@mui/icons-material/Close';
+ Typography,
+} from "@mui/material";
+import AddIcon from "@mui/icons-material/Add";
+import CloseIcon from "@mui/icons-material/Close";
// project imports
-import MainCard from 'ui-component/cards/MainCard';
-import InternshipCard from 'ui-component/cards/InternshipCard';
-import MainLayout from 'layout/MainLayout';
-import CourseEditForm from 'ui-component/cards/CourseEditForm';
-import { CourseProps } from 'types/course';
+import MainCard from "ui-component/cards/MainCard";
+import InternshipCard from "ui-component/cards/InternshipCard";
+import MainLayout from "layout/MainLayout";
+import CourseEditForm from "ui-component/cards/CourseEditForm";
+import { CourseProps } from "types/course";
export default function InternshipsPage() {
const [internships, setInternships] = React.useState([]);
@@ -27,12 +27,12 @@ export default function InternshipsPage() {
React.useEffect(() => {
const fetchInternships = async () => {
try {
- const response = await fetch('/api/courses?type=internship');
- if (!response.ok) throw new Error('Failed to fetch internships');
+ const response = await fetch("/api/courses?type=internship");
+ if (!response.ok) throw new Error("Failed to fetch internships");
const data = await response.json();
setInternships(data);
} catch (error) {
- console.error('Failed to fetch internships:', error);
+ console.error("Failed to fetch internships:", error);
}
};
fetchInternships();
@@ -48,29 +48,29 @@ export default function InternshipsPage() {
const handleAddSubmit = async (internshipData: Partial) => {
try {
- console.log('Page - Submitting internship data:', internshipData); // Debug log
- const response = await fetch('/api/courses', {
- method: 'POST',
+ console.log("Page - Submitting internship data:", internshipData); // Debug log
+ const response = await fetch("/api/courses", {
+ method: "POST",
headers: {
- 'Content-Type': 'application/json'
+ "Content-Type": "application/json",
},
body: JSON.stringify({
...internshipData,
- type: 'internship' // Add type to distinguish from regular courses
+ type: "internship", // Add type to distinguish from regular courses
}),
});
if (!response.ok) {
const error = await response.json();
- throw new Error(error.error || 'Failed to create internship');
+ throw new Error(error.error || "Failed to create internship");
}
const newInternship = await response.json();
- console.log('Page - New internship created:', newInternship); // Debug log
- setInternships(prevInternships => [newInternship, ...prevInternships]);
+ console.log("Page - New internship created:", newInternship); // Debug log
+ setInternships((prevInternships) => [newInternship, ...prevInternships]);
setIsAddDialogOpen(false);
} catch (error) {
- console.error('Error creating internship:', error);
+ console.error("Error creating internship:", error);
throw error;
}
};
@@ -79,12 +79,14 @@ export default function InternshipsPage() {
{/* Header with Title and Add Button */}
-
+
Internships
))}
{internships.length === 0 && (
-
+
No internships available
@@ -125,19 +129,16 @@ export default function InternshipsPage() {
maxWidth="md"
fullWidth
>
-
+
-
+
);
-}
\ No newline at end of file
+}
diff --git a/src/views/pages/account-profile/Profile1/ChangePassword.tsx b/src/views/pages/account-profile/Profile1/ChangePassword.tsx
index 40d6971a..fa91f9e2 100644
--- a/src/views/pages/account-profile/Profile1/ChangePassword.tsx
+++ b/src/views/pages/account-profile/Profile1/ChangePassword.tsx
@@ -1,14 +1,14 @@
// material-ui
-import Alert from '@mui/material/Alert';
-import AlertTitle from '@mui/material/AlertTitle';
-import Button from '@mui/material/Button';
-import Grid from '@mui/material/Grid2';
-import TextField from '@mui/material/TextField';
+import Alert from "@mui/material/Alert";
+import AlertTitle from "@mui/material/AlertTitle";
+import Button from "@mui/material/Button";
+import Grid from "@mui/material/Grid2";
+import TextField from "@mui/material/TextField";
// project imports
-import SubCard from 'ui-component/cards/SubCard';
-import AnimateButton from 'ui-component/extended/AnimateButton';
-import { gridSpacing } from 'store/constant';
+import SubCard from "ui-component/cards/SubCard";
+import AnimateButton from "ui-component/extended/AnimateButton";
+import { gridSpacing } from "store/constant";
// ==============================|| PROFILE 1 - CHANGE PASSWORD ||============================== //
@@ -16,9 +16,14 @@ export default function ChangePassword() {
return (
-
+
Alert!
- Your Password will expire in every 3 months. So change it periodically.
+ Your Password will expire in every 3 months. So change it
+ periodically.
Do not share your password
@@ -27,26 +32,45 @@ export default function ChangePassword() {
-
+
Change Password
- Clear
+ Clear
diff --git a/src/views/pages/account-profile/Profile1/MyAccount.tsx b/src/views/pages/account-profile/Profile1/MyAccount.tsx
index bcf758bc..f320ce1d 100644
--- a/src/views/pages/account-profile/Profile1/MyAccount.tsx
+++ b/src/views/pages/account-profile/Profile1/MyAccount.tsx
@@ -1,109 +1,109 @@
-'use client';
+"use client";
-import { useState } from 'react';
+import { useState } from "react";
// material-ui
-import Button from '@mui/material/Button';
-import Divider from '@mui/material/Divider';
-import Grid from '@mui/material/Grid2';
-import FormControlLabel from '@mui/material/FormControlLabel';
-import IconButton from '@mui/material/IconButton';
-import MenuItem from '@mui/material/MenuItem';
-import Switch from '@mui/material/Switch';
-import TextField from '@mui/material/TextField';
-import Typography from '@mui/material/Typography';
+import Button from "@mui/material/Button";
+import Divider from "@mui/material/Divider";
+import Grid from "@mui/material/Grid2";
+import FormControlLabel from "@mui/material/FormControlLabel";
+import IconButton from "@mui/material/IconButton";
+import MenuItem from "@mui/material/MenuItem";
+import Switch from "@mui/material/Switch";
+import TextField from "@mui/material/TextField";
+import Typography from "@mui/material/Typography";
// project imports
-import SubCard from 'ui-component/cards/SubCard';
-import AnimateButton from 'ui-component/extended/AnimateButton';
+import SubCard from "ui-component/cards/SubCard";
+import AnimateButton from "ui-component/extended/AnimateButton";
-import { gridSpacing } from 'store/constant';
+import { gridSpacing } from "store/constant";
// assets
-import DesktopWindowsTwoToneIcon from '@mui/icons-material/DesktopWindowsTwoTone';
-import HighlightOffTwoToneIcon from '@mui/icons-material/HighlightOffTwoTone';
-import FiberManualRecordIcon from '@mui/icons-material/FiberManualRecord';
-import SmartphoneTwoToneIcon from '@mui/icons-material/SmartphoneTwoTone';
-import PhoneIphoneTwoToneIcon from '@mui/icons-material/PhoneIphoneTwoTone';
+import DesktopWindowsTwoToneIcon from "@mui/icons-material/DesktopWindowsTwoTone";
+import HighlightOffTwoToneIcon from "@mui/icons-material/HighlightOffTwoTone";
+import FiberManualRecordIcon from "@mui/icons-material/FiberManualRecord";
+import SmartphoneTwoToneIcon from "@mui/icons-material/SmartphoneTwoTone";
+import PhoneIphoneTwoToneIcon from "@mui/icons-material/PhoneIphoneTwoTone";
const deviceStateSX = {
- display: 'inline-flex',
- alignItems: 'center',
- '& >svg': {
+ display: "inline-flex",
+ alignItems: "center",
+ "& >svg": {
width: 12,
height: 12,
- mr: 0.5
- }
+ mr: 0.5,
+ },
};
// select options
const currencies = [
{
- value: 'Washington',
- label: 'Washington'
+ value: "Washington",
+ label: "Washington",
},
{
- value: 'India',
- label: 'India'
+ value: "India",
+ label: "India",
},
{
- value: 'Africa',
- label: 'Africa'
+ value: "Africa",
+ label: "Africa",
},
{
- value: 'New-York',
- label: 'New York'
+ value: "New-York",
+ label: "New York",
},
{
- value: 'Malaysia',
- label: 'Malaysia'
- }
+ value: "Malaysia",
+ label: "Malaysia",
+ },
];
const experiences = [
{
- value: 'Startup',
- label: 'Startup'
+ value: "Startup",
+ label: "Startup",
},
{
- value: '2-year',
- label: '2 year'
+ value: "2-year",
+ label: "2 year",
},
{
- value: '3-year',
- label: '3 year'
+ value: "3-year",
+ label: "3 year",
},
{
- value: '4-year',
- label: '4 year'
+ value: "4-year",
+ label: "4 year",
},
{
- value: '5-year',
- label: '5 year'
- }
+ value: "5-year",
+ label: "5 year",
+ },
];
// ==============================|| PROFILE 1 - MY ACCOUNT ||============================== //
export default function MyAccount() {
- const [currency, setCurrency] = useState('Washington');
+ const [currency, setCurrency] = useState("Washington");
const handleChange1 = (event: React.ChangeEvent) => {
setCurrency(event.target.value);
};
- const [experience, setExperience] = useState('Startup');
+ const [experience, setExperience] = useState("Startup");
const handleChange2 = (event: React.ChangeEvent) => {
setExperience(event.target.value);
};
const [state1, setState1] = useState({
- checkedB: false
+ checkedB: false,
});
const [state2, setState2] = useState({
- checkedB: false
+ checkedB: false,
});
const [state3, setState3] = useState({
- checkedB: true
+ checkedB: true,
});
const handleSwitchChange1 = (event: React.ChangeEvent) => {
setState1({ ...state1, [event.target.name]: event.target.checked });
@@ -131,10 +131,22 @@ export default function MyAccount() {
/>
-
+
-
+
{currencies.map((option) => (
{option.label}
@@ -166,29 +178,59 @@ export default function MyAccount() {
-
+
Secure Browsing
}
+ control={
+
+ }
label="Browsing Securely ( https ) when it's necessary"
/>
-
+
Login Notifications
}
+ control={
+
+ }
label="Notify when login attempted from other place"
/>
-
+
Login Approvals
}
+ control={
+
+ }
label="Approvals is not required when login from unrecognized devices."
/>
@@ -196,77 +238,96 @@ export default function MyAccount() {
-
+
Recognized Devices
-
+
-
+
- Cent Desktop{' '}
+ Cent Desktop{" "}
| 4351 Deans Lane, Chelmsford
- {' '}
+ {" "}
-
+
Current Active
-
+
-
+
-
+
- Imho Tablet{' '}
+ Imho Tablet{" "}
| 4185 Michigan Avenue
- {' '}
+ {" "}
-
+
Active 5 days ago
-
+
-
+
-
+
- Albs Mobile{' '}
+ Albs Mobile{" "}
| 3462 Fairfax Drive, Montcalm
- {' '}
+ {" "}
-
+
Active 1 month ago
-
+
@@ -278,45 +339,52 @@ export default function MyAccount() {
-
+
Active Sessions
-
+
-
+
- Ceto Desktop{' '}
+ Ceto Desktop{" "}
| 4351 Deans Lane, Chelmsford
- {' '}
+ {" "}
-
+
Logout
-
+
-
+
- Moon Tablet{' '}
+ Moon Tablet{" "}
| 4185 Michigan Avenue
-
+
Logout
@@ -329,14 +397,14 @@ export default function MyAccount() {
-
+
Update Profile
- Clear
+ Clear
diff --git a/src/views/pages/account-profile/Profile1/PersonalAccount.tsx b/src/views/pages/account-profile/Profile1/PersonalAccount.tsx
index 58947eae..e0b83bca 100644
--- a/src/views/pages/account-profile/Profile1/PersonalAccount.tsx
+++ b/src/views/pages/account-profile/Profile1/PersonalAccount.tsx
@@ -1,69 +1,69 @@
-'use client';
+"use client";
-import { useState } from 'react';
+import { useState } from "react";
// material-ui
-import Button from '@mui/material/Button';
-import Grid from '@mui/material/Grid2';
-import MenuItem from '@mui/material/MenuItem';
-import TextField from '@mui/material/TextField';
+import Button from "@mui/material/Button";
+import Grid from "@mui/material/Grid2";
+import MenuItem from "@mui/material/MenuItem";
+import TextField from "@mui/material/TextField";
// project imports
-import useAuth from 'hooks/useAuth';
-import SubCard from 'ui-component/cards/SubCard';
-import AnimateButton from 'ui-component/extended/AnimateButton';
-import { gridSpacing } from 'store/constant';
+import useAuth from "hooks/useAuth";
+import SubCard from "ui-component/cards/SubCard";
+import AnimateButton from "ui-component/extended/AnimateButton";
+import { gridSpacing } from "store/constant";
// assets
-import FacebookIcon from '@mui/icons-material/Facebook';
-import TwitterIcon from '@mui/icons-material/Twitter';
-import LinkedInIcon from '@mui/icons-material/LinkedIn';
+import FacebookIcon from "@mui/icons-material/Facebook";
+import TwitterIcon from "@mui/icons-material/Twitter";
+import LinkedInIcon from "@mui/icons-material/LinkedIn";
// select options
const currencies = [
{
- value: 'Washington',
- label: 'Washington'
+ value: "Washington",
+ label: "Washington",
},
{
- value: 'India',
- label: 'India'
+ value: "India",
+ label: "India",
},
{
- value: 'Africa',
- label: 'Africa'
+ value: "Africa",
+ label: "Africa",
},
{
- value: 'New-York',
- label: 'New York'
+ value: "New-York",
+ label: "New York",
},
{
- value: 'Malaysia',
- label: 'Malaysia'
- }
+ value: "Malaysia",
+ label: "Malaysia",
+ },
];
const experiences = [
{
- value: 'Startup',
- label: 'Startup'
+ value: "Startup",
+ label: "Startup",
},
{
- value: '2-year',
- label: '2 year'
+ value: "2-year",
+ label: "2 year",
},
{
- value: '3-year',
- label: '3 year'
+ value: "3-year",
+ label: "3 year",
},
{
- value: '4-year',
- label: '4 year'
+ value: "4-year",
+ label: "4 year",
},
{
- value: '5-year',
- label: '5 year'
- }
+ value: "5-year",
+ label: "5 year",
+ },
];
// ==============================|| PROFILE 1 - PROFILE ACCOUNT ||============================== //
@@ -71,12 +71,12 @@ const experiences = [
export default function PersonalAccount() {
const { user } = useAuth();
- const [currency, setCurrency] = useState('Washington');
+ const [currency, setCurrency] = useState("Washington");
const handleChange1 = (event: React.ChangeEvent) => {
setCurrency(event.target.value);
};
- const [experience, setExperience] = useState('Startup');
+ const [experience, setExperience] = useState("Startup");
const handleChange2 = (event: React.ChangeEvent) => {
setExperience(event.target.value);
};
@@ -88,10 +88,22 @@ export default function PersonalAccount() {