{
  "openapi": "3.0.0",
  "paths": {
    "/api/v1": {
      "get": {
        "operationId": "AppController_getHello_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "App"
        ]
      }
    },
    "/api/v1/health": {
      "get": {
        "operationId": "HealthController_check_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "The Health Check is successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "ok"
                    },
                    "info": {
                      "type": "object",
                      "example": {
                        "database": {
                          "status": "up"
                        }
                      },
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "status"
                        ],
                        "properties": {
                          "status": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      },
                      "nullable": true
                    },
                    "error": {
                      "type": "object",
                      "example": {},
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "status"
                        ],
                        "properties": {
                          "status": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      },
                      "nullable": true
                    },
                    "details": {
                      "type": "object",
                      "example": {
                        "database": {
                          "status": "up"
                        }
                      },
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "status"
                        ],
                        "properties": {
                          "status": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "The Health Check is not successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "error"
                    },
                    "info": {
                      "type": "object",
                      "example": {
                        "database": {
                          "status": "up"
                        }
                      },
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "status"
                        ],
                        "properties": {
                          "status": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      },
                      "nullable": true
                    },
                    "error": {
                      "type": "object",
                      "example": {
                        "redis": {
                          "status": "down",
                          "message": "Could not connect"
                        }
                      },
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "status"
                        ],
                        "properties": {
                          "status": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      },
                      "nullable": true
                    },
                    "details": {
                      "type": "object",
                      "example": {
                        "database": {
                          "status": "up"
                        },
                        "redis": {
                          "status": "down",
                          "message": "Could not connect"
                        }
                      },
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "status"
                        ],
                        "properties": {
                          "status": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "health"
        ]
      }
    },
    "/api/v1/auth/otp/request": {
      "post": {
        "operationId": "AuthController_requestOtp_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestOtpDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": ""
          }
        },
        "summary": "Send a one-time passcode to a phone number",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/otp/verify": {
      "post": {
        "operationId": "AuthController_verifyOtp_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyOtpDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/TokenResponseDto"
                        },
                        {
                          "$ref": "#/components/schemas/RegistrationChallengeDto"
                        }
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          }
        },
        "summary": "Verify an OTP — returns tokens for a known phone, else a registration token",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/register": {
      "post": {
        "operationId": "AuthController_register_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/TokenResponseDto"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          }
        },
        "summary": "Complete mobile registration and receive tokens",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/login": {
      "post": {
        "operationId": "AuthController_login_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/TokenResponseDto"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          }
        },
        "summary": "Admin/web login with email and password",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/refresh": {
      "post": {
        "operationId": "AuthController_refresh_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/TokenResponseDto"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          }
        },
        "summary": "Rotate a refresh token for a fresh token pair",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/logout": {
      "post": {
        "operationId": "AuthController_logout_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LogoutDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Revoke the presented refresh token",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/password-reset/request": {
      "post": {
        "operationId": "AuthController_requestPasswordReset_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordResetRequestDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": ""
          }
        },
        "summary": "Request a password reset (always 204, no enumeration)",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/password-reset/confirm": {
      "post": {
        "operationId": "AuthController_confirmPasswordReset_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordResetConfirmDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": ""
          }
        },
        "summary": "Set a new password using a reset token",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/users/me": {
      "get": {
        "operationId": "MeController_me_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/UserResponseDto"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get the current authenticated user profile",
        "tags": [
          "me"
        ]
      }
    },
    "/api/v1/home/overview": {
      "get": {
        "operationId": "HomeController_getOverview_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/HomeOverviewResponseDto"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "[stub] Home dashboard overview for the signed-in agent",
        "tags": [
          "home"
        ]
      }
    },
    "/api/v1/performance/summary": {
      "get": {
        "operationId": "PerformanceController_getSummary_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/PerformanceSummaryResponseDto"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "[stub] Sales & commission summary for the signed-in agent",
        "tags": [
          "performance"
        ]
      }
    },
    "/api/v1/performance/commission-payments": {
      "get": {
        "operationId": "PerformanceController_getCommissionPayments_v1",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 1,
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 20,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CommissionPaymentDto"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PaginationMetaDto"
                    }
                  },
                  "required": [
                    "success",
                    "data",
                    "meta"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "[stub] Paginated commission payment history",
        "tags": [
          "performance"
        ]
      }
    },
    "/api/v1/performance/incentives": {
      "get": {
        "operationId": "IncentivesController_getIncentives_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/IncentiveSummaryResponseDto"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "[stub] Incentive points balance and history",
        "tags": [
          "incentives"
        ]
      }
    },
    "/api/v1/agents/become/summary": {
      "get": {
        "operationId": "AgentsController_getBecomeAgentSummary_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/BecomeAgentSummaryResponseDto"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "[stub] Become-an-agent application status summary",
        "tags": [
          "agents"
        ]
      }
    },
    "/api/v1/agent-applications": {
      "post": {
        "operationId": "AgentApplicationsController_createDraft_v1",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApplicationDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/ApplicationResponseDto"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Open (or resume) a become-agent application draft",
        "tags": [
          "agent-applications"
        ]
      }
    },
    "/api/v1/agent-applications/me": {
      "get": {
        "operationId": "AgentApplicationsController_getMine_v1",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/ApplicationResponseDto"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get the caller's become-agent application",
        "tags": [
          "agent-applications"
        ]
      }
    },
    "/api/v1/agent-applications/agreement": {
      "get": {
        "operationId": "AgentApplicationsController_getAgreement_v1",
        "parameters": [
          {
            "name": "type",
            "required": true,
            "in": "query",
            "description": "Applicant type the document should be scoped to.",
            "schema": {
              "example": "INDIVIDUAL",
              "type": "string",
              "enum": [
                "INDIVIDUAL",
                "COMPANY"
              ]
            }
          },
          {
            "name": "docType",
            "required": true,
            "in": "query",
            "description": "Which legal document to fetch the current published version of.",
            "schema": {
              "example": "AGREEMENT",
              "type": "string",
              "enum": [
                "GPC_TERMS",
                "PDPA",
                "AGREEMENT"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/LegalDocumentVersionResponseDto"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get the current published legal document for the wizard",
        "tags": [
          "agent-applications"
        ]
      }
    },
    "/api/v1/agent-applications/{id}": {
      "patch": {
        "operationId": "AgentApplicationsController_patch_v1",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateApplicationDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/ApplicationResponseDto"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Save applicant details (partial step save)",
        "tags": [
          "agent-applications"
        ]
      },
      "get": {
        "operationId": "AgentApplicationsController_status_v1",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/ApplicationResponseDto"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a become-agent application by id (status)",
        "tags": [
          "agent-applications"
        ]
      }
    },
    "/api/v1/agent-applications/{id}/documents": {
      "post": {
        "operationId": "AgentApplicationsController_uploadDocument_v1",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The document file plus its KYC document type.",
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file",
                  "type"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "JPEG, PNG, or PDF, max 5MB."
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "ID_FRONT",
                      "ID_BACK",
                      "SELFIE",
                      "COMPANY_CERTIFICATE",
                      "TM20",
                      "SIGNATURE"
                    ],
                    "example": "ID_FRONT"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/DocumentDto"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload (or replace) a KYC document on the draft",
        "tags": [
          "agent-applications"
        ]
      }
    },
    "/api/v1/agent-applications/{id}/documents/{docId}": {
      "delete": {
        "operationId": "AgentApplicationsController_deleteDocument_v1",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "docId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Document removed."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove a KYC document from the draft",
        "tags": [
          "agent-applications"
        ]
      }
    },
    "/api/v1/agent-applications/{id}/consents": {
      "post": {
        "operationId": "AgentApplicationsController_recordConsent_v1",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordConsentDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/ApplicationResponseDto"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Record a legal consent on the application",
        "tags": [
          "agent-applications"
        ]
      }
    },
    "/api/v1/agent-applications/{id}/signature": {
      "post": {
        "operationId": "AgentApplicationsController_signAgreement_v1",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "A PNG of the applicant signature, plus an optional signer name.",
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "PNG image of the signature, max 5MB."
                  },
                  "signerName": {
                    "type": "string",
                    "example": "Somchai Jaidee"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/ApplicationResponseDto"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Capture the agreement e-signature (PNG)",
        "tags": [
          "agent-applications"
        ]
      }
    },
    "/api/v1/agent-applications/{id}/submit": {
      "post": {
        "operationId": "AgentApplicationsController_submit_v1",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/ApplicationResponseDto"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Submit the application for review",
        "tags": [
          "agent-applications"
        ]
      }
    }
  },
  "info": {
    "title": "SC Asset GPC API (Mobile / Flutter)",
    "description": "SC Asset GPC dealer platform API contract Mobile / Flutter surface — admin endpoints are excluded.",
    "version": "1",
    "contact": {}
  },
  "tags": [],
  "servers": [],
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "type": "http"
      }
    },
    "schemas": {
      "TokenResponseDto": {
        "type": "object",
        "properties": {
          "accessToken": {
            "type": "string"
          },
          "refreshToken": {
            "type": "string"
          },
          "expiresIn": {
            "type": "number",
            "description": "Access token lifetime in seconds"
          }
        },
        "required": [
          "accessToken",
          "refreshToken",
          "expiresIn"
        ]
      },
      "RegistrationChallengeDto": {
        "type": "object",
        "properties": {
          "registrationRequired": {
            "type": "boolean",
            "example": true
          },
          "registrationToken": {
            "type": "string",
            "description": "Short-lived token to pass to /auth/register"
          }
        },
        "required": [
          "registrationRequired",
          "registrationToken"
        ]
      },
      "RequestOtpDto": {
        "type": "object",
        "properties": {
          "phone": {
            "type": "string",
            "example": "+66901234567",
            "description": "Mobile number in E.164-ish format"
          },
          "purpose": {
            "type": "string",
            "enum": [
              "login",
              "register",
              "reset"
            ],
            "default": "login",
            "description": "Defaults to login; the unified mobile-auth entry point"
          }
        },
        "required": [
          "phone"
        ]
      },
      "VerifyOtpDto": {
        "type": "object",
        "properties": {
          "phone": {
            "type": "string",
            "example": "+66901234567"
          },
          "code": {
            "type": "string",
            "example": "123456",
            "description": "6-digit one-time passcode"
          },
          "purpose": {
            "type": "string",
            "enum": [
              "login",
              "register",
              "reset"
            ],
            "default": "login"
          }
        },
        "required": [
          "phone",
          "code"
        ]
      },
      "PaginationMetaDto": {
        "type": "object",
        "properties": {
          "page": {
            "type": "number"
          },
          "limit": {
            "type": "number"
          },
          "total": {
            "type": "number"
          },
          "totalPages": {
            "type": "number"
          }
        },
        "required": [
          "page",
          "limit",
          "total",
          "totalPages"
        ]
      },
      "RegisterDto": {
        "type": "object",
        "properties": {
          "registrationToken": {
            "type": "string",
            "description": "Short-lived token issued by /auth/otp/verify for a new phone"
          },
          "firstName": {
            "type": "string",
            "example": "Somchai"
          },
          "lastName": {
            "type": "string",
            "example": "Jaidee"
          }
        },
        "required": [
          "registrationToken",
          "firstName",
          "lastName"
        ]
      },
      "LoginDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "example": "admin@scasset.local"
          },
          "password": {
            "type": "string",
            "example": "S3cure!Passw0rd"
          }
        },
        "required": [
          "email",
          "password"
        ]
      },
      "RefreshDto": {
        "type": "object",
        "properties": {
          "refreshToken": {
            "type": "string",
            "description": "The opaque refresh token from a prior auth response"
          }
        },
        "required": [
          "refreshToken"
        ]
      },
      "LogoutDto": {
        "type": "object",
        "properties": {
          "refreshToken": {
            "type": "string",
            "description": "The refresh token to revoke"
          }
        },
        "required": [
          "refreshToken"
        ]
      },
      "PasswordResetRequestDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "example": "admin@scasset.local"
          }
        },
        "required": [
          "email"
        ]
      },
      "PasswordResetConfirmDto": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "description": "The reset token delivered to the user"
          },
          "newPassword": {
            "type": "string",
            "example": "N3w!Secur3Pass",
            "minLength": 12
          }
        },
        "required": [
          "token",
          "newPassword"
        ]
      },
      "RoleSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "UserResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "object",
            "nullable": true
          },
          "phone": {
            "type": "object",
            "nullable": true
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "active",
              "suspended"
            ]
          },
          "roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RoleSummaryDto"
            }
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "email",
          "phone",
          "firstName",
          "lastName",
          "status",
          "roles",
          "createdAt",
          "updatedAt"
        ]
      },
      "CreateUserDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "example": "user@scasset.local"
          },
          "password": {
            "type": "string",
            "description": "Password must be at least 12 characters and include uppercase, lowercase, number, and special characters"
          },
          "firstName": {
            "type": "string",
            "example": "Somchai"
          },
          "lastName": {
            "type": "string",
            "example": "Jaidee"
          },
          "roleIds": {
            "description": "Role IDs to grant on creation",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "email",
          "password",
          "firstName",
          "lastName"
        ]
      },
      "UpdateUserDto": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "example": "Somchai"
          },
          "lastName": {
            "type": "string",
            "example": "Jaidee"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "active",
              "suspended"
            ]
          }
        }
      },
      "AssignRolesDto": {
        "type": "object",
        "properties": {
          "roleIds": {
            "description": "The complete set of role IDs the user should have",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "roleIds"
        ]
      },
      "RoleResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "object",
            "nullable": true
          },
          "permissions": {
            "description": "Permission codes this role grants",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "permissions"
        ]
      },
      "PermissionResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "example": "user.create"
          },
          "description": {
            "type": "object",
            "nullable": true
          }
        },
        "required": [
          "id",
          "code",
          "description"
        ]
      },
      "UserHeaderDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "example": "Agent"
          },
          "accountType": {
            "type": "string",
            "example": "Individual"
          }
        },
        "required": [
          "name",
          "role",
          "accountType"
        ]
      },
      "QuickActionDto": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "example": "search-projects"
          },
          "label": {
            "type": "string",
            "example": "ค้นหาโครงการ"
          },
          "icon": {
            "type": "string",
            "example": "search"
          },
          "destination": {
            "type": "string",
            "example": "/projects/search"
          }
        },
        "required": [
          "key",
          "label",
          "icon",
          "destination"
        ]
      },
      "RecommendedProjectDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "example": "Bangkok Boulevard"
          },
          "propertyType": {
            "type": "string",
            "example": "Single House"
          },
          "location": {
            "type": "string",
            "example": "Ladkrabang"
          },
          "status": {
            "type": "string",
            "example": "ready_to_move"
          },
          "priceMin": {
            "type": "number",
            "example": 4500000
          },
          "priceMax": {
            "type": "number",
            "example": 9800000
          },
          "favorite": {
            "type": "boolean"
          },
          "imageUrl": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "propertyType",
          "location",
          "status",
          "priceMin",
          "priceMax",
          "favorite",
          "imageUrl"
        ]
      },
      "HomeOverviewResponseDto": {
        "type": "object",
        "properties": {
          "greeting": {
            "type": "string",
            "example": "ยินดีต้อนรับ!"
          },
          "user": {
            "$ref": "#/components/schemas/UserHeaderDto"
          },
          "unreadNotifications": {
            "type": "number"
          },
          "unreadMessages": {
            "type": "number"
          },
          "quickActions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuickActionDto"
            }
          },
          "recommendedProjects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecommendedProjectDto"
            }
          }
        },
        "required": [
          "greeting",
          "user",
          "unreadNotifications",
          "unreadMessages",
          "quickActions",
          "recommendedProjects"
        ]
      },
      "CommissionSummaryDto": {
        "type": "object",
        "properties": {
          "total": {
            "type": "number",
            "example": 325000
          },
          "paid": {
            "type": "number",
            "example": 240000
          },
          "pending": {
            "type": "number",
            "example": 85000
          },
          "currency": {
            "type": "string",
            "example": "THB"
          }
        },
        "required": [
          "total",
          "paid",
          "pending",
          "currency"
        ]
      },
      "SalesRecordDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "projectName": {
            "type": "string",
            "example": "SC Nirvana Metro"
          },
          "status": {
            "type": "string",
            "example": "transfer"
          },
          "unit": {
            "type": "string",
            "example": "Unit 2401"
          },
          "transactionDate": {
            "type": "string",
            "format": "date-time"
          },
          "price": {
            "type": "number",
            "example": 4250000
          },
          "commission": {
            "type": "number",
            "example": 85000
          },
          "cashPoints": {
            "type": "number",
            "example": 425
          }
        },
        "required": [
          "id",
          "projectName",
          "status",
          "unit",
          "transactionDate",
          "price",
          "commission",
          "cashPoints"
        ]
      },
      "PerformanceSummaryResponseDto": {
        "type": "object",
        "properties": {
          "commission": {
            "$ref": "#/components/schemas/CommissionSummaryDto"
          },
          "salesRecords": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SalesRecordDto"
            }
          }
        },
        "required": [
          "commission",
          "salesRecords"
        ]
      },
      "CommissionPaymentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "projectName": {
            "type": "string",
            "example": "SC Veranda Ladprao"
          },
          "unit": {
            "type": "string",
            "example": "Unit 1203"
          },
          "amount": {
            "type": "number",
            "example": 77600
          },
          "status": {
            "type": "string",
            "example": "pending"
          },
          "paidAt": {
            "type": "object",
            "format": "date-time",
            "nullable": true
          }
        },
        "required": [
          "id",
          "projectName",
          "unit",
          "amount",
          "status",
          "paidAt"
        ]
      },
      "IncentivePointsDto": {
        "type": "object",
        "properties": {
          "balance": {
            "type": "number",
            "example": 12500
          },
          "tier": {
            "type": "string",
            "example": "Gold"
          },
          "earnedThisMonth": {
            "type": "number",
            "example": 1250
          }
        },
        "required": [
          "balance",
          "tier",
          "earnedThisMonth"
        ]
      },
      "IncentiveHistoryItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "example": "Sale reward"
          },
          "points": {
            "type": "number",
            "example": 425
          },
          "earnedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "description",
          "points",
          "earnedAt"
        ]
      },
      "IncentiveSummaryResponseDto": {
        "type": "object",
        "properties": {
          "points": {
            "$ref": "#/components/schemas/IncentivePointsDto"
          },
          "history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IncentiveHistoryItemDto"
            }
          }
        },
        "required": [
          "points",
          "history"
        ]
      },
      "ApplicationStepDto": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "example": "identity"
          },
          "label": {
            "type": "string",
            "example": "Identity"
          },
          "completed": {
            "type": "boolean"
          }
        },
        "required": [
          "key",
          "label",
          "completed"
        ]
      },
      "BecomeAgentSummaryResponseDto": {
        "type": "object",
        "properties": {
          "applicantType": {
            "type": "string",
            "enum": [
              "individual",
              "company"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "not_started",
              "in_progress",
              "submitted",
              "approved",
              "rejected"
            ],
            "example": "in_progress"
          },
          "currentStep": {
            "type": "number",
            "example": 2
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationStepDto"
            }
          },
          "eligible": {
            "type": "boolean"
          }
        },
        "required": [
          "applicantType",
          "status",
          "currentStep",
          "steps",
          "eligible"
        ]
      },
      "AddressDto": {
        "type": "object",
        "properties": {
          "detail": {
            "type": "string",
            "example": "123/45 Sukhumvit Rd, Khlong Toei"
          },
          "province": {
            "type": "string",
            "example": "Bangkok"
          },
          "district": {
            "type": "string",
            "example": "Watthana"
          },
          "subdistrict": {
            "type": "string",
            "example": "Khlong Tan Nuea"
          },
          "postalCode": {
            "type": "string",
            "example": "10110"
          }
        }
      },
      "ApplicantDetailsDto": {
        "type": "object",
        "properties": {
          "fullName": {
            "type": "string",
            "example": "Somchai Jaidee"
          },
          "nationalId": {
            "type": "string",
            "example": "1234567890123"
          },
          "occupation": {
            "type": "string",
            "example": "Real estate broker"
          },
          "address": {
            "$ref": "#/components/schemas/AddressDto"
          },
          "companyName": {
            "type": "string",
            "example": "SC Asset Brokerage Co., Ltd."
          },
          "companyRegistrationNumber": {
            "type": "string",
            "example": "0105551234567"
          },
          "companyTaxId": {
            "type": "string",
            "example": "0105551234567"
          },
          "registeredAddress": {
            "$ref": "#/components/schemas/AddressDto"
          },
          "phone": {
            "type": "string",
            "example": "0812345678"
          },
          "taxId": {
            "type": "string",
            "example": "1234567890123",
            "description": "Tax identification number (individual)."
          }
        }
      },
      "DocumentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "a3d9f0e1-2b3c-4d5e-6f70-8192a3b4c5d6"
          },
          "type": {
            "type": "string",
            "enum": [
              "ID_FRONT",
              "ID_BACK",
              "SELFIE",
              "COMPANY_CERTIFICATE",
              "TM20",
              "SIGNATURE"
            ],
            "example": "ID_FRONT"
          },
          "mimeType": {
            "type": "string",
            "example": "image/jpeg"
          },
          "sizeBytes": {
            "type": "number",
            "example": 184320,
            "description": "File size in bytes."
          },
          "uploadedAt": {
            "type": "string",
            "example": "2026-06-15T08:30:00.000Z"
          }
        },
        "required": [
          "id",
          "type",
          "mimeType",
          "sizeBytes",
          "uploadedAt"
        ]
      },
      "ConsentDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "GPC_TERMS",
              "PDPA",
              "AGREEMENT"
            ],
            "example": "PDPA"
          },
          "legalDocumentVersionId": {
            "type": "string",
            "example": "b1f1c2d3-4e5f-6789-abcd-ef0123456789"
          },
          "acceptedAt": {
            "type": "string",
            "example": "2026-06-15T08:30:00.000Z"
          }
        },
        "required": [
          "type",
          "legalDocumentVersionId",
          "acceptedAt"
        ]
      },
      "ApplicationResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
          },
          "type": {
            "type": "string",
            "enum": [
              "INDIVIDUAL",
              "COMPANY"
            ],
            "example": "INDIVIDUAL"
          },
          "status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "PENDING_REVIEW",
              "CHANGES_REQUESTED",
              "APPROVED",
              "REJECTED"
            ],
            "example": "DRAFT"
          },
          "requestNumber": {
            "type": "object",
            "nullable": true,
            "example": null,
            "description": "Human-facing request number, assigned on submit."
          },
          "applicantDetails": {
            "nullable": true,
            "description": "Per-type applicant details captured so far.",
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/ApplicantDetailsDto"
              }
            ]
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentDto"
            }
          },
          "consents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsentDto"
            }
          },
          "agreementSigned": {
            "type": "boolean",
            "example": false,
            "description": "Whether the agreement e-signature has been captured."
          },
          "agentCode": {
            "type": "object",
            "nullable": true,
            "example": null,
            "description": "Issued agent code, set once the application is approved."
          },
          "decisionReason": {
            "type": "object",
            "nullable": true,
            "example": null,
            "description": "Reviewer reason for a rejection or change request."
          }
        },
        "required": [
          "id",
          "type",
          "status",
          "requestNumber",
          "applicantDetails",
          "documents",
          "consents",
          "agreementSigned",
          "agentCode",
          "decisionReason"
        ]
      },
      "CreateApplicationDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "INDIVIDUAL",
              "COMPANY"
            ],
            "example": "INDIVIDUAL",
            "description": "Whether the applicant is an individual or a company."
          }
        },
        "required": [
          "type"
        ]
      },
      "LegalDocumentVersionResponseDto": {
        "type": "object",
        "properties": {
          "legalDocumentVersionId": {
            "type": "string",
            "example": "b1f1c2d3-4e5f-6789-abcd-ef0123456789"
          },
          "type": {
            "type": "string",
            "enum": [
              "GPC_TERMS",
              "PDPA",
              "AGREEMENT"
            ],
            "example": "AGREEMENT"
          },
          "agentType": {
            "type": "string",
            "enum": [
              "INDIVIDUAL",
              "COMPANY",
              "ANY"
            ],
            "example": "INDIVIDUAL",
            "description": "Scope the resolved document applies to (the requested type, or ANY)."
          },
          "version": {
            "type": "string",
            "example": "1.0"
          },
          "title": {
            "type": "string",
            "example": "AGREEMENT (INDIVIDUAL) [TBD: real legal text pending client]"
          },
          "body": {
            "type": "string",
            "example": "[TBD: real legal text pending client]"
          },
          "publishedAt": {
            "type": "string",
            "example": "2026-06-15T08:30:00.000Z",
            "nullable": true
          }
        },
        "required": [
          "legalDocumentVersionId",
          "type",
          "agentType",
          "version",
          "title",
          "body",
          "publishedAt"
        ]
      },
      "UpdateApplicationDto": {
        "type": "object",
        "properties": {
          "applicantDetails": {
            "$ref": "#/components/schemas/ApplicantDetailsDto"
          }
        }
      },
      "RecordConsentDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "GPC_TERMS",
              "PDPA",
              "AGREEMENT"
            ],
            "example": "PDPA",
            "description": "Which legal consent is being accepted."
          },
          "legalDocumentVersionId": {
            "type": "string",
            "example": "b1f1c2d3-4e5f-6789-abcd-ef0123456789",
            "description": "Id of the exact legal-document version that was accepted."
          }
        },
        "required": [
          "type",
          "legalDocumentVersionId"
        ]
      },
      "ReviewApplicationListItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
          },
          "requestNumber": {
            "type": "object",
            "nullable": true,
            "example": "REQ-2026-000123",
            "description": "Human-facing request number, assigned on submit."
          },
          "type": {
            "type": "string",
            "enum": [
              "INDIVIDUAL",
              "COMPANY"
            ],
            "example": "INDIVIDUAL"
          },
          "status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "PENDING_REVIEW",
              "CHANGES_REQUESTED",
              "APPROVED",
              "REJECTED"
            ],
            "example": "PENDING_REVIEW"
          },
          "applicantName": {
            "type": "object",
            "nullable": true,
            "example": "Somchai Jaidee",
            "description": "Applicant display name (fullName for individuals, companyName for companies)."
          },
          "submittedAt": {
            "type": "string",
            "example": "2026-06-15T08:30:00.000Z",
            "description": "When the application entered the review queue."
          },
          "decisionReason": {
            "type": "object",
            "nullable": true,
            "example": null,
            "description": "Reviewer reason for a rejection or change request."
          }
        },
        "required": [
          "id",
          "requestNumber",
          "type",
          "status",
          "applicantName",
          "submittedAt",
          "decisionReason"
        ]
      },
      "AdminApplicationDetailDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
          },
          "requestNumber": {
            "type": "object",
            "nullable": true,
            "example": "REQ-2026-000123",
            "description": "Human-facing request number, assigned on submit."
          },
          "type": {
            "type": "string",
            "enum": [
              "INDIVIDUAL",
              "COMPANY"
            ],
            "example": "INDIVIDUAL"
          },
          "status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "PENDING_REVIEW",
              "CHANGES_REQUESTED",
              "APPROVED",
              "REJECTED"
            ],
            "example": "PENDING_REVIEW"
          },
          "applicantDetails": {
            "type": "object",
            "nullable": true,
            "description": "Type-specific applicant payload as captured by the applicant."
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentDto"
            }
          },
          "consents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsentDto"
            }
          },
          "agreementSigned": {
            "type": "boolean",
            "example": false,
            "description": "Whether the agreement e-signature has been captured."
          },
          "decisionReason": {
            "type": "object",
            "nullable": true,
            "example": null,
            "description": "Reviewer reason for a rejection or change request."
          },
          "reviewedAt": {
            "type": "string",
            "nullable": true,
            "example": null,
            "description": "When the application was last reviewed (decision recorded)."
          }
        },
        "required": [
          "id",
          "requestNumber",
          "type",
          "status",
          "documents",
          "consents",
          "agreementSigned",
          "decisionReason",
          "reviewedAt"
        ]
      },
      "DocumentUrlResponseDto": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "example": "https://storage.example.com/agents/.../id-front.png?sig=...",
            "description": "Time-limited URL to fetch the document bytes."
          },
          "expiresInSeconds": {
            "type": "number",
            "example": 300,
            "description": "How long (seconds) the URL remains valid."
          }
        },
        "required": [
          "url",
          "expiresInSeconds"
        ]
      },
      "RequestChangesDto": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "example": "The ID-card photo is blurry — please re-upload a clear scan.",
            "description": "Why the application is being returned for corrections."
          }
        },
        "required": [
          "reason"
        ]
      },
      "AgentProfileResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
          },
          "agentCode": {
            "type": "string",
            "example": "SC-A-2026-000123",
            "description": "Public agent code, issued on approval (SC-A series)."
          },
          "type": {
            "type": "string",
            "enum": [
              "INDIVIDUAL",
              "COMPANY"
            ],
            "example": "INDIVIDUAL"
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "SUSPENDED"
            ],
            "example": "ACTIVE"
          },
          "userId": {
            "type": "string",
            "example": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
            "description": "The user this agent profile belongs to."
          },
          "approvedAt": {
            "type": "string",
            "example": "2026-06-15T08:30:00.000Z",
            "description": "When the agent was approved (profile created)."
          }
        },
        "required": [
          "id",
          "agentCode",
          "type",
          "status",
          "userId",
          "approvedAt"
        ]
      },
      "LegalDocumentVersionItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "b1f1c2d3-4e5f-6789-abcd-ef0123456789"
          },
          "version": {
            "type": "string",
            "example": "1.0"
          },
          "status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "PUBLISHED",
              "ARCHIVED"
            ],
            "example": "DRAFT"
          },
          "title": {
            "type": "string",
            "example": "Agreement (Individual) — 2026 revision"
          },
          "publishedAt": {
            "type": "string",
            "example": "2026-06-15T08:30:00.000Z",
            "nullable": true
          }
        },
        "required": [
          "id",
          "version",
          "status",
          "title",
          "publishedAt"
        ]
      },
      "LegalDocumentResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "a0b1c2d3-4e5f-6789-abcd-ef0123456789"
          },
          "type": {
            "type": "string",
            "enum": [
              "GPC_TERMS",
              "PDPA",
              "AGREEMENT"
            ],
            "example": "AGREEMENT"
          },
          "agentType": {
            "type": "string",
            "enum": [
              "INDIVIDUAL",
              "COMPANY",
              "ANY"
            ],
            "example": "INDIVIDUAL"
          },
          "versions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LegalDocumentVersionItemDto"
            }
          }
        },
        "required": [
          "id",
          "type",
          "agentType",
          "versions"
        ]
      },
      "CreateLegalDocumentDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "GPC_TERMS",
              "PDPA",
              "AGREEMENT"
            ],
            "example": "AGREEMENT"
          },
          "agentType": {
            "type": "string",
            "enum": [
              "INDIVIDUAL",
              "COMPANY",
              "ANY"
            ],
            "example": "INDIVIDUAL",
            "description": "Applicant scope the document applies to (INDIVIDUAL / COMPANY / ANY)."
          }
        },
        "required": [
          "type",
          "agentType"
        ]
      },
      "CreateLegalVersionDto": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "example": "2.0",
            "description": "Human-readable version label."
          },
          "title": {
            "type": "string",
            "example": "Agreement (Individual) — 2026 revision"
          },
          "body": {
            "type": "string",
            "example": "The full legal text of this version…"
          }
        },
        "required": [
          "version",
          "title",
          "body"
        ]
      }
    }
  }
}
