{
    "openapi": "3.0.0",
    "info": {
        "title": "E SLPHT API",
        "description": "API Documentation untuk aplikasi E SLPHT - Powered by Departemen Hama dan Penyakit Tumbuhan Universitas Gadjah Mada & PIAT (Pusat Inovasi Agroteknologi) Universitas Gadjah Mada",
        "contact": {
            "name": "E SLPHT Support",
            "email": "admin@eslpht.sunhouse.co.id"
        },
        "version": "1.1.0"
    },
    "servers": [
        {
            "url": "/api",
            "description": "API Server"
        }
    ],
    "paths": {
        "/login": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Login pengguna",
                "description": "Login menggunakan email dan password, mengembalikan token Sanctum",
                "operationId": "4b308fbeaa8dd2ad4f80668a5f4eaa91",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "email",
                                    "password"
                                ],
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "example": "user@example.com"
                                    },
                                    "password": {
                                        "type": "string",
                                        "example": "password123"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Login berhasil",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "properties": {
                                                "token": {
                                                    "type": "string",
                                                    "example": "1|abc123token"
                                                },
                                                "user": {
                                                    "$ref": "#/components/schemas/User"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Email/password salah",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/register": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Registrasi pengguna baru",
                "operationId": "e145fdd9dc6bd15e6d7f3f86ccd08313",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "email",
                                    "password",
                                    "cultivation_business",
                                    "address",
                                    "profession",
                                    "date_of_birth",
                                    "phone_number"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "John Doe"
                                    },
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "example": "john@example.com"
                                    },
                                    "password": {
                                        "type": "string",
                                        "minLength": 8,
                                        "example": "password123"
                                    },
                                    "cultivation_business": {
                                        "type": "string",
                                        "example": "Pertanian Padi"
                                    },
                                    "address": {
                                        "type": "string",
                                        "example": "Jl. Merdeka No. 1"
                                    },
                                    "profession": {
                                        "type": "string",
                                        "example": "Petani"
                                    },
                                    "date_of_birth": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "1990-01-01"
                                    },
                                    "phone_number": {
                                        "type": "string",
                                        "example": "081234567890"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Registrasi berhasil",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/User"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/update-photo": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Upload foto profil",
                "operationId": "ab7b847988feeef9276f9002fa4a1f95",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "required": [
                                    "photo"
                                ],
                                "properties": {
                                    "photo": {
                                        "description": "File gambar (max 3MB)",
                                        "type": "string",
                                        "format": "binary"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Upload berhasil",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "422": {
                        "description": "Validasi gagal"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/profile-update": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Update profil pengguna",
                "operationId": "939e309a99cece01d7c6a717e577cae2",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "email",
                                    "cultivation_business",
                                    "address",
                                    "profession",
                                    "date_of_birth",
                                    "phone_number"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "John Doe"
                                    },
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "example": "john@example.com"
                                    },
                                    "cultivation_business": {
                                        "type": "string",
                                        "example": "Pertanian Padi"
                                    },
                                    "address": {
                                        "type": "string",
                                        "example": "Jl. Merdeka No. 1"
                                    },
                                    "profession": {
                                        "type": "string",
                                        "example": "Petani"
                                    },
                                    "date_of_birth": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "1990-01-01"
                                    },
                                    "phone_number": {
                                        "type": "string",
                                        "example": "081234567890"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Update berhasil",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "422": {
                        "description": "Validasi gagal"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/password-update": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Update password",
                "operationId": "762efeee2f802f851642f241761b888a",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "password",
                                    "password_confirmation"
                                ],
                                "properties": {
                                    "password": {
                                        "type": "string",
                                        "minLength": 8,
                                        "example": "newpass123"
                                    },
                                    "password_confirmation": {
                                        "type": "string",
                                        "example": "newpass123"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Password diupdate",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "422": {
                        "description": "Validasi gagal"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/profile": {
            "get": {
                "tags": [
                    "Auth"
                ],
                "summary": "Get profil user yang login",
                "operationId": "2a61b1d2ebe1bb617069a2d234b71d3a",
                "responses": {
                    "200": {
                        "description": "Data profil",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/User"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/logout": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Logout pengguna",
                "description": "Menghapus semua token user",
                "operationId": "e162909e9d7cd687212c5383ebad5aec",
                "responses": {
                    "200": {
                        "description": "Logout berhasil",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "type": "string",
                                            "example": null,
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/game/{game}": {
            "get": {
                "tags": [
                    "Game"
                ],
                "summary": "Detail game",
                "operationId": "68d900df87f7774cfc31735397dc1521",
                "parameters": [
                    {
                        "name": "game",
                        "in": "path",
                        "description": "Game UUID",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Detail game dengan questions dan options",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Game"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "404": {
                        "description": "Game tidak ditemukan"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/module/{module}": {
            "get": {
                "tags": [
                    "Module"
                ],
                "summary": "Detail modul",
                "operationId": "db8e8a190917559013d0624f073fe990",
                "parameters": [
                    {
                        "name": "module",
                        "in": "path",
                        "description": "Module UUID",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Detail modul dengan sub modules",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Module"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "404": {
                        "description": "Modul tidak ditemukan"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/participant/{room}/join": {
            "post": {
                "tags": [
                    "Participant"
                ],
                "summary": "Bergabung ke kelas",
                "operationId": "b02f38a31ea9e1690a8c496164318119",
                "parameters": [
                    {
                        "name": "room",
                        "in": "path",
                        "description": "Room UUID",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil bergabung",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Room"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Sudah bergabung"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/participant": {
            "get": {
                "tags": [
                    "Participant"
                ],
                "summary": "Daftar kelas yang diikuti beserta nilai",
                "operationId": "d960325bb65e9c1b5147a90576f0e9df",
                "responses": {
                    "200": {
                        "description": "Daftar kelas dengan nilai",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Success"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/JoinedClass"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/participant/{participant}": {
            "get": {
                "tags": [
                    "Participant"
                ],
                "summary": "Cetak sertifikat",
                "description": "Generate dan download sertifikat PDF. Semua sesi harus sudah diselesaikan.",
                "operationId": "d9143b4fd2a3bf1cb609c9e0a4745a05",
                "parameters": [
                    {
                        "name": "participant",
                        "in": "path",
                        "description": "Participant UUID",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "URL sertifikat PDF",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Success"
                                        },
                                        "data": {
                                            "type": "string",
                                            "example": "http://localhost/sertifikat/uuid.pdf"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Belum menyelesaikan semua sesi"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/participant-sub-session/read-module": {
            "post": {
                "tags": [
                    "Participant Sub Session"
                ],
                "summary": "Tandai modul sudah dibaca",
                "operationId": "2855317d1ee75f5e26d4a1ff4040397f",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "sub_session_id"
                                ],
                                "properties": {
                                    "sub_session_id": {
                                        "description": "ID sub session yang berisi modul",
                                        "type": "string",
                                        "format": "uuid"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Berhasil ditandai",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "422": {
                        "description": "Validasi gagal"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/participant-sub-session/practice": {
            "post": {
                "tags": [
                    "Participant Sub Session"
                ],
                "summary": "Submit praktik lapangan",
                "operationId": "d107c4a1f726a6390e52e5a179721e77",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "required": [
                                    "sub_session_id",
                                    "comodity",
                                    "land_area",
                                    "plant_conditions",
                                    "pest",
                                    "photos"
                                ],
                                "properties": {
                                    "sub_session_id": {
                                        "type": "string",
                                        "format": "uuid"
                                    },
                                    "comodity": {
                                        "type": "string",
                                        "example": "Padi"
                                    },
                                    "land_area": {
                                        "type": "string",
                                        "example": "500m2"
                                    },
                                    "plant_conditions": {
                                        "type": "string",
                                        "example": "Baik"
                                    },
                                    "pest": {
                                        "type": "string",
                                        "example": "Wereng"
                                    },
                                    "photos[]": {
                                        "description": "Foto praktik (max 4MB per foto)",
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "format": "binary"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Praktik tersimpan",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "422": {
                        "description": "Validasi gagal"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/participant-sub-session/game": {
            "post": {
                "tags": [
                    "Participant Sub Session"
                ],
                "summary": "Submit jawaban game/kuis",
                "description": "Submit jawaban peserta untuk game/kuis. Mengembalikan hasil scoring termasuk jumlah jawaban benar, salah, dan tidak dijawab. Jika peserta sudah pernah menjawab, data tidak akan disimpan ulang.",
                "operationId": "33593b7b1653cdce2757b97e9804f318",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "sub_session_id",
                                    "questions"
                                ],
                                "properties": {
                                    "sub_session_id": {
                                        "type": "string",
                                        "format": "uuid"
                                    },
                                    "questions": {
                                        "type": "array",
                                        "items": {
                                            "properties": {
                                                "question_id": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "answered_id": {
                                                    "description": "ID option yang dipilih, nullable jika tidak menjawab",
                                                    "type": "string",
                                                    "format": "uuid",
                                                    "nullable": true
                                                }
                                            },
                                            "type": "object"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Jawaban tersimpan dengan hasil scoring",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "properties": {
                                                "result": {
                                                    "$ref": "#/components/schemas/GameResult"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "422": {
                        "description": "Validasi gagal"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/participant-sub-session/field-practice": {
            "get": {
                "tags": [
                    "Participant Sub Session"
                ],
                "summary": "Get hasil praktik lapangan",
                "operationId": "448ed7e1f2efc282ea3aae792a84a4c0",
                "parameters": [
                    {
                        "name": "sub_session_id",
                        "in": "query",
                        "description": "Sub Session UUID",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Data praktik lapangan",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/FieldPractice"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "404": {
                        "description": "Belum ada data praktik"
                    },
                    "422": {
                        "description": "Validasi gagal"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/reset-password/otp": {
            "post": {
                "tags": [
                    "Reset Password"
                ],
                "summary": "Kirim OTP ke email",
                "operationId": "9b532ba0cfa1ccc5f914a8a371ef9e19",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "email"
                                ],
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "example": "user@example.com"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OTP terkirim",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "properties": {
                                                "email": {
                                                    "type": "string",
                                                    "example": "user@example.com"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal"
                    }
                }
            }
        },
        "/reset-password/validate-otp": {
            "post": {
                "tags": [
                    "Reset Password"
                ],
                "summary": "Validasi kode OTP",
                "operationId": "b216d4cf44de9b1024a9fadfc31cb62d",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "email",
                                    "otp"
                                ],
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "example": "user@example.com"
                                    },
                                    "otp": {
                                        "type": "string",
                                        "maxLength": 6,
                                        "minLength": 6,
                                        "example": "123456"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OTP valid",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "properties": {
                                                "token": {
                                                    "type": "string"
                                                },
                                                "email": {
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "OTP tidak valid"
                    },
                    "422": {
                        "description": "Validasi gagal"
                    }
                }
            }
        },
        "/reset-password": {
            "post": {
                "tags": [
                    "Reset Password"
                ],
                "summary": "Reset password dengan token",
                "operationId": "5eaff4095cd2085d61e22a547f82cfd6",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "email",
                                    "password",
                                    "password_confirmation",
                                    "token"
                                ],
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "example": "user@example.com"
                                    },
                                    "password": {
                                        "type": "string",
                                        "minLength": 8,
                                        "example": "newpass123"
                                    },
                                    "password_confirmation": {
                                        "type": "string",
                                        "example": "newpass123"
                                    },
                                    "token": {
                                        "description": "Token dari validate-otp",
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Password berhasil direset",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Token tidak valid"
                    },
                    "422": {
                        "description": "Validasi gagal"
                    }
                }
            }
        },
        "/room/beranda": {
            "get": {
                "tags": [
                    "Room"
                ],
                "summary": "Beranda - daftar kelas",
                "description": "Tanpa parameter status = kelas populer. Dengan status = filter by status. is_my_class=1 untuk kelas saya.",
                "operationId": "effc2d18b54fdd2f8ef028eed939bf4d",
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "is_my_class",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        }
                    },
                    {
                        "name": "mix",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 10
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Daftar kelas",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Room"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/room/{room}": {
            "get": {
                "tags": [
                    "Room"
                ],
                "summary": "Detail kelas",
                "description": "Menampilkan detail kelas beserta daftar sessions (SessionList). Setiap session memiliki id, session_type, sequence, dan is_done.",
                "operationId": "d82a0f08b6cfc4fb2ebcf35f8252dd74",
                "parameters": [
                    {
                        "name": "room",
                        "in": "path",
                        "description": "Room UUID",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Detail kelas dengan sessions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/RoomDetail"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "404": {
                        "description": "Room tidak ditemukan"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/session/{session}": {
            "get": {
                "tags": [
                    "Session"
                ],
                "summary": "Detail sesi",
                "description": "Menampilkan detail sesi beserta daftar sub sessions (SubSessionList). Setiap sub session berisi materi, game, diskusi, dan praktik lapangan.",
                "operationId": "2f384f2a8b71fdcad5cd39e1cefa7f3e",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "description": "Session UUID",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Detail sesi dengan sub sessions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/SessionDetail"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "404": {
                        "description": "Sesi tidak ditemukan"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/sub-session/{subSession}": {
            "get": {
                "tags": [
                    "Sub Session"
                ],
                "summary": "Detail sub sesi",
                "description": "Menampilkan detail sub sesi termasuk materi, game, diskusi, atau praktik lapangan beserta jawaban peserta (practice_answer) dan foto praktik (field_practice_images)",
                "operationId": "dc0964956c5aef8ca424f0ec32b61134",
                "parameters": [
                    {
                        "name": "subSession",
                        "in": "path",
                        "description": "SubSession UUID",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Detail sub sesi",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/SubSessionDetail"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "404": {
                        "description": "Sub sesi tidak ditemukan"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/token/validation": {
            "get": {
                "tags": [
                    "Auth"
                ],
                "summary": "Validasi token",
                "description": "Mengecek apakah token Bearer yang diberikan masih valid",
                "operationId": "32d3103742e121cc3c3a18911f3cd52e",
                "responses": {
                    "200": {
                        "description": "Token valid",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Token tidak valid atau expired"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/sertifikat": {
            "get": {
                "tags": [
                    "Participant"
                ],
                "summary": "Webview sertifikat (public)",
                "description": "Menampilkan sertifikat dalam format webview. Tidak memerlukan autentikasi.",
                "operationId": "31dccf4d2e7fb7ab92653e711a06bef3",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Participant UUID",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTML sertifikat"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "ApiResponse": {
                "properties": {
                    "status": {
                        "type": "integer",
                        "example": 200
                    },
                    "message": {
                        "type": "string",
                        "example": "success"
                    },
                    "data": {
                        "type": "object"
                    }
                },
                "type": "object"
            },
            "ErrorResponse": {
                "properties": {
                    "status": {
                        "type": "integer",
                        "example": 400
                    },
                    "message": {
                        "type": "string",
                        "example": "Invalid request"
                    },
                    "data": {
                        "type": "string",
                        "example": "Error message"
                    }
                },
                "type": "object"
            },
            "ValidationError": {
                "properties": {
                    "message": {
                        "type": "string",
                        "example": "The given data was invalid."
                    },
                    "errors": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                },
                "type": "object"
            },
            "User": {
                "properties": {
                    "id": {
                        "type": "integer",
                        "example": 1
                    },
                    "name": {
                        "type": "string",
                        "example": "John Doe"
                    },
                    "email": {
                        "type": "string",
                        "example": "john@example.com"
                    },
                    "phone_number": {
                        "type": "string",
                        "example": "081234567890"
                    },
                    "date_of_birth": {
                        "type": "string",
                        "format": "date",
                        "example": "1990-01-01"
                    },
                    "profession": {
                        "type": "string",
                        "example": "Petani"
                    },
                    "cultivation_business": {
                        "type": "string",
                        "example": "Pertanian Padi"
                    },
                    "address": {
                        "type": "string",
                        "example": "Jl. Merdeka No. 1"
                    },
                    "photo": {
                        "type": "string",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "Room": {
                "description": "Room list resource - digunakan pada endpoint beranda",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "name": {
                        "type": "string",
                        "example": "Kelas PHT Padi 2026"
                    },
                    "desc": {
                        "description": "Deskripsi singkat (5 kata pertama)",
                        "type": "string"
                    },
                    "start_date": {
                        "type": "string",
                        "example": "01 Januari 2026"
                    },
                    "end_date": {
                        "type": "string",
                        "example": "31 Maret 2026"
                    },
                    "status": {
                        "type": "string"
                    },
                    "thumbnail_url": {
                        "type": "string"
                    },
                    "participants_count": {
                        "type": "integer"
                    },
                    "joined": {
                        "type": "integer"
                    },
                    "approved": {
                        "description": "0 = belum join, 1 = approved, 2 = pending approval",
                        "type": "integer"
                    },
                    "category": {
                        "$ref": "#/components/schemas/Category"
                    }
                },
                "type": "object"
            },
            "RoomDetail": {
                "description": "Room detail resource - digunakan pada endpoint detail kelas",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "name": {
                        "type": "string",
                        "example": "Kelas PHT Padi 2026"
                    },
                    "sessions": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/SessionList"
                        }
                    }
                },
                "type": "object"
            },
            "Category": {
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "SessionList": {
                "description": "Session list resource - digunakan pada room detail",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "session_type": {
                        "type": "string",
                        "enum": [
                            "Materi",
                            "Game",
                            "Diskusi",
                            "Praktik Lapangan"
                        ]
                    },
                    "sequence": {
                        "description": "Urutan sesi",
                        "type": "integer",
                        "example": 1
                    },
                    "is_done": {
                        "description": "Apakah semua sub sesi sudah diselesaikan peserta",
                        "type": "boolean"
                    }
                },
                "type": "object"
            },
            "SessionDetail": {
                "description": "Session detail resource - digunakan pada endpoint detail sesi",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "session_type": {
                        "type": "string",
                        "enum": [
                            "Materi",
                            "Game",
                            "Diskusi",
                            "Praktik Lapangan"
                        ]
                    },
                    "sub_sessions": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/SubSessionList"
                        }
                    }
                },
                "type": "object"
            },
            "SubSessionList": {
                "description": "Sub session list resource - digunakan pada session detail. Tidak menyertakan practice_answer dan field_practice_images.",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "materi": {
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/Module"
                            }
                        ],
                        "nullable": true
                    },
                    "game": {
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/Game"
                            }
                        ],
                        "nullable": true
                    },
                    "discussion_name": {
                        "type": "string",
                        "nullable": true
                    },
                    "discussion": {
                        "type": "string",
                        "nullable": true
                    },
                    "discussion_thumbnail_url": {
                        "type": "string",
                        "nullable": true
                    },
                    "practice_name": {
                        "type": "string",
                        "nullable": true
                    },
                    "field_practice": {
                        "type": "string",
                        "nullable": true
                    },
                    "is_done": {
                        "description": "Apakah sub sesi sudah diselesaikan peserta",
                        "type": "boolean"
                    }
                },
                "type": "object"
            },
            "SubSessionDetail": {
                "description": "Sub session detail resource - digunakan pada endpoint detail sub sesi. Menyertakan practice_answer dan field_practice_images.",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "materi": {
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/Module"
                            }
                        ],
                        "nullable": true
                    },
                    "game": {
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/Game"
                            }
                        ],
                        "nullable": true
                    },
                    "discussion_name": {
                        "type": "string",
                        "nullable": true
                    },
                    "discussion": {
                        "type": "string",
                        "nullable": true
                    },
                    "discussion_thumbnail_url": {
                        "type": "string",
                        "nullable": true
                    },
                    "practice_name": {
                        "type": "string",
                        "nullable": true
                    },
                    "field_practice": {
                        "type": "string",
                        "nullable": true
                    },
                    "practice_answer": {
                        "description": "Jawaban praktik lapangan peserta",
                        "type": "object",
                        "nullable": true
                    },
                    "is_done": {
                        "description": "Apakah sub sesi sudah diselesaikan peserta",
                        "type": "boolean"
                    },
                    "field_practice_images": {
                        "type": "array",
                        "items": {
                            "properties": {
                                "id": {
                                    "type": "string"
                                },
                                "image_url": {
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        }
                    }
                },
                "type": "object"
            },
            "Module": {
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "name": {
                        "type": "string",
                        "example": "Modul Pengenalan PHT"
                    },
                    "sub_modules": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/SubModule"
                        }
                    }
                },
                "type": "object"
            },
            "SubModule": {
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "content": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "Game": {
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "name": {
                        "type": "string",
                        "example": "Kuis PHT"
                    },
                    "questions": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Question"
                        }
                    },
                    "result": {
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/GameResult"
                            }
                        ],
                        "nullable": true,
                        "description": "Hasil game jika peserta sudah menjawab, null jika belum"
                    }
                },
                "type": "object"
            },
            "GameResult": {
                "description": "Hasil scoring game/kuis peserta",
                "properties": {
                    "total_questions": {
                        "type": "integer",
                        "example": 10
                    },
                    "correct_count": {
                        "type": "integer",
                        "example": 7
                    },
                    "wrong_count": {
                        "type": "integer",
                        "example": 2
                    },
                    "unanswered_count": {
                        "type": "integer",
                        "example": 1
                    },
                    "score": {
                        "type": "integer",
                        "example": 70
                    }
                },
                "type": "object"
            },
            "Question": {
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "question": {
                        "type": "string"
                    },
                    "type": {
                        "description": "Tipe pertanyaan",
                        "type": "string"
                    },
                    "is_answered": {
                        "description": "Selalu false dari API (dihandle di client)",
                        "type": "boolean",
                        "example": false
                    },
                    "participant_answer": {
                        "description": "Selalu empty string dari API (dihandle di client)",
                        "type": "string",
                        "example": ""
                    },
                    "old_participant_answer": {
                        "description": "ID option yang pernah dijawab peserta sebelumnya",
                        "type": "string",
                        "format": "uuid",
                        "nullable": true
                    },
                    "is_correct": {
                        "description": "Apakah jawaban peserta benar, null jika belum menjawab",
                        "type": "boolean",
                        "nullable": true
                    },
                    "correct_option_id": {
                        "description": "ID option yang benar, null jika belum menjawab",
                        "type": "string",
                        "format": "uuid",
                        "nullable": true
                    },
                    "participant_value": {
                        "description": "Nilai yang didapat peserta untuk pertanyaan ini",
                        "type": "integer",
                        "example": 0
                    },
                    "options": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Option"
                        }
                    }
                },
                "type": "object"
            },
            "Option": {
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "answer": {
                        "description": "Teks jawaban",
                        "type": "string"
                    },
                    "type": {
                        "description": "Tipe option (text/image)",
                        "type": "string"
                    },
                    "image": {
                        "description": "Path gambar jika tipe image",
                        "type": "string",
                        "nullable": true
                    },
                    "image_url": {
                        "description": "Full URL gambar",
                        "type": "string",
                        "nullable": true
                    },
                    "value": {
                        "description": "Nilai option (tertinggi = jawaban benar)",
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "FieldPractice": {
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "sub_session_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "comodity": {
                        "type": "string",
                        "example": "Padi"
                    },
                    "land_area": {
                        "type": "string",
                        "example": "500m2"
                    },
                    "plant_conditions": {
                        "type": "string",
                        "example": "Baik"
                    },
                    "pest": {
                        "type": "string",
                        "example": "Wereng"
                    },
                    "value": {
                        "type": "number",
                        "nullable": true
                    },
                    "photo_url": {
                        "type": "string"
                    },
                    "field_practice_images": {
                        "type": "array",
                        "items": {
                            "properties": {
                                "id": {
                                    "type": "string"
                                },
                                "image_url": {
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "created_at": {
                        "type": "string",
                        "format": "datetime",
                        "example": "2026-01-15 10:30:00"
                    }
                },
                "type": "object"
            },
            "JoinedClass": {
                "properties": {
                    "participant_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "room_name": {
                        "type": "string",
                        "example": "Kelas PHT Padi"
                    },
                    "status": {
                        "type": "string"
                    },
                    "nilai": {
                        "type": "number",
                        "format": "float",
                        "example": 85.5
                    }
                },
                "type": "object"
            }
        },
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "description": "Masukkan token dari response login",
                "bearerFormat": "sanctum",
                "scheme": "bearer"
            }
        }
    },
    "tags": [
        {
            "name": "Auth",
            "description": "Autentikasi pengguna"
        },
        {
            "name": "Game",
            "description": "Game/Kuis"
        },
        {
            "name": "Module",
            "description": "Modul materi"
        },
        {
            "name": "Participant",
            "description": "Peserta kelas"
        },
        {
            "name": "Participant Sub Session",
            "description": "Aktivitas peserta pada sub sesi (baca materi, praktik, game)"
        },
        {
            "name": "Reset Password",
            "description": "Reset password via OTP email"
        },
        {
            "name": "Room",
            "description": "Kelas/Ruangan"
        },
        {
            "name": "Session",
            "description": "Sesi kelas"
        },
        {
            "name": "Sub Session",
            "description": "Sub sesi kelas"
        }
    ]
}