{
  "openapi": "3.1.1",
  "info": {
    "title": "EnglishMastery.API | v1",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "http://api.najdapp.com/"
    }
  ],
  "paths": {
    "/": {
      "get": {
        "tags": [
          "EnglishMastery.API"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/version": {
      "get": {
        "tags": [
          "EnglishMastery.API"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/stripe/webhook": {
      "post": {
        "tags": [
          "Billing"
        ],
        "operationId": "StripeWebhook",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/billing/webhook": {
      "post": {
        "tags": [
          "Billing"
        ],
        "operationId": "BillingWebhook",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/auth/register": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "operationId": "Register",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/login": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "operationId": "Login",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "423": {
            "description": "Locked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/refresh": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "operationId": "RefreshToken",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/me": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "operationId": "GetCurrentUser",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/language": {
      "put": {
        "tags": [
          "Authentication"
        ],
        "operationId": "UpdateUserLanguage",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserLanguageRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/verify-email": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "operationId": "VerifyEmail",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyEmailCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/resend-verification": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "operationId": "ResendVerificationEmail",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResendVerificationEmailCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/grammar/rules": {
      "get": {
        "tags": [
          "Grammar"
        ],
        "operationId": "GetGrammarRules",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Grammar"
        ],
        "operationId": "CreateGrammarRule",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateGrammarRuleCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/grammar/rules/{tenseKey}": {
      "get": {
        "tags": [
          "Grammar"
        ],
        "operationId": "GetGrammarRuleByTense",
        "parameters": [
          {
            "name": "tenseKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/grammar/sentences": {
      "get": {
        "tags": [
          "Grammar"
        ],
        "operationId": "GetSentences",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Grammar"
        ],
        "operationId": "AddSentence",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddSentenceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/grammar/sentences/generate": {
      "post": {
        "tags": [
          "Grammar"
        ],
        "operationId": "GenerateSentences",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateSentencesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/grammar/sentences/{id}/approve": {
      "post": {
        "tags": [
          "Grammar"
        ],
        "operationId": "ApproveSentence",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/grammar/exercises": {
      "get": {
        "tags": [
          "Grammar"
        ],
        "operationId": "GetGrammarExercises",
        "parameters": [
          {
            "name": "tenseKey",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/grammar/exercises/next": {
      "get": {
        "tags": [
          "Grammar"
        ],
        "operationId": "GetNextGrammarExercise",
        "parameters": [
          {
            "name": "tenseKey",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "difficultyLevel",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/grammar/exercises/attempt": {
      "post": {
        "tags": [
          "Grammar"
        ],
        "operationId": "SubmitGrammarExerciseAttempt",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitExerciseAttemptCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/vocabulary": {
      "get": {
        "tags": [
          "Vocabulary"
        ],
        "operationId": "GetVocabulary",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "partOfSpeech",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "difficultyLevel",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "isAIGenerated",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Vocabulary"
        ],
        "operationId": "AddVocabulary",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddVocabularyCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/vocabulary/{id}": {
      "get": {
        "tags": [
          "Vocabulary"
        ],
        "operationId": "GetVocabularyById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/vocabulary/generate": {
      "post": {
        "tags": [
          "Vocabulary"
        ],
        "operationId": "GenerateVocabulary",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateVocabularyCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/vocabulary/exercises": {
      "get": {
        "tags": [
          "Vocabulary"
        ],
        "operationId": "GetVocabularyExercises",
        "parameters": [
          {
            "name": "vocabularyId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/vocabulary/exercises/attempt": {
      "post": {
        "tags": [
          "Vocabulary"
        ],
        "operationId": "SubmitVocabularyAttempt",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitVocabularyAttemptCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/assessment/progress/{userId}": {
      "get": {
        "tags": [
          "Assessment"
        ],
        "operationId": "GetProgress",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/assessment/progress/{userId}/{tenseKey}": {
      "get": {
        "tags": [
          "Assessment"
        ],
        "operationId": "GetProgressByTense",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "tenseKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/assessment/scores/{userId}": {
      "get": {
        "tags": [
          "Assessment"
        ],
        "operationId": "GetScores",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/assessment/progress": {
      "post": {
        "tags": [
          "Assessment"
        ],
        "operationId": "UpdateProgress",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProgressCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/assessment/scores/recalculate": {
      "post": {
        "tags": [
          "Assessment"
        ],
        "operationId": "RecalculateScore",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecalculateScoreCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/assessment/reports/monthly/{userId}": {
      "get": {
        "tags": [
          "Assessment"
        ],
        "operationId": "GetMonthlyReport",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/billing/plans": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "GetPlans",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/billing/subscription/{userId}": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "GetCurrentSubscription",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/billing/subscription": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "GetMySubscription",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/billing/usage/{userId}": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "GetUsage",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/billing/usage": {
      "post": {
        "tags": [
          "Billing"
        ],
        "operationId": "IncrementUsage",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IncrementUsageCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/billing/checkout": {
      "post": {
        "tags": [
          "Billing"
        ],
        "operationId": "CreateCheckoutSession",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCheckoutSessionCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/billing/checkout-session": {
      "post": {
        "tags": [
          "Billing"
        ],
        "operationId": "CreateBillingCheckoutSession",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCheckoutSessionCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/billing/upgrade": {
      "post": {
        "tags": [
          "Billing"
        ],
        "operationId": "UpgradePlan",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpgradePlanCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/billing/subscription/cancel": {
      "post": {
        "tags": [
          "Billing"
        ],
        "operationId": "CancelSubscription",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelSubscriptionCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/content/texts": {
      "get": {
        "tags": [
          "Content"
        ],
        "operationId": "GetTexts",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "topic",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "difficultyLevel",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "isApproved",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "addedByUserId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Content"
        ],
        "operationId": "AddText",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddTextRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/content/texts/{id}": {
      "get": {
        "tags": [
          "Content"
        ],
        "operationId": "GetTextById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/content/languages": {
      "get": {
        "tags": [
          "Content"
        ],
        "operationId": "GetLanguages",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/content/texts/generate": {
      "post": {
        "tags": [
          "Content"
        ],
        "operationId": "GenerateText",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateTextRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/content/texts/{id}/approve": {
      "post": {
        "tags": [
          "Content"
        ],
        "operationId": "ApproveText",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AddSentenceRequest": {
        "required": [
          "englishText",
          "tenseKey",
          "difficultyLevel",
          "isAIGenerated"
        ],
        "type": "object",
        "properties": {
          "englishText": {
            "type": "string"
          },
          "tenseKey": {
            "type": "string"
          },
          "difficultyLevel": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isAIGenerated": {
            "type": "boolean"
          }
        }
      },
      "AddTextRequest": {
        "required": [
          "title",
          "body",
          "difficultyLevel",
          "topic",
          "isAIGenerated"
        ],
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "difficultyLevel": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "topic": {
            "type": "string"
          },
          "isAIGenerated": {
            "type": "boolean"
          }
        }
      },
      "AddVocabularyCommand": {
        "required": [
          "word",
          "partOfSpeech",
          "difficultyLevel",
          "isAIGenerated"
        ],
        "type": "object",
        "properties": {
          "word": {
            "type": "string"
          },
          "partOfSpeech": {
            "type": "string"
          },
          "difficultyLevel": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isAIGenerated": {
            "type": "boolean"
          }
        }
      },
      "AuthResponse": {
        "required": [
          "accessToken",
          "email",
          "fullName",
          "expiresAt"
        ],
        "type": "object",
        "properties": {
          "accessToken": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "fullName": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CancelSubscriptionCommand": {
        "required": [
          "userId"
        ],
        "type": "object",
        "properties": {
          "userId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "CreateCheckoutSessionCommand": {
        "required": [
          "userId",
          "userEmail",
          "userFullName",
          "planId",
          "successUrl",
          "cancelUrl"
        ],
        "type": "object",
        "properties": {
          "userId": {
            "type": "string",
            "format": "uuid"
          },
          "userEmail": {
            "type": "string"
          },
          "userFullName": {
            "type": "string"
          },
          "planId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "successUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "cancelUrl": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "GenerateGrammarRuleCommand": {
        "required": [
          "tenseKey",
          "tenseName",
          "nativeLanguageId",
          "ruleExplanation",
          "structure",
          "isAIGenerated"
        ],
        "type": "object",
        "properties": {
          "tenseKey": {
            "type": "string"
          },
          "tenseName": {
            "type": "string"
          },
          "nativeLanguageId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "ruleExplanation": {
            "type": "string"
          },
          "structure": {
            "type": "string"
          },
          "isAIGenerated": {
            "type": "boolean"
          }
        }
      },
      "GenerateSentencesRequest": {
        "required": [
          "tenseKey",
          "difficultyLevel",
          "count"
        ],
        "type": "object",
        "properties": {
          "tenseKey": {
            "type": "string"
          },
          "difficultyLevel": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "GenerateTextRequest": {
        "required": [
          "title",
          "body",
          "difficultyLevel",
          "topic"
        ],
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "difficultyLevel": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "topic": {
            "type": "string"
          }
        }
      },
      "GenerateVocabularyCommand": {
        "required": [
          "word",
          "partOfSpeech",
          "difficultyLevel"
        ],
        "type": "object",
        "properties": {
          "word": {
            "type": "string"
          },
          "partOfSpeech": {
            "type": "string"
          },
          "difficultyLevel": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "IncrementUsageCommand": {
        "required": [
          "userId",
          "feature"
        ],
        "type": "object",
        "properties": {
          "userId": {
            "type": "string",
            "format": "uuid"
          },
          "feature": {
            "type": "string"
          }
        }
      },
      "LoginCommand": {
        "required": [
          "email",
          "password"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "password": {
            "type": "string"
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "instance": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RecalculateScoreCommand": {
        "required": [
          "userId",
          "year",
          "month"
        ],
        "type": "object",
        "properties": {
          "userId": {
            "type": "string",
            "format": "uuid"
          },
          "year": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "month": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "RegisterCommand": {
        "required": [
          "email",
          "password",
          "fullName",
          "nativeLanguageId"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "fullName": {
            "type": "string"
          },
          "nativeLanguageId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ResendVerificationEmailCommand": {
        "required": [
          "email"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          }
        }
      },
      "SubmitExerciseAttemptCommand": {
        "required": [
          "exerciseId",
          "userInput",
          "timeTakenSeconds"
        ],
        "type": "object",
        "properties": {
          "exerciseId": {
            "type": "string",
            "format": "uuid"
          },
          "userInput": {
            "type": "string"
          },
          "timeTakenSeconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "SubmitVocabularyAttemptCommand": {
        "required": [
          "exerciseId",
          "userInput",
          "timeTakenSeconds"
        ],
        "type": "object",
        "properties": {
          "exerciseId": {
            "type": "string",
            "format": "uuid"
          },
          "userInput": {
            "type": "string"
          },
          "timeTakenSeconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "UpdateProgressCommand": {
        "required": [
          "userId",
          "tenseKey",
          "masteryLevel",
          "totalAttempts",
          "correctAnswers"
        ],
        "type": "object",
        "properties": {
          "userId": {
            "type": "string",
            "format": "uuid"
          },
          "tenseKey": {
            "type": "string"
          },
          "masteryLevel": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalAttempts": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "correctAnswers": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "UpdateUserLanguageRequest": {
        "required": [
          "nativeLanguageId"
        ],
        "type": "object",
        "properties": {
          "nativeLanguageId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "UpgradePlanCommand": {
        "required": [
          "userId",
          "userEmail",
          "userFullName",
          "newPlanId"
        ],
        "type": "object",
        "properties": {
          "userId": {
            "type": "string",
            "format": "uuid"
          },
          "userEmail": {
            "type": "string"
          },
          "userFullName": {
            "type": "string"
          },
          "newPlanId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "UserResponse": {
        "required": [
          "id",
          "email",
          "fullName",
          "nativeLanguageId",
          "createdAt",
          "lastLoginAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": "string"
          },
          "fullName": {
            "type": "string"
          },
          "nativeLanguageId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastLoginAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "ValidationProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "instance": {
            "type": [
              "null",
              "string"
            ]
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      },
      "VerifyEmailCommand": {
        "required": [
          "token"
        ],
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "EnglishMastery.API"
    },
    {
      "name": "Billing"
    },
    {
      "name": "Authentication"
    },
    {
      "name": "Grammar"
    },
    {
      "name": "Vocabulary"
    },
    {
      "name": "Assessment"
    },
    {
      "name": "Content"
    }
  ]
}