{
  "openapi": "3.1.0",
  "info": {
    "title": "Tapee API Gateway",
    "version": "1.0.0",
    "description": "สัญญา API ที่ตรวจจาก source code วันที่ 2026-10-09. Base URL https://api.tapee.ac.th; ส่ง x-api-key สำหรับ /api/v1/* ยกเว้น health/access request; ผู้ดูแลใช้ x-admin-token. JSON ทุกคำขอเขียน; เก็บ requestId เพื่อสอบกลับ. คีย์และข้อมูลส่วนบุคคลต้องอยู่ฝั่งเซิร์ฟเวอร์. CORS ขึ้นกับ allowed origins และไม่แทนที่การตรวจ API key/IP."
  },
  "servers": [
    {
      "url": "https://api.tapee.ac.th"
    }
  ],
  "tags": [
    {
      "name": "System"
    },
    {
      "name": "Access"
    },
    {
      "name": "Admin"
    },
    {
      "name": "Students"
    },
    {
      "name": "Registrations"
    },
    {
      "name": "RegisterNet"
    },
    {
      "name": "SectionOrder"
    },
    {
      "name": "Graduation"
    },
    {
      "name": "Teaching"
    },
    {
      "name": "Transfers"
    }
  ],
  "paths": {
    "/api/health": {
      "get": {
        "operationId": "getHealth",
        "tags": [
          "System"
        ],
        "summary": "ตรวจสถานะ gateway",
        "responses": {
          "200": {
            "description": "สถานะระบบ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          },
          "503": {
            "description": "ฟีเจอร์ปิดหรือฐานข้อมูลไม่พร้อม",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "db",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "1 เพื่อตรวจ MSSQL"
          },
          {
            "name": "appdb",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "1 เพื่อตรวจฐานข้อมูลแอป"
          }
        ],
        "security": []
      }
    },
    "/api/access-requests": {
      "post": {
        "operationId": "createAccessRequest",
        "tags": [
          "Access"
        ],
        "summary": "ยื่นคำขอใช้ API",
        "responses": {
          "201": {
            "description": "รับคำขอแล้ว",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "requestCode": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "ข้อมูลคำขอไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "เกิน rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "ข้อผิดพลาดภายใน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccessRequest"
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/admin/access-requests": {
      "get": {
        "operationId": "listAccessRequests",
        "tags": [
          "Admin"
        ],
        "summary": "รายการคำขอใช้ API",
        "responses": {
          "200": {
            "description": "รายการสูงสุด 200 รายการ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {},
                        "additionalProperties": true
                      }
                    },
                    "count": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "requestId",
                    "data",
                    "count"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "ไม่มีหรือไม่ถูกต้องของ API key/admin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "เกิน rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "ข้อผิดพลาดภายใน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "ฟีเจอร์ปิดหรือฐานข้อมูลไม่พร้อม",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "AdminToken": []
          }
        ]
      }
    },
    "/api/admin/access-requests/{id}/approve": {
      "post": {
        "operationId": "approveAccessRequest",
        "tags": [
          "Admin"
        ],
        "summary": "อนุมัติคำขอและสร้าง API key",
        "responses": {
          "200": {
            "description": "อนุมัติแล้ว; คืน apiKey เพียงครั้งเดียว",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "clientId": {
                      "type": "integer"
                    },
                    "apiKeyId": {
                      "type": "integer"
                    },
                    "apiKey": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "ไม่มีหรือไม่ถูกต้องของ API key/admin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ไม่พบข้อมูล/endpoint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ข้อมูลซ้ำหรือขัดแย้ง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "เกิน rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "ข้อผิดพลาดภายใน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "ฟีเจอร์ปิดหรือฐานข้อมูลไม่พร้อม",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "adminNote": {
                    "type": "string",
                    "maxLength": 2000
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "security": [
          {
            "AdminToken": []
          }
        ]
      }
    },
    "/api/admin/access-requests/{id}/reject": {
      "post": {
        "operationId": "rejectAccessRequest",
        "tags": [
          "Admin"
        ],
        "summary": "ปฏิเสธคำขอ",
        "responses": {
          "200": {
            "description": "ปฏิเสธแล้ว",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "ไม่มีหรือไม่ถูกต้องของ API key/admin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ไม่พบข้อมูล/endpoint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "เกิน rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "ข้อผิดพลาดภายใน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "ฟีเจอร์ปิดหรือฐานข้อมูลไม่พร้อม",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "adminNote": {
                    "type": "string",
                    "maxLength": 2000
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "security": [
          {
            "AdminToken": []
          }
        ]
      }
    },
    "/api/v1": {
      "get": {
        "operationId": "getApiIndex",
        "tags": [
          "System"
        ],
        "summary": "ดูรายการ API เบื้องต้น",
        "responses": {
          "200": {
            "description": "รายการ endpoint",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "service": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": "string"
                    },
                    "client": {
                      "type": "string"
                    },
                    "endpoints": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "method": {
                            "type": "string"
                          },
                          "path": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "ไม่มีหรือไม่ถูกต้องของ API key/admin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "เกิน rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "any valid API key",
        "description": "รายการนี้เป็น discovery แบบย่อ; OpenAPI document นี้เป็นรายการครบทุก endpoint."
      }
    },
    "/api/v1/server-time": {
      "get": {
        "operationId": "getServerTime",
        "tags": [
          "System"
        ],
        "summary": "อ่านเวลาของ SQL Server",
        "responses": {
          "200": {
            "description": "เวลาเซิร์ฟเวอร์",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "serverTime": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "requestId",
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "ไม่มีหรือไม่ถูกต้องของ API key/admin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope หรือ IP ไม่อนุญาต",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "เกิน rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "ข้อผิดพลาดภายใน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "server-time:read"
      }
    },
    "/api/v1/students": {
      "get": {
        "operationId": "getStudents",
        "tags": [
          "Students"
        ],
        "summary": "ค้นหานักศึกษา",
        "responses": {
          "200": {
            "description": "รายการนักศึกษา",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Student"
                      }
                    },
                    "count": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "requestId",
                    "data",
                    "count"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "ข้อมูลคำขอไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "ไม่มีหรือไม่ถูกต้องของ API key/admin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope หรือ IP ไม่อนุญาต",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "เกิน rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "ข้อผิดพลาดภายใน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "years",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YY หรือ YY-YY; ช่วงไม่เกิน 10 ปี"
          },
          {
            "name": "studentIds",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "รหัสนักศึกษาคั่น comma สูงสุด 100 รหัส; ต้องมี years หรือ studentIds"
          },
          {
            "name": "faculty",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "major",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 500
            }
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "students:read"
      }
    },
    "/api/v1/student-options": {
      "get": {
        "operationId": "getStudentOptions",
        "tags": [
          "Students"
        ],
        "summary": "อ่านชุดตัวเลือกคณะ สาขา และระดับ",
        "responses": {
          "200": {
            "description": "ตัวเลือกไม่ซ้ำ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/StudentOption"
                      }
                    },
                    "count": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "requestId",
                    "data",
                    "count"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "ไม่มีหรือไม่ถูกต้องของ API key/admin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope หรือ IP ไม่อนุญาต",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "เกิน rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "ข้อผิดพลาดภายใน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "students:read"
      }
    },
    "/api/v1/students/{studentId}/registrations": {
      "get": {
        "operationId": "getRegistrations",
        "tags": [
          "Registrations"
        ],
        "summary": "อ่านรายการลงทะเบียนจาก REGISTER",
        "responses": {
          "200": {
            "description": "รายการสูงสุด 500 แถว",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Registration"
                      }
                    },
                    "count": {
                      "type": "integer"
                    },
                    "studentId": {
                      "type": "string"
                    },
                    "academicYear": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "semester": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "requestId",
                    "data",
                    "count"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "ข้อมูลคำขอไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "ไม่มีหรือไม่ถูกต้องของ API key/admin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope หรือ IP ไม่อนุญาต",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "ผลลัพธ์เกินขีดจำกัด",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "เกิน rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "ข้อผิดพลาดภายใน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "studentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4,15}$"
            }
          },
          {
            "name": "year",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^25[0-9]{2}$",
              "example": "2569"
            }
          },
          {
            "name": "semester",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-3]$",
              "example": "1"
            },
            "description": "หากส่ง semester ต้องส่ง year"
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "registrations:read"
      }
    },
    "/api/v1/students/{studentId}/register-net": {
      "get": {
        "operationId": "getRegisterNet",
        "tags": [
          "RegisterNet"
        ],
        "summary": "อ่าน RegisterNet ครบ 11 คอลัมน์",
        "responses": {
          "200": {
            "description": "รายการสูงสุด 500 แถว",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RegisterNetRow"
                      }
                    },
                    "count": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "requestId",
                    "data",
                    "count"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "ข้อมูลคำขอไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "ไม่มีหรือไม่ถูกต้องของ API key/admin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope หรือ IP ไม่อนุญาต",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "ผลลัพธ์เกินขีดจำกัด",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "เกิน rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "ข้อผิดพลาดภายใน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "studentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 10,
              "minLength": 1
            }
          },
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}$"
            }
          },
          {
            "name": "semester",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]$"
            }
          },
          {
            "name": "courseCode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 10
            }
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "register-net:read"
      }
    },
    "/api/v1/section-orders": {
      "get": {
        "operationId": "listSectionOrders",
        "tags": [
          "SectionOrder"
        ],
        "summary": "อ่านกลุ่มเรียนครบ 10 คอลัมน์",
        "responses": {
          "200": {
            "description": "รายการสูงสุด 500 แถว",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SectionOrderRow"
                      }
                    },
                    "count": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "requestId",
                    "data",
                    "count"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "ข้อมูลคำขอไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "ไม่มีหรือไม่ถูกต้องของ API key/admin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope หรือ IP ไม่อนุญาต",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "ผลลัพธ์เกินขีดจำกัด",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "เกิน rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "ข้อผิดพลาดภายใน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}$"
            }
          },
          {
            "name": "term",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]$"
            }
          },
          {
            "name": "courseCode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 10
            }
          },
          {
            "name": "section",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4
            }
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "section-orders:read"
      },
      "post": {
        "operationId": "createSectionOrder",
        "tags": [
          "SectionOrder"
        ],
        "summary": "เพิ่มกลุ่มเรียน",
        "responses": {
          "201": {
            "description": "เพิ่มสำเร็จ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "data": {
                      "$ref": "#/components/schemas/SectionOrderRow"
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "requestId",
                    "data"
                  ]
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Hash ของค่าทั้ง 10 คอลัมน์ ใช้เป็น If-Match สำหรับ PUT",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "ข้อมูลคำขอไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "ไม่มีหรือไม่ถูกต้องของ API key/admin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope หรือ IP ไม่อนุญาต",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ข้อมูลซ้ำหรือขัดแย้ง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "เกิน rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "ข้อผิดพลาดภายใน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "ฟีเจอร์ปิดหรือฐานข้อมูลไม่พร้อม",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SectionOrderRow"
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "section-orders:write",
        "x-feature-state": "enabled",
        "description": "รับ Total, OrderHow, OrderHowNet ตามที่ส่งมา; ไม่ตรวจเทียบ REGISTER หรือ RegisterNet; อีก 6 ช่อง nullable และเมื่อไม่ส่งจะบันทึก NULL."
      }
    },
    "/api/v1/section-orders/{year}/{term}/{courseCode}/{section}": {
      "get": {
        "operationId": "getSectionOrder",
        "tags": [
          "SectionOrder"
        ],
        "summary": "อ่านหนึ่งกลุ่มพร้อม ETag",
        "responses": {
          "200": {
            "description": "ข้อมูลหนึ่งแถว",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "data": {
                      "$ref": "#/components/schemas/SectionOrderRow"
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "requestId",
                    "data"
                  ]
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Hash ของค่าทั้ง 10 คอลัมน์ ใช้เป็น If-Match สำหรับ PUT",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "ข้อมูลคำขอไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "ไม่มีหรือไม่ถูกต้องของ API key/admin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope หรือ IP ไม่อนุญาต",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ไม่พบข้อมูล/endpoint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "เกิน rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "ข้อผิดพลาดภายใน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}$"
            }
          },
          {
            "name": "term",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]$"
            }
          },
          {
            "name": "courseCode",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 10
            }
          },
          {
            "name": "section",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 4
            }
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "section-orders:read"
      },
      "put": {
        "operationId": "updateSectionOrder",
        "tags": [
          "SectionOrder"
        ],
        "summary": "แก้กลุ่มเรียนเต็มแถวพร้อม If-Match",
        "responses": {
          "200": {
            "description": "แก้สำเร็จและคืน ETag ใหม่",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "data": {
                      "$ref": "#/components/schemas/SectionOrderRow"
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "requestId",
                    "data"
                  ]
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Hash ของค่าทั้ง 10 คอลัมน์ ใช้เป็น If-Match สำหรับ PUT",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "ข้อมูลคำขอไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "ไม่มีหรือไม่ถูกต้องของ API key/admin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope หรือ IP ไม่อนุญาต",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ไม่พบข้อมูล/endpoint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "If-Match ไม่ตรงกับข้อมูลปัจจุบัน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "ไม่ได้ส่ง If-Match",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "เกิน rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "ข้อผิดพลาดภายใน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "ฟีเจอร์ปิดหรือฐานข้อมูลไม่พร้อม",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}$"
            }
          },
          {
            "name": "term",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]$"
            }
          },
          {
            "name": "courseCode",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 10
            }
          },
          {
            "name": "section",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 4
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ETag จาก GET รายการเดียว"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SectionOrderRow"
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "section-orders:write",
        "x-feature-state": "enabled",
        "description": "คีย์หลักใน body ต้องตรง URL; เปลี่ยนคีย์ไม่ได้; counter values are stored as supplied."
      }
    },
    "/api/v1/graduation-student-profile": {
      "get": {
        "operationId": "getGraduationStudentProfile",
        "tags": [
          "Graduation"
        ],
        "summary": "อ่านข้อมูลนักศึกษาเพื่อระบบสำเร็จการศึกษา",
        "responses": {
          "200": {
            "description": "ข้อมูลนักศึกษาหรือ null",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "data": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/GraduationProfile"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "requestId",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "ข้อมูลคำขอไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "ไม่มีหรือไม่ถูกต้องของ API key/admin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope หรือ IP ไม่อนุญาต",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "เกิน rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "ข้อผิดพลาดภายใน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "studentId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._-]{4,30}$"
            }
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "graduation-student-profile:read"
      }
    },
    "/api/v1/student-verification": {
      "post": {
        "operationId": "verifyStudentByCitizenId",
        "tags": [
          "Graduation"
        ],
        "summary": "ตรวจเลขบัตรประชาชนเพื่อระบบสำเร็จการศึกษา",
        "responses": {
          "200": {
            "description": "verified และข้อมูลหรือ null",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "verified": {
                      "type": "boolean"
                    },
                    "data": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/VerificationProfile"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "requestId",
                    "verified",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "ข้อมูลคำขอไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "ไม่มีหรือไม่ถูกต้องของ API key/admin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope หรือ IP ไม่อนุญาต",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "เกิน rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "ข้อผิดพลาดภายใน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "purpose": {
                    "type": "string",
                    "const": "graduation"
                  },
                  "citizenId": {
                    "type": "string",
                    "pattern": "^[0-9]{13}$"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "purpose",
                  "citizenId"
                ]
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "graduation-student-profile:read"
      }
    },
    "/api/v1/teaching-loads": {
      "get": {
        "operationId": "getTeachingLoads",
        "tags": [
          "Teaching"
        ],
        "summary": "อ่านภาระสอนและจำนวนลงทะเบียน",
        "responses": {
          "200": {
            "description": "ภาระสอน",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TeachingLoad"
                      }
                    },
                    "count": {
                      "type": "integer"
                    },
                    "academicYear": {
                      "type": "string"
                    },
                    "semester": {
                      "type": "string"
                    },
                    "teacherId": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "timsInstructorId": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "requestId",
                    "data",
                    "count"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "ข้อมูลคำขอไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "ไม่มีหรือไม่ถูกต้องของ API key/admin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope หรือ IP ไม่อนุญาต",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "เกิน rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "ข้อผิดพลาดภายใน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^25[0-9]{2}$",
              "example": "2569"
            }
          },
          {
            "name": "semester",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-3]$",
              "example": "1"
            }
          },
          {
            "name": "teacherId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._@-]{1,64}$"
            }
          },
          {
            "name": "timsInstructorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,20}$"
            },
            "description": "ต้องระบุ teacherId ร่วมด้วย"
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "teaching-loads:read"
      }
    },
    "/api/v1/teachers/{teacherId}/teaching-loads": {
      "get": {
        "operationId": "getTeacherTeachingLoads",
        "tags": [
          "Teaching"
        ],
        "summary": "อ่านภาระสอนของอาจารย์หนึ่งคน",
        "responses": {
          "200": {
            "description": "ภาระสอน",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TeachingLoad"
                      }
                    },
                    "count": {
                      "type": "integer"
                    },
                    "academicYear": {
                      "type": "string"
                    },
                    "semester": {
                      "type": "string"
                    },
                    "teacherId": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "timsInstructorId": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "requestId",
                    "data",
                    "count"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "ข้อมูลคำขอไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "ไม่มีหรือไม่ถูกต้องของ API key/admin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope หรือ IP ไม่อนุญาต",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "เกิน rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "ข้อผิดพลาดภายใน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "teacherId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._@-]{1,64}$"
            }
          },
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^25[0-9]{2}$",
              "example": "2569"
            }
          },
          {
            "name": "semester",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-3]$",
              "example": "1"
            }
          },
          {
            "name": "timsInstructorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,20}$"
            },
            "description": "ต้องระบุ teacherId ร่วมด้วย"
          }
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "teaching-loads:read"
      }
    },
    "/api/v1/transfer-grades": {
      "post": {
        "operationId": "createTransferGrade",
        "tags": [
          "Transfers"
        ],
        "summary": "บันทึกเทียบโอนจาก ปวส./ความรู้/ประสบการณ์",
        "responses": {
          "201": {
            "description": "บันทึกแล้ว; grade เป็น S",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "studentId": {
                          "type": "string",
                          "pattern": "^[0-9]{4,10}$"
                        },
                        "year": {
                          "type": "string",
                          "pattern": "^25[0-9]{2}$",
                          "example": "2569"
                        },
                        "semester": {
                          "type": "string",
                          "pattern": "^[0-3]$",
                          "example": "1"
                        },
                        "courseCode": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 10
                        },
                        "grade": {
                          "type": "string",
                          "const": "S"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "requestId",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "ข้อมูลคำขอไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "ไม่มีหรือไม่ถูกต้องของ API key/admin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope หรือ IP ไม่อนุญาต",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ไม่พบข้อมูล/endpoint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ข้อมูลซ้ำหรือขัดแย้ง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "เกิน rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "ข้อผิดพลาดภายใน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "ฟีเจอร์ปิดหรือฐานข้อมูลไม่พร้อม",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferRequest"
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "transfer-grades:write",
        "x-feature-state": "enabled",
        "description": "ไม่สร้าง REGISTER โดยอัตโนมัติ"
      }
    },
    "/api/v1/external-transfers": {
      "post": {
        "operationId": "createExternalTransfer",
        "tags": [
          "Transfers"
        ],
        "summary": "บันทึกเทียบโอนต่างสถาบัน",
        "responses": {
          "201": {
            "description": "บันทึกแล้ว",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "studentId": {
                          "type": "string",
                          "pattern": "^[0-9]{4,10}$"
                        },
                        "year": {
                          "type": "string",
                          "pattern": "^25[0-9]{2}$",
                          "example": "2569"
                        },
                        "semester": {
                          "type": "string",
                          "pattern": "^[0-3]$",
                          "example": "1"
                        },
                        "courseCode": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 10
                        },
                        "universityId": {
                          "type": "string",
                          "pattern": "^[0-9]{5}$"
                        },
                        "gradeCode": {
                          "type": "number"
                        },
                        "transferDate": {
                          "type": "string",
                          "format": "date",
                          "description": "YYYY-MM-DD; 1900-01-01 ถึง 2079-06-06"
                        },
                        "universityNameThai": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "universityNameEnglish": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "requestId",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "ข้อมูลคำขอไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "ไม่มีหรือไม่ถูกต้องของ API key/admin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope หรือ IP ไม่อนุญาต",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ไม่พบข้อมูล/endpoint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ข้อมูลซ้ำหรือขัดแย้ง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "เกิน rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "ข้อผิดพลาดภายใน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "ฟีเจอร์ปิดหรือฐานข้อมูลไม่พร้อม",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExternalTransferRequest"
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "external-transfers:write",
        "x-feature-state": "enabled"
      }
    },
    "/api/v1/registrations": {
      "post": {
        "operationId": "createRegistration",
        "tags": [
          "Registrations"
        ],
        "summary": "บันทึกลงทะเบียนใน REGISTER",
        "responses": {
          "201": {
            "description": "บันทึกแล้ว; gradeCode 9.9",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "studentId": {
                          "type": "string",
                          "pattern": "^[0-9]{4,10}$"
                        },
                        "year": {
                          "type": "string",
                          "pattern": "^25[0-9]{2}$",
                          "example": "2569"
                        },
                        "semester": {
                          "type": "string",
                          "pattern": "^[0-3]$",
                          "example": "1"
                        },
                        "courseCode": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 10
                        },
                        "section": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9]{1,4}$"
                        },
                        "gradeCode": {
                          "type": "number",
                          "const": 9.9
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "requestId",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "ข้อมูลคำขอไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "ไม่มีหรือไม่ถูกต้องของ API key/admin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope หรือ IP ไม่อนุญาต",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ไม่พบข้อมูล/endpoint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ข้อมูลซ้ำหรือขัดแย้ง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "เกิน rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "ข้อผิดพลาดภายใน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "ฟีเจอร์ปิดหรือฐานข้อมูลไม่พร้อม",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegistrationWriteRequest"
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "registrations:write",
        "x-feature-state": "disabled",
        "description": "Endpoint นี้ยังปิดด้วย WRITE_REGISTRATIONS_ENABLED=0; เมื่อเปิดจะตรวจ SectionOrder.Total และจำนวน REGISTER; ไม่เพิ่ม SectionOrder.OrderHow."
      }
    },
    "/api/v1/register-net": {
      "post": {
        "operationId": "createRegisterNet",
        "tags": [
          "RegisterNet"
        ],
        "summary": "เพิ่ม RegisterNet ครบ 11 คอลัมน์",
        "responses": {
          "201": {
            "description": "เพิ่มสำเร็จ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "data": {
                      "$ref": "#/components/schemas/RegisterNetRow"
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "requestId",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "ข้อมูลคำขอไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "ไม่มีหรือไม่ถูกต้องของ API key/admin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope หรือ IP ไม่อนุญาต",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ข้อมูลซ้ำหรือขัดแย้ง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "เกิน rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "ข้อผิดพลาดภายใน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "ฟีเจอร์ปิดหรือฐานข้อมูลไม่พร้อม",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterNetRow"
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "register-net:write",
        "x-feature-state": "enabled",
        "description": "บันทึกเฉพาะ RegisterNet; ไม่สร้าง REGISTER; Status ไม่มีค่าเริ่มต้น"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      },
      "AdminToken": {
        "type": "apiKey",
        "in": "header",
        "name": "x-admin-token"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "requestId": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "required": [
          "error",
          "message"
        ]
      },
      "Health": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "service": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "database": {
            "type": "string"
          },
          "appDatabase": {
            "type": "string"
          },
          "databaseMessage": {
            "type": "string"
          },
          "appDatabaseMessage": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "required": [
          "status",
          "service",
          "timestamp"
        ]
      },
      "Student": {
        "type": "object",
        "properties": {
          "studentId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "firstName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "major": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "faculty": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "level": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "citizenId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "StudentOption": {
        "type": "object",
        "properties": {
          "faculty": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "major": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "level": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "Registration": {
        "type": "object",
        "properties": {
          "studentId": {
            "type": "string"
          },
          "academicYear": {
            "type": "string"
          },
          "semester": {
            "type": "string"
          },
          "courseCode": {
            "type": "string"
          },
          "courseNameThai": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "courseNameEnglish": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "credits": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "section": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "registrationDate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "RegisterNetRow": {
        "type": "object",
        "properties": {
          "Year_reg": {
            "type": "string",
            "maxLength": 4,
            "minLength": 1
          },
          "Semester": {
            "type": "string",
            "maxLength": 1,
            "minLength": 1
          },
          "ID": {
            "type": "string",
            "maxLength": 10,
            "minLength": 1
          },
          "Couse": {
            "type": "string",
            "maxLength": 10,
            "minLength": 1
          },
          "Cradit": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "Section_reg": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4
              },
              {
                "type": "null"
              }
            ]
          },
          "Status": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "Date_reg": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 30
              },
              {
                "type": "null"
              }
            ]
          },
          "IpReg": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "User_LK": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10
              },
              {
                "type": "null"
              }
            ]
          },
          "Reg_RecNo": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "Year_reg",
          "Semester",
          "ID",
          "Couse"
        ],
        "description": "ชื่อฟิลด์ตรงกับ dbo.RegisterNet; optional fields omitted on POST become null"
      },
      "SectionOrderRow": {
        "type": "object",
        "properties": {
          "YEAR": {
            "type": "string",
            "pattern": "^[0-9]{4}$",
            "maxLength": 4
          },
          "TERM": {
            "type": "string",
            "pattern": "^[0-9]$",
            "maxLength": 1
          },
          "Couse_no": {
            "type": "string",
            "maxLength": 10,
            "minLength": 1
          },
          "Section": {
            "type": "string",
            "maxLength": 4,
            "minLength": 1
          },
          "Total": {
            "anyOf": [
              {
                "type": "integer",
                "format": "int32"
              },
              {
                "type": "null"
              }
            ]
          },
          "OrderHow": {
            "anyOf": [
              {
                "type": "integer",
                "format": "int32"
              },
              {
                "type": "null"
              }
            ]
          },
          "SField": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4
              },
              {
                "type": "null"
              }
            ]
          },
          "memo": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 90
              },
              {
                "type": "null"
              }
            ]
          },
          "OrderHowNet": {
            "anyOf": [
              {
                "type": "integer",
                "format": "int32"
              },
              {
                "type": "null"
              }
            ]
          },
          "TeacherID": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 15
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "YEAR",
          "TERM",
          "Couse_no",
          "Section"
        ],
        "description": "ชื่อฟิลด์ตรงกับ dbo.SectionOrder; integer counters are stored exactly as supplied"
      },
      "GraduationProfile": {
        "type": "object",
        "properties": {
          "studentId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "firstName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "major": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "faculty": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "level": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "citizenId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "universityEmail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "VerificationProfile": {
        "type": "object",
        "properties": {
          "studentId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "firstName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "major": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "faculty": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "level": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "universityEmail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "graduationEligible": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "TeachingLoad": {
        "type": "object",
        "properties": {
          "academicYear": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "semester": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "teacherId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "teacherTitle": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "teacherFirstName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "teacherLastName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "majorCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "majorName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "facultyCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "facultyName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "courseCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "courseNameThai": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "courseNameEnglish": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "lectureCredits": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "labCredits": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "studyCredits": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "section": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "sectionMajorCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "externalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "teachingGroup": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "creditUnits": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "studentCount": {
            "type": "integer"
          },
          "groupCount": {
            "type": "integer"
          },
          "combinedCourse": {
            "type": "boolean"
          },
          "sourceCourseCount": {
            "type": "integer"
          },
          "courseCodes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "courseNamesThai": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false,
        "description": "Combined TIMS groups may add combinedCourse, teachingGroup, sourceCourseCount, courseCodes and courseNamesThai."
      },
      "TransferRequest": {
        "type": "object",
        "properties": {
          "studentId": {
            "type": "string",
            "pattern": "^[0-9]{4,10}$"
          },
          "year": {
            "type": "string",
            "pattern": "^25[0-9]{2}$",
            "example": "2569"
          },
          "semester": {
            "type": "string",
            "pattern": "^[0-3]$",
            "example": "1"
          },
          "courseCode": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10
          }
        },
        "additionalProperties": false,
        "required": [
          "studentId",
          "year",
          "semester",
          "courseCode"
        ]
      },
      "ExternalTransferRequest": {
        "type": "object",
        "properties": {
          "studentId": {
            "type": "string",
            "pattern": "^[0-9]{4,10}$"
          },
          "year": {
            "type": "string",
            "pattern": "^25[0-9]{2}$",
            "example": "2569"
          },
          "semester": {
            "type": "string",
            "pattern": "^[0-3]$",
            "example": "1"
          },
          "courseCode": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10
          },
          "universityId": {
            "type": "string",
            "pattern": "^[0-9]{5}$"
          },
          "gradeCode": {
            "type": "number"
          },
          "transferDate": {
            "type": "string",
            "format": "date",
            "description": "YYYY-MM-DD; 1900-01-01 ถึง 2079-06-06"
          }
        },
        "additionalProperties": false,
        "required": [
          "studentId",
          "year",
          "semester",
          "courseCode",
          "universityId",
          "gradeCode",
          "transferDate"
        ]
      },
      "RegistrationWriteRequest": {
        "type": "object",
        "properties": {
          "studentId": {
            "type": "string",
            "pattern": "^[0-9]{4,10}$"
          },
          "year": {
            "type": "string",
            "pattern": "^25[0-9]{2}$",
            "example": "2569"
          },
          "semester": {
            "type": "string",
            "pattern": "^[0-3]$",
            "example": "1"
          },
          "courseCode": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10
          },
          "section": {
            "type": "string",
            "pattern": "^[A-Za-z0-9]{1,4}$"
          }
        },
        "additionalProperties": false,
        "required": [
          "studentId",
          "year",
          "semester",
          "courseCode",
          "section"
        ]
      },
      "AccessRequest": {
        "type": "object",
        "properties": {
          "organization": {
            "type": "string",
            "maxLength": 190
          },
          "systemName": {
            "type": "string",
            "maxLength": 190
          },
          "contactName": {
            "type": "string",
            "maxLength": 150
          },
          "contactEmail": {
            "type": "string",
            "maxLength": 190,
            "format": "email"
          },
          "contactPhone": {
            "type": "string",
            "maxLength": 50
          },
          "purpose": {
            "type": "string",
            "maxLength": 2000
          },
          "requestedScopes": {
            "type": "string"
          },
          "allowedIps": {
            "type": "string",
            "maxLength": 1000
          },
          "allowedOrigins": {
            "type": "string",
            "maxLength": 1000
          },
          "expectedVolume": {
            "type": "string",
            "maxLength": 190
          },
          "desiredStartDate": {
            "type": "string",
            "format": "date"
          }
        },
        "additionalProperties": true,
        "required": [
          "organization",
          "systemName",
          "contactName",
          "contactEmail",
          "purpose"
        ],
        "description": "requestedScopes accepts only the public read scopes listed in the API reference; defaults to students:read."
      }
    }
  }
}
