send-code:
  post:
    tags:
      - Email Verification
    summary: 'Send Code'
    operationId: sendCode
    requestBody:
      content:
        application/json:
          schema:
            type: object
            properties:
              is_registration:
                type: string
                example: "Rules: ['required', 'numeric']. Example: `0` or `1`"
                required: true
              email:
                type: string
                example: "Rules: ['required', 'email']"
                required: true
    responses:
      '200':
        description: ""
        content:
          application/json:
            examples:
              success:
                value:
                  "success": true
                  "data": "The verification code will be valid for 5 minutes."


      '422':
        description: Validation Error
        content:
          application/json:
            examples:
              error:
                value:
                  errors: {
                      "is_registration": [
                          "The is_registration field is required.",
                          "The selected is_registration is invalid.",
                        ],
                      "email": [
                          "The email field is required.",
                          "The email field must be a valid email address.",
                        ],
                    }
      '500':
        description: Server error
        content:
          application/json:
            examples:
              error:
                value:
                  "success": false
                  "errors": ["Server error"]

confirm-code:
  post:
    tags:
      - Email Verification
    summary: 'Confirm Code'
    operationId: confirmCode
    requestBody:
      content:
        application/json:
          schema:
            type: object
            properties:
              email:
                type: string
                example: "Rules: ['required', 'email']"
                required: true
              code:
                type: string
                example: "Rules: ['required', 'numeric']"
                required: true
    responses:
      '200':
        description: ""
        content:
          application/json:
            examples:
              success:
                value:
                  "success": true
                  "data": true


      '422':
        description: Validation Error
        content:
          application/json:
            examples:
              error:
                value:
                  errors: {
                      "email": [
                          "The email field is required.",
                          "The email field must be a valid email address.",
                          "The selected email is invalid."
                      ],
                      "code": [
                          "The code field is required.",
                          "The selected code is invalid.",
                      ]
                    }
      '500':
        description: Server error
        content:
          application/json:
            examples:
              error:
                value:
                  "success": false
                  "errors": ["Server error"]
