{ "openapi": "3.0.3", "info": { "title": "Academy - OpenAPI 3.0", "description": "API documentation for the Academy Website, providing endpoints to manage courses, students, and more\n\nSome useful links:\n- [BackEnd repository](https://github.com/Muhamadzulfikar/FSW-BE-Final-Project)\n- [ERD link](https://dbdiagram.io/d/655ed5293be14957878fc325)\n", "license": { "name": "ISC License", "url": "https://www.isc.org/licenses/" }, "version": "1.0.0" }, "servers": [ { "url": "https://final-project-online-course.et.r.appspot.com/" } ], "tags": [ { "name": "Root", "description": "Root end-point" }, { "name": "Category", "description": "Everything about category management" }, { "name": "Class", "description": "Everything about class management" }, { "name": "Payment", "description": "Everything about payment" }, { "name": "Auth", "description": "Everything about authorization" }, { "name": "Admin", "description": "Everything about admin" }, { "name": "Notification", "description": "Everything about notification" }, { "name": "User", "description": "Everything about User" } ], "paths": { "/": { "get": { "tags": [ "Root" ], "summary": "Test your ping to the server here", "operationId": "testPing", "responses": { "200": { "description": "Successful operation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ping" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } } }, "/v1/course-categories": { "get": { "tags": [ "Category" ], "summary": "Find all Category", "description": "This end point will serve all list of categories", "operationId": "getAllCategories", "responses": { "200": { "description": "successful operation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/categories" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } } }, "/v1/courses": { "get": { "tags": [ "Class" ], "summary": "Find all Class if there are no params or spesific class if there are params", "description": "This end point will serve all list of class", "operationId": "getAllClass", "parameters": [ { "name": "categoryId", "in": "query", "description": "The category of the classes", "required": false, "schema": { "type": "string", "example": "1,3" } }, { "name": "level", "in": "query", "description": "The level of the classes", "required": false, "schema": { "type": "string", "example": "beginner,intermediate" } } ], "responses": { "200": { "description": "successful operation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/classes" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } } }, "/v1/course/{id}": { "get": { "tags": [ "Class" ], "summary": "Find detail class by ID", "description": "This end point will serve data of detailed class", "operationId": "getDetailClass", "parameters": [ { "name": "id", "in": "path", "description": "ID of class to fetch", "required": true, "schema": { "$ref": "#/components/schemas/paramsID" } } ], "responses": { "200": { "description": "successful operation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/classDetail" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } } }, "/v1/course-dashboard": { "get": { "tags": [ "Class" ], "summary": "Get Dashboard Admin", "description": "This end point will serve data of user's classes", "operationId": "getAdminCourses", "responses": { "200": { "description": "successful operation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/userCoursePayments" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } } }, "/v1/courses/onboarding/{courseUuid}": { "put": { "tags": [ "Class" ], "summary": "Update onboarding course", "description": "This end point will update user onboarding course", "operationId": "courseOnboarding", "responses": { "201": { "description": "successful operation", "content": { "application/json": { "example": { "status": "Created", "code": 201, "message": "Successfully Completed Onboarding", "data": true } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } } }, "/v1/course-modules/module-completed/{userChapterModuleUuid}": { "put": { "tags": [ "Class" ], "summary": "Update Completing Module", "description": "This end point will update user Completing Module", "operationId": "completingModule", "responses": { "200": { "description": "successful operation", "content": { "application/json": { "example": { "status": "Created", "code": 201, "message": "Successfully Completing Module", "data": [ 0 ] } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } } }, "/v1/courses/video-course/{chapterModuleUuid}": { "get": { "tags": [ "Class" ], "summary": "Get Video Course", "description": "This end point will Get Video Course", "operationId": "videoCourse", "responses": { "200": { "description": "successful operation", "content": { "application/json": { "example": { "status": "OK", "code": 200, "message": "Successfully get Video", "data": { "course_link":"https://www.youtube.com/embed/wSxl5tNp23U?si=kY5UOoMuwnGxuu8W" } } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } } }, "/v1/courses/my-courses": { "get": { "tags": [ "Class" ], "summary": "Get User Course", "description": "This end point will Get User Course", "operationId": "userCourse", "responses": { "200": { "description": "successful operation", "content": { "application/json": { "example": { "status": "OK", "code": 200, "message": "Successfully get My Course", "data": { "id":"53117f3a-7da9-4e5e-8c3f-0abe4455ef52", "category":"UI/UX Design", "name":"Intro to Basic of User Interaction Design", "author":"Simon Doe", "price":280000, "level":"intermediate", "rating":5, "isPremium":false, "classCode":"UIUX0123", "totalModule":2, "totalMinute":128, "progressBar":0 } } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } } }, "/v1/admin/courses": { "get": { "tags": ["Admin"], "summary": "Get Management Class Admin", "description": "This end point will serve data of classes", "operationId": "getCourse", "responses": { "200": { "description": "successful operation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/adminManagementClass" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } }, "post": { "tags": ["Admin"], "summary": "Create Class", "description": "This end point will create data of class", "operationId": "createAdminCourses", "requestBody": { "description": "Data of the course to be created", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/reqClass" } } } }, "responses": { "200": { "description": "successful operation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/reqClass" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } } }, "/v1/admin/courses/{id}": { "put": { "tags": ["Admin"], "summary": "Update Class", "description": "This end point will update data of class", "operationId": "updateAdminCourses", "parameters": [ { "name": "id", "in": "path", "description": "ID of the course to be updated", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "description": "Data of the course to be updated", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/reqClass" } } } }, "responses": { "200": { "description": "successful operation", "content": { "application/json": { "example": { "status": "OK", "code": 200, "message": "Success" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } }, "delete": { "tags": ["Admin"], "summary": "Delete Class", "description": "This end point will delete data of class", "operationId": "deleteAdminCourses", "parameters": [ { "name": "id", "in": "path", "description": "ID of the course to be updated", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "description": "Data of the course to be deleted", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/reqClass" } } } }, "responses": { "200": { "description": "successful operation", "content": { "application/json": { "example": { "status": "OK", "code": 200, "message": "Success" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } } }, "/v1/courses/enrollment": { "post": { "tags": ["Payment"], "summary": "Make Payment", "description": "This end point will post data to UserCourse", "operationId": "buyCourse", "requestBody": { "description": "Data of the course to be updated", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/reqBuyCourse" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "example": "Created" }, "code": { "type": "number", "example": 201 }, "message": { "type": "string", "example": "Success" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/resBuyCourse" } } } }, "example": { "status": "Created", "code": 201, "message": "Success", "data": [ { "paymentUuid": "be400614-d942-4648-933c-379537c64a30", "image": "https://res.cloudinary.com/dpg0tbbot/image/upload/v1701180735/b4zuplewxgtb5yxvw1gx.png", "type": "UI/UX Design", "name": "Intro to Basic of User Interaction Design", "author": "Simon Doe", "price": 280000, "tax":28000, "total":308000, "paid":true, "expired":"3 0 2024 11:37" } ] } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } } }, "/courses/invoice/{paymentUuid}": { "get": { "tags": ["Payment"], "summary": "Get Invoice", "description": "This end point will get data of user invoice", "operationId": "invoice", "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "example": "Created" }, "code": { "type": "number", "example": 201 }, "message": { "type": "string", "example": "Success" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/resBuyCourse" } } } }, "example": { "status": "OK", "code": 200, "message": "Successfully get Invoice Course", "data": [ { "paymentUuid": "be400614-d942-4648-933c-379537c64a30", "image": "https://res.cloudinary.com/dpg0tbbot/image/upload/v1701180735/b4zuplewxgtb5yxvw1gx.png", "type": "UI/UX Design", "name": "Intro to Basic of User Interaction Design", "author": "Simon Doe", "price": 280000, "tax":28000, "total":308000, "paid":true, "expired":"3 0 2024 11:37" } ] } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } } }, "/v1/courses/payment/{paymentUuid}": { "put": { "tags": ["Payment"], "summary": "Make Payment", "description": "This end point will post data to UserCourse", "operationId": "buyCourse", "requestBody": { "description": "Data of the course to be updated", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/reqPaymentCourse" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "example": "Created" }, "code": { "type": "number", "example": 201 }, "message": { "type": "string", "example": "Success" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/resBuyCourse" } } } }, "example": { "status": "Created", "code": 201, "message": "Success", "data": [ { "course_uuid":"721e7486-5796-42e7-b55d-0f466b709d35", "paymentUuid": "be400614-d942-4648-933c-379537c64a30", "image": "https://res.cloudinary.com/dpg0tbbot/image/upload/v1701180735/b4zuplewxgtb5yxvw1gx.png", "type": "UI/UX Design", "name": "Intro to Basic of User Interaction Design", "author": "Simon Doe", "price": 280000, "tax":28000, "total":308000, "paid":true, "expired":"3 0 2024 11:37", "payment_method":"credit card" } ] } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } } }, "/v1/courses/payment-history": { "get": { "tags": ["Payment"], "summary": "Payment History", "description": "This endpoint will get user payment history", "operationId": "paymentHistory", "security": [ { "bearerAuth": [] } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "example": "OK" }, "code": { "type": "integer", "example": 200 }, "message": { "type": "string", "example": "Success" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/resPayment" } } } }, "example": { "status": "OK", "code": 200, "message": "Success", "data": [ { "courseUuid": "721e7486-5796-42e7-b55d-0f466b709d35", "paymentUuid": "54d3308d-7e83-4f9e-b3c6-ac6f7b8afdce", "userCourseUuid": "eb285ddf-45c3-4e49-a4c6-b4986d7bd8cd", "image": "https://res.cloudinary.com/dpg0tbbot/image/upload/v1701180735/b4zuplewxgtb5yxvw1gx.png", "courseCategory": "UI/UX Design", "courseName": "Intro to Basic of User Interaction Design", "courseAuthor": "Simon Doe", "courseLevel": "intermediate", "totalModules": 1, "totalMinutes": 42, "expiredAt": "2023-12-16T02:13:22.448Z", "courseRating": "4.5", "is_paid": true } ] } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/unauthorized" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } } }, "/v1/login": { "post": { "tags": ["Auth"], "summary": "Login", "description": "This endpoint will login a user", "operationId": "login", "requestBody": { "description": "Data of the userCoursePayment to be updated", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/reqLogin" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/resLogin" }, "example": { "status": "OK", "code": 200, "message": "Successfully Login", "data": [ { "name": "Fahrel", "email": "fahrel@gmail.com", "phone": "081231238", "country": "Indonesia", "city": "Jember", "token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImYxMGY2ZWQwLTEzYzAtNDYzZC05MWRhLWYwNmVmM2I5MjhlZSIsImlhdCI6MTcwMjQ2MzEyNSwiZXhwIjoxNzAyNDY0OTI1fQ.r94ceYn_zj1O8g7KuNUpc9lZxzU04m26s8wQsdSck88" } ] } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/unauthorized" } } } } } } }, "/v1/login/admin": { "post": { "tags": ["Auth"], "summary": "Login", "description": "This endpoint will login an admin", "operationId": "loginAdmin", "requestBody": { "description": "Login for Admin", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/reqLogin" } } } }, "responses": { "200": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/resLogin" }, "example": { "status": "OK", "code": 200, "message": "Successfully Login", "data": [ { "name": "Fahrel Admin", "email": "fahreladmin@gmail.com", "phone": "0812312312", "country": "Indonesia", "city": "Jember", "token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImYxMGY2ZWQwLTEzYzAtNDYzZC05MWRhLWYwNmVmM2I5MjhlZSIsImlhdCI6MTcwMjQ2MzEyNSwiZXhwIjoxNzAyNDY0OTI1fQ.r94ceYn_zj1O8g7KuNUpc9lZxzU04m26s8wQsdSck88" } ] } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } } }, "/v1/register": { "post": { "tags": ["Auth"], "summary": "Register", "description": "This endpoint will register a user", "operationId": "register", "requestBody": { "description": "post a data to user", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/reqRegister" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "example": { "status": "Created", "code": 201, "message": "Success", "data": [ { "name": "Fahrel", "email": "fahrel@gmail.com", "phone": "081231238", "country": null, "city": null, "token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImYxMGY2ZWQwLTEzYzAtNDYzZC05MWRhLWYwNmVmM2I5MjhlZSIsImlhdCI6MTcwMjQ2MzEyNSwiZXhwIjoxNzAyNDY0OTI1fQ.r94ceYn_zj1O8g7KuNUpc9lZxzU04m26s8wQsdSck88" } ] } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } } }, "/v1/register/admin": { "post": { "tags": ["Auth"], "summary": "Register for Admin", "description": "This endpoint will register an Admin", "operationId": "registerAdmin", "requestBody": { "description": "post a data to user for admin", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/reqRegister" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "example": { "status": "Created", "code": 201, "message": "Success", "data": [ { "name": "Fahrel Admin", "email": "fahreladmin@gmail.com", "phone": "081231212", "country": null, "city": null, "token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImYxMGY2ZWQwLTEzYzAtNDYzZC05MWRhLWYwNmVmM2I5MjhlZSIsImlhdCI6MTcwMjQ2MzEyNSwiZXhwIjoxNzAyNDY0OTI1fQ.r94ceYn_zj1O8g7KuNUpc9lZxzU04m26s8wQsdSck88" } ] } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/unauthorized" } } } } } } }, "/v1/validate-register": { "post": { "tags": ["Auth"], "summary": "Validate Otp When Register", "description": "This endpoint will validate Otp when register", "operationId": "validateOtp", "requestBody": { "description": "post a data otpUser and vaildate Otp", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/reqValidateOtp" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "example": { "status": "OK", "code": 200, "message": "Successfully registered", "data": [ {} ] } } } }, "500": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/badRequest" } } } } } } }, "/validate-jwt": { "get": { "summary": "Validate JWT", "description": "Validate a JWT token", "operationId": "validateJwt", "tags": ["Auth"], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "JWT is valid", "content": { "application/json": { "example": { "status": "OK", "code": 200, "message": "Successfully Login", "data": { "name": "fahrel", "email": "fahrel@gmail.com", "phone": "081234543234", "country": null, "city": null, "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImY0ODM4NDAwLWY4YmItNDU2Yi1iZjU3LTRjMTg1YTJjZGI2OSIsImlhdCI6MTcwNDQ0NzA4MywiZXhwIjoxNzA0NTMzNDgzfQ.IvqV4XkGNJlQ4Eq5H9_HXAx5LB0bqRxRLY7pO3XSxv4" } } } }, "schema": { "type": "object", "properties": { "status": { "type": "string", "example": "Ok" }, "code": { "type": "integer", "example": 200 }, "message": { "type": "string", "example": "Jwt Valid" }, "data": { "type": "object", "properties": { "id": { "type": "integer", "example": 123 }, "username": { "type": "string", "example": "john_doe" }, "email": { "type": "string", "example": "john@example.com" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/unauthorized" } } }, "schema": { "type": "object", "properties": { "status": { "type": "string", "example": "Error" }, "code": { "type": "integer", "example": 401 }, "message": { "type": "string", "example": "Unauthorized" }, "error": { "type": "string", "example": "Token must not be empty" } } } } } } }, "/forget-password": { "post": { "summary": "Forget Password", "description": "Send email to reset password", "tags": ["Auth"], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "Successfully send email to reset password", "content": { "application/json": { "example": { "status": "Ok", "code": 200, "message": "Successfully send email to reset password", "data": {} } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "example": { "code": 400, "status": "Error", "message": "Bad Request" } } } } } } }, "/reset-password/{jwtToken}": { "put": { "summary": "Reset Password", "description": "Reset user password using JWT token", "tags": ["Auth"], "parameters": [ { "name": "jwtToken", "in": "path", "required": true, "type": "string", "description": "JWT token received for password reset" } ], "requestBody": { "description": "New password for the user", "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "new_password": { "type": "string", "description": "The new password for the user" } }, "required": ["new_password"] } } } }, "responses": { "200": { "description": "Successfully reset password", "content": { "application/json": { "example": { "status": "Ok", "code": 200, "message": "Successfully reset password", "data": {} } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "example": { "code": 400, "status": "Error", "message": "Bad Request" } } } } } } }, "/v1/admin/statistic": { "get": { "tags": ["Admin"], "summary": "Statistic User", "description": "This endpoint will get statistic user", "operationId": "statisticUser", "responses": { "201": { "description": "Statistic User", "content": { "application/json": { "example": { "status": "OK", "code": 200, "message": "Success", "data": [ { "activeUsersItem": 28, "activeClassItem": 27, "premiumClassItem": 9 } ] } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } } }, "/v1/admin/payment-status": { "get": { "tags": ["Admin"], "summary": "Payment Status", "description": "This endpoint will get Payment Status", "operationId": "paymentStatus", "responses": { "201": { "description": "Payment Status", "content": { "application/json": { "example": { "status": "OK", "code": 200, "message": "Success", "data": [ { "user": "David Casper", "courseCategory": "UI/UX Design", "courseName": "Intro to Basic of User Interaction Design", "is_paid": true, "paymentMethod": "credit card", "buyAt": "2023-12-15T10:45:12.619Z" } ] } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } } }, "/v1/notification": { "get": { "tags": ["Notification"], "summary": "Notification", "description": "This endpoint will get data from user notification", "operationId": "notification", "responses": { "201": { "description": "Notification", "content": { "application/json": { "example": { "status": "OK", "code": 200, "message": "Success", "data": [ { "id": 6, "user_uuid": "44fca4cf-3a55-456f-9aa4-377f238ad786", "title": "Payment Course", "notification": "Selamat anda telah melakukan pembayaran course", "is_conditional": false, "is_read": false } ] } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } } }, "/v1/profile": { "get": { "tags": ["User"], "summary": "Profile User", "description": "This endpoint will get data from the user profile", "operationId": "getUserProfile", "responses": { "200": { "description": "Profile", "content": { "application/json": { "example": { "status": "OK", "code": 200, "message": "Success", "data": [ { "userUuid": "44fca4cf-3a55-456f-9aa4-377f238ad786", "name": "Fahrel", "email": "fahrel@gmail.com", "phone": "081231212", "country": null, "city": null, "role": "admin" } ] } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } }, "put": { "tags": ["User"], "summary": "Update Profile User", "description": "This endpoint will update data in the user profile", "operationId": "updateUserProfile", "responses": { "200": { "description": "Profile Updated", "content": { "application/json": { "example": { "status": "OK", "code": 200, "message": "Success", "data": [ { "userUuid": "44fca4cf-3a55-456f-9aa4-377f238ad786", "name": "Fahrel", "email": "fahrel@gmail.com", "phone": "081231212", "country": null, "city": null, "role": "admin" } ] } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } } }, "/v1/update-password": { "put": { "tags": ["User"], "summary": "Update Password User", "description": "This endpoint will update the password in the user profile", "operationId": "updateUserPassword", "requestBody": { "description": "Request body for updating user password", "required": true, "content": { "application/json": { "example": { "oldPassword": "fahrel123", "newPassword": "fahrel888" } } } }, "responses": { "200": { "description": "Password Updated", "content": { "application/json": { "example": { "status": "OK", "code": 200, "message": "Success", "data": true } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/internalError" } } } } } } } }, "components": { "schemas": { "paramsID": { "type": "string", "format": "uuid", "example": "0f2feace-9e49-4fa6-aa58-a42ce05cd57c" }, "ping": { "type": "object", "properties": { "status": { "type": "string", "example": "OK" }, "code": { "type": "number", "example": 200 }, "message": { "type": "string", "example": "Ping succesfully" } } }, "resLogin": { "type": "object", "properties": { "name": { "type": "string", "example": "Fahrel" }, "email": { "type": "string", "example": "fahrel@gmail.com" }, "phone": { "type": "string", "example": "081231238" }, "country": { "type": "string", "example": "Indonesia" }, "city": { "type": "string", "example": "Jember" }, "token": { "type": "string", "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImYxMGY2ZWQwLTEzYzAtNDYzZC05MWRhLWYwNmVmM2I5MjhlZSIsImlhdCI6MTcwMjQ2MzEyNSwiZXhwIjoxNzAyNDY0OTI1fQ.r94ceYn_zj1O8g7KuNUpc9lZxzU04m26s8wQsdSck88" } } }, "category": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "example": "0033d087-4a4c-4828-a987-e6e0c72d37e9" }, "name": { "type": "string", "example": "UI/UX Design" }, "image": { "type": "string", "example": "https://www.image.com" } } }, "categories": { "type": "object", "properties": { "status": { "type": "string", "example": "OK" }, "code": { "type": "number", "example": 200 }, "message": { "type": "string", "example": "Success" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/category" } } } }, "modul": { "type": "object", "properties": { "title": { "type": "string", "example": "title" }, "link": { "type": "string", "example": "https://youtube.com" } } }, "user": { "type": "object", "properties": { "id": { "type": "integer", "format": "1", "example": "1" }, "uuid": { "type": "string", "format": "uuid", "example": "0033d087-4a4c-4828-a987-e6e0c72d37e9" }, "name":{ "type":"string", "example": "John Doe" }, "email":{ "type":"string", "example":"JohnDoe@gmail.com" }, "password":{ "type":"string", "example":"$2b$10$6K5cZJrUfI2w6u1Qq2nQ6eQ3DZ5Y6rZQ8Qp9XbXv5wZaLqZ7kZcX." }, "phone":{ "type":"string", "example":"0812349271" }, "country":{ "type":"string", "example":"Indonesia" }, "city":{ "type":"string", "example":"Jakarta" }, "role":{ "type":"string", "example":"admin" } } }, "classModule": { "type": "object", "properties": { "chapter": { "type": "string", "example": "chapter 1 - Pendahuluan" }, "estimation": { "type": "number", "example": 60 }, "module": { "type": "array", "items": { "$ref": "#/components/schemas/modul" } } } }, "userClass": { "type": "object", "properties": { "id": { "type": "integer", "format": "1", "example": "1" }, "uuid": { "type": "string", "format": "uuid", "example": "0033d087-4a4c-4828-a987-e6e0c72d37e9" }, "user_uuid": { "type": "array", "items": { "$ref": "#/components/schemas/user" } }, "class":{ "type": "array", "items": { "$ref": "#/components/schemas/class" } }, "is_onboarding":{ "type":"boolean", "example":true } } }, "classID": { "type": "object", "properties": { "description": { "type": "string", "example": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat" }, "classTarget": { "type": "array", "items": { "type": "string", "example": [ "Lorem ipsum dolor sit amet, consectetur adipiscing elit", "Lorem ipsum dolor sit amet, consectetur adipiscing elit", "Lorem ipsum dolor sit amet, consectetur adipiscing elit" ] } }, "telegram": { "type": "string", "example": "telegram.co.id" }, "onboarding": { "type": "string", "example": "Lorem ipsum dolor sit amet, consectetur adipiscing elit" }, "classModule": { "type": "array", "items": { "$ref": "#/components/schemas/classModule" } } } }, "userCoursePayments": { "type": "object", "properties": { "id": { "type": "integer", "format": "1", "example": "1" }, "uuid": { "type": "string", "format": "uuid", "example": "0033d087-4a4c-4828-a987-e6e0c72d37e9" }, "user_class_uuid": { "type": "array", "items": { "$ref": "#/components/schemas/userClass" } }, "payment_method": { "type": "string", "example": "credit card" }, "is_paid": { "type": "boolean", "example": true } } }, "class": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "example": "0033d087-4a4c-4828-a987-e6e0c72d37e9" }, "name": { "type": "string", "example": "Intro to Basic of User Interaction Design" }, "image": { "type": "string", "example": "https://www.image.com" }, "author": { "type": "string", "example": "nameexample" }, "price": { "type": "number", "example": 280000 }, "level": { "type": "string", "example": "Advanced" }, "rating": { "type": "number", "example": 4.9 }, "totalModule": { "type": "number", "example": 5 }, "totalMinute": { "type": "number", "example": 60 }, "isPremium": { "type": "boolean", "example": true }, "classCode": { "type": "string", "example": "UIUX0123" }, "category": { "type": "string", "example": "UI/UX Design" } } }, "classDetailNew": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "example": "0033d087-4a4c-4828-a987-e6e0c72d37e9" }, "name": { "type": "string", "example": "Intro to Basic of User Interaction Design" }, "image": { "type": "string", "example": "https://www.image.com" }, "author": { "type": "string", "example": "nameexample" }, "price": { "type": "number", "example": 280000 }, "level": { "type": "string", "example": "Advanced" }, "rating": { "type": "number", "example": 4.9 }, "totalModule": { "type": "number", "example": 5 }, "totalMinute": { "type": "number", "example": 60 }, "isPremium": { "type": "boolean", "example": true }, "classCode": { "type": "string", "example": "UIUX0123" }, "category": { "type": "string", "example": "UI/UX Design" } } }, "adminManagementClass": { "type": "object", "properties": { "classCode": { "type": "string", "example": "UIUX0123" }, "category": { "type": "string", "example": "UI/UX Design" }, "name": { "type": "string", "example": "Intro to Basic of User Interaction Design" }, "isPremium": { "type": "boolean", "example": true }, "level": { "type": "string", "example": "Advanced" }, "price": { "type": "number", "example": 280000 } } }, "classDetail": { "type": "object", "properties": { "status": { "type": "string", "example": "OK" }, "code": { "type": "number", "example": 200 }, "message": { "type": "string", "example": "Success" }, "data": { "allOf": [ { "$ref": "#/components/schemas/class" }, { "$ref": "#/components/schemas/classID" } ] } } }, "adminClass": { "type": "object", "properties": { "status": { "type": "string", "example": "OK" }, "code": { "type": "number", "example": 200 }, "message": { "type": "string", "example": "Success" }, "data": { "allOf": [ { "$ref": "#/components/schemas/class" }, { "$ref": "#/components/schemas/classID" } ] } } }, "classes": { "type": "object", "properties": { "status": { "type": "string", "example": "OK" }, "code": { "type": "number", "example": 200 }, "message": { "type": "string", "example": "Success" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/class" } } } }, "reqClass": { "type": "object", "properties": { "course_category_id": { "type": "string", "example": "4" }, "name": { "type": "string", "example": "Intro to Basic of User Interaction Design" }, "author": { "type": "string", "example": "Williamz1" }, "price": { "type": "string", "example": "280000" }, "level": { "type": "string", "example": "intermediate" }, "rating": { "type": "string", "example": "5" }, "isPremium": { "type": "string", "example": "true" }, "code": { "type": "string", "example": "UIUX0124" }, "intro_video": { "type": "string", "example": "https://www.youtube.com/embed/t3uVPX6rwgM?si=sxXq8LNBDtlP-ZFv" }, "chapters": { "type": "array", "items": { "type": "object", "properties": { "chapter": { "type": "string", "example": "Chapter 1" }, "duration": { "type": "string", "example": "30" }, "modules": { "type": "array", "items": { "type": "object", "properties": { "title": { "type": "string", "example": "Module 1" }, "course_link": { "type": "string", "example": "https://example.com/module1" }, "ImageData": { "type": "object", "properties": { "fieldname": { "type": "string", "example": "image" }, "originalname": { "type": "string", "example": "mitra_767893f5-ba57-494d-a95c-477ca5da6aca.png" }, "encoding": { "type": "string", "example": "7bit" }, "mimetype": { "type": "string", "example": "image/png" }, "buffer": { "type": "string", "example": "" }, "size": { "type": "integer", "example": 25888 } } } } } } } } } } }, "reqPayment": { "type": "object", "properties": { "payment_method": { "type": "string", "example": "credit card" }, "is_paid": { "type": "boolean", "example": true } } }, "reqValidateOtp": { "type": "object", "properties": { "otp": { "type": "integer", "example": 1234 } } }, "reqRegister": { "type": "object", "properties": { "name": { "type": "string", "example": "Fahrel" }, "email": { "type": "string", "example": "fahrel@gmail.com" }, "password": { "type": "string", "example": "fahrel123" }, "phone": { "type": "string", "example": "081231237" } } }, "resPayment": { "type": "array", "items": { "type": "object", "properties": { "courseUuid": { "type": "string", "example": "721e7486-5796-42e7-b55d-0f466b709d35" }, "paymentUuid": { "type": "string", "example": "54d3308d-7e83-4f9e-b3c6-ac6f7b8afdce" }, "userCourseUuid": { "type": "string", "example": "eb285ddf-45c3-4e49-a4c6-b4986d7bd8cd" }, "image": { "type": "string", "example": "https://res.cloudinary.com/dpg0tbbot/image/upload/v1701180735/b4zuplewxgtb5yxvw1gx.png" }, "courseCategory": { "type": "string", "example": "UI/UX Design" }, "courseName": { "type": "string", "example": "Intro to Basic of User Interaction Design" }, "courseAuthor": { "type": "string", "example": "Simon Doe" }, "courseLevel": { "type": "string", "example": "intermediate" }, "totalModules": { "type": "integer", "example": 1 }, "totalMinutes": { "type": "integer", "example": 42 }, "expiredAt": { "type": "string", "example": "2023-12-16T02:13:22.448Z" }, "courseRating": { "type": "string", "example": "4.5" }, "is_paid": { "type": "boolean", "example": true } } } }, "reqLogin": { "type": "object", "properties": { "email": { "type": "string", "example": "fahrel@gmail.com" }, "password": { "type": "string", "example": "fahrel123" } } }, "reqBuyCourse": { "type": "object", "properties": { "course_uuid": { "type": "string", "example": "7b835907-c7b4-43ed-a9ba-cf7e6d7043cb" } } }, "reqPaymentCourse": { "type": "object", "properties": { "course_uuid": { "type": "string", "example": "credit card" } } }, "resBuyCourse": { "type": "object", "properties": { "expiredAt": { "type": "string", "example": "2023-12-13 14:54:26.057+07" }, "uuid": { "type": "string", "example": "7b835907-c7b4-43ed-a9ba-cf7e6d7043cb" }, "user_course_uuid": { "type": "string", "example": "7b835907-c7b4-43ed-a9ba-cf7e6d7043cb" }, "payment_method": { "type": "string", "example": "credit card" }, "is_paid": { "type": "boolean", "example": false } } }, "unauthorized": { "type": "object", "properties": { "status": { "type": "string", "example": "unauthorized" }, "code": { "type": "number", "example": 401 }, "message": { "type": "string", "example": "unauthorized" } } }, "internalError": { "type": "object", "properties": { "status": { "type": "string", "example": "FAILED" }, "code": { "type": "number", "example": 500 }, "error": { "type": "string", "example": "Internal Server Error" } } }, "badRequest": { "type": "object", "properties": { "status": { "type": "string", "example": "Error" }, "code": { "type": "number", "example": 500 }, "message": { "type": "string", "example": "Bad Request" }, "error": { "type": "string", "example": "OTP must not be empty" } } } } } }