diff --git a/docs/docs.go b/docs/docs.go index 8dd2e4fc7bc8fa2189938d27110b0014956e5aa1..e47f7b97973d0f0f5c92966ff99243250a51ad40 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -57,7 +57,7 @@ const docTemplate = `{ "schema": { "type": "array", "items": { - "$ref": "#/definitions/entity.Topik" + "$ref": "#/definitions/entity.TopikSwag" } } } @@ -84,7 +84,7 @@ const docTemplate = `{ "schema": { "type": "array", "items": { - "$ref": "#/definitions/entity.Topik" + "$ref": "#/definitions/entity.TopikSwag" } } } @@ -95,7 +95,7 @@ const docTemplate = `{ "schema": { "type": "array", "items": { - "$ref": "#/definitions/entity.Topik" + "$ref": "#/definitions/entity.TopikSwag" } } } @@ -125,7 +125,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/entity.Topik" + "$ref": "#/definitions/entity.TopikSwag" } } } @@ -156,7 +156,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/entity.Topik" + "$ref": "#/definitions/entity.TopikSwag" } } ], @@ -164,7 +164,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/entity.Topik" + "$ref": "#/definitions/entity.TopikSwag" } } } @@ -194,7 +194,7 @@ const docTemplate = `{ } } }, - "/api/admin/dashboard/dosbing": { + "/api/dosbing/dashboard": { "get": { "description": "Retrieves a list of mahasiswa supervised by a specific dosen for TA.", "consumes": [ @@ -210,15 +210,14 @@ const docTemplate = `{ "parameters": [ { "type": "string", - "description": "Dosen ID", - "name": "id_dosen", - "in": "query", - "required": true + "description": "Search", + "name": "search", + "in": "query" }, { "type": "string", - "description": "Limit", - "name": "limit", + "description": "Size", + "name": "size", "in": "query" }, { @@ -241,7 +240,7 @@ const docTemplate = `{ } } }, - "/api/admin/dashboard/dosbing/statistic": { + "/api/dosbing/dashboard/statistic": { "get": { "description": "Retrieves the amount of mahasiswa supervised by a specific dosen for TA.", "consumes": [ @@ -253,30 +252,18 @@ const docTemplate = `{ "tags": [ "Dashboard Dosbing" ], - "summary": "Get amount of mahasiswa by dosen ID", - "parameters": [ - { - "type": "string", - "description": "Dosen ID", - "name": "id_dosen", - "in": "query", - "required": true - } - ], + "summary": "Get amount of mahasiswa", "responses": { "200": { "description": "List mahasiswa successfully retreived", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.JumlahMahasiswa" - } + "$ref": "#/definitions/entity.JumlahMahasiswaSwag" } } } } }, - "/api/admin/dashboard/dosbing/status-bimbingan": { + "/api/dosbing/dashboard/status-bimbingan": { "get": { "description": "Retrieves the amount of mahasiswa's bimbingan status supervised by a specific dosen for TA.", "consumes": [ @@ -289,23 +276,34 @@ const docTemplate = `{ "Dashboard Dosbing" ], "summary": "Get amount of mahasiswa's bimbingan status by dosen ID", - "parameters": [ - { - "type": "string", - "description": "Dosen ID", - "name": "id_dosen", - "in": "query", - "required": true + "responses": { + "200": { + "description": "List mahasiswa successfully retreived", + "schema": { + "$ref": "#/definitions/entity.StatusBimbinganMahasiswa" + } } + } + } + }, + "/api/mahasiswa/dashboard": { + "get": { + "description": "Retrieves the status mahasiswa by NIM.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Status Mahasiswa" ], + "summary": "Get status mahasiswa", "responses": { "200": { - "description": "List mahasiswa successfully retreived", + "description": "OK", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.StatusBimbinganMahasiswa" - } + "$ref": "#/definitions/entity.DashboardMahasiswaRet" } } } @@ -693,9 +691,9 @@ const docTemplate = `{ } } }, - "/jadwal-seminar": { + "/dashboard-tim": { "get": { - "description": "Retrieves all jadwal seminar records.", + "description": "Retrieves a list of mahasiswa that has already done pendaftaran", "consumes": [ "application/json" ], @@ -703,23 +701,46 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Jadwal Seminar" + "Dashboard Tim TA" + ], + "summary": "Get mahasiswa pendaftaran", + "parameters": [ + { + "type": "string", + "description": "Dosen ID", + "name": "id_dosen", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "Limit", + "name": "limit", + "in": "query" + }, + { + "type": "string", + "description": "Offset", + "name": "offset", + "in": "query" + } ], - "summary": "Get all jadwal seminar", "responses": { "200": { - "description": "Jadwal Seminar successfully retreived", + "description": "List mahasiswa successfully retrieved", "schema": { "type": "array", "items": { - "$ref": "#/definitions/entity.JadwalSeminar" + "$ref": "#/definitions/entity.DataPendaftaran" } } } } - }, + } + }, + "/pendaftaran": { "post": { - "description": "Adds a new jadwal seminar record.", + "description": "Adds a new pendaftaran record.", "consumes": [ "application/json" ], @@ -727,31 +748,33 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Jadwal Seminar" + "Pendaftaran" ], - "summary": "Add jadwal seminar", + "summary": "Add pendaftaran", "parameters": [ { - "description": "Jadwal Seminar request body", - "name": "body", + "description": "Pendaftaran Add Request", + "name": "request", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/entity.JadwalSeminarRequest" + "$ref": "#/definitions/entity.PendaftaranAddRequest" } } ], "responses": { "201": { - "description": "Jadwal added successfully", + "description": "Created", "schema": { - "$ref": "#/definitions/entity.JadwalSeminar" + "$ref": "#/definitions/entity.PendaftaranSwag" } } } - }, - "delete": { - "description": "Deletes a jadwal seminar record by ID.", + } + }, + "/pendaftaran-delete": { + "get": { + "description": "Deletes a pendaftaran record.", "consumes": [ "application/json" ], @@ -759,31 +782,31 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Jadwal Seminar" + "Pendaftaran" ], - "summary": "Delete jadwal seminar", + "summary": "Delete pendaftaran", "parameters": [ { - "description": "Edit Jadwal Seminar request body", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/entity.EditJadwalSeminarRequest" - } + "type": "string", + "description": "ID of the pendaftaran", + "name": "id", + "in": "query", + "required": true } ], "responses": { "200": { - "description": "Jadwal Seminar successfully deleted", + "description": "OK", "schema": { - "$ref": "#/definitions/entity.JadwalSeminar" + "type": "object" } } } - }, - "patch": { - "description": "Edits an existing jadwal seminar record.", + } + }, + "/pendaftaran-get-by-dosen": { + "get": { + "description": "Retrieves a list of pendaftaran records by dosen ID.", "consumes": [ "application/json" ], @@ -791,33 +814,34 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Jadwal Seminar" + "Pendaftaran" ], - "summary": "Edit jadwal seminar", + "summary": "Get pendaftaran by dosen ID", "parameters": [ { - "description": "Edit Jadwal Seminar request body", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/entity.EditJadwalSeminarRequest" - } + "type": "string", + "description": "ID of the dosen", + "name": "id", + "in": "query", + "required": true } ], "responses": { "200": { - "description": "Jadwal Seminar successfully edited", + "description": "OK", "schema": { - "$ref": "#/definitions/entity.JadwalSeminar" + "type": "array", + "items": { + "$ref": "#/definitions/entity.PendaftaranSwag" + } } } } } }, - "/jadwal-seminar-batch": { - "get": { - "description": "Retrieves jadwal seminar records by batch ID.", + "/pendaftaran-update-interview": { + "post": { + "description": "Updates the interview time of a pendaftaran record.", "consumes": [ "application/json" ], @@ -825,34 +849,33 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Jadwal Seminar" + "Pendaftaran" ], - "summary": "Get jadwal seminar by batch", + "summary": "Update pendaftaran interview time", "parameters": [ { - "type": "string", - "description": "Batch ID", - "name": "id_batch", - "in": "query", - "required": true + "description": "Update Pendaftaran Interview Time Request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/entity.WaktuInterviewUpdateRequest" + } } ], "responses": { - "200": { - "description": "Jadwal Seminar successfully retreived", + "201": { + "description": "Created", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.JadwalSeminar" - } + "$ref": "#/definitions/entity.PendaftaranSwag" } } } } }, - "/jadwal-seminar-latest": { - "get": { - "description": "Retrieves the latest jadwal seminar record.", + "/pendaftaran-update-status": { + "post": { + "description": "Updates the status of a pendaftaran record.", "consumes": [ "application/json" ], @@ -860,48 +883,53 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Jadwal Seminar" + "Pendaftaran" + ], + "summary": "Update pendaftaran status", + "parameters": [ + { + "description": "Update Pendaftaran Status Request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/entity.UpdatePendaftaranRequest" + } + } ], - "summary": "Get latest jadwal seminar", "responses": { - "200": { - "description": "Latest Jadwal Seminar successfully retreived", + "201": { + "description": "Created", "schema": { - "$ref": "#/definitions/entity.JadwalSeminar" + "$ref": "#/definitions/entity.PendaftaranSwag" } } } } }, - "/jadwal-seminar-range": { + "/period-data": { "get": { - "description": "Retrieves all jadwal seminar records within a date range.", - "consumes": [ - "application/json" - ], + "description": "Retrieve period statistics (period data and number of mahasiswa accepted) that is used for tim tugas dashboard", "produces": [ "application/json" ], "tags": [ - "Jadwal Seminar" + "dashboard-tim-tugas" ], - "summary": "Get all jadwal seminar within a date range", + "summary": "Retrieve dashboard period statistics (period data and number of mahasiswa accepted)", "responses": { "200": { "description": "OK", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.JadwalSeminar" - } + "$ref": "#/definitions/entity.PeriodStats" } } } } }, - "/jadwal-sidang": { + "/periode-pendaftaran": { "get": { - "description": "Retrieves all jadwal sidang records.", + "description": "Retrieves a list of bperiod for pendaftaran.", "consumes": [ "application/json" ], @@ -909,23 +937,23 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Jadwal Sidang" + "Periode Pendaftaran" ], - "summary": "Get all jadwal sidang", + "summary": "Get period for pendaftaran", "responses": { "200": { - "description": "OK", + "description": "Period pendaftaran successfully retreived", "schema": { "type": "array", "items": { - "$ref": "#/definitions/entity.JadwalSidang" + "$ref": "#/definitions/entity.PeriodPendaftaranSwag" } } } } }, "post": { - "description": "Adds a new jadwal sidang record.", + "description": "Adds a new period for pendaftaran.", "consumes": [ "application/json" ], @@ -933,31 +961,31 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Jadwal Sidang" + "Periode Pendaftaran" ], - "summary": "Add jadwal sidang", + "summary": "Add period for pendaftaran", "parameters": [ { - "description": "Jadwal Sidang Request", - "name": "request", + "description": "Period Pendaftaran object", + "name": "batch", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/entity.JadwalSidangRequest" + "$ref": "#/definitions/entity.PeriodPendaftaranSwag" } } ], "responses": { - "201": { - "description": "Created", + "200": { + "description": "Period pendaftaran added successfully", "schema": { - "$ref": "#/definitions/entity.JadwalSidang" + "$ref": "#/definitions/entity.PeriodPendaftaranSwag" } } } }, "delete": { - "description": "Deletes a jadwal sidang record by ID.", + "description": "Deletes a period for pendaftaran.", "consumes": [ "application/json" ], @@ -965,31 +993,33 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Jadwal Sidang" + "Periode Pendaftaran" ], - "summary": "Delete jadwal sidang", + "summary": "Delete period for pendaftaran", "parameters": [ { - "description": "Edit Jadwal Sidang Request", - "name": "request", + "description": "Period Pendaftaran object", + "name": "batch", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/entity.EditJadwalSidangRequest" + "$ref": "#/definitions/entity.PeriodPendaftaranSwag" } } ], "responses": { "200": { - "description": "OK", + "description": "Period pendaftaran successfully deleted", "schema": { - "$ref": "#/definitions/entity.JadwalSidang" + "$ref": "#/definitions/entity.PeriodPendaftaranSwag" } } } - }, - "patch": { - "description": "Edits an existing jadwal sidang record.", + } + }, + "/periode-pendaftaran-current": { + "get": { + "description": "Retrieves a list of period for pendaftaran.", "consumes": [ "application/json" ], @@ -997,33 +1027,22 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Jadwal Sidang" - ], - "summary": "Edit jadwal sidang", - "parameters": [ - { - "description": "Edit Jadwal Sidang Request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/entity.EditJadwalSidangRequest" - } - } + "Periode Pendaftaran" ], + "summary": "Get periode pendaftaran that current time is between its startDate and endDate.", "responses": { "200": { - "description": "OK", + "description": "Period pendaftaran successfully retreived", "schema": { - "$ref": "#/definitions/entity.JadwalSidang" + "$ref": "#/definitions/entity.PeriodPendaftaranSwag" } } } } }, - "/jadwal-sidang-batch": { + "/periode-pendaftaran-live": { "get": { - "description": "Retrieves jadwal sidang records by batch ID.", + "description": "Retrieves a period for pendaftaran.", "consumes": [ "application/json" ], @@ -1031,34 +1050,23 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Jadwal Sidang" - ], - "summary": "Get jadwal sidang by batch", - "parameters": [ - { - "type": "string", - "description": "Batch ID", - "name": "id_batch", - "in": "query", - "required": true - } + "Periode Pendaftaran" ], + "summary": "Get periode pendaftaran that is live.", "responses": { "200": { - "description": "OK", + "description": "Periode pendaftaran successfully retreived", "schema": { "type": "array", "items": { - "$ref": "#/definitions/entity.JadwalSidang" + "$ref": "#/definitions/entity.PeriodPendaftaranSwag" } } } } - } - }, - "/jadwal-sidang-latest": { - "get": { - "description": "Retrieves the latest jadwal sidang record.", + }, + "patch": { + "description": "Set Period to live.", "consumes": [ "application/json" ], @@ -1066,412 +1074,45 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Jadwal Sidang" + "Periode Pendaftaran" + ], + "summary": "Set Period to live", + "parameters": [ + { + "description": "Period Pendaftaran object", + "name": "batch", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/entity.PeriodPendaftaranSwag" + } + } ], - "summary": "Get latest jadwal sidang", "responses": { "200": { - "description": "OK", + "description": "Periode pendaftaran successfully updated to live", "schema": { - "$ref": "#/definitions/entity.JadwalSidang" + "$ref": "#/definitions/entity.PeriodPendaftaranSwag" } } } } }, - "/jadwal-sidang-range": { + "/statistics-dashboard-tim-tugas": { "get": { - "description": "Retrieves all jadwal sidang records within a date range.", - "consumes": [ - "application/json" - ], + "description": "Retrieve data and statistics that is used for tim tugas dashboard", "produces": [ "application/json" ], "tags": [ - "Jadwal Sidang" + "dashboard-tim-tugas" ], - "summary": "Get all jadwal sidang within a date range", + "summary": "Retrieve dashboard data and statistics", "responses": { "200": { "description": "OK", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.JadwalSidang" - } - } - } - } - } - }, - "/pendaftaran": { - "post": { - "description": "Adds a new pendaftaran record.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Pendaftaran" - ], - "summary": "Add pendaftaran", - "parameters": [ - { - "description": "Pendaftaran Add Request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/entity.PendaftaranAddRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/entity.Pendaftaran" - } - } - } - } - }, - "/pendaftaran-delete": { - "get": { - "description": "Deletes a pendaftaran record.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Pendaftaran" - ], - "summary": "Delete pendaftaran", - "parameters": [ - { - "type": "string", - "description": "ID of the pendaftaran", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "object" - } - } - } - } - }, - "/pendaftaran-get-by-dosen": { - "get": { - "description": "Retrieves a list of pendaftaran records by dosen ID.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Pendaftaran" - ], - "summary": "Get pendaftaran by dosen ID", - "parameters": [ - { - "type": "string", - "description": "ID of the dosen", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.Pendaftaran" - } - } - } - } - } - }, - "/pendaftaran-update-interview": { - "post": { - "description": "Updates the interview time of a pendaftaran record.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Pendaftaran" - ], - "summary": "Update pendaftaran interview time", - "parameters": [ - { - "description": "Update Pendaftaran Interview Time Request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/entity.WaktuInterviewUpdateRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/entity.Pendaftaran" - } - } - } - } - }, - "/pendaftaran-update-status": { - "post": { - "description": "Updates the status of a pendaftaran record.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Pendaftaran" - ], - "summary": "Update pendaftaran status", - "parameters": [ - { - "description": "Update Pendaftaran Status Request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/entity.UpdatePendaftaranRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/entity.Pendaftaran" - } - } - } - } - }, - "/periode-pendaftaran": { - "get": { - "description": "Retrieves a list of bperiod for pendaftaran.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Periode Pendaftaran" - ], - "summary": "Get period for pendaftaran", - "responses": { - "200": { - "description": "Period pendaftaran successfully retreived", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.PeriodPendaftaran" - } - } - } - } - }, - "post": { - "description": "Adds a new period for pendaftaran.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Periode Pendaftaran" - ], - "summary": "Add period for pendaftaran", - "parameters": [ - { - "description": "Period Pendaftaran object", - "name": "batch", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/entity.PeriodPendaftaran" - } - } - ], - "responses": { - "200": { - "description": "Period pendaftaran added successfully", - "schema": { - "$ref": "#/definitions/entity.PeriodPendaftaran" - } - } - } - }, - "delete": { - "description": "Deletes a period for pendaftaran.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Periode Pendaftaran" - ], - "summary": "Delete period for pendaftaran", - "parameters": [ - { - "description": "Period Pendaftaran object", - "name": "batch", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/entity.PeriodPendaftaran" - } - } - ], - "responses": { - "200": { - "description": "Period pendaftaran successfully deleted", - "schema": { - "$ref": "#/definitions/entity.PeriodPendaftaran" - } - } - } - } - }, - "/periode-pendaftaran-current": { - "get": { - "description": "Retrieves a list of period for pendaftaran.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Periode Pendaftaran" - ], - "summary": "Get periode pendaftaran that current time is between its startDate and endDate.", - "responses": { - "200": { - "description": "Period pendaftaran successfully retreived", - "schema": { - "$ref": "#/definitions/entity.PeriodPendaftaran" - } - } - } - } - }, - "/periode-pendaftaran-live": { - "get": { - "description": "Retrieves a period for pendaftaran.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Periode Pendaftaran" - ], - "summary": "Get periode pendaftaran that is live.", - "responses": { - "200": { - "description": "Periode pendaftaran successfully retreived", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.PeriodPendaftaran" - } - } - } - } - }, - "patch": { - "description": "Set Period to live.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Periode Pendaftaran" - ], - "summary": "Set Period to live", - "parameters": [ - { - "description": "Period Pendaftaran object", - "name": "batch", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/entity.PeriodPendaftaran" - } - } - ], - "responses": { - "200": { - "description": "Periode pendaftaran successfully updated to live", - "schema": { - "$ref": "#/definitions/entity.PeriodPendaftaran" - } - } - } - } - }, - "/status-mahasiswa": { - "get": { - "description": "Retrieves the status mahasiswa by NIM.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Status Mahasiswa" - ], - "summary": "Get status mahasiswa", - "parameters": [ - { - "type": "string", - "description": "NIM of the student", - "name": "nim", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/entity.StatusMahasiswa" + "$ref": "#/definitions/entity.DashboardData" } } } @@ -1562,6 +1203,20 @@ const docTemplate = `{ } } }, + "entity.BerkasLogBimbingan": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "link": { + "type": "string" + }, + "nama": { + "type": "string" + } + } + }, "entity.BimbinganLog": { "type": "object", "properties": { @@ -1588,241 +1243,212 @@ const docTemplate = `{ } } }, - "entity.EditJadwalSeminarRequest": { + "entity.DashboardData": { "type": "object", "properties": { - "ID": { - "type": "string" - }, - "IDBatch": { - "type": "string" - }, - "judul": { - "type": "string" + "list_pendaftaran": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.DataPendaftaranMahasiswa" + } }, - "namaDosbing": { - "type": "string" + "statistics": { + "$ref": "#/definitions/entity.StatusStatistics" + } + } + }, + "entity.DashboardMahasiswaRet": { + "type": "object", + "properties": { + "bimbingan": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.LogBimbingan" + } }, - "namaDosuji1": { - "type": "string" + "dosen_bimbingan": { + "$ref": "#/definitions/entity.DataDosenBimbingan" }, - "name": { - "type": "string" + "mahasiswa": { + "$ref": "#/definitions/entity.DataMahasiswa" }, - "nim": { - "type": "string" + "pendaftaran_ta": { + "$ref": "#/definitions/entity.StatusPendaftaranTA" }, - "ruang": { - "type": "string" + "seminar": { + "$ref": "#/definitions/entity.SidangSeminar" }, - "scheduledAt": { - "type": "string" + "sidang": { + "$ref": "#/definitions/entity.SidangSeminar" } } }, - "entity.EditJadwalSidangRequest": { + "entity.DataDosenBimbingan": { "type": "object", "properties": { - "ID": { + "email": { "type": "string" }, - "IDBatch": { - "type": "string" - }, - "judul": { + "id": { "type": "string" }, - "namaDosbing": { + "nama": { "type": "string" - }, - "namaDosuji1": { + } + } + }, + "entity.DataMahasiswa": { + "type": "object", + "properties": { + "email": { "type": "string" }, - "namaDosuji2": { + "id": { "type": "string" }, - "name": { + "nama": { "type": "string" }, "nim": { "type": "string" - }, - "ruang": { - "type": "string" - }, - "scheduledAt": { - "type": "string" } } }, - "entity.JadwalSeminar": { + "entity.DataPendaftaran": { "type": "object", "properties": { - "batchid": { - "type": "string" - }, - "createdAt": { - "description": "Use this if you want to override the gorm.Model's CreatedAt", - "type": "string" - }, - "id": { + "dosbing": { "type": "string" }, - "judul": { - "type": "string" - }, - "namaDosbing": { - "type": "string" - }, - "namaDosuji1": { + "id_pendaftaran": { "type": "string" }, - "name": { + "nama": { "type": "string" }, "nim": { "type": "string" }, - "ruang": { - "type": "string" - }, - "scheduledAt": { + "status": { "type": "string" } } }, - "entity.JadwalSeminarRequest": { + "entity.DataPendaftaranMahasiswa": { "type": "object", "properties": { - "IDBatch": { - "type": "string" - }, - "judul": { - "type": "string" - }, - "namaDosbing": { - "type": "string" - }, - "namaDosuji1": { + "judul_topik": { "type": "string" }, - "name": { + "nama": { "type": "string" }, "nim": { "type": "string" }, - "ruang": { - "type": "string" - }, - "scheduledAt": { - "type": "string" + "status": { + "type": "boolean" } } }, - "entity.JadwalSidang": { + "entity.DataTopik": { "type": "object", "properties": { - "batchid": { + "deskripsi": { "type": "string" }, - "createdAt": { - "description": "Use this if you want to override the gorm.Model's CreatedAt", + "id": { "type": "string" }, - "id": { + "id_pengaju": { "type": "string" }, "judul": { "type": "string" + } + } + }, + "entity.JumlahMahasiswaSwag": { + "type": "object", + "properties": { + "mahasiswa_if": { + "type": "integer" }, - "namaDosbing": { - "type": "string" + "mahasiswa_sti": { + "type": "integer" + } + } + }, + "entity.LogBimbingan": { + "type": "object", + "properties": { + "berkas": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.BerkasLogBimbingan" + } }, - "namaDosuji1": { + "id": { "type": "string" }, - "namaDosuji2": { + "laporan_kemajuan": { "type": "string" }, - "name": { + "next_bimbingan": { "type": "string" }, - "nim": { - "type": "string" + "status": { + "type": "boolean" }, - "ruang": { + "todo": { "type": "string" }, - "scheduledAt": { + "waktu_bimbingan": { "type": "string" } } }, - "entity.JadwalSidangRequest": { + "entity.MahasiswaBimbingan": { "type": "object", "properties": { - "IDBatch": { - "type": "string" - }, - "judul": { - "type": "string" - }, - "namaDosbing": { + "id": { "type": "string" }, - "namaDosuji1": { + "id_topik": { "type": "string" }, - "namaDosuji2": { + "judul_topik": { "type": "string" }, - "name": { + "nama": { "type": "string" }, "nim": { "type": "string" }, - "ruang": { - "type": "string" - }, - "scheduledAt": { + "status": { "type": "string" } } }, - "entity.JumlahMahasiswa": { - "type": "object", - "properties": { - "mahasiswa_if": { - "type": "integer" - }, - "mahasiswa_sti": { - "type": "integer" - } - } - }, - "entity.MahasiswaBimbingan": { + "entity.PendaftaranAddRequest": { "type": "object", "properties": { - "id": { + "idDosen": { "type": "string" }, - "nama": { + "idMahasiswa": { "type": "string" }, - "nim": { + "idPeriode": { "type": "string" }, - "status": { + "idTopik": { "type": "string" - }, - "topik": { - "$ref": "#/definitions/entity.TopikMahasiswaBingan" } } }, - "entity.Pendaftaran": { + "entity.PendaftaranSwag": { "type": "object", "properties": { "createdAt": { @@ -1860,24 +1486,7 @@ const docTemplate = `{ } } }, - "entity.PendaftaranAddRequest": { - "type": "object", - "properties": { - "idDosen": { - "type": "string" - }, - "idMahasiswa": { - "type": "string" - }, - "idPeriode": { - "type": "string" - }, - "idTopik": { - "type": "string" - } - } - }, - "entity.PeriodPendaftaran": { + "entity.PeriodPendaftaranSwag": { "type": "object", "properties": { "endDate": { @@ -1900,117 +1509,97 @@ const docTemplate = `{ } } }, - "entity.StatusBimbingan": { - "type": "object", - "properties": { - "jumlah_bimbingan": { - "type": "integer" - } - } - }, - "entity.StatusBimbinganMahasiswa": { + "entity.PeriodStats": { "type": "object", "properties": { - "butuh_bimbingan": { - "type": "integer" - }, - "lancar": { + "count_mahasiswa": { "type": "integer" }, - "terkendala": { - "type": "integer" + "period": { + "$ref": "#/definitions/src_module_dashboard_tim_tugas_entity.PeriodPendaftaran" } } }, - "entity.StatusMahasiswa": { + "entity.SidangSeminar": { "type": "object", "properties": { - "id_mahasiswa": { - "type": "string" + "ditolak": { + "type": "boolean" }, - "nama": { + "id": { "type": "string" }, - "nim": { + "jadwal_seminar": { "type": "string" }, - "status_bimbingan": { - "$ref": "#/definitions/entity.StatusBimbingan" + "lulus": { + "type": "boolean" }, - "status_pendaftaran": { - "$ref": "#/definitions/entity.StatusPendaftaran" + "ruangan": { + "type": "string" + } + } + }, + "entity.StatusBimbinganMahasiswa": { + "type": "object", + "properties": { + "butuh_bimbingan": { + "type": "integer" }, - "status_seminar": { - "$ref": "#/definitions/entity.StatusSeminar" + "lancar": { + "type": "integer" }, - "status_sidang": { - "$ref": "#/definitions/entity.StatusSidang" + "terkendala": { + "type": "integer" } } }, - "entity.StatusPendaftaran": { + "entity.StatusPendaftaranTA": { "type": "object", "properties": { - "dosen_pembimbing": { + "id": { "type": "string" }, "jadwal_interview": { "type": "string" }, - "judul": { - "type": "string" - }, - "pengesahan_dosen_pembimbing": { - "type": "boolean" - }, - "pengiriman_registrasi": { - "type": "string" - }, - "persetujuan_dosen_pembimbing": { + "jalur_pilihan": { "type": "string" }, "status": { - "type": "boolean" + "type": "string" }, "topik": { - "type": "string" - } - } - }, - "entity.StatusSeminar": { - "type": "object", - "properties": { - "dosen_penguji": { - "type": "string" + "$ref": "#/definitions/entity.DataTopik" }, - "jadwal_seminar": { + "waktu_keputusan": { "type": "string" }, - "ruangan": { + "waktu_pengiriman": { "type": "string" - }, - "status": { - "type": "boolean" } } }, - "entity.StatusSidang": { + "entity.StatusStatistics": { "type": "object", "properties": { - "dosen_penguji_1": { - "type": "string" + "diproses": { + "type": "integer" }, - "dosen_penguji_2": { - "type": "string" + "diterima": { + "type": "integer" }, - "jadwal_seminar": { - "type": "string" + "ditolak": { + "type": "integer" }, - "ruangan": { - "type": "string" + "persen_diproses": { + "type": "number" }, - "status": { - "type": "boolean" + "persen_diterima": { + "type": "number" + }, + "persen_ditolak": { + "type": "number" } } }, @@ -2031,7 +1620,7 @@ const docTemplate = `{ } } }, - "entity.Topik": { + "entity.TopikSwag": { "type": "object", "properties": { "deskripsi": { @@ -2054,35 +1643,47 @@ const docTemplate = `{ } } }, - "entity.TopikMahasiswaBingan": { + "entity.UpdatePendaftaranRequest": { "type": "object", "properties": { "id": { "type": "string" }, - "judul": { - "type": "string" + "status": { + "type": "boolean" } } }, - "entity.UpdatePendaftaranRequest": { + "entity.WaktuInterviewUpdateRequest": { "type": "object", "properties": { "id": { "type": "string" }, - "status": { - "type": "boolean" + "interviewAt": { + "type": "string" } } }, - "entity.WaktuInterviewUpdateRequest": { + "src_module_dashboard_tim_tugas_entity.PeriodPendaftaran": { "type": "object", "properties": { + "end_date": { + "type": "string" + }, "id": { "type": "string" }, - "interviewAt": { + "semester": { + "type": "string" + }, + "start_date": { + "type": "string" + }, + "status": { + "type": "boolean" + }, + "year": { "type": "string" } } diff --git a/docs/swagger.json b/docs/swagger.json index 0b9913698d2bf5fef44b1961955732b500a464a5..9ed74bcb1ae25f4d6b4a6c117b42bc834cf5d097 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -46,7 +46,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/entity.Topik" + "$ref": "#/definitions/entity.TopikSwag" } } } @@ -73,7 +73,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/entity.Topik" + "$ref": "#/definitions/entity.TopikSwag" } } } @@ -84,7 +84,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/entity.Topik" + "$ref": "#/definitions/entity.TopikSwag" } } } @@ -114,7 +114,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/entity.Topik" + "$ref": "#/definitions/entity.TopikSwag" } } } @@ -145,7 +145,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/entity.Topik" + "$ref": "#/definitions/entity.TopikSwag" } } ], @@ -153,7 +153,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/entity.Topik" + "$ref": "#/definitions/entity.TopikSwag" } } } @@ -183,7 +183,7 @@ } } }, - "/api/admin/dashboard/dosbing": { + "/api/dosbing/dashboard": { "get": { "description": "Retrieves a list of mahasiswa supervised by a specific dosen for TA.", "consumes": [ @@ -199,15 +199,14 @@ "parameters": [ { "type": "string", - "description": "Dosen ID", - "name": "id_dosen", - "in": "query", - "required": true + "description": "Search", + "name": "search", + "in": "query" }, { "type": "string", - "description": "Limit", - "name": "limit", + "description": "Size", + "name": "size", "in": "query" }, { @@ -230,7 +229,7 @@ } } }, - "/api/admin/dashboard/dosbing/statistic": { + "/api/dosbing/dashboard/statistic": { "get": { "description": "Retrieves the amount of mahasiswa supervised by a specific dosen for TA.", "consumes": [ @@ -242,30 +241,18 @@ "tags": [ "Dashboard Dosbing" ], - "summary": "Get amount of mahasiswa by dosen ID", - "parameters": [ - { - "type": "string", - "description": "Dosen ID", - "name": "id_dosen", - "in": "query", - "required": true - } - ], + "summary": "Get amount of mahasiswa", "responses": { "200": { "description": "List mahasiswa successfully retreived", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.JumlahMahasiswa" - } + "$ref": "#/definitions/entity.JumlahMahasiswaSwag" } } } } }, - "/api/admin/dashboard/dosbing/status-bimbingan": { + "/api/dosbing/dashboard/status-bimbingan": { "get": { "description": "Retrieves the amount of mahasiswa's bimbingan status supervised by a specific dosen for TA.", "consumes": [ @@ -278,23 +265,34 @@ "Dashboard Dosbing" ], "summary": "Get amount of mahasiswa's bimbingan status by dosen ID", - "parameters": [ - { - "type": "string", - "description": "Dosen ID", - "name": "id_dosen", - "in": "query", - "required": true + "responses": { + "200": { + "description": "List mahasiswa successfully retreived", + "schema": { + "$ref": "#/definitions/entity.StatusBimbinganMahasiswa" + } } + } + } + }, + "/api/mahasiswa/dashboard": { + "get": { + "description": "Retrieves the status mahasiswa by NIM.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Status Mahasiswa" ], + "summary": "Get status mahasiswa", "responses": { "200": { - "description": "List mahasiswa successfully retreived", + "description": "OK", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.StatusBimbinganMahasiswa" - } + "$ref": "#/definitions/entity.DashboardMahasiswaRet" } } } @@ -682,9 +680,9 @@ } } }, - "/jadwal-seminar": { + "/dashboard-tim": { "get": { - "description": "Retrieves all jadwal seminar records.", + "description": "Retrieves a list of mahasiswa that has already done pendaftaran", "consumes": [ "application/json" ], @@ -692,23 +690,46 @@ "application/json" ], "tags": [ - "Jadwal Seminar" + "Dashboard Tim TA" + ], + "summary": "Get mahasiswa pendaftaran", + "parameters": [ + { + "type": "string", + "description": "Dosen ID", + "name": "id_dosen", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "Limit", + "name": "limit", + "in": "query" + }, + { + "type": "string", + "description": "Offset", + "name": "offset", + "in": "query" + } ], - "summary": "Get all jadwal seminar", "responses": { "200": { - "description": "Jadwal Seminar successfully retreived", + "description": "List mahasiswa successfully retrieved", "schema": { "type": "array", "items": { - "$ref": "#/definitions/entity.JadwalSeminar" + "$ref": "#/definitions/entity.DataPendaftaran" } } } } - }, + } + }, + "/pendaftaran": { "post": { - "description": "Adds a new jadwal seminar record.", + "description": "Adds a new pendaftaran record.", "consumes": [ "application/json" ], @@ -716,31 +737,33 @@ "application/json" ], "tags": [ - "Jadwal Seminar" + "Pendaftaran" ], - "summary": "Add jadwal seminar", + "summary": "Add pendaftaran", "parameters": [ { - "description": "Jadwal Seminar request body", - "name": "body", + "description": "Pendaftaran Add Request", + "name": "request", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/entity.JadwalSeminarRequest" + "$ref": "#/definitions/entity.PendaftaranAddRequest" } } ], "responses": { "201": { - "description": "Jadwal added successfully", + "description": "Created", "schema": { - "$ref": "#/definitions/entity.JadwalSeminar" + "$ref": "#/definitions/entity.PendaftaranSwag" } } } - }, - "delete": { - "description": "Deletes a jadwal seminar record by ID.", + } + }, + "/pendaftaran-delete": { + "get": { + "description": "Deletes a pendaftaran record.", "consumes": [ "application/json" ], @@ -748,31 +771,31 @@ "application/json" ], "tags": [ - "Jadwal Seminar" + "Pendaftaran" ], - "summary": "Delete jadwal seminar", + "summary": "Delete pendaftaran", "parameters": [ { - "description": "Edit Jadwal Seminar request body", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/entity.EditJadwalSeminarRequest" - } + "type": "string", + "description": "ID of the pendaftaran", + "name": "id", + "in": "query", + "required": true } ], "responses": { "200": { - "description": "Jadwal Seminar successfully deleted", + "description": "OK", "schema": { - "$ref": "#/definitions/entity.JadwalSeminar" + "type": "object" } } } - }, - "patch": { - "description": "Edits an existing jadwal seminar record.", + } + }, + "/pendaftaran-get-by-dosen": { + "get": { + "description": "Retrieves a list of pendaftaran records by dosen ID.", "consumes": [ "application/json" ], @@ -780,33 +803,34 @@ "application/json" ], "tags": [ - "Jadwal Seminar" + "Pendaftaran" ], - "summary": "Edit jadwal seminar", + "summary": "Get pendaftaran by dosen ID", "parameters": [ { - "description": "Edit Jadwal Seminar request body", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/entity.EditJadwalSeminarRequest" - } + "type": "string", + "description": "ID of the dosen", + "name": "id", + "in": "query", + "required": true } ], "responses": { "200": { - "description": "Jadwal Seminar successfully edited", + "description": "OK", "schema": { - "$ref": "#/definitions/entity.JadwalSeminar" + "type": "array", + "items": { + "$ref": "#/definitions/entity.PendaftaranSwag" + } } } } } }, - "/jadwal-seminar-batch": { - "get": { - "description": "Retrieves jadwal seminar records by batch ID.", + "/pendaftaran-update-interview": { + "post": { + "description": "Updates the interview time of a pendaftaran record.", "consumes": [ "application/json" ], @@ -814,34 +838,33 @@ "application/json" ], "tags": [ - "Jadwal Seminar" + "Pendaftaran" ], - "summary": "Get jadwal seminar by batch", + "summary": "Update pendaftaran interview time", "parameters": [ { - "type": "string", - "description": "Batch ID", - "name": "id_batch", - "in": "query", - "required": true + "description": "Update Pendaftaran Interview Time Request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/entity.WaktuInterviewUpdateRequest" + } } ], "responses": { - "200": { - "description": "Jadwal Seminar successfully retreived", + "201": { + "description": "Created", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.JadwalSeminar" - } + "$ref": "#/definitions/entity.PendaftaranSwag" } } } } }, - "/jadwal-seminar-latest": { - "get": { - "description": "Retrieves the latest jadwal seminar record.", + "/pendaftaran-update-status": { + "post": { + "description": "Updates the status of a pendaftaran record.", "consumes": [ "application/json" ], @@ -849,48 +872,53 @@ "application/json" ], "tags": [ - "Jadwal Seminar" + "Pendaftaran" + ], + "summary": "Update pendaftaran status", + "parameters": [ + { + "description": "Update Pendaftaran Status Request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/entity.UpdatePendaftaranRequest" + } + } ], - "summary": "Get latest jadwal seminar", "responses": { - "200": { - "description": "Latest Jadwal Seminar successfully retreived", + "201": { + "description": "Created", "schema": { - "$ref": "#/definitions/entity.JadwalSeminar" + "$ref": "#/definitions/entity.PendaftaranSwag" } } } } }, - "/jadwal-seminar-range": { + "/period-data": { "get": { - "description": "Retrieves all jadwal seminar records within a date range.", - "consumes": [ - "application/json" - ], + "description": "Retrieve period statistics (period data and number of mahasiswa accepted) that is used for tim tugas dashboard", "produces": [ "application/json" ], "tags": [ - "Jadwal Seminar" + "dashboard-tim-tugas" ], - "summary": "Get all jadwal seminar within a date range", + "summary": "Retrieve dashboard period statistics (period data and number of mahasiswa accepted)", "responses": { "200": { "description": "OK", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.JadwalSeminar" - } + "$ref": "#/definitions/entity.PeriodStats" } } } } }, - "/jadwal-sidang": { + "/periode-pendaftaran": { "get": { - "description": "Retrieves all jadwal sidang records.", + "description": "Retrieves a list of bperiod for pendaftaran.", "consumes": [ "application/json" ], @@ -898,23 +926,23 @@ "application/json" ], "tags": [ - "Jadwal Sidang" + "Periode Pendaftaran" ], - "summary": "Get all jadwal sidang", + "summary": "Get period for pendaftaran", "responses": { "200": { - "description": "OK", + "description": "Period pendaftaran successfully retreived", "schema": { "type": "array", "items": { - "$ref": "#/definitions/entity.JadwalSidang" + "$ref": "#/definitions/entity.PeriodPendaftaranSwag" } } } } }, "post": { - "description": "Adds a new jadwal sidang record.", + "description": "Adds a new period for pendaftaran.", "consumes": [ "application/json" ], @@ -922,31 +950,31 @@ "application/json" ], "tags": [ - "Jadwal Sidang" + "Periode Pendaftaran" ], - "summary": "Add jadwal sidang", + "summary": "Add period for pendaftaran", "parameters": [ { - "description": "Jadwal Sidang Request", - "name": "request", + "description": "Period Pendaftaran object", + "name": "batch", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/entity.JadwalSidangRequest" + "$ref": "#/definitions/entity.PeriodPendaftaranSwag" } } ], "responses": { - "201": { - "description": "Created", + "200": { + "description": "Period pendaftaran added successfully", "schema": { - "$ref": "#/definitions/entity.JadwalSidang" + "$ref": "#/definitions/entity.PeriodPendaftaranSwag" } } } }, "delete": { - "description": "Deletes a jadwal sidang record by ID.", + "description": "Deletes a period for pendaftaran.", "consumes": [ "application/json" ], @@ -954,31 +982,33 @@ "application/json" ], "tags": [ - "Jadwal Sidang" + "Periode Pendaftaran" ], - "summary": "Delete jadwal sidang", + "summary": "Delete period for pendaftaran", "parameters": [ { - "description": "Edit Jadwal Sidang Request", - "name": "request", + "description": "Period Pendaftaran object", + "name": "batch", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/entity.EditJadwalSidangRequest" + "$ref": "#/definitions/entity.PeriodPendaftaranSwag" } } ], "responses": { "200": { - "description": "OK", + "description": "Period pendaftaran successfully deleted", "schema": { - "$ref": "#/definitions/entity.JadwalSidang" + "$ref": "#/definitions/entity.PeriodPendaftaranSwag" } } } - }, - "patch": { - "description": "Edits an existing jadwal sidang record.", + } + }, + "/periode-pendaftaran-current": { + "get": { + "description": "Retrieves a list of period for pendaftaran.", "consumes": [ "application/json" ], @@ -986,33 +1016,22 @@ "application/json" ], "tags": [ - "Jadwal Sidang" - ], - "summary": "Edit jadwal sidang", - "parameters": [ - { - "description": "Edit Jadwal Sidang Request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/entity.EditJadwalSidangRequest" - } - } + "Periode Pendaftaran" ], + "summary": "Get periode pendaftaran that current time is between its startDate and endDate.", "responses": { "200": { - "description": "OK", + "description": "Period pendaftaran successfully retreived", "schema": { - "$ref": "#/definitions/entity.JadwalSidang" + "$ref": "#/definitions/entity.PeriodPendaftaranSwag" } } } } }, - "/jadwal-sidang-batch": { + "/periode-pendaftaran-live": { "get": { - "description": "Retrieves jadwal sidang records by batch ID.", + "description": "Retrieves a period for pendaftaran.", "consumes": [ "application/json" ], @@ -1020,34 +1039,23 @@ "application/json" ], "tags": [ - "Jadwal Sidang" - ], - "summary": "Get jadwal sidang by batch", - "parameters": [ - { - "type": "string", - "description": "Batch ID", - "name": "id_batch", - "in": "query", - "required": true - } + "Periode Pendaftaran" ], + "summary": "Get periode pendaftaran that is live.", "responses": { "200": { - "description": "OK", + "description": "Periode pendaftaran successfully retreived", "schema": { "type": "array", "items": { - "$ref": "#/definitions/entity.JadwalSidang" + "$ref": "#/definitions/entity.PeriodPendaftaranSwag" } } } } - } - }, - "/jadwal-sidang-latest": { - "get": { - "description": "Retrieves the latest jadwal sidang record.", + }, + "patch": { + "description": "Set Period to live.", "consumes": [ "application/json" ], @@ -1055,412 +1063,45 @@ "application/json" ], "tags": [ - "Jadwal Sidang" + "Periode Pendaftaran" + ], + "summary": "Set Period to live", + "parameters": [ + { + "description": "Period Pendaftaran object", + "name": "batch", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/entity.PeriodPendaftaranSwag" + } + } ], - "summary": "Get latest jadwal sidang", "responses": { "200": { - "description": "OK", + "description": "Periode pendaftaran successfully updated to live", "schema": { - "$ref": "#/definitions/entity.JadwalSidang" + "$ref": "#/definitions/entity.PeriodPendaftaranSwag" } } } } }, - "/jadwal-sidang-range": { + "/statistics-dashboard-tim-tugas": { "get": { - "description": "Retrieves all jadwal sidang records within a date range.", - "consumes": [ - "application/json" - ], + "description": "Retrieve data and statistics that is used for tim tugas dashboard", "produces": [ "application/json" ], "tags": [ - "Jadwal Sidang" + "dashboard-tim-tugas" ], - "summary": "Get all jadwal sidang within a date range", + "summary": "Retrieve dashboard data and statistics", "responses": { "200": { "description": "OK", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.JadwalSidang" - } - } - } - } - } - }, - "/pendaftaran": { - "post": { - "description": "Adds a new pendaftaran record.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Pendaftaran" - ], - "summary": "Add pendaftaran", - "parameters": [ - { - "description": "Pendaftaran Add Request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/entity.PendaftaranAddRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/entity.Pendaftaran" - } - } - } - } - }, - "/pendaftaran-delete": { - "get": { - "description": "Deletes a pendaftaran record.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Pendaftaran" - ], - "summary": "Delete pendaftaran", - "parameters": [ - { - "type": "string", - "description": "ID of the pendaftaran", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "object" - } - } - } - } - }, - "/pendaftaran-get-by-dosen": { - "get": { - "description": "Retrieves a list of pendaftaran records by dosen ID.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Pendaftaran" - ], - "summary": "Get pendaftaran by dosen ID", - "parameters": [ - { - "type": "string", - "description": "ID of the dosen", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.Pendaftaran" - } - } - } - } - } - }, - "/pendaftaran-update-interview": { - "post": { - "description": "Updates the interview time of a pendaftaran record.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Pendaftaran" - ], - "summary": "Update pendaftaran interview time", - "parameters": [ - { - "description": "Update Pendaftaran Interview Time Request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/entity.WaktuInterviewUpdateRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/entity.Pendaftaran" - } - } - } - } - }, - "/pendaftaran-update-status": { - "post": { - "description": "Updates the status of a pendaftaran record.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Pendaftaran" - ], - "summary": "Update pendaftaran status", - "parameters": [ - { - "description": "Update Pendaftaran Status Request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/entity.UpdatePendaftaranRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/entity.Pendaftaran" - } - } - } - } - }, - "/periode-pendaftaran": { - "get": { - "description": "Retrieves a list of bperiod for pendaftaran.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Periode Pendaftaran" - ], - "summary": "Get period for pendaftaran", - "responses": { - "200": { - "description": "Period pendaftaran successfully retreived", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.PeriodPendaftaran" - } - } - } - } - }, - "post": { - "description": "Adds a new period for pendaftaran.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Periode Pendaftaran" - ], - "summary": "Add period for pendaftaran", - "parameters": [ - { - "description": "Period Pendaftaran object", - "name": "batch", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/entity.PeriodPendaftaran" - } - } - ], - "responses": { - "200": { - "description": "Period pendaftaran added successfully", - "schema": { - "$ref": "#/definitions/entity.PeriodPendaftaran" - } - } - } - }, - "delete": { - "description": "Deletes a period for pendaftaran.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Periode Pendaftaran" - ], - "summary": "Delete period for pendaftaran", - "parameters": [ - { - "description": "Period Pendaftaran object", - "name": "batch", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/entity.PeriodPendaftaran" - } - } - ], - "responses": { - "200": { - "description": "Period pendaftaran successfully deleted", - "schema": { - "$ref": "#/definitions/entity.PeriodPendaftaran" - } - } - } - } - }, - "/periode-pendaftaran-current": { - "get": { - "description": "Retrieves a list of period for pendaftaran.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Periode Pendaftaran" - ], - "summary": "Get periode pendaftaran that current time is between its startDate and endDate.", - "responses": { - "200": { - "description": "Period pendaftaran successfully retreived", - "schema": { - "$ref": "#/definitions/entity.PeriodPendaftaran" - } - } - } - } - }, - "/periode-pendaftaran-live": { - "get": { - "description": "Retrieves a period for pendaftaran.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Periode Pendaftaran" - ], - "summary": "Get periode pendaftaran that is live.", - "responses": { - "200": { - "description": "Periode pendaftaran successfully retreived", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.PeriodPendaftaran" - } - } - } - } - }, - "patch": { - "description": "Set Period to live.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Periode Pendaftaran" - ], - "summary": "Set Period to live", - "parameters": [ - { - "description": "Period Pendaftaran object", - "name": "batch", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/entity.PeriodPendaftaran" - } - } - ], - "responses": { - "200": { - "description": "Periode pendaftaran successfully updated to live", - "schema": { - "$ref": "#/definitions/entity.PeriodPendaftaran" - } - } - } - } - }, - "/status-mahasiswa": { - "get": { - "description": "Retrieves the status mahasiswa by NIM.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Status Mahasiswa" - ], - "summary": "Get status mahasiswa", - "parameters": [ - { - "type": "string", - "description": "NIM of the student", - "name": "nim", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/entity.StatusMahasiswa" + "$ref": "#/definitions/entity.DashboardData" } } } @@ -1551,6 +1192,20 @@ } } }, + "entity.BerkasLogBimbingan": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "link": { + "type": "string" + }, + "nama": { + "type": "string" + } + } + }, "entity.BimbinganLog": { "type": "object", "properties": { @@ -1577,241 +1232,212 @@ } } }, - "entity.EditJadwalSeminarRequest": { + "entity.DashboardData": { "type": "object", "properties": { - "ID": { - "type": "string" - }, - "IDBatch": { - "type": "string" - }, - "judul": { - "type": "string" + "list_pendaftaran": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.DataPendaftaranMahasiswa" + } }, - "namaDosbing": { - "type": "string" + "statistics": { + "$ref": "#/definitions/entity.StatusStatistics" + } + } + }, + "entity.DashboardMahasiswaRet": { + "type": "object", + "properties": { + "bimbingan": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.LogBimbingan" + } }, - "namaDosuji1": { - "type": "string" + "dosen_bimbingan": { + "$ref": "#/definitions/entity.DataDosenBimbingan" }, - "name": { - "type": "string" + "mahasiswa": { + "$ref": "#/definitions/entity.DataMahasiswa" }, - "nim": { - "type": "string" + "pendaftaran_ta": { + "$ref": "#/definitions/entity.StatusPendaftaranTA" }, - "ruang": { - "type": "string" + "seminar": { + "$ref": "#/definitions/entity.SidangSeminar" }, - "scheduledAt": { - "type": "string" + "sidang": { + "$ref": "#/definitions/entity.SidangSeminar" } } }, - "entity.EditJadwalSidangRequest": { + "entity.DataDosenBimbingan": { "type": "object", "properties": { - "ID": { + "email": { "type": "string" }, - "IDBatch": { - "type": "string" - }, - "judul": { + "id": { "type": "string" }, - "namaDosbing": { + "nama": { "type": "string" - }, - "namaDosuji1": { + } + } + }, + "entity.DataMahasiswa": { + "type": "object", + "properties": { + "email": { "type": "string" }, - "namaDosuji2": { + "id": { "type": "string" }, - "name": { + "nama": { "type": "string" }, "nim": { "type": "string" - }, - "ruang": { - "type": "string" - }, - "scheduledAt": { - "type": "string" } } }, - "entity.JadwalSeminar": { + "entity.DataPendaftaran": { "type": "object", "properties": { - "batchid": { - "type": "string" - }, - "createdAt": { - "description": "Use this if you want to override the gorm.Model's CreatedAt", - "type": "string" - }, - "id": { + "dosbing": { "type": "string" }, - "judul": { - "type": "string" - }, - "namaDosbing": { - "type": "string" - }, - "namaDosuji1": { + "id_pendaftaran": { "type": "string" }, - "name": { + "nama": { "type": "string" }, "nim": { "type": "string" }, - "ruang": { - "type": "string" - }, - "scheduledAt": { + "status": { "type": "string" } } }, - "entity.JadwalSeminarRequest": { + "entity.DataPendaftaranMahasiswa": { "type": "object", "properties": { - "IDBatch": { - "type": "string" - }, - "judul": { - "type": "string" - }, - "namaDosbing": { - "type": "string" - }, - "namaDosuji1": { + "judul_topik": { "type": "string" }, - "name": { + "nama": { "type": "string" }, "nim": { "type": "string" }, - "ruang": { - "type": "string" - }, - "scheduledAt": { - "type": "string" + "status": { + "type": "boolean" } } }, - "entity.JadwalSidang": { + "entity.DataTopik": { "type": "object", "properties": { - "batchid": { + "deskripsi": { "type": "string" }, - "createdAt": { - "description": "Use this if you want to override the gorm.Model's CreatedAt", + "id": { "type": "string" }, - "id": { + "id_pengaju": { "type": "string" }, "judul": { "type": "string" + } + } + }, + "entity.JumlahMahasiswaSwag": { + "type": "object", + "properties": { + "mahasiswa_if": { + "type": "integer" }, - "namaDosbing": { - "type": "string" + "mahasiswa_sti": { + "type": "integer" + } + } + }, + "entity.LogBimbingan": { + "type": "object", + "properties": { + "berkas": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.BerkasLogBimbingan" + } }, - "namaDosuji1": { + "id": { "type": "string" }, - "namaDosuji2": { + "laporan_kemajuan": { "type": "string" }, - "name": { + "next_bimbingan": { "type": "string" }, - "nim": { - "type": "string" + "status": { + "type": "boolean" }, - "ruang": { + "todo": { "type": "string" }, - "scheduledAt": { + "waktu_bimbingan": { "type": "string" } } }, - "entity.JadwalSidangRequest": { + "entity.MahasiswaBimbingan": { "type": "object", "properties": { - "IDBatch": { - "type": "string" - }, - "judul": { - "type": "string" - }, - "namaDosbing": { + "id": { "type": "string" }, - "namaDosuji1": { + "id_topik": { "type": "string" }, - "namaDosuji2": { + "judul_topik": { "type": "string" }, - "name": { + "nama": { "type": "string" }, "nim": { "type": "string" }, - "ruang": { - "type": "string" - }, - "scheduledAt": { + "status": { "type": "string" } } }, - "entity.JumlahMahasiswa": { - "type": "object", - "properties": { - "mahasiswa_if": { - "type": "integer" - }, - "mahasiswa_sti": { - "type": "integer" - } - } - }, - "entity.MahasiswaBimbingan": { + "entity.PendaftaranAddRequest": { "type": "object", "properties": { - "id": { + "idDosen": { "type": "string" }, - "nama": { + "idMahasiswa": { "type": "string" }, - "nim": { + "idPeriode": { "type": "string" }, - "status": { + "idTopik": { "type": "string" - }, - "topik": { - "$ref": "#/definitions/entity.TopikMahasiswaBingan" } } }, - "entity.Pendaftaran": { + "entity.PendaftaranSwag": { "type": "object", "properties": { "createdAt": { @@ -1849,24 +1475,7 @@ } } }, - "entity.PendaftaranAddRequest": { - "type": "object", - "properties": { - "idDosen": { - "type": "string" - }, - "idMahasiswa": { - "type": "string" - }, - "idPeriode": { - "type": "string" - }, - "idTopik": { - "type": "string" - } - } - }, - "entity.PeriodPendaftaran": { + "entity.PeriodPendaftaranSwag": { "type": "object", "properties": { "endDate": { @@ -1889,117 +1498,97 @@ } } }, - "entity.StatusBimbingan": { - "type": "object", - "properties": { - "jumlah_bimbingan": { - "type": "integer" - } - } - }, - "entity.StatusBimbinganMahasiswa": { + "entity.PeriodStats": { "type": "object", "properties": { - "butuh_bimbingan": { - "type": "integer" - }, - "lancar": { + "count_mahasiswa": { "type": "integer" }, - "terkendala": { - "type": "integer" + "period": { + "$ref": "#/definitions/src_module_dashboard_tim_tugas_entity.PeriodPendaftaran" } } }, - "entity.StatusMahasiswa": { + "entity.SidangSeminar": { "type": "object", "properties": { - "id_mahasiswa": { - "type": "string" + "ditolak": { + "type": "boolean" }, - "nama": { + "id": { "type": "string" }, - "nim": { + "jadwal_seminar": { "type": "string" }, - "status_bimbingan": { - "$ref": "#/definitions/entity.StatusBimbingan" + "lulus": { + "type": "boolean" }, - "status_pendaftaran": { - "$ref": "#/definitions/entity.StatusPendaftaran" + "ruangan": { + "type": "string" + } + } + }, + "entity.StatusBimbinganMahasiswa": { + "type": "object", + "properties": { + "butuh_bimbingan": { + "type": "integer" }, - "status_seminar": { - "$ref": "#/definitions/entity.StatusSeminar" + "lancar": { + "type": "integer" }, - "status_sidang": { - "$ref": "#/definitions/entity.StatusSidang" + "terkendala": { + "type": "integer" } } }, - "entity.StatusPendaftaran": { + "entity.StatusPendaftaranTA": { "type": "object", "properties": { - "dosen_pembimbing": { + "id": { "type": "string" }, "jadwal_interview": { "type": "string" }, - "judul": { - "type": "string" - }, - "pengesahan_dosen_pembimbing": { - "type": "boolean" - }, - "pengiriman_registrasi": { - "type": "string" - }, - "persetujuan_dosen_pembimbing": { + "jalur_pilihan": { "type": "string" }, "status": { - "type": "boolean" + "type": "string" }, "topik": { - "type": "string" - } - } - }, - "entity.StatusSeminar": { - "type": "object", - "properties": { - "dosen_penguji": { - "type": "string" + "$ref": "#/definitions/entity.DataTopik" }, - "jadwal_seminar": { + "waktu_keputusan": { "type": "string" }, - "ruangan": { + "waktu_pengiriman": { "type": "string" - }, - "status": { - "type": "boolean" } } }, - "entity.StatusSidang": { + "entity.StatusStatistics": { "type": "object", "properties": { - "dosen_penguji_1": { - "type": "string" + "diproses": { + "type": "integer" }, - "dosen_penguji_2": { - "type": "string" + "diterima": { + "type": "integer" }, - "jadwal_seminar": { - "type": "string" + "ditolak": { + "type": "integer" }, - "ruangan": { - "type": "string" + "persen_diproses": { + "type": "number" }, - "status": { - "type": "boolean" + "persen_diterima": { + "type": "number" + }, + "persen_ditolak": { + "type": "number" } } }, @@ -2020,7 +1609,7 @@ } } }, - "entity.Topik": { + "entity.TopikSwag": { "type": "object", "properties": { "deskripsi": { @@ -2043,35 +1632,47 @@ } } }, - "entity.TopikMahasiswaBingan": { + "entity.UpdatePendaftaranRequest": { "type": "object", "properties": { "id": { "type": "string" }, - "judul": { - "type": "string" + "status": { + "type": "boolean" } } }, - "entity.UpdatePendaftaranRequest": { + "entity.WaktuInterviewUpdateRequest": { "type": "object", "properties": { "id": { "type": "string" }, - "status": { - "type": "boolean" + "interviewAt": { + "type": "string" } } }, - "entity.WaktuInterviewUpdateRequest": { + "src_module_dashboard_tim_tugas_entity.PeriodPendaftaran": { "type": "object", "properties": { + "end_date": { + "type": "string" + }, "id": { "type": "string" }, - "interviewAt": { + "semester": { + "type": "string" + }, + "start_date": { + "type": "string" + }, + "status": { + "type": "boolean" + }, + "year": { "type": "string" } } diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 7d1bb1c1eea18d81c933288a7252126db316dcb8..de4b3c3faead559cc6f38b939770eb11248ac865 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -29,6 +29,15 @@ definitions: status: type: boolean type: object + entity.BerkasLogBimbingan: + properties: + id: + type: string + link: + type: string + nama: + type: string + type: object entity.BimbinganLog: properties: date: @@ -46,161 +55,140 @@ definitions: todo: type: string type: object - entity.EditJadwalSeminarRequest: + entity.DashboardData: properties: - ID: - type: string - IDBatch: - type: string - judul: - type: string - namaDosbing: - type: string - namaDosuji1: - type: string - name: - type: string - nim: - type: string - ruang: - type: string - scheduledAt: - type: string + list_pendaftaran: + items: + $ref: '#/definitions/entity.DataPendaftaranMahasiswa' + type: array + statistics: + $ref: '#/definitions/entity.StatusStatistics' type: object - entity.EditJadwalSidangRequest: + entity.DashboardMahasiswaRet: properties: - ID: - type: string - IDBatch: + bimbingan: + items: + $ref: '#/definitions/entity.LogBimbingan' + type: array + dosen_bimbingan: + $ref: '#/definitions/entity.DataDosenBimbingan' + mahasiswa: + $ref: '#/definitions/entity.DataMahasiswa' + pendaftaran_ta: + $ref: '#/definitions/entity.StatusPendaftaranTA' + seminar: + $ref: '#/definitions/entity.SidangSeminar' + sidang: + $ref: '#/definitions/entity.SidangSeminar' + type: object + entity.DataDosenBimbingan: + properties: + email: type: string - judul: + id: type: string - namaDosbing: + nama: type: string - namaDosuji1: + type: object + entity.DataMahasiswa: + properties: + email: type: string - namaDosuji2: + id: type: string - name: + nama: type: string nim: type: string - ruang: - type: string - scheduledAt: - type: string type: object - entity.JadwalSeminar: + entity.DataPendaftaran: properties: - batchid: - type: string - createdAt: - description: Use this if you want to override the gorm.Model's CreatedAt - type: string - id: - type: string - judul: - type: string - namaDosbing: + dosbing: type: string - namaDosuji1: + id_pendaftaran: type: string - name: + nama: type: string nim: type: string - ruang: - type: string - scheduledAt: + status: type: string type: object - entity.JadwalSeminarRequest: + entity.DataPendaftaranMahasiswa: properties: - IDBatch: - type: string - judul: - type: string - namaDosbing: + judul_topik: type: string - namaDosuji1: - type: string - name: + nama: type: string nim: type: string - ruang: - type: string - scheduledAt: - type: string + status: + type: boolean type: object - entity.JadwalSidang: + entity.DataTopik: properties: - batchid: - type: string - createdAt: - description: Use this if you want to override the gorm.Model's CreatedAt + deskripsi: type: string id: type: string - judul: - type: string - namaDosbing: + id_pengaju: type: string - namaDosuji1: + judul: type: string - namaDosuji2: + type: object + entity.JumlahMahasiswaSwag: + properties: + mahasiswa_if: + type: integer + mahasiswa_sti: + type: integer + type: object + entity.LogBimbingan: + properties: + berkas: + items: + $ref: '#/definitions/entity.BerkasLogBimbingan' + type: array + id: type: string - name: + laporan_kemajuan: type: string - nim: + next_bimbingan: type: string - ruang: + status: + type: boolean + todo: type: string - scheduledAt: + waktu_bimbingan: type: string type: object - entity.JadwalSidangRequest: + entity.MahasiswaBimbingan: properties: - IDBatch: - type: string - judul: - type: string - namaDosbing: + id: type: string - namaDosuji1: + id_topik: type: string - namaDosuji2: + judul_topik: type: string - name: + nama: type: string nim: type: string - ruang: - type: string - scheduledAt: + status: type: string type: object - entity.JumlahMahasiswa: - properties: - mahasiswa_if: - type: integer - mahasiswa_sti: - type: integer - type: object - entity.MahasiswaBimbingan: + entity.PendaftaranAddRequest: properties: - id: + idDosen: type: string - nama: + idMahasiswa: type: string - nim: + idPeriode: type: string - status: + idTopik: type: string - topik: - $ref: '#/definitions/entity.TopikMahasiswaBingan' type: object - entity.Pendaftaran: + entity.PendaftaranSwag: properties: createdAt: description: Use this if you want to override the gorm.Model's CreatedAt @@ -226,18 +214,7 @@ definitions: description: Use this if you want to override the gorm.Model's UpdatedAt type: string type: object - entity.PendaftaranAddRequest: - properties: - idDosen: - type: string - idMahasiswa: - type: string - idPeriode: - type: string - idTopik: - type: string - type: object - entity.PeriodPendaftaran: + entity.PeriodPendaftaranSwag: properties: endDate: type: string @@ -252,10 +229,25 @@ definitions: status: type: boolean type: object - entity.StatusBimbingan: + entity.PeriodStats: properties: - jumlah_bimbingan: + count_mahasiswa: type: integer + period: + $ref: '#/definitions/src_module_dashboard_tim_tugas_entity.PeriodPendaftaran' + type: object + entity.SidangSeminar: + properties: + ditolak: + type: boolean + id: + type: string + jadwal_seminar: + type: string + lulus: + type: boolean + ruangan: + type: string type: object entity.StatusBimbinganMahasiswa: properties: @@ -266,65 +258,37 @@ definitions: terkendala: type: integer type: object - entity.StatusMahasiswa: + entity.StatusPendaftaranTA: properties: - id_mahasiswa: - type: string - nama: - type: string - nim: - type: string - status_bimbingan: - $ref: '#/definitions/entity.StatusBimbingan' - status_pendaftaran: - $ref: '#/definitions/entity.StatusPendaftaran' - status_seminar: - $ref: '#/definitions/entity.StatusSeminar' - status_sidang: - $ref: '#/definitions/entity.StatusSidang' - type: object - entity.StatusPendaftaran: - properties: - dosen_pembimbing: + id: type: string jadwal_interview: type: string - judul: - type: string - pengesahan_dosen_pembimbing: - type: boolean - pengiriman_registrasi: - type: string - persetujuan_dosen_pembimbing: + jalur_pilihan: type: string status: - type: boolean - topik: - type: string - type: object - entity.StatusSeminar: - properties: - dosen_penguji: type: string - jadwal_seminar: + topik: + $ref: '#/definitions/entity.DataTopik' + waktu_keputusan: type: string - ruangan: + waktu_pengiriman: type: string - status: - type: boolean type: object - entity.StatusSidang: + entity.StatusStatistics: properties: - dosen_penguji_1: - type: string - dosen_penguji_2: - type: string - jadwal_seminar: - type: string - ruangan: - type: string - status: - type: boolean + diproses: + type: integer + diterima: + type: integer + ditolak: + type: integer + persen_diproses: + type: number + persen_diterima: + type: number + persen_ditolak: + type: number type: object entity.SystemLog: properties: @@ -337,7 +301,7 @@ definitions: id_pengguna: type: string type: object - entity.Topik: + entity.TopikSwag: properties: deskripsi: type: string @@ -352,13 +316,6 @@ definitions: periode: type: string type: object - entity.TopikMahasiswaBingan: - properties: - id: - type: string - judul: - type: string - type: object entity.UpdatePendaftaranRequest: properties: id: @@ -373,6 +330,21 @@ definitions: interviewAt: type: string type: object + src_module_dashboard_tim_tugas_entity.PeriodPendaftaran: + properties: + end_date: + type: string + id: + type: string + semester: + type: string + start_date: + type: string + status: + type: boolean + year: + type: string + type: object info: contact: {} paths: @@ -403,7 +375,7 @@ paths: description: OK schema: items: - $ref: '#/definitions/entity.Topik' + $ref: '#/definitions/entity.TopikSwag' type: array summary: Retrieve topics tags: @@ -419,7 +391,7 @@ paths: required: true schema: items: - $ref: '#/definitions/entity.Topik' + $ref: '#/definitions/entity.TopikSwag' type: array produces: - application/json @@ -428,7 +400,7 @@ paths: description: OK schema: items: - $ref: '#/definitions/entity.Topik' + $ref: '#/definitions/entity.TopikSwag' type: array summary: Add all new topics tags: @@ -464,7 +436,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/entity.Topik' + $ref: '#/definitions/entity.TopikSwag' summary: Retrieve a topic by ID tags: - Topics @@ -483,32 +455,31 @@ paths: name: topic required: true schema: - $ref: '#/definitions/entity.Topik' + $ref: '#/definitions/entity.TopikSwag' produces: - application/json responses: "200": description: OK schema: - $ref: '#/definitions/entity.Topik' + $ref: '#/definitions/entity.TopikSwag' summary: Update an existing topic tags: - Topics - /api/admin/dashboard/dosbing: + /api/dosbing/dashboard: get: consumes: - application/json description: Retrieves a list of mahasiswa supervised by a specific dosen for TA. parameters: - - description: Dosen ID + - description: Search in: query - name: id_dosen - required: true + name: search type: string - - description: Limit + - description: Size in: query - name: limit + name: size type: string - description: Offset in: query @@ -526,54 +497,53 @@ paths: summary: Get mahasiswa by dosen ID tags: - Dashboard Dosbing - /api/admin/dashboard/dosbing/statistic: + /api/dosbing/dashboard/statistic: get: consumes: - application/json description: Retrieves the amount of mahasiswa supervised by a specific dosen for TA. - parameters: - - description: Dosen ID - in: query - name: id_dosen - required: true - type: string produces: - application/json responses: "200": description: List mahasiswa successfully retreived schema: - items: - $ref: '#/definitions/entity.JumlahMahasiswa' - type: array - summary: Get amount of mahasiswa by dosen ID + $ref: '#/definitions/entity.JumlahMahasiswaSwag' + summary: Get amount of mahasiswa tags: - Dashboard Dosbing - /api/admin/dashboard/dosbing/status-bimbingan: + /api/dosbing/dashboard/status-bimbingan: get: consumes: - application/json description: Retrieves the amount of mahasiswa's bimbingan status supervised by a specific dosen for TA. - parameters: - - description: Dosen ID - in: query - name: id_dosen - required: true - type: string produces: - application/json responses: "200": description: List mahasiswa successfully retreived schema: - items: - $ref: '#/definitions/entity.StatusBimbinganMahasiswa' - type: array + $ref: '#/definitions/entity.StatusBimbinganMahasiswa' summary: Get amount of mahasiswa's bimbingan status by dosen ID tags: - Dashboard Dosbing + /api/mahasiswa/dashboard: + get: + consumes: + - application/json + description: Retrieves the status mahasiswa by NIM. + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/entity.DashboardMahasiswaRet' + summary: Get status mahasiswa + tags: + - Status Mahasiswa /batch-seminar: delete: consumes: @@ -824,276 +794,37 @@ paths: summary: Add a new bimbingan log tags: - BimbinganLog - /jadwal-seminar: - delete: - consumes: - - application/json - description: Deletes a jadwal seminar record by ID. - parameters: - - description: Edit Jadwal Seminar request body - in: body - name: body - required: true - schema: - $ref: '#/definitions/entity.EditJadwalSeminarRequest' - produces: - - application/json - responses: - "200": - description: Jadwal Seminar successfully deleted - schema: - $ref: '#/definitions/entity.JadwalSeminar' - summary: Delete jadwal seminar - tags: - - Jadwal Seminar - get: - consumes: - - application/json - description: Retrieves all jadwal seminar records. - produces: - - application/json - responses: - "200": - description: Jadwal Seminar successfully retreived - schema: - items: - $ref: '#/definitions/entity.JadwalSeminar' - type: array - summary: Get all jadwal seminar - tags: - - Jadwal Seminar - patch: - consumes: - - application/json - description: Edits an existing jadwal seminar record. - parameters: - - description: Edit Jadwal Seminar request body - in: body - name: body - required: true - schema: - $ref: '#/definitions/entity.EditJadwalSeminarRequest' - produces: - - application/json - responses: - "200": - description: Jadwal Seminar successfully edited - schema: - $ref: '#/definitions/entity.JadwalSeminar' - summary: Edit jadwal seminar - tags: - - Jadwal Seminar - post: - consumes: - - application/json - description: Adds a new jadwal seminar record. - parameters: - - description: Jadwal Seminar request body - in: body - name: body - required: true - schema: - $ref: '#/definitions/entity.JadwalSeminarRequest' - produces: - - application/json - responses: - "201": - description: Jadwal added successfully - schema: - $ref: '#/definitions/entity.JadwalSeminar' - summary: Add jadwal seminar - tags: - - Jadwal Seminar - /jadwal-seminar-batch: + /dashboard-tim: get: consumes: - application/json - description: Retrieves jadwal seminar records by batch ID. + description: Retrieves a list of mahasiswa that has already done pendaftaran parameters: - - description: Batch ID + - description: Dosen ID in: query - name: id_batch + name: id_dosen required: true type: string - produces: - - application/json - responses: - "200": - description: Jadwal Seminar successfully retreived - schema: - items: - $ref: '#/definitions/entity.JadwalSeminar' - type: array - summary: Get jadwal seminar by batch - tags: - - Jadwal Seminar - /jadwal-seminar-latest: - get: - consumes: - - application/json - description: Retrieves the latest jadwal seminar record. - produces: - - application/json - responses: - "200": - description: Latest Jadwal Seminar successfully retreived - schema: - $ref: '#/definitions/entity.JadwalSeminar' - summary: Get latest jadwal seminar - tags: - - Jadwal Seminar - /jadwal-seminar-range: - get: - consumes: - - application/json - description: Retrieves all jadwal seminar records within a date range. - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/entity.JadwalSeminar' - type: array - summary: Get all jadwal seminar within a date range - tags: - - Jadwal Seminar - /jadwal-sidang: - delete: - consumes: - - application/json - description: Deletes a jadwal sidang record by ID. - parameters: - - description: Edit Jadwal Sidang Request - in: body - name: request - required: true - schema: - $ref: '#/definitions/entity.EditJadwalSidangRequest' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/entity.JadwalSidang' - summary: Delete jadwal sidang - tags: - - Jadwal Sidang - get: - consumes: - - application/json - description: Retrieves all jadwal sidang records. - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/entity.JadwalSidang' - type: array - summary: Get all jadwal sidang - tags: - - Jadwal Sidang - patch: - consumes: - - application/json - description: Edits an existing jadwal sidang record. - parameters: - - description: Edit Jadwal Sidang Request - in: body - name: request - required: true - schema: - $ref: '#/definitions/entity.EditJadwalSidangRequest' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/entity.JadwalSidang' - summary: Edit jadwal sidang - tags: - - Jadwal Sidang - post: - consumes: - - application/json - description: Adds a new jadwal sidang record. - parameters: - - description: Jadwal Sidang Request - in: body - name: request - required: true - schema: - $ref: '#/definitions/entity.JadwalSidangRequest' - produces: - - application/json - responses: - "201": - description: Created - schema: - $ref: '#/definitions/entity.JadwalSidang' - summary: Add jadwal sidang - tags: - - Jadwal Sidang - /jadwal-sidang-batch: - get: - consumes: - - application/json - description: Retrieves jadwal sidang records by batch ID. - parameters: - - description: Batch ID + - description: Limit in: query - name: id_batch - required: true + name: limit + type: string + - description: Offset + in: query + name: offset type: string produces: - application/json responses: "200": - description: OK - schema: - items: - $ref: '#/definitions/entity.JadwalSidang' - type: array - summary: Get jadwal sidang by batch - tags: - - Jadwal Sidang - /jadwal-sidang-latest: - get: - consumes: - - application/json - description: Retrieves the latest jadwal sidang record. - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/entity.JadwalSidang' - summary: Get latest jadwal sidang - tags: - - Jadwal Sidang - /jadwal-sidang-range: - get: - consumes: - - application/json - description: Retrieves all jadwal sidang records within a date range. - produces: - - application/json - responses: - "200": - description: OK + description: List mahasiswa successfully retrieved schema: items: - $ref: '#/definitions/entity.JadwalSidang' + $ref: '#/definitions/entity.DataPendaftaran' type: array - summary: Get all jadwal sidang within a date range + summary: Get mahasiswa pendaftaran tags: - - Jadwal Sidang + - Dashboard Tim TA /pendaftaran: post: consumes: @@ -1112,7 +843,7 @@ paths: "201": description: Created schema: - $ref: '#/definitions/entity.Pendaftaran' + $ref: '#/definitions/entity.PendaftaranSwag' summary: Add pendaftaran tags: - Pendaftaran @@ -1155,7 +886,7 @@ paths: description: OK schema: items: - $ref: '#/definitions/entity.Pendaftaran' + $ref: '#/definitions/entity.PendaftaranSwag' type: array summary: Get pendaftaran by dosen ID tags: @@ -1178,7 +909,7 @@ paths: "201": description: Created schema: - $ref: '#/definitions/entity.Pendaftaran' + $ref: '#/definitions/entity.PendaftaranSwag' summary: Update pendaftaran interview time tags: - Pendaftaran @@ -1200,10 +931,25 @@ paths: "201": description: Created schema: - $ref: '#/definitions/entity.Pendaftaran' + $ref: '#/definitions/entity.PendaftaranSwag' summary: Update pendaftaran status tags: - Pendaftaran + /period-data: + get: + description: Retrieve period statistics (period data and number of mahasiswa + accepted) that is used for tim tugas dashboard + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/entity.PeriodStats' + summary: Retrieve dashboard period statistics (period data and number of mahasiswa + accepted) + tags: + - dashboard-tim-tugas /periode-pendaftaran: delete: consumes: @@ -1215,14 +961,14 @@ paths: name: batch required: true schema: - $ref: '#/definitions/entity.PeriodPendaftaran' + $ref: '#/definitions/entity.PeriodPendaftaranSwag' produces: - application/json responses: "200": description: Period pendaftaran successfully deleted schema: - $ref: '#/definitions/entity.PeriodPendaftaran' + $ref: '#/definitions/entity.PeriodPendaftaranSwag' summary: Delete period for pendaftaran tags: - Periode Pendaftaran @@ -1237,7 +983,7 @@ paths: description: Period pendaftaran successfully retreived schema: items: - $ref: '#/definitions/entity.PeriodPendaftaran' + $ref: '#/definitions/entity.PeriodPendaftaranSwag' type: array summary: Get period for pendaftaran tags: @@ -1252,14 +998,14 @@ paths: name: batch required: true schema: - $ref: '#/definitions/entity.PeriodPendaftaran' + $ref: '#/definitions/entity.PeriodPendaftaranSwag' produces: - application/json responses: "200": description: Period pendaftaran added successfully schema: - $ref: '#/definitions/entity.PeriodPendaftaran' + $ref: '#/definitions/entity.PeriodPendaftaranSwag' summary: Add period for pendaftaran tags: - Periode Pendaftaran @@ -1274,7 +1020,7 @@ paths: "200": description: Period pendaftaran successfully retreived schema: - $ref: '#/definitions/entity.PeriodPendaftaran' + $ref: '#/definitions/entity.PeriodPendaftaranSwag' summary: Get periode pendaftaran that current time is between its startDate and endDate. tags: @@ -1291,7 +1037,7 @@ paths: description: Periode pendaftaran successfully retreived schema: items: - $ref: '#/definitions/entity.PeriodPendaftaran' + $ref: '#/definitions/entity.PeriodPendaftaranSwag' type: array summary: Get periode pendaftaran that is live. tags: @@ -1306,38 +1052,30 @@ paths: name: batch required: true schema: - $ref: '#/definitions/entity.PeriodPendaftaran' + $ref: '#/definitions/entity.PeriodPendaftaranSwag' produces: - application/json responses: "200": description: Periode pendaftaran successfully updated to live schema: - $ref: '#/definitions/entity.PeriodPendaftaran' + $ref: '#/definitions/entity.PeriodPendaftaranSwag' summary: Set Period to live tags: - Periode Pendaftaran - /status-mahasiswa: + /statistics-dashboard-tim-tugas: get: - consumes: - - application/json - description: Retrieves the status mahasiswa by NIM. - parameters: - - description: NIM of the student - in: query - name: nim - required: true - type: string + description: Retrieve data and statistics that is used for tim tugas dashboard produces: - application/json responses: "200": description: OK schema: - $ref: '#/definitions/entity.StatusMahasiswa' - summary: Get status mahasiswa + $ref: '#/definitions/entity.DashboardData' + summary: Retrieve dashboard data and statistics tags: - - Status Mahasiswa + - dashboard-tim-tugas /system-logs: get: description: Retrieves a list of system logs. diff --git a/src/database/Database.go b/src/database/Database.go index 7f12516c088b22df52c77aa41bad3d69756fb47d..7f52689ac43cfe81b620b77c121bc78d764e572b 100644 --- a/src/database/Database.go +++ b/src/database/Database.go @@ -31,6 +31,21 @@ func initialize() { panic("failed to connect database") } + // Create enum for PendaftaranTA.Status + dbInstance.Exec(` + DO $$ + BEGIN + IF NOT EXISTS(SELECT 1 FROM pg_type WHERE typname = 'pendaftaran_ta_status_enum') THEN + CREATE TYPE pendaftaran_ta_status_enum AS ENUM ( + 'NOT_ASSIGNED', + 'INTERVIEW', + 'APPROVED', + 'REJECTED' + ); + END IF; + END $$; + `) + dbInstance.AutoMigrate(&models.Pengguna{}) dbInstance.AutoMigrate(&models.Topik{}) dbInstance.AutoMigrate(&models.PendaftaranTA{}) diff --git a/src/handler/handler.go b/src/handler/handler.go index ff343af1d4b27194d89ceeaa32410cf6a240fc02..66939c2f2fd73055acca2584a75504c4306a5623 100644 --- a/src/handler/handler.go +++ b/src/handler/handler.go @@ -10,6 +10,8 @@ import ( bimbinganLogTransport "gitlab.informatika.org/k-01-11/graduit-be/src/module/bimbingan_log/transport" dashboardDosbingConfig "gitlab.informatika.org/k-01-11/graduit-be/src/module/dashboard_dosbing/config" dashboardDosbingTrasport "gitlab.informatika.org/k-01-11/graduit-be/src/module/dashboard_dosbing/transport" + dashboardMahasiswaConfig "gitlab.informatika.org/k-01-11/graduit-be/src/module/dashboard_mahasiswa/config" + dashboardMahasiswaTransport "gitlab.informatika.org/k-01-11/graduit-be/src/module/dashboard_mahasiswa/transport" dashboardTimTugasConfig "gitlab.informatika.org/k-01-11/graduit-be/src/module/dashboard_tim_tugas/config" dashboardTimTugasTransport "gitlab.informatika.org/k-01-11/graduit-be/src/module/dashboard_tim_tugas/transport" pendaftaranConfig "gitlab.informatika.org/k-01-11/graduit-be/src/module/pendaftaran/config" @@ -20,8 +22,6 @@ import ( periodePendaftaranTransport "gitlab.informatika.org/k-01-11/graduit-be/src/module/period_pendaftaran/transport" schedulingConfig "gitlab.informatika.org/k-01-11/graduit-be/src/module/scheduling/config" schedulingTransport "gitlab.informatika.org/k-01-11/graduit-be/src/module/scheduling/transport" - statusMahasiswaConfig "gitlab.informatika.org/k-01-11/graduit-be/src/module/status_mahasiswa/config" - statusMahasiswaTransport "gitlab.informatika.org/k-01-11/graduit-be/src/module/status_mahasiswa/transport" systemLogConfig "gitlab.informatika.org/k-01-11/graduit-be/src/module/system_log/config" systemLogTransport "gitlab.informatika.org/k-01-11/graduit-be/src/module/system_log/transport" topicAllocationConfig "gitlab.informatika.org/k-01-11/graduit-be/src/module/topic_allocation/config" @@ -36,8 +36,8 @@ type Service struct { BatchSeminarHandler *batchSeminarTransport.AdminBatchSeminarHandler BatchSidangHandler *batchSidangTransport.AdminBatchSidangHandler AdminPendaftaranSidSemHandler *pendaftaranSidSemTransport.AdminPendaftaranSidSemHandler - AdminStatusMahasiswaHandler *statusMahasiswaTransport.AdminStatusMahasiswaHandler - AdminDashboardDosbingHandler *dashboardDosbingTrasport.AdminDashboardDosbingHandler + MahasiswaDashboardHandler *dashboardMahasiswaTransport.MahasiswaDashboardHandler + DosbingDashboardHandler *dashboardDosbingTrasport.DosbingDashboardHandler AdminPendaftaranHandler *pendaftaranTransport.AdminPendaftaranHandler AdminPeriodePendaftaranHandler *periodePendaftaranTransport.AdminPeriodPendaftaranHandler MahasiswaBimbinganLogHandler *bimbinganLogTransport.MahasiswaBimbinganLogHandler @@ -76,11 +76,11 @@ func MakeHandler() *Service { DBWrite: dbWrite, DBRead: dbRead, }) - AdminStatusMahasiswaHandler := statusMahasiswaTransport.NewAdminStatusMahasiswaHandler(statusMahasiswaConfig.StatusMahasiswaTransportConfig{ + MahasiswaDashboardHandler := dashboardMahasiswaTransport.NewMahasiswaDashboardHandler(dashboardMahasiswaConfig.DashboardMahasiswaTransportConfig{ DBWrite: dbWrite, DBRead: dbRead, }) - AdminDashboardDosbingHandler := dashboardDosbingTrasport.NewAdminDashboardDosbingHandler(dashboardDosbingConfig.DashboardDosbingTransportConfig{ + DosbingDashboardHandler := dashboardDosbingTrasport.NewDosbingDashboardHandler(dashboardDosbingConfig.DashboardDosbingTransportConfig{ DBWrite: dbWrite, DBRead: dbRead, }) @@ -133,8 +133,8 @@ func MakeHandler() *Service { BatchSeminarHandler: AdminBatchSeminarHandler, BatchSidangHandler: AdminBatchSidangHandler, AdminPendaftaranSidSemHandler: AdminPendaftaranSidSemHandler, - AdminStatusMahasiswaHandler: AdminStatusMahasiswaHandler, - AdminDashboardDosbingHandler: AdminDashboardDosbingHandler, + MahasiswaDashboardHandler: MahasiswaDashboardHandler, + DosbingDashboardHandler: DosbingDashboardHandler, AdminPendaftaranHandler: AdminPendaftaranHandler, AdminPeriodePendaftaranHandler: AdminPeriodPendaftaranHandler, MahasiswaBimbinganLogHandler: MahasiwaBimbinganLogHandler, diff --git a/src/handler/server.go b/src/handler/server.go index 4b34c201df6715067b56804f09271fb26587a591..0e4a1f73b8a243465f2b5783df5f0f248c698638 100644 --- a/src/handler/server.go +++ b/src/handler/server.go @@ -42,8 +42,6 @@ func (s *Service) InitializeRoutes() *echo.Echo { s.AdminTopicAllocationHandler.MountAdmin(adminGroup) s.BatchSeminarHandler.MountAdmin(adminGroup) s.BatchSidangHandler.MountAdmin(adminGroup) - s.AdminStatusMahasiswaHandler.MountAdmin(adminGroup) - s.AdminDashboardDosbingHandler.MountAdmin(adminGroup) s.AdminPendaftaranSidSemHandler.MountAdmin(adminGroup) s.AdminPendaftaranHandler.MountAdmin(adminGroup) s.AdminPeriodePendaftaranHandler.MountAdmin(adminGroup) @@ -53,10 +51,12 @@ func (s *Service) InitializeRoutes() *echo.Echo { mahasiswaGroup.Use(middleware.Validator("S1_MAHASISWA")) s.MahasiswaBimbinganLogHandler.MountMahasiswa(mahasiswaGroup) s.MahasiswaPendaftaranSidSemHandler.MountMahasiswa(mahasiswaGroup) + s.MahasiswaDashboardHandler.MountMahasiswa(mahasiswaGroup) dosbingGroup := e.Group("api/dosbing") dosbingGroup.Use(middleware.Validator("S1_PEMBIMBING")) s.DosbingBimbinganLogHandler.MountDosbing(dosbingGroup) + s.DosbingDashboardHandler.MountDosbing(dosbingGroup) TIMTAGroup := e.Group("api/TIMTA") TIMTAGroup.Use(middleware.Validator("S1_TIM_TA")) diff --git a/src/models/PendaftaranTA.go b/src/models/PendaftaranTA.go index 157399253817c3a6cf486ae5d00eeecffa4c5970..044aea676aaead1b301cad5b25d9c1ffc985503a 100644 --- a/src/models/PendaftaranTA.go +++ b/src/models/PendaftaranTA.go @@ -2,19 +2,28 @@ package models import "time" +type pendaftaran_ta_status_enum string + +const ( + NOT_ASSIGNED pendaftaran_ta_status_enum = "NOT_ASSIGNED" + INTERVIEW pendaftaran_ta_status_enum = "INTERVIEW" + APPROVED pendaftaran_ta_status_enum = "APPROVED" + REJECTED pendaftaran_ta_status_enum = "REJECTED" +) + type PendaftaranTA struct { - ID string `gorm:"type:uuid;primaryKey;default:gen_random_uuid();unique"` // UUID as a string - IdTopik string `gorm:"type:uuid"` - IdMahasiswa string `gorm:"type:uuid"` - IdDosen string `gorm:"type:uuid"` - Status bool `gorm:"default:null"` - JalurPilihan string `gorm:"default:null"` - InterviewAt time.Time `gorm:"default:null"` - DecidedAt time.Time `gorm:"default:null"` - WaktuPengiriman time.Time `gorm:"autoCreateTime"` - Dosen Pengguna `gorm:"foreignKey:IdDosen;references:ID"` - Mahasiswa Pengguna `gorm:"foreignKey:IdMahasiswa;references:ID"` - Topik Topik `gorm:"foreignKey:IdTopik;references:ID"` + ID string `gorm:"type:uuid;primaryKey;default:gen_random_uuid();unique"` // UUID as a string + IdTopik string `gorm:"type:uuid"` + IdMahasiswa string `gorm:"type:uuid"` + IdDosen string `gorm:"type:uuid"` + Status pendaftaran_ta_status_enum `gorm:"type:pendaftaran_ta_status_enum;default:NOT_ASSIGNED"` + JalurPilihan string `gorm:"default:null"` + InterviewAt time.Time `gorm:"default:null"` + DecidedAt time.Time `gorm:"default:null"` + WaktuPengiriman time.Time `gorm:"autoCreateTime"` + Dosen Pengguna `gorm:"foreignKey:IdDosen;references:ID"` + Mahasiswa Pengguna `gorm:"foreignKey:IdMahasiswa;references:ID"` + Topik Topik `gorm:"foreignKey:IdTopik;references:ID"` } func (PendaftaranTA) TableName() string { diff --git a/src/module/dashboard_dosbing/entity/dashboard_dosbing.go b/src/module/dashboard_dosbing/entity/dashboard_dosbing.go index dcd16e83d0d106fd776a3c26469d2bb3bd231693..ce5a06b4b4c63dd7c2489e8dfdb0e96af1c82838 100644 --- a/src/module/dashboard_dosbing/entity/dashboard_dosbing.go +++ b/src/module/dashboard_dosbing/entity/dashboard_dosbing.go @@ -12,14 +12,10 @@ type StatusBimbinganMahasiswa struct { } type MahasiswaBimbingan struct { - IdMahasiswa string `json:"id"` - Nama string `json:"nama"` - NIM string `json:"nim"` - Status string `json:"status"` - Topik TopikMahasiswaBingan `json:"topik"` -} - -type TopikMahasiswaBingan struct { - Id string `json:"id"` - Judul string `json:"judul"` + IdMahasiswa string `json:"id"` + Nama string `json:"nama"` + NIM string `json:"nim"` + Status string `json:"status"` + IdTopik string `json:"id_topik"` + JudulTopik string `json:"judul_topik"` } diff --git a/src/module/dashboard_dosbing/internal/repository/dashboard_dosbing.go b/src/module/dashboard_dosbing/internal/repository/dashboard_dosbing.go index 16ddf43cf23a60b37c56f2c63ae7683efdbe0f23..424cf4f64830361e05c6897ebd7ff861b685dc5f 100644 --- a/src/module/dashboard_dosbing/internal/repository/dashboard_dosbing.go +++ b/src/module/dashboard_dosbing/internal/repository/dashboard_dosbing.go @@ -22,60 +22,49 @@ func NewDashboardDosbingRepository(dbWrite *gorm.DB, dbRead *gorm.DB) *Dashboard } } -func (repo *DashboardDosbingRepo) GetMahasiswaByDosenId(idDosen string, offset, size int) (output []entity.MahasiswaBimbingan, err error) { +func (repo *DashboardDosbingRepo) GetMahasiswaByDosenId(idDosen string, offset, size int, search string) (output []entity.MahasiswaBimbingan, err error) { + var result *gorm.DB + var mahasiswaBimbingan []entity.MahasiswaBimbingan - var dosen models.Pengguna - var mahasiswa models.Pengguna - var topik models.Topik - var pendaftaran []models.PendaftaranTA var logBimbingan models.BimbinganLogs - var statusBimbingan string - result := repo.DBRead.Where("id = ?", idDosen).First(&dosen) - if result.Error != nil { - return nil, errors.New("dosen tidak ditemukan") - } + result = repo.DBRead.Table("dosen_bimbingan"). + Select(`pengguna.id AS id_mahasiswa, + pengguna.nama AS nama, + pengguna.nim AS nim, + topik.judul AS judul_topik, + topik.id AS id_topik`). + Joins("JOIN pendaftaran_ta ON dosen_bimbingan.pendaftaran_id = pendaftaran_ta.id"). + Joins("JOIN pengguna ON pendaftaran_ta.id_mahasiswa = pengguna.id"). + Joins("JOIN topik ON pendaftaran_ta.id_topik = topik.id"). + Where("dosen_bimbingan.dosen_id = ?", idDosen). + Where(" (pengguna.nama ILIKE '%' || ? || '%' OR pengguna.nim ILIKE '%' || ? || '%') ", search, search). + Limit(size). + Offset(offset). + Scan(&mahasiswaBimbingan) - result = repo.DBRead.Where("id_dosen = ? AND status = TRUE", idDosen).Limit(size).Offset(offset).Find(&pendaftaran) if result.Error != nil { - return nil, errors.New("tidak ada mahasiswa bimbingan") + return nil, result.Error } - for _, pendaftar := range pendaftaran { - - repo.DBRead.Where("id = ?", pendaftar.IdMahasiswa).First(&mahasiswa) - repo.DBRead.Where("id = ?", pendaftar.IdTopik).First(&topik) - result = repo.DBRead.Where("id_mahasiswa = ?", pendaftar.IdMahasiswa).Order("date desc").First(&logBimbingan) + // Assign status + for i := range mahasiswaBimbingan { + result := repo.DBRead.Where("id_mahasiswa = ?", mahasiswaBimbingan[i].IdMahasiswa).Order("date desc").First(&logBimbingan) if result.Error != nil { - statusBimbingan = "TERKENDALA" + mahasiswaBimbingan[i].Status = "TERKENDALA" } else { currentDate := time.Now() diff := currentDate.Sub(logBimbingan.Date).Hours() / 24 if diff <= 30 { - statusBimbingan = "LANCAR" + mahasiswaBimbingan[i].Status = "LANCAR" } else if diff > 30 && diff < 90 { - statusBimbingan = "BUTUH BIMBINGAN" + mahasiswaBimbingan[i].Status = "BUTUH BIMBINGAN" } else if diff >= 90 { - statusBimbingan = "TERKENDALA" + mahasiswaBimbingan[i].Status = "TERKENDALA" } } - - topik := entity.TopikMahasiswaBingan{ - Judul: topik.Judul, - Id: topik.ID, - } - - bimbingan := entity.MahasiswaBimbingan{ - IdMahasiswa: mahasiswa.ID, - Nama: mahasiswa.Nama, - NIM: mahasiswa.NIM, - Topik: topik, - Status: statusBimbingan, - } - - mahasiswaBimbingan = append(mahasiswaBimbingan, bimbingan) } return mahasiswaBimbingan, nil @@ -83,23 +72,20 @@ func (repo *DashboardDosbingRepo) GetMahasiswaByDosenId(idDosen string, offset, } func (repo *DashboardDosbingRepo) GetAmountMahasiswaByDosenId(idDosen string) (output []entity.JumlahMahasiswa, err error) { + var result *gorm.DB + var jumlahMahasiswa entity.JumlahMahasiswa - var dosen models.Pengguna var mahasiswaIF int64 var mahasiswaSTI int64 - result := repo.DBRead.Where("id = ?", idDosen).First(&dosen) - if result.Error != nil { - return nil, errors.New("dosen tidak ditemukan") - } - // Mahasiswa IF - result = repo.DBRead.Model(&models.PendaftaranTA{}). - Joins("JOIN pengguna m ON pendaftarans.id_mahasiswa = m.id"). - Where("pendaftarans.id_dosen = ? AND m.nim LIKE ?", idDosen, "135%"). + result = repo.DBRead.Table("dosen_bimbingan"). + Joins("JOIN pendaftaran_ta ON dosen_bimbingan.pendaftaran_id = pendaftaran_ta.id"). + Joins("JOIN pengguna ON pendaftaran_ta.id_mahasiswa = pengguna.id"). + Where("dosen_bimbingan.dosen_id = ?", idDosen). + Where("pengguna.nim LIKE '135%' "). Count(&mahasiswaIF) - // result = repo.DBRead.Where("id = ? AND NIM LIKE ?", dosen.Id, "135%").Find(&mahasiswa) if result.Error != nil { fmt.Println(result) mahasiswaIF = 0 @@ -107,11 +93,12 @@ func (repo *DashboardDosbingRepo) GetAmountMahasiswaByDosenId(idDosen string) (o jumlahMahasiswa.MahasiswaIF = int(mahasiswaIF) // Mahasiswa STI - result = repo.DBRead.Model(&models.PendaftaranTA{}). - Joins("JOIN pengguna m ON pendaftarans.id_mahasiswa = m.id"). - Where("pendaftarans.id_dosen = ? AND m.nim LIKE ?", idDosen, "182%"). + result = repo.DBRead.Table("dosen_bimbingan"). + Joins("JOIN pendaftaran_ta ON dosen_bimbingan.pendaftaran_id = pendaftaran_ta.id"). + Joins("JOIN pengguna ON pendaftaran_ta.id_mahasiswa = pengguna.id"). + Where("dosen_bimbingan.dosen_id = ?", idDosen). + Where("pengguna.nim LIKE '182%' "). Count(&mahasiswaSTI) - // result = repo.DBRead.Where("id_dosen = ? AND NIM LIKE ?", dosen.Id, "182%").Find(&mahasiswa) if result.Error != nil { fmt.Println(result) mahasiswaSTI = 0 @@ -123,27 +110,27 @@ func (repo *DashboardDosbingRepo) GetAmountMahasiswaByDosenId(idDosen string) (o } func (repo *DashboardDosbingRepo) GetAmountStatusBimbinganMahasiswaByDosenId(idDosen string) (output []entity.StatusBimbinganMahasiswa, err error) { + var result *gorm.DB + var statusBimbinganMahasiswa entity.StatusBimbinganMahasiswa + var mahasiswaBimbingan []entity.MahasiswaBimbingan - var dosen models.Pengguna - var mahasiswa models.Pengguna - var pendaftaran []models.PendaftaranTA var logBimbingan models.BimbinganLogs - result := repo.DBRead.Where("id = ?", idDosen).First(&dosen) - if result.Error != nil { - return nil, errors.New("dosen tidak ditemukan") - } + result = repo.DBRead.Table("dosen_bimbingan"). + Select(`pengguna.id AS id_mahasiswa`). + Joins("JOIN pendaftaran_ta ON dosen_bimbingan.pendaftaran_id = pendaftaran_ta.id"). + Joins("JOIN pengguna ON pendaftaran_ta.id_mahasiswa = pengguna.id"). + Where("dosen_bimbingan.dosen_id = ?", idDosen). + Scan(&mahasiswaBimbingan) - result = repo.DBRead.Where("id_dosen = ? AND status = TRUE", idDosen).Find(&pendaftaran) if result.Error != nil { return nil, errors.New("tidak ada mahasiswa bimbingan") } - for _, pendaftar := range pendaftaran { + for _, mhs := range mahasiswaBimbingan { - repo.DBRead.Where("id = ?", pendaftar.IdMahasiswa).First(&mahasiswa) - result = repo.DBRead.Where("id_mahasiswa = ?", pendaftar.IdMahasiswa).Order("date desc").First(&logBimbingan) + result = repo.DBRead.Where("id_mahasiswa = ?", mhs.IdMahasiswa).Order("date desc").First(&logBimbingan) if result.Error != nil { statusBimbinganMahasiswa.Terkendala++ diff --git a/src/module/dashboard_dosbing/internal/usecase/dashboard_dosbing.go b/src/module/dashboard_dosbing/internal/usecase/dashboard_dosbing.go index 40296971c81582b8ffc2edb6368ab20a84b04a57..064a0f1c19cd74eac87982fc7c57dc54c0091729 100644 --- a/src/module/dashboard_dosbing/internal/usecase/dashboard_dosbing.go +++ b/src/module/dashboard_dosbing/internal/usecase/dashboard_dosbing.go @@ -3,7 +3,7 @@ package usecase import "gitlab.informatika.org/k-01-11/graduit-be/src/module/dashboard_dosbing/entity" type DashboardDosbingUseCase interface { - GetMahasiswaByDosenId(idDosen string, offset, size int) (output []entity.MahasiswaBimbingan, err error) + GetMahasiswaByDosenId(idDosen string, offset, size int, search string) (output []entity.MahasiswaBimbingan, err error) GetAmountMahasiswaByDosenId(idDosen string) (output []entity.JumlahMahasiswa, err error) GetAmountStatusBimbinganMahasiswaByDosenId(idDosen string) (output []entity.StatusBimbinganMahasiswa, err error) } @@ -18,8 +18,8 @@ func NewDashboardDosbingUsecase(dashboardDosbingRepo DashboardDosbingRepository) } } -func (uc *DashboardDosbingUc) GetMahasiswaByDosenId(idDosen string, offset, size int) (output []entity.MahasiswaBimbingan, err error) { - listMahasiswa, err := uc.dashboardDosbingRepo.GetMahasiswaByDosenId(idDosen, offset, size) +func (uc *DashboardDosbingUc) GetMahasiswaByDosenId(idDosen string, offset, size int, search string) (output []entity.MahasiswaBimbingan, err error) { + listMahasiswa, err := uc.dashboardDosbingRepo.GetMahasiswaByDosenId(idDosen, offset, size, search) if err != nil { return listMahasiswa, err diff --git a/src/module/dashboard_dosbing/internal/usecase/repository.go b/src/module/dashboard_dosbing/internal/usecase/repository.go index 0d7f821934403bc375cc92a598c3b0a4a8f1af03..bccd455aabe4445b5973dc61c7303c77162b09c1 100644 --- a/src/module/dashboard_dosbing/internal/usecase/repository.go +++ b/src/module/dashboard_dosbing/internal/usecase/repository.go @@ -3,7 +3,7 @@ package usecase import "gitlab.informatika.org/k-01-11/graduit-be/src/module/dashboard_dosbing/entity" type DashboardDosbingRepository interface { - GetMahasiswaByDosenId(idDosen string, offset, size int) (output []entity.MahasiswaBimbingan, err error) + GetMahasiswaByDosenId(idDosen string, offset, size int, search string) (output []entity.MahasiswaBimbingan, err error) GetAmountMahasiswaByDosenId(idDosen string) (output []entity.JumlahMahasiswa, err error) GetAmountStatusBimbinganMahasiswaByDosenId(idDosen string) (output []entity.StatusBimbinganMahasiswa, err error) } diff --git a/src/module/dashboard_dosbing/transport/admin_handler.go b/src/module/dashboard_dosbing/transport/dosbing_handler.go similarity index 59% rename from src/module/dashboard_dosbing/transport/admin_handler.go rename to src/module/dashboard_dosbing/transport/dosbing_handler.go index fec277d978e9c413068b67140a77393bb7da7c02..3473f406adf86200c9ecc3d372cf5b55c0297601 100644 --- a/src/module/dashboard_dosbing/transport/admin_handler.go +++ b/src/module/dashboard_dosbing/transport/dosbing_handler.go @@ -11,40 +11,47 @@ import ( "gitlab.informatika.org/k-01-11/graduit-be/src/utils" ) -type AdminDashboardDosbingHandler struct { +type DosbingDashboardHandler struct { dashboardDosbingUseCase usecase.DashboardDosbingUseCase } -func NewAdminDashboardDosbingHandler(cfg config.DashboardDosbingTransportConfig) *AdminDashboardDosbingHandler { +func NewDosbingDashboardHandler(cfg config.DashboardDosbingTransportConfig) *DosbingDashboardHandler { dashboardDosbingRepository := repository.NewDashboardDosbingRepository(cfg.DBWrite, cfg.DBRead) dashboardDosbingUsecase := usecase.NewDashboardDosbingUsecase(dashboardDosbingRepository) - return &AdminDashboardDosbingHandler{ + return &DosbingDashboardHandler{ dashboardDosbingUseCase: dashboardDosbingUsecase, } } -func (t *AdminDashboardDosbingHandler) MountAdmin(group *echo.Group) { - group.GET("/dashboard/dosbing", t.GetMahasiswaByDosenId) - group.GET("/dashboard/dosbing/statistic", t.GetAmountMahasiswaByDosenId) - group.GET("/dashboard/dosbing/status-bimbingan", t.GetAmountStatusBimbinganMahasiswaByDosenId) +func (t *DosbingDashboardHandler) MountDosbing(group *echo.Group) { + group.GET("/dashboard", t.GetMahasiswa) + group.GET("/dashboard/statistic", t.GetAmountMahasiswa) + group.GET("/dashboard/status-bimbingan", t.GetAmountStatusBimbinganMahasiswa) } -// GetMahasiswaByDosenId retrieves a list of mahasiswa supervised by a specific dosen for TA. +// GetMahasiswa retrieves a list of mahasiswa supervised by a specific dosen for TA. // @Summary Get mahasiswa by dosen ID // @Description Retrieves a list of mahasiswa supervised by a specific dosen for TA. // @Tags Dashboard Dosbing // @Accept json // @Produce json -// @Param id_dosen query string true "Dosen ID" -// @Param limit query string false "Limit" +// @Param search query string false "Search" +// @Param size query string false "Size" // @Param offset query string false "Offset" // @Success 200 {object} []entity.MahasiswaBimbingan "List mahasiswa successfully retrieved" -// @Router /api/admin/dashboard/dosbing [get] -func (t *AdminDashboardDosbingHandler) GetMahasiswaByDosenId(c echo.Context) error { - idDosen := c.QueryParam("id_dosen") - sizeStr := c.QueryParam("limit") +// @Router /api/dosbing/dashboard [get] +func (t *DosbingDashboardHandler) GetMahasiswa(c echo.Context) error { + payload, ok := c.Get("authPayload").(utils.Payload) + + if !ok { + return c.JSON(http.StatusInternalServerError, utils.ResponseDetailOutput(false, http.StatusInternalServerError, "Error parsing id", nil)) + } + + idDosen := payload.ID + sizeStr := c.QueryParam("size") offsetStr := c.QueryParam("offset") + search := c.QueryParam("search") if idDosen == "" { return c.JSON(http.StatusInternalServerError, utils.ResponseDetailOutput(false, http.StatusInternalServerError, "insert id_dosen", nil)) @@ -62,7 +69,7 @@ func (t *AdminDashboardDosbingHandler) GetMahasiswaByDosenId(c echo.Context) err offset = 0 } - listMahasiswa, err := t.dashboardDosbingUseCase.GetMahasiswaByDosenId(idDosen, offset, size) + listMahasiswa, err := t.dashboardDosbingUseCase.GetMahasiswaByDosenId(idDosen, offset, size, search) if err != nil { return c.JSON(http.StatusBadRequest, utils.ResponseDetailOutput(false, http.StatusBadRequest, err.Error(), nil)) } @@ -71,17 +78,22 @@ func (t *AdminDashboardDosbingHandler) GetMahasiswaByDosenId(c echo.Context) err } -// GetAmountMahasiswaByDosenId retrieves the amount of mahasiswa supervised by a specific dosen for TA. -// @Summary Get amount of mahasiswa by dosen ID +// GetAmountMahasiswa retrieves the amount of mahasiswa supervised by a specific dosen for TA. +// @Summary Get amount of mahasiswa // @Description Retrieves the amount of mahasiswa supervised by a specific dosen for TA. // @Tags Dashboard Dosbing // @Accept json // @Produce json -// @Param id_dosen query string true "Dosen ID" -// @Success 200 {object} []entity.JumlahMahasiswa "List mahasiswa successfully retreived" -// @Router /api/admin/dashboard/dosbing/statistic [get] -func (t *AdminDashboardDosbingHandler) GetAmountMahasiswaByDosenId(c echo.Context) error { - idDosen := c.QueryParam("id_dosen") +// @Success 200 {object} entity.JumlahMahasiswa "List mahasiswa successfully retreived" +// @Router /api/dosbing/dashboard/statistic [get] +func (t *DosbingDashboardHandler) GetAmountMahasiswa(c echo.Context) error { + payload, ok := c.Get("authPayload").(utils.Payload) + + if !ok { + return c.JSON(http.StatusInternalServerError, utils.ResponseDetailOutput(false, http.StatusInternalServerError, "Error parsing id", nil)) + } + + idDosen := payload.ID if idDosen == "" { return c.JSON(http.StatusInternalServerError, utils.ResponseDetailOutput(false, http.StatusInternalServerError, "insert id_dosen", nil)) @@ -96,17 +108,22 @@ func (t *AdminDashboardDosbingHandler) GetAmountMahasiswaByDosenId(c echo.Contex } -// GetAmountStatusBimbinganMahasiswaByDosenId retrieves the amount of mahasiswa's bimbingan status supervised by a specific dosen for TA. +// GetAmountStatusBimbinganMahasiswa retrieves the amount of mahasiswa's bimbingan status supervised by a specific dosen for TA. // @Summary Get amount of mahasiswa's bimbingan status by dosen ID // @Description Retrieves the amount of mahasiswa's bimbingan status supervised by a specific dosen for TA. // @Tags Dashboard Dosbing // @Accept json // @Produce json -// @Param id_dosen query string true "Dosen ID" -// @Success 200 {object} []entity.StatusBimbinganMahasiswa "List mahasiswa successfully retreived" -// @Router /api/admin/dashboard/dosbing/status-bimbingan [get] -func (t *AdminDashboardDosbingHandler) GetAmountStatusBimbinganMahasiswaByDosenId(c echo.Context) error { - idDosen := c.QueryParam("id_dosen") +// @Success 200 {object} entity.StatusBimbinganMahasiswa "List mahasiswa successfully retreived" +// @Router /api/dosbing/dashboard/status-bimbingan [get] +func (t *DosbingDashboardHandler) GetAmountStatusBimbinganMahasiswa(c echo.Context) error { + payload, ok := c.Get("authPayload").(utils.Payload) + + if !ok { + return c.JSON(http.StatusInternalServerError, utils.ResponseDetailOutput(false, http.StatusInternalServerError, "Error parsing id", nil)) + } + + idDosen := payload.ID if idDosen == "" { return c.JSON(http.StatusInternalServerError, utils.ResponseDetailOutput(false, http.StatusInternalServerError, "insert id_dosen", nil)) diff --git a/src/module/status_mahasiswa/config/common.go b/src/module/dashboard_mahasiswa/config/common.go similarity index 61% rename from src/module/status_mahasiswa/config/common.go rename to src/module/dashboard_mahasiswa/config/common.go index d5f107e423837041d9f8ed6585da299a754e5f8c..c6a5ffcf4c6121fa965ade86513ff026c8212d62 100644 --- a/src/module/status_mahasiswa/config/common.go +++ b/src/module/dashboard_mahasiswa/config/common.go @@ -2,7 +2,7 @@ package config import "gorm.io/gorm" -type StatusMahasiswaTransportConfig struct { +type DashboardMahasiswaTransportConfig struct { DBWrite *gorm.DB DBRead *gorm.DB } diff --git a/src/module/dashboard_mahasiswa/entity/dashboard_mahasiswa.go b/src/module/dashboard_mahasiswa/entity/dashboard_mahasiswa.go new file mode 100644 index 0000000000000000000000000000000000000000..4b9582f2d4dd49713a1f6040e599391b5597d786 --- /dev/null +++ b/src/module/dashboard_mahasiswa/entity/dashboard_mahasiswa.go @@ -0,0 +1,77 @@ +package entity + +import ( + "time" +) + +// type pendaftaran_ta_status_enum string + +// const ( +// NOT_ASSIGNED pendaftaran_ta_status_enum = "NOT_ASSIGNED" +// INTERVIEW pendaftaran_ta_status_enum = "INTERVIEW" +// APPROVED pendaftaran_ta_status_enum = "APPROVED" +// REJECTED pendaftaran_ta_status_enum = "REJECTED" +// ) + +type DataTopik struct { + Id string `json:"id"` + Judul string `json:"judul"` + Deskripsi string `json:"deskripsi"` + IdPengaju string `json:"id_pengaju"` +} + +type DashboardMahasiswaRet struct { + Mahasiswa DataMahasiswa `json:"mahasiswa"` + StatusPendaftaranTA StatusPendaftaranTA `json:"pendaftaran_ta"` + DosenBimbingan DataDosenBimbingan `json:"dosen_bimbingan"` + LogBimbingan []LogBimbingan `json:"bimbingan"` + Seminar SidangSeminar `json:"seminar"` + Sidang SidangSeminar `json:"sidang"` +} + +type DataMahasiswa struct { + IdMahasiswa string `json:"id"` + Nama string `json:"nama"` + Email string `json:"email"` + NIM string `json:"nim"` +} + +type StatusPendaftaranTA struct { + Id string `json:"id"` + JalurPilihan string `json:"jalur_pilihan"` + WaktuPengiriman time.Time `json:"waktu_pengiriman"` + JadwalInterview time.Time `json:"jadwal_interview"` + WaktuKeputusan time.Time `json:"waktu_keputusan"` + Status string `json:"status"` + Topik DataTopik `json:"topik"` +} + +type DataDosenBimbingan struct { + IdDosen string `json:"id"` + Nama string `json:"nama"` + Email string `json:"email"` +} + +type LogBimbingan struct { + Id string `json:"id"` + WaktuBimbingan time.Time `json:"waktu_bimbingan"` + LaporanKemajuan string `json:"laporan_kemajuan"` + Todo string `json:"todo"` + NextBimbingan string `json:"next_bimbingan"` + Status bool `json:"status"` + Berkas []BerkasLogBimbingan `json:"berkas"` +} + +type BerkasLogBimbingan struct { + Id string `json:"id"` + Nama string `json:"nama"` + Link string `json:"link"` +} + +type SidangSeminar struct { + Id string `json:"id"` + Ditolak bool `json:"ditolak"` + Lulus bool `json:"lulus"` + WaktuMulai time.Time `json:"jadwal_seminar"` + Ruangan string `json:"ruangan"` +} diff --git a/src/module/dashboard_mahasiswa/internal/repository/dashboard_mahasiswa.go b/src/module/dashboard_mahasiswa/internal/repository/dashboard_mahasiswa.go new file mode 100644 index 0000000000000000000000000000000000000000..860e699751252ed180710c66e5b45453546b063f --- /dev/null +++ b/src/module/dashboard_mahasiswa/internal/repository/dashboard_mahasiswa.go @@ -0,0 +1,146 @@ +package repository + +import ( + "errors" + + "gitlab.informatika.org/k-01-11/graduit-be/src/models" + "gitlab.informatika.org/k-01-11/graduit-be/src/module/dashboard_mahasiswa/entity" + "gorm.io/gorm" +) + +type DashboardMahasiswaRepo struct { + DBWrite *gorm.DB + DBRead *gorm.DB +} + +func NewDashboardMahasiswaRepository(dbWrite *gorm.DB, dbRead *gorm.DB) *DashboardMahasiswaRepo { + return &DashboardMahasiswaRepo{ + DBWrite: dbWrite, + DBRead: dbRead, + } +} + +func (repo *DashboardMahasiswaRepo) GetDashboardMahasiswaById(IdMahasiswa string) (output []entity.DashboardMahasiswaRet, err error) { + var result *gorm.DB + + var dashboardMahasiswa entity.DashboardMahasiswaRet + var dataMahasiswa entity.DataMahasiswa + var statusPendaftaran entity.StatusPendaftaranTA + var dataTopik entity.DataTopik + var dataDosen entity.DataDosenBimbingan + var logBimbingan []entity.LogBimbingan + var berkasLogBimbingan []entity.BerkasLogBimbingan + var dataSeminar entity.SidangSeminar + var dataSidang entity.SidangSeminar + + var pendaftaranTA models.PendaftaranTA + var logBimbinganModel []models.BimbinganLogs + + // Get Mahasiswa + result = repo.DBRead.Table("pengguna"). + Select(`pengguna.id AS id_mahasiswa, + pengguna.nama AS nama, + pengguna.email AS email, + pengguna.nim AS nim`). + Where("pengguna.id = ?", IdMahasiswa). + Scan(&dataMahasiswa) + + if result.Error != nil { + return nil, errors.New("mahasiswa tidak ditemukan") + } + dashboardMahasiswa.Mahasiswa = dataMahasiswa + + result = repo.DBRead.Where("id_mahasiswa = ?", dashboardMahasiswa.Mahasiswa.IdMahasiswa). + Order("waktu_pengiriman DESC").First(&pendaftaranTA) + + statusPendaftaran.Id = pendaftaranTA.ID + statusPendaftaran.JalurPilihan = pendaftaranTA.JalurPilihan + statusPendaftaran.WaktuPengiriman = pendaftaranTA.WaktuPengiriman + statusPendaftaran.JadwalInterview = pendaftaranTA.InterviewAt + statusPendaftaran.WaktuKeputusan = pendaftaranTA.DecidedAt + statusPendaftaran.Status = string(pendaftaranTA.Status) + + // Cari data sesudah ini only if udah daftar + if result.Error == nil { + // Cari topik + repo.DBRead.Table("pendaftaran_ta"). + Select(`topik.id, + topik.judul, + topik.deskripsi, + topik.pengaju_id AS id_pengaju`). + Joins("JOIN topik ON pendaftaran_ta.id_topik = topik.id"). + Where("pendaftaran_ta.id = ?", statusPendaftaran.Id). + Scan(&dataTopik) + + statusPendaftaran.Topik = dataTopik + dashboardMahasiswa.StatusPendaftaranTA = statusPendaftaran + + // Cari dosen + result = repo.DBRead.Table("pendaftaran_ta"). + Select(`dosen_bimbingan.id AS id_dosen, + pengguna.nama as nama, + pengguna.email as email`). + Joins("JOIN dosen_bimbingan ON pendaftaran_ta.id = dosen_bimbingan.pendaftaran_id"). + Joins("JOIN pengguna ON dosen_bimbingan.dosen_id = pengguna.id"). + Where("pendaftaran_ta.id = ?", statusPendaftaran.Id). + Scan(&dataDosen) + + if result.Error == nil { + + dashboardMahasiswa.DosenBimbingan = dataDosen + + // Cari log bimbingan + result = repo.DBRead.Where("id_mahasiswa = ?", dashboardMahasiswa.Mahasiswa.IdMahasiswa). + Find(&logBimbinganModel) + + for i := range logBimbinganModel { + repo.DBRead.Table("berkas"). + Select("id, nama, link"). + Where("id_bimbingan_log = ?", logBimbinganModel[i].ID). + Scan(&berkasLogBimbingan) + + logBimbinganBaru := entity.LogBimbingan{ + Id: logBimbinganModel[i].ID, + WaktuBimbingan: logBimbinganModel[i].Date, + LaporanKemajuan: logBimbinganModel[i].LaporanKemajuan, + Todo: logBimbinganModel[i].Todo, + NextBimbingan: logBimbinganModel[i].NextBimbingan, + Status: logBimbinganModel[i].Status, + Berkas: berkasLogBimbingan, + } + + logBimbingan = append(logBimbingan, logBimbinganBaru) + } + + dashboardMahasiswa.LogBimbingan = logBimbingan + + // Cari seminar & sidang + repo.DBRead.Table("pendaftaran_sidsem"). + Select(`pendaftaran_sidsem.id AS id, + pendaftaran_sidsem.ditolak AS ditolak, + pendaftaran_sidsem.lulus AS lulus, + pendaftaran_sidsem.waktu_mulai AS jadwal_seminar, + ruangan.nama AS ruangan`). + Joins("JOIN ruangan ON pendaftaran_sidsem.ruangan_id = ruangan.id"). + Joins("JOIN pendaftaran_ta ON pendaftaran_sidsem.pendaftaran_ta_id = pendaftaran_ta.id"). + Where("pendaftaran_ta.id = ? AND pendaftaran_sidsem.tipe = ?", dashboardMahasiswa.StatusPendaftaranTA.Id, "SEMINAR"). + Scan(&dataSeminar) + + repo.DBRead.Table("pendaftaran_sidsem"). + Select(`pendaftaran_sidsem.id AS id, + pendaftaran_sidsem.ditolak AS ditolak, + pendaftaran_sidsem.lulus AS lulus, + pendaftaran_sidsem.waktu_mulai AS jadwal_seminar, + ruangan.nama AS ruangan`). + Joins("JOIN ruangan ON pendaftaran_sidsem.ruangan_id = ruangan.id"). + Joins("JOIN pendaftaran_ta ON pendaftaran_sidsem.pendaftaran_ta_id = pendaftaran_ta.id"). + Where("pendaftaran_ta.id = ? AND pendaftaran_sidsem.tipe = ?", dashboardMahasiswa.StatusPendaftaranTA.Id, "SIDANG"). + Scan(&dataSidang) + + dashboardMahasiswa.Seminar = dataSeminar + dashboardMahasiswa.Sidang = dataSidang + } + } + + return []entity.DashboardMahasiswaRet{dashboardMahasiswa}, nil +} diff --git a/src/module/dashboard_mahasiswa/internal/usecase/dashboard_mahasiswa.go b/src/module/dashboard_mahasiswa/internal/usecase/dashboard_mahasiswa.go new file mode 100644 index 0000000000000000000000000000000000000000..03a533fe4a4adf4b03b8f0d8a608069b1e644e89 --- /dev/null +++ b/src/module/dashboard_mahasiswa/internal/usecase/dashboard_mahasiswa.go @@ -0,0 +1,27 @@ +package usecase + +import "gitlab.informatika.org/k-01-11/graduit-be/src/module/dashboard_mahasiswa/entity" + +type DashboardMahasiswaUseCase interface { + GetDashboardMahasiswa(IdMahasiswa string) ([]entity.DashboardMahasiswaRet, error) +} + +type DashboardMahasiswaUc struct { + dashboardMahasiswaRepo DashboardMahasiswaRepository +} + +func NewDashboardMahasiswaUsecase(dashboardMahasiswaRepo DashboardMahasiswaRepository) *DashboardMahasiswaUc { + return &DashboardMahasiswaUc{ + dashboardMahasiswaRepo: dashboardMahasiswaRepo, + } +} + +func (uc *DashboardMahasiswaUc) GetDashboardMahasiswa(IdMahasiswa string) ([]entity.DashboardMahasiswaRet, error) { + newDashboardMahasiswa, err := uc.dashboardMahasiswaRepo.GetDashboardMahasiswaById(IdMahasiswa) + + if err != nil { + return newDashboardMahasiswa, err + } + + return newDashboardMahasiswa, nil +} diff --git a/src/module/dashboard_mahasiswa/internal/usecase/repository.go b/src/module/dashboard_mahasiswa/internal/usecase/repository.go new file mode 100644 index 0000000000000000000000000000000000000000..f7b3d8cec40ce35849408168961bf7ff0a105ec5 --- /dev/null +++ b/src/module/dashboard_mahasiswa/internal/usecase/repository.go @@ -0,0 +1,7 @@ +package usecase + +import "gitlab.informatika.org/k-01-11/graduit-be/src/module/dashboard_mahasiswa/entity" + +type DashboardMahasiswaRepository interface { + GetDashboardMahasiswaById(IdMahasiswa string) (output []entity.DashboardMahasiswaRet, err error) +} diff --git a/src/module/dashboard_mahasiswa/transport/mahasiswa_handler.go b/src/module/dashboard_mahasiswa/transport/mahasiswa_handler.go new file mode 100644 index 0000000000000000000000000000000000000000..ebfceadc734d851bd718cdce2027a35d9063faf2 --- /dev/null +++ b/src/module/dashboard_mahasiswa/transport/mahasiswa_handler.go @@ -0,0 +1,52 @@ +package transport + +import ( + "net/http" + + "github.com/labstack/echo/v4" + "gitlab.informatika.org/k-01-11/graduit-be/src/module/dashboard_mahasiswa/config" + "gitlab.informatika.org/k-01-11/graduit-be/src/module/dashboard_mahasiswa/internal/repository" + "gitlab.informatika.org/k-01-11/graduit-be/src/module/dashboard_mahasiswa/internal/usecase" + "gitlab.informatika.org/k-01-11/graduit-be/src/utils" +) + +type MahasiswaDashboardHandler struct { + dashboardMahasiswaUsecase usecase.DashboardMahasiswaUseCase +} + +func NewMahasiswaDashboardHandler(cfg config.DashboardMahasiswaTransportConfig) *MahasiswaDashboardHandler { + dashboardMahasiswaRepository := repository.NewDashboardMahasiswaRepository(cfg.DBWrite, cfg.DBRead) + dashboardMahasiswaUsecase := usecase.NewDashboardMahasiswaUsecase(dashboardMahasiswaRepository) + + return &MahasiswaDashboardHandler{ + dashboardMahasiswaUsecase: dashboardMahasiswaUsecase, + } + +} + +func (t *MahasiswaDashboardHandler) MountMahasiswa(group *echo.Group) { + group.GET("/dashboard", t.GetStatusMahasiswa) +} + +// GetStatusMahasiswa retrieves the status mahasiswa by NIM. +// @Summary Get status mahasiswa +// @Description Retrieves the status mahasiswa by NIM. +// @Tags Status Mahasiswa +// @Accept json +// @Produce json +// @Success 200 {object} entity.DashboardMahasiswaRet +// @Router /api/mahasiswa/dashboard [get] +func (t *MahasiswaDashboardHandler) GetStatusMahasiswa(c echo.Context) error { + payload, ok := c.Get("authPayload").(utils.Payload) + + if !ok { + return c.JSON(http.StatusInternalServerError, utils.ResponseDetailOutput(false, http.StatusInternalServerError, "Error parsing id", nil)) + } + + dashboardMahasiswa, err := t.dashboardMahasiswaUsecase.GetDashboardMahasiswa(payload.ID) + if err != nil { + return c.JSON(http.StatusBadRequest, utils.ResponseDetailOutput(false, http.StatusBadRequest, err.Error(), nil)) + } + + return c.JSON(http.StatusOK, utils.ResponseDetailOutput(true, http.StatusOK, "Status mahasiswa successfully retreived", dashboardMahasiswa[0])) +} diff --git a/src/module/dashboard_tim_ta/internal/repository/dashboard_tim_ta.go b/src/module/dashboard_tim_ta/internal/repository/dashboard_tim_ta.go index 9b005348b7dcf7ddd105ee3ff155d682b2ae944a..dd0e75df33a1053aa756ea9230f65182bfbdaeac 100644 --- a/src/module/dashboard_tim_ta/internal/repository/dashboard_tim_ta.go +++ b/src/module/dashboard_tim_ta/internal/repository/dashboard_tim_ta.go @@ -49,7 +49,7 @@ func (repo *DashboardTimRepo) GetDataDashboard(offset, size int) (output []entit Status: "Pengajuan Topik", } - if pendaftar.Status { + if pendaftar.Status == "APPROVED" { data.Status = "Bimbingan" res := repo.DBRead.Where("id_mahasiswa = ?", pendaftar.IdMahasiswa).Find(&logBimbingan) diff --git a/src/module/status_mahasiswa/entity/status_mahasiswa.go b/src/module/status_mahasiswa/entity/status_mahasiswa.go deleted file mode 100644 index eb1feb560f72fe931ba82f98c882fa6f71c40c88..0000000000000000000000000000000000000000 --- a/src/module/status_mahasiswa/entity/status_mahasiswa.go +++ /dev/null @@ -1,46 +0,0 @@ -package entity - -import ( - "time" -) - -type StatusMahasiswa struct { - IdMahasiswa string `json:"id_mahasiswa"` - Nama string `json:"nama"` - NIM string `json:"nim"` - - StatusPendaftaran StatusPendaftaran `json:"status_pendaftaran"` - StatusBimbingan StatusBimbingan `json:"status_bimbingan"` - StatusSeminar StatusSeminar `json:"status_seminar"` - StatusSidang StatusSidang `json:"status_sidang"` -} - -type StatusPendaftaran struct { - Status bool `json:"status"` - Topik string `json:"topik"` - Judul string `json:"judul"` - DosenPembimbing string `json:"dosen_pembimbing"` - PengirimanRegistrasi time.Time `json:"pengiriman_registrasi"` - PersetujuanDosenPembimbing time.Time `json:"persetujuan_dosen_pembimbing"` - JadwalInterview time.Time `json:"jadwal_interview"` - PengesahanDosenPembimbing bool `json:"pengesahan_dosen_pembimbing"` -} - -type StatusBimbingan struct { - JumlahBimbingan int `json:"jumlah_bimbingan"` -} - -type StatusSeminar struct { - Status bool `json:"status"` - DosenPenguji string `json:"dosen_penguji"` - JadwalSeminar time.Time `json:"jadwal_seminar"` - Ruangan string `json:"ruangan"` -} - -type StatusSidang struct { - Status bool `json:"status"` - DosenPenguji1 string `json:"dosen_penguji_1"` - DosenPenguji2 string `json:"dosen_penguji_2"` - JadwalSeminar time.Time `json:"jadwal_seminar"` - Ruangan string `json:"ruangan"` -} diff --git a/src/module/status_mahasiswa/internal/repository/status_mahasiswa.go b/src/module/status_mahasiswa/internal/repository/status_mahasiswa.go deleted file mode 100644 index bff84e307c6101ed2c76614f5e2805ca80a25870..0000000000000000000000000000000000000000 --- a/src/module/status_mahasiswa/internal/repository/status_mahasiswa.go +++ /dev/null @@ -1,112 +0,0 @@ -package repository - -import ( - "errors" - "time" - - "gitlab.informatika.org/k-01-11/graduit-be/src/models" - "gitlab.informatika.org/k-01-11/graduit-be/src/module/status_mahasiswa/entity" - "gorm.io/gorm" -) - -type StatusMahasiswaRepo struct { - DBWrite *gorm.DB - DBRead *gorm.DB -} - -func NewStatusMahasiswaRepository(dbWrite *gorm.DB, dbRead *gorm.DB) *StatusMahasiswaRepo { - return &StatusMahasiswaRepo{ - DBWrite: dbWrite, - DBRead: dbRead, - } -} - -func (repo *StatusMahasiswaRepo) GetStatusMahasiswaByNIM(nim string) (output []entity.StatusMahasiswa, err error) { - var statusMahasiswa entity.StatusMahasiswa - var statusPendaftaran entity.StatusPendaftaran - var statusBimbingan entity.StatusBimbingan - var statusSeminar entity.StatusSeminar - var statusSidang entity.StatusSidang - - var mahasiswa models.Pengguna - var dosenPembimbing models.Pengguna - var topik models.Topik - var judul models.UsulanJudul - var pendaftaran models.PendaftaranTA - - statusPendaftaran.Status = true - - // Get Mahasiswa - result := repo.DBRead.Where("nim = ?", nim).First(&mahasiswa) - if result.Error != nil { - return nil, errors.New("mahasiswa tidak ditemukan") - } - statusMahasiswa.IdMahasiswa = mahasiswa.ID - statusMahasiswa.NIM = mahasiswa.NIM - statusMahasiswa.Nama = mahasiswa.Nama - - // Get Pendaftaran - - // conditions 1 : already got supervisor - result = repo.DBRead.Where("id_mahasiswa = ? AND status = TRUE", mahasiswa.ID).First(&pendaftaran).Order("updated_at DESC") - if result.Error != nil { - if errors.Is(result.Error, gorm.ErrRecordNotFound) { - - // conditions 2 : already apply but not accepted, yet - result = repo.DBRead.Where("id_mahasiswa = ? AND (status = FALSE OR status IS NULL)", mahasiswa.ID).First(&pendaftaran).Order("updated_at DESC") - if result.Error != nil { - if errors.Is(result.Error, gorm.ErrRecordNotFound) { - // conditions 3 : not applied yeet - statusPendaftaran.Status = false - } - } - } - } - - if statusPendaftaran.Status { - - // Get Dosen - result = repo.DBRead.Where("id = ?", pendaftaran.IdDosen).First(&dosenPembimbing) - if result.Error != nil { - return nil, errors.New("dosen tidak ditemukan") - } - - // Get Topik - result = repo.DBRead.Where("id = ?", pendaftaran.IdTopik).First(&topik) - if result.Error != nil { - return nil, errors.New("topik tidak ditemukan") - } - - // Get Judul - result = repo.DBRead.Where("id_pendaftaran = ?", pendaftaran.ID).First(&judul) - if result.Error != nil { - return nil, errors.New("judul tidak ditemukan") - } - - statusPendaftaran.Topik = topik.Judul - statusPendaftaran.Judul = judul.Judul - statusPendaftaran.DosenPembimbing = dosenPembimbing.Nama - statusPendaftaran.PengirimanRegistrasi = pendaftaran.WaktuPengiriman - statusPendaftaran.PersetujuanDosenPembimbing = pendaftaran.DecidedAt - statusPendaftaran.JadwalInterview = pendaftaran.InterviewAt - statusPendaftaran.PengesahanDosenPembimbing = pendaftaran.Status - - } - - statusMahasiswa.StatusPendaftaran = statusPendaftaran - - // below this still uncertain - statusBimbingan.JumlahBimbingan = 10 - statusMahasiswa.StatusBimbingan = statusBimbingan - - statusSeminar.Status = true - statusSeminar.DosenPenguji = "Dr. Ir. Rinaldi Munir, M.T." - statusSeminar.JadwalSeminar = time.Now() - statusSeminar.Ruangan = "7609" - statusMahasiswa.StatusSeminar = statusSeminar - - statusSidang.Status = false - statusMahasiswa.StatusSidang = statusSidang - - return []entity.StatusMahasiswa{statusMahasiswa}, nil -} diff --git a/src/module/status_mahasiswa/internal/usecase/repository.go b/src/module/status_mahasiswa/internal/usecase/repository.go deleted file mode 100644 index a8d808b9948cdb91b7c0cd7042f2666a1a7b1053..0000000000000000000000000000000000000000 --- a/src/module/status_mahasiswa/internal/usecase/repository.go +++ /dev/null @@ -1,7 +0,0 @@ -package usecase - -import "gitlab.informatika.org/k-01-11/graduit-be/src/module/status_mahasiswa/entity" - -type StatusMahasiswaRepository interface { - GetStatusMahasiswaByNIM(nim string) (output []entity.StatusMahasiswa, err error) -} diff --git a/src/module/status_mahasiswa/internal/usecase/status_mahasiswa.go b/src/module/status_mahasiswa/internal/usecase/status_mahasiswa.go deleted file mode 100644 index 63e6ab0620b1bf4ffcb203c27d8a6354af228fe7..0000000000000000000000000000000000000000 --- a/src/module/status_mahasiswa/internal/usecase/status_mahasiswa.go +++ /dev/null @@ -1,27 +0,0 @@ -package usecase - -import "gitlab.informatika.org/k-01-11/graduit-be/src/module/status_mahasiswa/entity" - -type StatusMahasiswaUseCase interface { - GetStatusMahasiswa(nim string) ([]entity.StatusMahasiswa, error) -} - -type StatusMahasiswaUc struct { - statusMahasiswaRepo StatusMahasiswaRepository -} - -func NewStatusMahasiswaUsecase(statusMahasiswaRepo StatusMahasiswaRepository) *StatusMahasiswaUc { - return &StatusMahasiswaUc{ - statusMahasiswaRepo: statusMahasiswaRepo, - } -} - -func (uc *StatusMahasiswaUc) GetStatusMahasiswa(nim string) ([]entity.StatusMahasiswa, error) { - newStatusMahasiswa, err := uc.statusMahasiswaRepo.GetStatusMahasiswaByNIM(nim) - - if err != nil { - return newStatusMahasiswa, err - } - - return newStatusMahasiswa, nil -} diff --git a/src/module/status_mahasiswa/transport/admin_handler.go b/src/module/status_mahasiswa/transport/admin_handler.go deleted file mode 100644 index ff2cba526642adf0b087aaaa0885d70470f4e9fb..0000000000000000000000000000000000000000 --- a/src/module/status_mahasiswa/transport/admin_handler.go +++ /dev/null @@ -1,52 +0,0 @@ -package transport - -import ( - "net/http" - - "github.com/labstack/echo/v4" - "gitlab.informatika.org/k-01-11/graduit-be/src/module/status_mahasiswa/config" - "gitlab.informatika.org/k-01-11/graduit-be/src/module/status_mahasiswa/internal/repository" - "gitlab.informatika.org/k-01-11/graduit-be/src/module/status_mahasiswa/internal/usecase" - "gitlab.informatika.org/k-01-11/graduit-be/src/utils" -) - -type AdminStatusMahasiswaHandler struct { - statusMahasiswaUsecase usecase.StatusMahasiswaUseCase -} - -func NewAdminStatusMahasiswaHandler(cfg config.StatusMahasiswaTransportConfig) *AdminStatusMahasiswaHandler { - statusMahasiswaRepository := repository.NewStatusMahasiswaRepository(cfg.DBWrite, cfg.DBRead) - statusMahasiswaUsecase := usecase.NewStatusMahasiswaUsecase(statusMahasiswaRepository) - - return &AdminStatusMahasiswaHandler{ - statusMahasiswaUsecase: statusMahasiswaUsecase, - } - -} - -func (t *AdminStatusMahasiswaHandler) MountAdmin(group *echo.Group) { - group.GET("/status-mahasiswa", t.GetStatusMahasiswa) -} - -// GetStatusMahasiswa retrieves the status mahasiswa by NIM. -// @Summary Get status mahasiswa -// @Description Retrieves the status mahasiswa by NIM. -// @Tags Status Mahasiswa -// @Accept json -// @Produce json -// @Param nim query string true "NIM of the student" -// @Success 200 {object} entity.StatusMahasiswa -// @Router /status-mahasiswa [get] -func (t *AdminStatusMahasiswaHandler) GetStatusMahasiswa(c echo.Context) error { - nim := c.QueryParam("nim") - if nim == "" { - return c.JSON(http.StatusInternalServerError, utils.ResponseDetailOutput(false, http.StatusInternalServerError, "insert nim", nil)) - } - - statusMahasiswa, err := t.statusMahasiswaUsecase.GetStatusMahasiswa(nim) - if err != nil { - return c.JSON(http.StatusBadRequest, utils.ResponseDetailOutput(false, http.StatusBadRequest, err.Error(), nil)) - } - - return c.JSON(http.StatusOK, utils.ResponseDetailOutput(true, http.StatusOK, "Status mahasiswa successfully retreived", statusMahasiswa[0])) -}