openapi: 3.0.0
info:
  title: Flagright Management API
  version: '1.0'
  description: Flagright is a fully-managed, API-first compliance-as-a-service
    solution. This API provides for programmatic access to the Flagright no-code
    back office portal. The Flagright Management API is organized around REST.
    Our API has predictable resource-oriented URLs, accepts JSON-encoded request
    bodies, returns JSON-encoded responses, and uses standard HTTP response
    codes, authentication, and verbs.  API keys are used to authenticate the
    requests. Your API keys carry many privileges, so be sure to keep them
    secure! Do not share your secret API keys in publicly accessible areas such
    as GitHub, client-side code, and so forth.
servers:
  - url: https://sandbox.api.flagright.com/management
    description: Sandbox API server (eu-1)
    x-fern-server-name: Sandbox API server (eu-1)
  - url: https://sandbox-asia-1.api.flagright.com/management
    description: Sandbox API server (asia-1)
    x-fern-server-name: Sandbox API server (asia-1)
paths:
  /rules:
    get:
      security:
        - x-api-key: []
      summary: Rule - List
      tags: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Rule'
              examples:
                example-1:
                  value:
                    - id: R-1
                      type: TRANSACTION
                      name: First payment by customer
                      description: First Payment by customer
                      defaultParameters: {}
                      defaultRiskLevelParameters:
                        VERY_HIGH: {}
                        HIGH: {}
                        MEDIUM: {}
                        LOW: {}
                        VERY_LOW: {}
                      defaultAction: FLAG
                      defaultRiskLevelActions:
                        VERY_HIGH: FLAG
                        HIGH: FLAG
                        MEDIUM: FLAG
                        LOW: FLAG
                        VERY_LOW: FLAG
                      labels:
                        - string
                      defaultCasePriority: P1
      operationId: get-rules
      description: >-
        ### Rules List


        `GET /rules` endpoint returns a lot of all rule templates supported by flagright. You can use [GET /rules/{ruleId}](/management-api/api-reference/api-reference/get-rules-rule-id) endpoint to fetch the details of any particular rule. 


        Each rule is identified by the unique `id` which is of the form `R-{X}` where `X` is an integer. 


        Rules have a `parametersSchema` which is a [JSON Schema](https://json-schema.org/) that contains the schema of the parameters supported by the rule. When you create a [ruleInstance](/management-api/api-reference/api-reference/post-rule-instances), you need to provide the values in accordance with the `parametersSchema`. 


        All the rules come with default values for all required attributes. 


        Rules come with default `name`, `description`. Each rule may take multiple rule parameters, by default they have a `defaultParameters` attribute that contains all the required fields. For use cases where the rule parameters are forked based on customer dynamic risk score, `defaultRiskLevelParameters` are set. 


        Rules also come with a `defaultAction` and `defaultRiskLevelActions` for rule actions for the rule. 


        All of the above should be configured at the [rule instance](/management-api/api-reference/api-reference/post-rule-instances) level when creating a rule instance. Rules are read only and provided by flagright. You can only manipulate rules instances, not rule templates themselves. 


        If you need an update to a rule or a new rule, you can always contact the Flagright team.
      parameters: []
  /rules/{ruleId}:
    parameters:
      - schema:
          type: string
        name: ruleId
        in: path
        required: true
    get:
      security:
        - x-api-key: []
      summary: Rule - Get
      operationId: get-rules-ruleId
      tags: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Rule'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      description: >-
        ### Retrieve a Rule 


        `GET /rules/{ruleId}` endpoint returns a rule template supported by flagright.
  /rule-instances:
    post:
      security:
        - x-api-key: []
      summary: Rule Instance - Create
      operationId: post-rule_instances
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuleInstance'
              examples:
                example-1:
                  value:
                    id: string
                    type: TRANSACTION
                    ruleId: string
                    action: FLAG
                    parameters: {}
                    status: ACTIVE
                    casePriority: P1
                    createdAt: 0
                    updatedAt: 0
                    runCount: 0
                    hitCount: 0
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RuleInstanceUpdatable'
        required: true
      description: >-
        ### Create Rule Instance


        `POST /rule-instances` endpoint is used to create a new rule instance. A rule instance can be thought of as a live entity, that runs checks for for transactions. Rule instances use `Rule` templates as the blueprint. 


        Every rule instance has an associated `ruleId` of the rule from which it is derived. The details of the rule and the required parameters is found by `GET /rules` endpoint. 


        Once a rule instance is created, flagright generates an ID for the rule instance and also stores related metadata like:


        - `id` - unique identifier for the rule instance

        - `runCount` - how many times the rule instance was run

        - `hitCount` - how many times a rule was hit

        - `createdAt` & `updatedAt` - timestamps


        They are generated and maintained by the flagright system and are not updatable by the API.
    get:
      security:
        - x-api-key: []
      summary: Rule Instance - List
      operationId: get-rule_instances
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RuleInstance'
      description: >-
        ### Retrieve Rule Instances


        `GET /rule-instances` endpoint returns a list of all rule instances created by your account on flagright.
  /rule-instances/{ruleInstanceId}:
    parameters:
      - schema:
          type: string
        name: ruleInstanceId
        in: path
        required: true
    delete:
      security:
        - x-api-key: []
      summary: Rule Instance - Delete
      operationId: delete-rule_instances-ruleInstanceId
      responses:
        '200':
          description: OK
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      description: You can *permanently* delete a rule instance using the `DELETE
        /rule-instances/{ruleInstanceId}` endpoint. If you want to deactive a
        rule instance, you can update the status on the rule instance using the
        [POST
        /rule-instances/{ruleInstanceId}](/management-api/api-reference/api-reference/post-rule-instances-rule-instance-id)
        endpoint
    post:
      security:
        - x-api-key: []
      summary: Rule Instance - Update
      operationId: post-rule-instances-ruleInstanceId
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuleInstance'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RuleInstanceUpdatable'
        required: true
      description: >
        ### Update Rule Instance


        Created rule instances can be idempotently updated with the `POST /rule-instances/{ruleInstanceId}`.
  /rule-filters-schema:
    get:
      security:
        - x-api-key: []
      summary: Rule Filters Schema - Get
      tags: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
              examples:
                example-1:
                  value:
                    type: object
                    properties:
                      paymentMethod:
                        type: string
                        ui:schema:
                          ui:group: transaction
                          ui:subtype: PAYMENT_METHOD
                        title: Payment Method
                        enum:
                          - ACH
                          - CARD
                          - IBAN
                          - SWIFT
                          - UPI
                          - WALLET
                          - MPESA
                          - GENERIC_BANK_ACCOUNT
                          - CHECK
                          - CASH
                          - NPP
                        nullable: true
      operationId: get-rule-filters-schema
      description: >-
        ### Retrieve Rule Filters Schema


        `GET /rule-filteres-schema` endpoint returns the rule filters supported by flagright as [JSON Schema](https://json-schema.org/). 


        When you create a [rule instance](/management-api/api-reference/api-reference/post-rule-instances), you can use the schema returned by this endpoint to construct `filters` field for a rule instance.


        If you need an update to a rule filter or a new rule filter, you can always contact the Flagright team.
      parameters: []
    parameters: []
  /cases:
    post:
      security:
        - x-api-key: []
      summary: Case - Create
      operationId: post-cases
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Case'
              examples:
                example-1:
                  value:
                    caseId: string
                    entityDetails:
                      userId: string
                      type: USER
                    caseStatus: OPEN
                    priority: P1
                    createdTimestamp: 1713177955000
                    updatedAt: 1713177955000
                    relatedCases:
                      - string
                    tags:
                      - $ref: '#/components/schemas/Tag'
                    assignments:
                      - $ref: '#/components/schemas/Assignment'
                    creationReason:
                      reasons:
                        - string
                      comment: string
                      timestamp: 1713177955000
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CaseCreationRequest'
        required: true
    get:
      security:
        - x-api-key: []
      summary: Case - List
      operationId: get-cases
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CasesListResponse'
      parameters:
        - schema:
            type: string
          name: start
          in: query
          required: false
        - schema:
            type: number
            minimum: 1
            maximum: 100
          name: pageSize
          in: query
          required: false
        - schema:
            type: string
            enum:
              - createdTimestamp
              - updatedAt
              - caseId
              - priority
          name: sortBy
          in: query
          required: false
        - schema:
            type: string
            enum:
              - asc
              - desc
          name: sortOrder
          in: query
          required: false
        - schema:
            type: array
            items:
              $ref: '#/components/schemas/Status'
          name: filterCaseStatus
          in: query
          required: false
        - schema:
            $ref: '#/components/schemas/Priority'
          name: filterPriority
          in: query
          required: false
        - schema:
            type: array
            items:
              $ref: '#/components/schemas/CaseSource'
          name: filterCaseSource
          in: query
          required: false
        - schema:
            type: number
          name: filterAfterCreatedTimestamp
          in: query
          required: false
        - schema:
            type: number
          name: filterBeforeCreatedTimestamp
          in: query
          required: false
      description: '### Retrieve Cases'
  /cases/{caseId}:
    parameters:
      - schema:
          type: string
        name: caseId
        in: path
        required: true
    get:
      security:
        - x-api-key: []
      summary: Case - Get
      operationId: get-cases-caseId
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Case'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      description: '### Retrieve a Case'
    patch:
      security:
        - x-api-key: []
      summary: Case - Update
      operationId: patch-cases-caseId
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Case'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CaseUpdateable'
        required: true
      description: '### Update Case'
  /cases/{caseId}/statuses:
    parameters:
      - schema:
          type: string
        name: caseId
        in: path
        required: true
    post:
      security:
        - x-api-key: []
      summary: Case - Update Status
      operationId: post-cases-caseId-statuses
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  caseStatus:
                    $ref: '#/components/schemas/ExternalRequestCaseStatus'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CaseStatusChangeRequest'
        required: true
      description: >-
        ### Update Case Status 

        The `POST /cases/{caseId}/statuses` endpoint is used to update the status of a case. The status can be one of the following values: `OPEN`, `CLOSED`, `REOPENED`, `IN_PROGRESS`, `ON_HOLD`.

        Note: When closing a case the `reason` field is required.
  /alerts:
    post:
      security:
        - x-api-key: []
      summary: Alert - Create
      operationId: post-alerts
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alert'
              examples:
                example-1:
                  value:
                    alertId: string
                    entityDetails:
                      type: TRANSACTION
                      transactionIds:
                        - string
                    alertStatus: OPEN
                    priority: P1
                    createdTimestamp: 1713177955000
                    updatedAt: 1713177955000
                    tags:
                      - $ref: '#/components/schemas/Tag'
                    assignments:
                      - $ref: '#/components/schemas/Assignment'
                    creationReason:
                      reasons:
                        - string
                      comment: string
                      timestamp: 1713177955000
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertCreationRequest'
        required: true
  /alerts/{alertId}:
    parameters:
      - schema:
          type: string
        name: alertId
        in: path
        required: true
    get:
      security:
        - x-api-key: []
      summary: Alert - Get
      operationId: get-alerts-alertId
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alert'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      description: '### Retrieve an Alert'
    patch:
      security:
        - x-api-key: []
      summary: Alert - Update
      operationId: patch-alerts-alertId
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alert'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertUpdatable'
        required: true
      description: '### Update Alert'
  /alerts/{alertId}/hits:
    get:
      security:
        - x-api-key: []
      summary: Retrieve Alert Hits
      operationId: get-alert-hits
      parameters:
        - name: alertId
          in: path
          description: Unique Alert Identifier
          required: true
          style: simple
          schema:
            type: string
        - schema:
            $ref: '#/components/schemas/PageSize'
          in: query
          name: pageSize
        - schema:
            $ref: '#/components/schemas/Page'
          in: query
          name: page
      responses:
        '200':
          description: OK
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertHitsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
  /alerts/{alertId}/hits/status:
    post:
      security:
        - x-api-key: []
      summary: Update Alert Hits Status
      operationId: post-alert-hits-status
      parameters:
        - name: alertId
          in: path
          description: Unique Alert Identifier
          required: true
          style: simple
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HitsStatusUpdateRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
  /alerts/{alertId}/comments:
    get:
      security:
        - x-api-key: []
      summary: Retrieve Alert Comments
      description: >
        ## GET Alert Comments

        `GET /alerts/{alertId}/comments` endpoint returns all comments for an alert.
      operationId: get-alert-comments
      parameters:
        - name: alertId
          in: path
          description: Unique Alert Identifier
          required: true
          style: simple
          schema:
            type: string
      responses:
        '200':
          description: OK
          headers: {}
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CommentResponse'
              examples:
                example-1:
                  value:
                    - commentId: 96647cfd9e8fe66ee0f3362e011e34e8
                      body: This is a comment
                      files:
                        - filename: file.txt
                          size: 1024
                          downloadLink: s3://bucket/key
                      createdTimestamp: 1641654664000
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
    post:
      security:
        - x-api-key: []
      summary: Create an Alert Comment
      description: >
        ## POST Alert Comments 

        `POST /alerts/{alertId}/comments` endpoint is used to create a comment for an alert.

        To attach files in the comment upload the file first using the `POST /pre-signed-url` endpoint and then use the returned `key` to attach the file in the comment with the filename and size.`
      operationId: post-alert-comment
      parameters:
        - name: alertId
          in: path
          description: Unique Alert Identifier
          required: true
          style: simple
          schema:
            type: string
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CommentRequest'
            examples:
              example-1:
                value:
                  body: This is a comment
                  createdTimestamp: 1641654664000
        required: true
      responses:
        '201':
          description: Created
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommentResponse'
              examples:
                example-1:
                  value:
                    commentId: 96647cfd9e8fe66ee0f3362e011e34e8
                    body: This is a comment
                    createdTimestamp: 1641654664000
  /alerts/{alertId}/comments/{commentId}:
    get:
      security:
        - x-api-key: []
      summary: Retrieve an Alert Comment
      description: >
        ## GET Alert Comment

        `GET /alerts/{alertId}/comments/{commentId}` endpoint returns a comment for an alert.
      operationId: get-alert-comment
      parameters:
        - name: alertId
          in: path
          description: Unique Alert Identifier
          required: true
          style: simple
          schema:
            type: string
        - name: commentId
          in: path
          description: Unique Comment Identifier
          required: true
          style: simple
          schema:
            type: string
      responses:
        '200':
          description: OK
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommentResponse'
              examples:
                example-1:
                  value:
                    commentId: 96647cfd9e8fe66ee0f3362e011e34e8
                    body: This is a comment
                    files:
                      - filename: file.txt
                        size: 1024
                        downloadLink: s3://bucket/key
                    createdTimestamp: 1641654664000
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
    delete:
      security:
        - x-api-key: []
      summary: Delete an Alert Comment
      description: >
        ## DELETE Alert Comment

        `DELETE /alerts/{alertId}/comments/{commentId}` endpoint is used to delete an alert comment.
      operationId: delete-alert-comment
      parameters:
        - name: alertId
          in: path
          description: Unique Alert Identifier
          required: true
          style: simple
          schema:
            type: string
        - name: commentId
          in: path
          description: Unique Comment Identifier
          required: true
          style: simple
          schema:
            type: string
      responses:
        '204':
          description: Deleted successfully
          headers: {}
          content: {}
        '400':
          description: Bad Request
          headers: {}
  /alerts/{alertId}/statuses:
    parameters:
      - schema:
          type: string
        name: alertId
        in: path
        required: true
    post:
      security:
        - x-api-key: []
      summary: Alert - Update Status
      operationId: post-alerts-alertId-statuses
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  alertStatus:
                    $ref: '#/components/schemas/ExternalRequestCaseStatus'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertStatusChangeRequest'
        required: true
      description: >-
        ### Update Alert Status 

        The `POST /alerts/{alertId}/statuses` endpoint is used to update the status of an alert. The status can be one of the following values: `OPEN`, `CLOSED`, `REOPENED`, `IN_PROGRESS`, `ON_HOLD`.

        Note: When closing an alert the `reason` field is required.
  /pre-signed-url:
    post:
      security:
        - x-api-key: []
      summary: Get a pre-signed URL
      operationId: get-upload-presignedUrl
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PresignedUrlResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PresignedPostRequest'
        required: true
      description: >-
        ### Generate Pre-Signed URL for File Uploads


        The `POST /pre-signed-url` endpoint provides a secure, pre-signed URL that you can use to upload files directly to a designated storage service. The URL is time-limited, remaining valid for 15 minutes, and authenticated to ensure that file uploads are secure. The maximum supported file size is 100000000 bytes (100MB).


        #### Uploading Your File


        Once you have obtained the pre-signed URL and the accompanying fields (`key`, `name`, `x-amz-Algorithm`, `x-amz-credential`, `x-amz-date`, `x-amz-signature`, `x-amz-security-token`) from the API endpoint:


        To upload your file to the designated storage location using the provided data, you need to make a request formatted as follows:


        ```bash
            curl -X POST 'url' \
            --form 'key="key"' \
            --form 'name="name"' \
            --form 'X-Amz-Algorithm="x-amz-algorithm"' \   
            --form 'X-Amz-Credential="x-amz-credential"' \
            --form 'X-Amz-Date="x-amz-date"' \
            --form 'X-Amz-Security-Token="x-amz-security-token"' \
            --form 'Policy="policy"' \
            --form 'X-Amz-Signature= "x-amz-signature"' \
            --form 'file=@"/path/to/file"'
        ```

        **Important Note:** You must retain the returned `key` as it is essential for later referencing the file in the application, such as attaching it to a case or including it in a user comment.
  /users/{userId}/comments:
    get:
      security:
        - x-api-key: []
      summary: Retrieve User Comments
      description: |
        ## GET User Comments

        `GET /users/{userId}/comments` endpoint returns all comments for a user.
      operationId: get-user-comments
      parameters:
        - name: userId
          in: path
          description: Unique User Identifier
          required: true
          style: simple
          schema:
            type: string
      responses:
        '200':
          description: OK
          headers: {}
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CommentResponse'
              examples:
                example-1:
                  value:
                    - commentId: 96647cfd9e8fe66ee0f3362e011e34e8
                      body: This is a comment
                      createdTimestamp: 1641654664000
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: Unauthorized
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
    post:
      security:
        - x-api-key: []
      summary: Create a User Comment
      description: >
        ## POST User Comments 

        `POST /users/{userId}/comments` endpoint is used to create a comment for a user.

        To attach files in the comment upload the file first using the `POST /pre-signed-url` endpoint and then use the returned `key` to attach the file in the comment with the filename and size.`
      operationId: post-user-comment
      parameters:
        - name: userId
          in: path
          description: Unique User Identifier
          required: true
          style: simple
          schema:
            type: string
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CommentRequest'
            examples:
              example-1:
                value:
                  body: This is a comment
                  createdTimestamp: 1641654664000
        required: true
      responses:
        '201':
          description: Created
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommentResponse'
              examples:
                example-1:
                  value:
                    commentId: 96647cfd9e8fe66ee0f3362e011e34e8
                    body: This is a comment
                    createdTimestamp: 1641654664000
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
  /users/{userId}/comments/{commentId}:
    get:
      security:
        - x-api-key: []
      summary: Retrieve a User Comment
      description: >
        ## GET User Comment

        `GET /users/{userId}/comments/{commentId}` endpoint returns a comment for a user.
      operationId: get-user-comment
      parameters:
        - name: userId
          in: path
          description: Unique User Identifier
          required: true
          style: simple
          schema:
            type: string
        - name: commentId
          in: path
          description: Unique Comment Identifier
          required: true
          style: simple
          schema:
            type: string
      responses:
        '200':
          description: OK
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommentResponse'
              examples:
                example-1:
                  value:
                    commentId: 96647cfd9e8fe66ee0f3362e011e34e8
                    body: This is a comment
                    files:
                      - filename: file.txt
                        size: 1024
                        downloadLink: s3://bucket/key
                    createdTimestamp: 1641654664000
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
    delete:
      security:
        - x-api-key: []
      summary: Delete a User Comment
      description: >
        ## DELETE User Comment

        `DELETE /users/{userId}/comments/{commentId}` endpoint is used to delete a user comment.
      operationId: delete-user-comment
      parameters:
        - name: userId
          in: path
          description: Unique User Identifier
          required: true
          style: simple
          schema:
            type: string
        - name: commentId
          in: path
          description: Unique Comment Identifier
          required: true
          style: simple
          schema:
            type: string
      responses:
        '204':
          description: Deleted successfully
          headers: {}
          content: {}
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Comment not found
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
  /users/search:
    get:
      security:
        - x-api-key: []
      summary: Users - Search
      operationId: get-users-search
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsersSearchResponse'
        '400':
          description: Bad Request
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      parameters:
        - schema:
            type: string
          name: name
          in: query
        - schema:
            type: string
          name: email
          in: query
        - schema:
            type: string
          name: start
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 100
          name: pageSize
          in: query
        - schema:
            type: string
            enum:
              - asc
              - desc
          name: sortOrder
          in: query
        - schema:
            type: string
            enum:
              - createdTimestamp
              - updatedAt
          name: sortBy
          in: query
      description: >
        ## Users Search

        `GET /users/search` endpoint retrieves a list of users matching the specified search criteria.
  /lists:
    get:
      security:
        - x-api-key: []
      summary: Get all lists
      description: Get all lists
      operationId: get-lists
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListsResponse'
    post:
      security:
        - x-api-key: []
      summary: Create or update a list
      description: POST /lists endpoint creates updates or clears a list.
      operationId: post-lists
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListUpdateRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
  /lists/{listId}:
    get:
      security:
        - x-api-key: []
      summary: Get a list by id
      description: Get a list by id
      operationId: get-list-by-id
      parameters:
        - name: listId
          in: path
          description: List ID
          required: true
          style: simple
          schema:
            type: string
        - schema:
            type: string
          name: start
          in: query
        - schema:
            type: number
          name: pageSize
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListItemsResponse'
        '404':
          description: List not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
  /crm/link:
    post:
      security:
        - x-api-key: []
      summary: Link a CRM record to a user
      description: Link a CRM record to a user
      operationId: post-crm-link
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CRMRecordLinkRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CRMRecordLinkResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
components:
  schemas:
    CRMRecordLinkRequest:
      title: CRMRecordLinkRequest
      type: object
      properties:
        userId:
          type: string
        crmRecordId:
          type: string
        recordType:
          type: string
          enum:
            - TICKET
        crmName:
          type: string
          enum:
            - FRESHDESK
      required:
        - userId
        - crmRecordId
        - recordType
        - crmName
    CRMRecordLinkResponse:
      title: CRMRecordLinkResponse
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
      required:
        - success
        - message
    List:
      title: List
      type: object
      properties:
        listId:
          type: string
        listType:
          type: string
          enum:
            - WHITELIST
            - BLACKLIST
        subtype:
          $ref: '#/components/schemas/ListSubtype'
        data:
          $ref: '#/components/schemas/ListData'
      required:
        - listId
        - listType
        - subtype
        - data
    ListSubtype:
      type: string
      enum:
        - USER_ID
        - CARD_FINGERPRINT_NUMBER
        - IBAN_NUMBER
        - BANK_ACCOUNT_NUMBER
        - ACH_ACCOUNT_NUMBER
        - SWIFT_ACCOUNT_NUMBER
        - BIC
        - BANK_SWIFT_CODE
        - UPI_IDENTIFYING_NUMBER
        - IP_ADDRESS
        - DEVICE_IDENTIFIER
        - STRING
        - COUNTRY
        - CUSTOM
    ListAppendRequest:
      title: ListAppendRequest
      type: object
      properties:
        data:
          $ref: '#/components/schemas/ListData'
        operation:
          type: string
          enum:
            - APPEND
        listId:
          type: string
        listType:
          type: string
          enum:
            - WHITELIST
            - BLACKLIST
        subtype:
          type: string
          enum:
            - USER_ID
      required:
        - data
        - operation
        - listId
        - listType
        - subtype
    ListClearRequest:
      title: ListClearRequest
      type: object
      properties:
        listId:
          type: string
        operation:
          type: string
          enum:
            - CLEAR
      required:
        - listId
        - operation
    ListUpdateRequest:
      title: ListUpdateRequest
      oneOf:
        - $ref: '#/components/schemas/ListAppendRequest'
        - $ref: '#/components/schemas/ListClearRequest'
    ListData:
      type: object
      title: ListData
      description: Payload of a list, new or existed
      properties:
        metadata:
          $ref: '#/components/schemas/ListMetadata'
        items:
          type: array
          description: List items
          items:
            $ref: '#/components/schemas/ListItem'
    ListDataItems:
      title: ListDataItems
      type: object
      properties:
        key:
          type: string
      required:
        - key
    ListResponse:
      title: ListResponse
      type: object
      properties:
        status:
          type: string
          enum:
            - SUCCESS
            - FAILURE
        message:
          type: string
        listId:
          type: string
      required:
        - status
        - message
        - listId
    ListHeader:
      title: ListHeader
      type: object
      properties:
        listId:
          type: string
        listType:
          $ref: '#/components/schemas/ListType'
        subtype:
          $ref: '#/components/schemas/ListSubtype'
        metadata:
          $ref: '#/components/schemas/ListMetadata'
        createdTimestamp:
          type: number
        size:
          type: number
        version:
          type: number
      required:
        - listId
        - listType
        - subtype
        - createdTimestamp
    ListsResponse:
      title: ListsResponse
      type: object
      properties:
        lists:
          type: array
          items:
            $ref: '#/components/schemas/ListHeader'
      required:
        - lists
    ListItemsResponse:
      title: ListItemsResponse
      type: object
      properties:
        listId:
          type: string
        items:
          type: array
          items:
            $ref: '#/components/schemas/ListDataItems'
      required:
        - listId
        - items
    UsersSearchResponse:
      title: UsersSearchResponse
      type: object
      properties:
        items:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/User'
              - $ref: '#/components/schemas/Business'
        hasNext:
          type: boolean
        hasPrev:
          type: boolean
        next:
          type: string
        prev:
          type: string
        count:
          type: integer
        pageSize:
          type: integer
        last:
          type: string
    ExternalRequestCaseStatus:
      type: string
      title: ExternalRequestCaseStatus
      enum:
        - OPEN
        - CLOSED
        - REOPENED
        - IN_PROGRESS
        - ON_HOLD
    CommentRequest:
      title: CommentRequest
      type: object
      properties:
        id:
          type: string
        body:
          type: string
        type:
          type: string
          enum:
            - STATUS_CHANGE
        parentId:
          type: string
        files:
          type: array
          items:
            $ref: '#/components/schemas/FileInfo'
      required:
        - body
    RequestFileInfo:
      title: RequestFileInfo
      type: object
      properties:
        s3Key:
          type: string
          description: S3 key of the file
        filename:
          type: string
          description: Name of the file
        size:
          type: number
          description: Size of the file in bytes
      required:
        - s3Key
        - filename
        - size
    CommentResponse:
      title: CommentResponse
      type: object
      properties:
        commentId:
          type: string
          description: Unique comment ID
        body:
          type: string
          description: Comment body
        files:
          type: array
          items:
            $ref: '#/components/schemas/ResponseFileInfo'
        createdTimestamp:
          type: number
          description: Timestamp when comment is created
        updatedTimestamp:
          type: number
          description: Timestamp when comment is updated
      required:
        - body
        - commentId
    ResponseFileInfo:
      title: ResponseFileInfo
      type: object
      properties:
        filename:
          type: string
          description: Name of the file
        size:
          type: number
          description: Size of the file in bytes
        downloadLink:
          type: string
          description: Download link for the file
      required:
        - filename
        - size
        - downloadLink
    PresignedPostRequest:
      title: PresignedPostRequest
      type: object
      description: ''
      properties:
        filename:
          type: string
        fileSize:
          type: number
          maximum: 100000000
          description: File size should be less than 100000000 bytes
      required:
        - filename
        - fileSize
    PresignedUrlResponse:
      title: PresignedUrlResponse
      type: object
      properties:
        presignedUrl:
          type: string
        s3Key:
          type: string
      required:
        - presignedUrl
        - s3Key
    AlertStatusChangeRequest:
      title: AlertStatusChangeRequest
      type: object
      properties:
        status:
          $ref: '#/components/schemas/ExternalRequestCaseStatus'
        reason:
          type: array
          items:
            type: string
        otherReason:
          type: string
        comment:
          type: string
        files:
          type: array
          items:
            $ref: '#/components/schemas/RequestFileInfo'
      required:
        - status
    CaseStatusChangeRequest:
      title: CaseStatusChangeRequest
      type: object
      properties:
        status:
          $ref: '#/components/schemas/ExternalRequestCaseStatus'
        reason:
          type: array
          items:
            type: string
        otherReason:
          type: string
        comment:
          type: string
        files:
          type: array
          items:
            $ref: '#/components/schemas/RequestFileInfo'
      required:
        - status
    RuleInstance:
      title: RuleInstance
      type: object
      properties:
        id:
          type: string
        ruleId:
          type: string
        casePriority:
          $ref: '#/components/schemas/Priority'
        alertCreationOnHit:
          type: boolean
        logic:
          type: object
        riskLevelLogic:
          $ref: '#/components/schemas/RiskLevelRuleLogic'
        logicAggregationVariables:
          type: array
          items:
            $ref: '#/components/schemas/LogicAggregationVariable'
        logicMachineLearningVariables:
          type: array
          items:
            $ref: '#/components/schemas/RuleMachineLearningVariable'
        logicEntityVariables:
          type: array
          items:
            $ref: '#/components/schemas/LogicEntityVariableInUse'
        baseCurrency:
          oneOf:
            - $ref: '#/components/schemas/CurrencyCode'
            - type: string
              enum:
                - ORIGINAL_CURRENCY
        parameters:
          type: object
        action:
          $ref: '#/components/schemas/RuleAction'
        type:
          $ref: '#/components/schemas/RuleType'
        ruleNameAlias:
          type: string
        ruleDescriptionAlias:
          type: string
        filters:
          type: object
        riskLevelParameters:
          $ref: '#/components/schemas/RiskLevelRuleParameters'
        riskLevelActions:
          $ref: '#/components/schemas/RiskLevelRuleActions'
        triggersOnHit:
          $ref: '#/components/schemas/TriggersOnHit'
        riskLevelsTriggersOnHit:
          $ref: '#/components/schemas/RiskLevelsTriggersOnHit'
        nature:
          $ref: '#/components/schemas/RuleNature'
        labels:
          type: array
          items:
            $ref: '#/components/schemas/RuleLabels'
        status:
          $ref: '#/components/schemas/RuleInstanceStatus'
        createdAt:
          type: number
        updatedAt:
          type: number
        runCount:
          type: number
        hitCount:
          type: number
        ruleRunTime:
          type: number
        falsePositiveCheckEnabled:
          type: boolean
        checklistTemplateId:
          type: string
        queueId:
          type: string
        alertConfig:
          type: object
          properties:
            alertCreationInterval:
              oneOf:
                - $ref: '#/components/schemas/AlertCreationIntervalInstantly'
                - $ref: '#/components/schemas/AlertCreationIntervalWeekly'
                - $ref: '#/components/schemas/AlertCreationIntervalMonthly'
                - $ref: '#/components/schemas/AlertCreationIntervalDaily'
            alertAssignees:
              type: array
              items:
                type: string
            alertAssigneeRole:
              type: string
            alertCreatedFor:
              type: array
              items:
                type: string
                enum:
                  - USER
                  - PAYMENT_DETAILS
                  - ADDRESS
                  - EMAIL
                  - NAME
            frozenStatuses:
              type: array
              items:
                $ref: '#/components/schemas/DerivedStatus'
            alertCreationDirection:
              $ref: '#/components/schemas/AlertCreationDirection'
            slaPolicies:
              type: array
              items:
                type: string
              maxItems: 5
            defaultAlertStatus:
              $ref: '#/components/schemas/DefaultAlertStatusForCaseCreation'
        checksFor:
          type: array
          items:
            type: string
        createdBy:
          type: string
        mode:
          $ref: '#/components/schemas/RuleMode'
        ruleRunMode:
          $ref: '#/components/schemas/RuleRunMode'
        ruleExecutionMode:
          $ref: '#/components/schemas/RuleExecutionMode'
        userRuleRunCondition:
          $ref: '#/components/schemas/UserRuleRunCondition'
        ruleRunFor:
          enum:
            - SENDER
            - RECEIVER
        screeningAlertCreationLogic:
          $ref: '#/components/schemas/ScreeningAlertCreationLogic'
        alertCreationLogic:
          $ref: '#/components/schemas/AlertCreationLogic'
      required:
        - casePriority
        - nature
        - labels
        - checksFor
        - type
        - ruleRunMode
        - ruleExecutionMode
    RuleInstanceBase:
      title: RuleInstanceBase
      type: object
      description: ''
      properties:
        id:
          type: string
        type:
          $ref: '#/components/schemas/RuleType'
        ruleId:
          type: string
        runCount:
          type: number
        hitCount:
          type: integer
        createdAt:
          type: number
        updatedAt:
          type: number
        checksFor:
          type: array
          items:
            type: string
      required:
        - id
        - type
        - ruleId
        - checksFor
    RuleInstanceUpdatable:
      title: RuleInstanceUpdatable
      type: object
      properties:
        ruleId:
          type: string
        alertCreationOnHit:
          type: boolean
        filters:
          type: object
          description: Rule filters. A key-value json object corresponding to the json
            schema returned by /rule-filters-schema endpoint.
        parameters:
          type: object
        ruleNameAlias:
          type: string
        riskLevelParameters:
          $ref: '#/components/schemas/RiskLevelRuleParameters'
        action:
          $ref: '#/components/schemas/RuleAction'
        riskLevelActions:
          $ref: '#/components/schemas/RiskLevelRuleActions'
        triggersOnHit:
          $ref: '#/components/schemas/TriggersOnHit'
        riskLevelsTriggersOnHit:
          $ref: '#/components/schemas/RiskLevelsTriggersOnHit'
        status:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
        casePriority:
          $ref: '#/components/schemas/Priority'
    StatusDetails:
      title: StatusDetails
      type: object
      properties:
        description:
          type: string
    UserDirections:
      title: UserDirections
      type: string
      enum:
        - ALL
        - ORIGIN
        - DESTINATION
    UserStateDetailsInternal:
      type: object
      properties:
        reason:
          type: string
        state:
          $ref: '#/components/schemas/UserState'
        description:
          type: string
      required:
        - state
        - reason
    KYCStatusDetailsInternal:
      type: object
      properties:
        reason:
          type: string
        status:
          $ref: '#/components/schemas/KYCStatus'
        description:
          type: string
      required:
        - reason
    TriggersOnHit:
      title: TriggersOnHit
      type: object
      properties:
        usersToCheck:
          $ref: '#/components/schemas/UserDirections'
        userStateDetails:
          $ref: '#/components/schemas/UserStateDetailsInternal'
        kycStatusDetails:
          $ref: '#/components/schemas/KYCStatusDetailsInternal'
        pepStatus:
          $ref: '#/components/schemas/PEPStatus'
        listId:
          type: string
        tags:
          type: array
          items:
            $ref: '#/components/schemas/UserTag'
    RiskLevelsTriggersOnHit:
      title: RiskLevelsTriggersOnHit
      type: object
      properties:
        VERY_HIGH:
          $ref: '#/components/schemas/TriggersOnHit'
        HIGH:
          $ref: '#/components/schemas/TriggersOnHit'
        MEDIUM:
          $ref: '#/components/schemas/TriggersOnHit'
        LOW:
          $ref: '#/components/schemas/TriggersOnHit'
        VERY_LOW:
          $ref: '#/components/schemas/TriggersOnHit'
      required:
        - VERY_HIGH
        - HIGH
        - MEDIUM
        - LOW
        - VERY_LOW
    RuleAction:
      type: string
      title: RuleAction
      enum:
        - ALLOW
        - FLAG
        - BLOCK
        - SUSPEND
      x-examples:
        example-1: ALLOW
      description: Model for rule action if a rule is hit. This is returned in the API
        response and can be configured on Console by operational accounts like a
        Compliance Analyst
    RuleActionAlias:
      type: object
      title: RuleActionAlias
      properties:
        action:
          $ref: '#/components/schemas/RuleAction'
        alias:
          type: string
      required:
        - action
        - alias
    Priority:
      type: string
      title: Priority
      enum:
        - P1
        - P2
        - P3
        - P4
    CaseSource:
      type: string
      title: CaseSource
      enum:
        - MANUAL
        - SYSTEM
        - EXTERNAL
    RuleLabels:
      type: string
      title: RuleLabels
      enum:
        - UNEXPECTED_BEHAVIOR
        - ILLICIT_GAINS_CHECK
        - RFI_TRIGGER
        - EDD_TRIGGER
        - KYC_TRIGGER
        - SCAM
        - ABUSE
        - ACCOUNT_TAKEOVER
        - DISPUTE
        - SANCTIONS
        - SANCTIONS_PEP
        - SANCTIONS_PEP_ADVERSE_MEDIA
        - SANCTIONS_MANUAL_REVIEW
    RiskLevelRuleActions:
      title: RiskLevelRuleActions
      type: object
      properties:
        VERY_HIGH:
          $ref: '#/components/schemas/RuleAction'
        HIGH:
          $ref: '#/components/schemas/RuleAction'
        MEDIUM:
          $ref: '#/components/schemas/RuleAction'
        LOW:
          $ref: '#/components/schemas/RuleAction'
        VERY_LOW:
          $ref: '#/components/schemas/RuleAction'
      required:
        - VERY_HIGH
        - HIGH
        - MEDIUM
        - LOW
        - VERY_LOW
    RiskLevelRuleParameters:
      title: RiskLevelRuleParameters
      type: object
      properties:
        VERY_HIGH:
          type: object
        HIGH:
          type: object
        MEDIUM:
          type: object
        LOW:
          type: object
        VERY_LOW:
          type: object
      required:
        - VERY_HIGH
        - HIGH
        - MEDIUM
        - LOW
        - VERY_LOW
    RuleType:
      title: RuleType
      type: string
      enum:
        - TRANSACTION
        - USER
        - USER_ONGOING_SCREENING
    Rule:
      title: Rule
      type: object
      properties:
        id:
          type: string
        type:
          $ref: '#/components/schemas/RuleType'
        name:
          type: string
        description:
          type: string
        types:
          type: array
          items:
            type: string
        typologies:
          type: array
          items:
            type: string
        defaultLogic:
          type: object
        defaultRiskLevelLogic:
          $ref: '#/components/schemas/RiskLevelRuleLogic'
        defaultLogicAggregationVariables:
          type: array
          items:
            $ref: '#/components/schemas/LogicAggregationVariable'
        defaultBaseCurrency:
          oneOf:
            - $ref: '#/components/schemas/CurrencyCode'
            - type: string
              enum:
                - ORIGINAL_CURRENCY
        parametersSchema:
          type: object
        defaultParameters:
          type: object
        defaultAction:
          $ref: '#/components/schemas/RuleAction'
        ruleImplementationName:
          type: string
        labels:
          type: array
          items:
            $ref: '#/components/schemas/RuleLabels'
        defaultNature:
          $ref: '#/components/schemas/RuleNature'
        defaultCasePriority:
          $ref: '#/components/schemas/Priority'
        descriptionTemplate:
          type: string
        defaultRiskLevelParameters:
          $ref: '#/components/schemas/RiskLevelRuleParameters'
        defaultRiskLevelActions:
          $ref: '#/components/schemas/RiskLevelRuleActions'
        defaultFilters:
          type: object
        createdAt:
          type: number
        updatedAt:
          type: number
        tenantIds:
          type: array
          items:
            type: string
        defaultFalsePositiveCheckEnabled:
          type: boolean
        requiredFeatures:
          type: array
          items:
            $ref: '#/components/schemas/Feature'
        checksFor:
          type: array
          items:
            type: string
        tags:
          type: array
          items:
            $ref: '#/components/schemas/RuleTag'
        sampleUseCases:
          type: string
      required:
        - id
        - type
        - name
        - description
        - parametersSchema
        - defaultAction
        - labels
        - defaultNature
        - defaultCasePriority
        - checksFor
        - types
        - typologies
        - sampleUseCases
    CaseCreationRequest:
      type: object
      properties:
        caseId:
          type: string
        createdTimestamp:
          type: number
          minimum: 1262300400000
          maximum: 4133890801000
        priority:
          $ref: '#/components/schemas/Priority'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        creationReason:
          $ref: '#/components/schemas/ActionReason'
        entityDetails:
          oneOf:
            - $ref: '#/components/schemas/UserEntityDetails'
            - $ref: '#/components/schemas/PaymentEntityDetails'
            - $ref: '#/components/schemas/AddressEntityDetails'
            - $ref: '#/components/schemas/EmailEntityDetails'
            - $ref: '#/components/schemas/NameEntityDetails'
        relatedCases:
          type: array
          items:
            type: string
        assignments:
          type: array
          items:
            $ref: '#/components/schemas/Assignment'
      required:
        - caseId
        - createdTimestamp
        - entityDetails
        - priority
    AlertCreationRequest:
      type: object
      properties:
        alertId:
          type: string
        createdTimestamp:
          type: number
          minimum: 1262300400000
          maximum: 4133890801000
        caseId:
          type: string
        priority:
          $ref: '#/components/schemas/Priority'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        creationReason:
          $ref: '#/components/schemas/ActionReason'
        entityDetails:
          oneOf:
            - $ref: '#/components/schemas/TransactionHitDetails'
            - $ref: '#/components/schemas/SanctionsHitDetails'
        assignments:
          type: array
          items:
            $ref: '#/components/schemas/Assignment'
        ruleDetails:
          $ref: '#/components/schemas/AlertRuleDetails'
      required:
        - alertId
        - createdTimestamp
        - caseId
        - priority
        - ruleDetails
    CaseBase:
      title: CaseBase
      type: object
      description: ''
      properties:
        caseId:
          type: string
        createdTimestamp:
          type: number
          minimum: 1262300400000
          maximum: 4133890801000
      required:
        - caseId
        - createdTimestamp
    AlertBase:
      title: AlertBase
      type: object
      description: ''
      properties:
        alertId:
          type: string
        createdTimestamp:
          type: number
          minimum: 1262300400000
          maximum: 4133890801000
        caseId:
          type: string
      required:
        - alertId
        - createdTimestamp
        - caseId
    TransactionHitDetails:
      title: TransactionHitDetails
      type: object
      description: ''
      properties:
        type:
          type: string
          enum:
            - TRANSACTION
        transactionIds:
          type: array
          items:
            type: string
      required:
        - type
        - transactionIds
    SanctionsHitDetails:
      title: SanctionsHitDetails
      type: object
      description: ''
      properties:
        type:
          type: string
          enum:
            - SANCTIONS
      required:
        - type
        - sanctionIds
    AlertUpdatable:
      title: AlertUpdateable
      type: object
      description: ''
      properties:
        priority:
          $ref: '#/components/schemas/Priority'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        creationReason:
          $ref: '#/components/schemas/ActionReason'
        entityDetails:
          oneOf:
            - $ref: '#/components/schemas/TransactionHitDetails'
            - $ref: '#/components/schemas/SanctionsHitDetails'
        assignments:
          type: array
          items:
            $ref: '#/components/schemas/Assignment'
        ruleDetails:
          $ref: '#/components/schemas/AlertRuleDetails'
    AlertDerived:
      title: AlertDerived
      type: object
      description: ''
      properties:
        alertStatus:
          $ref: '#/components/schemas/Status'
        updatedAt:
          type: number
    Alert:
      title: Alert
      type: object
      properties:
        _id:
          type: integer
        alertId:
          type: string
        parentAlertId:
          type: string
        createdTimestamp:
          type: number
        availableAfterTimestamp:
          type: number
        latestTransactionArrivalTimestamp:
          type: number
        caseId:
          type: string
        alertStatus:
          $ref: '#/components/schemas/AlertStatus'
        assignments:
          type: array
          items:
            $ref: '#/components/schemas/Assignment'
        reviewAssignments:
          type: array
          items:
            $ref: '#/components/schemas/Assignment'
        creationReason:
          $ref: '#/components/schemas/ActionReason'
        createdTimestampInternal:
          type: number
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        ruleInstanceId:
          type: string
        ruleName:
          type: string
        ruleDescription:
          type: string
        ruleId:
          type: string
        ruleAction:
          $ref: '#/components/schemas/RuleAction'
        ruleNature:
          $ref: '#/components/schemas/RuleNature'
        ruleHitMeta:
          $ref: '#/components/schemas/RuleHitMeta'
        ruleQueueId:
          type: string
        numberOfTransactionsHit:
          type: integer
        priority:
          $ref: '#/components/schemas/Priority'
        statusChanges:
          type: array
          items:
            $ref: '#/components/schemas/CaseStatusChange'
        lastStatusChange:
          $ref: '#/components/schemas/CaseStatusChange'
        updatedAt:
          type: number
        transactionIds:
          type: array
          items:
            type: string
        originPaymentMethods:
          type: array
          items:
            $ref: '#/components/schemas/PaymentMethod'
        destinationPaymentMethods:
          type: array
          items:
            $ref: '#/components/schemas/PaymentMethod'
        comments:
          type: array
          items:
            $ref: '#/components/schemas/Comment'
        ruleQaStatus:
          $ref: '#/components/schemas/ChecklistStatus'
        ruleChecklist:
          type: array
          items:
            $ref: '#/components/schemas/ChecklistItemValue'
        ruleChecklistTemplateId:
          type: string
        qaAssignment:
          type: array
          items:
            $ref: '#/components/schemas/Assignment'
        slaPolicyDetails:
          type: array
          items:
            $ref: '#/components/schemas/SLAPolicyDetails'
        caseCreatedTimestamp:
          type: number
        caseSubjectIdentifiers:
          type: array
          items:
            type: string
        alertMeta:
          type: object
          properties:
            originPaymentMethodId:
              type: string
            destinationPaymentMethodId:
              type: string
      required:
        - createdTimestamp
        - ruleInstanceId
        - ruleName
        - ruleDescription
        - ruleAction
        - numberOfTransactionsHit
        - priority
    Page:
      title: Page
      type: number
      minimum: 1
    PageSize:
      title: PageSize
      type: number
      minimum: 1
      maximum: 100
    HitsStatusUpdateRequest:
      title: HitsStatusUpdateRequest
      type: object
      properties:
        hitIds:
          type: array
          items:
            type: string
        updates:
          $ref: '#/components/schemas/SanctionHitStatusUpdateBaseRequest'
      required:
        - hitIds
        - updates
    AlertHitsResponse:
      title: AlertHitsResponse
      type: object
      description: ''
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/AlertHit'
        hasNext:
          type: boolean
        hasPrev:
          type: boolean
        next:
          type: string
        prev:
          type: string
        count:
          type: integer
        pageSize:
          type: integer
        last:
          type: string
    AlertHit:
      title: AlertHit
      type: object
      description: ''
      properties:
        hitId:
          type: string
        status:
          $ref: '#/components/schemas/SanctionsHitStatus'
        hitDetails:
          $ref: '#/components/schemas/HitDetails'
    HitDetails:
      title: HitDetails
      type: object
      description: ''
      properties:
        name:
          type: string
        dateOfBirths:
          type: array
          items:
            type: string
        gender:
          type: string
        countries:
          type: array
          items:
            type: string
        documents:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsIdDocument'
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsEntityAddress'
        mediaSources:
          type: array
          items:
            type: string
    CasesListResponse:
      title: CasesListResponse
      type: object
      description: ''
      properties:
        total:
          type: number
        data:
          type: array
          items:
            $ref: '#/components/schemas/Case'
      required:
        - total
        - data
    AlertRuleDetails:
      title: AlertRuleDetails
      type: object
      description: ''
      properties:
        id:
          type: string
        name:
          type: string
        action:
          $ref: '#/components/schemas/RuleAction'
        description:
          type: string
        instanceId:
          type: string
        nature:
          $ref: '#/components/schemas/RuleNature'
      required:
        - id
        - name
        - description
        - instanceId
        - action
    CaseUpdateable:
      title: CasePatchRequest
      type: object
      description: ''
      properties:
        priority:
          $ref: '#/components/schemas/Priority'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        creationReason:
          $ref: '#/components/schemas/ActionReason'
        entityDetails:
          oneOf:
            - $ref: '#/components/schemas/UserEntityDetails'
            - $ref: '#/components/schemas/PaymentEntityDetails'
            - $ref: '#/components/schemas/AddressEntityDetails'
            - $ref: '#/components/schemas/EmailEntityDetails'
            - $ref: '#/components/schemas/NameEntityDetails'
        relatedCases:
          type: array
          items:
            type: string
        assignments:
          type: array
          items:
            $ref: '#/components/schemas/Assignment'
    CaseDerived:
      title: CaseDerived
      type: object
      description: ''
      properties:
        caseStatus:
          $ref: '#/components/schemas/Status'
        alertIds:
          type: array
          items:
            type: string
        updatedAt:
          type: number
    Status:
      title: Status
      type: string
      enum:
        - OPEN
        - CLOSED
        - REOPENED
        - IN_REVIEW
        - ESCALATED
        - IN_PROGRESS
        - ON_HOLD
    Case:
      title: Case
      type: object
      properties:
        caseId:
          type: string
        caseType:
          $ref: '#/components/schemas/CaseType'
        subjectType:
          $ref: '#/components/schemas/CaseSubjectType'
        createdBy:
          type: string
        createdTimestamp:
          type: number
        availableAfterTimestamp:
          type: number
        latestTransactionArrivalTimestamp:
          type: number
        caseStatus:
          $ref: '#/components/schemas/CaseStatus'
        caseTransactionsIds:
          type: array
          items:
            type: string
        creationReason:
          $ref: '#/components/schemas/ActionReason'
        createdTimestampInternal:
          type: number
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        alerts:
          type: array
          items:
            $ref: '#/components/schemas/Alert'
        address:
          type: object
          properties:
            origin:
              $ref: '#/components/schemas/Address'
            destination:
              $ref: '#/components/schemas/Address'
        email:
          type: object
          properties:
            origin:
              type: string
            destination:
              type: string
        name:
          type: object
          properties:
            origin:
              type: string
            destination:
              type: string
        paymentDetails:
          type: object
          properties:
            origin:
              oneOf:
                - $ref: '#/components/schemas/CardDetails'
                - $ref: '#/components/schemas/GenericBankAccountDetails'
                - $ref: '#/components/schemas/IBANDetails'
                - $ref: '#/components/schemas/ACHDetails'
                - $ref: '#/components/schemas/SWIFTDetails'
                - $ref: '#/components/schemas/MpesaDetails'
                - $ref: '#/components/schemas/UPIDetails'
                - $ref: '#/components/schemas/WalletDetails'
                - $ref: '#/components/schemas/CheckDetails'
                - $ref: '#/components/schemas/CashDetails'
                - $ref: '#/components/schemas/NPPDetails'
            destination:
              oneOf:
                - $ref: '#/components/schemas/CardDetails'
                - $ref: '#/components/schemas/GenericBankAccountDetails'
                - $ref: '#/components/schemas/IBANDetails'
                - $ref: '#/components/schemas/ACHDetails'
                - $ref: '#/components/schemas/SWIFTDetails'
                - $ref: '#/components/schemas/MpesaDetails'
                - $ref: '#/components/schemas/UPIDetails'
                - $ref: '#/components/schemas/WalletDetails'
                - $ref: '#/components/schemas/CheckDetails'
                - $ref: '#/components/schemas/CashDetails'
                - $ref: '#/components/schemas/NPPDetails'
        paymentMethodId:
          type: string
        caseUsers:
          type: object
          properties:
            origin:
              oneOf:
                - $ref: '#/components/schemas/InternalConsumerUser'
                - $ref: '#/components/schemas/InternalBusinessUser'
                - $ref: '#/components/schemas/MissingUser'
            destination:
              oneOf:
                - $ref: '#/components/schemas/InternalConsumerUser'
                - $ref: '#/components/schemas/InternalBusinessUser'
                - $ref: '#/components/schemas/MissingUser'
            originUserDrsScore:
              type: number
            destinationUserDrsScore:
              type: number
            originUserRiskLevel:
              $ref: '#/components/schemas/RiskLevel'
            destinationUserRiskLevel:
              $ref: '#/components/schemas/RiskLevel'
        comments:
          type: array
          items:
            $ref: '#/components/schemas/Comment'
        assignments:
          type: array
          items:
            $ref: '#/components/schemas/Assignment'
        reviewAssignments:
          type: array
          items:
            $ref: '#/components/schemas/Assignment'
        statusChanges:
          type: array
          items:
            $ref: '#/components/schemas/CaseStatusChange'
        lastStatusChange:
          $ref: '#/components/schemas/CaseStatusChange'
        updatedAt:
          type: number
        priority:
          $ref: '#/components/schemas/Priority'
        relatedCases:
          type: array
          items:
            type: string
        caseHierarchyDetails:
          $ref: '#/components/schemas/CaseHierarchyDetails'
        caseTransactionsCount:
          type: number
        caseAggregates:
          $ref: '#/components/schemas/CaseAggregates'
        slaPolicyDetails:
          type: array
          items:
            $ref: '#/components/schemas/SLAPolicyDetails'
        caseSubjectIdentifiers:
          type: array
          items:
            type: string
      required:
        - caseType
        - caseAggregates
    UserEntityDetails:
      title: UserEntityDetails
      type: object
      description: ''
      properties:
        userId:
          type: string
        type:
          type: string
          enum:
            - USER
      required:
        - userId
        - type
    AddressEntityDetails:
      title: AddressEntityDetails
      type: object
      description: ''
      properties:
        address:
          $ref: '#/components/schemas/Address'
        type:
          type: string
          enum:
            - ADDRESS
      required:
        - address
        - type
    PaymentEntityDetails:
      title: PaymentEntityDetails
      type: object
      description: ''
      properties:
        type:
          type: string
          enum:
            - PAYMENT
        paymentDetails:
          oneOf:
            - $ref: '#/components/schemas/CardDetails'
            - $ref: '#/components/schemas/GenericBankAccountDetails'
            - $ref: '#/components/schemas/IBANDetails'
            - $ref: '#/components/schemas/ACHDetails'
            - $ref: '#/components/schemas/SWIFTDetails'
            - $ref: '#/components/schemas/MpesaDetails'
            - $ref: '#/components/schemas/UPIDetails'
            - $ref: '#/components/schemas/WalletDetails'
            - $ref: '#/components/schemas/CheckDetails'
            - $ref: '#/components/schemas/CashDetails'
      required:
        - type
        - paymentDetails
    EmailEntityDetails:
      title: EmailEntityDetails
      type: object
      description: ''
      properties:
        email:
          type: string
        type:
          type: string
          enum:
            - EMAIL
      required:
        - email
        - type
    NameEntityDetails:
      title: NameEntityDetails
      type: object
      description: ''
      properties:
        name:
          type: string
        type:
          type: string
          enum:
            - NAME
      required:
        - name
        - type
    ActionReason:
      title: ActionReason
      type: object
      properties:
        reasons:
          type: array
          items:
            type: string
        comment:
          type: string
        timestamp:
          type: number
          minimum: 1262300400000
          maximum: 4133890801000
      required:
        - reasons
        - comment
    Assignment:
      title: Assignment
      type: object
      properties:
        assigneeUserId:
          type: string
        assignedByUserId:
          type: string
        timestamp:
          type: number
        escalationLevel:
          $ref: '#/components/schemas/EscalationLevel'
      required:
        - assigneeUserId
        - timestamp
    ErrorMessage:
      title: ErrorMessage
      type: object
      properties:
        error:
          type: string
        message:
          type: string
      required:
        - error
        - message
    Address:
      title: Address
      required:
        - addressLines
      type: object
      properties:
        addressLines:
          type: array
          items:
            type: string
          description: Address lines of the user's residence address
        postcode:
          minLength: 1
          type: string
          description: Post code of the user's residence address
        city:
          minLength: 1
          type: string
          description: City of the user's residence address
        state:
          minLength: 1
          type: string
          description: State of the user's residence address
        country:
          minLength: 1
          type: string
          description: User's country of residence
        addressType:
          type: string
          description: Type of the address (ex - Residential, Postal, etc.)
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
          description: Additional information that can be added via tags
      description: Model for standardized address
      example:
        addressLines:
          - Klara-Franke Str 20
        postcode: '10557'
        city: Berlin
        state: Berlin
        country: Germany
        tags:
          - key: customKey
            value: customValue
    UserBase:
      title: UserBase
      type: object
      description: Model for User details
      example:
        createdTimestamp: 1641654664000
        userId: 96647cfd9e8fe66ee0f3362e011e34e8
        userDetails:
          name:
            firstName: Baran
            middleName: Realblood
            lastName: Ozkan
          dateOfBirth: 1991-01-01
          countryOfResidence: US
          countryOfNationality: DE
        legalDocuments:
          - documentType: passport
            documentNumber: Z9431P
            documentIssuedDate: 1639939034000
            documentExpirationDate: 1839939034000
            documentIssuedCountry: DE
            tags:
              - key: customerType
                value: wallet
        contactDetails:
          emailIds:
            - baran@flagright.com
          contactNumbers:
            - '+37112345432'
          websites:
            - flagright.com
          addresses:
            - addressLines:
                - Klara-Franke Str 20
              postcode: '10557'
              city: Berlin
              state: Berlin
              country: Germany
              tags:
                - key: customKey
                  value: customValue
        tags:
          - key: customKey
            value: customValue
      x-examples:
        example-1:
          userId: 96647cfd9e8fe66ee0f3362e011e34e8
          userDetails:
            name:
              firstName: Baran
              middleName: Realblood
              lastName: Ozkan
            dateOfBirth:
              day: 1
              month: 1
              year: 1990
            countryOfResidence: US
            countryOfNationality: DE
          legalDocuments:
            - documentType: passport
              documentNumber: Z9431P
              documentIssuedDate: 1639939034000
              documentExpirationDate: 1839939034000
              documentIssuedCountry: DE
              tags:
                - key: customerType
                  value: wallet
          contactDetails:
            emailIds:
              - baran@flagright.com
            contactNumbers:
              - '+37112345432'
            websites:
              - flagright.com
            addresses:
              - addressLines:
                  - Klara-Franke Str 20
                postcode: '10557'
                city: Berlin
                state: Berlin
                country: Germany
                tags:
                  - key: customKey
                    value: customValue
          tags:
            - key: customKey
              value: customValue
      properties:
        userId:
          minLength: 1
          type: string
          description: Unique user ID
        createdTimestamp:
          type: number
          description: Timestamp when userId is created
          minimum: 315529200000
          maximum: 4133890801000
      required:
        - userId
        - createdTimestamp
    UserOptional:
      title: UserOptional
      type: object
      description: Model for User details
      example:
        createdTimestamp: 1641654664000
        userId: 96647cfd9e8fe66ee0f3362e011e34e8
        userDetails:
          name:
            firstName: Baran
            middleName: Realblood
            lastName: Ozkan
          dateOfBirth: 1991-01-01
          countryOfResidence: US
          countryOfNationality: DE
        legalDocuments:
          - documentType: passport
            documentNumber: Z9431P
            documentIssuedDate: 1639939034000
            documentExpirationDate: 1839939034000
            documentIssuedCountry: DE
            tags:
              - key: customerType
                value: wallet
        contactDetails:
          emailIds:
            - baran@flagright.com
          contactNumbers:
            - '+37112345432'
          websites:
            - flagright.com
          addresses:
            - addressLines:
                - Klara-Franke Str 20
              postcode: '10557'
              city: Berlin
              state: Berlin
              country: Germany
              tags:
                - key: customKey
                  value: customValue
        tags:
          - key: customKey
            value: customValue
        metaData:
          batteryLevel: 76.3
          deviceLatitude: 13.009711
          deviceLongitude: 76.102898
          ipAddress: 79.144.2.20
          vpnUsed: true
      x-examples:
        example-1:
          userId: 96647cfd9e8fe66ee0f3362e011e34e8
          userDetails:
            name:
              firstName: Baran
              middleName: Realblood
              lastName: Ozkan
            dateOfBirth:
              day: 1
              month: 1
              year: 1990
            countryOfResidence: US
            countryOfNationality: DE
          legalDocuments:
            - documentType: passport
              documentNumber: Z9431P
              documentIssuedDate: 1639939034000
              documentExpirationDate: 1839939034000
              documentIssuedCountry: DE
              tags:
                - key: customerType
                  value: wallet
          contactDetails:
            emailIds:
              - baran@flagright.com
            contactNumbers:
              - '+37112345432'
            websites:
              - flagright.com
            addresses:
              - addressLines:
                  - Klara-Franke Str 20
                postcode: '10557'
                city: Berlin
                state: Berlin
                country: Germany
                tags:
                  - key: customKey
                    value: customValue
          tags:
            - key: customKey
              value: customValue
          metaData:
            batteryLevel: 76.3
            deviceLatitude: 13.009711
            deviceLongitude: 76.102898
            ipAddress: 79.144.2.20
            vpnUsed: true
      properties:
        activatedTimestamp:
          type: number
          description: Timestamp when user was activated
          minimum: 315529200000
          maximum: 4133890801000
        userDetails:
          $ref: '#/components/schemas/UserDetails'
        userStateDetails:
          $ref: '#/components/schemas/UserStateDetails'
        kycStatusDetails:
          $ref: '#/components/schemas/KYCStatusDetails'
        eoddDate:
          type: number
          x-fern-ignore: true
        employmentStatus:
          $ref: '#/components/schemas/EmploymentStatus'
        occupation:
          type: string
        legalDocuments:
          type: array
          description: User's legal identity documents - See Document Model for details
          items:
            $ref: '#/components/schemas/LegalDocument'
        contactDetails:
          $ref: '#/components/schemas/ContactDetails'
        employmentDetails:
          $ref: '#/components/schemas/EmploymentDetails'
        transactionLimits:
          $ref: '#/components/schemas/TransactionLimits'
        expectedIncome:
          $ref: '#/components/schemas/ExpectedIncome'
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        kycRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        acquisitionChannel:
          $ref: '#/components/schemas/AcquisitionChannel'
        reasonForAccountOpening:
          type: array
          items:
            type: string
        sourceOfFunds:
          type: array
          items:
            $ref: '#/components/schemas/SourceOfFunds'
        userSegment:
          $ref: '#/components/schemas/ConsumerUserSegment'
        pepStatus:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
        sanctionsStatus:
          $ref: '#/components/schemas/SanctionsStatus'
        adverseMediaStatus:
          $ref: '#/components/schemas/AdverseMediaStatus'
        lastTransactionTimestamp:
          type: number
          description: Timestamp of the last successful transaction of the user
          x-fern-ignore: true
        corporateEntities:
          type: array
          description: Corporate entities of the user
          items:
            $ref: '#/components/schemas/CorporateEntityDetails'
        linkedEntities:
          $ref: '#/components/schemas/UserEntityLink'
        savedPaymentDetails:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/CardDetails'
              - $ref: '#/components/schemas/GenericBankAccountDetails'
              - $ref: '#/components/schemas/IBANDetails'
              - $ref: '#/components/schemas/ACHDetails'
              - $ref: '#/components/schemas/SWIFTDetails'
              - $ref: '#/components/schemas/MpesaDetails'
              - $ref: '#/components/schemas/UPIDetails'
              - $ref: '#/components/schemas/WalletDetails'
              - $ref: '#/components/schemas/CheckDetails'
              - $ref: '#/components/schemas/CashDetails'
              - $ref: '#/components/schemas/NPPDetails'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/UserTag'
        attachments:
          type: array
          description: Uploaded user's attachment
          items:
            $ref: '#/components/schemas/PersonAttachment'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        productsEnabled:
          type: array
          items:
            $ref: '#/components/schemas/ProductsEnabled'
    ProductsEnabled:
      title: ProductsEnabled
      type: object
      properties:
        productName:
          type: string
    ConsumerUserSegment:
      title: ConsumerUserSegment
      type: string
      enum:
        - RETAIL
        - PROFESSIONAL
    User:
      type: object
      properties:
        userId:
          minLength: 1
          type: string
          description: Unique user ID
        createdTimestamp:
          type: number
          description: Timestamp when userId is created
          minimum: 315529200000
          maximum: 4133890801000
        activatedTimestamp:
          type: number
          description: Timestamp when user was activated
          minimum: 315529200000
          maximum: 4133890801000
        userDetails:
          $ref: '#/components/schemas/UserDetails'
        userStateDetails:
          $ref: '#/components/schemas/UserStateDetails'
        kycStatusDetails:
          $ref: '#/components/schemas/KYCStatusDetails'
        eoddDate:
          type: number
          x-fern-ignore: true
        employmentStatus:
          $ref: '#/components/schemas/EmploymentStatus'
        occupation:
          type: string
        legalDocuments:
          type: array
          description: User's legal identity documents - See Document Model for details
          items:
            $ref: '#/components/schemas/LegalDocument'
        contactDetails:
          $ref: '#/components/schemas/ContactDetails'
        employmentDetails:
          $ref: '#/components/schemas/EmploymentDetails'
        transactionLimits:
          $ref: '#/components/schemas/TransactionLimits'
        expectedIncome:
          $ref: '#/components/schemas/ExpectedIncome'
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        kycRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        acquisitionChannel:
          $ref: '#/components/schemas/AcquisitionChannel'
        reasonForAccountOpening:
          type: array
          items:
            type: string
        sourceOfFunds:
          type: array
          items:
            $ref: '#/components/schemas/SourceOfFunds'
        userSegment:
          $ref: '#/components/schemas/ConsumerUserSegment'
        pepStatus:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
        sanctionsStatus:
          $ref: '#/components/schemas/SanctionsStatus'
        adverseMediaStatus:
          $ref: '#/components/schemas/AdverseMediaStatus'
        lastTransactionTimestamp:
          type: number
          description: Timestamp of the last successful transaction of the user
          x-fern-ignore: true
        corporateEntities:
          type: array
          description: Corporate entities of the user
          items:
            $ref: '#/components/schemas/CorporateEntityDetails'
        linkedEntities:
          $ref: '#/components/schemas/UserEntityLink'
        savedPaymentDetails:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/CardDetails'
              - $ref: '#/components/schemas/GenericBankAccountDetails'
              - $ref: '#/components/schemas/IBANDetails'
              - $ref: '#/components/schemas/ACHDetails'
              - $ref: '#/components/schemas/SWIFTDetails'
              - $ref: '#/components/schemas/MpesaDetails'
              - $ref: '#/components/schemas/UPIDetails'
              - $ref: '#/components/schemas/WalletDetails'
              - $ref: '#/components/schemas/CheckDetails'
              - $ref: '#/components/schemas/CashDetails'
              - $ref: '#/components/schemas/NPPDetails'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/UserTag'
        attachments:
          type: array
          description: Uploaded user's attachment
          items:
            $ref: '#/components/schemas/PersonAttachment'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        productsEnabled:
          type: array
          items:
            $ref: '#/components/schemas/ProductsEnabled'
      required:
        - userId
        - createdTimestamp
    Person:
      title: Person
      type: object
      properties:
        userId:
          minLength: 1
          type: string
          description: Unique user ID for the person
        generalDetails:
          $ref: '#/components/schemas/UserDetails'
        legalDocuments:
          type: array
          description: User's legal identity documents - See Document Model for details
          items:
            $ref: '#/components/schemas/LegalDocument'
        contactDetails:
          $ref: '#/components/schemas/ContactDetails'
        pepStatus:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
        attachments:
          type: array
          description: User's attachments uploaded by business user
          items:
            $ref: '#/components/schemas/PersonAttachment'
      required:
        - generalDetails
      description: Model for a generic individual - different from User model by not
        having userId field
      example:
        generalDetails:
          name:
            firstName: Baran
            middleName: Realblood
            lastName: Ozkan
          dateOfBirth: 1991-01-01
          countryOfResidence: US
          countryOfNationality: DE
        legalDocuments:
          - documentType: passport
            documentNumber: Z9431P
            documentIssuedDate: 1639939034000
            documentExpirationDate: 1839939034000
            documentIssuedCountry: DE
            tags:
              - key: customerType
                value: wallet
        contactDetails:
          emailIds:
            - baran@flagright.com
          contactNumbers:
            - +371 123132
          websites:
            - flagright.com
          addresses:
            - addressLines:
                - Klara-Franke Str 20
              postcode: '10557'
              city: Berlin
              state: Berlin
              country: Germany
              tags:
                - key: customKey
                  value: customValue
        tags:
          - key: customKey
            value: customValue
    LegalDocument:
      title: LegalDocument
      required:
        - documentType
        - documentNumber
        - documentIssuedCountry
      type: object
      properties:
        documentType:
          minLength: 1
          type: string
          description: User's identity document type such as passport, national ID etc.
        documentNumber:
          minLength: 1
          type: string
          description: User's unique identity document number such as passport number
        documentIssuedDate:
          type: number
          description: User's identity document issuance date (UNIX timestamp in
            milliseconds)
          maximum: 4133890801000
        documentExpirationDate:
          type: number
          description: User's identity document expiration date (UNIX timestamp in
            milliseconds)
          maximum: 4133890801000
        documentIssuedCountry:
          $ref: '#/components/schemas/CountryCode'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
          description: Additional information that can be added via tags
        nameOnDocument:
          $ref: '#/components/schemas/ConsumerName'
      description: "LegalDocument model generalizes User's identity document type (ex:
        Passport)"
      example:
        documentType: passport
        documentNumber: Z9431P
        documentIssuedDate: 1639939034000
        documentExpirationDate: 1839939034000
        documentIssuedCountry: DE
        tags:
          - key: customerType
            value: wallet
    Attachment:
      title: FileInfo
      type: object
      properties:
        s3Key:
          type: string
        bucket:
          type: string
        filename:
          type: string
        size:
          type: number
        downloadLink:
          type: string
        aiSummary:
          type: string
      required:
        - s3Key
        - filename
        - size
    PersonAttachment:
      title: PersonAttachment
      required:
        - files
        - userId
      type: object
      properties:
        id:
          type: string
        comment:
          type: string
          description: User's comment on the attached file.
        files:
          type: array
          items:
            $ref: '#/components/schemas/Attachment'
        userId:
          type: string
        createdAt:
          type: number
        deletedAt:
          type: number
        tags:
          type: array
          items:
            type: string
      description: PersonAttachment model generalizes User's uploaded attachments
      example:
        comment: Arun's tax information
        files:
          filename: Tax Receipt FY 23-24
          s3Key: flagright/693c2df4-ec15-4bd6-8d0b-3237dfdb701ed
          size: 112419
    EmploymentDetails:
      title: EmploymentDetails
      type: object
      properties:
        employmentSector:
          type: string
          description: Sector of employment
        employerName:
          minLength: 1
          type: string
          description: Name of the employer
        businessIndustry:
          type: array
          description: The industry in which the business operates for a business customer
          items:
            type: string
      description: Details of User's employment
    UserTag:
      type: object
      properties:
        key:
          minLength: 1
          type: string
          description: Key value when you are creating a custom variable
        value:
          minLength: 1
          type: string
          description: Value for a given key when you are creating a custom variable
        isTimestamp:
          type: boolean
          description: Flag to indicate if the tag value is a timestamp
        isEditable:
          type: boolean
          description: Flag to indicate if the tag is editable over the console
      required:
        - key
        - value
    Tag:
      title: Tag
      required:
        - key
        - value
      type: object
      properties:
        key:
          minLength: 1
          type: string
          description: Key value when you are creating a custom variable
        value:
          minLength: 1
          type: string
          description: Value for a given key when you are creating a custom variable
        isTimestamp:
          type: boolean
          description: Flag to indicate if the tag value is a timestamp
      description: Generic key-value pair model to append a custom variable being sent
        to Flagright API
      example:
        key: customKey
        value: customValue
    EmailId:
      title: EmailId
      type: string
      description: 'Email ID format. Ex: baran@flagright.com'
    Transaction:
      type: object
      properties:
        type:
          type: string
          description: 'Type of transaction (ex: DEPOSIT, WITHDRAWAL, TRANSFER,
            EXTERNAL_PAYMENT, REFUND, OTHER)'
        transactionId:
          minLength: 1
          type: string
          description: Unique transaction identifier
        timestamp:
          type: number
          description: Timestamp of when transaction took place
          minimum: 315529200000
          maximum: 4133890801000
        originUserId:
          type: string
          description: UserId for where the transaction originates from
        destinationUserId:
          type: string
          description: UserId for transaction's destination. In other words, where the
            value is being transferred to.
        transactionState:
          $ref: '#/components/schemas/TransactionState'
        originAmountDetails:
          $ref: '#/components/schemas/TransactionAmountDetails'
        destinationAmountDetails:
          $ref: '#/components/schemas/TransactionAmountDetails'
        originPaymentDetails:
          oneOf:
            - $ref: '#/components/schemas/CardDetails'
            - $ref: '#/components/schemas/GenericBankAccountDetails'
            - $ref: '#/components/schemas/IBANDetails'
            - $ref: '#/components/schemas/ACHDetails'
            - $ref: '#/components/schemas/SWIFTDetails'
            - $ref: '#/components/schemas/MpesaDetails'
            - $ref: '#/components/schemas/UPIDetails'
            - $ref: '#/components/schemas/WalletDetails'
            - $ref: '#/components/schemas/CheckDetails'
            - $ref: '#/components/schemas/CashDetails'
            - $ref: '#/components/schemas/NPPDetails'
          description: Payment details of the origin. It can be a bank account number,
            wallet ID, card fingerprint etc.
        destinationPaymentDetails:
          oneOf:
            - $ref: '#/components/schemas/CardDetails'
            - $ref: '#/components/schemas/GenericBankAccountDetails'
            - $ref: '#/components/schemas/IBANDetails'
            - $ref: '#/components/schemas/ACHDetails'
            - $ref: '#/components/schemas/UPIDetails'
            - $ref: '#/components/schemas/WalletDetails'
            - $ref: '#/components/schemas/SWIFTDetails'
            - $ref: '#/components/schemas/MpesaDetails'
            - $ref: '#/components/schemas/CheckDetails'
            - $ref: '#/components/schemas/CashDetails'
            - $ref: '#/components/schemas/NPPDetails'
        originFundsInfo:
          $ref: '#/components/schemas/OriginFundsInfo'
        corporateEntity:
          $ref: '#/components/schemas/CorporateEntityDetails'
        relatedTransactionIds:
          type: array
          description: 'IDs of transactions related to this transaction. Ex: refund, split
            bills'
          items:
            type: string
        productType:
          type: string
          description: Type of produce being used by the consumer (ex wallets, payments etc)
        promotionCodeUsed:
          type: boolean
          description: Whether a promotion code was used or not the transaction
        reference:
          minLength: 1
          type: string
          description: Reference field for the transaction indicating the purpose of the
            transaction etc.
        originDeviceData:
          $ref: '#/components/schemas/DeviceData'
        destinationDeviceData:
          $ref: '#/components/schemas/DeviceData'
        metadata:
          $ref: '#/components/schemas/TransactionMetadata'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        paymentApprovalTimestamp:
          x-fern-ignore: true
          type: number
      required:
        - type
        - transactionId
        - timestamp
    TransactionUpdatable:
      title: TransactionUpdatable
      type: object
      description: Model for transaction additional payload
      example:
        originAmountDetails:
          country: DE
          transactionAmount: 800
          transactionCurrency: EUR
        destinationAmountDetails:
          country: IN
          transactionAmount: 68351.34
          transactionCurrency: INR
        promotionCodeUsed: true
        timestamp: 1641654664000
        originPaymentDetails:
          method: CARD
          cardFingerprint: 20ac00fed8ef913aefb17cfae1097cce
          cardIssuedCountry: US
          transactionReferenceField: Deposit
          3dsDone: true
        destinationPaymentDetails:
          method: CARD
          cardFingerprint: 20ac00fed8ef913aefb17cfae1097cce
          cardIssuedCountry: IN
          transactionReferenceField: Deposit
          3dsDone: true
        reference: loan repayment
        originDeviceData:
          batteryLevel: 95
          deviceLatitude: 13.0033
          deviceLongitude: 76.1004
          ipAddress: 10.23.191.2
          deviceIdentifier: 3c49f915d04485e34caba
          vpnUsed: false
          operatingSystem: Android 11.2
          deviceMaker: ASUS
          deviceModel: Zenphone M2 Pro Max
          deviceYear: '2018'
          appVersion: 1.1.0
        destinationDeviceData:
          batteryLevel: 95
          deviceLatitude: 13.0033
          deviceLongitude: 76.1004
          ipAddress: 10.23.191.2
          deviceIdentifier: 3c49f915d04485e34caba
          vpnUsed: false
          operatingSystem: Android 11.2
          deviceMaker: ASUS
          deviceModel: Zenphone M2 Pro Max
          deviceYear: '2018'
          appVersion: 1.1.0
        tags:
          - key: customKey
            value: customValue
      x-examples:
        example-1:
          originAmountDetails:
            country: DE
            transactionAmount: 800
            transactionCurrency: EUR
          destinationAmountDetails:
            country: IN
            transactionAmount: 68351.34
            transactionCurrency: INR
          promotionCodeUsed: true
          timestamp: 1641654664
          originPaymentDetails:
            method: CARD
            cardFingerprint: 20ac00fed8ef913aefb17cfae1097cce
            cardIssuedCountry: US
            transactionReferenceField: Deposit
            3dsDone: true
          destinationPaymentDetails:
            method: CARD
            cardFingerprint: 20ac00fed8ef913aefb17cfae1097cce
            cardIssuedCountry: IN
            transactionReferenceField: Deposit
            3dsDone: true
          reference: loan repayment
          originDeviceData:
            batteryLevel: 95
            deviceLatitude: 13.0033
            deviceLongitude: 76.1004
            ipAddress: 10.23.191.2
            deviceIdentifier: 3c49f915d04485e34caba
            vpnUsed: false
            operatingSystem: Android 11.2
            deviceMaker: ASUS
            deviceModel: Zenphone M2 Pro Max
            deviceYear: '2018'
            appVersion: 1.1.0
          destinationDeviceData:
            batteryLevel: 95
            deviceLatitude: 13.0033
            deviceLongitude: 76.1004
            ipAddress: 10.23.191.2
            deviceIdentifier: 3c49f915d04485e34caba
            vpnUsed: false
            operatingSystem: Android 11.2
            deviceMaker: ASUS
            deviceModel: Zenphone M2 Pro Max
            deviceYear: '2018'
            appVersion: 1.1.0
          tags:
            - key: customKey
              value: customValue
      properties:
        originAmountDetails:
          $ref: '#/components/schemas/TransactionAmountDetails'
        destinationAmountDetails:
          $ref: '#/components/schemas/TransactionAmountDetails'
        originPaymentDetails:
          oneOf:
            - $ref: '#/components/schemas/CardDetails'
            - $ref: '#/components/schemas/GenericBankAccountDetails'
            - $ref: '#/components/schemas/IBANDetails'
            - $ref: '#/components/schemas/ACHDetails'
            - $ref: '#/components/schemas/SWIFTDetails'
            - $ref: '#/components/schemas/MpesaDetails'
            - $ref: '#/components/schemas/UPIDetails'
            - $ref: '#/components/schemas/WalletDetails'
            - $ref: '#/components/schemas/CheckDetails'
            - $ref: '#/components/schemas/CashDetails'
            - $ref: '#/components/schemas/NPPDetails'
          description: Payment details of the origin. It can be a bank account number,
            wallet ID, card fingerprint etc.
        destinationPaymentDetails:
          oneOf:
            - $ref: '#/components/schemas/CardDetails'
            - $ref: '#/components/schemas/GenericBankAccountDetails'
            - $ref: '#/components/schemas/IBANDetails'
            - $ref: '#/components/schemas/ACHDetails'
            - $ref: '#/components/schemas/UPIDetails'
            - $ref: '#/components/schemas/WalletDetails'
            - $ref: '#/components/schemas/SWIFTDetails'
            - $ref: '#/components/schemas/MpesaDetails'
            - $ref: '#/components/schemas/CheckDetails'
            - $ref: '#/components/schemas/CashDetails'
            - $ref: '#/components/schemas/NPPDetails'
        originFundsInfo:
          $ref: '#/components/schemas/OriginFundsInfo'
        corporateEntity:
          $ref: '#/components/schemas/CorporateEntityDetails'
        relatedTransactionIds:
          type: array
          description: 'IDs of transactions related to this transaction. Ex: refund, split
            bills'
          items:
            type: string
        productType:
          type: string
          description: Type of produce being used by the consumer (ex wallets, payments etc)
        promotionCodeUsed:
          type: boolean
          description: Whether a promotion code was used or not the transaction
        reference:
          minLength: 1
          type: string
          description: Reference field for the transaction indicating the purpose of the
            transaction etc.
        originDeviceData:
          $ref: '#/components/schemas/DeviceData'
        destinationDeviceData:
          $ref: '#/components/schemas/DeviceData'
        metadata:
          $ref: '#/components/schemas/TransactionMetadata'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        paymentApprovalTimestamp:
          x-fern-ignore: true
          type: number
    TransactionBase:
      title: TransactionBase
      type: object
      description: Model for transaction base Payload
      example:
        transactionId: 7b80a539eea6e78acbd6d458e5971482
        type: DEPOSIT
        originUserId: 8650a2611d0771cba03310f74bf6
        destinationUserId: 9350a2611e0771cba03310f74bf6
        timestamp: 1262300400111
        transactionState: CREATED
      x-examples:
        example-1:
          transactionId: 7b80a539eea6e78acbd6d458e5971482
          type: DEPOSIT
          originUserId: 8650a2611d0771cba03310f74bf6
          destinationUserId: 9350a2611e0771cba03310f74bf6
          transactionState: CREATED
      properties:
        type:
          type: string
          description: 'Type of transaction (ex: DEPOSIT, WITHDRAWAL, TRANSFER,
            EXTERNAL_PAYMENT, REFUND, OTHER)'
        transactionId:
          minLength: 1
          type: string
          description: Unique transaction identifier
        timestamp:
          type: number
          description: Timestamp of when transaction took place
          minimum: 315529200000
          maximum: 4133890801000
        originUserId:
          type: string
          description: UserId for where the transaction originates from
        destinationUserId:
          type: string
          description: UserId for transaction's destination. In other words, where the
            value is being transferred to.
        transactionState:
          $ref: '#/components/schemas/TransactionState'
      required:
        - type
        - transactionId
        - timestamp
    TransactionMetadata:
      title: TransactionMetadata
      description: Additional metadata for transactions including risk analysis and
        counterparty information
      type: object
      properties:
        blockchainRisk:
          type: array
          items:
            $ref: '#/components/schemas/BlockchainRisk'
          description: List of blockchain risk analyses from different providers
    BlockchainRisk:
      title: BlockchainRisk
      description: Blockchain-specific risk analysis from a provider including risk
        assessment and counterparty information
      type: object
      properties:
        provider:
          type: string
          description: Risk analysis provider (e.g., chainalysis)
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
          description: Overall risk level of the transaction
        riskScore:
          type: number
          minimum: 0
          maximum: 100
          description: Numeric risk score from 0 to 100
        counterparties:
          type: array
          items:
            $ref: '#/components/schemas/BlockchainCounterparty'
          description: List of counterparties involved in the transaction
        subject:
          $ref: '#/components/schemas/BlockchainRiskSubject'
          description: Subject of the risk analysis (address, transaction, entity, or
            smart contract)
        risks:
          type: array
          items:
            $ref: '#/components/schemas/BlockchainRiskDetail'
          description: Detailed risk categories and their analysis
    BlockchainCounterparty:
      title: BlockchainCounterparty
      description: Information about a counterparty in a blockchain transaction
      type: object
      properties:
        name:
          type: string
          description: Name of the counterparty (e.g., exchange name)
        categoryId:
          type: string
          description: Category identifier for the counterparty
    BlockchainRiskSubject:
      title: BlockchainRiskSubject
      description: Subject of the blockchain risk analysis
      type: object
      properties:
        type:
          $ref: '#/components/schemas/BlockchainRiskSubjectType'
          description: Type of the subject being analyzed
        value:
          type: string
          description: Single canonical value for the subject (e.g., address hash)
        direction:
          $ref: '#/components/schemas/BlockchainRiskSubjectDirection'
          description: Direction of the subject in the transaction (maps to
            origin/destination)
    BlockchainRiskDetail:
      title: BlockchainRiskDetail
      description: Detailed risk category analysis for a specific risk type
      type: object
      properties:
        alertId:
          type: string
          description: Optional alert identifier (alerts don't always exist)
        categoryId:
          type: string
          description: Unique identifier for the risk category
        categoryName:
          type: string
          description: Human-readable name of the risk category
        categoryRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
          description: Risk level specific to this category
        categoryRiskScore:
          type: number
          minimum: 0
          maximum: 100
          description: Numeric risk score for this specific category
        exposureType:
          $ref: '#/components/schemas/RiskExposureType'
          description: Type of exposure to the risk entity
        entity:
          type: string
          description: Name of the specific entity that poses the risk
        exposureAmount:
          $ref: '#/components/schemas/TransactionAmountDetails'
          description: Amount of the transaction exposed to this risk
    BlockchainRiskSubjectType:
      title: BlockchainRiskSubjectType
      type: string
      enum:
        - ADDRESS
        - TRANSACTION
        - SMART_CONTRACT
        - ENTITY
    BlockchainRiskSubjectDirection:
      title: BlockchainRiskSubjectDirection
      type: string
      enum:
        - ORIGIN
        - DESTINATION
    RiskExposureType:
      title: RiskExposureType
      type: string
      enum:
        - DIRECT
        - INDIRECT
    TransactionWithRulesResult:
      type: object
      properties:
        type:
          type: string
          description: 'Type of transaction (ex: DEPOSIT, WITHDRAWAL, TRANSFER,
            EXTERNAL_PAYMENT, REFUND, OTHER)'
        transactionId:
          minLength: 1
          type: string
          description: Unique transaction identifier
        timestamp:
          type: number
          description: Timestamp of when transaction took place
          minimum: 315529200000
          maximum: 4133890801000
        originUserId:
          type: string
          description: UserId for where the transaction originates from
        destinationUserId:
          type: string
          description: UserId for transaction's destination. In other words, where the
            value is being transferred to.
        transactionState:
          $ref: '#/components/schemas/TransactionState'
        originAmountDetails:
          $ref: '#/components/schemas/TransactionAmountDetails'
        destinationAmountDetails:
          $ref: '#/components/schemas/TransactionAmountDetails'
        originPaymentDetails:
          oneOf:
            - $ref: '#/components/schemas/CardDetails'
            - $ref: '#/components/schemas/GenericBankAccountDetails'
            - $ref: '#/components/schemas/IBANDetails'
            - $ref: '#/components/schemas/ACHDetails'
            - $ref: '#/components/schemas/SWIFTDetails'
            - $ref: '#/components/schemas/MpesaDetails'
            - $ref: '#/components/schemas/UPIDetails'
            - $ref: '#/components/schemas/WalletDetails'
            - $ref: '#/components/schemas/CheckDetails'
            - $ref: '#/components/schemas/CashDetails'
            - $ref: '#/components/schemas/NPPDetails'
          description: Payment details of the origin. It can be a bank account number,
            wallet ID, card fingerprint etc.
        destinationPaymentDetails:
          oneOf:
            - $ref: '#/components/schemas/CardDetails'
            - $ref: '#/components/schemas/GenericBankAccountDetails'
            - $ref: '#/components/schemas/IBANDetails'
            - $ref: '#/components/schemas/ACHDetails'
            - $ref: '#/components/schemas/UPIDetails'
            - $ref: '#/components/schemas/WalletDetails'
            - $ref: '#/components/schemas/SWIFTDetails'
            - $ref: '#/components/schemas/MpesaDetails'
            - $ref: '#/components/schemas/CheckDetails'
            - $ref: '#/components/schemas/CashDetails'
            - $ref: '#/components/schemas/NPPDetails'
        originFundsInfo:
          $ref: '#/components/schemas/OriginFundsInfo'
        corporateEntity:
          $ref: '#/components/schemas/CorporateEntityDetails'
        relatedTransactionIds:
          type: array
          description: 'IDs of transactions related to this transaction. Ex: refund, split
            bills'
          items:
            type: string
        productType:
          type: string
          description: Type of produce being used by the consumer (ex wallets, payments etc)
        promotionCodeUsed:
          type: boolean
          description: Whether a promotion code was used or not the transaction
        reference:
          minLength: 1
          type: string
          description: Reference field for the transaction indicating the purpose of the
            transaction etc.
        originDeviceData:
          $ref: '#/components/schemas/DeviceData'
        destinationDeviceData:
          $ref: '#/components/schemas/DeviceData'
        metadata:
          $ref: '#/components/schemas/TransactionMetadata'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        paymentApprovalTimestamp:
          x-fern-ignore: true
          type: number
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        status:
          $ref: '#/components/schemas/RuleAction'
        riskScoreDetails:
          $ref: '#/components/schemas/TransactionRiskScoringResult'
      required:
        - type
        - transactionId
        - timestamp
        - executedRules
        - hitRules
        - status
    TransactionEventWithRulesResult:
      type: object
      properties:
        transactionState:
          $ref: '#/components/schemas/TransactionState'
        timestamp:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        transactionId:
          type: string
          minLength: 1
          description: Transaction ID the event pertains to
        eventId:
          type: string
          description: Unique event ID
        reason:
          type: string
          description: Reason for the event or a state change
        eventDescription:
          type: string
          description: Event description
        updatedTransactionAttributes:
          $ref: '#/components/schemas/TransactionUpdatable'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        updateCount:
          x-fern-ignore: true
          type: number
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        status:
          $ref: '#/components/schemas/RuleAction'
        riskScoreDetails:
          $ref: '#/components/schemas/TransactionRiskScoringResult'
      required:
        - transactionState
        - timestamp
        - transactionId
    DeviceData:
      title: DeviceData
      type: object
      properties:
        batteryLevel:
          type: number
          description: Battery level of the device used for a transaction or event at a
            given timestamp
        deviceLatitude:
          type: number
          description: Device latitude at a give timestamp for an event or transaction
        deviceLongitude:
          type: number
          description: Device longitude at a give timestamp for an event or transaction
        ipAddress:
          minLength: 1
          type: string
          description: IP address of the device at a given timestamp for an event or
            transaction
        ipCountry:
          $ref: '#/components/schemas/CountryCode'
        deviceIdentifier:
          minLength: 1
          type: string
          description: Device identifier number
        vpnUsed:
          type: boolean
          description: Whether VPN was used at a given timestamp for an event or transaction
        operatingSystem:
          minLength: 1
          type: string
          description: Operating system of the device at a given timestamp for an event or
            transaction
        deviceMaker:
          minLength: 1
          type: string
          description: The maker of the device at a given timestamp for an event or
            transaction
        deviceModel:
          minLength: 1
          type: string
          description: The model of the device at a given timestamp for an event or
            transaction
        deviceYear:
          minLength: 1
          type: string
          description: The year the device was manufactured at a given timestamp for an
            event or transaction
        appVersion:
          minLength: 1
          type: string
          description: The version of the app your user is using on their device at a
            given timestamp for an event or transaction
      description: Model for device data
    BatchTransactionMonitoringResults:
      type: object
      properties:
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/BatchTransactionMonitoringResult'
        totalCount:
          type: number
      required:
        - transactions
        - totalCount
    BatchTransactionMonitoringResult:
      type: object
      properties:
        transactionId:
          type: string
          description: Transaction ID that the results pertain to
        status:
          $ref: '#/components/schemas/RuleAction'
        riskScoreDetails:
          $ref: '#/components/schemas/TransactionRiskScoringResult'
        hitRules:
          type: array
          description: Uniquue transaction identifier
          items:
            $ref: '#/components/schemas/HitRulesDetails'
      required:
        - transactionId
        - status
        - hitRules
    TransactionMonitoringResult:
      type: object
      properties:
        transactionId:
          type: string
          description: Transaction ID that the results pertain to
        status:
          $ref: '#/components/schemas/RuleAction'
        riskScoreDetails:
          $ref: '#/components/schemas/TransactionRiskScoringResult'
        executedRules:
          type: array
          description: Unique transaction identifier
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          description: Unique transaction identifier
          items:
            $ref: '#/components/schemas/HitRulesDetails'
      required:
        - transactionId
        - status
        - executedRules
        - hitRules
    BatchTransactionEventMonitoringResults:
      type: object
      title: BatchTransactionEventMonitoringResults
      properties:
        transactionEvents:
          type: array
          items:
            $ref: '#/components/schemas/BatchTransactionEventMonitoringResult'
        totalCount:
          type: number
      required:
        - transactionEvents
        - totalCount
    BatchTransactionEventMonitoringResult:
      type: object
      properties:
        transactionState:
          $ref: '#/components/schemas/TransactionState'
        timestamp:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        transactionId:
          type: string
          minLength: 1
          description: Transaction ID the event pertains to
        eventId:
          type: string
          description: Unique event ID
        reason:
          type: string
          description: Reason for the event or a state change
        eventDescription:
          type: string
          description: Event description
        updatedTransactionAttributes:
          $ref: '#/components/schemas/TransactionUpdatable'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        updateCount:
          x-fern-ignore: true
          type: number
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        status:
          $ref: '#/components/schemas/RuleAction'
        riskScoreDetails:
          $ref: '#/components/schemas/TransactionRiskScoringResult'
      required:
        - transactionState
        - timestamp
        - transactionId
    TransactionEventMonitoringResult:
      type: object
      properties:
        eventId:
          type: string
        transaction:
          $ref: '#/components/schemas/Transaction'
        status:
          $ref: '#/components/schemas/RuleAction'
        riskScoreDetails:
          $ref: '#/components/schemas/TransactionRiskScoringResult'
        executedRules:
          type: array
          description: Unique transaction identifier
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          description: Unique transaction identifier
          items:
            $ref: '#/components/schemas/HitRulesDetails'
      required:
        - eventId
        - transaction
        - executedRules
        - hitRules
    RulesResults:
      title: RulesResults
      type: object
      example:
        transactionId: 7b80a539eea6e78acbd6d458e5971482
        executedRules:
          - ruleId: R-1a
            ruleName: Proof of funds for high value transactions
            ruleDescription: If a user makes a remittance transaction >= 1800 in EUR - ask
              for proof of funds
            ruleAction: BLOCK
            ruleHit: true
        hitRules:
          - ruleId: R-1a
            ruleName: Proof of funds for high value transactions
            ruleDescription: If a user makes a remittance transaction >= 1800 in EUR - ask
              for proof of funds
            ruleAction: BLOCK
      x-examples:
        example-1:
          transactionId: 7b80a539eea6e78acbd6d458e5971482
          executedRules:
            - ruleId: R-1a
              ruleName: Proof of funds for high value transactions
              ruleDescription: If a user makes a remittance transaction >= 1800 in EUR - ask
                for proof of funds
              ruleAction: BLOCK
              ruleHit: true
          hitRules:
            - ruleId: R-1a
              ruleName: Proof of funds for high value transactions
              ruleDescription: If a user makes a remittance transaction >= 1800 in EUR - ask
                for proof of funds
              ruleAction: BLOCK
      properties:
        executedRules:
          type: array
          description: Unique transaction identifier
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          description: Unique transaction identifier
          items:
            $ref: '#/components/schemas/HitRulesDetails'
      required:
        - executedRules
        - hitRules
    HitRulesResults:
      title: HitRulesResults
      type: object
      x-examples:
        example-1:
          transactionId: 7b80a539eea6e78acbd6d458e5971482
          hitRules:
            - ruleId: R-1a
              ruleName: Proof of funds for high value transactions
              ruleDescription: If a user makes a remittance transaction >= 1800 in EUR - ask
                for proof of funds
              ruleAction: BLOCK
      properties:
        hitRules:
          type: array
          description: Uniquue transaction identifier
          items:
            $ref: '#/components/schemas/HitRulesDetails'
      required:
        - hitRules
    TransactionRiskScoringResult:
      title: TransactionRiskScoringResult
      type: object
      properties:
        trsScore:
          type: number
          description: Transaction risk scoring score
        trsRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        originUserCraRiskScore:
          type: number
          description: Origin user's CRA risk score
        destinationUserCraRiskScore:
          type: number
          description: Destination user's CRA risk score
        originUserCraRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        destinationUserCraRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
      required:
        - trsScore
        - trsRiskLevel
    ExecutedLogicVars:
      title: ExecutedLogicVars
      type: object
      properties:
        direction:
          $ref: '#/components/schemas/RuleHitDirection'
        value:
          type: object
      required:
        - value
    RuleExecutionSanctionsDetails:
      type: object
      properties:
        name:
          type: string
        searchId:
          type: string
        iban:
          type: string
        entityType:
          $ref: '#/components/schemas/SanctionsDetailsEntityType'
        sanctionHitIds:
          type: array
          items:
            type: string
        hitContext:
          $ref: '#/components/schemas/SanctionsHitContext'
        hitDirection:
          $ref: '#/components/schemas/RuleHitDirection'
        isRuleHit:
          type: boolean
      required:
        - name
        - searchId
    ExecutedRulesResult:
      title: ExecutedRulesResult
      type: object
      example:
        ruleId: R-1a
        ruleName: Proof of funds for high value transactions
        ruleDescription: If a user makes a remittance transaction >= 1800 in EUR - ask
          for proof of funds
        ruleAction: BLOCK
        ruleHit: true
      description: Model for list of executed rules
      properties:
        ruleId:
          minLength: 1
          type: string
          description: Unique rule identifier
        ruleInstanceId:
          type: string
        ruleName:
          minLength: 1
          type: string
          description: Name of the rule
        ruleDescription:
          minLength: 1
          type: string
          description: Description of the rule
        ruleAction:
          $ref: '#/components/schemas/RuleAction'
        ruleHit:
          type: boolean
        executedAt:
          type: number
          description: Timestamp when the rule was executed
          minimum: 315529200000
          maximum: 4133890801000
        ruleHitMeta:
          $ref: '#/components/schemas/RuleHitMeta'
        vars:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedLogicVars'
        labels:
          type: array
          items:
            $ref: '#/components/schemas/RuleLabels'
        nature:
          $ref: '#/components/schemas/RuleNature'
        isShadow:
          type: boolean
        sanctionsDetails:
          type: array
          items:
            $ref: '#/components/schemas/RuleExecutionSanctionsDetails'
          x-fern-ignore: true
      required:
        - ruleInstanceId
        - ruleName
        - ruleDescription
        - ruleAction
        - ruleHit
    HitRulesDetails:
      title: HitRulesDetails
      type: object
      example:
        ruleId: R-1a
        ruleName: Proof of funds for high value transactions
        ruleDescription: If a user makes a remittance transaction >= 1800 in EUR - ask
          for proof of funds
        ruleAction: BLOCK
        ruleHit: true
        nature: FRAUD
      description: Model for list of hit rules
      properties:
        ruleId:
          minLength: 1
          type: string
          description: Unique rule identifier
        ruleInstanceId:
          type: string
        ruleName:
          minLength: 1
          type: string
          description: Name of the rule
        ruleDescription:
          minLength: 1
          type: string
          description: Description of the rule
        executedAt:
          type: number
          description: Timestamp when the rule was hit
          minimum: 315529200000
          maximum: 4133890801000
        ruleAction:
          $ref: '#/components/schemas/RuleAction'
        ruleHitMeta:
          $ref: '#/components/schemas/RuleHitMeta'
        labels:
          type: array
          items:
            $ref: '#/components/schemas/RuleLabels'
        nature:
          $ref: '#/components/schemas/RuleNature'
        isShadow:
          type: boolean
      required:
        - ruleInstanceId
        - ruleName
        - ruleDescription
        - ruleAction
    FailedRulesResult:
      title: FailedRulesResult
      type: object
      example:
        ruleId: R-1a
        ruleName: Proof of funds for high value transactions
        ruleDescription: If a user makes a remittance transaction >= 1800 in EUR - ask
          for proof of funds
        failureException:
          exceptionName: MISSING_DATA
          exceptionDescription: Some data is missing
      description: Model for list of rules failed execution. It means rules could not be run
      properties:
        ruleId:
          minLength: 1
          type: string
          description: Unique rule identifier
        ruleName:
          minLength: 1
          type: string
          description: Name of the rule
        ruleDescription:
          minLength: 1
          type: string
          description: Description of the rule
        failureException:
          $ref: '#/components/schemas/RuleFailureException'
      required:
        - ruleId
        - ruleName
        - ruleDescription
        - failureException
    RuleFailureException:
      title: RuleFailureException
      required:
        - exceptionName
        - exceptionDescription
      type: object
      properties:
        exceptionName:
          minLength: 1
          type: string
          description: Unique rule identifier
        exceptionDescription:
          minLength: 1
          type: string
          description: Name of the rule
      example:
        exceptionName: MISSING_DATA
        exceptionDescription: Some data is missing
    ConsumerName:
      title: ConsumerName
      required:
        - firstName
      type: object
      properties:
        firstName:
          minLength: 1
          type: string
          description: First name of the user
        middleName:
          minLength: 1
          type: string
          description: Middle name of the user
        lastName:
          minLength: 1
          type: string
          description: Last name of the user
      description: Model for a generic consumer name
      example:
        firstName: Baran
        middleName: Realblood
        lastName: Ozkan
    TransactionAmountDetails:
      title: TransactionAmountDetails
      type: object
      example:
        country: DE
        transactionAmount: 800
        transactionCurrency: EUR
      description: Model for transaction amount details
      properties:
        transactionAmount:
          type: number
          description: Amount of the transaction
        transactionCurrency:
          $ref: '#/components/schemas/CurrencyCode'
        country:
          $ref: '#/components/schemas/CountryCode'
      required:
        - transactionAmount
        - transactionCurrency
    Amount:
      title: Amount
      type: object
      example:
        amountValue: 800
        amountCurrency: GBP
      description: Model for amount
      properties:
        amountValue:
          type: number
          description: Numerical value of the transaction
        amountCurrency:
          $ref: '#/components/schemas/CurrencyCode'
      required:
        - amountValue
        - amountCurrency
    OriginFundsInfo:
      title: OriginFundsInfo
      type: object
      description: Model for origin funds information
      properties:
        sourceOfFunds:
          type: string
          description: Source of funds for the transaction
        sourceOfWealth:
          type: string
          description: Source of wealth
    LegalEntity:
      title: LegalEntity
      type: object
      description: Model for business user legal entity details
      properties:
        companyGeneralDetails:
          $ref: '#/components/schemas/CompanyGeneralDetails'
        companyFinancialDetails:
          $ref: '#/components/schemas/CompanyFinancialDetails'
        companyRegistrationDetails:
          $ref: '#/components/schemas/CompanyRegistrationDetails'
        reasonForAccountOpening:
          type: array
          items:
            type: string
        sourceOfFunds:
          type: array
          items:
            $ref: '#/components/schemas/SourceOfFunds'
        contactDetails:
          $ref: '#/components/schemas/ContactDetails'
      required:
        - companyGeneralDetails
    CorporateEntityDetails:
      title: CorporateEntityDetails
      type: object
      description: Model for corporate entity details
      properties:
        legalName:
          minLength: 1
          type: string
          description: Legal name of the corporate entity
      required:
        - legalName
    SourceOfFunds:
      title: SourceOfFunds
      type: string
      enum:
        - Earnings
        - Savings
        - Investments/Deposits
        - Wealth
        - Gift
        - Pension
        - Inheritance
        - Gambling
        - Benefits
        - Passive
        - Family
        - Insurance
        - Legal
        - Sales
        - Rollover
        - Equity
        - Crypto
        - Business
        - Employment
        - Salary
        - Real Estate Sale
        - Real Estate Rental
        - Company Exit
    ContactDetails:
      title: ContactDetails
      type: object
      description: Model for business user contact information details
      properties:
        emailIds:
          type: array
          description: Email addresses of the contacts for a given business customer
          items:
            type: string
        contactNumbers:
          type: array
          description: Phone numbers to contact a given business customer
          items:
            type: string
        faxNumbers:
          type: array
          description: Fax numbers to contact a business customer
          items:
            type: string
        websites:
          type: array
          description: Website of the company
          items:
            type: string
        addresses:
          type: array
          description: Address(es) of the company
          items:
            $ref: '#/components/schemas/Address'
        name:
          $ref: '#/components/schemas/ConsumerName'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
    CompanyFinancialDetails:
      title: CompanyFinancialDetails
      type: object
      example:
        expectedTransactionAmountPerMonth:
          amountValue: 800
          amountCurrency: GBP
        expectedTurnoverPerMonth:
          amountValue: 8000
          amountCurrency: USD
      description: Model for business user company financial details
      properties:
        expectedTransactionAmountPerMonth:
          $ref: '#/components/schemas/Amount'
        expectedTurnoverPerMonth:
          $ref: '#/components/schemas/Amount'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
    UserDetails:
      title: UserDetails
      type: object
      example:
        name:
          firstName: Baran
          middleName: Realblood
          lastName: Ozkan
        dateOfBirth: 1991-01-01
        countryOfResidence: US
        countryOfNationality: DE
      description: Model for consumer user personal details
      properties:
        name:
          $ref: '#/components/schemas/ConsumerName'
        dateOfBirth:
          type: string
          pattern: ^(\d{4}-\d{2}-\d{2})*$
          description: Date of birth of the user (YYYY-MM-DD)
        userCategory:
          type: string
          description: Internal category of the user
        countryOfResidence:
          $ref: '#/components/schemas/CountryCode'
        countryOfTaxResidence:
          $ref: '#/components/schemas/CountryCode'
        countryOfNationality:
          $ref: '#/components/schemas/CountryCode'
        gender:
          $ref: '#/components/schemas/Gender'
        maritalStatus:
          $ref: '#/components/schemas/MaritalStatus'
        placeOfBirth:
          $ref: '#/components/schemas/PlaceOfBirth'
        alias:
          type: array
          items:
            type: string
          description: Alias names of the user
    UserRegistrationStatus:
      title: UserRegistrationStatus
      type: string
      enum:
        - REGISTERED
        - UNREGISTERED
    BusinessUserSegment:
      title: BusinessUserSegment
      type: string
      enum:
        - SOLE_PROPRIETORSHIP
        - LIMITED
        - SMB
        - SMALL
        - MEDIUM
        - LARGE
        - UNKNOWN
    CompanyGeneralDetails:
      title: CompanyGeneralDetails
      type: object
      example:
        legalName: Ozkan Hazelnut Export JSC
        businessIndustry:
          - Farming
        mainProductsServicesSold:
          - Hazelnut
      description: Model for business user company general details
      properties:
        legalName:
          minLength: 1
          type: string
          description: Legal name of the company
        businessIndustry:
          type: array
          description: The industry in which the business operates for a business customer
          items:
            type: string
        mainProductsServicesSold:
          type: array
          description: The key products and services provided by the company
          items:
            type: string
        userSegment:
          $ref: '#/components/schemas/BusinessUserSegment'
          description: Segmentation of the business user
        userRegistrationStatus:
          $ref: '#/components/schemas/UserRegistrationStatus'
        operatingCountries:
          type: array
          description: Countries where the business operates
          items:
            $ref: '#/components/schemas/CountryCode'
        alias:
          type: array
          items:
            type: string
          description: Alias names of the business entity
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
    CompanyRegistrationDetails:
      title: CompanyRegistrationDetails
      type: object
      example:
        registrationIdentifier: PSJ554342
        registrationCountry: DE
      description: Model for business user company registration details
      properties:
        registrationIdentifier:
          minLength: 1
          type: string
          description: Commercial registry registration number for the company in its
            registration country
        registrationCountry:
          $ref: '#/components/schemas/CountryCode'
        taxResidenceCountry:
          $ref: '#/components/schemas/CountryCode'
        taxIdentifier:
          type: string
          description: Tax ID number of the registered entity
        legalEntityType:
          type: string
          description: Type of legal entity, e.g., Limited Liability
        dateOfRegistration:
          type: string
          pattern: ^(\d{4}-\d{2}-\d{2})*$
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
    Business:
      type: object
      properties:
        userId:
          minLength: 1
          type: string
          description: Unique user ID for the user
        createdTimestamp:
          type: number
          description: Timestamp when the user was created
          minimum: 315529200000
          maximum: 4133890801000
        legalEntity:
          $ref: '#/components/schemas/LegalEntity'
        activatedTimestamp:
          type: number
          description: Timestamp when the user was activated
          minimum: 315529200000
          maximum: 4133890801000
        userStateDetails:
          $ref: '#/components/schemas/UserStateDetails'
        kycStatusDetails:
          $ref: '#/components/schemas/KYCStatusDetails'
        corporateEntities:
          type: array
          description: Corporate entities of the user
          items:
            $ref: '#/components/schemas/CorporateEntityDetails'
        shareHolders:
          type: array
          description: Shareholders (beneficiaries) of the company that hold at least 25%
            ownership. Can be another company or an individual
          items:
            oneOf:
              - $ref: '#/components/schemas/Person'
              - $ref: '#/components/schemas/LegalEntity'
        directors:
          type: array
          description: Director(s) of the company. Must be at least one
          items:
            $ref: '#/components/schemas/Person'
        transactionLimits:
          $ref: '#/components/schemas/TransactionLimits'
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        kycRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        allowedPaymentMethods:
          type: array
          items:
            $ref: '#/components/schemas/PaymentMethod'
        lastTransactionTimestamp:
          type: number
          description: Timestamp of the last successful transaction of the user
          x-fern-ignore: true
        linkedEntities:
          $ref: '#/components/schemas/UserEntityLink'
        acquisitionChannel:
          $ref: '#/components/schemas/AcquisitionChannel'
        savedPaymentDetails:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/CardDetails'
              - $ref: '#/components/schemas/GenericBankAccountDetails'
              - $ref: '#/components/schemas/IBANDetails'
              - $ref: '#/components/schemas/ACHDetails'
              - $ref: '#/components/schemas/SWIFTDetails'
              - $ref: '#/components/schemas/MpesaDetails'
              - $ref: '#/components/schemas/UPIDetails'
              - $ref: '#/components/schemas/WalletDetails'
              - $ref: '#/components/schemas/CheckDetails'
              - $ref: '#/components/schemas/CashDetails'
              - $ref: '#/components/schemas/NPPDetails'
        mccDetails:
          $ref: '#/components/schemas/MCCDetails'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/UserTag'
        attachments:
          type: array
          description: User's attachments uploaded by business user
          items:
            $ref: '#/components/schemas/PersonAttachment'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        productsEnabled:
          type: array
          items:
            $ref: '#/components/schemas/ProductsEnabled'
        pepStatus:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
        sanctionsStatus:
          type: boolean
          description: Whether the user is sanctioned
        adverseMediaStatus:
          type: boolean
          description: Whether the user is in the adverse media list
      required:
        - userId
        - createdTimestamp
        - legalEntity
    BusinessBase:
      title: BusinessBase
      type: object
      example:
        createdTimestamp: 1641654664000
        userId: 96647cfd9e8fe66ee0f3362e011e34e8
        legalEntity:
          companyGeneralDetails:
            legalName: Ozkan Hazelnut Export JSC
            businessIndustry:
              - Farming
            mainProductsServicesSold:
              - Hazelnut
          companyFinancialDetails:
            expectedTransactionAmountPerMonth:
              amountValue: 800
              amountCurrency: GBP
            expectedTurnoverPerMonth:
              amountValue: 8000
              amountCurrency: USD
          companyRegistrationDetails:
            registrationIdentifier: PSJ554342
            registrationCountry: DE
          reasonForAccountOpening:
            - string
          contactDetails:
            addresses:
              - addressLines:
                  - Klara-Franke Str 20
                postcode: '10557'
                city: Berlin
                state: Berlin
                country: Germany
                tags:
                  - key: customKey
                    value: customValue
        shareHolders:
          - generalDetails:
              name:
                firstName: Baran
                middleName: Realblood
                lastName: Ozkan
              dateOfBirth: 1991-01-01
              countryOfResidence: US
              countryOfNationality: DE
            legalDocuments:
              - documentType: passport
                documentNumber: Z9431P
                documentIssuedDate: 1639939034000
                documentExpirationDate: 1839939034000
                documentIssuedCountry: DE
                tags:
                  - key: customerType
                    value: wallet
            contactDetails:
              emailIds:
                - baran@flagright.com
              contactNumbers:
                - +371 123132
              websites:
                - flagright.com
              addresses:
                - addressLines:
                    - Klara-Franke Str 20
                  postcode: '10557'
                  city: Berlin
                  state: Berlin
                  country: Germany
                  tags:
                    - key: customKey
                      value: customValue
            tags:
              - key: customKey
                value: customValue
        directors:
          - generalDetails:
              name:
                firstName: Baran
                middleName: Realblood
                lastName: Ozkan
              dateOfBirth: 1991-01-01
              countryOfResidence: US
              countryOfNationality: DE
            legalDocuments:
              - documentType: passport
                documentNumber: Z9431P
                documentIssuedDate: 1639939034000
                documentExpirationDate: 1839939034000
                documentIssuedCountry: DE
                tags:
                  - key: customerType
                    value: wallet
            contactDetails:
              emailIds:
                - baran@flagright.com
              contactNumbers:
                - +371 123132
              websites:
                - flagright.com
              addresses:
                - addressLines:
                    - Klara-Franke Str 20
                  postcode: '10557'
                  city: Berlin
                  state: Berlin
                  country: Germany
                  tags:
                    - key: customKey
                      value: customValue
            tags:
              - key: customKey
                value: customValue
        tags:
          - key: customKey
            value: customValue
      x-examples:
        example-1:
          userId: 96647cfd9e8fe66ee0f3362e011e34e8
          legalEntity:
            companyGeneralDetails:
              legalName: Ozkan Hazelnut Export JSC
              businessIndustry:
                - Farming
              mainProductsServicesSold:
                - Hazelnut
            companyFinancialDetails:
              expectedTransactionAmountPerMonth:
                amountValue: 800
                amountCurrency: GBP
              expectedTurnoverPerMonth:
                amountValue: 8000
                amountCurrency: USD
            companyRegistrationDetails:
              registrationIdentifier: PSJ554342
              registrationCountry: DE
            reasonForAccountOpening:
              - string
            contactDetails:
              addresses:
                - addressLines:
                    - Klara-Franke Str 20
                  postcode: '10557'
                  city: Berlin
                  state: Berlin
                  country: Germany
                  tags:
                    - key: customKey
                      value: customValue
          shareHolders:
            - generalDetails:
                name:
                  firstName: Baran
                  middleName: Realblood
                  lastName: Ozkan
                dateOfBirth:
                  day: 1
                  month: 1
                  year: 1990
                countryOfResidence: US
                countryOfNationality: DE
              legalDocuments:
                - documentType: passport
                  documentNumber: Z9431P
                  documentIssuedDate: 1639939034000
                  documentExpirationDate: 1839939034000
                  documentIssuedCountry: DE
                  tags:
                    - key: customerType
                      value: wallet
              contactDetails:
                emailIds:
                  - baran@flagright.com
                contactNumbers:
                  - +371 123132
                websites:
                  - flagright.com
                addresses:
                  - addressLines:
                      - Klara-Franke Str 20
                    postcode: '10557'
                    city: Berlin
                    state: Berlin
                    country: Germany
                    tags:
                      - key: customKey
                        value: customValue
              tags:
                - key: customKey
                  value: customValue
          directors:
            - generalDetails:
                name:
                  firstName: Baran
                  middleName: Realblood
                  lastName: Ozkan
                dateOfBirth:
                  day: 1
                  month: 1
                  year: 1990
                countryOfResidence: US
                countryOfNationality: DE
              legalDocuments:
                - documentType: passport
                  documentNumber: Z9431P
                  documentIssuedDate: 1639939034000
                  documentExpirationDate: 1839939034000
                  documentIssuedCountry: DE
                  tags:
                    - key: customerType
                      value: wallet
              contactDetails:
                emailIds:
                  - baran@flagright.com
                contactNumbers:
                  - +371 123132
                websites:
                  - flagright.com
                addresses:
                  - addressLines:
                      - Klara-Franke Str 20
                    postcode: '10557'
                    city: Berlin
                    state: Berlin
                    country: Germany
                    tags:
                      - key: customKey
                        value: customValue
              tags:
                - key: customKey
                  value: customValue
          tags:
            - key: customKey
              value: customValue
      description: Model for a business user base fields
      properties:
        userId:
          minLength: 1
          type: string
          description: Unique user ID for the user
        createdTimestamp:
          type: number
          description: Timestamp when the user was created
          minimum: 315529200000
          maximum: 4133890801000
        legalEntity:
          $ref: '#/components/schemas/LegalEntity'
      required:
        - userId
        - createdTimestamp
        - legalEntity
    BusinessOptional:
      title: BusinessOptional
      type: object
      example:
        createdTimestamp: 1641654664000
        userId: 96647cfd9e8fe66ee0f3362e011e34e8
        legalEntity:
          companyGeneralDetails:
            legalName: Ozkan Hazelnut Export JSC
            businessIndustry:
              - Farming
            mainProductsServicesSold:
              - Hazelnut
          companyFinancialDetails:
            expectedTransactionAmountPerMonth:
              amountValue: 800
              amountCurrency: GBP
            expectedTurnoverPerMonth:
              amountValue: 8000
              amountCurrency: USD
          companyRegistrationDetails:
            registrationIdentifier: PSJ554342
            registrationCountry: DE
          reasonForAccountOpening:
            - string
          contactDetails:
            addresses:
              - addressLines:
                  - Klara-Franke Str 20
                postcode: '10557'
                city: Berlin
                state: Berlin
                country: Germany
                tags:
                  - key: customKey
                    value: customValue
        shareHolders:
          - generalDetails:
              name:
                firstName: Baran
                middleName: Realblood
                lastName: Ozkan
              dateOfBirth: 1991-01-01
              countryOfResidence: US
              countryOfNationality: DE
            legalDocuments:
              - documentType: passport
                documentNumber: Z9431P
                documentIssuedDate: 1639939034000
                documentExpirationDate: 1839939034000
                documentIssuedCountry: DE
                tags:
                  - key: customerType
                    value: wallet
            contactDetails:
              emailIds:
                - baran@flagright.com
              contactNumbers:
                - +371 123132
              websites:
                - flagright.com
              addresses:
                - addressLines:
                    - Klara-Franke Str 20
                  postcode: '10557'
                  city: Berlin
                  state: Berlin
                  country: Germany
                  tags:
                    - key: customKey
                      value: customValue
            tags:
              - key: customKey
                value: customValue
        directors:
          - generalDetails:
              name:
                firstName: Baran
                middleName: Realblood
                lastName: Ozkan
              dateOfBirth: 1991-01-01
              countryOfResidence: US
              countryOfNationality: DE
            legalDocuments:
              - documentType: passport
                documentNumber: Z9431P
                documentIssuedDate: 1639939034000
                documentExpirationDate: 1839939034000
                documentIssuedCountry: DE
                tags:
                  - key: customerType
                    value: wallet
            contactDetails:
              emailIds:
                - baran@flagright.com
              contactNumbers:
                - +371 123132
              websites:
                - flagright.com
              addresses:
                - addressLines:
                    - Klara-Franke Str 20
                  postcode: '10557'
                  city: Berlin
                  state: Berlin
                  country: Germany
                  tags:
                    - key: customKey
                      value: customValue
            tags:
              - key: customKey
                value: customValue
        tags:
          - key: customKey
            value: customValue
        metaData:
          batteryLevel: 76.3
          deviceLatitude: 13.009711
          deviceLongitude: 76.102898
          ipAddress: 79.144.2.20
          vpnUsed: true
      x-examples:
        example-1:
          userId: 96647cfd9e8fe66ee0f3362e011e34e8
          legalEntity:
            companyGeneralDetails:
              legalName: Ozkan Hazelnut Export JSC
              businessIndustry:
                - Farming
              mainProductsServicesSold:
                - Hazelnut
            companyFinancialDetails:
              expectedTransactionAmountPerMonth:
                amountValue: 800
                amountCurrency: GBP
              expectedTurnoverPerMonth:
                amountValue: 8000
                amountCurrency: USD
            companyRegistrationDetails:
              registrationIdentifier: PSJ554342
              registrationCountry: DE
            reasonForAccountOpening:
              - string
            contactDetails:
              addresses:
                - addressLines:
                    - Klara-Franke Str 20
                  postcode: '10557'
                  city: Berlin
                  state: Berlin
                  country: Germany
                  tags:
                    - key: customKey
                      value: customValue
          shareHolders:
            - generalDetails:
                name:
                  firstName: Baran
                  middleName: Realblood
                  lastName: Ozkan
                dateOfBirth:
                  day: 1
                  month: 1
                  year: 1990
                countryOfResidence: US
                countryOfNationality: DE
              legalDocuments:
                - documentType: passport
                  documentNumber: Z9431P
                  documentIssuedDate: 1639939034000
                  documentExpirationDate: 1839939034000
                  documentIssuedCountry: DE
                  tags:
                    - key: customerType
                      value: wallet
              contactDetails:
                emailIds:
                  - baran@flagright.com
                contactNumbers:
                  - +371 123132
                websites:
                  - flagright.com
                addresses:
                  - addressLines:
                      - Klara-Franke Str 20
                    postcode: '10557'
                    city: Berlin
                    state: Berlin
                    country: Germany
                    tags:
                      - key: customKey
                        value: customValue
              tags:
                - key: customKey
                  value: customValue
          directors:
            - generalDetails:
                name:
                  firstName: Baran
                  middleName: Realblood
                  lastName: Ozkan
                dateOfBirth:
                  day: 1
                  month: 1
                  year: 1990
                countryOfResidence: US
                countryOfNationality: DE
              legalDocuments:
                - documentType: passport
                  documentNumber: Z9431P
                  documentIssuedDate: 1639939034000
                  documentExpirationDate: 1839939034000
                  documentIssuedCountry: DE
                  tags:
                    - key: customerType
                      value: wallet
              contactDetails:
                emailIds:
                  - baran@flagright.com
                contactNumbers:
                  - +371 123132
                websites:
                  - flagright.com
                addresses:
                  - addressLines:
                      - Klara-Franke Str 20
                    postcode: '10557'
                    city: Berlin
                    state: Berlin
                    country: Germany
                    tags:
                      - key: customKey
                        value: customValue
              tags:
                - key: customKey
                  value: customValue
          tags:
            - key: customKey
              value: customValue
          metaData:
            batteryLevel: 76.3
            deviceLatitude: 13.009711
            deviceLongitude: 76.102898
            ipAddress: 79.144.2.20
            vpnUsed: true
      description: Model for a business user - optional fields
      properties:
        activatedTimestamp:
          type: number
          description: Timestamp when the user was activated
          minimum: 315529200000
          maximum: 4133890801000
        userStateDetails:
          $ref: '#/components/schemas/UserStateDetails'
        kycStatusDetails:
          $ref: '#/components/schemas/KYCStatusDetails'
        legalEntity:
          $ref: '#/components/schemas/LegalEntity'
        corporateEntities:
          type: array
          description: Corporate entities of the user
          items:
            $ref: '#/components/schemas/CorporateEntityDetails'
        shareHolders:
          type: array
          description: Shareholders (beneficiaries) of the company that hold at least 25%
            ownership. Can be another company or an individual
          items:
            oneOf:
              - $ref: '#/components/schemas/Person'
              - $ref: '#/components/schemas/LegalEntity'
        directors:
          type: array
          description: Director(s) of the company. Must be at least one
          items:
            $ref: '#/components/schemas/Person'
        transactionLimits:
          $ref: '#/components/schemas/TransactionLimits'
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        kycRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        allowedPaymentMethods:
          type: array
          items:
            $ref: '#/components/schemas/PaymentMethod'
        lastTransactionTimestamp:
          type: number
          description: Timestamp of the last successful transaction of the user
          x-fern-ignore: true
        linkedEntities:
          $ref: '#/components/schemas/UserEntityLink'
        acquisitionChannel:
          $ref: '#/components/schemas/AcquisitionChannel'
        savedPaymentDetails:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/CardDetails'
              - $ref: '#/components/schemas/GenericBankAccountDetails'
              - $ref: '#/components/schemas/IBANDetails'
              - $ref: '#/components/schemas/ACHDetails'
              - $ref: '#/components/schemas/SWIFTDetails'
              - $ref: '#/components/schemas/MpesaDetails'
              - $ref: '#/components/schemas/UPIDetails'
              - $ref: '#/components/schemas/WalletDetails'
              - $ref: '#/components/schemas/CheckDetails'
              - $ref: '#/components/schemas/CashDetails'
              - $ref: '#/components/schemas/NPPDetails'
        mccDetails:
          $ref: '#/components/schemas/MCCDetails'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/UserTag'
        attachments:
          type: array
          description: User's attachments uploaded by business user
          items:
            $ref: '#/components/schemas/PersonAttachment'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        productsEnabled:
          type: array
          items:
            $ref: '#/components/schemas/ProductsEnabled'
        pepStatus:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
        sanctionsStatus:
          type: boolean
          description: Whether the user is sanctioned
        adverseMediaStatus:
          type: boolean
          description: Whether the user is in the adverse media list
    BusinessUserMonitoringResult:
      title: BusinessUserMonitoringResult
      type: object
      description: Model for business user risk score response
      x-examples:
        example-1:
          userId: string
          riskScoreDetails:
            kycRiskScore: 27.5
            craRiskScore: 23.92
            kycRiskLevel: LOW
            craRiskLevel: LOW
      properties:
        userId:
          minLength: 1
          type: string
          description: user ID the risk score pertains to
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
      required:
        - userId
    ConsumerUserMonitoringResult:
      title: ConsumerUserMonitoringResult
      type: object
      x-examples:
        example-1:
          userId: string
          riskScoreDetails:
            kycRiskScore: 27.5
            craRiskScore: 23.92
            kycRiskLevel: LOW
            craRiskLevel: LOW
      description: Model for consumer user risk score response
      properties:
        userId:
          minLength: 1
          type: string
          description: user ID the risk score pertains to
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
      required:
        - userId
    CardStatus:
      title: CardStatus
      type: string
      description: Status of the card
      enum:
        - ACTIVE
        - FROZEN
        - BLOCKED
        - SUSPECTED_FRAUD
        - STOLEN
        - LOST
        - CLOSED
        - OTHER
    CardDetails:
      title: CardDetails
      type: object
      description: Model for credit or debit card details
      example:
        method: CARD
        cardFingerprint: 20ac00fed8ef913aefb17cfae1097cce
        cardIssuedCountry: TR
        transactionReferenceField: Deposit
        3dsDone: true
      properties:
        method:
          $ref: '#/components/schemas/CardPaymentMethod'
        cardFingerprint:
          minLength: 1
          type: string
          description: Unique card fingerprint that helps identify a specific card without
            having to use explicit card number. This is likely available at your
            card payment scheme provider
        emailId:
          $ref: '#/components/schemas/EmailId'
        cardStatus:
          $ref: '#/components/schemas/CardStatus'
        cardIssuedCountry:
          $ref: '#/components/schemas/CountryCode'
        transactionReferenceField:
          minLength: 1
          type: string
          description: Reference for the transaction
        3dsDone:
          type: boolean
          description: Whether 3ds was successfully enforced for the transaction
        nameOnCard:
          $ref: '#/components/schemas/ConsumerName'
        cardExpiry:
          $ref: '#/components/schemas/CardExpiry'
        posDetails:
          $ref: '#/components/schemas/POSDetails'
        cardLast4Digits:
          type: string
          minLength: 4
          maxLength: 4
          description: Last 4 digits of Card
        cardBrand:
          $ref: '#/components/schemas/CardBrand'
        cardFunding:
          $ref: '#/components/schemas/CardFunding'
        cardAuthenticated:
          type: boolean
          description: Authentication of Card
        cardTokenized:
          type: boolean
          description: Was the card tokenized
        cardPresent:
          type: boolean
          description: Card Present
        paymentChannel:
          type: string
        cardType:
          $ref: '#/components/schemas/CardType'
        cardBalance:
          $ref: '#/components/schemas/Amount'
        merchantDetails:
          $ref: '#/components/schemas/CardMerchantDetails'
        networkProviderRiskScore:
          type: number
          description: Risk score of the card from your network provider
        address:
          $ref: '#/components/schemas/Address'
        countryOfNationality:
          $ref: '#/components/schemas/CountryCode'
        countryOfResidence:
          $ref: '#/components/schemas/CountryCode'
        bankAddress:
          $ref: '#/components/schemas/Address'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
      required:
        - method
    NPPDetails:
      title: NPPDetails
      type: object
      description: New Payment Platform Details for Australia
      properties:
        method:
          $ref: '#/components/schemas/NPPPaymentMethod'
        accountNumber:
          type: string
          description: Account number
        name:
          $ref: '#/components/schemas/ConsumerName'
        emailId:
          $ref: '#/components/schemas/EmailId'
        contactNumber:
          type: string
          description: Contact number
        bsb:
          type: string
          description: BSB number
        payId:
          type: string
          description: PayID
        endToEndId:
          type: string
          description: End to End ID
        oskoReference:
          type: string
          description: OSKO reference
        payIdReference:
          type: string
          description: PayID reference
        isInstant:
          type: boolean
          description: Whether the payment is instant
        remittanceInformation:
          type: string
          description: Remittance information
        remittanceAdvice:
          type: string
          description: Remittance advice
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
        processingDate:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        settlementDate:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        referenceNumber:
          type: string
          description: Unique reference number for transaction reconciliation
        traceNumber:
          type: string
          description: Trace number for tracking the payment through the NPP system
        messageFormat:
          type: string
          description: Format of the NPP message (e.g., JSON, XML)
        bankName:
          type: string
          description: Name of the bank associated with the account
        address:
          $ref: '#/components/schemas/Address'
      required:
        - method
    IBANDetails:
      title: IBANDetails
      type: object
      description: Standardized model for Bank Details
      example:
        method: IBAN
        BIC: DE761234561
        bankName: Merryl Lynch
        IBAN: '1234321'
        bankAddress:
          addressLines:
            - Klara-Franke Str 20
          postcode: '10557'
          city: Berlin
          state: Berlin
          country: Germany
          tags:
            - key: customKey
              value: customValue
      x-examples:
        example-1:
          method: IBAN
          bankIdentifierType: IBAN
          bankIdentifier: DE761234561
          bankName: Merryl Lynch
          accountNumber: '1234321'
          bankAddress:
            addressLines:
              - Klara-Franke Str 20
            postcode: '10557'
            city: Berlin
            state: Berlin
            country: Germany
            tags:
              - key: customKey
                value: customValue
      properties:
        method:
          $ref: '#/components/schemas/IBANPaymentMethod'
        BIC:
          minLength: 1
          type: string
          description: Identifier for the bank. Can be routing number, BIK number, SWIFT
            code, BIC number etc.
        bankName:
          minLength: 1
          type: string
          description: Name of the bank
        bankAddress:
          $ref: '#/components/schemas/Address'
        address:
          $ref: '#/components/schemas/Address'
          description: Address of the account holder
        country:
          $ref: '#/components/schemas/CountryCode'
        IBAN:
          type: string
          description: Account number of the user. Can be account number, IBAN number etc.
        accountBalance:
          $ref: '#/components/schemas/Amount'
        name:
          type: string
          description: Name of the bank account holder
        emailId:
          $ref: '#/components/schemas/EmailId'
        bankBranchCode:
          type: string
          description: Branch code of the bank. In some countries, this can be the same as
            the bank's SWIFT code
        paymentChannel:
          type: string
        countryOfNationality:
          $ref: '#/components/schemas/CountryCode'
        countryOfResidence:
          $ref: '#/components/schemas/CountryCode'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
      required:
        - method
    WalletDetails:
      title: WalletDetails
      type: object
      description: Standardized model for a Generic wallet transaction
      x-examples: {}
      properties:
        method:
          $ref: '#/components/schemas/WalletPaymentMethod'
        walletType:
          type: string
          description: Wallet type if there are various types of wallets belonging to the
            same user. E.g. Checking, savings, vault, different currency wallets
            etc.
        walletId:
          minLength: 1
          type: string
          description: Unique ID of the wallet
        paymentChannel:
          type: string
          description: Payment Channel used through wallet
        name:
          type: string
          description: Name of the account holder for a specific wallet
        emailId:
          $ref: '#/components/schemas/EmailId'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
        walletPhoneNumber:
          type: string
          description: Phone number associated with the wallet, if any
        walletBalance:
          $ref: '#/components/schemas/Amount'
        network:
          $ref: '#/components/schemas/WalletNetwork'
        address:
          $ref: '#/components/schemas/Address'
        countryOfNationality:
          $ref: '#/components/schemas/CountryCode'
        countryOfResidence:
          $ref: '#/components/schemas/CountryCode'
        bankAddress:
          $ref: '#/components/schemas/Address'
        authorizedRepresentative:
          type: array
          items:
            $ref: '#/components/schemas/UserDetails'
        dateOfBirth:
          type: string
          pattern: ^(\d{4}-\d{2}-\d{2})*$
          description: Date of birth of the account holder (YYYY-MM-DD)
        transactionHash:
          type: string
          description: A hash is a cryptographic fingerprint that uniquely identifies a
            blockchain transaction on the network, whereas a transactionId is
            just an internal reference used by a wallet or platform to track the
            transaction in its own system.
      required:
        - method
    WalletNetwork:
      type: string
      description: Network of the wallet
      enum:
        - BITCOIN
        - ETHEREUM
        - POLYGON
        - BNB_SMART_CHAIN
        - BNB_BEACON_CHAIN
        - ARBITRUM_L2
        - SOLANA
        - AVALANCHE_C_CHAIN
        - TEZOS
        - VICTION
        - LITECOIN
        - BITCOIN_CASH
        - RIPPLE
        - STELLAR
        - EOS_PUBLIC
        - TRON
        - CARDANO
        - POLKADOT
        - NEAR_PROTOCOL
        - COSMOS
        - DOGECOIN
        - OPTIMISM_MAINNET
        - FANTOM
        - HEDERA
        - ALGORAND
        - CELESTIA
    ACHDetails:
      description: Model for ACH payment method
      type: object
      x-examples:
        example-2:
          method: ACH
          routingNumber: '1231241'
          accountNumber: '543456675'
          bankName: Wells Fargo
          name:
            firstName: Baran
            middleName: Realblood
            lastName: Ozkan
          bankAddress:
            addressLines:
              - 1201 N Monroe St
            postcode: '32303'
            city: Tallahassee
            state: FL
            country: United States of America
            tags:
              - key: userType
                value: customValue
      title: ACHDetails
      properties:
        method:
          $ref: '#/components/schemas/ACHPaymentMethod'
        routingNumber:
          type: string
          minLength: 1
          description: Routing number of the bank
        accountNumber:
          type: string
          minLength: 1
          description: Bank account number of the individual
        accountBalance:
          $ref: '#/components/schemas/Amount'
        bankName:
          type: string
          minLength: 1
          description: Name of the bank
        name:
          type: string
          description: Name of the account holder
        bankAddress:
          $ref: '#/components/schemas/Address'
        address:
          $ref: '#/components/schemas/Address'
          description: Address of the account holder
        countryOfNationality:
          $ref: '#/components/schemas/CountryCode'
        countryOfResidence:
          $ref: '#/components/schemas/CountryCode'
        beneficiaryName:
          type: string
          description: Beneficiary name of the account
        emailId:
          $ref: '#/components/schemas/EmailId'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
      required:
        - method
    CorrespondentBankDetails:
      description: Model for Correspondent bank details
      type: object
      x-examples: {}
      title: CorrespondentBankDetails
      properties:
        bankName:
          type: string
          minLength: 1
          description: Name of the bank
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
    SWIFTDetails:
      description: Model for SWIFT payment method
      type: object
      x-examples: {}
      title: SWIFTDetails
      properties:
        method:
          $ref: '#/components/schemas/SWIFTPaymentMethod'
        swiftCode:
          type: string
          minLength: 1
          description: SWIFT code of the financial institution
        accountNumber:
          type: string
          minLength: 1
          description: Account number
        routingNumber:
          type: string
          description: Routing number of the bank
        accountBalance:
          $ref: '#/components/schemas/Amount'
        accountType:
          type: string
          description: Account type. E.g. Checking, Savings etc.
        bankName:
          type: string
          minLength: 1
          description: Name of the bank
        name:
          type: string
          description: Name of the account holder
        bankAddress:
          $ref: '#/components/schemas/Address'
        countryOfNationality:
          $ref: '#/components/schemas/CountryCode'
        countryOfResidence:
          $ref: '#/components/schemas/CountryCode'
        emailId:
          $ref: '#/components/schemas/EmailId'
        specialInstructions:
          type: string
          description: Special instructions if any
        address:
          $ref: '#/components/schemas/Address'
        correspondentBankDetails:
          type: array
          items:
            $ref: '#/components/schemas/CorrespondentBankDetails'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
      required:
        - method
    MpesaDetails:
      description: Model for Mpesa payment method
      type: object
      x-examples: {}
      title: MpesaDetails
      properties:
        method:
          $ref: '#/components/schemas/MpesaPaymentMethod'
        businessShortCode:
          type: string
          minLength: 1
          description: Business code
        transactionType:
          $ref: '#/components/schemas/MpesaTransactionType'
        phoneNumber:
          type: string
          description: Contact Number of the account holder
        emailId:
          $ref: '#/components/schemas/EmailId'
        name:
          type: string
          description: Name of the account holder
        address:
          $ref: '#/components/schemas/Address'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
      required:
        - method
        - businessShortCode
        - transactionType
        - phoneNumber
    GenericBankAccountDetails:
      description: Model for any generic bank account
      type: object
      x-examples: {}
      title: GenericBankAccountDetails
      properties:
        method:
          $ref: '#/components/schemas/GeneralBankAccountPaymentMethod'
        accountNumber:
          type: string
          minLength: 1
          description: Bank account number
        accountType:
          type: string
          description: Bank account type. E.g. Checking, Savings etc.
        accountBalance:
          $ref: '#/components/schemas/Amount'
        bankName:
          type: string
          minLength: 1
          description: Name of the bank
        bankCode:
          type: string
          description: Unique identifier of the bank. In some countries, this can be the
            same as the bank's SWIFT code
        country:
          $ref: '#/components/schemas/CountryCode'
        name:
          type: string
          description: Name of the account holder
        countryOfNationality:
          $ref: '#/components/schemas/CountryCode'
          description: Country of nationality of the account holder
        countryOfResidence:
          $ref: '#/components/schemas/CountryCode'
          description: Country of residence of the account holder
        dateOfBirth:
          type: string
          pattern: ^(\d{4}-\d{2}-\d{2})*$
          description: Date of birth of the account holder (YYYY-MM-DD)
        bankAddress:
          $ref: '#/components/schemas/Address'
        emailId:
          $ref: '#/components/schemas/EmailId'
        specialInstructions:
          type: string
          description: Special instructions to be specified if any
        paymentChannel:
          type: string
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
        transitNumber:
          type: string
          description: Transit number of the bank account
        address:
          $ref: '#/components/schemas/Address'
        routingNumber:
          type: string
          description: Routing number of the bank
      required:
        - method
    UPIDetails:
      description: Model for UPI payment method
      type: object
      x-examples:
        example-1:
          method: UPI
          upiID: user@okhdfcbank
          bankProvider: HDFC Bank
          interfaceProvider: PhonePe
      title: UPIDetails
      properties:
        method:
          $ref: '#/components/schemas/UPIPaymentMethod'
        upiID:
          type: string
          minLength: 1
          description: UPI Id number
        bankProvider:
          type: string
          minLength: 1
          description: Bank provider name
        interfaceProvider:
          type: string
          minLength: 1
          description: Interface provider name
        name:
          type: string
          description: Name of the account holder
        address:
          $ref: '#/components/schemas/Address'
        emailId:
          $ref: '#/components/schemas/EmailId'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
      required:
        - method
        - upiID
    TransactionLimits:
      title: TransactionLimits
      type: object
      x-examples:
        example-1:
          maximumDailyTransactionLimit:
            amountValue: 800
            amountCurrency: EUR
          maximumWeeklyTransactionLimit:
            amountValue: 800
            amountCurrency: GBP
          maximumMonthlyTransactionLimit:
            amountValue: 800
            amountCurrency: EUR
          maximumQuarterlyTransactionLimit:
            amountValue: 800
            amountCurrency: GBP
          maximumYearlyTransactionLimit:
            amountValue: 800
            amountCurrency: GBP
          paymentMethodLimits:
            CARD:
              transactionCountLimit:
                day: 100
                month: 100
              transactionAmountLimit:
                day:
                  amountValue: 100
                  amountCurrency: GBP
                month:
                  amountValue: 1000
                  amountCurrency: GBP
              averageTransactionAmountLimit:
                day:
                  amountValue: 100
                  amountCurrency: GBP
                month:
                  amountValue: 1000
                  amountCurrency: GBP
            IBAN:
              transactionCountLimit:
                day: 50
                month: 500
              transactionAmountLimit:
                day:
                  amountValue: 500
                  amountCurrency: EUR
                month:
                  amountValue: 5000
                  amountCurrency: EUR
              averageTransactionAmountLimit:
                day:
                  amountValue: 500
                  amountCurrency: EUR
                month:
                  amountValue: 5000
                  amountCurrency: EUR
      description: Model for transaction limits for a given user
      properties:
        maximumDailyTransactionLimit:
          $ref: '#/components/schemas/Amount'
        maximumWeeklyTransactionLimit:
          $ref: '#/components/schemas/Amount'
        maximumMonthlyTransactionLimit:
          $ref: '#/components/schemas/Amount'
        maximumQuarterlyTransactionLimit:
          $ref: '#/components/schemas/Amount'
        maximumTransactionLimit:
          $ref: '#/components/schemas/Amount'
        maximumYearlyTransactionLimit:
          $ref: '#/components/schemas/Amount'
        paymentMethodLimits:
          type: object
          properties:
            ACH:
              $ref: '#/components/schemas/TransactionLimit'
            CARD:
              $ref: '#/components/schemas/TransactionLimit'
            IBAN:
              $ref: '#/components/schemas/TransactionLimit'
            UPI:
              $ref: '#/components/schemas/TransactionLimit'
            GENERIC_BANK_ACCOUNT:
              $ref: '#/components/schemas/TransactionLimit'
            MPESA:
              $ref: '#/components/schemas/TransactionLimit'
            SWIFT:
              $ref: '#/components/schemas/TransactionLimit'
            WALLET:
              $ref: '#/components/schemas/TransactionLimit'
            CHECK:
              $ref: '#/components/schemas/TransactionLimit'
            CASH:
              $ref: '#/components/schemas/TransactionLimit'
            NPP:
              $ref: '#/components/schemas/TransactionLimit'
    ExpectedIncome:
      title: ExpectedIncome
      type: object
      description: Model for expected income details
      properties:
        dailyExpectedIncome:
          $ref: '#/components/schemas/Amount'
        weeklyExpectedIncome:
          $ref: '#/components/schemas/Amount'
        monthlyExpectedIncome:
          $ref: '#/components/schemas/Amount'
        quarterlyExpectedIncome:
          $ref: '#/components/schemas/Amount'
        yearlyExpectedIncome:
          $ref: '#/components/schemas/Amount'
    RuleHitMeta:
      type: object
      description: Details of rule execution, for internal purposes only
      properties:
        hitDirections:
          type: array
          items:
            $ref: '#/components/schemas/RuleHitDirection'
        falsePositiveDetails:
          $ref: '#/components/schemas/FalsePositiveDetails'
        sanctionsDetails:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsDetails'
        isOngoingScreeningHit:
          type: boolean
    RuleHitDirection:
      type: string
      title: RuleHitDirection
      enum:
        - ORIGIN
        - DESTINATION
    RuleNature:
      type: string
      title: Rule nature type
      enum:
        - AML
        - FRAUD
        - CTF
        - SCREENING
    TransactionEvent:
      description: Model for transaction-related events
      type: object
      x-examples:
        example-1:
          transactionState: CREATED
          timestamp: 1262300441294
          transactionId: 443dea26147a406b957d9ee3a1247b11
          eventId: aaeeb166147a406b957dd9147a406b957
          eventDescription: Transaction created
          metaData:
            batteryLevel: 76.3
            deviceLatitude: 13.009711
            deviceLongitude: 76.102898
            ipAddress: 79.144.2.20
            vpnUsed: true
      additionalProperties: false
      properties:
        transactionState:
          $ref: '#/components/schemas/TransactionState'
        timestamp:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        transactionId:
          type: string
          minLength: 1
          description: Transaction ID the event pertains to
        eventId:
          type: string
          description: Unique event ID
        reason:
          type: string
          description: Reason for the event or a state change
        eventDescription:
          type: string
          description: Event description
        updatedTransactionAttributes:
          $ref: '#/components/schemas/TransactionUpdatable'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        updateCount:
          x-fern-ignore: true
          type: number
      required:
        - transactionState
        - timestamp
        - transactionId
    BatchConsumerUsersWithRulesResults:
      title: BatchConsumerUsersWithRulesResult
      type: object
      properties:
        consumerUsers:
          type: array
          items:
            $ref: '#/components/schemas/BatchConsumerUserWithRulesResult'
        totalCount:
          type: number
      required:
        - consumerUsers
        - totalCount
    BatchBusinessUsersWithRulesResults:
      type: object
      properties:
        businessUsers:
          type: array
          items:
            $ref: '#/components/schemas/BatchBusinessUserWithRulesResult'
        totalCount:
          type: number
      required:
        - businessUsers
        - totalCount
    BatchConsumerUserWithRulesResult:
      type: object
      properties:
        userId:
          minLength: 1
          type: string
          description: Unique user ID
        createdTimestamp:
          type: number
          description: Timestamp when userId is created
          minimum: 315529200000
          maximum: 4133890801000
        activatedTimestamp:
          type: number
          description: Timestamp when user was activated
          minimum: 315529200000
          maximum: 4133890801000
        userDetails:
          $ref: '#/components/schemas/UserDetails'
        userStateDetails:
          $ref: '#/components/schemas/UserStateDetails'
        kycStatusDetails:
          $ref: '#/components/schemas/KYCStatusDetails'
        eoddDate:
          type: number
          x-fern-ignore: true
        employmentStatus:
          $ref: '#/components/schemas/EmploymentStatus'
        occupation:
          type: string
        legalDocuments:
          type: array
          description: User's legal identity documents - See Document Model for details
          items:
            $ref: '#/components/schemas/LegalDocument'
        contactDetails:
          $ref: '#/components/schemas/ContactDetails'
        employmentDetails:
          $ref: '#/components/schemas/EmploymentDetails'
        transactionLimits:
          $ref: '#/components/schemas/TransactionLimits'
        expectedIncome:
          $ref: '#/components/schemas/ExpectedIncome'
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        kycRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        acquisitionChannel:
          $ref: '#/components/schemas/AcquisitionChannel'
        reasonForAccountOpening:
          type: array
          items:
            type: string
        sourceOfFunds:
          type: array
          items:
            $ref: '#/components/schemas/SourceOfFunds'
        userSegment:
          $ref: '#/components/schemas/ConsumerUserSegment'
        pepStatus:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
        sanctionsStatus:
          $ref: '#/components/schemas/SanctionsStatus'
        adverseMediaStatus:
          $ref: '#/components/schemas/AdverseMediaStatus'
        lastTransactionTimestamp:
          type: number
          description: Timestamp of the last successful transaction of the user
          x-fern-ignore: true
        corporateEntities:
          type: array
          description: Corporate entities of the user
          items:
            $ref: '#/components/schemas/CorporateEntityDetails'
        linkedEntities:
          $ref: '#/components/schemas/UserEntityLink'
        savedPaymentDetails:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/CardDetails'
              - $ref: '#/components/schemas/GenericBankAccountDetails'
              - $ref: '#/components/schemas/IBANDetails'
              - $ref: '#/components/schemas/ACHDetails'
              - $ref: '#/components/schemas/SWIFTDetails'
              - $ref: '#/components/schemas/MpesaDetails'
              - $ref: '#/components/schemas/UPIDetails'
              - $ref: '#/components/schemas/WalletDetails'
              - $ref: '#/components/schemas/CheckDetails'
              - $ref: '#/components/schemas/CashDetails'
              - $ref: '#/components/schemas/NPPDetails'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/UserTag'
        attachments:
          type: array
          description: Uploaded user's attachment
          items:
            $ref: '#/components/schemas/PersonAttachment'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        productsEnabled:
          type: array
          items:
            $ref: '#/components/schemas/ProductsEnabled'
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
      required:
        - userId
        - createdTimestamp
    BatchBusinessUserWithRulesResult:
      type: object
      properties:
        userId:
          minLength: 1
          type: string
          description: Unique user ID for the user
        createdTimestamp:
          type: number
          description: Timestamp when the user was created
          minimum: 315529200000
          maximum: 4133890801000
        legalEntity:
          $ref: '#/components/schemas/LegalEntity'
        activatedTimestamp:
          type: number
          description: Timestamp when the user was activated
          minimum: 315529200000
          maximum: 4133890801000
        userStateDetails:
          $ref: '#/components/schemas/UserStateDetails'
        kycStatusDetails:
          $ref: '#/components/schemas/KYCStatusDetails'
        corporateEntities:
          type: array
          description: Corporate entities of the user
          items:
            $ref: '#/components/schemas/CorporateEntityDetails'
        shareHolders:
          type: array
          description: Shareholders (beneficiaries) of the company that hold at least 25%
            ownership. Can be another company or an individual
          items:
            oneOf:
              - $ref: '#/components/schemas/Person'
              - $ref: '#/components/schemas/LegalEntity'
        directors:
          type: array
          description: Director(s) of the company. Must be at least one
          items:
            $ref: '#/components/schemas/Person'
        transactionLimits:
          $ref: '#/components/schemas/TransactionLimits'
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        kycRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        allowedPaymentMethods:
          type: array
          items:
            $ref: '#/components/schemas/PaymentMethod'
        lastTransactionTimestamp:
          type: number
          description: Timestamp of the last successful transaction of the user
          x-fern-ignore: true
        linkedEntities:
          $ref: '#/components/schemas/UserEntityLink'
        acquisitionChannel:
          $ref: '#/components/schemas/AcquisitionChannel'
        savedPaymentDetails:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/CardDetails'
              - $ref: '#/components/schemas/GenericBankAccountDetails'
              - $ref: '#/components/schemas/IBANDetails'
              - $ref: '#/components/schemas/ACHDetails'
              - $ref: '#/components/schemas/SWIFTDetails'
              - $ref: '#/components/schemas/MpesaDetails'
              - $ref: '#/components/schemas/UPIDetails'
              - $ref: '#/components/schemas/WalletDetails'
              - $ref: '#/components/schemas/CheckDetails'
              - $ref: '#/components/schemas/CashDetails'
              - $ref: '#/components/schemas/NPPDetails'
        mccDetails:
          $ref: '#/components/schemas/MCCDetails'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/UserTag'
        attachments:
          type: array
          description: User's attachments uploaded by business user
          items:
            $ref: '#/components/schemas/PersonAttachment'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        productsEnabled:
          type: array
          items:
            $ref: '#/components/schemas/ProductsEnabled'
        pepStatus:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
        sanctionsStatus:
          type: boolean
          description: Whether the user is sanctioned
        adverseMediaStatus:
          type: boolean
          description: Whether the user is in the adverse media list
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
      required:
        - userId
        - createdTimestamp
        - legalEntity
    BatchConsumerUserEventsWithRulesResult:
      title: BatchConsumerUserEventsRulesResult
      type: object
      properties:
        consumerUserEvents:
          type: array
          items:
            $ref: '#/components/schemas/BatchConsumerUserEventWithRulesResult'
        totalCount:
          type: number
      required:
        - consumerUserEvents
        - totalCount
    BatchBusinessUserEventsWithRulesResult:
      title: BatchBusinessUserEventsWithRulesResult
      type: object
      properties:
        businessUserEvents:
          type: array
          items:
            $ref: '#/components/schemas/BatchBusinessUserEventWithRulesResult'
        totalCount:
          type: number
      required:
        - businessUserEvents
        - totalCount
    BatchUserRulesResult:
      title: BatchUserRulesResult
      type: object
      properties:
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
    BatchConsumerUserEventWithRulesResult:
      type: object
      properties:
        timestamp:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        userId:
          type: string
          minLength: 1
          description: Transaction ID the event pertains to
        eventId:
          type: string
          description: Unique event ID
        reason:
          type: string
          description: Reason for the event or a state change
        eventDescription:
          type: string
          description: Event description
        updatedConsumerUserAttributes:
          $ref: '#/components/schemas/UserOptional'
        updateCount:
          x-fern-ignore: true
          type: number
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
      required:
        - timestamp
        - userId
    BatchBusinessUserEventWithRulesResult:
      type: object
      properties:
        timestamp:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        userId:
          type: string
          minLength: 1
          description: Transaction ID the event pertains to
        eventId:
          type: string
          description: Unique event ID
        reason:
          type: string
          description: Reason for the event or a state change
        eventDescription:
          type: string
          description: Event description
        updatedBusinessUserAttributes:
          $ref: '#/components/schemas/BusinessOptional'
        updateCount:
          x-fern-ignore: true
          type: number
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
      required:
        - timestamp
        - userId
    UserRulesResult:
      title: UserRulesResult
      type: object
      properties:
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
    ConsumerUserEventWithRulesResult:
      type: object
      properties:
        timestamp:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        userId:
          type: string
          minLength: 1
          description: Transaction ID the event pertains to
        eventId:
          type: string
          description: Unique event ID
        reason:
          type: string
          description: Reason for the event or a state change
        eventDescription:
          type: string
          description: Event description
        updatedConsumerUserAttributes:
          $ref: '#/components/schemas/UserOptional'
        updateCount:
          x-fern-ignore: true
          type: number
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
      required:
        - timestamp
        - userId
    BusinessUserEventWithRulesResult:
      type: object
      properties:
        timestamp:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        userId:
          type: string
          minLength: 1
          description: Transaction ID the event pertains to
        eventId:
          type: string
          description: Unique event ID
        reason:
          type: string
          description: Reason for the event or a state change
        eventDescription:
          type: string
          description: Event description
        updatedBusinessUserAttributes:
          $ref: '#/components/schemas/BusinessOptional'
        updateCount:
          x-fern-ignore: true
          type: number
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
      required:
        - timestamp
        - userId
    ConsumerUserEvent:
      description: Model for consumer user-related events
      type: object
      x-examples:
        example-1:
          timestamp: 315529200000
          userId: string
          userStateDetails:
            reason: string
            state: UNACCEPTABLE
          eventId: string
          reason: string
          eventDescription: string
          updatedConsumerUserAttributes:
            createdTimestamp: 1641654664000
            userId: 96647cfd9e8fe66ee0f3362e011e34e8
            userDetails:
              name:
                firstName: Baran
                middleName: Realblood
                lastName: Ozkan
              dateOfBirth: 1991-01-01
              countryOfResidence: US
              countryOfNationality: DE
            legalDocuments:
              - documentType: passport
                documentNumber: Z9431P
                documentIssuedDate: 1639939034000
                documentExpirationDate: 1839939034000
                documentIssuedCountry: DE
                tags:
                  - key: customerType
                    value: wallet
            contactDetails:
              emailIds:
                - baran@flagright.com
              contactNumbers:
                - '+37112345432'
              websites:
                - flagright.com
              addresses:
                - addressLines:
                    - Klara-Franke Str 20
                  postcode: '10557'
                  city: Berlin
                  state: Berlin
                  country: Germany
                  tags:
                    - key: customKey
                      value: customValue
            tags:
              - key: customKey
                value: customValue
      title: ConsumerUserEvent
      additionalProperties: false
      properties:
        timestamp:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        userId:
          type: string
          minLength: 1
          description: Transaction ID the event pertains to
        eventId:
          type: string
          description: Unique event ID
        reason:
          type: string
          description: Reason for the event or a state change
        eventDescription:
          type: string
          description: Event description
        updatedConsumerUserAttributes:
          $ref: '#/components/schemas/UserOptional'
        updateCount:
          x-fern-ignore: true
          type: number
      required:
        - timestamp
        - userId
    BusinessUserEvent:
      description: Model for business user-related events
      type: object
      x-examples:
        example-1:
          timestamp: 315529200000
          userId: string
          userStateDetails:
            reason: string
            state: UNACCEPTABLE
          eventId: string
          reason: string
          eventDescription: string
          updatedConsumerUserAttributes:
            createdTimestamp: 1641654664000
            userId: 96647cfd9e8fe66ee0f3362e011e34e8
            userDetails:
              name:
                firstName: Baran
                middleName: Realblood
                lastName: Ozkan
              dateOfBirth: 1991-01-01
              countryOfResidence: US
              countryOfNationality: DE
            legalDocuments:
              - documentType: passport
                documentNumber: Z9431P
                documentIssuedDate: 1639939034000
                documentExpirationDate: 1839939034000
                documentIssuedCountry: DE
                tags:
                  - key: customerType
                    value: wallet
            contactDetails:
              emailIds:
                - baran@flagright.com
              contactNumbers:
                - '+37112345432'
              websites:
                - flagright.com
              addresses:
                - addressLines:
                    - Klara-Franke Str 20
                  postcode: '10557'
                  city: Berlin
                  state: Berlin
                  country: Germany
                  tags:
                    - key: customKey
                      value: customValue
            tags:
              - key: customKey
                value: customValue
      title: BusinessUserEvent
      additionalProperties: false
      properties:
        timestamp:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        userId:
          type: string
          minLength: 1
          description: Transaction ID the event pertains to
        eventId:
          type: string
          description: Unique event ID
        reason:
          type: string
          description: Reason for the event or a state change
        eventDescription:
          type: string
          description: Event description
        updatedBusinessUserAttributes:
          $ref: '#/components/schemas/BusinessOptional'
        updateCount:
          x-fern-ignore: true
          type: number
      required:
        - timestamp
        - userId
    CaseManagementEvent:
      type: object
      x-examples:
        example-1:
          caseStatus: Unsuspended
          timestamp: 1262300441294
          transactionId: 443dea26147a406b957d9ee3a1247b11
          eventId: aaeeb166147a406b957dd9147a406b957
          eventDescription: Case Unsuspended
      title: CaseManagementEvent
      description: Model for case management events
      properties:
        caseStatus:
          type: string
          minLength: 1
          enum:
            - CLOSED
            - HIT
          description: Status of a case. E.g. Open, Closed etc.
        timestamp:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        caseStatusReason:
          type: string
          enum:
            - FALSE_POSITIVE
            - INVESTIGATION_COMPLETED
            - DOCUMENTS_COLLECTED
            - OTHER
          description: Case status reason. E.g. Closed & False Positive, Closed &
            Investigation Completed etc.
        transactionId:
          type: string
          minLength: 1
          description: Transaction ID the case pertains to
        userId:
          type: string
          description: User ID the case pertains to
        eventId:
          type: string
          description: Event ID the case pertains to
        caseStatusReasonDescription:
          type: string
          description: Case status reason description
      required:
        - caseStatus
        - timestamp
        - caseStatusReason
      additionalProperties: false
    Date:
      title: Date
      type: object
      description: Model for date
      properties:
        day:
          type: number
          description: Day of date
        month:
          type: number
          description: Month of date
        year:
          type: number
          description: Year of date
      required:
        - day
        - month
        - year
    TransactionState:
      type: string
      title: TransactionState
      enum:
        - CREATED
        - PROCESSING
        - SENT
        - EXPIRED
        - DECLINED
        - SUSPENDED
        - REFUNDED
        - SUCCESSFUL
        - REVERSED
      minLength: 1
      description: Model for transaction states. E.g. Processing, Refunded, Successful etc.
    AcquisitionChannel:
      type: string
      title: AcquisitionChannel
      minLength: 1
      description: Model for User acquisition channel
      enum:
        - ORGANIC
        - PAID
        - REFERRAL
        - OFFLINE
        - GATHERING
        - UNKNOWN
    UPIPaymentMethod:
      type: string
      title: UPIPaymentMethod
      enum:
        - UPI
      description: Classify the method of payment as "UPI" for UPIDetails
    IBANPaymentMethod:
      type: string
      title: IBANPaymentMethod
      enum:
        - IBAN
      description: |
        Classify the method of payment as "IBAN" for IBANDetails
    CardPaymentMethod:
      type: string
      title: CardPaymentMethod
      enum:
        - CARD
      description: |
        Classify the method of payment as "Card" for CardDetails
    NPPPaymentMethod:
      type: string
      title: NPPPaymentMethod
      enum:
        - NPP
      description: Classify the method of payment as "NPP" for NPPDetails (New Payment
        Platform Details for Australia)
    WalletPaymentMethod:
      type: string
      title: WalletPaymentMethod
      enum:
        - WALLET
      description: Classify the method of payment as "Wallet" for WalletDetails
    ACHPaymentMethod:
      type: string
      title: ACHPaymentMethod
      enum:
        - ACH
      description: Classify the method of payment as "ACH" for ACHDetails
    SWIFTPaymentMethod:
      type: string
      title: SWIFTPaymentMethod
      enum:
        - SWIFT
      description: Classify the method of payment as "SWIFT" for SWIFTDetails
    CheckPaymentMethod:
      type: string
      title: CheckPaymentMethod
      description: Classify the method of payment as "CHECK" for CheckDetails
      enum:
        - CHECK
    CashPaymentMethod:
      type: string
      title: CashPaymentMethod
      description: Classify the method of payment as "CASH" for Details
      enum:
        - CASH
    MpesaPaymentMethod:
      type: string
      title: MpesaPaymentMethod
      enum:
        - MPESA
      description: Classify the method of payment as "Mpesa" for MpesaDetails
    GeneralBankAccountPaymentMethod:
      type: string
      title: GeneralBankAccountPaymentMethod
      enum:
        - GENERIC_BANK_ACCOUNT
      description: Classify the method of payment as "GENERIC_BANK_ACCOUNT" for
        GenericBankAccountDetails
    UserState:
      type: string
      title: UserState
      enum:
        - UNACCEPTABLE
        - TERMINATED
        - ACTIVE
        - DORMANT
        - CREATED
        - SUSPENDED
        - BLOCKED
      x-examples:
        example-1: UNACCEPTABLE
        example-2: ACTIVE
    KYCStatus:
      type: string
      title: KYCStatus
      enum:
        - SUCCESSFUL
        - FAILED
        - NOT_STARTED
        - IN_PROGRESS
        - EXPIRED
        - NEW
        - CANCELLED
        - MANUAL_REVIEW
        - EDD_IN_PROGRESS
    EmploymentStatus:
      type: string
      title: EmploymentStatus
      enum:
        - UNEMPLOYED
        - EMPLOYED
        - SELF_EMPLOYED
        - FREELANCER
        - STUDENT
        - FULL_TIME
        - PART_TIME
        - SOLE_PROPRIETOR
        - PENSIONER
        - COMPANY_OWNER
        - OTHER
        - NA
    PEPStatus:
      type: object
      title: PEPStatus
      properties:
        isPepHit:
          type: boolean
        pepCountry:
          $ref: '#/components/schemas/CountryCode'
        pepRank:
          $ref: '#/components/schemas/PepRank'
      required:
        - isPepHit
    PepRank:
      type: string
      description: PEP rank
      enum:
        - LEVEL_1
        - LEVEL_2
        - LEVEL_3
    SanctionsStatus:
      type: boolean
    AdverseMediaStatus:
      type: boolean
    KYCStatusDetails:
      title: KYCStatusDetails
      type: object
      properties:
        reason:
          type: string
        status:
          $ref: '#/components/schemas/KYCStatus'
    UserTagsUpdate:
      title: UserTagsUpdate
      type: object
      properties:
        userId:
          type: string
        tags:
          type: array
          items:
            $ref: '#/components/schemas/UserTag'
    UserStateDetails:
      title: UserStateDetails
      type: object
      properties:
        reason:
          type: string
        state:
          $ref: '#/components/schemas/UserState'
      required:
        - state
    WebhookUserStateDetails:
      type: object
      properties:
        reason:
          type: string
        state:
          $ref: '#/components/schemas/UserState'
        userId:
          type: string
      required:
        - state
        - userId
    WebhookKYCStatusDetails:
      type: object
      properties:
        reason:
          type: string
        status:
          $ref: '#/components/schemas/KYCStatus'
        userId:
          type: string
      required:
        - userId
    CaseStatusDetails:
      title: CaseStatusDetails
      type: object
      properties:
        caseId:
          type: string
        status:
          type: string
        reasons:
          type: array
          items:
            type: string
        reasonDescriptionForOther:
          type: string
        comment:
          type: string
        userId:
          type: string
        transactionIds:
          type: array
          items:
            type: string
    CaseOpenedDetails:
      title: CaseOpenedDetails
      type: object
      properties:
        caseId:
          type: string
        status:
          type: string
        userId:
          type: string
        transactionIds:
          type: array
          items:
            type: string
    AlertStatusDetails:
      title: AlertStatusDetails
      type: object
      properties:
        alertId:
          type: string
        status:
          type: string
        reasons:
          type: array
          items:
            type: string
        reasonDescriptionForOther:
          type: string
        comment:
          type: string
        userId:
          type: string
        transactionIds:
          type: array
          items:
            type: string
        ruleName:
          type: string
        ruleDescription:
          type: string
        ruleId:
          type: string
        ruleInstanceId:
          type: string
    AlertOpenedDetails:
      title: AlertOpenedDetails
      type: object
      properties:
        alertId:
          type: string
        status:
          type: string
        transactionIds:
          type: array
          items:
            type: string
        ruleName:
          type: string
        ruleDescription:
          type: string
        ruleId:
          type: string
        ruleInstanceId:
          type: string
        caseId:
          type: string
        userId:
          type: string
    TransactionStatusDetails:
      title: TransactionStatusDetails
      type: object
      properties:
        transactionId:
          type: string
        reasons:
          type: array
          items:
            type: string
        status:
          $ref: '#/components/schemas/RuleAction'
        comment:
          type: string
        type:
          type: string
          description: 'Type of transaction (ex: DEPOSIT, WITHDRAWAL, TRANSFER,
            EXTERNAL_PAYMENT, REFUND, OTHER)'
      required:
        - transactionId
        - status
        - reasons
    RiskLevel:
      type: string
      title: RiskLevel
      enum:
        - VERY_HIGH
        - HIGH
        - MEDIUM
        - LOW
        - VERY_LOW
    CardExpiry:
      title: CardExpiry
      type: object
      properties:
        month:
          type: number
        year:
          type: number
    POSDetails:
      title: POSDetails
      type: object
      properties:
        entryMode:
          $ref: '#/components/schemas/POSEntryMode'
    POSEntryMode:
      title: POSEntryMode
      type: string
      enum:
        - '0'
        - '1'
        - '2'
        - '3'
        - '4'
        - '5'
        - '6'
        - '7'
        - '8'
        - '9'
        - '10'
        - '79'
        - '80'
        - '81'
        - '82'
        - '85'
        - '90'
        - '91'
        - '95'
        - '97'
    WebhookEventBase:
      title: WebhookEventBase
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the event
        triggeredBy:
          type: string
          description: Event triggered by a user or system
          enum:
            - MANUAL
            - SYSTEM
        createdTimestamp:
          type: number
          description: Time at which the event was created. Measured in ms since the Unix
            epoch.
          minimum: 315529200000
          maximum: 4133890801000
        account:
          type: string
          description: Email ID associated with the event
      required:
        - id
        - triggeredBy
        - createdTimestamp
    CRARiskLevelUpdatedDetails:
      title: CRARiskLevelUpdatedDetails
      type: object
      properties:
        riskLevel:
          type: string
        userId:
          type: string
    ListUpdatedDetails:
      title: ListUpdatedDetails
      type: object
      properties:
        listId:
          type: string
        action:
          type: string
          enum:
            - SET
            - UNSET
            - CLEAR
        items:
          type: array
          items:
            $ref: '#/components/schemas/ListItem'
      required:
        - listId
        - action
        - items
    WebhookEvent:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the event
        triggeredBy:
          type: string
          description: Event triggered by a user or system
          enum:
            - MANUAL
            - SYSTEM
        createdTimestamp:
          type: number
          description: Time at which the event was created. Measured in ms since the Unix
            epoch.
          minimum: 315529200000
          maximum: 4133890801000
        account:
          type: string
          description: Email ID associated with the event
        type:
          $ref: '#/components/schemas/WebhookEventType'
        data:
          oneOf:
            - $ref: '#/components/schemas/UserStateDetails'
            - $ref: '#/components/schemas/CaseStatusDetails'
            - $ref: '#/components/schemas/CaseOpenedDetails'
            - $ref: '#/components/schemas/AlertStatusDetails'
            - $ref: '#/components/schemas/AlertOpenedDetails'
            - $ref: '#/components/schemas/TransactionStatusDetails'
            - $ref: '#/components/schemas/KYCStatusDetails'
            - $ref: '#/components/schemas/UserTagsUpdate'
            - $ref: '#/components/schemas/CRARiskLevelUpdatedDetails'
      required:
        - id
        - triggeredBy
        - createdTimestamp
        - type
        - data
    WebhookEventType:
      type: string
      title: WebhookEventType
      enum:
        - CASE_CLOSED
        - USER_STATE_UPDATED
        - ALERT_CLOSED
        - TRANSACTION_STATUS_UPDATED
        - KYC_STATUS_UPDATED
        - CASE_OPENED
        - ALERT_OPENED
        - PEP_STATUS_UPDATED
        - USER_TAGS_UPDATED
        - USER_TAGS_DELETED
        - CRA_RISK_LEVEL_UPDATED
        - LIST_UPDATED
        - SANCTIONS_STATUS_UPDATED
        - ADVERSE_MEDIA_STATUS_UPDATED
        - CASE_ESCALATED
        - ALERT_ESCALATED
    ListType:
      type: string
      enum:
        - WHITELIST
        - BLACKLIST
        - FLAGRIGHT_LIBRARY
    ListKeyMetadata:
      type: object
      title: ListKeyMetadata
      additionalProperties: {}
    ListItem:
      type: object
      title: ListItem
      properties:
        key:
          type: string
        metadata:
          $ref: '#/components/schemas/ListKeyMetadata'
        ttl:
          type: number
      required:
        - key
    ColumnType:
      title: ColumnType
      type: string
      enum:
        - STRING
        - NUMBER
        - DATE
    CustomColumn:
      title: CustomColumn
      type: object
      properties:
        key:
          type: string
        type:
          $ref: '#/components/schemas/ColumnType'
        primaryKey:
          type: boolean
      required:
        - key
        - type
    ListMetadata:
      title: ListMetadata
      type: object
      properties:
        name:
          type: string
          description: List name
        description:
          type: string
          description: List description
        status:
          type: boolean
        checksum:
          type: string
        columns:
          type: array
          items:
            $ref: '#/components/schemas/CustomColumn'
        ttl:
          type: object
          properties:
            unit:
              type: string
              enum:
                - HOUR
                - DAY
            value:
              type: number
          required:
            - unit
            - value
      additionalProperties: {}
    ListExisted:
      type: object
      x-examples:
        example-1:
          header:
            listId: worst_people
            createdTimestamp: 1661782207924
          metadata:
            name: People I hate
          values:
            - key: john
              metadata:
                fullName: John Dow
      title: ListExisted
      description: List with ID and header
      properties:
        listId:
          type: string
        header:
          $ref: '#/components/schemas/ListHeader'
        items:
          type: array
          description: List items
          items:
            $ref: '#/components/schemas/ListItem'
      required:
        - listId
        - header
        - items
    PaymentMethod:
      type: string
      title: PaymentMethod
      enum:
        - ACH
        - CARD
        - IBAN
        - UPI
        - GENERIC_BANK_ACCOUNT
        - MPESA
        - SWIFT
        - WALLET
        - CHECK
        - CASH
        - NPP
    CardMerchantDetails:
      title: CardMerchantDetails
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        category:
          type: string
        MCC:
          type: string
        city:
          type: string
        country:
          $ref: '#/components/schemas/CountryCode'
        state:
          type: string
        postCode:
          type: string
    CheckDetails:
      title: CheckDetails
      type: object
      properties:
        method:
          $ref: '#/components/schemas/CheckPaymentMethod'
        checkNumber:
          type: string
        checkIdentifier:
          type: string
        routingNumber:
          type: string
          description: Routing number of the bank
        name:
          type: string
        deliveryStatus:
          $ref: '#/components/schemas/CheckDeliveryStatus'
        etaTimestamp:
          type: number
          minimum: 315529200000
          maximum: 4133890801000
        shippingAddress:
          $ref: '#/components/schemas/Address'
        address:
          $ref: '#/components/schemas/Address'
          description: Address of the account holder
        accountNumber:
          type: string
        emailId:
          type: string
          description: Email ID of the account holder
        countryOfNationality:
          $ref: '#/components/schemas/CountryCode'
        countryOfResidence:
          $ref: '#/components/schemas/CountryCode'
        bankAddress:
          $ref: '#/components/schemas/Address'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
      required:
        - method
    CashDetails:
      title: CashDetails
      type: object
      properties:
        method:
          $ref: '#/components/schemas/CashPaymentMethod'
        identifier:
          type: string
          description: Identifier for the cash transaction
        address:
          $ref: '#/components/schemas/Address'
        name:
          type: string
        emailId:
          $ref: '#/components/schemas/EmailId'
      required:
        - method
    CountryCode:
      type: string
      title: CountryCode
      enum:
        - AF
        - AL
        - DZ
        - AS
        - AD
        - AO
        - AI
        - AQ
        - AG
        - AR
        - AM
        - AW
        - AU
        - AT
        - AZ
        - BS
        - BH
        - BD
        - BB
        - BY
        - BE
        - BZ
        - BJ
        - BM
        - BT
        - BO
        - BQ
        - BA
        - BW
        - BV
        - BR
        - IO
        - BN
        - BG
        - BF
        - BI
        - CV
        - KH
        - CM
        - CA
        - KY
        - CF
        - TD
        - CL
        - CN
        - CX
        - CC
        - CO
        - KM
        - CD
        - CG
        - CK
        - CR
        - HR
        - CU
        - CW
        - CY
        - CZ
        - CI
        - DK
        - DJ
        - DM
        - DO
        - EC
        - EG
        - SV
        - GQ
        - ER
        - EE
        - SZ
        - ET
        - FK
        - FO
        - FJ
        - FI
        - FR
        - GF
        - PF
        - TF
        - GA
        - GM
        - GE
        - DE
        - GH
        - GI
        - GR
        - GL
        - GD
        - GP
        - GU
        - GT
        - GG
        - GN
        - GW
        - GY
        - HT
        - HM
        - VA
        - HN
        - HK
        - HU
        - IS
        - IN
        - ID
        - IR
        - IQ
        - IE
        - IM
        - IL
        - IT
        - JM
        - JP
        - JE
        - JO
        - KZ
        - KE
        - KI
        - KP
        - KR
        - KW
        - KG
        - LA
        - LV
        - LB
        - LS
        - LR
        - LY
        - LI
        - LT
        - LU
        - MO
        - MG
        - MW
        - MY
        - MV
        - ML
        - MT
        - MH
        - MQ
        - MR
        - MU
        - YT
        - MX
        - FM
        - MD
        - MC
        - MN
        - ME
        - MS
        - MA
        - MZ
        - MM
        - NA
        - NR
        - NP
        - NL
        - NC
        - NZ
        - NI
        - NE
        - NG
        - NU
        - NF
        - MK
        - MP
        - NO
        - OM
        - PK
        - PW
        - PS
        - PA
        - PG
        - PY
        - PE
        - PH
        - PN
        - PL
        - PT
        - PR
        - QA
        - RO
        - RU
        - RW
        - RE
        - BL
        - SH
        - KN
        - LC
        - MF
        - PM
        - VC
        - WS
        - SM
        - ST
        - SA
        - SN
        - RS
        - SC
        - SL
        - SG
        - SX
        - SK
        - SI
        - SB
        - SO
        - ZA
        - GS
        - SS
        - ES
        - LK
        - SD
        - SR
        - SJ
        - SE
        - CH
        - SY
        - TW
        - TJ
        - TZ
        - TH
        - TL
        - TG
        - TK
        - TO
        - TT
        - TN
        - TM
        - TC
        - TV
        - TR
        - UG
        - UA
        - AE
        - GB
        - UM
        - US
        - UY
        - UZ
        - VU
        - VE
        - VN
        - VG
        - VI
        - WF
        - EH
        - YE
        - ZM
        - ZW
        - AX
        - XA
        - XB
        - XC
        - XD
        - XE
        - XF
        - XG
        - XH
        - XI
        - XJ
        - XK
        - XL
        - XM
        - XN
        - XO
        - XP
        - XQ
        - XR
        - XS
        - XT
        - XU
        - XV
        - XW
        - XY
        - XZ
        - N/A
    CurrencyCode:
      type: string
      title: CurrencyCode
      enum:
        - 1INCH
        - AAVE
        - ABT
        - ACH
        - ACS
        - ADA
        - AED
        - AERGO
        - AERO
        - AFN
        - AGLD
        - AIOZ
        - ALCX
        - ALEPH
        - ALGO
        - ALICE
        - ALL
        - AMD
        - AMP
        - ANG
        - ANKR
        - ANT
        - AOA
        - APE
        - API3
        - APT
        - ARB
        - ARPA
        - ARS
        - ASM
        - AST
        - ATA
        - ATOM
        - AUCTION
        - AUD
        - AUDIO
        - AURORA
        - AVAX
        - AVT
        - AWG
        - AXL
        - AXS
        - AZN
        - BADGER
        - BAL
        - BAM
        - BAND
        - BAT
        - BBD
        - BCH
        - BDT
        - BGN
        - BHD
        - BICO
        - BIF
        - BIGTIME
        - BIT
        - BLUR
        - BLZ
        - BMD
        - BND
        - BNT
        - BOB
        - BOBA
        - BOND
        - BONK
        - BRL
        - BSD
        - BSV
        - BTC
        - BTN
        - BTRST
        - BUSD
        - BWP
        - BYN
        - BYR
        - BZD
        - C98
        - CAD
        - CBETH
        - CDF
        - CELR
        - CGLD
        - CHF
        - CHZ
        - CLF
        - CLP
        - CLV
        - CNH
        - CNY
        - COMP
        - COP
        - COTI
        - COVAL
        - CRC
        - CRO
        - CRPT
        - CRV
        - CTSI
        - CTX
        - CUC
        - CUP
        - CVC
        - CVE
        - CVX
        - CZK
        - DAI
        - DAR
        - DASH
        - DDX
        - DESO
        - DEXT
        - DIA
        - DIMO
        - DJF
        - DKK
        - DNT
        - DOGE
        - DOP
        - DOT
        - DREP
        - DYDX
        - DYP
        - DZD
        - EEK
        - EGLD
        - EGP
        - ELA
        - ENJ
        - ENS
        - EOS
        - ERN
        - ETB
        - ETC
        - ETH
        - ETH2
        - EUR
        - EURA
        - EURC
        - EURT
        - EUROC
        - ETHFI
        - FARM
        - FET
        - FIDA
        - FIL
        - FIS
        - FJD
        - FKP
        - FLOW
        - FLR
        - FORT
        - FORTH
        - FOX
        - FX
        - FTM
        - GAL
        - GALA
        - GBP
        - GEL
        - GFI
        - GGP
        - GHS
        - GHST
        - GIP
        - GLM
        - GMD
        - GMT
        - GNF
        - GNO
        - GNT
        - GODS
        - GRT
        - GST
        - GTC
        - GTQ
        - GUSD
        - GYD
        - GYEN
        - HBAR
        - HFT
        - HIGH
        - HKD
        - HNL
        - HNT
        - HONEY
        - HOPR
        - HRK
        - HTG
        - HUF
        - ICP
        - IDEX
        - IDR
        - ILS
        - ILV
        - IMP
        - IMX
        - INDEX
        - INJ
        - INR
        - INV
        - IOTA
        - IOTX
        - ISLM
        - IQD
        - IRR
        - ISK
        - JASMY
        - JEP
        - JMD
        - JOD
        - JPY
        - JTO
        - JUP
        - KAVA
        - KEEP
        - KES
        - KGS
        - KHR
        - KLAY
        - KMF
        - KNC
        - KPW
        - KRL
        - KRW
        - KSM
        - KWD
        - KYD
        - KZT
        - LAK
        - LBP
        - LCX
        - LDO
        - LINK
        - LIT
        - LKR
        - LOKA
        - LOOM
        - LPT
        - LQTY
        - LRC
        - LRD
        - LSETH
        - LSL
        - LTC
        - LTL
        - LUNA2
        - LVL
        - LYD
        - MAD
        - MAGIC
        - MANA
        - MASK
        - MATH
        - MATIC
        - MCO2
        - MDL
        - MDT
        - MEDIA
        - METIS
        - MGA
        - MINA
        - MIR
        - MKD
        - MKR
        - MLN
        - MMK
        - MNDE
        - MNT
        - MOBILE
        - MONA
        - MOP
        - MPL
        - MRO
        - MRU
        - MSOL
        - MTL
        - MULTI
        - MUR
        - MUSE
        - MVR
        - MWK
        - MXC
        - MXN
        - MXNB
        - MXND
        - MYR
        - MZN
        - NAD
        - NCT
        - NEAR
        - NEO
        - NEST
        - NGN
        - NIO
        - NKN
        - NMR
        - NOK
        - NPC
        - NPR
        - NU
        - NZD
        - OCEAN
        - OGN
        - OMG
        - OMR
        - ONDO
        - OOKI
        - OP
        - ORCA
        - ORN
        - OSMO
        - OXT
        - PAB
        - PAX
        - PEN
        - PENGU
        - PEPE
        - PERP
        - PGK
        - PHP
        - PKR
        - PLA
        - PLN
        - PLU
        - PNG
        - POL
        - POLS
        - POLY
        - POND
        - POWR
        - PRIME
        - PRO
        - PRQ
        - PUNDIX
        - PYG
        - PYR
        - PYUSD
        - QAR
        - QI
        - QNT
        - QSP
        - QUICK
        - RAD
        - RAI
        - RARE
        - RARI
        - RBN
        - REN
        - RENDER
        - REP
        - REPV2
        - REQ
        - RGT
        - RLC
        - RLY
        - RLUSD
        - RNDR
        - RON
        - ROSE
        - RPL
        - RSD
        - RUB
        - RUNE
        - RWF
        - SAND
        - SAR
        - SBD
        - SCR
        - SDG
        - SEAM
        - SEI
        - SEK
        - SGD
        - SHIB
        - SHP
        - SHPING
        - SKK
        - SKL
        - SLL
        - SNT
        - SNX
        - SOL
        - SOS
        - SPA
        - SPELL
        - SRD
        - SSP
        - STD
        - STG
        - STORJ
        - STRK
        - STX
        - SUI
        - SUKU
        - SUPER
        - SUSHI
        - SVC
        - SWFTC
        - SYLO
        - SYN
        - SYP
        - SYRUPUSDC
        - SZL
        - T
        - THB
        - THETA
        - TIA
        - TIME
        - TJS
        - TMM
        - TMT
        - TND
        - TONE
        - TON
        - TOP
        - TRAC
        - TRB
        - TRIBE
        - TRU
        - TRUMP
        - TRY
        - TTD
        - TVK
        - TWD
        - TZS
        - UAH
        - UGX
        - UMA
        - UNFI
        - UNI
        - UPI
        - USD
        - USDG
        - USDAI
        - USDE
        - USDH
        - USDC
        - USDT
        - USYC
        - UST
        - UYU
        - UZS
        - VARA
        - VEF
        - VELO
        - VES
        - VET
        - VGX
        - VND
        - VOXEL
        - VTHO
        - VUV
        - WAMPL
        - WAVES
        - WAXL
        - WBTC
        - WCFG
        - WLUNA
        - WST
        - XAF
        - XAG
        - XAU
        - XCD
        - XCN
        - XDR
        - XLM
        - XMON
        - XOF
        - XPD
        - XPF
        - XPT
        - XRP
        - XTZ
        - XYO
        - YER
        - YFI
        - YFII
        - ZAR
        - ZEC
        - ZEN
        - ZETA
        - ZIL
        - ZMK
        - ZMW
        - ZRX
        - ZWD
        - FDUSD
        - AGX
        - AUX
        - BNB
        - CUBE
        - EMON
        - FDGT
        - KGLD
        - LODE
        - PASS
        - PREMIA
        - TAB1
        - TD-USD
        - TRX
        - TYUGA
        - VIC
        - XAI
        - SLE
        - UDI
    MCCDetails:
      title: MCCDetails
      type: object
      properties:
        code:
          type: number
          description: Merchant code
        description:
          type: string
          description: Merchant Description
      required:
        - code
    TransactionCountLimit:
      title: TransactionCountLimit
      type: object
      properties:
        day:
          type: number
        week:
          type: number
        month:
          type: number
        year:
          type: number
    TransactionAmountLimit:
      title: TransactionAmountLimit
      type: object
      properties:
        day:
          $ref: '#/components/schemas/Amount'
        week:
          $ref: '#/components/schemas/Amount'
        month:
          $ref: '#/components/schemas/Amount'
        year:
          $ref: '#/components/schemas/Amount'
    TransactionLimit:
      title: TransactionLimit
      type: object
      properties:
        transactionCountLimit:
          $ref: '#/components/schemas/TransactionCountLimit'
        transactionAmountLimit:
          $ref: '#/components/schemas/TransactionAmountLimit'
        averageTransactionAmountLimit:
          $ref: '#/components/schemas/TransactionAmountLimit'
    FalsePositiveDetails:
      title: FalsePositiveDetails
      type: object
      properties:
        isFalsePositive:
          type: boolean
        confidenceScore:
          type: number
      required:
        - isFalsePositive
        - confidenceScore
    SanctionsDetails:
      title: SanctionsDetails
      type: object
      properties:
        name:
          type: string
        searchId:
          type: string
        iban:
          type: string
        entityType:
          $ref: '#/components/schemas/SanctionsDetailsEntityType'
        sanctionHitIds:
          type: array
          items:
            type: string
        hitContext:
          $ref: '#/components/schemas/SanctionsHitContext'
        hitDirection:
          $ref: '#/components/schemas/RuleHitDirection'
      required:
        - name
        - searchId
    SanctionsHitContext:
      type: object
      title: SanctionsHitContext
      properties:
        entity:
          $ref: '#/components/schemas/SanctionsScreeningEntity'
        entityType:
          $ref: '#/components/schemas/SanctionsDetailsEntityType'
        userId:
          type: string
        transactionId:
          type: string
        ruleInstanceId:
          type: string
        ruleId:
          type: string
        iban:
          type: string
        yearOfBirth:
          type: number
        searchTerm:
          type: string
        paymentMethodId:
          type: string
      required:
        - entity
    SanctionsScreeningEntity:
      type: string
      enum:
        - USER
        - BANK
        - IBAN
        - EXTERNAL_USER
    SanctionsDetailsEntityType:
      title: SanctionsDetailsEntityType
      type: string
      enum:
        - CONSUMER_NAME
        - LEGAL_NAME
        - SHAREHOLDER
        - DIRECTOR
        - NAME_ON_CARD
        - PAYMENT_NAME
        - PAYMENT_BENEFICIARY_NAME
        - BANK_NAME
        - BANK_ACCOUNT_HOLDER_NAME
    UserEntityLink:
      title: UserEntityLink
      type: object
      properties:
        parentUserId:
          type: string
    UserWithRulesResult:
      type: object
      properties:
        userId:
          minLength: 1
          type: string
          description: Unique user ID
        createdTimestamp:
          type: number
          description: Timestamp when userId is created
          minimum: 315529200000
          maximum: 4133890801000
        activatedTimestamp:
          type: number
          description: Timestamp when user was activated
          minimum: 315529200000
          maximum: 4133890801000
        userDetails:
          $ref: '#/components/schemas/UserDetails'
        userStateDetails:
          $ref: '#/components/schemas/UserStateDetails'
        kycStatusDetails:
          $ref: '#/components/schemas/KYCStatusDetails'
        eoddDate:
          type: number
          x-fern-ignore: true
        employmentStatus:
          $ref: '#/components/schemas/EmploymentStatus'
        occupation:
          type: string
        legalDocuments:
          type: array
          description: User's legal identity documents - See Document Model for details
          items:
            $ref: '#/components/schemas/LegalDocument'
        contactDetails:
          $ref: '#/components/schemas/ContactDetails'
        employmentDetails:
          $ref: '#/components/schemas/EmploymentDetails'
        transactionLimits:
          $ref: '#/components/schemas/TransactionLimits'
        expectedIncome:
          $ref: '#/components/schemas/ExpectedIncome'
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        kycRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        acquisitionChannel:
          $ref: '#/components/schemas/AcquisitionChannel'
        reasonForAccountOpening:
          type: array
          items:
            type: string
        sourceOfFunds:
          type: array
          items:
            $ref: '#/components/schemas/SourceOfFunds'
        userSegment:
          $ref: '#/components/schemas/ConsumerUserSegment'
        pepStatus:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
        sanctionsStatus:
          $ref: '#/components/schemas/SanctionsStatus'
        adverseMediaStatus:
          $ref: '#/components/schemas/AdverseMediaStatus'
        lastTransactionTimestamp:
          type: number
          description: Timestamp of the last successful transaction of the user
          x-fern-ignore: true
        corporateEntities:
          type: array
          description: Corporate entities of the user
          items:
            $ref: '#/components/schemas/CorporateEntityDetails'
        linkedEntities:
          $ref: '#/components/schemas/UserEntityLink'
        savedPaymentDetails:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/CardDetails'
              - $ref: '#/components/schemas/GenericBankAccountDetails'
              - $ref: '#/components/schemas/IBANDetails'
              - $ref: '#/components/schemas/ACHDetails'
              - $ref: '#/components/schemas/SWIFTDetails'
              - $ref: '#/components/schemas/MpesaDetails'
              - $ref: '#/components/schemas/UPIDetails'
              - $ref: '#/components/schemas/WalletDetails'
              - $ref: '#/components/schemas/CheckDetails'
              - $ref: '#/components/schemas/CashDetails'
              - $ref: '#/components/schemas/NPPDetails'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/UserTag'
        attachments:
          type: array
          description: Uploaded user's attachment
          items:
            $ref: '#/components/schemas/PersonAttachment'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        productsEnabled:
          type: array
          items:
            $ref: '#/components/schemas/ProductsEnabled'
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
      required:
        - userId
        - createdTimestamp
    UserRiskScoreDetails:
      title: UserRiskScoreDetails
      type: object
      properties:
        kycRiskScore:
          type: number
        craRiskScore:
          type: number
        kycRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        craRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
    BusinessWithRulesResult:
      type: object
      properties:
        userId:
          minLength: 1
          type: string
          description: Unique user ID for the user
        createdTimestamp:
          type: number
          description: Timestamp when the user was created
          minimum: 315529200000
          maximum: 4133890801000
        legalEntity:
          $ref: '#/components/schemas/LegalEntity'
        activatedTimestamp:
          type: number
          description: Timestamp when the user was activated
          minimum: 315529200000
          maximum: 4133890801000
        userStateDetails:
          $ref: '#/components/schemas/UserStateDetails'
        kycStatusDetails:
          $ref: '#/components/schemas/KYCStatusDetails'
        corporateEntities:
          type: array
          description: Corporate entities of the user
          items:
            $ref: '#/components/schemas/CorporateEntityDetails'
        shareHolders:
          type: array
          description: Shareholders (beneficiaries) of the company that hold at least 25%
            ownership. Can be another company or an individual
          items:
            oneOf:
              - $ref: '#/components/schemas/Person'
              - $ref: '#/components/schemas/LegalEntity'
        directors:
          type: array
          description: Director(s) of the company. Must be at least one
          items:
            $ref: '#/components/schemas/Person'
        transactionLimits:
          $ref: '#/components/schemas/TransactionLimits'
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        kycRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        allowedPaymentMethods:
          type: array
          items:
            $ref: '#/components/schemas/PaymentMethod'
        lastTransactionTimestamp:
          type: number
          description: Timestamp of the last successful transaction of the user
          x-fern-ignore: true
        linkedEntities:
          $ref: '#/components/schemas/UserEntityLink'
        acquisitionChannel:
          $ref: '#/components/schemas/AcquisitionChannel'
        savedPaymentDetails:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/CardDetails'
              - $ref: '#/components/schemas/GenericBankAccountDetails'
              - $ref: '#/components/schemas/IBANDetails'
              - $ref: '#/components/schemas/ACHDetails'
              - $ref: '#/components/schemas/SWIFTDetails'
              - $ref: '#/components/schemas/MpesaDetails'
              - $ref: '#/components/schemas/UPIDetails'
              - $ref: '#/components/schemas/WalletDetails'
              - $ref: '#/components/schemas/CheckDetails'
              - $ref: '#/components/schemas/CashDetails'
              - $ref: '#/components/schemas/NPPDetails'
        mccDetails:
          $ref: '#/components/schemas/MCCDetails'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/UserTag'
        attachments:
          type: array
          description: User's attachments uploaded by business user
          items:
            $ref: '#/components/schemas/PersonAttachment'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        productsEnabled:
          type: array
          items:
            $ref: '#/components/schemas/ProductsEnabled'
        pepStatus:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
        sanctionsStatus:
          type: boolean
          description: Whether the user is sanctioned
        adverseMediaStatus:
          type: boolean
          description: Whether the user is in the adverse media list
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
      required:
        - userId
        - createdTimestamp
        - legalEntity
    BooleanString:
      title: Boolean string value
      type: string
      enum:
        - 'true'
        - 'false'
    Gender:
      title: Gender
      description: Gender of the individual - Male, Female or Non-Binary
      type: string
      enum:
        - M
        - F
        - NB
    MaritalStatus:
      title: MaritalStatus
      description: Marital status of the individual
      type: string
      enum:
        - DIVORCED
        - MARRIED
        - SINGLE
        - WIDOWED
        - NA
    CardBrand:
      title: CardBrand
      description: Brand of Card
      type: string
      enum:
        - VISA
        - MASTERCARD
        - AMERICAN_EXPRESS
        - DISCOVER
        - UNIONPAY
        - RUPAY
        - JCB
    CardFunding:
      title: CardFunding
      description: Funding of Card
      type: string
      enum:
        - CREDIT
        - DEBIT
        - PREPAID
    BatchResponseStatus:
      title: BatchResponseStatus
      description: Status of the batch response
      type: string
      enum:
        - SUCCESS
        - PARTIAL_FAILURE
        - FAILURE
    BatchResponseFailedRecord:
      title: BatchResponseFailedRecord
      description: Failed record in a batch response
      type: object
      properties:
        id:
          type: string
        reasonCode:
          type: string
    BatchResponse:
      title: BatchResponse
      description: Response from creation of a batch
      type: object
      properties:
        status:
          $ref: '#/components/schemas/BatchResponseStatus'
        batchId:
          type: string
        successful:
          type: number
        failed:
          type: number
        failedRecords:
          type: array
          items:
            $ref: '#/components/schemas/BatchResponseFailedRecord'
        message:
          type: string
      required:
        - status
        - batchId
        - successful
        - failed
    ConsumerUserEventBatchRequest:
      title: ConsumerUserEventBatchRequest
      description: Batch request to create consumer users
      type: object
      properties:
        batchId:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/ConsumerUserEvent'
      required:
        - data
    BusinessUserEventBatchRequest:
      title: BusinessUserEventBatchRequest
      description: Batch request to create business users
      type: object
      properties:
        batchId:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/BusinessUserEvent'
      required:
        - data
    TransactionBatchRequest:
      title: TransactionBatchRequest
      description: Batch request to create transactions
      type: object
      properties:
        batchId:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/Transaction'
      required:
        - data
    TransactionEventBatchRequest:
      title: TransactionEventBatchRequest
      description: Batch request to create transaction events
      type: object
      properties:
        batchId:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/TransactionEvent'
      required:
        - data
    UserBatchRequest:
      title: UserBatchRequest
      description: Batch request to create consumer users
      type: object
      properties:
        batchId:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/User'
      required:
        - data
    BusinessBatchRequest:
      title: BusinessBatchRequest
      description: Batch request to create business users
      type: object
      properties:
        batchId:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/Business'
      required:
        - data
    CardType:
      title: CardType
      description: Type of card
      type: string
      enum:
        - VIRTUAL
        - PHYSICAL
    PlaceOfBirth:
      title: PlaceOfBirth
      description: Place of birth of the individual
      type: object
      properties:
        city:
          type: string
        state:
          type: string
        country:
          $ref: '#/components/schemas/CountryCode'
      required:
        - country
    MpesaTransactionType:
      title: MpesaTransactionType
      description: Type of transaction
      type: string
      enum:
        - CustomerPayBillOnline
        - CustomerBuyGoodsOnline
        - SalaryPayment
        - BusinessPayment
        - PromotionPayment
    CheckDeliveryStatus:
      title: CheckDeliveryStatus
      type: string
      enum:
        - COMPLETED
        - PENDING
        - SETTLED
        - CANCELED
        - REFUND
        - DECLINED
    ApiErrorResponse:
      title: ApiErrorResponse
      type: object
      properties:
        message:
          type: string
        validationErrors:
          type: string
      required:
        - message
    FilterCondition:
      title: FilterCondition
      description: A single filter condition
      type: object
      properties:
        permissionId:
          type: string
          description: The ID of the permission being filtered (e.g., case-status)
        operator:
          type: string
          description: The operator to apply (e.g., Equals, NotEquals)
          enum:
            - Equals
            - NotEquals
            - In
            - NotIn
            - Contains
            - Range
            - Pattern
        param:
          type: string
          description: The query parameter name (e.g., filterCaseStatus)
        values:
          type: array
          description: The values to filter by
          items:
            type: string
      required:
        - permissionId
        - operator
        - param
        - values
      example:
        permissionId: case-status
        operator: Equals
        param: filterCaseStatus
        values:
          - OPEN
          - CLOSED
    FilterConditions:
      title: FilterConditions
      description: A list of filter conditions to apply
      type: array
      items:
        $ref: '#/components/schemas/FilterCondition'
      example:
        - permissionId: case-status
          operator: Equals
          param: filterCaseStatus
          values:
            - OPEN
            - CLOSED
        - permissionId: alert-status
          operator: In
          param: filterAlertStatus
          values:
            - OPEN
            - ESCALATED
    FilterDefinition:
      title: FilterDefinition
      description: Defines how a permission node can be filtered, including the type
        of filter, parameter name, and allowed operators.
      type: object
      properties:
        type:
          type: string
          description: The type of filter to apply
          enum:
            - enum
            - range
            - dateRange
            - pattern
            - array
        param:
          type: string
          description: The query parameter name to use for this filter (e.g.,
            filterCaseStatus)
        operator:
          type: string
          description: List of operators allowed for this filter type
          enum:
            - Equals
            - NotEquals
            - In
            - NotIn
            - Contains
            - Range
            - Pattern
        allowedValues:
          type: array
          description: List of allowed values for enum filters
          items:
            type: string
        validation:
          type: object
          description: Optional validation rules for the filter values
          properties:
            minValue:
              type: number
              description: Minimum allowed value for range filters
            maxValue:
              type: number
              description: Maximum allowed value for range filters
            minDate:
              type: string
              format: date-time
              description: Minimum allowed date for dateRange filters
            maxDate:
              type: string
              format: date-time
              description: Maximum allowed date for dateRange filters
            pattern:
              type: string
              description: Regex pattern for pattern filters
            allowedValues:
              type: array
              description: List of allowed values for enum filters
              items:
                type: string
      required:
        - type
        - param
    CustomListMetadataList:
      title: CustomListMetadataList
      type: object
      properties:
        listId:
          type: string
        items:
          type: array
          items:
            $ref: '#/components/schemas/CustomColumn'
      required:
        - listId
        - items
    ManualRiskAssignmentPayload:
      title: ManualRiskAssignmentPayload
      type: object
      properties:
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        isUpdatable:
          type: boolean
        releaseAt:
          type: number
          description: Timestamp (Unix epoch ms) when CRA lock should expire (only used
            when isUpdatable is false)
        comment:
          type: string
          description: Optional comment/reason for the risk assignment or lock change
    DynamoDbClickhouseBackfillBatchJobEntity:
      title: DynamoDbClickhouseBackfillBatchJobEntity
      type: string
      enum:
        - ALERTS_QA_SAMPLING
        - COUNTERS
        - NOTIFICATIONS
        - GPT_REQUEST_LOGS
        - API_REQUEST_LOGS
        - AUDIT_LOG
        - METRICS
        - BATCH_JOBS
        - CASES
        - WEBHOOK_CONFIGURATION
        - WEBHOOK_DELIVERY
    FlatFileSchema:
      title: FlatFileSchema
      type: string
      enum:
        - BULK_CASE_CLOSURE
        - CUSTOM_LIST_UPLOAD
        - RULE_INSTANCES_IMPORT
        - RISK_FACTORS_IMPORT
        - CONSUMER_USERS_UPLOAD
        - BUSINESS_USERS_UPLOAD
        - TRANSACTIONS_UPLOAD
        - BULK_ALERT_CLOSURE
        - BULK_SANCTIONS_HITS_UPDATE
        - BULK_MANUAL_SCREENING
    FlatFileProgressResponse:
      title: FlatFileProgressResponse
      type: object
      properties:
        saved:
          type: number
        errored:
          type: number
        total:
          type: number
        processed:
          type: number
        status:
          $ref: '#/components/schemas/TaskStatusChangeStatusEnum'
        isValidationJobFound:
          type: boolean
        isValidationJobRunning:
          type: boolean
        erroredRecordsFileUrl:
          type: string
    FlatFileTemplateFormat:
      title: FlatFileTemplateFormat
      type: string
      enum:
        - CSV
        - JSONL
    FlatFileTemplateRequest:
      title: FlatFileTemplateRequest
      type: object
      properties:
        schema:
          $ref: '#/components/schemas/FlatFileSchema'
        format:
          $ref: '#/components/schemas/FlatFileTemplateFormat'
        metadata:
          oneOf:
            - $ref: '#/components/schemas/CustomListMetadataList'
      required:
        - schema
        - format
    RotateApiKeyRequest:
      title: RotateApiKeyRequest
      type: object
      properties:
        apiKeyId:
          type: string
      required:
        - apiKeyId
    FlatFileTemplateResponse:
      title: FlatFileTemplateResponse
      type: object
      properties:
        keys:
          type: array
          items:
            type: string
        fileString:
          type: string
      required:
        - keys
        - formatString
    IntercommTokenResponse:
      title: IntercommTokenResponse
      type: object
      properties:
        token:
          type: string
      required:
        - token
    CaseClosure:
      title: CaseClosure
      type: object
      properties:
        caseId:
          type: string
        reason:
          type: string
        otherReason:
          type: string
        comment:
          type: string
      required:
        - caseId
        - reason
        - comment
    AlertClosure:
      title: AlertClosure
      type: object
      properties:
        alertId:
          type: string
        reason:
          type: string
        otherReason:
          type: string
        comment:
          type: string
      required:
        - alertId
        - reason
        - comment
    SanctionsHitUpdate:
      title: SanctionsHitUpdate
      type: object
      properties:
        sanctionsHitId:
          type: string
        reason:
          $ref: '#/components/schemas/SanctionsHitReasons'
        otherReason:
          type: string
        comment:
          type: string
        whitelistHits:
          type: boolean
        alertId:
          type: string
        sanctionsHitStatus:
          $ref: '#/components/schemas/SanctionsHitStatus'
        removeHitsFromWhitelist:
          type: boolean
      required:
        - sanctionsHitId
        - reason
        - comment
        - alertId
        - sanctionsHitStatus
    QuestionAutocompleteResponse:
      title: QuestionAutocompleteResponse
      type: object
      properties:
        suggestions:
          type: array
          items:
            type: string
    QuestionVariable:
      type: object
      properties:
        name:
          type: string
        value:
          $ref: '#/components/schemas/AnyValue'
      required:
        - name
        - value
    TenantData:
      type: object
      properties:
        tenantId:
          type: string
        tenantName:
          type: string
    AnyValue: {}
    QuestionRequest:
      title: QuestionRequest
      type: object
      properties:
        question:
          type: string
        variables:
          type: array
          items:
            $ref: '#/components/schemas/QuestionVariable'
        createdAt:
          type: number
    GetQuestionsResponse:
      title: GetQuestionsResponse
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/QuestionResponse'
    QuestionResponse:
      title: QuestionResponse
      type: object
      properties:
        questionId:
          type: string
        title:
          type: string
        explained:
          type: string
        summary:
          type: string
        questionType:
          type: string
        createdAt:
          type: number
        createdById:
          type: string
        variableOptions:
          type: array
          items:
            $ref: '#/components/schemas/QuestionVariableOption'
        variables:
          type: array
          items:
            $ref: '#/components/schemas/QuestionVariable'
      required:
        - questionId
        - title
        - questionType
        - createdAt
        - createdById
        - variableOptions
      oneOf:
        - $ref: '#/components/schemas/Table'
        - $ref: '#/components/schemas/Timeseries'
        - $ref: '#/components/schemas/StackedBarchart'
        - $ref: '#/components/schemas/Barchart'
        - $ref: '#/components/schemas/Properties'
        - $ref: '#/components/schemas/SanctionsHitComparison'
    QuestionVariableOption:
      title: QuestionVariableOption
      type: object
      properties:
        name:
          type: string
        options:
          type: array
          items:
            type: string
        value:
          type: array
          items:
            type: object
            properties:
              label:
                type: string
              value:
                type: string
            required:
              - label
              - value
        variableType:
          type: string
          enum:
            - DATE
            - DATETIME
            - STRING
            - INTEGER
            - FLOAT
            - BOOLEAN
            - AUTOCOMPLETE
            - SEARCH
            - SCREENING_DETAIL_FILTER
    SlackWebhookEvent:
      title: SlackWebhookEvent
      type: object
      properties:
        token:
          type: string
        challenge:
          type: string
        type:
          type: string
        event:
          type: object
        event_id:
          type: string
        event_time:
          type: integer
        team_id:
          type: string
        api_app_id:
          type: string
        authed_users:
          type: object
    SlackWebhookEventResponse:
      title: SlackWebhookEventResponse
      type: object
      properties:
        challenge:
          type: string
    TableHeaders:
      title: TableHeaders
      type: object
      properties:
        name:
          type: string
        columnType:
          type: string
          enum:
            - STRING
            - NUMBER
            - FLOAT
            - LONG_TEXT
            - BOOLEAN
            - ID
            - TRANSACTION_TYPE
            - DATE_TIME
            - PAYMENT_METHOD
            - TAG
            - MONEY_AMOUNT
            - MONEY_CURRENCY
            - COUNTRY
            - MERCHANT_NAME
            - MODAL
        columnWidth:
          type: number
        columnId:
          type: string
        sortable:
          type: boolean
      required:
        - name
        - columnType
    Table:
      title: Table
      type: object
      properties:
        headers:
          type: array
          items:
            $ref: '#/components/schemas/TableHeaders'
        total:
          type: number
        transactionsCount:
          type: number
        rows:
          type: array
          items:
            type: array
            items:
              type: object
              properties:
                value:
                  type: string
    Timeseries:
      title: Timeseries
      type: object
      properties:
        timeseries:
          type: array
          items:
            type: object
            properties:
              label:
                type: string
              values:
                type: array
                items:
                  type: object
                  properties:
                    time:
                      type: number
                    value:
                      type: number
    StackedBarchart:
      title: StackedBarchart
      type: object
      properties:
        series:
          type: array
          items:
            type: object
            properties:
              label:
                type: string
              values:
                type: array
                items:
                  type: object
                  properties:
                    x:
                      type: string
                    y:
                      type: number
    SanctionsHitComparison:
      title: SanctionsHitComparison
      type: object
      properties:
        sanctionsHit:
          $ref: '#/components/schemas/SanctionsHit'
    Barchart:
      title: Barchart
      type: object
      properties:
        values:
          type: array
          items:
            type: object
            properties:
              x:
                type: string
              y:
                type: number
    Properties:
      title: Properties
      type: object
      properties:
        properties:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
              value:
                type: string
    KrsScore:
      title: KrsScore
      type: object
      description: ''
      properties:
        createdAt:
          type: number
        krsScore:
          type: number
        userId:
          type: string
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        components:
          type: array
          items:
            $ref: '#/components/schemas/RiskScoreComponent'
        factorScoreDetails:
          type: array
          items:
            $ref: '#/components/schemas/RiskFactorScoreDetails'
        manualRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        isLocked:
          type: boolean
        updateCount:
          type: number
      required:
        - createdAt
        - krsScore
    ArsScore:
      title: ArsScore
      type: object
      description: ''
      properties:
        createdAt:
          type: number
        arsScore:
          type: number
        originUserId:
          type: string
        destinationUserId:
          type: string
        transactionId:
          type: string
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        components:
          type: array
          items:
            $ref: '#/components/schemas/RiskScoreComponent'
        factorScoreDetails:
          type: array
          items:
            $ref: '#/components/schemas/RiskFactorScoreDetails'
        updateCount:
          type: number
      required:
        - createdAt
        - arsScore
    DrsScore:
      title: DrsScore
      type: object
      description: ''
      properties:
        createdAt:
          type: number
        drsScore:
          type: number
        userId:
          type: string
        transactionId:
          type: string
        derivedRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        manualRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        isUpdatable:
          type: boolean
        components:
          type: array
          items:
            $ref: '#/components/schemas/RiskScoreComponent'
        factorScoreDetails:
          type: array
          items:
            $ref: '#/components/schemas/RiskFactorScoreDetails'
        triggeredBy:
          type: string
          enum:
            - CONSOLE
            - BATCH
            - PUBLIC_API
        prevDrsScore:
          type: number
        updateCount:
          type: number
        lockedAt:
          type: number
          description: Timestamp when CRA was locked
        lockExpiresAt:
          type: number
          description: Timestamp when CRA lock will automatically expire
      required:
        - createdAt
        - drsScore
        - isUpdatable
    LogicConfigResponse:
      title: LogicConfigResponse
      type: object
      properties:
        logicConfig:
          $ref: '#/components/schemas/LogicConfig'
    RuleMLModel:
      title: RuleMLModel
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        modelType:
          type: string
          enum:
            - EXPLAINABLE
            - NON_EXPLAINABLE
        checksFor:
          type: array
          items:
            type: string
        enabled:
          type: boolean
      required:
        - id
        - name
        - description
    LogicConfig:
      title: LogicConfig
      type: object
      properties:
        variables:
          type: array
          items:
            $ref: '#/components/schemas/LogicEntityVariable'
        operators:
          type: array
          items:
            $ref: '#/components/schemas/LogicOperator'
        functions:
          type: array
          items:
            $ref: '#/components/schemas/LogicFunction'
      required:
        - variables
        - operators
        - functions
    LogicEntityVariable:
      title: LogicEntityVariable
      type: object
      properties:
        key:
          type: string
        uiDefinition:
          type: object
        entity:
          type: string
          enum:
            - TRANSACTION
            - TRANSACTION_EVENT
            - USER
            - CONSUMER_USER
            - BUSINESS_USER
            - PAYMENT_DETAILS
        valueType:
          type: string
          enum:
            - string
            - number
            - boolean
            - date
            - array
        tenantIds:
          type: array
          items:
            type: string
        requiredFeatures:
          type: array
          items:
            $ref: '#/components/schemas/Feature'
      required:
        - key
        - uiDefinition
    LogicOperator:
      title: LogicOperator
      type: object
      properties:
        key:
          $ref: '#/components/schemas/LogicOperatorType'
        uiDefinition:
          type: object
        parameters:
          type: array
          items:
            type: object
      required:
        - key
        - uiDefinition
    LogicOperatorType:
      title: LogicOperatorType
      type: string
      enum:
        - op:inlist
        - op:!inlist
        - op:contains
        - op:!contains
        - op:startswith
        - op:endswith
        - op:similarto
        - op:!similarto
        - op:similartowords
        - op:!similartowords
        - op:between_time
        - op:!between_time
        - op:regexmatch
        - op:!regexmatch
        - op:time_difference_greater_than
        - op:time_difference_lesser_than
        - op:contains_in_lists
        - op:!contains_in_lists
        - op:similar_to_in_lists
        - op:!similar_to_in_lists
        - op:contains_in_lists_subtype
    LogicFunction:
      title: LogicFunction
      type: object
      properties:
        key:
          type: object
        uiDefinition:
          type: object
        group:
          $ref: '#/components/schemas/LogicFunctionGroup'
      required:
        - key
        - uiDefinition
        - group
    LogicFunctionGroup:
      title: LogicFunctionGroup
      type: string
      enum:
        - datetime
        - number
        - string
    LogicEntityVariableInUse:
      title: LogicEntityVariableInUse
      type: object
      properties:
        key:
          type: string
          description: Unique variable key (uuid). We can create multiple variables for
            the same entity with different filters
        entityKey:
          type: string
          description: Entity variable key (e.g TRANSACTION:type)
        name:
          type: string
        filtersLogic:
          type: object
      required:
        - key
        - entityKey
    LogicAggregationType:
      title: LogicAggregationType
      type: string
      enum:
        - USER_TRANSACTIONS
        - PAYMENT_DETAILS_TRANSACTIONS
        - USER_DETAILS
        - PAYMENT_DETAILS_ADDRESS
        - PAYMENT_DETAILS_NAME
        - PAYMENT_DETAILS_EMAIL
    LogicAggregationTransactionDirection:
      title: LogicAggregationTransactionDirection
      type: string
      enum:
        - SENDING
        - RECEIVING
        - SENDING_RECEIVING
    LogicAggregationUserDirection:
      title: LogicAggregationUserDirection
      type: string
      enum:
        - SENDER
        - RECEIVER
        - SENDER_OR_RECEIVER
    LogicAggregationFunc:
      title: LogicAggregationFunc
      type: string
      enum:
        - SUM
        - COUNT
        - AVG
        - UNIQUE_COUNT
        - UNIQUE_VALUES
        - MIN
        - MAX
        - STDEV
        - CHANGE_COUNT
    LogicAggregationVariable:
      title: AggregationVariable
      type: object
      properties:
        key:
          type: string
        name:
          type: string
        type:
          $ref: '#/components/schemas/LogicAggregationType'
        userDirection:
          $ref: '#/components/schemas/LogicAggregationUserDirection'
        transactionDirection:
          $ref: '#/components/schemas/LogicAggregationTransactionDirection'
        aggregationFieldKey:
          type: string
        secondaryAggregationFieldKey:
          type: string
        aggregationFunc:
          $ref: '#/components/schemas/LogicAggregationFunc'
        aggregationGroupByFieldKey:
          type: string
        aggregationFilterFieldKey:
          type: string
        aggregationFilterFieldValue:
          type: string
        baseCurrency:
          oneOf:
            - $ref: '#/components/schemas/CurrencyCode'
            - type: string
              enum:
                - ORIGINAL_CURRENCY
        timeWindow:
          type: object
          properties:
            start:
              $ref: '#/components/schemas/LogicAggregationTimeWindow'
            end:
              $ref: '#/components/schemas/LogicAggregationTimeWindow'
          required:
            - start
            - end
        filtersLogic:
          type: object
        version:
          type: number
        lastNEntities:
          type: number
        useEventTimestamp:
          type: boolean
        includeCurrentEntity:
          type: boolean
      required:
        - key
        - type
        - aggregationFieldKey
        - aggregationFunc
        - timeWindow
    UsedAggregationVariable:
      title: UsedAggregationVariable
      type: object
      properties:
        aggVarHash:
          type: string
        version:
          type: number
        usedEntityIds:
          type: array
          items:
            type: string
      required:
        - aggVarHash
        - version
    RuleMachineLearningVariable:
      title: MachineLearningVariable
      type: object
      properties:
        key:
          type: string
        name:
          type: string
        valueType:
          type: string
          enum:
            - number
      required:
        - key
    LogicAggregationTimeWindowGranularity:
      title: LogicAggregationTimeWindowGranularity
      type: string
      enum:
        - all_time
        - now
        - second
        - minute
        - hour
        - day
        - week
        - month
        - year
        - fiscal_year
    LogicAggregationTimeWindow:
      title: LogicAggregationTimeWindow
      type: object
      properties:
        units:
          type: number
        granularity:
          $ref: '#/components/schemas/LogicAggregationTimeWindowGranularity'
        rollingBasis:
          type: boolean
        fiscalYear:
          type: object
          properties:
            startDay:
              type: number
            startMonth:
              type: number
          required:
            - startDay
            - startMonth
      required:
        - units
        - granularity
    ImportConsoleDataRequest:
      title: ImportRulesRequest
      type: object
      properties:
        file:
          $ref: '#/components/schemas/FileInfo'
      required:
        - file
    RuleFilters:
      title: RuleFilter
      type: object
      properties:
        schema:
          type: object
          properties:
            properties:
              type: object
            type:
              type: string
            ui:schema:
              type: object
          required:
            - properties
            - type
        defaultValues:
          type: object
      required:
        - schema
    ScreeningDetails:
      title: ScreeningDetails
      type: object
      properties:
        pepStatus:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
        sanctionsStatus:
          $ref: '#/components/schemas/SanctionsStatus'
        adverseMediaStatus:
          $ref: '#/components/schemas/AdverseMediaStatus'
    KYCAndUserStatusChangeReason:
      title: KYCAndUserStatusChangeReason
      type: string
      enum:
        - Fake document
        - Blurry document
        - Suspected fraud
        - Adverse media
        - PEP
        - Sanctions hit
        - Risky profile
        - High risk country
        - Other
    DefaultAlertStatusForCaseCreation:
      title: DefaultAlertStatusForCaseCreation
      type: string
      enum:
        - OPEN
        - OPEN_ON_HOLD
        - CLOSED
        - OPEN_IN_PROGRESS
    ScreeningAlertCreationLogic:
      title: ScreeningAlertCreationLogic
      type: string
      enum:
        - PER_SEARCH_ALERT
        - SINGLE_ALERT
    AlertCreationLogic:
      title: AlertCreationLogic
      type: string
      enum:
        - PER_COUNTERPARTY_ALERT
        - SINGLE_ALERT
    UserRuleRunCondition:
      title: UserRuleRunCondition
      type: object
      properties:
        entityUpdated:
          type: boolean
        schedule:
          type: object
          properties:
            value:
              type: number
            unit:
              $ref: '#/components/schemas/UserRuleScheduleUnit'
          required:
            - value
            - unit
      required:
        - entityUpdated
    UserRuleScheduleUnit:
      title: UserRuleScheduleUnit
      type: string
      enum:
        - DAY
        - WEEK
        - MONTH
        - YEAR
    UserRuleStage:
      title: UserRuleStage
      type: string
      enum:
        - INITIAL
        - UPDATE
        - ONGOING
    TransactionRuleStage:
      title: TransactionRuleStage
      type: string
      enum:
        - INITIAL
        - UPDATE
    RuleInstanceStatus:
      title: RuleInstanceStatus
      type: string
      enum:
        - ACTIVE
        - INACTIVE
        - DEPLOYING
    RuleMode:
      title: RuleMode
      type: string
      enum:
        - LIVE_SYNC
        - SHADOW_SYNC
        - LIVE_ASYNC
        - SHADOW_ASYNC
    RuleRunMode:
      title: RuleRunMode
      type: string
      enum:
        - LIVE
        - SHADOW
    RuleExecutionMode:
      title: RuleExecutionMode
      type: string
      enum:
        - SYNC
        - ASYNC
    NewIdResponse:
      title: NewIdResponse
      type: object
      properties:
        id:
          type: string
    AlertCreationDirection:
      type: string
      title: AlertCreationDirection
      enum:
        - ORIGIN
        - DESTINATION
        - ALL
        - AUTO
        - AUTO_ORIGIN
        - AUTO_DESTINATION
    ExtraTransactionStatus:
      title: ExtraTransactionStatus
      type: string
      enum:
        - ALLOW_MANUAL
        - BLOCK_MANUAL
    TransactionStateAlias:
      type: object
      title: TransactionStateAlias
      properties:
        state:
          $ref: '#/components/schemas/TransactionState'
        alias:
          type: string
      required:
        - state
        - alias
    UserStateAlias:
      type: object
      title: UserStateAlias
      properties:
        state:
          $ref: '#/components/schemas/UserState'
        alias:
          type: string
      required:
        - state
        - alias
    KYCStatusAlias:
      type: object
      title: KYCStatusAlias
      properties:
        state:
          $ref: '#/components/schemas/KYCStatus'
        alias:
          type: string
      required:
        - state
        - alias
    RiskLevelAlias:
      type: object
      title: RiskLevelAlias
      properties:
        level:
          $ref: '#/components/schemas/RiskLevel'
        alias:
          type: string
        isActive:
          type: boolean
      required:
        - level
        - alias
        - isActive
    TenantUsageData:
      title: TenantUsageData
      type: object
      properties:
        burstCapacityInRps:
          type: number
        rateLimitInRps:
          type: number
        quotaLimit:
          type: string
        quotaLeft:
          type: string
        quotaRenewalRate:
          type: string
      required:
        - burstCapacityInRps
        - rateLimitInRps
        - quotaLimit
        - quotaLeft
        - quotaRenewalRate
    TransactionsResponse:
      title: TransactionsResponse
      type: object
      description: ''
      properties:
        hasPrev:
          type: boolean
        prev:
          type: string
        next:
          type: string
        count:
          type: number
        limit:
          type: number
        last:
          type: string
        hasNext:
          type: boolean
        items:
          type: array
          items:
            $ref: '#/components/schemas/TransactionTableItem'
      required:
        - prev
        - next
        - last
        - count
        - limit
        - items
        - hasNext
        - hasPrev
    TransactionsEventResponse:
      title: TransactionsEventResponse
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/InternalTransactionEvent'
        count:
          type: number
      required:
        - items
        - count
    TransactionsResponseOffsetPaginated:
      title: TransactionsResponseOffsetPaginated
      type: object
      description: ''
      properties:
        count:
          type: number
        items:
          type: array
          items:
            $ref: '#/components/schemas/TransactionTableItem'
      required:
        - count
        - items
    TransactionEventsResponse:
      title: TransactionEventsResponse
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/InternalTransactionEvent'
        total:
          type: number
      required:
        - items
        - total
    TenantApiKey:
      title: TenantApiKey
      type: object
      properties:
        id:
          type: string
        key:
          type: string
        createdAt:
          type: number
        updatedAt:
          type: number
        deactivationTimestamp:
          type: number
        enabled:
          type: boolean
      required:
        - id
        - key
        - createdAt
        - updatedAt
        - enabled
    CrmSummary:
      title: CrmSummary
      type: object
      properties:
        accountId:
          type: string
        summary:
          type: string
        sentiment:
          type: number
        good:
          type: string
        bad:
          type: string
        neutral:
          type: string
      required:
        - accountId
        - summary
        - sentiment
        - good
        - bad
        - neutral
    Graph:
      title: Graph
      type: object
      properties:
        nodes:
          type: array
          items:
            type: object
            required:
              - id
              - label
            properties:
              id:
                type: string
              label:
                type: string
        edges:
          type: array
          items:
            type: object
            required:
              - id
              - source
              - target
            properties:
              id:
                type: string
              source:
                type: string
              target:
                type: string
              label:
                type: string
              size:
                type: number
    CrmAccountResponse:
      title: CrmAccountResponse
      type: object
      required:
        - summary
        - tasks
        - notes
        - engagements
      properties:
        summary:
          $ref: '#/components/schemas/CrmSummary'
        tasks:
          type: array
          items:
            type: object
            properties:
              content:
                type: string
              user:
                type: string
              createdAt:
                type: number
            required:
              - content
              - user
        notes:
          type: array
          items:
            type: object
            properties:
              user:
                type: string
              body:
                type: string
              createdAt:
                type: number
            required:
              - user
              - body
              - createdAt
        engagements:
          type: array
          items:
            type: object
            properties:
              subject:
                type: string
              content:
                type: string
              user:
                type: string
              createdAt:
                type: number
              to:
                type: array
                items:
                  type: string
            required:
              - subject
              - content
              - user
    TransactionsStatsByTypesResponse:
      title: TransactionsStatsByTypesResponse
      type: object
      description: ''
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              transactionType:
                type: string
              count:
                type: number
              sum:
                type: number
                nullable: true
              average:
                type: number
                nullable: true
              min:
                type: number
                nullable: true
              max:
                type: number
                nullable: true
              median:
                type: number
            required:
              - count
              - sum
              - average
              - min
              - max
              - median
      required:
        - data
    TransactionsStatsByTimeResponse:
      title: TransactionsStatsByTimeResponse
      type: object
      description: ''
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              series:
                type: string
              label:
                type: string
              values:
                type: object
                additionalProperties:
                  type: object
                  properties:
                    count:
                      type: number
                    amount:
                      type: number
                  required:
                    - count
                    - amount
            required:
              - series
              - label
              - values
      required:
        - data
    InternalTransactionEvent:
      type: object
      properties:
        transactionState:
          $ref: '#/components/schemas/TransactionState'
        timestamp:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        transactionId:
          type: string
          minLength: 1
          description: Transaction ID the event pertains to
        eventId:
          type: string
          description: Unique event ID
        reason:
          type: string
          description: Reason for the event or a state change
        eventDescription:
          type: string
          description: Event description
        updatedTransactionAttributes:
          $ref: '#/components/schemas/TransactionUpdatable'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        updateCount:
          x-fern-ignore: true
          type: number
        createdAt:
          type: number
        riskScoreDetails:
          $ref: '#/components/schemas/TransactionRiskScoringResult'
      required:
        - transactionState
        - timestamp
        - transactionId
    InternalConsumerUserEvent:
      type: object
      properties:
        timestamp:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        userId:
          type: string
          minLength: 1
          description: Transaction ID the event pertains to
        eventId:
          type: string
          description: Unique event ID
        reason:
          type: string
          description: Reason for the event or a state change
        eventDescription:
          type: string
          description: Event description
        updatedConsumerUserAttributes:
          $ref: '#/components/schemas/UserOptional'
        updateCount:
          x-fern-ignore: true
          type: number
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
        createdAt:
          type: number
        isKrsLocked:
          type: boolean
      required:
        - timestamp
        - userId
    InternalBusinessUserEvent:
      type: object
      properties:
        timestamp:
          type: number
          description: Timestamp of the event
          minimum: 315529200000
          maximum: 4133890801000
        userId:
          type: string
          minLength: 1
          description: Transaction ID the event pertains to
        eventId:
          type: string
          description: Unique event ID
        reason:
          type: string
          description: Reason for the event or a state change
        eventDescription:
          type: string
          description: Event description
        updatedBusinessUserAttributes:
          $ref: '#/components/schemas/BusinessOptional'
        updateCount:
          x-fern-ignore: true
          type: number
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
        createdAt:
          type: number
        isKrsLocked:
          type: boolean
      required:
        - timestamp
        - userId
    InternalUserEvent:
      title: InternalUserEvent
      oneOf:
        - $ref: '#/components/schemas/InternalConsumerUserEvent'
        - $ref: '#/components/schemas/InternalBusinessUserEvent'
    InternalUserEventsResponse:
      title: InternalUserEventsResponse
      type: object
      description: ''
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/InternalUserEvent'
        total:
          type: number
      required:
        - items
        - total
    InternalTransaction:
      type: object
      properties:
        type:
          type: string
          description: 'Type of transaction (ex: DEPOSIT, WITHDRAWAL, TRANSFER,
            EXTERNAL_PAYMENT, REFUND, OTHER)'
        transactionId:
          minLength: 1
          type: string
          description: Unique transaction identifier
        timestamp:
          type: number
          description: Timestamp of when transaction took place
          minimum: 315529200000
          maximum: 4133890801000
        originUserId:
          type: string
          description: UserId for where the transaction originates from
        destinationUserId:
          type: string
          description: UserId for transaction's destination. In other words, where the
            value is being transferred to.
        transactionState:
          $ref: '#/components/schemas/TransactionState'
        originAmountDetails:
          $ref: '#/components/schemas/TransactionAmountDetails'
        destinationAmountDetails:
          $ref: '#/components/schemas/TransactionAmountDetails'
        originPaymentDetails:
          oneOf:
            - $ref: '#/components/schemas/CardDetails'
            - $ref: '#/components/schemas/GenericBankAccountDetails'
            - $ref: '#/components/schemas/IBANDetails'
            - $ref: '#/components/schemas/ACHDetails'
            - $ref: '#/components/schemas/SWIFTDetails'
            - $ref: '#/components/schemas/MpesaDetails'
            - $ref: '#/components/schemas/UPIDetails'
            - $ref: '#/components/schemas/WalletDetails'
            - $ref: '#/components/schemas/CheckDetails'
            - $ref: '#/components/schemas/CashDetails'
            - $ref: '#/components/schemas/NPPDetails'
          description: Payment details of the origin. It can be a bank account number,
            wallet ID, card fingerprint etc.
        destinationPaymentDetails:
          oneOf:
            - $ref: '#/components/schemas/CardDetails'
            - $ref: '#/components/schemas/GenericBankAccountDetails'
            - $ref: '#/components/schemas/IBANDetails'
            - $ref: '#/components/schemas/ACHDetails'
            - $ref: '#/components/schemas/UPIDetails'
            - $ref: '#/components/schemas/WalletDetails'
            - $ref: '#/components/schemas/SWIFTDetails'
            - $ref: '#/components/schemas/MpesaDetails'
            - $ref: '#/components/schemas/CheckDetails'
            - $ref: '#/components/schemas/CashDetails'
            - $ref: '#/components/schemas/NPPDetails'
        originFundsInfo:
          $ref: '#/components/schemas/OriginFundsInfo'
        corporateEntity:
          $ref: '#/components/schemas/CorporateEntityDetails'
        relatedTransactionIds:
          type: array
          description: 'IDs of transactions related to this transaction. Ex: refund, split
            bills'
          items:
            type: string
        productType:
          type: string
          description: Type of produce being used by the consumer (ex wallets, payments etc)
        promotionCodeUsed:
          type: boolean
          description: Whether a promotion code was used or not the transaction
        reference:
          minLength: 1
          type: string
          description: Reference field for the transaction indicating the purpose of the
            transaction etc.
        originDeviceData:
          $ref: '#/components/schemas/DeviceData'
        destinationDeviceData:
          $ref: '#/components/schemas/DeviceData'
        metadata:
          $ref: '#/components/schemas/TransactionMetadata'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/Tag'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        paymentApprovalTimestamp:
          type: number
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        status:
          $ref: '#/components/schemas/RuleAction'
        riskScoreDetails:
          $ref: '#/components/schemas/TransactionRiskScoringResult'
        originPaymentMethodId:
          type: string
        destinationPaymentMethodId:
          type: string
        originUser:
          oneOf:
            - $ref: '#/components/schemas/InternalConsumerUser'
            - $ref: '#/components/schemas/InternalBusinessUser'
        destinationUser:
          oneOf:
            - $ref: '#/components/schemas/InternalConsumerUser'
            - $ref: '#/components/schemas/InternalBusinessUser'
        events:
          type: array
          items:
            $ref: '#/components/schemas/InternalTransactionEvent'
        arsScore:
          $ref: '#/components/schemas/ArsScore'
        createdAt:
          type: number
        updatedAt:
          type: number
        alertIds:
          type: array
          items:
            type: string
      required:
        - type
        - transactionId
        - timestamp
        - executedRules
        - hitRules
        - status
    TransactionTableItemUser:
      title: TransactionTableItemUser
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        type:
          $ref: '#/components/schemas/UserType'
    TransactionTableItemPayment:
      title: TransactionTableItemPaymentDetails
      type: object
      properties:
        paymentDetails:
          oneOf:
            - $ref: '#/components/schemas/CardDetails'
            - $ref: '#/components/schemas/GenericBankAccountDetails'
            - $ref: '#/components/schemas/IBANDetails'
            - $ref: '#/components/schemas/ACHDetails'
            - $ref: '#/components/schemas/SWIFTDetails'
            - $ref: '#/components/schemas/MpesaDetails'
            - $ref: '#/components/schemas/UPIDetails'
            - $ref: '#/components/schemas/WalletDetails'
            - $ref: '#/components/schemas/CheckDetails'
            - $ref: '#/components/schemas/CashDetails'
            - $ref: '#/components/schemas/NPPDetails'
        amount:
          type: number
        currency:
          $ref: '#/components/schemas/CurrencyCode'
        country:
          $ref: '#/components/schemas/CountryCode'
        paymentMethodId:
          type: string
    TransactionTableItemARS:
      title: TransactionTableItemARS
      type: object
      properties:
        arsScore:
          type: number
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
    AllUsersTableItemPreview:
      title: AllUsersTableItemPreview
      type: object
      properties:
        userId:
          type: string
        name:
          type: string
        casesCount:
          type: number
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
      required:
        - userId
    UserCommonTableItem:
      title: UserRiskScoreTableItem
      type: object
      properties:
        userId:
          type: string
        createdTimestamp:
          type: number
        updatedAt:
          type: number
        drsScore:
          type: number
        krsScore:
          type: number
        isRiskLevelLocked:
          type: boolean
        manualRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/UserTag'
        type:
          $ref: '#/components/schemas/UserType'
        name:
          type: string
        userState:
          $ref: '#/components/schemas/UserState'
        userStateReason:
          type: string
        kycStatus:
          $ref: '#/components/schemas/KYCStatus'
        kycStatusReason:
          type: string
      required:
        - userId
        - createdTimestamp
        - type
    AllUsersTableItem:
      type: object
      properties:
        userId:
          type: string
        createdTimestamp:
          type: number
        updatedAt:
          type: number
        drsScore:
          type: number
        krsScore:
          type: number
        isRiskLevelLocked:
          type: boolean
        manualRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/UserTag'
        type:
          $ref: '#/components/schemas/UserType'
        name:
          type: string
        userState:
          $ref: '#/components/schemas/UserState'
        userStateReason:
          type: string
        kycStatus:
          $ref: '#/components/schemas/KYCStatus'
        kycStatusReason:
          type: string
        casesCount:
          type: number
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
      required:
        - userId
        - createdTimestamp
        - type
    ConsumerUserTableItem:
      type: object
      properties:
        userId:
          type: string
        createdTimestamp:
          type: number
        updatedAt:
          type: number
        drsScore:
          type: number
        krsScore:
          type: number
        isRiskLevelLocked:
          type: boolean
        manualRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/UserTag'
        type:
          $ref: '#/components/schemas/UserType'
        name:
          type: string
        userState:
          $ref: '#/components/schemas/UserState'
        userStateReason:
          type: string
        kycStatus:
          $ref: '#/components/schemas/KYCStatus'
        kycStatusReason:
          type: string
        dateOfBirth:
          type: string
        countryOfResidence:
          $ref: '#/components/schemas/CountryCode'
        countryOfNationality:
          $ref: '#/components/schemas/CountryCode'
        pepDetails:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
      required:
        - userId
        - createdTimestamp
        - type
    BusinessUserTableItem:
      type: object
      properties:
        userId:
          type: string
        createdTimestamp:
          type: number
        updatedAt:
          type: number
        drsScore:
          type: number
        krsScore:
          type: number
        isRiskLevelLocked:
          type: boolean
        manualRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/UserTag'
        type:
          $ref: '#/components/schemas/UserType'
        name:
          type: string
        userState:
          $ref: '#/components/schemas/UserState'
        userStateReason:
          type: string
        kycStatus:
          $ref: '#/components/schemas/KYCStatus'
        kycStatusReason:
          type: string
        industry:
          type: array
          items:
            type: string
        userRegistrationStatus:
          $ref: '#/components/schemas/UserRegistrationStatus'
        expectedVolumes:
          $ref: '#/components/schemas/BusinessUserExpectedVolumes'
        registrationIdentifier:
          type: string
        registrationCountry:
          $ref: '#/components/schemas/CountryCode'
      required:
        - userId
        - createdTimestamp
        - type
    BusinessUserExpectedVolumes:
      title: BusinessUserExpectedVolumes
      type: object
      properties:
        transactionVolumePerMonth:
          $ref: '#/components/schemas/Amount'
        expectedTransactionAmountPerMonth:
          $ref: '#/components/schemas/Amount'
        maximumDailyTransactionLimit:
          $ref: '#/components/schemas/Amount'
    TransactionTableHitResponse:
      title: TransactionTableHitResponse
      type: object
      properties:
        ruleName:
          type: string
        ruleDescription:
          type: string
    TransactionTableItem:
      title: TransactionTableItem
      type: object
      properties:
        transactionId:
          type: string
        type:
          type: string
        status:
          $ref: '#/components/schemas/RuleAction'
        originUser:
          $ref: '#/components/schemas/TransactionTableItemUser'
        destinationUser:
          $ref: '#/components/schemas/TransactionTableItemUser'
        timestamp:
          type: number
        originPayment:
          $ref: '#/components/schemas/TransactionTableItemPayment'
        destinationPayment:
          $ref: '#/components/schemas/TransactionTableItemPayment'
        productType:
          type: string
        arsScore:
          $ref: '#/components/schemas/TransactionTableItemARS'
        transactionState:
          $ref: '#/components/schemas/TransactionState'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        reference:
          type: string
        hasHitRules:
          type: boolean
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/TransactionTableHitResponse'
        originFundsInfo:
          $ref: '#/components/schemas/OriginFundsInfo'
        alertIds:
          type: array
          items:
            type: string
        paymentApprovalTimestamp:
          type: number
        reason:
          type: string
          description: The last reason chosen for payment approval or block action
      required:
        - transactionId
        - timestamp
    ConsumerUsersOffsetPaginateListResponse:
      title: ConsumerUsersOffsetPaginateListResponse
      type: object
      properties:
        count:
          type: number
        items:
          type: array
          items:
            $ref: '#/components/schemas/ConsumerUserTableItem'
      required:
        - count
        - items
    BusinessUsersOffsetPaginateListResponse:
      title: BusinessUsersOffsetPaginateListResponse
      type: object
      properties:
        count:
          type: number
        items:
          type: array
          items:
            $ref: '#/components/schemas/BusinessUserTableItem'
      required:
        - count
        - items
    AllUsersOffsetPaginateListResponse:
      title: AllUsersOffsetPaginateListResponse
      type: object
      properties:
        count:
          type: number
        items:
          type: array
          items:
            $ref: '#/components/schemas/AllUsersTableItem'
      required:
        - count
        - items
    AllUsersPreviewOffsetPaginateListResponse:
      title: AllUsersPreviewOffsetPaginateListResponse
      type: object
      properties:
        count:
          type: number
        items:
          type: array
          items:
            $ref: '#/components/schemas/AllUsersTableItemPreview'
      required:
        - count
        - items
    NotificationListResponse:
      title: NotificationListResponse
      type: object
      properties:
        hasPrev:
          type: boolean
        prev:
          type: string
        next:
          type: string
        count:
          type: number
        limit:
          type: number
        last:
          type: string
        hasNext:
          type: boolean
        items:
          type: array
          items:
            $ref: '#/components/schemas/Notification'
      required:
        - hasPrev
        - prev
        - next
        - hasNext
        - items
        - count
        - limit
        - last
    TenantTriggerBatchJobRequest:
      title: TenantTriggerBatchJobRequest
      type: object
      properties:
        jobName:
          $ref: '#/components/schemas/BatchJobNames'
      required:
        - jobName
    BulkUsersRerunStatus:
      title: BulkUsersRerunStatus
      type: object
      properties:
        count:
          type: number
        isAnyJobRunning:
          type: boolean
        sentCount:
          type: number
        processedCount:
          type: number
      required:
        - count
        - isAnyJobRunning
    BatchJobNames:
      title: BatchJobNames
      type: string
      enum:
        - ONGOING_SCREENING_USER_RULE
        - DEMO_MODE_DATA_LOAD
        - TEST_FARGATE
        - SANCTIONS_DATA_FETCH
        - SYNC_AUTH0_DATA
        - FAILING_BATCH_JOB
        - DELTA_SANCTIONS_DATA_FETCH
        - PERIODIC_SCREENING_USER_RULE
        - API_USAGE_METRICS
        - PNB_PULL_USERS_DATA
        - CLICKHOUSE_DATA_BACKFILL
        - SYNC_DATABASES
        - SCREENING_ALERTS_EXPORT
    CrmIntegrationNames:
      title: CrmIntegrationNames
      type: string
      enum:
        - FRESHDESK
        - SALESFORCE
        - ZENDESK
    ChatbotNames:
      title: ChatbotNames
      type: string
      enum:
        - INTERCOMM
    DashboardStatsTransactionsCount:
      type: object
      title: DashboardStatsTransactionsCount
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              time:
                type: string
              status_ALLOW:
                type: number
              status_ALLOW_MANUAL:
                type: number
              status_FLAG:
                type: number
              status_BLOCK:
                type: number
              status_BLOCK_MANUAL:
                type: number
              status_SUSPEND:
                type: number
              paymentMethods_ACH:
                type: number
              paymentMethods_CARD:
                type: number
              paymentMethods_GENERIC_BANK_ACCOUNT:
                type: number
              paymentMethods_IBAN':
                type: number
              paymentMethods_SWIFT:
                type: number
              paymentMethods_UPI:
                type: number
              paymentMethods_WALLET:
                type: number
              paymentMethods_MPESA:
                type: number
              paymentMethods_CHECK:
                type: number
              arsRiskLevel_VERY_HIGH:
                type: number
              arsRiskLevel_HIGH:
                type: number
              arsRiskLevel_MEDIUM:
                type: number
              arsRiskLevel_LOW:
                type: number
              arsRiskLevel_VERY_LOW:
                type: number
            required:
              - time
      required:
        - data
    DashboardStatsTransactionsCountItem:
      type: object
      title: DashboardStatsTransactionsCountItem
      properties:
        time:
          type: string
        paymentMethods_ACH:
          type: number
        paymentMethods_CARD:
          type: number
        paymentMethods_GENERIC_BANK_ACCOUNT:
          type: number
        paymentMethods_IBAN':
          type: number
        paymentMethods_SWIFT:
          type: number
        paymentMethods_UPI:
          type: number
        paymentMethods_WALLET:
          type: number
        paymentMethods_MPESA:
          type: number
        paymentMethods_CHECK:
          type: number
        arsRiskLevel_VERY_HIGH:
          type: number
        arsRiskLevel_HIGH:
          type: number
        arsRiskLevel_MEDIUM:
          type: number
        arsRiskLevel_LOW:
          type: number
        arsRiskLevel_VERY_LOW:
          type: number
      required:
        - time
    DashboardStatsTransactionTypeDistribution:
      type: object
      title: DashboardStatsTransactionTypeDistribution
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              count:
                type: number
            required:
              - type
              - count
      required:
        - data
    DashboardStatsRulesCount:
      type: object
      title: DashboardStatsRulesCount
      properties:
        ruleId:
          type: string
        ruleInstanceId:
          type: string
        hitCount:
          type: number
        openAlertsCount:
          type: number
        runCount:
          type: number
      required:
        - ruleId
        - hitCount
    DashboardStatsUsersStats:
      type: object
      title: DashboardStatsUsersStats
      properties:
        time:
          type: string
        drsRiskLevel_VERY_LOW:
          type: number
        drsRiskLevel_LOW:
          type: number
        drsRiskLevel_MEDIUM:
          type: number
        drsRiskLevel_HIGH:
          type: number
        drsRiskLevel_VERY_HIGH:
          type: number
        krsRiskLevel_VERY_LOW:
          type: number
        krsRiskLevel_LOW:
          type: number
        krsRiskLevel_MEDIUM:
          type: number
        krsRiskLevel_HIGH:
          type: number
        krsRiskLevel_VERY_HIGH:
          type: number
        kycStatus_SUCCESSFUL:
          type: number
        kycStatus_FAILED:
          type: number
        kycStatus_NOT_STARTED:
          type: number
        kycStatus_IN_PROGRESS:
          type: number
        kycStatus_MANUAL_REVIEW:
          type: number
        userState_UNACCEPTABLE:
          type: number
        userState_TERMINATED:
          type: number
        userState_ACTIVE:
          type: number
        userState_DORMANT:
          type: number
        userState_CREATED:
          type: number
        userState_SUSPENDED:
          type: number
        userState_BLOCKED:
          type: number
      required:
        - time
    DashboardStatsKRSDistribution:
      type: object
      title: DashboardStatsKRSDistribution
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              date:
                type: string
              riskLevel:
                $ref: '#/components/schemas/RiskLevel'
              percentage:
                type: string
              count:
                type: number
              riskScoreRange:
                type: string
            required:
              - riskLevel
              - count
        total:
          type: number
      required:
        - data
    DashboardStatsKYCStatusDistribution:
      type: object
      title: DashboardStatsKYCStatusDistribution
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              kycStatus:
                $ref: '#/components/schemas/KYCStatus'
              percentage:
                type: string
              count:
                type: number
            required:
              - kycStatus
              - count
        total:
          type: number
      required:
        - data
    DashboardStatsOverview:
      type: object
      title: DashboardStatsOverview
      properties:
        totalOpenCases:
          type: number
        totalOpenAlerts:
          type: number
        averageInvestigationTimeCases:
          type: number
        averageInvestigationTimeAlerts:
          type: number
        totalSarReported:
          type: number
      required:
        - totalOpenCases
        - totalOpenAlerts
        - averageInvestigationTimeCases
        - averageInvestigationTimeAlerts
        - totalSarReported
    DashboardStatsClosingReasonDistributionStats:
      type: object
      title: DashboardStatsClosingReasonDistributionStats
      properties:
        closingReasonsData:
          type: array
          items:
            type: object
            properties:
              reason:
                type: string
              value:
                type: number
      required:
        - closingReasonsData
    DashboardStatsAlertPriorityDistributionStats:
      type: object
      title: DashboardStatsAlertPriorityDistributionStats
      properties:
        alertPriorityData:
          type: array
          items:
            type: object
            properties:
              priority:
                $ref: '#/components/schemas/Priority'
              value:
                type: number
      required:
        - alertPriorityData
    DashboardStatsQaAlertsCountByRule:
      type: object
      title: DashboardStatsQaAlertsCountByRule
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              ruleId:
                type: string
              ruleInstanceId:
                type: string
              alertsCount:
                type: number
            required:
              - ruleId
              - ruleInstanceId
              - alertsCount
      required:
        - data
    DashboardStatsQaAlertsStatsByChecklistReason:
      type: object
      title: DashboardStatsQaAlertsStatsByChecklistReason
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              checklistTemplateId:
                type: string
              checklistTemplateCategory:
                type: string
              checklistItemId:
                type: string
              totalQaPassedAlerts:
                type: number
              totalQaFailedAlerts:
                type: number
              checklistItemReason:
                type: string
            required:
              - checklistTemplateId
              - checklistTemplateCategory
              - checklistItemId
              - totalQaPassedAlerts
              - totalQaFailedAlerts
      required:
        - data
    DashboardStatsQaAlertsCountByAssignee:
      type: object
      title: DashboardStatsQaAlertsCountByAssignee
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              accountId:
                type: string
              alertsAssignedForQa:
                type: number
              alertsQaedByAssignee:
                type: number
            required:
              - accountId
              - alertsAssignedForQa
              - alertsQaedByAssignee
      required:
        - data
    DashboardStatsQaOverview:
      type: object
      title: DashboardStatsQaOverview
      properties:
        totalAlertsForQa:
          type: number
        totalQaPassedAlerts:
          type: number
        totalQaFailedAlerts:
          type: number
      required:
        - totalQaFailedAlerts
        - totalAlertsForQa
        - totalQaPassedAlerts
    UpdateMonitoringStatusRequest:
      type: object
      title: UpdateMonitoringStatusRequest
      properties:
        isMonitoringEnabled:
          type: boolean
      required:
        - isMonitoringEnabled
    InternalConsumerUser:
      type: object
      properties:
        userId:
          minLength: 1
          type: string
          description: Unique user ID
        createdTimestamp:
          type: number
          description: Timestamp when userId is created
          minimum: 315529200000
          maximum: 4133890801000
        activatedTimestamp:
          type: number
          description: Timestamp when user was activated
          minimum: 315529200000
          maximum: 4133890801000
        userDetails:
          $ref: '#/components/schemas/UserDetails'
        userStateDetails:
          $ref: '#/components/schemas/UserStateDetails'
        kycStatusDetails:
          $ref: '#/components/schemas/KYCStatusDetails'
        eoddDate:
          type: number
        employmentStatus:
          $ref: '#/components/schemas/EmploymentStatus'
        occupation:
          type: string
        legalDocuments:
          type: array
          description: User's legal identity documents - See Document Model for details
          items:
            $ref: '#/components/schemas/LegalDocument'
        contactDetails:
          $ref: '#/components/schemas/ContactDetails'
        employmentDetails:
          $ref: '#/components/schemas/EmploymentDetails'
        transactionLimits:
          $ref: '#/components/schemas/TransactionLimits'
        expectedIncome:
          $ref: '#/components/schemas/ExpectedIncome'
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        kycRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        acquisitionChannel:
          $ref: '#/components/schemas/AcquisitionChannel'
        reasonForAccountOpening:
          type: array
          items:
            type: string
        sourceOfFunds:
          type: array
          items:
            $ref: '#/components/schemas/SourceOfFunds'
        userSegment:
          $ref: '#/components/schemas/ConsumerUserSegment'
        pepStatus:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
        sanctionsStatus:
          $ref: '#/components/schemas/SanctionsStatus'
        adverseMediaStatus:
          $ref: '#/components/schemas/AdverseMediaStatus'
        lastTransactionTimestamp:
          type: number
          description: Timestamp of the last successful transaction of the user
          x-fern-ignore: true
        corporateEntities:
          type: array
          description: Corporate entities of the user
          items:
            $ref: '#/components/schemas/CorporateEntityDetails'
        linkedEntities:
          $ref: '#/components/schemas/UserEntityLink'
        savedPaymentDetails:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/CardDetails'
              - $ref: '#/components/schemas/GenericBankAccountDetails'
              - $ref: '#/components/schemas/IBANDetails'
              - $ref: '#/components/schemas/ACHDetails'
              - $ref: '#/components/schemas/SWIFTDetails'
              - $ref: '#/components/schemas/MpesaDetails'
              - $ref: '#/components/schemas/UPIDetails'
              - $ref: '#/components/schemas/WalletDetails'
              - $ref: '#/components/schemas/CheckDetails'
              - $ref: '#/components/schemas/CashDetails'
              - $ref: '#/components/schemas/NPPDetails'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/UserTag'
        attachments:
          type: array
          description: Uploaded user's attachment
          items:
            $ref: '#/components/schemas/PersonAttachment'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        productsEnabled:
          type: array
          items:
            $ref: '#/components/schemas/ProductsEnabled'
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
        type:
          enum:
            - CONSUMER
          type: string
        comments:
          type: array
          items:
            $ref: '#/components/schemas/Comment'
        krsScore:
          $ref: '#/components/schemas/KrsScore'
        drsScore:
          $ref: '#/components/schemas/DrsScore'
        avgArsScore:
          $ref: '#/components/schemas/AverageArsScore'
        casesCount:
          type: number
        createdAt:
          type: number
        updatedAt:
          type: number
      required:
        - userId
        - createdTimestamp
        - type
    InternalBusinessUser:
      type: object
      properties:
        userId:
          minLength: 1
          type: string
          description: Unique user ID for the user
        createdTimestamp:
          type: number
          description: Timestamp when the user was created
          minimum: 315529200000
          maximum: 4133890801000
        legalEntity:
          $ref: '#/components/schemas/LegalEntity'
        activatedTimestamp:
          type: number
          description: Timestamp when the user was activated
          minimum: 315529200000
          maximum: 4133890801000
        userStateDetails:
          $ref: '#/components/schemas/UserStateDetails'
        kycStatusDetails:
          $ref: '#/components/schemas/KYCStatusDetails'
        corporateEntities:
          type: array
          description: Corporate entities of the user
          items:
            $ref: '#/components/schemas/CorporateEntityDetails'
        shareHolders:
          type: array
          description: Shareholders (beneficiaries) of the company that hold at least 25%
            ownership. Can be another company or an individual
          items:
            oneOf:
              - $ref: '#/components/schemas/Person'
              - $ref: '#/components/schemas/LegalEntity'
        directors:
          type: array
          description: Director(s) of the company. Must be at least one
          items:
            $ref: '#/components/schemas/Person'
        transactionLimits:
          $ref: '#/components/schemas/TransactionLimits'
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        kycRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        allowedPaymentMethods:
          type: array
          items:
            $ref: '#/components/schemas/PaymentMethod'
        lastTransactionTimestamp:
          type: number
          description: Timestamp of the last successful transaction of the user
          x-fern-ignore: true
        linkedEntities:
          $ref: '#/components/schemas/UserEntityLink'
        acquisitionChannel:
          $ref: '#/components/schemas/AcquisitionChannel'
        savedPaymentDetails:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/CardDetails'
              - $ref: '#/components/schemas/GenericBankAccountDetails'
              - $ref: '#/components/schemas/IBANDetails'
              - $ref: '#/components/schemas/ACHDetails'
              - $ref: '#/components/schemas/SWIFTDetails'
              - $ref: '#/components/schemas/MpesaDetails'
              - $ref: '#/components/schemas/UPIDetails'
              - $ref: '#/components/schemas/WalletDetails'
              - $ref: '#/components/schemas/CheckDetails'
              - $ref: '#/components/schemas/CashDetails'
              - $ref: '#/components/schemas/NPPDetails'
        mccDetails:
          $ref: '#/components/schemas/MCCDetails'
        tags:
          type: array
          description: Additional information that can be added via tags
          items:
            $ref: '#/components/schemas/UserTag'
        attachments:
          type: array
          description: User's attachments uploaded by business user
          items:
            $ref: '#/components/schemas/PersonAttachment'
        metaData:
          $ref: '#/components/schemas/DeviceData'
        jurisdiction:
          type: string
          description: Legal authority or region governing the transaction
        updateCount:
          x-fern-ignore: true
          type: number
        productsEnabled:
          type: array
          items:
            $ref: '#/components/schemas/ProductsEnabled'
        pepStatus:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
        sanctionsStatus:
          type: boolean
          description: Whether the user is sanctioned
        adverseMediaStatus:
          type: boolean
          description: Whether the user is in the adverse media list
        executedRules:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedRulesResult'
        hitRules:
          type: array
          items:
            $ref: '#/components/schemas/HitRulesDetails'
        riskScoreDetails:
          $ref: '#/components/schemas/UserRiskScoreDetails'
        type:
          enum:
            - BUSINESS
          type: string
        comments:
          type: array
          items:
            $ref: '#/components/schemas/Comment'
        krsScore:
          $ref: '#/components/schemas/KrsScore'
        drsScore:
          $ref: '#/components/schemas/DrsScore'
        avgArsScore:
          $ref: '#/components/schemas/AverageArsScore'
        casesCount:
          type: number
        createdAt:
          type: number
        updatedAt:
          type: number
        isMonitoringEnabled:
          type: boolean
        eoddDate:
          type: number
      required:
        - userId
        - createdTimestamp
        - legalEntity
        - type
    InternalUser:
      title: InternalUser
      oneOf:
        - $ref: '#/components/schemas/InternalConsumerUser'
        - $ref: '#/components/schemas/InternalBusinessUser'
    DashboardStatsHitsPerUser:
      type: object
      title: DashboardStatsHitsPerUser
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              userId:
                type: string
              rulesHitCount:
                type: number
              userName:
                type: string
              userType:
                type: string
              openAlertsCount:
                type: number
              rulesRunCount:
                type: number
            required:
              - userId
              - rulesHitCount
              - rulesRunCount
      required:
        - data
    DashboardTeamStatsItem:
      type: object
      title: DashboardTeamStatsItem
      properties:
        accountId:
          type: string
        assignedTo:
          type: number
        closedBy:
          type: number
        caseIds:
          type: array
          items:
            type: string
        investigationTime:
          type: number
        closedBySystem:
          type: number
        escalatedBy:
          type: number
        inProgress:
          type: number
        role:
          type: string
      required:
        - accountId
        - assignedTo
        - closedBy
    DashboardLatestTeamStatsItem:
      type: object
      title: DashboardLatestTeamStatsItem
      properties:
        accountId:
          type: string
        open:
          type: number
        onHold:
          type: number
        escalated:
          type: number
        inProgress:
          type: number
        inReview:
          type: number
        role:
          type: string
      required:
        - accountId
    Comment:
      type: object
      properties:
        id:
          type: string
        body:
          type: string
        type:
          type: string
          enum:
            - STATUS_CHANGE
        parentId:
          type: string
        files:
          type: array
          items:
            $ref: '#/components/schemas/FileInfo'
        userId:
          type: string
        createdAt:
          type: number
        updatedAt:
          type: number
        mentions:
          type: array
          items:
            type: string
        deletedAt:
          type: number
        isAttachment:
          type: boolean
        otherReason:
          type: string
      required:
        - body
    CommentsResponseItem:
      type: object
      title: CommentsResponseItem
      properties:
        comments:
          type: array
          items:
            $ref: '#/components/schemas/Comment'
        entityId:
          type: string
        entityType:
          $ref: '#/components/schemas/CommentType'
      required:
        - comments
        - entityId
        - entityType
    CommentsResponse:
      type: object
      title: CommentsResponse
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/CommentsResponseItem'
      required:
        - items
    NarrativeType:
      type: string
      enum:
        - ALERT
        - CASE
        - TRANSACTION
        - REPORT
        - SANCTIONS_HIT
    CommentType:
      type: string
      enum:
        - ALERT
        - CASE
    NarrativeRequest:
      title: NarrativeRequest
      type: object
      properties:
        entityId:
          type: string
        entityType:
          $ref: '#/components/schemas/NarrativeType'
        reasons:
          type: array
          items:
            type: string
        narrative:
          type: string
        additionalCopilotInfo:
          $ref: '#/components/schemas/AdditionalCopilotInfo'
        otherReason:
          type: string
        narrativeMode:
          $ref: '#/components/schemas/NarrativeMode'
      required:
        - reasons
        - entityId
        - entityType
        - narrative
        - narrativeMode
    AdditionalCopilotInfo:
      title: AdditionalCopilotInfo
      type: object
      properties:
        newCaseStatus:
          $ref: '#/components/schemas/CaseStatus'
        newAlertStatus:
          $ref: '#/components/schemas/AlertStatus'
        action:
          $ref: '#/components/schemas/RuleAction'
        additionalSarInformation:
          type: object
          properties:
            title:
              type: string
            description:
              type: string
            transactionId:
              type: string
            reportType:
              type: string
    NarrativeResponse:
      title: NarrativeResponse
      type: object
      properties:
        narrative:
          type: string
        attributes:
          type: array
          items:
            type: object
            properties:
              attribute:
                type: string
              secret:
                type: boolean
              value:
                $ref: '#/components/schemas/AnyValue'
            required:
              - attribute
              - value
      required:
        - narrative
        - attributes
    AiSourcesResponse:
      title: AiSourcesResponse
      type: object
      properties:
        aiSources:
          type: array
          items:
            $ref: '#/components/schemas/AiSource'
      required:
        - aiSources
    AiSource:
      title: AiSource
      type: object
      properties:
        sourceName:
          $ref: '#/components/schemas/AIAttribute'
        category:
          $ref: '#/components/schemas/AIAttributeCategory'
        isPii:
          type: boolean
      required:
        - sourceName
        - category
        - isPii
    FileInfo:
      title: FileInfo
      type: object
      properties:
        s3Key:
          type: string
        bucket:
          type: string
        filename:
          type: string
        size:
          type: number
        downloadLink:
          type: string
        aiSummary:
          type: string
      required:
        - s3Key
        - filename
        - size
    TransactionAction:
      title: TransactionAction
      type: object
      properties:
        transactionIds:
          type: array
          items:
            type: string
        comment:
          type: string
        action:
          $ref: '#/components/schemas/RuleAction'
        reason:
          type: array
          items:
            type: string
        files:
          type: array
          items:
            $ref: '#/components/schemas/FileInfo'
        otherReason:
          type: string
      required:
        - comment
        - transactionIds
        - reason
        - action
    AttachmentUserType:
      type: string
      title: AttachmentUserType
      enum:
        - CONSUMER
        - BUSINESS
        - SHAREHOLDER
        - DIRECTOR
    UserAttachmentUpdateRequest:
      title: UserAttachmentUpdateRequest
      type: object
      properties:
        attachment:
          $ref: '#/components/schemas/PersonAttachment'
      required:
        - attachment
    UserUpdateRequest:
      title: UserUpdateRequest
      type: object
      properties:
        userStateDetails:
          $ref: '#/components/schemas/UserStateDetailsInternal'
        kycStatusDetails:
          $ref: '#/components/schemas/KYCStatusDetailsInternal'
        transactionLimits:
          $ref: '#/components/schemas/TransactionLimits'
        comment:
          $ref: '#/components/schemas/CommentRequest'
        pepStatus:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
        sanctionsStatus:
          $ref: '#/components/schemas/SanctionsStatus'
        adverseMediaStatus:
          $ref: '#/components/schemas/AdverseMediaStatus'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/UserTag'
        eoddDate:
          type: number
    FileImport:
      title: FileImport
      type: object
      properties:
        _id:
          type: string
        type:
          type: string
          enum:
            - TRANSACTION
            - USER
            - BUSINESS
        s3Key:
          type: string
        filename:
          type: string
        importedRecords:
          type: number
        error:
          type: string
        statuses:
          type: array
          items:
            $ref: '#/components/schemas/TaskStatusChange'
      required:
        - _id
        - type
        - s3Key
        - filename
        - statuses
    TaskStatusChangeStatusEnum:
      type: string
      enum:
        - IN_PROGRESS
        - PENDING
        - SUCCESS
        - FAILED
    TaskStatusChange:
      type: object
      title: TaskStatusChange
      properties:
        status:
          $ref: '#/components/schemas/TaskStatusChangeStatusEnum'
        timestamp:
          type: number
        scheduledAt:
          type: number
      required:
        - status
        - timestamp
    AccountDeletePayload:
      title: AccountDeletePayload
      type: object
      properties:
        reassignTo:
          type: string
      required:
        - reassignTo
    EscalationLevel:
      type: string
      enum:
        - L1
        - L2
    AccountMinimum:
      type: object
      properties:
        id:
          type: string
        role:
          type: string
        name:
          type: string
        blocked:
          type: boolean
        escalationLevel:
          $ref: '#/components/schemas/EscalationLevel'
        isReviewer:
          type: boolean
        reviewerId:
          type: string
        escalationReviewerId:
          type: string
        demoMode:
          type: boolean
        tenantId:
          type: string
        isFlagrightUser:
          type: boolean
      required:
        - id
        - role
        - name
        - blocked
        - tenantId
    Account:
      type: object
      properties:
        id:
          type: string
        role:
          type: string
        name:
          type: string
        blocked:
          type: boolean
        escalationLevel:
          $ref: '#/components/schemas/EscalationLevel'
        isReviewer:
          type: boolean
        reviewerId:
          type: string
        escalationReviewerId:
          type: string
        demoMode:
          type: boolean
        tenantId:
          type: string
        isFlagrightUser:
          type: boolean
        email:
          type: string
        emailVerified:
          type: boolean
        picture:
          type: string
        allowTenantDeletion:
          type: boolean
        allowedRegions:
          type: array
          items:
            type: string
        lastLogin:
          type: number
        createdAt:
          type: number
        lastPasswordReset:
          type: number
        blockedReason:
          type: string
          enum:
            - DELETED
            - DORMANT
            - BRUTE_FORCE
            - DEACTIVATED
        staffId:
          type: string
        department:
          type: string
        orgName:
          type: string
      required:
        - id
        - role
        - name
        - blocked
        - tenantId
        - email
        - emailVerified
        - orgName
    AccountSettings:
      title: AccountSettings
      type: object
      properties:
        demoMode:
          type: boolean
    AccountInvitePayload:
      title: AccountInvitePayload
      type: object
      properties:
        email:
          type: string
        name:
          type: string
        staffId:
          type: string
        department:
          type: string
        role:
          type: string
        reviewerId:
          type: string
        escalationLevel:
          $ref: '#/components/schemas/EscalationLevel'
        escalationReviewerId:
          type: string
        isReviewer:
          type: boolean
      required:
        - email
    ResendAccountInvitePayload:
      title: ResendAccountInvitePayload
      type: object
      properties:
        email:
          type: string
      required:
        - email
    AccountPatchPayload:
      title: AccountPatchPayload
      type: object
      properties:
        role:
          type: string
        name:
          type: string
        staffId:
          type: string
        department:
          type: string
        reviewerId:
          type: string
        escalationLevel:
          $ref: '#/components/schemas/EscalationLevel'
        escalationReviewerId:
          type: string
        isReviewer:
          type: boolean
    Tenant:
      title: Tenant
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        region:
          type: string
        isProductionAccessDisabled:
          type: boolean
        host:
          type: string
        tenantCreatedAt:
          type: string
      required:
        - id
        - name
        - isProductionAccessDisabled
    SecondaryQueueTenants:
      title: SecondaryQueueTenants
      type: object
      properties:
        tenants:
          type: array
          items:
            type: string
    AIAttribute:
      title: CoPilotAttribute
      type: string
      enum:
        - userType
        - country
        - reasons
        - caseComments
        - alertComments
        - userComments
        - caseGenerationDate
        - alertGenerationDate
        - firstPaymentAmount
        - transactionsCount
        - minOriginAmount
        - maxOriginAmount
        - minDestinationAmount
        - maxDestinationAmount
        - totalOriginAmount
        - totalDestinationAmount
        - averageOriginAmount
        - averageDestinationAmount
        - name
        - websites
        - caseActionDate
        - alertActionDate
        - industry
        - productsSold
        - transactionIds
        - rules
        - originUserName
        - destinationUserName
        - originTransactionAmount
        - destinationTransactionAmount
        - originTransactionCurrency
        - destinationTransactionCurrency
        - originTransactionCountry
        - destinationTransactionCountry
        - originPaymentDetails
        - destinationPaymentDetails
        - timeOfTransaction
        - transactionReference
        - sanctionsHitDetails
        - ruleHitNames
        - address
        - counterPartyPaymentName
        - email
        - paymentIdentifier
    AIAttributeCategory:
      title: CoPilotAttributeCategory
      type: string
      enum:
        - CASE
        - USER
        - TRANSACTION
        - ALERT
    NarrativeMode:
      title: NarrativeMode
      type: string
      enum:
        - COMPACT
        - STANDARD
    TenantSettings:
      title: TenantSettings
      type: object
      properties:
        features:
          type: array
          items:
            $ref: '#/components/schemas/Feature'
        ruleActionAliases:
          type: array
          items:
            $ref: '#/components/schemas/RuleActionAlias'
        userAlias:
          type: string
        transactionStateAlias:
          type: array
          items:
            $ref: '#/components/schemas/TransactionStateAlias'
        userStateAlias:
          type: array
          items:
            $ref: '#/components/schemas/UserStateAlias'
        kycStatusAlias:
          type: array
          items:
            $ref: '#/components/schemas/KYCStatusAlias'
        riskScoringCraEnabled:
          type: boolean
        riskScoringAlgorithm:
          oneOf:
            - $ref: '#/components/schemas/FormulaLegacyMovingAvg'
            - $ref: '#/components/schemas/FormulaSimpleAvg'
            - $ref: '#/components/schemas/FormulaCustom'
        reRunRiskScoringTriggers:
          type: array
          items:
            $ref: '#/components/schemas/ReRunTrigger'
        riskLevelAlias:
          type: array
          items:
            $ref: '#/components/schemas/RiskLevelAlias'
        consoleTags:
          type: array
          items:
            $ref: '#/components/schemas/ConsoleTag'
          maxItems: 10
        defaultValues:
          type: object
          properties:
            currency:
              $ref: '#/components/schemas/CurrencyCode'
            tenantTimezone:
              $ref: '#/components/schemas/Timezone'
        aiSourcesDisabled:
          type: array
          items:
            $ref: '#/components/schemas/AIAttribute'
        isPaymentApprovalEnabled:
          type: boolean
        sanctions:
          $ref: '#/components/schemas/SanctionsSettings'
        isProductionAccessEnabled:
          type: boolean
        isAiEnabled:
          type: boolean
        kycUserStatusLock:
          type: boolean
        pepStatusLock:
          type: boolean
        apiKeyViewData:
          type: array
          items:
            type: object
            properties:
              apiKey:
                type: string
              count:
                type: number
        limits:
          type: object
          properties:
            simulations:
              type: number
            seats:
              type: number
            apiKeyView:
              type: number
            rerunRiskScoringLimit:
              type: number
        batchRerunRiskScoringFrequency:
          type: string
          enum:
            - DISABLED
            - DAILY
            - WEEKLY
            - MONTHLY
        craLockTimerDays:
          type: number
          minimum: 0
          maximum: 10000
          description: Default duration in days for CRA locks. When set (>= 1), it's
            suggested as default CRA Lock expiry. When set to 0, the setting is
            unset (perpetual lock is suggested).
        narrativeMode:
          $ref: '#/components/schemas/NarrativeMode'
        allowManualNarrativeModeUpdates:
          type: boolean
        auth0Domain:
          type: string
        notificationsSubscriptions:
          type: object
          properties:
            console:
              type: array
              items:
                $ref: '#/components/schemas/NotificationType'
        isAccountSuspended:
          type: boolean
        isMlEnabled:
          type: boolean
        mfaEnabled:
          type: boolean
        bruteForceAccountBlockingEnabled:
          type: boolean
        passwordResetDays:
          type: number
        accountDormancyAllowedDays:
          type: number
        sessionTimeoutMinutes:
          type: number
        maxActiveSessions:
          type: number
        webhookSettings:
          $ref: '#/components/schemas/WebhookSettings'
        crmIntegrationName:
          $ref: '#/components/schemas/CrmIntegrationNames'
        sarJurisdictions:
          type: array
          items:
            type: string
        chatbotName:
          $ref: '#/components/schemas/ChatbotNames'
        llmProvider:
          $ref: '#/components/schemas/LLMProvider'
        workflowSettings:
          $ref: '#/components/schemas/WorkflowSettings'
        showAllDecimalPlaces:
          type: boolean
    LLMProvider:
      type: string
      enum:
        - ANTHROPIC
        - OPEN_AI
    WorkflowSettings:
      type: object
      properties:
        riskLevelsApprovalWorkflow:
          type: string
          description: ID of the change-approval workflow to use for risk level changes.
            Use empty string to unset.
        riskFactorsApprovalWorkflow:
          type: string
          description: ID of the change-approval workflow to use for risk factor changes.
            Use empty string to unset.
        userApprovalWorkflows:
          type: object
          description: Map of user field names to change-approval workflow IDs
          properties:
            Cra:
              type: string
              nullable: true
            eoddDate:
              type: string
              nullable: true
            PepStatus:
              type: string
              nullable: true
    UserApprovalUpdateRequest:
      type: object
      title: UserApprovalUpdateRequest
      properties:
        proposedChanges:
          type: array
          items:
            $ref: '#/components/schemas/UserProposedChange'
        comment:
          type: string
      required:
        - proposedChanges
        - comment
    UserApproval:
      type: object
      title: UserApproval
      properties:
        id:
          type: number
        userId:
          type: string
        proposedChanges:
          type: array
          items:
            $ref: '#/components/schemas/UserProposedChange'
        comment:
          type: string
        workflowRef:
          $ref: '#/components/schemas/WorkflowRef'
        approvalStatus:
          $ref: '#/components/schemas/UserApprovalStatus'
        approvalStep:
          type: number
        createdAt:
          type: number
        createdBy:
          type: string
      required:
        - userId
        - proposedChanges
        - comment
        - workflowRef
        - approvalStatus
        - approvalStep
        - createdAt
        - createdBy
    UserProposedChange:
      type: object
      title: UserProposedChange
      properties:
        field:
          type: string
          description: The field name to be changed
        value:
          description: The new value for the field
      required:
        - field
        - value
    UserApprovalStatus:
      type: string
      enum:
        - PENDING
        - APPROVED
        - REJECTED
        - CANCELLED
    UserApprovalRequest:
      type: object
      title: UserApprovalRequest
      properties:
        action:
          type: string
          enum:
            - accept
            - reject
            - cancel
          description: Whether to accept or reject the proposed changes
      required:
        - action
    NangoPostConnect:
      title: NangoPostConnect
      type: object
      properties:
        connectionId:
          type: string
        providerConfigKey:
          type: string
      required:
        - connectionId
        - providerConfigKey
    NangoPostConnectResponse:
      title: NangoPostConnectResponse
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
      required:
        - success
        - message
    NangoConnection:
      title: NangoConnection
      type: object
      properties:
        token:
          type: string
        expiresAt:
          type: number
        currentIntegrations:
          type: array
          items:
            $ref: '#/components/schemas/NangoPostConnect'
        allowedIntegrations:
          type: array
          items:
            type: string
      required:
        - token
        - expiresAt
        - currentIntegrations
        - allowedIntegrations
    WebhookRetryOnlyFor:
      type: string
      enum:
        - 3XX
        - 4XX
        - 5XX
    WebhookSettings:
      title: WebhookSettings
      type: object
      properties:
        retryOnlyFor:
          type: array
          items:
            $ref: '#/components/schemas/WebhookRetryOnlyFor'
        maxRetryHours:
          type: number
        retryBackoffStrategy:
          type: string
          enum:
            - LINEAR
            - EXPONENTIAL
        maxRetryReachedAction:
          type: string
          enum:
            - DISABLE_WEBHOOK
            - IGNORE
      required:
        - retryOnlyFor
        - maxRetryHours
        - retryBackoffStrategy
        - maxRetryReachedAction
    ReRunTrigger:
      title: ReRunTrigger
      type: string
      enum:
        - SAR
        - LIST
    ConsoleTag:
      title: ConsoleTag
      type: object
      properties:
        key:
          type: string
        createdAt:
          type: number
        type:
          type: string
          enum:
            - STRING
            - ENUM
        options:
          type: array
          items:
            type: string
      required:
        - key
        - createdAt
        - type
    TenantCreationResponse:
      title: TenantCreationResponse
      type: object
      properties:
        tenantId:
          type: string
        tenantName:
          type: string
        auth0OrganizationId:
          type: string
        usagePlanId:
          type: string
      required:
        - tenantId
        - tenantName
        - usagePlanId
    VersionHistoryType:
      type: string
      enum:
        - RiskClassification
        - RiskFactors
    VersionHistory:
      type: object
      title: VersionHistory
      properties:
        data:
          oneOf:
            - type: array
              items:
                $ref: '#/components/schemas/RiskClassificationScore'
            - type: array
              items:
                $ref: '#/components/schemas/RiskFactor'
        comment:
          type: string
        id:
          type: string
        createdAt:
          type: number
        updatedAt:
          type: number
        createdBy:
          type: string
        type:
          $ref: '#/components/schemas/VersionHistoryType'
      required:
        - data
        - comment
        - id
        - createdAt
        - updatedAt
        - createdBy
        - type
    RiskClassificationScore:
      description: ''
      title: RiskClassificationScore
      type: object
      properties:
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        lowerBoundRiskScore:
          type: number
          minimum: 0
          maximum: 100
          exclusiveMinimum: false
          exclusiveMaximum: false
        upperBoundRiskScore:
          type: number
          exclusiveMinimum: false
          exclusiveMaximum: false
          minimum: 0
          maximum: 100
      required:
        - riskLevel
        - lowerBoundRiskScore
        - upperBoundRiskScore
    RiskClassificationRequest:
      type: object
      title: RiskClassificationRequest
      properties:
        scores:
          type: array
          items:
            $ref: '#/components/schemas/RiskClassificationScore'
        comment:
          type: string
      required:
        - scores
        - comment
    PaginatedVersionHistory:
      type: object
      title: PaginatedVersionHistory
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/VersionHistory'
        total:
          type: number
      required:
        - items
        - total
    VersionHistoryRestorePayload:
      type: object
      title: VersionHistoryRestorePayload
      properties:
        versionId:
          type: string
        type:
          $ref: '#/components/schemas/VersionHistoryType'
        comment:
          type: string
      required:
        - versionId
        - type
        - comment
    RiskLevelRuleLogic:
      title: RiskLevelRuleLogic
      type: object
      properties:
        VERY_HIGH:
          type: object
        HIGH:
          type: object
        MEDIUM:
          type: object
        LOW:
          type: object
        VERY_LOW:
          type: object
      required:
        - VERY_HIGH
        - HIGH
        - MEDIUM
        - LOW
        - VERY_LOW
    RiskScoreComponent:
      title: RiskScoreComponent
      type: object
      properties:
        entityType:
          $ref: '#/components/schemas/RiskEntityType'
        parameter:
          type: string
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        score:
          type: number
        value:
          type: object
        weight:
          type: number
      required:
        - entityType
        - parameter
        - riskLevel
        - score
        - value
        - weight
    RiskClassificationConfig:
      type: object
      title: RiskClassificationConfig
      properties:
        createdAt:
          type: number
        updatedAt:
          type: number
        id:
          type: string
        classificationValues:
          type: array
          items:
            $ref: '#/components/schemas/RiskClassificationScore'
      required:
        - updatedAt
        - classificationValues
        - id
        - createdAt
    RiskClassificationConfigApproval:
      type: object
      title: RiskClassificationConfigApproval
      properties:
        riskClassificationConfig:
          $ref: '#/components/schemas/RiskClassificationConfig'
        comment:
          type: string
        workflowRef:
          $ref: '#/components/schemas/WorkflowRef'
        approvalStatus:
          $ref: '#/components/schemas/RiskClassificationApprovalStatus'
        approvalStep:
          type: number
        createdAt:
          type: number
        createdBy:
          type: string
      required:
        - riskClassificationConfig
        - comment
        - workflowRef
        - approvalStatus
        - approvalStep
        - createdAt
        - createdBy
    RiskFactorApproval:
      type: object
      title: RiskFactorApproval
      properties:
        action:
          type: string
          enum:
            - create
            - update
            - delete
        riskFactor:
          $ref: '#/components/schemas/RiskFactor'
        comment:
          type: string
        workflowRef:
          $ref: '#/components/schemas/WorkflowRef'
        approvalStatus:
          $ref: '#/components/schemas/RiskFactorApprovalStatus'
        approvalStep:
          type: number
        createdAt:
          type: number
        createdBy:
          type: string
      required:
        - action
        - riskFactor
        - comment
        - workflowRef
        - approvalStatus
        - createdAt
        - createdBy
    RiskFactorApprovalStatus:
      type: string
      enum:
        - PENDING
        - APPROVED
        - REJECTED
        - CANCELLED
    RiskFactorsApprovalRequest:
      type: object
      title: RiskFactorsApprovalRequest
      properties:
        riskFactorId:
          type: string
        action:
          type: string
          enum:
            - accept
            - reject
            - cancel
          description: Whether to accept or reject the proposed changes
      required:
        - riskFactorId
        - action
    RiskFactorRequest:
      type: object
      title: RiskFactorRequest
      properties:
        riskFactor:
          $ref: '#/components/schemas/RiskFactorsPostRequest'
          nullable: true
        action:
          type: string
          enum:
            - create
            - update
            - delete
        comment:
          type: string
      required:
        - riskFactor
        - action
        - comment
    RiskClassificationApprovalStatus:
      type: string
      enum:
        - PENDING
        - APPROVED
        - REJECTED
        - CANCELLED
    RiskClassificationApprovalRequest:
      type: object
      title: RiskClassificationApprovalRequest
      properties:
        action:
          type: string
          enum:
            - accept
            - reject
            - cancel
          description: Whether to accept or reject the proposed changes
      required:
        - action
    RiskParameterLevelKeyValue:
      type: object
      title: RiskParameterLevelKeyValue
      properties:
        parameterValue:
          $ref: '#/components/schemas/RiskParameterValue'
        riskValue:
          oneOf:
            - $ref: '#/components/schemas/RiskScoreValueLevel'
            - $ref: '#/components/schemas/RiskScoreValueScore'
      required:
        - parameterValue
        - riskValue
    RiskParameterValue:
      type: object
      properties:
        content:
          oneOf:
            - $ref: '#/components/schemas/RiskParameterValueLiteral'
            - $ref: '#/components/schemas/RiskParameterValueRange'
            - $ref: '#/components/schemas/RiskParameterValueMultiple'
            - $ref: '#/components/schemas/RiskParameterValueTimeRange'
            - $ref: '#/components/schemas/RiskParameterValueDayRange'
            - $ref: '#/components/schemas/RiskParameterValueAmountRange'
      required:
        - content
    RiskParameterValueLiteral:
      title: RiskParameterValueLiteral
      properties:
        kind:
          type: string
          enum:
            - LITERAL
        content:
          $ref: '#/components/schemas/AnyValue'
      required:
        - kind
    RiskParameterValueRange:
      title: RiskParameterValueRange
      properties:
        kind:
          type: string
          enum:
            - RANGE
        start:
          type: number
        end:
          type: number
      required:
        - kind
    RiskParameterValueMultiple:
      title: RiskParameterValueMultiple
      properties:
        kind:
          type: string
          enum:
            - MULTIPLE
        values:
          type: array
          items:
            $ref: '#/components/schemas/RiskParameterValueLiteral'
      required:
        - kind
        - values
    RiskParameterValueTimeRange:
      title: RiskParameterValueTimeRange
      properties:
        kind:
          type: string
          enum:
            - TIME_RANGE
        startHour:
          type: number
        endHour:
          type: number
        timezone:
          type: string
      required:
        - kind
        - startHour
        - endHour
        - timezone
    RiskParameterValueAmountRange:
      title: RiskParameterValueAmountRange
      properties:
        kind:
          type: string
          enum:
            - AMOUNT_RANGE
        start:
          type: number
        end:
          type: number
        currency:
          $ref: '#/components/schemas/CurrencyCode'
      required:
        - kind
        - start
        - end
        - currency
    RiskParameterValueDayRange:
      title: RiskParameterValueDayRange
      properties:
        kind:
          type: string
          enum:
            - DAY_RANGE
        start:
          type: number
        end:
          type: number
        startGranularity:
          type: string
          enum:
            - DAYS
            - MONTHS
            - YEARS
        endGranularity:
          type: string
          enum:
            - DAYS
            - MONTHS
            - YEARS
            - INFINITE
      required:
        - kind
        - start
        - end
        - startGranularity
        - endGranularity
    RiskFactorLogic:
      title: RiskFactorLogic
      type: object
      properties:
        logic:
          type: object
        riskScore:
          type: number
          minimum: 0
          maximum: 100
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        overrideScore:
          type: boolean
        weight:
          type: number
          minimum: 0.01
          maximum: 1
        excludeFactor:
          type: boolean
      required:
        - logic
        - weight
        - riskLevel
        - riskScore
    RiskFactorLogicConditions:
      title: RiskFactorLogicConditions
      type: array
      items:
        $ref: '#/components/schemas/RiskFactorLogic'
    RiskLevelRiskFactorParameters:
      title: RiskLevelRiskFactorParameters
      type: object
      properties:
        VERY_HIGH:
          type: object
        HIGH:
          type: object
        MEDIUM:
          type: object
        LOW:
          type: object
        VERY_LOW:
          type: object
    RiskFactorsUpdateRequest:
      title: RiskFactorsUpdateRequest
      type: object
      properties:
        riskFactors:
          type: array
          items:
            $ref: '#/components/schemas/RiskFactor'
        comment:
          type: string
      required:
        - riskFactors
        - comment
    RiskFactorsUpdate:
      title: RiskFactorsUpdate
      type: object
      properties:
        riskFactorId:
          type: string
        status:
          $ref: '#/components/schemas/RuleInstanceStatus'
        logicAggregationVariables:
          type: array
          items:
            $ref: '#/components/schemas/LogicAggregationVariable'
        logicEntityVariables:
          type: array
          items:
            $ref: '#/components/schemas/LogicEntityVariableInUse'
        defaultWeight:
          type: number
          minimum: 0.01
          maximum: 1
        defaultRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        defaultRiskScore:
          type: number
          minimum: 0
          maximum: 100
        riskLevelLogic:
          $ref: '#/components/schemas/RiskFactorLogicConditions'
        name:
          type: string
        description:
          type: string
        baseCurrency:
          oneOf:
            - $ref: '#/components/schemas/CurrencyCode'
            - type: string
              enum:
                - ORIGINAL_CURRENCY
        type:
          $ref: '#/components/schemas/RiskEntityType'
        riskLevelAssignmentValues:
          type: array
          items:
            $ref: '#/components/schemas/RiskParameterLevelKeyValue'
        parameter:
          $ref: '#/components/schemas/RiskFactorParameter'
        isDerived:
          type: boolean
        dataType:
          $ref: '#/components/schemas/RiskFactorDataType'
        targetIterableParameter:
          type: string
          enum:
            - generalDetails.countryOfNationality
        valueType:
          type: string
          enum:
            - LITERAL
            - RANGE
            - MULTIPLE
            - TIME_RANGE
            - DAY_RANGE
            - AMOUNT_RANGE
        createdAt:
          type: number
    RiskFactorDataType:
      title: RiskFactorDataType
      type: string
      enum:
        - RANGE
        - STRING
        - DAY_RANGE
        - COUNTRY
        - CURRENCY
        - PAYMENT_METHOD
        - CONSUMER_USER_TYPE
        - BUSINESS_USER_TYPE
        - TRANSACTION_TYPES
        - RESIDENCE_TYPES
        - TIME_RANGE
        - BUSINESS_INDUSTRY
        - BOOLEAN
        - BUSINESS_USER_SEGMENT
        - CONSUMER_USER_SEGMENT
        - CONSUMER_EMPLOYMENT_STATUS
        - USER_REGISTRATION_STATUS
        - BANK_NAMES
        - CARD_3DS_STATUS
        - SOURCE_OF_FUNDS
        - AMOUNT_RANGE
    RiskFactorsPostRequest:
      type: object
      properties:
        riskFactorId:
          type: string
        status:
          $ref: '#/components/schemas/RuleInstanceStatus'
        logicAggregationVariables:
          type: array
          items:
            $ref: '#/components/schemas/LogicAggregationVariable'
        logicEntityVariables:
          type: array
          items:
            $ref: '#/components/schemas/LogicEntityVariableInUse'
        defaultWeight:
          type: number
          minimum: 0.01
          maximum: 1
        defaultRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        defaultRiskScore:
          type: number
          minimum: 0
          maximum: 100
        riskLevelLogic:
          $ref: '#/components/schemas/RiskFactorLogicConditions'
        name:
          type: string
        description:
          type: string
        baseCurrency:
          oneOf:
            - $ref: '#/components/schemas/CurrencyCode'
            - type: string
              enum:
                - ORIGINAL_CURRENCY
        type:
          $ref: '#/components/schemas/RiskEntityType'
        riskLevelAssignmentValues:
          type: array
          items:
            $ref: '#/components/schemas/RiskParameterLevelKeyValue'
        parameter:
          $ref: '#/components/schemas/RiskFactorParameter'
        isDerived:
          type: boolean
        dataType:
          $ref: '#/components/schemas/RiskFactorDataType'
        targetIterableParameter:
          type: string
          enum:
            - generalDetails.countryOfNationality
        valueType:
          type: string
          enum:
            - LITERAL
            - RANGE
            - MULTIPLE
            - TIME_RANGE
            - DAY_RANGE
            - AMOUNT_RANGE
        createdAt:
          type: number
      required:
        - name
        - description
        - status
        - logicEntityVariables
        - logicAggregationVariables
        - defaultWeight
        - type
    RiskFactor:
      title: RiskFactor
      type: object
      allOf:
        - $ref: '#/components/schemas/RiskFactorsPostRequest'
      properties:
        id:
          type: string
        createdAt:
          type: number
        updatedAt:
          type: number
        versionId:
          type: string
      required:
        - id
        - name
        - type
        - description
        - status
        - logicEntityVariables
        - logicAggregationVariables
        - defaultWeight
    RiskFactorParameter:
      title: RiskFactorParameter
      type: string
      enum:
        - userDetails.countryOfResidence
        - userDetails.countryOfNationality
        - originPaymentDetails.method
        - destinationPaymentDetails.method
        - originAmountDetails.country
        - destinationAmountDetails.country
        - originAmountDetails.transactionCurrency
        - destinationAmountDetails.transactionCurrency
        - ipAddressCountry
        - type
        - legalEntity.companyRegistrationDetails.registrationCountry
        - shareHolders
        - directors
        - legalEntity.companyGeneralDetails.businessIndustry
        - userDetails.dateOfBirth
        - legalEntity.companyRegistrationDetails.dateOfRegistration
        - consumerCreatedTimestamp
        - businessCreatedTimestamp
        - createdTimestamp
        - timestamp
        - domesticOrForeignOriginCountryConsumer
        - domesticOrForeignDestinationCountryConsumer
        - domesticOrForeignOriginCountryBusiness
        - domesticOrForeignDestinationCountryBusiness
        - 3dsDone
        - cardIssuedCountry
        - legalEntity.companyGeneralDetails.userRegistrationStatus
        - legalEntity.companyGeneralDetails.userSegment
        - userSegment
        - originPaymentDetails.bankName
        - destinationPaymentDetails.bankName
        - originUserSarFiled
        - destinationUserSarFiled
        - employmentStatus
        - occupation
        - reasonForAccountOpening
        - sourceOfFunds
        - originAmountDetails.transactionAmount
        - destinationAmountDetails.transactionAmount
        - originMccCode
        - destinationMccCode
    RiskFactorScoreDetails:
      title: RiskFactorScoreDetails
      type: object
      properties:
        riskFactorId:
          type: string
        versionId:
          type: string
        vars:
          type: array
          items:
            $ref: '#/components/schemas/ExecutedLogicVars'
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        score:
          type: number
        weight:
          type: number
          minimum: 0.01
          maximum: 1
        hit:
          type: boolean
        overrideScore:
          type: boolean
        excludeFactor:
          type: boolean
      required:
        - riskFactorId
        - vars
        - riskLevel
        - score
        - weight
        - hit
    RiskFactorsResult:
      title: RiskFactorsResult
      type: object
      properties:
        scoreDetails:
          type: array
          items:
            $ref: '#/components/schemas/RiskFactorScoreDetails'
        components:
          type: array
          items:
            $ref: '#/components/schemas/RiskScoreComponent'
        score:
          type: number
        isOverriddenScore:
          type: boolean
      required:
        - scoreDetails
        - score
        - components
        - isOverriddenScore
    ParameterAttributeRiskValues:
      title: ParameterAttributeRiskValues
      type: object
      properties:
        parameter:
          $ref: '#/components/schemas/RiskFactorParameter'
        isActive:
          type: boolean
        isDerived:
          type: boolean
        riskEntityType:
          $ref: '#/components/schemas/RiskEntityType'
        riskLevelAssignmentValues:
          type: array
          items:
            $ref: '#/components/schemas/RiskParameterLevelKeyValue'
        parameterType:
          type: string
          enum:
            - ITERABLE
            - VARIABLE
        targetIterableParameter:
          type: string
          enum:
            - generalDetails.countryOfNationality
        weight:
          type: number
          minimum: 0.01
          maximum: 1
        isNullableAllowed:
          type: boolean
        value:
          type: object
        defaultValue:
          oneOf:
            - $ref: '#/components/schemas/RiskScoreValueLevel'
            - $ref: '#/components/schemas/RiskScoreValueScore'
      required:
        - parameter
        - isActive
        - isDerived
        - riskEntityType
        - riskLevelAssignmentValues
        - defaultValue
        - weight
    RiskScoreValueLevel:
      title: RiskScoreValueLevel
      type: object
      properties:
        type:
          type: string
          enum:
            - RISK_LEVEL
        value:
          $ref: '#/components/schemas/RiskLevel'
      required:
        - type
        - value
    RiskScoreValueScore:
      title: RiskValueScore
      type: object
      properties:
        type:
          type: string
          enum:
            - RISK_SCORE
        value:
          type: number
      required:
        - type
        - value
    SarCountries:
      type: string
      title: SarCountries
      enum:
        - AU
        - CA
        - KE
        - LT
        - US
        - MY
    Feature:
      type: string
      title: Feature
      enum:
        - RISK_LEVELS
        - RISK_SCORING
        - SLACK_ALERTS
        - NARRATIVE_COPILOT
        - AI_FORENSICS
        - SANCTIONS
        - FALSE_POSITIVE_CHECK
        - DEMO_MODE
        - SIMULATOR
        - CRM
        - ENTITY_LINKING
        - ADVANCED_WORKFLOWS
        - SAR
        - QA
        - RULES_ENGINE_V8
        - RULES_ENGINE_V8_FOR_V2_RULES
        - RULES_ENGINE_V8_SYNC_REBUILD
        - NOTIFICATIONS
        - FILES_AI_SUMMARY
        - CLICKHOUSE_ENABLED
        - ALERT_SLA
        - MACHINE_LEARNING
        - DOW_JONES
        - OPEN_SANCTIONS
        - ASYNC_RULES
        - CONCURRENT_ASYNC_RULES
        - PNB
        - PNB_DAY_2
        - NEW_FEATURES
        - MULTI_LEVEL_ESCALATION
        - STRICT_FILE_SECURITY
        - MANUAL_PRE_AGGREGATION
        - MANUAL_DASHBOARD_REFRESH
        - ACURIS
        - LSEG
        - 314A
        - CLICKHOUSE_MIGRATION
        - CHAINALYSIS
        - WORKFLOWS_BUILDER
        - TRANSLITERATION
        - CONSOLE_MIGRATION
        - OPEN_SEARCH
        - APPROVAL_WORKFLOWS
        - USER_CHANGES_APPROVAL
        - DISABLE_GLOBAL_AGGREGATIONS
        - EDD_REPORT
        - CRA_LOCK_TIMER
        - CHATBOT
        - CUSTOM_AGGREGATION_FIELDS
        - EDD
        - FLAT_FILES_IMPORT
        - MULTIPLEX_ASYNC_RULES_TX
        - MULTIPLEX_ASYNC_RULE_SCHEDULED
        - LSEG_API
      description: ''
    NewRiskFactorIdResponse:
      title: NewRiskFactorIdResponse
      type: object
      properties:
        riskFactorId:
          type: string
          nullable: false
    ManagedRoleName:
      type: string
      title: ManagedRoleName
      enum:
        - root
        - whitelabel-root
        - admin
        - user
        - analyst
        - approver
        - auditor
        - developer
    CreateAccountRole:
      type: object
      title: CreateAccountRole
      properties:
        name:
          type: string
        description:
          type: string
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/Permission'
        statements:
          type: array
          items:
            $ref: '#/components/schemas/PermissionStatements'
      required:
        - name
        - description
        - permissions
    AccountRole:
      type: object
      title: AccountRole
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/Permission'
        statements:
          type: array
          items:
            $ref: '#/components/schemas/PermissionStatements'
        createdAt:
          type: number
        updatedAt:
          type: number
      required:
        - id
        - name
        - description
        - permissions
    FormulaLegacyMovingAvg:
      type: object
      title: FormulaLegacyMovingAvg
      properties:
        type:
          type: string
          enum:
            - FORMULA_LEGACY_MOVING_AVG
      required:
        - type
    FormulaSimpleAvg:
      type: object
      title: FormulaSimpleAvg
      properties:
        type:
          type: string
          enum:
            - FORMULA_SIMPLE_AVG
      required:
        - type
    FormulaCustom:
      type: object
      title: FormulaCustom
      properties:
        type:
          type: string
          enum:
            - FORMULA_CUSTOM
        krsWeight:
          type: number
          minimum: 0
          maximum: 1
        avgArsWeight:
          type: number
          minimum: 0
          maximum: 1
      required:
        - type
        - krsWeight
        - avgArsWeight
    Permission:
      type: string
      title: Permission
      enum:
        - case-management:case-overview:read
        - case-management:case-overview:write
        - case-management:case-details:read
        - case-management:case-details:write
        - case-management:case-reopen:write
        - case-management:qa:read
        - case-management:qa:write
        - case-management:export:read
        - case-management:case-assignment:write
        - rules:my-rules:read
        - rules:my-rules:write
        - rules:library:read
        - risk-scoring:risk-levels:read
        - risk-scoring:risk-levels:write
        - risk-scoring:risk-factors:read
        - risk-scoring:risk-factors:write
        - risk-scoring:risk-algorithms:read
        - risk-scoring:risk-score-details:read
        - users:user-overview:read
        - users:user-overview:write
        - users:user-comments:write
        - users:user-details:read
        - users:user-pep-status:write
        - users:user-tags:write
        - users:user-manual-risk-levels:write
        - dashboard:download-data:read
        - settings:system-config:read
        - settings:system-config:write
        - settings:case-management:write
        - settings:case-management:read
        - settings:security:read
        - settings:security:write
        - settings:transactions:read
        - settings:transactions:write
        - settings:users:read
        - settings:users:write
        - settings:rules:read
        - settings:rules:write
        - settings:risk-scoring:read
        - settings:risk-scoring:write
        - settings:notifications:read
        - settings:notifications:write
        - settings:add-ons:read
        - settings:add-ons:write
        - settings:developers:read
        - settings:developers:write
        - settings:screening:read
        - settings:screening:write
        - sanctions:search:read
        - sanctions:search:write
        - transactions:overview:read
        - transactions:overview:write
        - transactions:details:read
        - transactions:export:read
        - audit-log:export:read
        - lists:all:read
        - lists:all:write
        - lists:whitelist:read
        - lists:whitelist:write
        - lists:blacklist:read
        - lists:blacklist:write
        - lists:export:read
        - simulator:simulations:read
        - simulator:simulations:write
        - reports:schema:read
        - reports:generated:read
        - reports:generated:write
        - copilot:narrative:read
        - copilot:narrative:write
        - notifications:all:read
        - accounts:overview:read
        - accounts:overview:write
        - roles:overview:read
        - roles:overview:write
        - screening:search-profiles:read
        - screening:search-profiles:write
        - screening:screening-profiles:read
        - screening:screening-profiles:write
    CaseStatus:
      type: string
      title: CaseStatus
      enum:
        - OPEN
        - CLOSED
        - REOPENED
        - ESCALATED
        - IN_REVIEW_OPEN
        - IN_REVIEW_CLOSED
        - IN_REVIEW_REOPENED
        - IN_REVIEW_ESCALATED
        - OPEN_IN_PROGRESS
        - OPEN_ON_HOLD
        - ESCALATED_IN_PROGRESS
        - ESCALATED_ON_HOLD
        - ESCALATED_L2
        - ESCALATED_L2_IN_PROGRESS
        - ESCALATED_L2_ON_HOLD
    AlertStatus:
      type: string
      title: AlertStatus
      enum:
        - OPEN
        - CLOSED
        - REOPENED
        - ESCALATED
        - IN_REVIEW_OPEN
        - IN_REVIEW_CLOSED
        - IN_REVIEW_REOPENED
        - IN_REVIEW_ESCALATED
        - OPEN_IN_PROGRESS
        - OPEN_ON_HOLD
        - ESCALATED_IN_PROGRESS
        - ESCALATED_ON_HOLD
        - ESCALATED_L2
        - ESCALATED_L2_IN_PROGRESS
        - ESCALATED_L2_ON_HOLD
    SarDetails:
      title: SarDetails
      type: object
      properties:
        reportId:
          type: string
        status:
          $ref: '#/components/schemas/ReportStatus'
        region:
          $ref: '#/components/schemas/CountryCode'
        createdAt:
          type: number
          minimum: 1262300400000
      required:
        - reportId
        - status
        - region
    DerivedStatus:
      type: string
      title: Status
      enum:
        - OPEN
        - CLOSED
        - REOPENED
        - ESCALATED
        - IN_REVIEW
        - IN_PROGRESS
        - ON_HOLD
        - ESCALATED_L2
    FilterOperator:
      type: string
      title: FilterOperator
      enum:
        - AND
        - OR
    WebhookConfiguration:
      title: WebhookConfiguration
      type: object
      description: ''
      properties:
        _id:
          type: string
        createdAt:
          type: number
          minimum: 1262300400000
        enabledAt:
          type: number
          minimum: 1262300400000
        webhookUrl:
          type: string
        events:
          type: array
          items:
            $ref: '#/components/schemas/WebhookEventType'
        enabled:
          type: boolean
        autoDisableMessage:
          type: string
        secret:
          type: string
        expiringSecret:
          type: string
      required:
        - webhookUrl
        - events
        - enabled
    WebhookSecrets:
      title: WebhookSecrets
      type: object
      properties:
        secret:
          type: string
        expiringSecret:
          type: string
      required:
        - secret
    WebhookDeliveryAttemptPaginated:
      title: WebhookDeliveryAttemptPaginated
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/WebhookDeliveryAttempt'
        total:
          type: number
      required:
        - items
        - total
    WebhookDeliveryAttempt:
      title: WebhookDeliveryAttempt
      type: object
      properties:
        _id:
          type: string
        deliveryTaskId:
          type: string
        webhookId:
          type: string
        webhookUrl:
          type: string
        requestStartedAt:
          type: number
        requestFinishedAt:
          type: number
        entityId:
          type: string
        success:
          type: boolean
        event:
          $ref: '#/components/schemas/WebhookEventType'
        eventCreatedAt:
          type: number
        request:
          type: object
        response:
          type: object
        manualRetry:
          type: boolean
        attempts:
          type: array
          items:
            $ref: '#/components/schemas/WebhookDeliveryAttempt'
        overallSuccess:
          type: boolean
      required:
        - deliveryTaskId
        - webhookId
        - webhookUrl
        - requestStartedAt
        - requestFinishedAt
        - success
        - event
        - eventCreatedAt
        - request
        - entityId
    ConsoleActionReasonPutRequest:
      title: ActionReasonPutRequest
      type: object
      properties:
        isActive:
          type: boolean
        reasonType:
          $ref: '#/components/schemas/ReasonType'
      required:
        - isActive
        - reasonType
    ConsoleBulkActionReasonPostRequest:
      title: ConsoleBulkActionReasonPostRequest
      type: array
      items:
        $ref: '#/components/schemas/ConsoleActionReasonCreationRequest'
    ConsoleActionReasonCreationRequest:
      title: ConsoleActionReasonCreationRequest
      type: object
      properties:
        reason:
          type: string
        reasonType:
          $ref: '#/components/schemas/ReasonType'
      required:
        - reason
        - reasonType
    ConsoleActionReason:
      title: ConsoleActionReason
      type: object
      properties:
        id:
          type: string
        reason:
          type: string
        reasonType:
          $ref: '#/components/schemas/ReasonType'
        isActive:
          type: boolean
        isDeleted:
          type: boolean
        updatedAt:
          type: number
      required:
        - id
        - reason
        - reasonType
        - isActive
    ReasonType:
      title: ReasonType
      type: string
      enum:
        - CLOSURE
        - ESCALATION
    SanctionsHitReasons:
      type: string
      title: SanctionsHitReasons
      enum:
        - FALSE_POSITIVE
        - OTHER
        - TRUE_POSITIVE
    MissingUser:
      title: MissingUser
      type: object
      properties:
        userId:
          type: string
    CaseType:
      title: CaseType
      type: string
      enum:
        - MANUAL
        - SYSTEM
        - EXTERNAL
    WorkflowRef:
      title: WorkflowRef
      type: object
      properties:
        id:
          type: string
        version:
          type: number
      required:
        - id
        - version
    ManualCaseCreationDataRequest:
      type: object
      title: ManualCaseCreationDataRequest
      properties:
        manualCaseData:
          $ref: '#/components/schemas/CaseStatusChange'
        files:
          type: array
          items:
            $ref: '#/components/schemas/FileInfo'
        priority:
          $ref: '#/components/schemas/Priority'
        transactionIds:
          type: array
          items:
            type: string
      required:
        - manualCaseData
        - files
        - transactionIds
    ManualCasePatchRequest:
      type: object
      title: ManualCasePatchRequest
      properties:
        caseId:
          type: string
        transactionIds:
          type: array
          items:
            type: string
        files:
          type: array
          items:
            $ref: '#/components/schemas/FileInfo'
        comment:
          type: string
      required:
        - caseId
        - transactionIds
        - files
        - comment
    CasesUsersUserIdResponse:
      title: CasesUsersUserIdResponse
      type: object
      properties:
        caseIds:
          type: array
          items:
            type: string
      required:
        - caseIds
    CaseAggregates:
      title: CaseAggregates
      type: object
      properties:
        originPaymentMethods:
          type: array
          items:
            $ref: '#/components/schemas/PaymentMethod'
        destinationPaymentMethods:
          type: array
          items:
            $ref: '#/components/schemas/PaymentMethod'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
      required:
        - originPaymentMethods
        - destinationPaymentMethods
        - tags
    AlertsQAAutomaticSamplingData:
      title: AlertsQAAutomaticSamplingData
      type: object
      properties:
        samplingType:
          type: string
          enum:
            - AUTOMATIC
        filters:
          $ref: '#/components/schemas/AlertQASamplingFilters'
        samplingQuantity:
          type: number
      required:
        - filters
        - samplingType
        - samplingQuantity
    AlertsQASamplingManualData:
      title: AlertsQASamplingManualData
      type: object
      properties:
        samplingType:
          type: string
          enum:
            - MANUAL
        alertIds:
          type: array
          items:
            type: string
      required:
        - alertIds
        - samplingType
    AlertsQaSamplingRequest:
      title: AlertsQASamplingRequest
      type: object
      properties:
        samplingName:
          type: string
        samplingDescription:
          type: string
        priority:
          $ref: '#/components/schemas/Priority'
        samplingData:
          oneOf:
            - $ref: '#/components/schemas/AlertsQAAutomaticSamplingData'
            - $ref: '#/components/schemas/AlertsQASamplingManualData'
      required:
        - samplingName
        - samplingDescription
        - priority
        - samplingData
    AlertsQaSamplingUpdateRequest:
      title: AlertsQASamplingUpdateRequest
      type: object
      properties:
        samplingName:
          type: string
        samplingDescription:
          type: string
        priority:
          $ref: '#/components/schemas/Priority'
        alertIds:
          type: array
          items:
            type: string
        samplingQuantity:
          type: number
    AlertsQASampleIds:
      title: AlertsQASampleIds
      type: object
      properties:
        samplingId:
          type: string
        samplingName:
          type: string
      required:
        - samplingId
        - samplingName
    AverageArsScore:
      title: AverageArsScore
      type: object
      properties:
        userId:
          type: string
        value:
          type: number
        transactionCount:
          type: number
        createdAt:
          type: number
        updateCount:
          type: number
      required:
        - value
        - transactionCount
        - createdAt
        - userId
    AlertQASamplingFilters:
      title: AlertQASamplingFilters
      type: object
      description: To maintain the consistency with the AlertFilters currently we
        cannot set properties as an empty object blocked by the
        https://github.com/OpenAPITools/openapi-generator/issues/17283
    AlertsQaSampling:
      title: AlertsQASampling
      type: object
      properties:
        samplingQuantity:
          type: number
        samplingName:
          type: string
        samplingDescription:
          type: string
        priority:
          $ref: '#/components/schemas/Priority'
        createdAt:
          type: number
        updatedAt:
          type: number
        createdBy:
          type: string
        samplingId:
          type: string
        alertIds:
          type: array
          items:
            type: string
        filters:
          $ref: '#/components/schemas/AlertQASamplingFilters'
        numberOfAlerts:
          type: number
        numberOfAlertsQaDone:
          type: number
        samplingType:
          type: string
          enum:
            - MANUAL
            - AUTOMATIC
        manuallyAdded:
          type: array
          items:
            type: string
      required:
        - samplingQuantity
        - samplingName
        - samplingDescription
        - priority
        - createdAt
        - updatedAt
        - samplingType
        - samplingId
        - createdBy
    AlertQASamplingListResponse:
      title: AlertQASamplingListResponse
      type: object
      properties:
        total:
          type: number
        data:
          type: array
          items:
            $ref: '#/components/schemas/AlertsQaSampling'
      required:
        - total
        - data
    SLAPolicyDetails:
      title: SLAPolicyStatusDetails
      type: object
      properties:
        slaPolicyId:
          type: string
        policyStatus:
          $ref: '#/components/schemas/SLAPolicyStatus'
        elapsedTime:
          type: number
        updatedAt:
          type: number
        startedAt:
          type: number
        timeToWarning:
          type: number
        timeToBreach:
          type: number
      required:
        - slaPolicyId
    SLAPolicyStatus:
      title: SLAPolicyStatus
      type: string
      enum:
        - OK
        - WARNING
        - BREACHED
    AlertListResponse:
      title: AlertListResponse
      type: object
      description: ''
      properties:
        total:
          type: number
        totalPages:
          type: number
        data:
          type: array
          items:
            type: object
            title: AlertListResponseItem
            properties:
              alert:
                $ref: '#/components/schemas/Alert'
              caseCreatedTimestamp:
                type: number
              caseUsers:
                type: object
                properties:
                  origin:
                    oneOf:
                      - $ref: '#/components/schemas/InternalConsumerUser'
                      - $ref: '#/components/schemas/InternalBusinessUser'
                      - $ref: '#/components/schemas/MissingUser'
                  destination:
                    oneOf:
                      - $ref: '#/components/schemas/InternalConsumerUser'
                      - $ref: '#/components/schemas/InternalBusinessUser'
                      - $ref: '#/components/schemas/MissingUser'
                  originUserDrsScore:
                    type: number
                  destinationUserDrsScore:
                    type: number
                  originUserRiskLevel:
                    $ref: '#/components/schemas/RiskLevel'
                  destinationUserRiskLevel:
                    $ref: '#/components/schemas/RiskLevel'
              caseType:
                $ref: '#/components/schemas/CaseType'
              age:
                type: number
              address:
                type: object
                properties:
                  origin:
                    $ref: '#/components/schemas/Address'
                  destination:
                    $ref: '#/components/schemas/Address'
              email:
                type: object
                properties:
                  origin:
                    type: string
                  destination:
                    type: string
              name:
                type: object
                properties:
                  origin:
                    type: string
                  destination:
                    type: string
              paymentDetails:
                type: object
                properties:
                  origin:
                    oneOf:
                      - $ref: '#/components/schemas/CardDetails'
                      - $ref: '#/components/schemas/GenericBankAccountDetails'
                      - $ref: '#/components/schemas/IBANDetails'
                      - $ref: '#/components/schemas/ACHDetails'
                      - $ref: '#/components/schemas/SWIFTDetails'
                      - $ref: '#/components/schemas/MpesaDetails'
                      - $ref: '#/components/schemas/UPIDetails'
                      - $ref: '#/components/schemas/WalletDetails'
                      - $ref: '#/components/schemas/CheckDetails'
                      - $ref: '#/components/schemas/CashDetails'
                      - $ref: '#/components/schemas/NPPDetails'
                  destination:
                    oneOf:
                      - $ref: '#/components/schemas/CardDetails'
                      - $ref: '#/components/schemas/GenericBankAccountDetails'
                      - $ref: '#/components/schemas/IBANDetails'
                      - $ref: '#/components/schemas/ACHDetails'
                      - $ref: '#/components/schemas/SWIFTDetails'
                      - $ref: '#/components/schemas/MpesaDetails'
                      - $ref: '#/components/schemas/UPIDetails'
                      - $ref: '#/components/schemas/WalletDetails'
                      - $ref: '#/components/schemas/CheckDetails'
                      - $ref: '#/components/schemas/CashDetails'
                      - $ref: '#/components/schemas/NPPDetails'
            required:
              - alert
              - caseCreatedTimestamp
              - caseUsers
              - caseType
      required:
        - total
        - data
    AuditLogListResponse:
      title: AuditLogListResponse
      type: object
      description: ''
      properties:
        total:
          type: number
        data:
          type: array
          items:
            $ref: '#/components/schemas/AuditLog'
      required:
        - total
        - data
    CaseRuleTransactionListResponse:
      title: CaseRuleTransactionListResponse
      type: object
      properties:
        total:
          type: number
        data:
          type: object
          required:
            - caseTransactions
          properties:
            caseTransactions:
              type: array
              items:
                $ref: '#/components/schemas/InternalTransaction'
      required:
        - total
        - data
    CaseStatusUpdate:
      title: CaseStatusUpdate
      type: object
      properties:
        reason:
          type: array
          items:
            type: string
        caseStatus:
          $ref: '#/components/schemas/CaseStatus'
        priority:
          $ref: '#/components/schemas/Priority'
        otherReason:
          type: string
        comment:
          type: string
        files:
          type: array
          items:
            $ref: '#/components/schemas/FileInfo'
        alertCaseId:
          type: string
        updatedAlertIds:
          type: array
          items:
            type: string
        userStateDetails:
          $ref: '#/components/schemas/UserStateDetailsInternal'
        kycStatusDetails:
          $ref: '#/components/schemas/KYCStatusDetailsInternal'
        eoddDate:
          type: number
        listId:
          type: string
        tags:
          type: array
          items:
            $ref: '#/components/schemas/UserTag'
        screeningDetails:
          $ref: '#/components/schemas/ScreeningDetails'
        updateTransactionStatus:
          $ref: '#/components/schemas/RuleAction'
      required:
        - reason
      description: ''
    CasesAssignmentsUpdateRequest:
      title: CasesAssignmentsUpdateRequest
      type: object
      properties:
        caseIds:
          type: array
          items:
            type: string
        assignments:
          type: array
          items:
            $ref: '#/components/schemas/Assignment'
      required:
        - caseIds
        - assignments
    CasesReviewAssignmentsUpdateRequest:
      title: CasesReviewAssignmentsUpdateRequest
      type: object
      properties:
        caseIds:
          type: array
          items:
            type: string
        reviewAssignments:
          type: array
          items:
            $ref: '#/components/schemas/Assignment'
      required:
        - caseIds
        - reviewAssignments
    CaseEscalationsUpdateRequest:
      type: object
      properties:
        reason:
          type: array
          items:
            type: string
        caseStatus:
          $ref: '#/components/schemas/CaseStatus'
        priority:
          $ref: '#/components/schemas/Priority'
        otherReason:
          type: string
        comment:
          type: string
        files:
          type: array
          items:
            $ref: '#/components/schemas/FileInfo'
        alertCaseId:
          type: string
        updatedAlertIds:
          type: array
          items:
            type: string
        userStateDetails:
          $ref: '#/components/schemas/UserStateDetailsInternal'
        kycStatusDetails:
          $ref: '#/components/schemas/KYCStatusDetailsInternal'
        eoddDate:
          type: number
        listId:
          type: string
        tags:
          type: array
          items:
            $ref: '#/components/schemas/UserTag'
        screeningDetails:
          $ref: '#/components/schemas/ScreeningDetails'
        updateTransactionStatus:
          $ref: '#/components/schemas/RuleAction'
        reviewAssignments:
          type: array
          items:
            $ref: '#/components/schemas/Assignment'
        assignments:
          type: array
          items:
            $ref: '#/components/schemas/Assignment'
      required:
        - reason
    AlertQaStatusUpdateRequest:
      title: AlertQaStatusUpdateRequest
      type: object
      properties:
        alertIds:
          type: array
          items:
            type: string
        reason:
          type: array
          items:
            type: string
        checklistStatus:
          $ref: '#/components/schemas/ChecklistStatus'
        otherReason:
          type: string
        comment:
          type: string
        files:
          type: array
          items:
            $ref: '#/components/schemas/FileInfo'
      required:
        - alertIds
        - reason
        - checklistStatus
    ValidateAlertsQAStatusRequest:
      title: ValidateAlertsQAStatusRequest
      type: object
      properties:
        alertIds:
          type: array
          items:
            type: string
      required:
        - alertIds
    ValidateAlertsQAStatusResponse:
      title: ValidateAlertsQAStatusResponse
      type: object
      properties:
        valid:
          type: boolean
      required:
        - valid
    AlertStatusUpdateRequest:
      title: AlertStatusUpdateRequest
      type: object
      properties:
        reason:
          type: array
          items:
            type: string
        alertStatus:
          $ref: '#/components/schemas/AlertStatus'
        priority:
          $ref: '#/components/schemas/Priority'
        otherReason:
          type: string
        comment:
          type: string
        files:
          type: array
          items:
            $ref: '#/components/schemas/FileInfo'
        alertCaseId:
          type: string
        updatedTransactions:
          type: array
          items:
            type: string
        closeSourceCase:
          type: boolean
        userStateDetails:
          $ref: '#/components/schemas/UserStateDetailsInternal'
        kycStatusDetails:
          $ref: '#/components/schemas/KYCStatusDetailsInternal'
        eoddDate:
          type: number
        listId:
          type: string
        updateTransactionStatus:
          $ref: '#/components/schemas/RuleAction'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/UserTag'
        screeningDetails:
          $ref: '#/components/schemas/ScreeningDetails'
      required:
        - alertStatus
        - reason
    SanctionsHitListResponse:
      title: SanctionsHitListResponse
      type: object
      properties:
        hasPrev:
          type: boolean
        prev:
          type: string
        next:
          type: string
        count:
          type: number
        limit:
          type: number
        last:
          type: string
        hasNext:
          type: boolean
        items:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsHit'
      required:
        - hasPrev
        - prev
        - next
        - hasNext
        - items
        - count
        - limit
        - last
    SanctionsWhitelistSearchResponse:
      title: SanctionsWhitelistSearchResponse
      type: object
      properties:
        hasPrev:
          type: boolean
        prev:
          type: string
        next:
          type: string
        count:
          type: number
        limit:
          type: number
        last:
          type: string
        hasNext:
          type: boolean
        items:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsWhitelistEntity'
      required:
        - hasPrev
        - prev
        - next
        - hasNext
        - items
        - count
        - limit
        - last
    SanctionsWhitelistEntity:
      title: SanctionsWhitelistEntity
      type: object
      properties:
        provider:
          $ref: '#/components/schemas/SanctionsDataProviderName'
        sanctionsWhitelistId:
          type: string
        createdAt:
          type: number
        screenEntity:
          $ref: '#/components/schemas/SanctionsScreeningEntity'
        sanctionsEntity:
          $ref: '#/components/schemas/SanctionsEntity'
        userId:
          type: string
        paymentMethodId:
          type: string
        alertId:
          type: string
        entity:
          $ref: '#/components/schemas/SanctionsScreeningEntity'
        entityType:
          $ref: '#/components/schemas/SanctionsDetailsEntityType'
        searchTerm:
          type: string
        reason:
          type: array
          items:
            type: string
        comment:
          type: string
      required:
        - sanctionsWhitelistId
        - createdAt
        - sanctionsEntity
        - provider
    SanctionsDataProviderName:
      title: SanctionsDataProviderName
      type: string
      enum:
        - dowjones
        - list
        - open-sanctions
        - acuris
        - lseg
        - lseg-api
    SanctionsDataProviderScreeningInfo:
      title: SanctionsDataProviderScreeningInfo
      type: object
      properties:
        provider:
          $ref: '#/components/schemas/SanctionsDataProviderName'
        types:
          type: array
          items:
            $ref: '#/components/schemas/GenericSanctionsSearchType'
    SanctionHitStatusUpdateBaseRequest:
      title: SanctionHitStatusUpdateBaseRequest
      type: object
      properties:
        status:
          $ref: '#/components/schemas/SanctionsHitStatus'
        reasons:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsHitReasons'
        otherReason:
          type: string
        whitelistHits:
          type: boolean
        removeHitsFromWhitelist:
          type: boolean
        comment:
          type: string
      required:
        - reasons
    SanctionHitStatusUpdateRequest:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/SanctionsHitStatus'
        reasons:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsHitReasons'
        otherReason:
          type: string
        whitelistHits:
          type: boolean
        removeHitsFromWhitelist:
          type: boolean
        comment:
          type: string
        files:
          type: array
          items:
            $ref: '#/components/schemas/FileInfo'
      required:
        - reasons
    AlertsAssignmentsUpdateRequest:
      title: AlertsAssignmentsUpdateRequest
      type: object
      properties:
        alertIds:
          type: array
          items:
            type: string
        assignments:
          type: array
          items:
            $ref: '#/components/schemas/Assignment'
      required:
        - alertIds
        - assignments
    AlertQaAssignmentsUpdateRequest:
      title: AlertQaAssignmentsUpdateRequest
      type: object
      properties:
        assignments:
          type: array
          items:
            $ref: '#/components/schemas/Assignment'
      required:
        - assignments
    AlertsReviewAssignmentsUpdateRequest:
      title: AlertsReviewAssignmentsUpdateRequest
      type: object
      properties:
        alertIds:
          type: array
          items:
            type: string
        reviewAssignments:
          type: array
          items:
            $ref: '#/components/schemas/Assignment'
      required:
        - alertIds
        - reviewAssignments
    CasesStatusUpdateRequest:
      title: CasesStatusUpdateRequest
      type: object
      properties:
        caseIds:
          type: array
          items:
            type: string
        updates:
          $ref: '#/components/schemas/CaseStatusUpdate'
      required:
        - caseIds
        - updates
    AlertsStatusUpdateRequest:
      title: AlertsStatusUpdateRequest
      type: object
      properties:
        alertIds:
          type: array
          items:
            type: string
        updates:
          $ref: '#/components/schemas/AlertStatusUpdateRequest'
      required:
        - alertIds
        - updates
    SanctionHitsStatusUpdateRequest:
      title: SanctionHitsStatusUpdateRequest
      type: object
      properties:
        alertId:
          type: string
        sanctionHitIds:
          type: array
          items:
            type: string
        updates:
          $ref: '#/components/schemas/SanctionHitStatusUpdateRequest'
      required:
        - alertId
        - sanctionHitIds
        - updates
    AlertChecklistQaUpdateRequest:
      title: AlertChecklistQaUpdateRequest
      type: object
      properties:
        checklistItemIds:
          type: array
          items:
            type: string
        status:
          $ref: '#/components/schemas/ChecklistStatus'
      required:
        - status
        - checklistItemIds
    AlertChecklistUpdateRequest:
      title: AlertChecklistUpdateRequest
      type: object
      properties:
        checklistItemIds:
          type: array
          items:
            type: string
        done:
          $ref: '#/components/schemas/ChecklistDoneStatus'
        comment:
          type: string
      required:
        - done
        - checklistItemIds
    AlertsToNewCaseRequest:
      title: AlertsUpdateRequest
      type: object
      properties:
        alertIds:
          type: array
          items:
            type: string
        sourceCaseId:
          type: string
      required:
        - alertIds
        - sourceCaseId
    AlertEscalation:
      title: AlertEscalation
      type: object
      properties:
        alertId:
          type: string
        transactionIds:
          type: array
          items:
            type: string
      required:
        - alertId
    CaseEscalationRequest:
      title: CaseEscalationRequest
      type: object
      properties:
        caseUpdateRequest:
          $ref: '#/components/schemas/CaseEscalationsUpdateRequest'
        alertEscalations:
          type: array
          items:
            $ref: '#/components/schemas/AlertEscalation'
        closeSourceCase:
          type: boolean
      required:
        - caseUpdateRequest
    CaseEscalationResponse:
      title: CaseEscalationResponse
      type: object
      properties:
        childCaseId:
          type: string
        assigneeIds:
          type: array
          items:
            type: string
    CaseStatusChange:
      title: CaseStatusChange
      type: object
      properties:
        userId:
          type: string
        reason:
          type: array
          items:
            type: string
        timestamp:
          type: number
        caseStatus:
          $ref: '#/components/schemas/CaseStatus'
        otherReason:
          type: string
        reviewerId:
          type: string
        comment:
          type: string
        meta:
          type: object
          properties:
            closeSourceCase:
              type: boolean
      required:
        - userId
        - timestamp
    SanctionsSearchRequestEntityType:
      title: SanctionsSearchRequestEntityType
      type: string
      enum:
        - PERSON
        - BUSINESS
        - BANK
        - EXTERNAL_USER
    SanctionsBulkSearchRequest:
      title: SanctionsBulkSearchRequest
      type: object
      properties:
        file:
          $ref: '#/components/schemas/FileInfo'
        filters:
          $ref: '#/components/schemas/SanctionsSearchBaseRequest'
        reason:
          type: string
      required:
        - file
        - reason
    SanctionsBulkSearchResponse:
      title: SanctionsBulkSearchResponse
      type: object
      properties:
        searchTermId:
          type: string
        searchTerm:
          type: string
        reason:
          type: string
        createdBy:
          type: string
        createdAt:
          type: number
    SanctionsSearchBaseRequest:
      title: SanctionsSearchRequest
      type: object
      properties:
        _id:
          type: string
        monitored:
          type: boolean
        isOngoingScreening:
          type: boolean
        existingProviderId:
          type: string
        searchProfileId:
          type: string
        screeningProfileId:
          type: string
        fuzziness:
          type: number
          minimum: 0
          maximum: 1
        countryCodes:
          type: array
          items:
            type: string
        nationality:
          type: array
          items:
            type: string
        documentId:
          type: array
          items:
            type: string
        occupationCode:
          type: array
          items:
            $ref: '#/components/schemas/OccupationCode'
        yearOfBirth:
          type: number
        yearOfBirthRange:
          type: object
          properties:
            minYear:
              type: number
            maxYear:
              type: number
        types:
          type: array
          items:
            $ref: '#/components/schemas/GenericSanctionsSearchType'
        monitoring:
          $ref: '#/components/schemas/SanctionsSearchMonitoring'
        apiSearchRequest:
          type: object
        fuzzinessRange:
          type: object
          properties:
            lowerBound:
              type: number
            upperBound:
              type: number
        gender:
          type: string
        PEPRank:
          $ref: '#/components/schemas/PepRank'
        orFilters:
          type: array
          items:
            type: string
        allowDocumentMatches:
          type: boolean
        manualSearch:
          type: boolean
        listVersion:
          type: number
        entityType:
          $ref: '#/components/schemas/SanctionsSearchRequestEntityType'
        fuzzinessSettings:
          $ref: '#/components/schemas/FuzzinessSetting'
        stopwords:
          type: array
          items:
            type: string
        page:
          type: number
          default: 1
        pageSize:
          type: number
          default: 20
        isActivePep:
          type: boolean
        isActiveSanctioned:
          type: boolean
        partialMatch:
          type: boolean
        enableShortNameMatching:
          type: boolean
        enablePhoneticMatching:
          type: boolean
        countryOfResidence:
          type: array
          items:
            type: string
        registrationId:
          type: string
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/Address'
        lsegMediaCheck:
          $ref: '#/components/schemas/LSEGMediaCheckParameters'
    SanctionsSearchRequest:
      type: object
      properties:
        _id:
          type: string
        monitored:
          type: boolean
        isOngoingScreening:
          type: boolean
        existingProviderId:
          type: string
        searchProfileId:
          type: string
        screeningProfileId:
          type: string
        fuzziness:
          type: number
          minimum: 0
          maximum: 1
        countryCodes:
          type: array
          items:
            type: string
        nationality:
          type: array
          items:
            type: string
        documentId:
          type: array
          items:
            type: string
        occupationCode:
          type: array
          items:
            $ref: '#/components/schemas/OccupationCode'
        yearOfBirth:
          type: number
        yearOfBirthRange:
          type: object
          properties:
            minYear:
              type: number
            maxYear:
              type: number
        types:
          type: array
          items:
            $ref: '#/components/schemas/GenericSanctionsSearchType'
        monitoring:
          $ref: '#/components/schemas/SanctionsSearchMonitoring'
        apiSearchRequest:
          type: object
        fuzzinessRange:
          type: object
          properties:
            lowerBound:
              type: number
            upperBound:
              type: number
        gender:
          type: string
        PEPRank:
          $ref: '#/components/schemas/PepRank'
        orFilters:
          type: array
          items:
            type: string
        allowDocumentMatches:
          type: boolean
        manualSearch:
          type: boolean
        listVersion:
          type: number
        entityType:
          $ref: '#/components/schemas/SanctionsSearchRequestEntityType'
        fuzzinessSettings:
          $ref: '#/components/schemas/FuzzinessSetting'
        stopwords:
          type: array
          items:
            type: string
        page:
          type: number
          default: 1
        pageSize:
          type: number
          default: 20
        isActivePep:
          type: boolean
        isActiveSanctioned:
          type: boolean
        partialMatch:
          type: boolean
        enableShortNameMatching:
          type: boolean
        enablePhoneticMatching:
          type: boolean
        countryOfResidence:
          type: array
          items:
            type: string
        registrationId:
          type: string
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/Address'
        lsegMediaCheck:
          $ref: '#/components/schemas/LSEGMediaCheckParameters'
        searchTerm:
          type: string
      required:
        - searchTerm
    LSEGMediaCheckParameters:
      title: LSEGMediaCheckParameters
      type: object
      properties:
        enabled:
          type: boolean
        timeWindow:
          type: object
          properties:
            startGranularity:
              $ref: '#/components/schemas/TimeWindowGranularity'
            endGranularity:
              $ref: '#/components/schemas/TimeWindowGranularity'
            startUnits:
              type: number
            endUnits:
              type: number
    TimeWindowGranularity:
      title: TimeWindowGranularity
      type: string
      enum:
        - now
        - all_time
        - year
        - month
    ListSearchProfileResponse:
      title: ListSearchProfileResponse
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/SearchProfileResponse'
    SearchProfileResponse:
      title: SearchProfileResponse
      type: object
      properties:
        searchProfileId:
          type: string
        searchProfileName:
          type: string
        searchProfileDescription:
          type: string
        isDefault:
          type: boolean
        fuzziness:
          type: number
          minimum: 0
          maximum: 1
        nationality:
          type: array
          items:
            type: string
        types:
          type: array
          items:
            $ref: '#/components/schemas/GenericSanctionsSearchType'
        createdAt:
          type: number
        updatedAt:
          type: number
        createdBy:
          type: string
        updatedBy:
          type: string
        searchProfileStatus:
          type: string
          enum:
            - ENABLED
            - DISABLED
    SearchProfileRequest:
      title: SearchProfileRequest
      type: object
      properties:
        searchProfileName:
          type: string
        searchProfileDescription:
          type: string
        isDefault:
          type: boolean
        fuzziness:
          type: number
          minimum: 0
          maximum: 1
        nationality:
          type: array
          items:
            type: string
        types:
          type: array
          items:
            $ref: '#/components/schemas/GenericSanctionsSearchType'
        searchProfileStatus:
          type: string
          enum:
            - ENABLED
            - DISABLED
      required:
        - searchProfileName
        - searchProfileStatus
    DefaultManualScreeningFiltersRequest:
      title: DefaultManualScreeningFiltersRequest
      type: object
      properties:
        fuzziness:
          type: number
          minimum: 0
          maximum: 1
        nationality:
          type: array
          items:
            type: string
        types:
          type: array
          items:
            $ref: '#/components/schemas/GenericSanctionsSearchType'
        yearOfBirth:
          type: number
        yearOfBirthRange:
          type: object
          properties:
            minYear:
              type: number
            maxYear:
              type: number
        documentId:
          type: array
          items:
            type: string
        entityType:
          type: string
    DefaultManualScreeningFiltersResponse:
      title: DefaultManualScreeningFiltersResponse
      type: object
      properties:
        fuzziness:
          type: number
          minimum: 0
          maximum: 1
        nationality:
          type: array
          items:
            type: string
        types:
          type: array
          items:
            $ref: '#/components/schemas/GenericSanctionsSearchType'
        yearOfBirth:
          type: number
        yearOfBirthRange:
          type: object
          properties:
            minYear:
              type: number
            maxYear:
              type: number
        documentId:
          type: array
          items:
            type: string
        entityType:
          $ref: '#/components/schemas/SanctionsSearchRequestEntityType'
    ScreeningProfileRequest:
      title: ScreeningProfileRequest
      type: object
      properties:
        screeningProfileName:
          type: string
        screeningProfileDescription:
          type: string
        isDefault:
          type: boolean
        sanctions:
          type: object
          properties:
            relevance:
              type: array
              items:
                $ref: '#/components/schemas/SanctionsSourceRelevance'
            sourceIds:
              type: array
              items:
                type: string
        pep:
          type: object
          properties:
            relevance:
              type: array
              items:
                type: string
            sourceIds:
              type: array
              items:
                type: string
        rel:
          type: object
          properties:
            relevance:
              type: array
              items:
                $ref: '#/components/schemas/RELSourceRelevance'
            sourceIds:
              type: array
              items:
                type: string
        adverseMedia:
          type: object
          properties:
            relevance:
              type: array
              items:
                $ref: '#/components/schemas/AdverseMediaRelevanceInternal'
        crime:
          type: object
          properties:
            relevance:
              type: array
              items:
                type: string
        screeningProfileStatus:
          type: string
          enum:
            - ENABLED
            - DISABLED
        containAllSources:
          type: boolean
        provider:
          $ref: '#/components/schemas/SanctionsDataProviderName'
      required:
        - screeningProfileName
    ScreeningProfileResponse:
      title: ScreeningProfileResponse
      type: object
      properties:
        screeningProfileId:
          type: string
        screeningProfileName:
          type: string
        screeningProfileDescription:
          type: string
        isDefault:
          type: boolean
        sanctions:
          type: object
          properties:
            relevance:
              type: array
              items:
                $ref: '#/components/schemas/SanctionsSourceRelevance'
            sourceIds:
              type: array
              items:
                type: string
        pep:
          type: object
          properties:
            relevance:
              type: array
              items:
                $ref: '#/components/schemas/PEPSourceRelevance'
            sourceIds:
              type: array
              items:
                type: string
        rel:
          type: object
          properties:
            relevance:
              type: array
              items:
                $ref: '#/components/schemas/RELSourceRelevance'
            sourceIds:
              type: array
              items:
                type: string
        adverseMedia:
          type: object
          properties:
            relevance:
              type: array
              items:
                $ref: '#/components/schemas/AdverseMediaSourceRelevance'
        crime:
          type: object
          properties:
            relevance:
              type: array
              items:
                type: string
        createdAt:
          type: number
        updatedAt:
          type: number
        createdBy:
          type: string
        updatedBy:
          type: string
        screeningProfileStatus:
          $ref: '#/components/schemas/StatusEnum'
        containAllSources:
          type: boolean
        provider:
          $ref: '#/components/schemas/SanctionsDataProviderName'
      required:
        - screeningProfileId
        - screeningProfileName
        - screeningProfileStatus
        - createdBy
        - updatedBy
        - createdAt
        - updatedAt
    ListScreeningProfileResponse:
      title: ListScreeningProfileResponse
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ScreeningProfileResponse'
      required:
        - items
    SanctionsSourceResponse:
      title: SanctionsSourceResponse
      type: object
      properties:
        id:
          type: string
        sourceType:
          $ref: '#/components/schemas/GenericSanctionsSearchType'
        sourceCountry:
          type: string
        displayName:
          type: string
        entityCount:
          type: number
    SanctionsSourceListResponse:
      title: SanctionsSourceListResponse
      type: object
      properties:
        relevance:
          type: array
          items:
            type: string
        sources:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsSourceResponse'
      required:
        - sources
    StatusEnum:
      title: StatusEnum
      type: string
      enum:
        - ENABLED
        - DISABLED
    GenericSanctionsSearchType:
      title: GenericSanctionsSearchType
      type: string
      enum:
        - SANCTIONS
        - PEP
        - ADVERSE_MEDIA
        - REGULATORY_ENFORCEMENT_LIST
        - CRIME
    AcurisSanctionsSearchType:
      title: AcurisSanctionsSearchType
      type: string
      enum:
        - SANCTIONS
        - PEP
        - ADVERSE_MEDIA
        - REGULATORY_ENFORCEMENT_LIST
    LSEGSanctionsSearchType:
      title: LSEGSanctionsSearchType
      type: string
      enum:
        - SANCTIONS
        - PEP
        - ADVERSE_MEDIA
        - REGULATORY_ENFORCEMENT_LIST
    DowJonesSanctionsSearchType:
      title: DowJonesSanctionsSearchType
      type: string
      enum:
        - SANCTIONS
        - PEP
        - ADVERSE_MEDIA
    OpenSanctionsSearchType:
      title: OpenSanctionsSearchType
      type: string
      enum:
        - SANCTIONS
        - PEP
        - CRIME
    SanctionsSourceRelevance:
      title: SanctionsSourceRelevance
      type: string
      enum:
        - CURRENT
        - FORMER
    PEPSourceRelevance:
      title: PEPSourceRelevance
      type: string
      enum:
        - POI
        - PEP
    OpenSanctionsPEPSourceRelevance:
      title: OpenSanctionsPEPSourceRelevance
      type: string
      enum:
        - poi
        - role.pep
        - role.rca
        - role.oligarch
        - role.diplo
        - role.judge
    OpenSanctionsCrimeSourceRelevance:
      title: OpenSanctionsCrimeSourceRelevance
      type: string
      enum:
        - crime
        - crime.fraud
        - crime.cyber
        - crime.fin
        - crime.war
        - crime.boss
        - crime.terror
        - crime.traffick
    RELSourceRelevance:
      title: RELSourceRelevance
      type: string
      enum:
        - FINANCIAL_REGULATOR
        - LAW_ENFORCEMENT
    DowJonesPEPSourceRelevance:
      title: DowJonesPEPSourceRelevance
      type: string
      enum:
        - PEP
    AdverseMediaSourceRelevance:
      title: AdverseMediaSourceRelevance
      type: string
      enum:
        - TERRORISM
        - ORGANISED_CRIME
        - MODERN_SLAVERY
        - FINANCIAL_CRIME_AND_FRAUD
        - BRIBERY_AND_CORRUPTION
        - CYBERCRIMES
        - OTHER_ALLEGED_OFFENCES
        - REPUTATIONAL_RISK_EXPOSURE
    DowJonesAdverseMediaSourceRelevance:
      title: DowJonesAdverseMediaSourceRelevance
      type: string
      enum:
        - TERROR
        - ORGANISED_CRIME
        - FINANCIAL_CRIME
        - TRAFFICKING
        - CORRUPTION
        - WAR_CRIMES
        - ORGANISED_CRIME_JAPAN
        - ENHANCED_COUNTRY_RISK
        - TAX_CRIME
        - CHILD_SEXUAL_EXPLOITATION
    PEPRelevanceInternal:
      title: PEPRelevanceInternal
      type: string
      enum:
        - POI
        - PEP
    AdverseMediaRelevanceInternal:
      title: AdverseMediaRelevanceInternal
      type: string
      enum:
        - TERRORISM
        - ORGANISED_CRIME
        - MODERN_SLAVERY
        - FINANCIAL_CRIME_AND_FRAUD
        - BRIBERY_AND_CORRUPTION
        - CYBERCRIMES
        - OTHER_ALLEGED_OFFENCES
        - REPUTATIONAL_RISK_EXPOSURE
        - TERROR
        - FINANCIAL_CRIME
        - TRAFFICKING
        - CORRUPTION
        - WAR_CRIMES
        - ORGANISED_CRIME_JAPAN
        - ENHANCED_COUNTRY_RISK
        - TAX_CRIME
        - CHILD_SEXUAL_EXPLOITATION
    RuleTag:
      title: RuleTag
      type: string
      enum:
        - DYNAMIC
        - RECOMMENDED
    FilterTags:
      title: FilterTags
      type: string
      enum:
        - NONE
        - DYNAMIC
        - RECOMMENDED
    SanctionsSearchResponse:
      title: SanctionsSearchResponse
      type: object
      properties:
        hitsCount:
          type: number
        data:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsEntity'
        searchId:
          type: string
        providerSearchId:
          type: string
        createdAt:
          type: number
        monitor:
          type: boolean
        request:
          $ref: '#/components/schemas/SanctionsSearchRequest'
        page:
          type: number
        pageSize:
          type: number
        totalPages:
          type: number
        providerReferenceIds:
          type: array
          items:
            type: string
        isNewSearch:
          type: boolean
      required:
        - hitsCount
        - searchId
        - providerSearchId
        - createdAt
    SanctionsSearchHistoryResponse:
      title: SanctionsSearchHistoryResponse
      type: object
      properties:
        hasPrev:
          type: boolean
        prev:
          type: string
        next:
          type: string
        count:
          type: number
        limit:
          type: number
        last:
          type: string
        hasNext:
          type: boolean
        items:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsSearchHistoryItem'
      required:
        - hasPrev
        - prev
        - next
        - hasNext
        - items
        - count
        - limit
        - last
    SearchTypeHistory:
      title: SearchTypeHistory
      type: object
      properties:
        screeningType:
          type: string
          enum:
            - SEARCH
            - BATCH
        batchId:
          type: string
        searchTermId:
          type: string
        searchedAt:
          type: number
    SanctionsSearchHistoryItem:
      type: object
      properties:
        _id:
          type: string
        provider:
          $ref: '#/components/schemas/SanctionsDataProviderName'
        providerConfigHash:
          type: string
        request:
          $ref: '#/components/schemas/SanctionsSearchRequest'
        response:
          $ref: '#/components/schemas/SanctionsSearchResponse'
        createdAt:
          type: number
        updatedAt:
          type: number
        searchedBy:
          type: string
        hitContext:
          $ref: '#/components/schemas/SanctionsHitContext'
        requestHash:
          type: string
        history:
          type: array
          items:
            $ref: '#/components/schemas/SearchTypeHistory'
        metadata:
          type: object
          properties:
            screeningEntity:
              type: array
              items:
                type: string
                enum:
                  - USER
                  - TRANSACTION
        screeningType:
          type: string
          enum:
            - SEARCH
            - BATCH
        batchId:
          type: string
        searchTermId:
          type: string
      required:
        - _id
        - provider
        - request
        - createdAt
    SanctionsSearchHistory:
      title: SanctionsSearchHistory
      type: object
      properties:
        _id:
          type: string
        provider:
          $ref: '#/components/schemas/SanctionsDataProviderName'
        providerConfigHash:
          type: string
        request:
          $ref: '#/components/schemas/SanctionsSearchRequest'
        response:
          $ref: '#/components/schemas/SanctionsSearchResponse'
        createdAt:
          type: number
        updatedAt:
          type: number
        searchedBy:
          type: string
        hitContext:
          $ref: '#/components/schemas/SanctionsHitContext'
        requestHash:
          type: string
        history:
          type: array
          items:
            $ref: '#/components/schemas/SearchTypeHistory'
        metadata:
          type: object
          properties:
            screeningEntity:
              type: array
              items:
                type: string
                enum:
                  - USER
                  - TRANSACTION
      required:
        - _id
        - provider
        - request
        - createdAt
    SanctionsBulkSearchResultMap:
      title: SanctionsBulkSearchResultMap
      type: object
      properties:
        batchId:
          type: string
        searchTermId:
          type: string
        searchId:
          type: string
        searchTerm:
          type: string
        createdAt:
          type: number
        updatedAt:
          type: number
      required:
        - batchId
        - searchId
        - searchTermId
    SanctionsBulkSearchHistory:
      title: SanctionsBulkSearchHistory
      type: object
      properties:
        batchId:
          type: string
        request:
          $ref: '#/components/schemas/SanctionsSearchBaseRequest'
        createdAt:
          type: number
        updatedAt:
          type: number
        reason:
          type: string
        createdBy:
          type: string
      required:
        - batchId
        - reason
        - request
    SanctionsBulkUploadSchema:
      title: SanctionsBulkUploadSchema
      type: object
      properties:
        name:
          type: string
      required:
        - name
    SanctionsSearchMonitoring:
      title: SanctionsSearchMonitoring
      type: object
      properties:
        enabled:
          type: boolean
        webhookUrl:
          type: string
      required:
        - enabled
    SanctionsScreeningDetails:
      type: object
      title: SanctionsScreeningDetails
      properties:
        name:
          type: string
        entity:
          $ref: '#/components/schemas/SanctionsScreeningEntity'
        ruleInstanceIds:
          type: array
          items:
            type: string
        userIds:
          type: array
          items:
            type: string
        transactionIds:
          type: array
          items:
            type: string
        isOngoingScreening:
          type: boolean
        isHit:
          type: boolean
        isNew:
          type: boolean
        searchId:
          type: string
        lastScreenedAt:
          type: number
      required:
        - searchId
        - lastScreenedAt
        - name
        - entity
    SanctionsScreeningDetailsV2:
      type: object
      title: SanctionsScreeningDetailsV2
      properties:
        name:
          type: string
        entity:
          $ref: '#/components/schemas/SanctionsScreeningEntity'
        ruleInstanceIds:
          type: array
          items:
            type: string
        userId:
          type: string
        transactionId:
          type: string
        isOngoingScreening:
          type: boolean
        isHit:
          type: boolean
        isNew:
          type: boolean
        searchId:
          type: string
        lastScreenedAt:
          type: number
        latestTimeStamp:
          type: number
        screeningId:
          type: string
      required:
        - searchId
        - lastScreenedAt
        - name
        - entity
    SanctionsScreeningDetailsResponse:
      type: object
      title: SanctionsScreeningDetailsResponse
      properties:
        total:
          type: number
        data:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsScreeningDetails'
      required:
        - total
        - data
    SanctionsScreeningEntityStats:
      title: SanctionsScreeningEntityStats
      type: object
      properties:
        entity:
          $ref: '#/components/schemas/SanctionsScreeningEntity'
        newCount:
          type: number
        screenedCount:
          type: number
        hitCount:
          type: number
    SanctionsScreeningStats:
      title: SanctionsScreeningStats
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsScreeningEntityStats'
    SanctionsHit:
      title: SanctionsHit
      type: object
      properties:
        provider:
          $ref: '#/components/schemas/SanctionsDataProviderName'
        sanctionsHitId:
          type: string
        searchId:
          type: string
        status:
          $ref: '#/components/schemas/SanctionsHitStatus'
        clearingReason:
          type: array
          items:
            type: string
        createdAt:
          type: number
        updatedAt:
          type: number
        hitContext:
          $ref: '#/components/schemas/SanctionsHitContext'
        entity:
          $ref: '#/components/schemas/SanctionsEntity'
        delta:
          $ref: '#/components/schemas/SanctionsEntityDelta'
        comment:
          type: string
        score:
          type: number
      required:
        - sanctionsHitId
        - searchId
        - createdAt
        - updatedAt
        - entity
        - provider
    SanctionsEntityDelta:
      title: SanctionsEntityDelta
      type: object
      properties:
        sanctionsSources:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsSource'
        mediaSources:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsSource'
        pepSources:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsSource'
        yearOfBirth:
          type: array
          items:
            type: string
        gender:
          type: string
        nationality:
          type: array
          items:
            $ref: '#/components/schemas/CountryCode'
    SanctionsSource:
      title: SanctionsSource
      type: object
      properties:
        evidenceId:
          type: string
        countryCodes:
          type: array
          items:
            $ref: '#/components/schemas/CountryCode'
        createdAt:
          type: number
        endedAt:
          type: number
        name:
          type: string
        sourceName:
          type: string
        url:
          type: string
        description:
          type: string
        internalId:
          type: string
        fields:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              values:
                type: array
                items:
                  type: string
            required:
              - name
        media:
          type: array
          items:
            type: object
            properties:
              snippet:
                type: string
              title:
                type: string
              url:
                type: string
        category:
          type: string
    SanctionsMedia:
      title: SanctionsMedia
      type: object
      properties:
        date:
          type: number
        snippet:
          type: string
        title:
          type: string
        url:
          type: string
    SanctionsIdDocument:
      title: SanctionsIdDocument
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        formattedId:
          type: string
    SanctionsOccupation:
      title: SanctionsOccupation
      type: object
      properties:
        occupationCode:
          $ref: '#/components/schemas/OccupationCode'
        title:
          type: string
        rank:
          $ref: '#/components/schemas/PepRank'
        country:
          $ref: '#/components/schemas/CountryCode'
        dateFrom:
          type: string
        dateTo:
          type: string
    SanctionsAssociate:
      title: SanctionsAssociate
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        association:
          type: string
        sanctionsSearchTypes:
          type: array
          items:
            $ref: '#/components/schemas/GenericSanctionsSearchType'
        ranks:
          type: array
          items:
            $ref: '#/components/schemas/PepRank'
    OccupationCode:
      title: OccupationCode
      type: string
      enum:
        - heads_and_deputies_state_national_government
        - national_government_ministers
        - members_of_the_national_legislature
        - senior_civil_servants_national_government
        - senior_civil_servants_regional_government
        - embassy_consular_staff
        - senior_members_of_the_armed_forces
        - senior_members_of_the_police_service
        - senior_members_of_the_secret_services
        - senior_members_of_the_judiciary
        - state_corporation_executives
        - state_agency_officials
        - heads_and_deputy_heads_regional_government
        - regional_government_ministers
        - religious_leaders
        - political_party_officials
        - international_organisation_officials
        - city_mayors
        - political_pressure_labour_group_officials
        - other
        - local_public_officials
        - international_sporting_organisation_officials
    RawSanctionsResponse: {}
    SanctionsEntityAddress:
      title: SanctionsEntityAddress
      type: object
      properties:
        addressType:
          type: string
        addressLine:
          type: string
        city:
          type: string
        country:
          $ref: '#/components/schemas/CountryCode'
        postalCode:
          type: string
    SourceDocument:
      title: SourceDocument
      type: object
      properties:
        id:
          type: string
        sourceName:
          type: string
        sourceCountry:
          type: string
        displayName:
          type: string
        entityIds:
          type: array
          items:
            type: string
        sourceType:
          $ref: '#/components/schemas/GenericSanctionsSearchType'
        entityType:
          type: string
        refId:
          type: string
        entityCount:
          type: integer
    SanctionsEntity:
      title: SanctionsEntity
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        entityType:
          $ref: '#/components/schemas/SanctionsEntityType'
        matchTypes:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsMatchType'
        types:
          type: array
          items:
            type: string
        aggregatedSourceIds:
          type: array
          items:
            type: string
        sanctionSearchTypes:
          type: array
          items:
            $ref: '#/components/schemas/GenericSanctionsSearchType'
        updatedAt:
          type: number
        nameMatched:
          type: boolean
        dateMatched:
          type: boolean
        gender:
          type: string
        aka:
          type: array
          items:
            type: string
        countries:
          type: array
          items:
            type: string
        countryCodes:
          type: array
          items:
            $ref: '#/components/schemas/CountryCode'
        nationality:
          type: array
          items:
            $ref: '#/components/schemas/CountryCode'
        documents:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsIdDocument'
        occupations:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsOccupation'
        yearOfBirth:
          type: array
          items:
            type: string
        freetext:
          type: string
        screeningSources:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsSource'
        sanctionsSources:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsSource'
        mediaSources:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsSource'
        otherSources:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              value:
                type: array
                items:
                  $ref: '#/components/schemas/SanctionsSource'
        pepSources:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsSource'
        associates:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsAssociate'
        matchTypeDetails:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsMatchTypeDetails'
        rawResponse:
          $ref: '#/components/schemas/RawSanctionsResponse'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        keywords:
          type: array
          items:
            type: string
        citizenship:
          type: array
          items:
            $ref: '#/components/schemas/CountryCode'
        pepStatus:
          type: array
          items:
            $ref: '#/components/schemas/PEPStatus'
        isActivePep:
          type: boolean
        isActiveSanctioned:
          type: boolean
        isDeseased:
          type: boolean
        profileImagesUrls:
          type: array
          items:
            type: string
        dateOfBirths:
          type: array
          items:
            type: string
        provider:
          $ref: '#/components/schemas/SanctionsDataProviderName'
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsEntityAddress'
        normalizedAka:
          type: array
          items:
            type: string
        resourceId:
          type: string
      required:
        - id
        - name
        - entityType
    UserSearchEntity:
      title: UserSearchEntity
      type: object
      properties:
        id:
          type: string
        userName:
          type: string
        legalEntityName:
          type: string
        shareHoldersNames:
          type: array
          items:
            type: string
        directorsNames:
          type: array
          items:
            type: string
      required:
        - id
    SanctionsField:
      type: object
      properties:
        name:
          type: string
        values:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsFieldValue'
      required:
        - name
    SanctionsFieldValue:
      type: object
      properties:
        name:
          type: string
        title:
          type: string
    SanctionsMatchTypeDetails:
      title: SanctionsMatchTypeDetails
      type: object
      properties:
        amlTypes:
          type: array
          items:
            type: string
        matchingName:
          type: string
        nameMatches:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsNameMatched'
        secondaryMatches:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsNameMatched'
        sources:
          type: array
          items:
            type: string
      required:
        - sources
    SanctionsMatchTypeDetailsEnum:
      title: SanctionsMatchTypeDetailsEnum
      type: string
      enum:
        - exact_match
        - edit_distance
        - phonetic
        - equivalent_name
        - word_to_initial
        - initial_to_word
        - removed_spaces
        - word_to_digit
        - digit_to_word
        - name_variations_removal
        - removed_personal_title
        - removed_personal_suffix
        - removed_organisation_prefix
        - removed_organisation_suffix
        - removed_clerical_mark
        - fuzzy_birth_year_match
        - exact_birth_year_match
        - exact_nationality_match
        - exact_gender_match
        - exact_document_id_match
    SanctionsNameMatched:
      type: object
      properties:
        match_types:
          type: array
          items:
            $ref: '#/components/schemas/SanctionsMatchTypeDetailsEnum'
        query_term:
          type: string
        key:
          type: string
          enum:
            - nationality
            - gender
            - documentId
            - yearOfBirth
    MediaCheckArticleResponseItem:
      type: object
      properties:
        lsegCaseId:
          type: string
        lsegArticleId:
          type: string
        id:
          type: string
        articleSummary:
          $ref: '#/components/schemas/MediaCheckArticleSummary'
        articleContent:
          $ref: '#/components/schemas/MediaCheckArticleContent'
    MediaCheckArticleResponse:
      type: object
      properties:
        hasPrev:
          type: boolean
        prev:
          type: string
        next:
          type: string
        count:
          type: number
        limit:
          type: number
        last:
          type: string
        hasNext:
          type: boolean
        items:
          type: array
          items:
            $ref: '#/components/schemas/MediaCheckArticleResponseItem'
      required:
        - hasPrev
        - prev
        - next
        - hasNext
        - items
        - count
        - limit
        - last
    MediaCheckCaseDetails:
      type: object
      required:
        - smartFilter
      properties:
        smartFilter:
          type: boolean
    ProviderType:
      type: string
      description: Provider type enumeration.
      enum:
        - WATCHLIST
        - PASSPORT_CHECK
        - MEDIA_CHECK
        - CLIENT_WATCHLIST
        - UBO_CHECK
    CaseEntityType:
      type: string
      description: Case Entity Type Enumeration.
      enum:
        - INDIVIDUAL
        - ORGANISATION
        - VESSEL
        - UNSPECIFIED
    ScreeningResultCollection:
      type: object
      required:
        - results
        - name
        - providerTypes
        - groupId
        - entityType
      properties:
        caseId:
          type: string
        name:
          type: string
        providerTypes:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/ProviderType'
        groupId:
          type: string
        entityType:
          $ref: '#/components/schemas/CaseEntityType'
        caseSystemId:
          type: string
        caseScreeningState:
          type: object
          properties:
            WATCHLIST:
              type: string
            MEDIA_CHECK:
              type: string
          required:
            - WATCHLIST
            - MEDIA_CHECK
        lifecycleState:
          type: string
          enum:
            - ARCHIVED
            - UNARCHIVED
        creationDate:
          type: string
        modificationDate:
          type: string
        nameTransposition:
          type: boolean
        outstandingActions:
          type: boolean
        lastScreenedDatesByProviderType:
          type: object
          additionalProperties:
            type: string
            maxLength: 255
        lastIndexDatesByProviderType:
          type: object
          additionalProperties:
            type: string
            maxLength: 255
        providerTypeDetails:
          $ref: '#/components/schemas/MediaCheckCaseDetails'
        caseRating:
          type: string
          enum:
            - NO_RISK
            - LOW
            - MEDIUM
            - HIGH
            - UNKNOWN
            - NOT_RATED
        parentCaseSystemId:
          type: string
        results:
          type: array
          items:
            $ref: '#/components/schemas/AbstractScreeningResult'
        caseResultsSummary:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/CaseResultsSummary'
    CaseResultsSummary:
      type: object
      properties:
        status:
          type: string
          enum:
            - NOT_SCREENED
            - SCREENED
        totalMatches:
          type: integer
          format: int64
        reviewRequiredCount:
          type: integer
          format: int64
        reviewRequired:
          type: boolean
        unresolved:
          type: integer
          format: int64
        resolvedPositive:
          type: integer
          format: int64
        resolvedPossible:
          type: integer
          format: int64
        resolvedFalse:
          type: integer
          format: int64
        resolvedUnspecified:
          type: integer
          format: int64
    MatchedTerm:
      type: object
      properties:
        term:
          type: string
        type:
          type: string
          enum:
            - PRIMARY
            - AKA
            - AKAENHANCED
            - FKA
            - DBA
            - MAIDEN
            - LANG_VARIATION
            - PREVIOUS
            - VEHICLE_ID
            - LOW_QUALITY_AKA
            - NATIVE_AKA
            - DOCUMENT_ID
    RecordDate:
      type: object
      properties:
        type:
          type: string
          enum:
            - INITIAL_PUBLISHED_DATE
            - LAST_PUBLISHED_DATE
        value:
          type: string
    RecordType:
      type: object
      properties:
        value:
          type: string
          enum:
            - COUNTRY
            - INDIVIDUAL
            - ORGANISATION
            - VESSEL
            - PORT
            - WEBSITE
            - AIRCRAFT
            - GEOGRAPHY
        recordSubTypes:
          type: array
          items:
            type: string
    RecordGender:
      type: object
      properties:
        value:
          type: string
          default: UNKNOWN
          enum:
            - MALE
            - FEMALE
            - UNKNOWN
    RecordEvent:
      type: object
      properties:
        type:
          type: string
          enum:
            - ACQUISTION_DATE
            - BANKRUPTCY_DATE
            - BIRTH
            - CALCULATED_YOB
            - CESSATION_DATE
            - COMMENCEMENT_DATE
            - DEATH
            - DECEASED_DATE
            - INCORP_DATE
            - NATIONALISATION_DATE
            - PRIVATISATION_DATE
            - REGISTRATION_DATE
            - REPORTED_DOB
        value:
          type: string
    RecordLocation:
      type: object
      properties:
        type:
          type: string
          enum:
            - AFFILIATION
            - AGENCY
            - BRANCH
            - COMMISSION
            - FINANCIAL_HQ
            - HQ
            - ISSUER
            - LOCATION
            - NATIONALITY
            - OPERATESIN
            - OWNERSHIP
            - PEP
            - POB
            - POD
            - REGISTEREDIN
            - RESIDENT
            - UNDETERMINED
            - VESSELFLAG
        details:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - FREE_TEXT
                  - REGION
                  - STREET
                  - CITY
                  - STATE_OR_PROVINCE
                  - POSTCODE
              value:
                type: string
        country:
          type: object
          required:
            - code
            - name
          properties:
            code:
              type: string
            name:
              type: string
    RecordName:
      type: object
      properties:
        type:
          type: string
          enum:
            - PRIMARY
            - AKA
            - AKAENHANCED
            - FKA
            - DBA
            - MAIDEN
            - LANG_VARIATION
            - PREVIOUS
            - VEHICLE_ID
            - LOW_QUALITY_AKA
            - NATIVE_AKA
            - DOCUMENT_ID
        details:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - FULL_NAME
                  - FIRST_NAME
                  - LAST_NAME
                  - PREFIX
                  - ORIGINAL_NAME
                  - SUFFIX
              value:
                type: string
    RecordIdentityDocument:
      type: object
      properties:
        type:
          type: string
        name:
          type: string
        expiryDate:
          type: string
        issueDate:
          type: string
        issuer:
          type: string
        idCategory:
          type: object
          properties:
            type:
              type: string
            name:
              type: string
        entityTypes:
          type: array
          items:
            type: string
        value:
          type: string
    AbstractScreeningResult:
      type: object
      required:
        - referenceId
      properties:
        genders:
          type: array
          items:
            $ref: '#/components/schemas/RecordGender'
        entityType:
          enum:
            - INDIVIDUAL
            - ORGANISATION
        recordDates:
          type: array
          items:
            $ref: '#/components/schemas/RecordDate'
        recordType:
          $ref: '#/components/schemas/RecordType'
        dates:
          type: array
          items:
            $ref: '#/components/schemas/RecordEvent'
        locations:
          type: array
          items:
            $ref: '#/components/schemas/RecordLocation'
        names:
          type: array
          items:
            $ref: '#/components/schemas/RecordName'
        identifications:
          type: array
          items:
            $ref: '#/components/schemas/RecordIdentityDocument'
        resultId:
          type: string
        referenceId:
          type: string
        matchStrength:
          type: string
          enum:
            - WEAK
            - MEDIUM
            - STRONG
            - EXACT
        matchScore:
          type: number
        matchedTerms:
          type: array
          items:
            $ref: '#/components/schemas/MatchedTerm'
        submittedTerm:
          type: string
        providerType:
          $ref: '#/components/schemas/ProviderType'
        sources:
          type: array
          items:
            type: string
        sourceCategories:
          type: array
          items:
            type: string
        creationDate:
          type: string
        modificationDate:
          type: string
        lastAlertDate:
          type: string
    AbstractCase:
      type: object
      properties:
        caseId:
          type: string
        name:
          type: string
        providerTypes:
          type: array
          items:
            $ref: '#/components/schemas/ProviderType'
        caseScreeningState:
          type: object
          properties:
            WATCHLIST:
              type: string
              enum:
                - ANONYMOUS
                - ONGOING
                - INITIAL
            MEDIA_CHECK:
              type: string
              enum:
                - ANONYMOUS
                - ONGOING
                - INITIAL
        nameTransposition:
          type: boolean
    NewCase:
      type: object
      properties:
        caseId:
          type: string
        name:
          type: string
        providerTypes:
          type: array
          items:
            $ref: '#/components/schemas/ProviderType'
        caseScreeningState:
          type: object
          properties:
            WATCHLIST:
              type: string
              enum:
                - ANONYMOUS
                - ONGOING
                - INITIAL
            MEDIA_CHECK:
              type: string
              enum:
                - ANONYMOUS
                - ONGOING
                - INITIAL
        nameTransposition:
          type: boolean
        parentCaseSystemId:
          type: string
        groupId:
          type: string
        entityType:
          $ref: '#/components/schemas/CaseEntityType'
      required:
        - name
        - groupId
        - entityType
        - providerTypes
    LSEGCaseCreationRequest:
      type: object
      properties:
        caseId:
          type: string
        name:
          type: string
        providerTypes:
          type: array
          items:
            $ref: '#/components/schemas/ProviderType'
        caseScreeningState:
          type: object
          properties:
            WATCHLIST:
              type: string
              enum:
                - ANONYMOUS
                - ONGOING
                - INITIAL
            MEDIA_CHECK:
              type: string
              enum:
                - ANONYMOUS
                - ONGOING
                - INITIAL
        nameTransposition:
          type: boolean
        parentCaseSystemId:
          type: string
        groupId:
          type: string
        entityType:
          $ref: '#/components/schemas/CaseEntityType'
        startScreeningDate:
          type: string
        endScreeningDate:
          type: string
      required:
        - name
        - groupId
        - entityType
        - providerTypes
    MediaCheckSortCriterion:
      type: object
      properties:
        columnName:
          type: string
          enum:
            - publicationDate
        order:
          type: string
          enum:
            - ASCENDING
            - DESCENDING
    MediaCheckResultsPagination:
      properties:
        itemsPerPage:
          minimum: 1
          maximum: 100
          default: 100
          type: integer
          format: int32
        pageReference:
          type: string
    LSEGMediaCheckRequest:
      type: object
      properties:
        drilldownKeys:
          type: array
          items:
            type: string
        baseFilter:
          $ref: '#/components/schemas/MediaCheckBaseFilter'
        sort:
          $ref: '#/components/schemas/MediaCheckSortCriterion'
        pagination:
          $ref: '#/components/schemas/MediaCheckResultsPagination'
        facets:
          $ref: '#/components/schemas/MediaCheckFacetsRequest'
    MediaCheckFacetsRequest:
      type: object
      properties:
        publicationTypes:
          $ref: '#/components/schemas/MediaCheckRegularFacetRequest'
        phases:
          $ref: '#/components/schemas/MediaCheckRegularFacetRequest'
        geographies:
          $ref: '#/components/schemas/MediaCheckRegularFacetRequest'
        topics:
          $ref: '#/components/schemas/MediaCheckRegularFacetRequest'
    MediaCheckRegularFacetRequest:
      type: object
      properties:
        limit:
          minimum: 1
          maximum: 100
          type: integer
          format: int32
    MediaCheckPublicationDateRange:
      type: object
      properties:
        min:
          type: string
        max:
          type: string
    MediaCheckBaseFilter:
      type: object
      properties:
        publicationDate:
          $ref: '#/components/schemas/MediaCheckPublicationDateRange'
        query:
          type: string
        reviewRequiredArticles:
          type: boolean
          default: true
        smartFilter:
          type: boolean
        deduplicatedArticles:
          type: string
          enum:
            - STRICT
            - COMPOSITE
            - DISABLED
    MediaCheckResultsPaginationReference:
      type: object
      properties:
        current:
          type: string
        first:
          type: string
        last:
          type: string
        next:
          type: string
        previous:
          type: string
    MediaCheckResultsPaginationResponse:
      type: object
      properties:
        itemsPerPage:
          type: integer
          format: int32
        totalItems:
          type: integer
          format: int64
        pageReferences:
          $ref: '#/components/schemas/MediaCheckResultsPaginationReference'
    MediaCheckPublicationDetails:
      type: object
      properties:
        code:
          type: string
        countries:
          type: array
          items:
            type: string
        description:
          type: string
        languages:
          type: array
          items:
            type: string
        name:
          type: string
        publicationTypes:
          type: array
          items:
            type: string
        regions:
          type: array
          items:
            type: string
        sectors:
          type: array
          items:
            type: string
        status:
          type: string
    MediaCheckArticleSummary:
      type: object
      properties:
        articleId:
          type: string
        articleFound:
          type: boolean
        contentType:
          type: string
        language:
          type: string
        publicationDate:
          type: string
        publication:
          $ref: '#/components/schemas/MediaCheckPublicationDetails'
        author:
          type: string
        topics:
          type: array
          items:
            type: string
        phases:
          type: array
          items:
            type: string
        duplicatesKey:
          type: string
        title:
          type: string
        snippet:
          type: string
        geographies:
          type: array
          items:
            type: string
        wordCount:
          type: integer
          format: int32
    MediaCheckArticleContent:
      type: object
      properties:
        content:
          type: string
        copyrightHolder:
          type: string
        copyrightNotice:
          type: string
    MediaCheckResult:
      type: object
      properties:
        articleContent:
          $ref: '#/components/schemas/MediaCheckArticleContent'
        articleSummary:
          $ref: '#/components/schemas/MediaCheckArticleSummary'
    MediaCheckResultsResponse:
      type: object
      properties:
        pagination:
          $ref: '#/components/schemas/MediaCheckResultsPaginationResponse'
        totalResultCount:
          type: integer
          format: int64
        results:
          type: array
          items:
            $ref: '#/components/schemas/MediaCheckResult'
        facets:
          $ref: '#/components/schemas/MediaCheckFacetsResponse'
    MediaCheckFacetsResponse:
      type: object
      properties:
        publicationTypes:
          type: array
          items:
            $ref: '#/components/schemas/MediaCheckRegularFacetResponse'
        geographies:
          type: array
          items:
            $ref: '#/components/schemas/MediaCheckRegularFacetResponse'
        topics:
          type: array
          items:
            $ref: '#/components/schemas/MediaCheckRegularFacetResponse'
        phases:
          type: array
          items:
            $ref: '#/components/schemas/MediaCheckRegularFacetResponse'
        matchingEntities:
          type: array
          items:
            $ref: '#/components/schemas/MediaCheckMatchingEntitiesFacetResponse'
    MediaCheckRegularFacetResponse:
      type: object
      properties:
        drilldownKey:
          type: string
        facetLabel:
          type: string
        articleCount:
          type: integer
          format: int64
    MediaCheckMatchingEntitiesFacetResponse:
      type: object
      properties:
        drilldownKey:
          type: string
        facetLabel:
          type: string
        articleCount:
          type: integer
          format: int64
        matchStrength:
          type: number
          format: double
    Auth0WebhookEvent:
      title: Auth0WebhookEvent
      type: object
      properties:
        logs:
          type: array
          items:
            $ref: '#/components/schemas/Auth0Log'
      required:
        - logs
    NangoWebhookEvent:
      title: NangoWebhookEvent
      type: object
      properties:
        connectionId:
          type: string
        providerConfigKey:
          type: string
        syncName:
          type: string
        model:
          type: string
        responseResults:
          type: object
          properties:
            added:
              type: number
            updated:
              type: number
            deleted:
              type: number
        syncType:
          type: string
        modifiedAfter:
          type: string
    FlagrightRegion:
      type: string
      enum:
        - eu-1
        - us-1
        - eu-2
        - asia-1
        - asia-2
        - asia-3
        - au-1
        - me-1
    InternalProxyWebhookEvent:
      title: InternalProxyWebhookEvent
      type: object
      properties:
        sourceRegion:
          $ref: '#/components/schemas/FlagrightRegion'
        destinationRegion:
          $ref: '#/components/schemas/FlagrightRegion'
        data:
          oneOf:
            - $ref: '#/components/schemas/NangoBatchJobTrigger'
            - $ref: '#/components/schemas/AccountsRefreshBatchJobTrigger'
        createdTimestamp:
          type: number
      required:
        - sourceRegion
        - destinationRegion
        - data
        - createdTimestamp
    NangoBatchJobTrigger:
      type: object
      properties:
        tenantId:
          type: string
        type:
          type: string
          enum:
            - NANGO_DATA_FETCH
        webhookData:
          $ref: '#/components/schemas/NangoWebhookEvent'
        region:
          $ref: '#/components/schemas/FlagrightRegion'
      required:
        - tenantId
        - type
        - webhookData
        - region
    AccountsRefreshBatchJobTrigger:
      type: object
      properties:
        type:
          type: string
          enum:
            - ACCOUNTS_REFRESH
      required:
        - type
    Auth0Log:
      title: Auth0Log
      type: object
      properties:
        log_id:
          type: string
          description: Unique identifier for the log
          example: '90020240926110445520271000000000000001223372094446483298'
        data:
          type: object
          properties:
            client_id:
              type: string
              description: Unique identifier for the client
              example: uUFYLezaTSqQjj9052jiInDAaarI3f92
            client_name:
              type: string
              description: Name of the client
              example: Flagright Console (Dev)
            connection:
              type: string
              description: Type of authentication connection
              example: Username-Password-Authentication
            connection_id:
              type: string
              description: ID of the authentication connection
              example: con_oHIF5vjJvkZbUxvl
            date:
              type: string
              format: date-time
              description: Date and time of the login attempt
              example: 2024-09-26T11:04:45.462Z
            description:
              type: string
              description: Description of the log event
              example: User (aman@flagright.com) attempted 3 consecutive logins
                unsuccessfully. Brute force protection is enabled for this
                connection, further attempts are blocked from this IP address
                for this user.
            hostname:
              type: string
              description: Hostname of the application where the login attempt occurred
              example: login.console.flagright.dev
            ip:
              type: string
              description: IP address of the user attempting to login
              example: 150.129.62.238
            type:
              type: string
              description: Type of the log event
              example: limit_wc
            user_agent:
              type: string
              description: User agent string of the browser used for the login attempt
              example: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36
                (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
            user_id:
              type: string
              description: ID of the user, if available
              example: ''
            user_name:
              type: string
              description: Username of the person attempting to login
              example: aman@flagright.com
            tenant_name:
              type: string
              description: Tenant name where the login attempt happened
              example: dev-flagright
    TransactionsUniquesField:
      title: TransactionsUniquesField
      type: string
      enum:
        - TRANSACTION_STATE
        - TAGS_KEY
        - TAGS_VALUE
        - IBAN_NUMBER
        - CARD_FINGERPRINT_NUMBER
        - BANK_ACCOUNT_NUMBER
        - ACH_ACCOUNT_NUMBER
        - SWIFT_ACCOUNT_NUMBER
        - BIC
        - BANK_SWIFT_CODE
        - UPI_IDENTIFYING_NUMBER
        - IP_ADDRESS
        - PAYMENT_CHANNELS
        - CURRENCY
        - COUNTRY
        - BANK_NAMES
        - PRODUCT_TYPES
        - DEVICE_IDENTIFIER
        - 314A_INDIVIDUAL
        - 314A_BUSINESS
        - TRANSACTION_TYPES
    CasesUniquesField:
      title: CasesUniquesField
      type: string
      enum:
        - TAGS_KEY
        - TAGS_VALUE
    ProductType:
      title: ProductType
      type: string
      enum:
        - PHYSICAL_GOODS
        - DIGITAL_GOODS
        - SERVICES
        - SUBSCRIPTION
        - OTHER
    SanctionsMatchType:
      title: SanctionsMatchType
      type: string
      enum:
        - name_exact
        - aka_exact
        - name_fuzzy
        - aka_fuzzy
        - phonetic_name
        - phonetic_aka
        - equivalent_name
        - equivalent_aka
        - unknown
        - year_of_birth
        - removed_personal_title
        - removed_personal_suffix
        - removed_organisation_prefix
        - removed_organisation_suffix
        - removed_clerical_mark
        - name_variations_removal
        - document_id
        - nationality
        - gender
        - PEP_rank
        - associate_PEP_rank
        - associate_screening_type_match
        - screening_type_match
        - is_active_pep
        - is_active_sanctioned
    SanctionsEntityType:
      title: SanctionsEntityType
      type: string
      enum:
        - PERSON
        - BUSINESS
        - BANK
    FuzzinessSetting:
      title: FuzzinessSetting
      type: object
      properties:
        similarTermsConsideration:
          type: boolean
        sanitizeInputForFuzziness:
          type: boolean
        levenshteinDistanceDefault:
          type: boolean
        jarowinklerDistance:
          type: boolean
    FuzzinessSettingOptions:
      title: FuzzinessSettingOptions
      type: string
      enum:
        - LEVENSHTEIN_DISTANCE_DEFAULT
        - IGNORE_SPACES_AND_SPECIAL_CHARACTERS
        - TOKENIZED_SIMILARITY_MATCHING
        - JAROWINKLER_DISTANCE
    UsersUniquesField:
      title: UsersUniquesField
      type: string
      enum:
        - BUSINESS_INDUSTRY
        - TAGS_KEY
        - TAGS_VALUE
    RiskEntityType:
      type: string
      title: Risk entity type
      enum:
        - CONSUMER_USER
        - TRANSACTION
        - BUSINESS
    UsersUniquesResponse:
      type: object
      properties:
        businessIndustry:
          type: array
          items:
            type: string
      required:
        - businessIndustry
    DeleteTenantStatusEnum:
      type: string
      enum:
        - PENDING
        - IN_PROGRESS
        - FAILED
        - CANCELLED
        - WAITING_HARD_DELETE
        - HARD_DELETED
    DeleteTenantStatus:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/DeleteTenantStatusEnum'
        timestamp:
          type: number
        message:
          type: string
      required:
        - status
        - timestamp
    DeleteTenant:
      type: object
      properties:
        tenantName:
          type: string
        tenantId:
          type: string
        notRecoverable:
          type: boolean
        createdTimestamp:
          type: number
        hardDeleteTimestamp:
          type: number
        updatedTimestamp:
          type: number
        triggeredById:
          type: string
        triggeredByEmail:
          type: string
        statuses:
          type: array
          items:
            $ref: '#/components/schemas/DeleteTenantStatus'
        latestStatus:
          $ref: '#/components/schemas/DeleteTenantStatusEnum'
    AuditLogType:
      title: AuditLogType
      type: string
      enum:
        - TENANT
        - RULE
        - ACCOUNT
        - ROLE
        - CASE
        - USER
        - RISK_SCORING
        - RISK_FACTOR
        - ALERT
        - WEBHOOK
        - API-KEY
        - SAR
        - SLA
        - LIST
        - TRANSACTION
    AuditLogActionEnum:
      title: AuditLogActionEnum
      type: string
      enum:
        - CREATE
        - DELETE
        - DEACTIVATE
        - VIEW
        - DOWNLOAD
        - CALCULATE
        - UPDATE
        - ESCALATE
        - ROTATE
        - APPROACHING_DEACTIVATION
    AllReportType:
      title: AllReportType
      type: boolean
    TableListViewEnum:
      title: TableListViewEnum
      type: string
      enum:
        - TABLE
        - DOWNLOAD
    AuditLog:
      title: AuditLog
      type: object
      properties:
        auditlogId:
          type: string
        type:
          $ref: '#/components/schemas/AuditLogType'
        subtype:
          type: string
          enum:
            - COMMENT
            - COMMENT_ALERT
            - COMMENT_CASE
            - VIEW_CASE
            - VIEW_ALERT
            - CASE_LIST
            - CASE_REPORT
            - ALERT_LIST
            - DOCUMENT
            - RISK_CLASSIFICATION
            - RISK_CLASSIFICATION_PROPOSAL
            - RISK_FACTOR
            - RISK_FACTOR_PROPOSAL
            - DRS_RISK_LEVEL
            - PARAMETER_RISK_ITEM
            - ASSIGNMENT
            - CREATION
            - STATUS_CHANGE
            - MANUAL_CASE_CREATION
            - MANUAL_CASE_TRANSACTIONS_ADDITION
            - CHECKLIST_QA_STATUS_CHANGE
            - CHECKLIST_ITEM_STATUS_CHANGE
            - USER_STATUS_CHANGE
            - USER_KYC_STATUS_CHANGE
            - USER_CHANGE_PROPOSAL
            - REVIEW_ASSIGNMENT
            - API_UPDATE
            - API_CREATION
            - TAGS_UPDATE
            - SLA_POLICY_UPDATE
            - SLA_STATUS_UPDATE
            - WEBHOOK
            - SAR_UPDATE
            - SAR_DELETE
            - SAR_LIST
            - RISK_FACTOR_V8
            - ACCOUNT
            - ROLE
            - LIST_HEADER
            - LIST_ITEM
            - TRANSACTION_LIST
            - USER_LIST
            - USER_VIEW
            - RULE_INSTANCES
            - RULE_LIBRARY
            - API_KEY_ROTATE
        action:
          $ref: '#/components/schemas/AuditLogActionEnum'
        timestamp:
          type: number
        entityId:
          type: string
        oldImage:
          type: object
        newImage:
          type: object
        logMetadata:
          type: object
        user:
          $ref: '#/components/schemas/Account'
      required:
        - type
        - action
    NewListPayload:
      title: NewListPayload
      type: object
      properties:
        subtype:
          $ref: '#/components/schemas/ListSubtypeInternal'
        data:
          $ref: '#/components/schemas/ListData'
        file:
          $ref: '#/components/schemas/FileInfo'
      required:
        - subtype
        - data
    UserFlatFileUploadRequest:
      title: UserFlatFileUploadRequest
      type: object
      properties:
        file:
          $ref: '#/components/schemas/FileInfo'
        type:
          type: string
          enum:
            - BUSINESS
            - CONSUMER
      required:
        - file
        - type
    ListExistedInternal:
      type: object
      properties:
        listId:
          type: string
        header:
          $ref: '#/components/schemas/ListHeaderInternal'
        items:
          type: array
          description: List items
          items:
            $ref: '#/components/schemas/ListItem'
      required:
        - listId
        - header
        - items
    TransactionFlatFileUploadRequest:
      title: TransactionFlatFileUploadRequest
      type: object
      properties:
        file:
          $ref: '#/components/schemas/FileInfo'
      required:
        - file
    ListHeaderInternal:
      type: object
      properties:
        listId:
          type: string
        listType:
          $ref: '#/components/schemas/ListType'
        subtype:
          $ref: '#/components/schemas/ListSubtypeInternal'
        metadata:
          $ref: '#/components/schemas/ListMetadata'
        createdTimestamp:
          type: number
        size:
          type: number
        version:
          type: number
      required:
        - listId
        - listType
        - subtype
        - createdTimestamp
    ListSubtypeInternal:
      title: ListSubtypeInternal
      type: string
      enum:
        - USER_ID
        - CARD_FINGERPRINT_NUMBER
        - IBAN_NUMBER
        - BANK_ACCOUNT_NUMBER
        - ACH_ACCOUNT_NUMBER
        - SWIFT_ACCOUNT_NUMBER
        - BIC
        - BANK_SWIFT_CODE
        - UPI_IDENTIFYING_NUMBER
        - IP_ADDRESS
        - DEVICE_IDENTIFIER
        - STRING
        - COUNTRY
        - 314A_INDIVIDUAL
        - 314A_BUSINESS
        - CUSTOM
    SimulationRiskLevelsParameters:
      title: SimulationRiskLevelsParameters
      type: object
      properties:
        type:
          $ref: '#/components/schemas/SimulationRiskLevelsType'
        classificationValues:
          type: array
          items:
            $ref: '#/components/schemas/RiskClassificationScore'
        sampling:
          $ref: '#/components/schemas/SimulationRiskLevelsSampling'
        name:
          type: string
        description:
          type: string
      required:
        - type
        - name
    SimulationBeaconSampling:
      title: SimulationBeaconSampling
      type: object
      properties:
        transactionsCount:
          type: number
        filters:
          type: object
          properties:
            afterTimestamp:
              type: number
            beforeTimestamp:
              type: number
          required:
            - afterTimestamp
            - beforeTimestamp
      required:
        - transactionsCount
    SimulationBeaconParameters:
      title: SimulationBeaconParameters
      type: object
      properties:
        type:
          $ref: '#/components/schemas/SimulationBeaconType'
        ruleInstance:
          $ref: '#/components/schemas/RuleInstance'
        sampling:
          $ref: '#/components/schemas/SimulationBeaconSampling'
        name:
          type: string
        description:
          type: string
      required:
        - type
        - ruleInstance
        - name
    SimulationBeaconParametersRequest:
      title: SimulationBeaconParametersRequest
      type: object
      properties:
        jobId:
          type: string
        parameters:
          type: array
          items:
            $ref: '#/components/schemas/SimulationBeaconParameters'
        type:
          $ref: '#/components/schemas/SimulationBeaconType'
        defaultRuleInstance:
          $ref: '#/components/schemas/RuleInstance'
      required:
        - parameters
        - type
        - defaultRuleInstance
    SimulationBeaconStatistics:
      title: SimulationBeaconStatistics
      type: object
      properties:
        totalCases:
          type: number
        transactionsHit:
          type: number
        usersHit:
          type: number
        falsePositivesCases:
          type: number
    SimulationBeaconStatisticsResult:
      title: SimulationBeaconStatisticsResult
      type: object
      properties:
        current:
          $ref: '#/components/schemas/SimulationBeaconStatistics'
        simulated:
          $ref: '#/components/schemas/SimulationBeaconStatistics'
    SimulationIteration:
      title: SimulationBeaconIteration
      type: object
      properties:
        taskId:
          type: string
        name:
          type: string
        description:
          type: string
        createdAt:
          type: number
        progress:
          type: number
          minimum: 0
          maximum: 1
        latestStatus:
          $ref: '#/components/schemas/TaskStatusChange'
        statuses:
          type: array
          items:
            $ref: '#/components/schemas/TaskStatusChange'
        totalEntities:
          type: number
      required:
        - taskId
        - progress
        - latestStatus
        - statuses
        - name
    SimulationBeaconIteration:
      type: object
      properties:
        taskId:
          type: string
        name:
          type: string
        description:
          type: string
        createdAt:
          type: number
        progress:
          type: number
          minimum: 0
          maximum: 1
        latestStatus:
          $ref: '#/components/schemas/TaskStatusChange'
        statuses:
          type: array
          items:
            $ref: '#/components/schemas/TaskStatusChange'
        totalEntities:
          type: number
        type:
          $ref: '#/components/schemas/SimulationBeaconType'
        parameters:
          $ref: '#/components/schemas/SimulationBeaconParameters'
        statistics:
          $ref: '#/components/schemas/SimulationBeaconStatisticsResult'
      required:
        - taskId
        - progress
        - latestStatus
        - statuses
        - name
        - type
        - parameters
        - statistics
    SimulationRiskLevelsParametersRequest:
      title: SimulationRiskLevelsParametersRequest
      type: object
      properties:
        jobId:
          type: string
        parameters:
          type: array
          items:
            $ref: '#/components/schemas/SimulationRiskLevelsParameters'
        type:
          $ref: '#/components/schemas/SimulationRiskLevelsType'
        defaultRiskClassifications:
          type: array
          items:
            $ref: '#/components/schemas/RiskClassificationScore'
      required:
        - parameters
        - type
        - defaultRiskClassifications
    SimulationV8RiskFactorsParametersRequest:
      title: SimulationV8RiskFactorsParametersRequest
      type: object
      properties:
        jobId:
          type: string
        parameters:
          type: array
          items:
            $ref: '#/components/schemas/SimulationV8RiskFactorsParameters'
        type:
          $ref: '#/components/schemas/SimulationV8RiskFactorsType'
      required:
        - parameters
        - type
    V8RiskSimulationJob:
      type: object
      properties:
        jobId:
          type: string
        createdAt:
          type: number
        createdBy:
          type: string
        internal:
          type: boolean
        type:
          $ref: '#/components/schemas/SimulationV8RiskFactorsType'
        iterations:
          type: array
          items:
            $ref: '#/components/schemas/SimulationV8RiskFactorsIteration'
      required:
        - jobId
        - createdBy
        - type
        - iterations
    SimulationV8RiskFactorsParameters:
      title: SimulationV8RiskFactorsParameters
      type: object
      properties:
        jobId:
          type: string
        type:
          $ref: '#/components/schemas/SimulationV8RiskFactorsType'
        parameters:
          type: array
          items:
            $ref: '#/components/schemas/RiskFactor'
        name:
          type: string
        description:
          type: string
        riskScoringAlgorithm:
          oneOf:
            - $ref: '#/components/schemas/FormulaLegacyMovingAvg'
            - $ref: '#/components/schemas/FormulaSimpleAvg'
            - $ref: '#/components/schemas/FormulaCustom'
        sampling:
          $ref: '#/components/schemas/SimulationRiskFactorsSampling'
      required:
        - parameters
        - name
        - description
        - type
        - sampling
    SimulationRiskLevelsSampling:
      title: SimulationRiskLevelsSampling
      type: object
      properties:
        usersCount:
          type: integer
        userLatestTransactionsCount:
          type: integer
    SimulationRiskFactorsSampling:
      title: SimulationRiskFactorsSampling
      type: object
      properties:
        sample:
          oneOf:
            - $ref: '#/components/schemas/AllUserSample'
            - $ref: '#/components/schemas/RandomUserSample'
      required:
        - sample
    AllUserSample:
      title: AllUserSample
      type: object
      properties:
        type:
          enum:
            - ALL
      required:
        - type
    RandomUserSample:
      title: RandomUserSample
      type: object
      properties:
        type:
          enum:
            - RANDOM
        sampleDetails:
          $ref: '#/components/schemas/RiskFactorSampleDetails'
      required:
        - type
        - sampleDetails
    RiskFactorSampleDetails:
      title: RandomRiskFactorSample
      type: object
      properties:
        userCount:
          type: number
        userRiskRange:
          $ref: '#/components/schemas/RiskRange'
        userIds:
          type: array
          items:
            type: string
        listIds:
          type: array
          items:
            type: string
        transactionIds:
          type: array
          items:
            type: string
      required:
        - userCount
    RiskRange:
      title: Risk Range
      type: object
      properties:
        startScore:
          type: number
        endScore:
          type: number
      required:
        - startScore
        - endScore
    SimulationJob:
      title: SimulationRiskLevelsJob
      type: object
      properties:
        jobId:
          type: string
        createdAt:
          type: number
        createdBy:
          type: string
        internal:
          type: boolean
      required:
        - jobId
        - createdBy
    RulesSearchResponse:
      title: RulesSearchResponse
      type: object
      properties:
        bestSearches:
          type: array
          items:
            $ref: '#/components/schemas/Rule'
        otherSearches:
          type: array
          items:
            $ref: '#/components/schemas/Rule'
        filtersApplied:
          type: object
          properties:
            typologies:
              type: array
              items:
                type: string
            ruleNature:
              type: array
              items:
                $ref: '#/components/schemas/RuleNature'
            checksFor:
              type: array
              items:
                type: string
            types:
              type: array
              items:
                type: string
            isAi:
              type: boolean
            tags:
              type: array
              items:
                $ref: '#/components/schemas/FilterTags'
      required:
        - bestSearches
        - otherSearches
    SimulationRiskLevelsJob:
      type: object
      properties:
        jobId:
          type: string
        createdAt:
          type: number
        createdBy:
          type: string
        internal:
          type: boolean
        type:
          $ref: '#/components/schemas/SimulationRiskLevelsType'
        iterations:
          type: array
          items:
            $ref: '#/components/schemas/SimulationRiskLevelsIteration'
        defaultRiskClassifications:
          type: array
          items:
            $ref: '#/components/schemas/RiskClassificationScore'
      required:
        - jobId
        - createdBy
        - type
        - iterations
        - defaultRiskClassifications
    SimulationBeaconJob:
      type: object
      properties:
        jobId:
          type: string
        createdAt:
          type: number
        createdBy:
          type: string
        internal:
          type: boolean
        type:
          $ref: '#/components/schemas/SimulationBeaconType'
        iterations:
          type: array
          items:
            $ref: '#/components/schemas/SimulationBeaconIteration'
        defaultRuleInstance:
          $ref: '#/components/schemas/RuleInstance'
      required:
        - jobId
        - createdBy
        - type
        - iterations
        - defaultRuleInstance
    SimulationRiskLevelsIteration:
      type: object
      properties:
        taskId:
          type: string
        name:
          type: string
        description:
          type: string
        createdAt:
          type: number
        progress:
          type: number
          minimum: 0
          maximum: 1
        latestStatus:
          $ref: '#/components/schemas/TaskStatusChange'
        statuses:
          type: array
          items:
            $ref: '#/components/schemas/TaskStatusChange'
        totalEntities:
          type: number
        type:
          $ref: '#/components/schemas/SimulationRiskLevelsType'
        parameters:
          $ref: '#/components/schemas/SimulationRiskLevelsParameters'
        statistics:
          $ref: '#/components/schemas/SimulationRiskLevelsStatisticsResult'
      required:
        - taskId
        - progress
        - latestStatus
        - statuses
        - name
        - type
        - parameters
        - statistics
    SimulationV8RiskFactorsIteration:
      type: object
      properties:
        taskId:
          type: string
        name:
          type: string
        description:
          type: string
        createdAt:
          type: number
        progress:
          type: number
          minimum: 0
          maximum: 1
        latestStatus:
          $ref: '#/components/schemas/TaskStatusChange'
        statuses:
          type: array
          items:
            $ref: '#/components/schemas/TaskStatusChange'
        totalEntities:
          type: number
        type:
          $ref: '#/components/schemas/SimulationV8RiskFactorsType'
        parameters:
          $ref: '#/components/schemas/SimulationV8RiskFactorsParameters'
        statistics:
          $ref: '#/components/schemas/SimulationV8RiskFactorsStatisticsResult'
      required:
        - taskId
        - progress
        - latestStatus
        - statuses
        - name
        - type
        - parameters
        - statistics
    SimulationV8RiskFactorsType:
      title: SimulationV8RiskFactorsType
      type: string
      enum:
        - RISK_FACTORS_V8
    SimulationV8RiskFactorsStatisticsResult:
      title: SimulationV8RiskFactorsStatisticsResult
      type: object
      properties:
        current:
          type: array
          items:
            $ref: '#/components/schemas/SimulationV8RiskFactorsStatistics'
        simulated:
          type: array
          items:
            $ref: '#/components/schemas/SimulationV8RiskFactorsStatistics'
    SimulationV8RiskFactorsStatistics:
      title: SimulationV8RiskFactorsStatistics
      type: object
      properties:
        count:
          type: number
        riskType:
          type: string
          enum:
            - KRS
            - ARS
            - DRS
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
    TrsScoresResponse:
      title: TrsScoresResponse
      type: object
      properties:
        average:
          type: number
      required:
        - average
    TenantFeatures:
      title: TenantFeatures
      type: object
      properties:
        tenantId:
          type: string
        tenantName:
          type: string
        region:
          type: string
        features:
          type: array
          items:
            $ref: '#/components/schemas/Feature'
      required:
        - tenantId
        - features
    TenantCreationRequest:
      title: TenantCreationRequest
      type: object
      properties:
        tenantName:
          type: string
        tenantWebsite:
          type: string
        features:
          type: array
          items:
            $ref: '#/components/schemas/Feature'
        adminEmails:
          type: array
          items:
            type: string
        tenantId:
          type: string
        auth0Domain:
          type: string
        auth0DisplayName:
          type: string
        seats:
          type: number
        siloDataMode:
          type: boolean
        sarJurisdiction:
          type: array
          items:
            type: string
      required:
        - tenantName
        - tenantWebsite
        - auth0Domain
        - auth0DisplayName
        - adminEmails
        - features
    SimulationRiskLevelsStatistics:
      type: object
      title: SimulationRiskLevelsStatistics
      properties:
        count:
          type: number
        riskType:
          type: string
          enum:
            - KRS
            - DRS
            - ARS
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
    SimulationRiskLevelsStatisticsResult:
      type: object
      title: SimulationRiskLevelsStatisticsResult
      properties:
        current:
          type: array
          items:
            $ref: '#/components/schemas/SimulationRiskLevelsStatistics'
        simulated:
          type: array
          items:
            $ref: '#/components/schemas/SimulationRiskLevelsStatistics'
    SimulationRiskLevelsType:
      title: SimulationRiskLevelsType
      type: string
      enum:
        - PULSE
    SimulationBeaconType:
      title: SimulationBeaconType
      type: string
      enum:
        - BEACON
    SimulationRiskLevelsRiskScoreResult:
      title: SimulationRiskLevelsResult
      type: object
      properties:
        krs:
          type: object
          properties:
            riskScore:
              type: number
            riskLevel:
              $ref: '#/components/schemas/RiskLevel'
        drs:
          type: object
          properties:
            riskScore:
              type: number
            riskLevel:
              $ref: '#/components/schemas/RiskLevel'
    SimulationBeaconUser:
      title: SimulationBeaconUser
      type: object
      properties:
        userId:
          type: string
        userName:
          type: string
        userType:
          $ref: '#/components/schemas/UserType'
        riskScore:
          type: number
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
      required:
        - userId
        - userName
        - userType
    SimulationBeaconResultUser:
      type: object
      properties:
        userId:
          type: string
        userName:
          type: string
        userType:
          $ref: '#/components/schemas/UserType'
        riskScore:
          type: number
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        type:
          type: string
          enum:
            - BEACON_USER
        taskId:
          type: string
        hit:
          $ref: '#/components/schemas/SimulationBeaconHit'
      required:
        - userId
        - userName
        - userType
        - taskId
        - type
        - hit
    SimulationBeaconPaymentDetails:
      title: SimulationBeaconPaymentDetails
      type: object
      properties:
        paymentMethod:
          $ref: '#/components/schemas/PaymentMethod'
        paymentMethodId:
          type: string
      required:
        - paymentMethod
        - paymentMethodId
    SimulationBeaconTransactionResult:
      title: SimulationBeaconTransactionResult
      type: object
      properties:
        taskId:
          type: string
        type:
          type: string
          enum:
            - BEACON_TRANSACTION
        transactionType:
          type: string
        timestamp:
          type: number
        action:
          $ref: '#/components/schemas/RuleAction'
        transactionId:
          type: string
        originUser:
          $ref: '#/components/schemas/SimulationBeaconUser'
        destinationUser:
          $ref: '#/components/schemas/SimulationBeaconUser'
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        riskScore:
          type: number
        originAmountDetails:
          $ref: '#/components/schemas/TransactionAmountDetails'
        destinationAmountDetails:
          $ref: '#/components/schemas/TransactionAmountDetails'
        originPaymentDetails:
          $ref: '#/components/schemas/SimulationBeaconPaymentDetails'
        destinationPaymentDetails:
          $ref: '#/components/schemas/SimulationBeaconPaymentDetails'
        hit:
          $ref: '#/components/schemas/SimulationBeaconHit'
      required:
        - taskId
        - type
        - transactionId
        - tranasctionType
        - hit
        - timestamp
        - action
    SimulationBeaconHit:
      title: SimulationBeaconHit
      type: string
      enum:
        - HIT
        - NO_HIT
    SimulationRiskLevelsResult:
      title: SimulationRiskLevelsResult
      type: object
      properties:
        taskId:
          type: string
        type:
          type: string
          enum:
            - PULSE
        userId:
          type: string
        userType:
          type: string
        current:
          $ref: '#/components/schemas/SimulationRiskLevelsRiskScoreResult'
        simulated:
          $ref: '#/components/schemas/SimulationRiskLevelsRiskScoreResult'
        userName:
          type: string
      required:
        - taskId
        - type
        - userId
        - old
        - new
        - userName
    SimulationV8RiskFactorsResult:
      title: SimulationV8RiskFactorsResult
      type: object
      properties:
        taskId:
          type: string
        type:
          type: string
          enum:
            - RISK_FACTORS_V8
        userId:
          type: string
        userType:
          type: string
        current:
          $ref: '#/components/schemas/SimulationRiskLevelsRiskScoreResult'
        simulated:
          $ref: '#/components/schemas/SimulationRiskLevelsRiskScoreResult'
        userName:
          type: string
      required:
        - taskId
        - type
        - userId
        - old
        - new
        - userName
    SimulationRiskLevelsAndRiskFactorsResult:
      title: SimulationRiskLevelsAndRiskFactorsResult
      type: object
      properties:
        taskId:
          type: string
        type:
          type: string
          enum:
            - PULSE
            - RISK_FACTORS_V8
        userId:
          type: string
        userType:
          type: string
        current:
          $ref: '#/components/schemas/SimulationRiskLevelsRiskScoreResult'
        simulated:
          $ref: '#/components/schemas/SimulationRiskLevelsRiskScoreResult'
        userName:
          type: string
      required:
        - taskId
        - type
        - userId
        - old
        - new
        - userName
    SimulationV8RiskFactorsResultResponse:
      title: SimulationV8RiskFactorsResultResponse
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/SimulationV8RiskFactorsResult'
        total:
          type: number
      required:
        - items
        - total
    SimulationRiskLevelsAndRiskFactorsResultResponse:
      title: SimulationRiskLevelsAndRiskFactorsResultResponse
      type: object
      properties:
        items:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/SimulationRiskLevelsAndRiskFactorsResult'
              - $ref: '#/components/schemas/SimulationBeaconTransactionResult'
              - $ref: '#/components/schemas/SimulationBeaconResultUser'
        total:
          type: number
      required:
        - items
        - total
    SortOrder:
      type: string
      enum:
        - ascend
        - descend
    Info:
      type: object
      properties:
        region:
          type: string
      required:
        - region
    SimulationPostRequest:
      type: object
      properties:
        riskLevelsParameters:
          $ref: '#/components/schemas/SimulationRiskLevelsParametersRequest'
        beaconParameters:
          $ref: '#/components/schemas/SimulationBeaconParametersRequest'
        riskFactorsV8Parameters:
          $ref: '#/components/schemas/SimulationV8RiskFactorsParametersRequest'
    SimulationPostResponse:
      type: object
      properties:
        taskIds:
          type: array
          items:
            type: string
        jobId:
          type: string
      required:
        - taskIds
        - jobId
    SimulationGetResponse:
      title: SimulationGetResponse
      type: object
      properties:
        total:
          type: integer
        data:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/SimulationRiskLevelsJob'
              - $ref: '#/components/schemas/SimulationBeaconJob'
              - $ref: '#/components/schemas/V8RiskSimulationJob'
      required:
        - total
        - data
    SimulationStats:
      type: object
      properties:
        runJobsCount:
          type: integer
      required:
        - runJobsCount
    CaseHierarchyDetails:
      title: CaseHierarchyDetails
      type: object
      properties:
        parentCaseId:
          type: string
        childCaseIds:
          type: array
          items:
            type: string
        childTransactionIds:
          type: array
          items:
            type: string
    ReportHierarchyDetails:
      title: ReportHierarchyDetails
      type: object
      properties:
        parentId:
          type: string
        childIds:
          type: array
          items:
            type: string
    NarrativeTemplateRequest:
      title: NarrativeTemplateRequest
      type: object
      properties:
        name:
          type: string
        description:
          type: string
      required:
        - name
        - description
    NarrativeTemplate:
      title: NarrativeTemplate
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        id:
          type: string
        createdAt:
          type: number
        updatedAt:
          type: number
        _id:
          type: string
      required:
        - name
        - description
        - id
        - createdAt
        - updatedAt
    NarrativeTemplateResponse:
      title: NarrativeTemplateResponse
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/NarrativeTemplate'
        total:
          type: number
      required:
        - items
        - total
    ReportSchema:
      title: ReportSchema
      type: object
      properties:
        settings:
          type: object
          properties:
            propertyNameStyle:
              type: string
              enum:
                - SNAKE_CASE
                - AS_IS
                - CAMEL_CASE
            disableAttachmentsStep:
              type: boolean
        reportSchema:
          type: object
        transactionMetadataSchema:
          type: object
        customerAndAccountDetailsSchema:
          type: object
        transactionSchema:
          type: object
        definitionsSchema:
          type: object
        currencyTransactionSchema:
          type: object
        indicators:
          type: array
          items:
            type: object
            required:
              - key
              - description
            properties:
              key:
                type: string
              description:
                type: string
    ReportType:
      title: ReportType
      type: object
      required:
        - id
        - type
        - countryCode
        - country
        - directSubmission
        - reportStatuses
      properties:
        id:
          type: string
        type:
          type: string
        subjectType:
          type: array
          items:
            $ref: '#/components/schemas/ReportSubjectType'
        implemented:
          type: boolean
        country:
          type: string
        countryCode:
          $ref: '#/components/schemas/CountryCode'
        directSubmission:
          type: boolean
        reportStatuses:
          oneOf:
            - type: array
              items:
                $ref: '#/components/schemas/FincenReportValidStatus'
            - type: array
              items:
                $ref: '#/components/schemas/NonFincenReportValidStatus'
    ReportSubjectType:
      title: ReportSubjectType
      type: string
      enum:
        - CASE
        - USER
    ReportRevision:
      title: ReportRevision
      type: object
      required:
        - output
        - createdAt
      properties:
        output:
          type: string
        createdAt:
          type: number
    NonFincenReportValidStatus:
      type: string
      title: NonFincenReportValidStatus
      description: report status for those jurisdiction that don't support fincen
        report submission
      enum:
        - COMPLETE
        - DRAFT
    FincenReportValidStatus:
      type: string
      title: FincenReportValidStatus
      description: report status for those jurisdiction that support fincen report
        submission
      enum:
        - DRAFT
        - SUBMITTING
        - SUBMISSION_ACCEPTED
        - SUBMISSION_REJECTED
        - SUBMISSION_SUCCESSFUL
    ReportStatus:
      type: string
      title: ReportStatus
      enum:
        - DRAFT
        - SUBMITTING
        - SUBMISSION_ACCEPTED
        - SUBMISSION_REJECTED
        - SUBMISSION_SUCCESSFUL
        - COMPLETE
    FincenReportStatus:
      type: string
      title: FincenReportStatus
      description: status returned from fincen sftp server
      enum:
        - ACCEPTED
        - REJECTED
        - A
        - R
        - P
        - E
    Report:
      title: Report
      type: object
      required:
        - name
        - description
        - createdById
        - reportTypeId
        - status
        - createdAt
        - updatedAt
        - parameters
        - comments
        - revisions
        - caseUserId
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        status:
          $ref: '#/components/schemas/ReportStatus'
        statusInfo:
          type: string
        caseId:
          type: string
        reportTypeId:
          type: string
        schema:
          $ref: '#/components/schemas/ReportSchema'
          readOnly: true
        caseUserId:
          type: string
        createdById:
          type: string
        createdByName:
          type: string
        createdAt:
          type: number
        updatedAt:
          type: number
        parameters:
          $ref: '#/components/schemas/ReportParameters'
        comments:
          type: array
          items:
            $ref: '#/components/schemas/Comment'
        revisions:
          type: array
          items:
            $ref: '#/components/schemas/ReportRevision'
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/FileInfo'
        hierarchy:
          $ref: '#/components/schemas/ReportHierarchyDetails'
        caseUser:
          oneOf:
            - $ref: '#/components/schemas/InternalConsumerUser'
            - $ref: '#/components/schemas/InternalBusinessUser'
        lastAckFetchTime:
          type: number
        trackingId:
          type: string
        BSAID:
          type: string
        sftpFileName:
          type: string
    ReportParameters:
      type: object
      properties:
        report:
          type: object
        transactionMetadata:
          type: object
        customerAndAccountDetails:
          type: object
        indicators:
          type: array
          items:
            type: string
        transactions:
          type: array
          items:
            type: object
            required:
              - id
              - transaction
            properties:
              id:
                type: string
              transaction:
                type: object
        currencyTransaction:
          type: object
        definitions:
          type: object
    ReportTypesResponse:
      title: ReportTypesResponse
      type: object
      properties:
        total:
          type: integer
        data:
          type: array
          items:
            $ref: '#/components/schemas/ReportType'
      required:
        - total
        - data
    ReportsResponse:
      title: ReportsResponse
      type: object
      properties:
        total:
          type: integer
        items:
          type: array
          items:
            $ref: '#/components/schemas/Report'
      required:
        - total
        - items
    ReportStatusUpdateRequest:
      title: ReportStatusUpdateRequest
      type: object
      required:
        - status
        - statusInfo
      properties:
        status:
          $ref: '#/components/schemas/ReportStatus'
        statusInfo:
          type: string
    ReportAckResponse:
      title: ReportAckResponse
      type: object
      properties:
        initalAck:
          $ref: '#/components/schemas/Batch'
        ack:
          $ref: '#/components/schemas/EFilingSubmissionXML'
    Timezone:
      type: string
      title: Timezone
      enum:
        - Africa/Abidjan
        - Africa/Algiers
        - Africa/Bissau
        - Africa/Cairo
        - Africa/Casablanca
        - Africa/Ceuta
        - Africa/El_Aaiun
        - Africa/Johannesburg
        - Africa/Juba
        - Africa/Khartoum
        - Africa/Lagos
        - Africa/Maputo
        - Africa/Monrovia
        - Africa/Nairobi
        - Africa/Ndjamena
        - Africa/Sao_Tome
        - Africa/Tripoli
        - Africa/Tunis
        - Africa/Windhoek
        - America/Adak
        - America/Anchorage
        - America/Araguaina
        - America/Argentina/Buenos_Aires
        - America/Argentina/Catamarca
        - America/Argentina/Cordoba
        - America/Argentina/Jujuy
        - America/Argentina/La_Rioja
        - America/Argentina/Mendoza
        - America/Argentina/Rio_Gallegos
        - America/Argentina/Salta
        - America/Argentina/San_Juan
        - America/Argentina/San_Luis
        - America/Argentina/Tucuman
        - America/Argentina/Ushuaia
        - America/Asuncion
        - America/Bahia
        - America/Bahia_Banderas
        - America/Barbados
        - America/Belem
        - America/Belize
        - America/Boa_Vista
        - America/Bogota
        - America/Boise
        - America/Cambridge_Bay
        - America/Campo_Grande
        - America/Cancun
        - America/Caracas
        - America/Cayenne
        - America/Chicago
        - America/Chihuahua
        - America/Ciudad_Juarez
        - America/Costa_Rica
        - America/Cuiaba
        - America/Danmarkshavn
        - America/Dawson
        - America/Dawson_Creek
        - America/Denver
        - America/Detroit
        - America/Edmonton
        - America/Eirunepe
        - America/El_Salvador
        - America/Fort_Nelson
        - America/Fortaleza
        - America/Glace_Bay
        - America/Goose_Bay
        - America/Grand_Turk
        - America/Guatemala
        - America/Guayaquil
        - America/Guyana
        - America/Halifax
        - America/Havana
        - America/Hermosillo
        - America/Indiana/Indianapolis
        - America/Indiana/Knox
        - America/Indiana/Marengo
        - America/Indiana/Petersburg
        - America/Indiana/Tell_City
        - America/Indiana/Vevay
        - America/Indiana/Vincennes
        - America/Indiana/Winamac
        - America/Inuvik
        - America/Iqaluit
        - America/Jamaica
        - America/Juneau
        - America/Kentucky/Louisville
        - America/Kentucky/Monticello
        - America/La_Paz
        - America/Lima
        - America/Los_Angeles
        - America/Maceio
        - America/Managua
        - America/Manaus
        - America/Martinique
        - America/Matamoros
        - America/Mazatlan
        - America/Menominee
        - America/Merida
        - America/Metlakatla
        - America/Mexico_City
        - America/Miquelon
        - America/Moncton
        - America/Monterrey
        - America/Montevideo
        - America/New_York
        - America/Nome
        - America/Noronha
        - America/North_Dakota/Beulah
        - America/North_Dakota/Center
        - America/North_Dakota/New_Salem
        - America/Nuuk
        - America/Ojinaga
        - America/Panama
        - America/Paramaribo
        - America/Phoenix
        - America/Port-au-Prince
        - America/Porto_Velho
        - America/Puerto_Rico
        - America/Punta_Arenas
        - America/Rankin_Inlet
        - America/Recife
        - America/Regina
        - America/Resolute
        - America/Rio_Branco
        - America/Santarem
        - America/Santiago
        - America/Santo_Domingo
        - America/Sao_Paulo
        - America/Scoresbysund
        - America/Sitka
        - America/St_Johns
        - America/Swift_Current
        - America/Tegucigalpa
        - America/Thule
        - America/Tijuana
        - America/Toronto
        - America/Vancouver
        - America/Whitehorse
        - America/Winnipeg
        - America/Yakutat
        - Antarctica/Casey
        - Antarctica/Davis
        - Antarctica/Macquarie
        - Antarctica/Mawson
        - Antarctica/Palmer
        - Antarctica/Rothera
        - Antarctica/Troll
        - Asia/Almaty
        - Asia/Amman
        - Asia/Anadyr
        - Asia/Aqtau
        - Asia/Aqtobe
        - Asia/Ashgabat
        - Asia/Atyrau
        - Asia/Baghdad
        - Asia/Baku
        - Asia/Bangkok
        - Asia/Barnaul
        - Asia/Beirut
        - Asia/Bishkek
        - Asia/Chita
        - Asia/Choibalsan
        - Asia/Colombo
        - Asia/Damascus
        - Asia/Dhaka
        - Asia/Dili
        - Asia/Dubai
        - Asia/Dushanbe
        - Asia/Famagusta
        - Asia/Gaza
        - Asia/Hebron
        - Asia/Ho_Chi_Minh
        - Asia/Hong_Kong
        - Asia/Hovd
        - Asia/Irkutsk
        - Asia/Jakarta
        - Asia/Jayapura
        - Asia/Jerusalem
        - Asia/Kabul
        - Asia/Kamchatka
        - Asia/Karachi
        - Asia/Kathmandu
        - Asia/Khandyga
        - Asia/Kolkata
        - Asia/Krasnoyarsk
        - Asia/Kuching
        - Asia/Macau
        - Asia/Magadan
        - Asia/Makassar
        - Asia/Manila
        - Asia/Nicosia
        - Asia/Novokuznetsk
        - Asia/Novosibirsk
        - Asia/Omsk
        - Asia/Oral
        - Asia/Pontianak
        - Asia/Pyongyang
        - Asia/Qatar
        - Asia/Qostanay
        - Asia/Qyzylorda
        - Asia/Riyadh
        - Asia/Sakhalin
        - Asia/Samarkand
        - Asia/Seoul
        - Asia/Shanghai
        - Asia/Singapore
        - Asia/Srednekolymsk
        - Asia/Taipei
        - Asia/Tashkent
        - Asia/Tbilisi
        - Asia/Tehran
        - Asia/Thimphu
        - Asia/Tokyo
        - Asia/Tomsk
        - Asia/Ulaanbaatar
        - Asia/Urumqi
        - Asia/Ust-Nera
        - Asia/Vladivostok
        - Asia/Yakutsk
        - Asia/Yangon
        - Asia/Yekaterinburg
        - Asia/Yerevan
        - Atlantic/Azores
        - Atlantic/Bermuda
        - Atlantic/Canary
        - Atlantic/Cape_Verde
        - Atlantic/Faroe
        - Atlantic/Madeira
        - Atlantic/South_Georgia
        - Atlantic/Stanley
        - Australia/Adelaide
        - Australia/Brisbane
        - Australia/Broken_Hill
        - Australia/Darwin
        - Australia/Eucla
        - Australia/Hobart
        - Australia/Lindeman
        - Australia/Lord_Howe
        - Australia/Melbourne
        - Australia/Perth
        - Australia/Sydney
        - CET
        - CST6CDT
        - EET
        - EST
        - EST5EDT
        - Etc/GMT
        - Etc/GMT-1
        - Etc/GMT-10
        - Etc/GMT-11
        - Etc/GMT-12
        - Etc/GMT-13
        - Etc/GMT-14
        - Etc/GMT-2
        - Etc/GMT-3
        - Etc/GMT-4
        - Etc/GMT-5
        - Etc/GMT-6
        - Etc/GMT-7
        - Etc/GMT-8
        - Etc/GMT-9
        - Etc/GMT+1
        - Etc/GMT+10
        - Etc/GMT+11
        - Etc/GMT+12
        - Etc/GMT+2
        - Etc/GMT+3
        - Etc/GMT+4
        - Etc/GMT+5
        - Etc/GMT+6
        - Etc/GMT+7
        - Etc/GMT+8
        - Etc/GMT+9
        - Etc/UTC
        - Europe/Andorra
        - Europe/Astrakhan
        - Europe/Athens
        - Europe/Belgrade
        - Europe/Berlin
        - Europe/Brussels
        - Europe/Bucharest
        - Europe/Budapest
        - Europe/Chisinau
        - Europe/Dublin
        - Europe/Gibraltar
        - Europe/Helsinki
        - Europe/Istanbul
        - Europe/Kaliningrad
        - Europe/Kirov
        - Europe/Kyiv
        - Europe/Lisbon
        - Europe/London
        - Europe/Madrid
        - Europe/Malta
        - Europe/Minsk
        - Europe/Moscow
        - Europe/Paris
        - Europe/Prague
        - Europe/Riga
        - Europe/Rome
        - Europe/Samara
        - Europe/Saratov
        - Europe/Simferopol
        - Europe/Sofia
        - Europe/Tallinn
        - Europe/Tirane
        - Europe/Ulyanovsk
        - Europe/Vienna
        - Europe/Vilnius
        - Europe/Volgograd
        - Europe/Warsaw
        - Europe/Zurich
        - HST
        - Indian/Chagos
        - Indian/Maldives
        - Indian/Mauritius
        - MET
        - MST
        - MST7MDT
        - Pacific/Apia
        - Pacific/Auckland
        - Pacific/Bougainville
        - Pacific/Chatham
        - Pacific/Easter
        - Pacific/Efate
        - Pacific/Fakaofo
        - Pacific/Fiji
        - Pacific/Galapagos
        - Pacific/Gambier
        - Pacific/Guadalcanal
        - Pacific/Guam
        - Pacific/Honolulu
        - Pacific/Kanton
        - Pacific/Kiritimati
        - Pacific/Kosrae
        - Pacific/Kwajalein
        - Pacific/Marquesas
        - Pacific/Nauru
        - Pacific/Niue
        - Pacific/Norfolk
        - Pacific/Noumea
        - Pacific/Pago_Pago
        - Pacific/Palau
        - Pacific/Pitcairn
        - Pacific/Port_Moresby
        - Pacific/Rarotonga
        - Pacific/Tahiti
        - Pacific/Tarawa
        - Pacific/Tongatapu
        - PST8PDT
        - WET
    AlertCreationIntervalInstantly:
      title: AlertCreationIntervalInstantly
      type: object
      properties:
        type:
          type: string
          enum:
            - INSTANTLY
      required:
        - type
    DailyTime:
      type: string
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
        - 9
        - 10
        - 11
        - 12
        - 13
        - 14
        - 15
        - 16
        - 17
        - 18
        - 19
        - 20
        - 21
        - 22
        - 23
    AlertCreationIntervalDaily:
      title: AlertCreationIntervalDaily
      type: object
      properties:
        type:
          type: string
          enum:
            - DAILY
        time:
          $ref: '#/components/schemas/DailyTime'
      required:
        - type
        - time
    AlertCreationIntervalWeekly:
      title: AlertCreationIntervalWeekly
      type: object
      properties:
        type:
          type: string
          enum:
            - WEEKLY
        day:
          type: string
          enum:
            - MONDAY
            - TUESDAY
            - WEDNESDAY
            - THURSDAY
            - FRIDAY
            - SATURDAY
            - SUNDAY
      required:
        - type
        - day
    AlertCreationIntervalMonthly:
      title: AlertCreationIntervalMonthly
      type: object
      properties:
        type:
          type: string
          enum:
            - MONTHLY
        day:
          type: number
          minimum: 1
          maximum: 31
      required:
        - type
        - day
    ChecklistInfo:
      type: object
      title: ChecklistInfo
      properties:
        reason:
          type: string
        comment:
          type: string
        files:
          type: array
          items:
            $ref: '#/components/schemas/FileInfo'
    ChecklistStatus:
      type: string
      enum:
        - PASSED
        - FAILED
        - NOT_APPLICABLE
    SanctionsHitStatus:
      type: string
      enum:
        - OPEN
        - CLEARED
        - ESCALATED
    ChecklistDoneStatus:
      type: string
      enum:
        - DONE
        - NOT_DONE
        - NOT_STARTED
        - NOT_APPLICABLE
    ChecklistItemValue:
      type: object
      title: ChecklistItemValue
      properties:
        checklistItemId:
          type: string
        done:
          $ref: '#/components/schemas/ChecklistDoneStatus'
        status:
          $ref: '#/components/schemas/ChecklistStatus'
        info:
          $ref: '#/components/schemas/ChecklistInfo'
        comment:
          type: string
    ChecklistItem:
      title: ChecklistItem
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        level:
          $ref: '#/components/schemas/Priority'
      required:
        - name
        - level
    ChecklistCategory:
      title: ChecklistCategory
      type: object
      properties:
        name:
          type: string
        checklistItems:
          type: array
          items:
            $ref: '#/components/schemas/ChecklistItem'
      required:
        - name
        - checklistItems
    ChecklistTemplate:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        categories:
          type: array
          items:
            $ref: '#/components/schemas/ChecklistCategory'
        createdAt:
          type: number
        updatedAt:
          type: number
        status:
          type: string
          enum:
            - ACTIVE
            - DRAFT
        isDeleted:
          type: boolean
        deletedAt:
          type: number
        qaPassCriteria:
          type: object
          properties:
            p1Errors:
              type: number
            p2Errors:
              type: number
          required:
            - p1Errors
            - p2Errors
      required:
        - name
        - categories
        - qaPassCriteria
      title: ChecklistTemplate
    ChecklistTemplatesResponse:
      type: object
      title: ChecklistTemplatesResponse
      properties:
        total:
          type: number
        data:
          type: array
          items:
            $ref: '#/components/schemas/ChecklistTemplate'
      required:
        - total
        - data
    RuleQueue:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        createdAt:
          type: integer
        updatedAt:
          type: integer
        createdBy:
          type: string
      required:
        - name
      title: RuleQueue
    RuleQueuesResponse:
      type: object
      title: RuleQueuesResponse
      properties:
        total:
          type: number
        data:
          type: array
          items:
            $ref: '#/components/schemas/RuleQueue'
      required:
        - total
        - data
    DashboardStatsAlertAndCaseStatusDistributionStats:
      type: object
      title: DashboardStatsAlertAndCaseStatusDistributionStats
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              _id:
                type: string
              count_OPEN:
                type: number
              count_IN_PROGRESS:
                type: number
              count_ON_HOLD:
                type: number
              count_ESCALATED:
                type: number
              count_CLOSED:
                type: number
              count_REOPENED:
                type: number
              count_IN_REVIEW:
                type: number
              count_ESCALATED_L2:
                type: number
            required:
              - _id
    CaseSubjectType:
      title: CaseSubjectType
      type: string
      enum:
        - USER
        - PAYMENT
        - NAME
        - ADDRESS
        - EMAIL
    RiskScoreDetails:
      title: RiskScoreDetails
      type: object
      properties:
        score:
          type: number
        components:
          type: array
          items:
            $ref: '#/components/schemas/RiskScoreComponent'
      required:
        - score
        - components
    NotificationType:
      title: NotificationType
      type: string
      enum:
        - CASE_ASSIGNMENT
        - ALERT_ASSIGNMENT
        - CASE_UNASSIGNMENT
        - ALERT_UNASSIGNMENT
        - CASE_ESCALATION
        - ALERT_ESCALATION
        - ALERT_COMMENT_MENTION
        - CASE_COMMENT_MENTION
        - USER_COMMENT_MENTION
        - CASE_IN_REVIEW
        - ALERT_IN_REVIEW
        - ALERT_COMMENT
        - CASE_COMMENT
        - ALERT_STATUS_UPDATE
        - CASE_STATUS_UPDATE
        - RISK_CLASSIFICATION_APPROVAL
        - RISK_FACTORS_APPROVAL
        - USER_CHANGES_APPROVAL
        - API_KEY_EXPIRING
    NotificationChannels:
      title: NotificationChannels
      type: string
      enum:
        - CONSOLE
    AssignmentNotification:
      title: AssignmentNotification
      type: object
      properties:
        type:
          type: string
          enum:
            - ASSIGNMENT
        assignments:
          type: array
          items:
            $ref: '#/components/schemas/Assignment'
      required:
        - type
        - assignments
    EscalationNotification:
      title: EscalationNotification
      type: object
      properties:
        type:
          type: string
          enum:
            - ESCALATION
        reason:
          type: array
          items:
            type: string
        reviewAssignments:
          type: array
          items:
            $ref: '#/components/schemas/Assignment'
        status:
          $ref: '#/components/schemas/CaseStatus'
        childCaseId:
          type: string
      required:
        - type
        - reason
        - reviewAssignments
        - status
    UpdateNotification:
      title: UpdateNotification
      type: object
      properties:
        type:
          type: string
          enum:
            - UPDATE
        status:
          $ref: '#/components/schemas/CaseStatus'
        oldStatus:
          $ref: '#/components/schemas/CaseStatus'
      required:
        - type
        - status
    CommentMentionNotification:
      title: CommentMentionNotification
      type: object
      properties:
        type:
          type: string
          enum:
            - COMMENT_MENTION
        mentions:
          type: array
          items:
            type: string
      required:
        - type
        - assignments
    CommentNotification:
      title: CommentNotification
      type: object
      properties:
        type:
          type: string
          enum:
            - COMMENT
        comment:
          $ref: '#/components/schemas/Comment'
      required:
        - type
        - comment
    ConsoleNotificationStatus:
      title: ConsoleNotificationStatus
      type: object
      properties:
        status:
          type: string
          enum:
            - SENT
            - READ
        stausUpdatedAt:
          type: number
        recieverUserId:
          type: string
      required:
        - status
        - stausUpdatedAt
        - recieverUserId
    UserType:
      title: UserType
      type: string
      enum:
        - BUSINESS
        - CONSUMER
    Notification:
      title: Notification
      type: object
      properties:
        id:
          type: string
        notificationType:
          $ref: '#/components/schemas/NotificationType'
        notificationChannel:
          $ref: '#/components/schemas/NotificationChannels'
        createdAt:
          type: number
        triggeredBy:
          type: string
        recievers:
          type: array
          items:
            type: string
        entityId:
          type: string
        entityType:
          type: string
          enum:
            - CASE
            - ALERT
            - USER
            - RISK_LEVELS
            - RISK_FACTORS
            - API_KEY
        notificationData:
          type: object
        consoleNotificationStatuses:
          type: array
          items:
            $ref: '#/components/schemas/ConsoleNotificationStatus'
        metadata:
          type: object
          properties:
            user:
              type: object
              properties:
                userType:
                  $ref: '#/components/schemas/UserType'
            alert:
              type: object
              properties:
                caseId:
                  type: string
      required:
        - id
        - notificationType
        - notificationChannels
        - createdAt
        - triggeredBy
        - recievers
        - entityId
        - entityType
        - notificationData
    DashboardStatsRulesCountResponse:
      title: DashboardStatsRulesCountResponse
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DashboardStatsRulesCount'
        total:
          type: number
      required:
        - data
        - total
    SanctionsSettings:
      title: SanctionsSettings
      type: object
      properties:
        dowjonesCreds:
          type: object
          properties:
            username:
              type: string
            password:
              type: string
        lsegCreds:
          type: object
          properties:
            username:
              type: string
            password:
              type: string
        providerScreeningTypes:
          type: array
          items:
            type: object
            properties:
              provider:
                $ref: '#/components/schemas/SanctionsDataProviderName'
              screeningTypes:
                type: array
                items:
                  type: string
              entityTypes:
                type: array
                items:
                  type: string
        aggregateScreeningProfileData:
          type: boolean
    RuleInstanceStats:
      title: RuleInstanceStats
      type: object
      properties:
        transactionsHit:
          type: number
        usersHit:
          type: number
        alertsHit:
          type: number
        investigationTime:
          type: number
        executionStats:
          type: array
          items:
            $ref: '#/components/schemas/RuleInstanceExecutionStats'
        alertsStats:
          type: array
          items:
            $ref: '#/components/schemas/RuleInstanceAlertsStats'
        ruleInstanceUpdateStats:
          type: array
          items:
            type: string
      required:
        - usersHit
        - alertsHit
        - executionStats
    RuleInstanceExecutionStats:
      title: RuleInstanceExecutionStats
      type: object
      properties:
        date:
          type: string
        hitCount:
          type: number
        runCount:
          type: number
      required:
        - date
        - runCount
    RuleInstanceAlertsStats:
      title: RuleInstanceAlertsStats
      type: object
      properties:
        date:
          type: string
        alertsCreated:
          type: number
        falsePositiveAlerts:
          type: number
      required:
        - date
        - alertsCreated
    SLAPolicy:
      title: SLAPolicy
      type: object
      properties:
        id:
          type: string
        type:
          $ref: '#/components/schemas/SLAPolicyType'
        name:
          type: string
        description:
          type: string
        policyConfiguration:
          $ref: '#/components/schemas/SLAPolicyConfiguration'
        createdBy:
          type: string
        createdAt:
          type: number
        updatedAt:
          type: number
        isDeleted:
          type: boolean
      required:
        - name
        - policyConfiguration
        - id
        - type
        - description
        - createdBy
    SLAPolicyType:
      title: SLAPolicyType
      type: string
      enum:
        - ALERT
        - MANUAL_CASE
    SLAPolicyConfiguration:
      title: SLAPolicyConfiguration
      type: object
      properties:
        accountRoles:
          type: array
          items:
            type: string
        SLATime:
          type: object
          properties:
            breachTime:
              $ref: '#/components/schemas/SLATimeWindow'
            warningTime:
              $ref: '#/components/schemas/SLATimeWindow'
          required:
            - breachTime
        workingDays:
          type: array
          items:
            type: string
            enum:
              - MON
              - TUE
              - WED
              - THU
              - FRI
              - SAT
              - SUN
        statusDetails:
          $ref: '#/components/schemas/PolicyStatusDetails'
      required:
        - SLATime
        - statusDetails
        - workingDays
    DashboardStatsTeamSLAItem:
      title: DashboardStatsTeamSLAItem
      type: object
      properties:
        accountId:
          type: string
        WARNING:
          type: number
        BREACHED:
          type: number
        OK:
          type: number
      required:
        - accountId
        - WARNING
        - BREACHED
        - OK
    DashboardTeamStatsItemResponse:
      title: DashboardTeamStatsItemResponse
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/DashboardTeamStatsItem'
        total:
          type: number
      required:
        - items
        - total
    DashboardLatestTeamStatsItemResponse:
      title: DashboardLatestTeamStatsItemResponse
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/DashboardLatestTeamStatsItem'
        total:
          type: number
      required:
        - items
        - total
    DashboardStatsTeamSLAItemResponse:
      title: DashboardStatsTeamSLAItemResponse
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/DashboardStatsTeamSLAItem'
        total:
          type: number
      required:
        - items
        - total
    PolicyStatusDetails:
      title: PolicyStatusDetails
      type: object
      properties:
        statuses:
          type: array
          items:
            type: string
            enum:
              - OPEN
              - IN_PROGRESS
              - ON_HOLD
              - ESCALATED
              - IN_REVIEW
              - REOPENED
              - ESCALATED_L2
        statusesCount:
          type: array
          items:
            type: object
            properties:
              status:
                type: string
                enum:
                  - OPEN
                  - IN_PROGRESS
                  - ON_HOLD
                  - ESCALATED
                  - REOPENED
                  - IN_REVIEW
                  - ESCALATED_L2
              operator:
                $ref: '#/components/schemas/NumberOperators'
              count:
                type: number
            required:
              - status
              - count
              - operator
      required:
        - statuses
    SLATimeWindow:
      title: SLATimeWindow
      type: object
      properties:
        units:
          type: number
        granularity:
          type: string
          enum:
            - hours
            - days
      required:
        - units
        - granularity
    SLAPoliciesResponse:
      title: SLAPoliciesResponse
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/SLAPolicy'
        total:
          type: number
      required:
        - items
        - total
    SLAPolicyIdResponse:
      title: SLAPolicyIdResponse
      type: object
      properties:
        id:
          type: string
      required:
        - id
    NumberOperators:
      title: NumberOperators
      type: string
      enum:
        - EQ
        - NE
        - GT
        - GTE
        - LT
        - LTE
    ListImportResponse:
      title: ListImportResponse
      type: object
      properties:
        totalRows:
          type: number
        successRows:
          type: number
        failedRows:
          type: array
          items:
            type: object
            properties:
              lineNumber:
                type: number
              reason:
                type: string
            required:
              - lineNumber
              - reason
      required:
        - totalRows
        - successRows
        - failedRows
    CRMModelType:
      title: CRMModelType
      type: string
      enum:
        - TICKET
    CRMTicketType:
      title: CRMTicketType
      type: string
      enum:
        - TICKET
    CRMRecordSearch:
      title: CRMRecordSearch
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        recordType:
          $ref: '#/components/schemas/CRMTicketType'
        crmName:
          $ref: '#/components/schemas/CrmName'
      required:
        - id
        - name
        - recordType
        - crmName
    CrmGetResponse:
      title: CrmRecords
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/CRMRecord'
        count:
          type: integer
      required:
        - items
        - count
    CrmName:
      title: CrmName
      type: string
      enum:
        - FRESHDESK
    CRMRecordBase:
      title: CRMRecordBase
      type: object
      properties:
        crmName:
          $ref: '#/components/schemas/CrmName'
        recordType:
          $ref: '#/components/schemas/CRMTicketType'
        timestamp:
          type: number
        id:
          type: string
      required:
        - crmName
        - recordType
        - timestamp
        - id
    CRMRecordLink:
      title: CRMRecordLink
      type: object
      properties:
        id:
          type: string
        crmName:
          $ref: '#/components/schemas/CrmName'
        recordType:
          $ref: '#/components/schemas/CRMTicketType'
        userId:
          type: string
        timestamp:
          type: number
      required:
        - crmName
        - recordType
        - userId
        - timestamp
        - id
    CRMData:
      title: CRMData
      type: object
      properties:
        data:
          oneOf:
            - $ref: '#/components/schemas/CRMTicket'
      required:
        - data
    CRMTicket:
      title: CRMTicket
      type: object
      properties:
        recordType:
          $ref: '#/components/schemas/CRMTicketType'
        record:
          $ref: '#/components/schemas/NangoTicket'
      required:
        - recordType
        - record
    CRMRecord:
      type: object
      properties:
        crmName:
          $ref: '#/components/schemas/CrmName'
        recordType:
          $ref: '#/components/schemas/CRMTicketType'
        timestamp:
          type: number
        id:
          type: string
        data:
          oneOf:
            - $ref: '#/components/schemas/CRMTicket'
      required:
        - crmName
        - recordType
        - timestamp
        - id
        - data
        - model
    AlertTransactionsStats:
      type: object
      properties:
        totalTransactionsAmount:
          $ref: '#/components/schemas/MoneyAmount'
        numberOfUsersTransactedWith:
          type: number
      required:
        - totalTransactionsAmount
        - numberOfUsersTransactedWith
    MoneyAmount:
      type: object
      properties:
        amount:
          type: number
        currency:
          $ref: '#/components/schemas/CurrencyCode'
      required:
        - amount
        - currency
    RuleThresholdRecommendations:
      type: object
      properties:
        ruleInstanceId:
          type: string
        varsThresholdData:
          type: array
          items:
            $ref: '#/components/schemas/VarThresholdData'
        isReady:
          type: boolean
      required:
        - ruleInstanceId
        - varsThresholdData
        - isReady
    VarThresholdData:
      type: object
      properties:
        varKey:
          type: string
        threshold:
          type: number
        falsePositivesReduced:
          type: number
        timeReduced:
          type: number
        transactionsHit:
          type: number
        usersHit:
          type: number
        createdAt:
          type: number
      required:
        - varKey
        - threshold
        - falsePositivesReduced
        - timeReduced
        - transactionsHit
        - usersHit
    DrsValuesResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ExtendedDrsScore'
        total:
          type: number
      required:
        - items
        - total
    ExtendedDrsScore:
      type: object
      properties:
        createdAt:
          type: number
        drsScore:
          type: number
        userId:
          type: string
        transactionId:
          type: string
        derivedRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        manualRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        isUpdatable:
          type: boolean
        components:
          type: array
          items:
            $ref: '#/components/schemas/RiskScoreComponent'
        factorScoreDetails:
          type: array
          items:
            $ref: '#/components/schemas/RiskFactorScoreDetails'
        triggeredBy:
          type: string
          enum:
            - CONSOLE
            - BATCH
            - PUBLIC_API
        prevDrsScore:
          type: number
        updateCount:
          type: number
        lockedAt:
          type: number
          description: Timestamp when CRA was locked
        lockExpiresAt:
          type: number
          description: Timestamp when CRA lock will automatically expire
        arsRiskLevel:
          $ref: '#/components/schemas/RiskLevel'
        arsRiskScore:
          type: number
      required:
        - createdAt
        - drsScore
        - isUpdatable
    PermissionsNodeBase:
      type: object
      properties:
        id:
          type: string
        actions:
          type: array
          items:
            $ref: '#/components/schemas/PermissionsAction'
        children:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/StaticPermissionsNode'
              - $ref: '#/components/schemas/DynamicPermissionsNode'
      required:
        - id
        - actions
    PermissionsAction:
      type: string
      enum:
        - read
        - write
    StaticPermissionsNode:
      type: object
      properties:
        id:
          type: string
        actions:
          type: array
          items:
            $ref: '#/components/schemas/PermissionsAction'
        children:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/StaticPermissionsNode'
              - $ref: '#/components/schemas/DynamicPermissionsNode'
        type:
          type: string
          enum:
            - STATIC
        name:
          type: string
        filter:
          $ref: '#/components/schemas/FilterDefinition'
        allowedValues:
          type: array
          description: List of allowed values for enum filters
          items:
            type: string
      required:
        - id
        - actions
        - type
        - name
    DynamicPermissionsNodeSubType:
      type: string
      enum:
        - NARRATIVE_TEMPLATES
    DynamicPermissionsNode:
      type: object
      properties:
        id:
          type: string
        actions:
          type: array
          items:
            $ref: '#/components/schemas/PermissionsAction'
        children:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/StaticPermissionsNode'
              - $ref: '#/components/schemas/DynamicPermissionsNode'
        type:
          type: string
          enum:
            - DYNAMIC
        subType:
          $ref: '#/components/schemas/DynamicPermissionsNodeSubType'
        items:
          type: array
          items:
            $ref: '#/components/schemas/DynamicResourcesData'
        filter:
          $ref: '#/components/schemas/FilterDefinition'
      required:
        - id
        - actions
        - type
        - subType
    PermissionsResponse:
      type: object
      properties:
        permissions:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/StaticPermissionsNode'
              - $ref: '#/components/schemas/DynamicPermissionsNode'
        counts:
          type: array
          items:
            $ref: '#/components/schemas/PermissionsCountResponse'
      required:
        - permissions
        - counts
    PermissionsCountResponse:
      type: object
      properties:
        id:
          type: string
        read:
          type: number
        write:
          type: number
      required:
        - id
        - read
        - write
    DynamicResourcesData:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
      required:
        - id
        - name
    PermissionStatements:
      type: object
      properties:
        resources:
          type: array
          items:
            type: string
        actions:
          type: array
          items:
            $ref: '#/components/schemas/PermissionsAction'
        filter:
          $ref: '#/components/schemas/FilterConditions'
      required:
        - resources
        - actions
    EDDReportRequest:
      type: object
      properties:
        caseId:
          type: string
        userId:
          type: string
      required:
        - caseId
        - userId
    EDDReviewResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/EDDReview'
        total:
          type: number
      required:
        - data
        - total
    EDDReview:
      type: object
      properties:
        caseId:
          type: string
        userId:
          type: string
        review:
          type: string
        createdAt:
          type: number
        updatedAt:
          type: number
        createdBy:
          type: string
        updatedBy:
          type: string
        periodStart:
          type: number
        periodEnd:
          type: number
        files:
          type: array
          items:
            $ref: '#/components/schemas/FileInfo'
        id:
          type: string
      required:
        - caseId
        - userId
        - id
    EDDReviewUpdateRequest:
      type: object
      properties:
        review:
          type: string
      required:
        - review
    FincenBatchStatus:
      type: string
      enum:
        - ACCEPTED
        - REJECTED
      description: Filing status (ACCEPTED, REJECTED)
    FincenBatchMessageLevel:
      type: string
      enum:
        - WARN
        - FATAL
        - ERROR
    FincenSubmissionStatus:
      type: string
      enum:
        - A
        - R
        - P
        - E
      description: Submission status
    FincenBatchMessages:
      type: object
      properties:
        BatchMessages:
          type: object
          properties:
            Batch:
              $ref: '#/components/schemas/Batch'
          required:
            - Batch
      required:
        - BatchMessages
    Batch:
      type: object
      properties:
        type:
          type: string
          description: Filing type
        trackingID:
          type: string
          description: FinCEN tracking ID
        status:
          $ref: '#/components/schemas/FincenBatchStatus'
        filingName:
          type: string
        filingDate:
          type: string
          format: date
        Message:
          type: array
          items:
            $ref: '#/components/schemas/BatchMessage'
      required:
        - type
        - trackingID
        - status
        - filingName
        - filingDate
    BatchMessage:
      type: object
      properties:
        code:
          type: string
          description: Error/warning code
        level:
          $ref: '#/components/schemas/FincenBatchMessageLevel'
        Context:
          type: string
          nullable: true
          description: Path of the XML element
        Description:
          type: string
          description: Human-readable message
      required:
        - code
        - level
        - Description
    FinCENAckRoot:
      type: object
      properties:
        EFilingBatchXML:
          $ref: '#/components/schemas/EFilingBatchXML'
      required:
        - EFilingBatchXML
    EFilingBatchXML:
      type: object
      properties:
        StatusCode:
          $ref: '#/components/schemas/FincenSubmissionStatus'
        SeqNum:
          type: string
        EFilingSubmissionXML:
          $ref: '#/components/schemas/EFilingSubmissionXML'
      required:
        - StatusCode
        - SeqNum
        - EFilingSubmissionXML
    EFilingSubmissionXML:
      type: object
      properties:
        StatusCode:
          $ref: '#/components/schemas/FincenSubmissionStatus'
        SeqNum:
          type: string
        EFilingActivityXML:
          type: array
          description: One or more activity result blocks
          items:
            $ref: '#/components/schemas/EFilingActivityXML'
      required:
        - StatusCode
        - SeqNum
        - EFilingActivityXML
    EFilingActivityXML:
      type: object
      properties:
        SeqNum:
          type: string
        BSAID:
          type: string
          description: FinCEN BSA Identifier
        EFilingActivityErrorXML:
          oneOf:
            - $ref: '#/components/schemas/EFilingActivityErrorXML'
            - type: array
              items:
                $ref: '#/components/schemas/EFilingActivityErrorXML'
      required:
        - SeqNum
        - BSAID
        - EFilingActivityErrorXML
    EFilingActivityErrorXML:
      type: object
      properties:
        SeqNum:
          type: string
        ErrorContextText:
          type: string
          nullable: true
        ErrorElementNameText:
          type: string
          nullable: true
        ErrorLevelText:
          $ref: '#/components/schemas/FincenBatchMessageLevel'
        ErrorText:
          type: string
          nullable: true
        ErrorTypeCode:
          type: string
      required:
        - SeqNum
        - ErrorLevelText
    CreateWorkflowType:
      title: CreateWorkflowType
      type: object
      properties:
        caseWorkflow:
          $ref: '#/components/schemas/CreateCaseWorkflow'
        alertWorkflow:
          $ref: '#/components/schemas/CreateAlertWorkflow'
        approvalWorkflow:
          $ref: '#/components/schemas/CreateApprovalWorkflow'
    UpdateWorkflowEnabledRequest:
      type: object
      properties:
        enabled:
          type: boolean
          description: Whether the workflow is enabled
      required:
        - enabled
    GetWorkflowVersionsBulkRequest:
      type: object
      properties:
        workflows:
          type: array
          maxItems: 10
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - case
                  - alert
                description: Type of workflow
              id:
                type: string
                description: Workflow ID
              version:
                type: integer
                format: int64
                description: Version of the workflow (timestamp)
            required:
              - type
              - id
              - version
      required:
        - workflows
    WorkflowStatusesResponse:
      type: object
      properties:
        statuses:
          type: array
          items:
            type: string
          description: Array of unique statuses for the workflow type
      required:
        - statuses
    BaseWorkflow:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the workflow
        workflowType:
          $ref: '#/components/schemas/WorkflowType'
        version:
          type: integer
          format: int64
          description: Timestamp in milliseconds when the document was saved
          example: 1710834000000
        name:
          type: string
          description: Human readable name for the workflow
        description:
          type: string
          description: Detailed description of the workflow
        author:
          type: string
          description: The account that created or last modified the workflow
        enabled:
          type: boolean
          description: Whether the workflow is enabled
          default: true
      required:
        - id
        - workflowType
        - version
        - name
        - author
        - enabled
    BaseCaseAlertWorkflow:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the workflow
        workflowType:
          type: string
          enum:
            - case
            - alert
          description: Must be case or alert for case and alert workflows
        version:
          type: integer
          format: int64
          description: Timestamp in milliseconds when the document was saved
          example: 1710834000000
        name:
          type: string
          description: Human readable name for the workflow
        description:
          type: string
          description: Detailed description of the workflow
        author:
          type: string
          description: The account that created or last modified the workflow
        enabled:
          type: boolean
          description: Whether the workflow is enabled
          default: true
        statuses:
          type: array
          items:
            type: string
          description: List of user-defined case statuses
        statusAssignments:
          type: object
          additionalProperties:
            type: string
          description: Maps status to role that should be assigned
          example:
            OPEN: analyst
            IN_REVIEW: reviewer
            ESCALATION_L1: manager
        transitions:
          type: object
          description: Defines allowed status transitions
        roleTransitions:
          type: object
          description: Defines allowed role transitions
      required:
        - id
        - workflowType
        - version
        - name
        - author
        - enabled
        - statuses
        - statusAssignments
        - transitions
        - roleTransitions
    CaseWorkflow:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the workflow
        workflowType:
          type: string
          enum:
            - case
        version:
          type: integer
          format: int64
          description: Timestamp in milliseconds when the document was saved
          example: 1710834000000
        name:
          type: string
          description: Human readable name for the workflow
        description:
          type: string
          description: Detailed description of the workflow
        author:
          type: string
          description: The account that created or last modified the workflow
        enabled:
          type: boolean
          description: Whether the workflow is enabled
          default: true
        statuses:
          type: array
          items:
            type: string
          description: List of user-defined case statuses
        statusAssignments:
          type: object
          additionalProperties:
            type: string
          description: Maps status to role that should be assigned
          example:
            OPEN: analyst
            IN_REVIEW: reviewer
            ESCALATION_L1: manager
        transitions:
          type: object
          description: Defines allowed status transitions
        roleTransitions:
          type: object
          description: Defines allowed role transitions
        autoClose:
          type: boolean
          description: Whether cases can be automatically closed
      required:
        - id
        - workflowType
        - version
        - name
        - author
        - enabled
        - statuses
        - statusAssignments
        - transitions
        - roleTransitions
        - autoClose
    AlertWorkflow:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the workflow
        workflowType:
          type: string
          enum:
            - alert
        version:
          type: integer
          format: int64
          description: Timestamp in milliseconds when the document was saved
          example: 1710834000000
        name:
          type: string
          description: Human readable name for the workflow
        description:
          type: string
          description: Detailed description of the workflow
        author:
          type: string
          description: The account that created or last modified the workflow
        enabled:
          type: boolean
          description: Whether the workflow is enabled
          default: true
        statuses:
          type: array
          items:
            type: string
          description: List of user-defined case statuses
        statusAssignments:
          type: object
          additionalProperties:
            type: string
          description: Maps status to role that should be assigned
          example:
            OPEN: analyst
            IN_REVIEW: reviewer
            ESCALATION_L1: manager
        transitions:
          type: object
          description: Defines allowed status transitions
        roleTransitions:
          type: object
          description: Defines allowed role transitions
      required:
        - id
        - workflowType
        - version
        - name
        - author
        - enabled
        - statuses
        - statusAssignments
        - transitions
        - roleTransitions
    ApprovalWorkflow:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the workflow
        workflowType:
          type: string
          enum:
            - change-approval
          description: Unified workflow type for all approval workflows
        version:
          type: integer
          format: int64
          description: Timestamp in milliseconds when the document was saved
          example: 1710834000000
        name:
          type: string
          description: Human readable name for the workflow
        description:
          type: string
          description: Detailed description of the workflow
        author:
          type: string
          description: The account that created or last modified the workflow
        enabled:
          type: boolean
          description: Whether the workflow is enabled
          default: true
        approvalChain:
          type: array
          items:
            type: string
          description: List of roles that are part of the approval chain
      required:
        - id
        - workflowType
        - version
        - name
        - author
        - enabled
        - approvalChain
    WorkflowResponse:
      type: object
      properties:
        workflows:
          type: array
          items:
            $ref: '#/components/schemas/AnyWorkflow'
    AnyWorkflow:
      type: object
      oneOf:
        - $ref: '#/components/schemas/CaseWorkflow'
        - $ref: '#/components/schemas/AlertWorkflow'
        - $ref: '#/components/schemas/ApprovalWorkflow'
    WorkflowType:
      type: string
      enum:
        - case
        - alert
        - change-approval
    CreateBaseWorkflow:
      type: object
      properties:
        name:
          type: string
          description: Human readable name for the workflow
        description:
          type: string
          description: Detailed description of the workflow
        enabled:
          type: boolean
          description: Whether the workflow is enabled
          default: true
      required:
        - name
        - description
        - enabled
    CreateApprovalWorkflow:
      type: object
      properties:
        name:
          type: string
          description: Human readable name for the workflow
        description:
          type: string
          description: Detailed description of the workflow
        enabled:
          type: boolean
          description: Whether the workflow is enabled
          default: true
        approvalChain:
          type: array
          items:
            type: string
          description: List of roles that are part of the approval chain
      required:
        - name
        - description
        - enabled
        - approvalChain
    CreateBaseCaseAlertWorkflow:
      type: object
      properties:
        name:
          type: string
          description: Human readable name for the workflow
        description:
          type: string
          description: Detailed description of the workflow
        enabled:
          type: boolean
          description: Whether the workflow is enabled
          default: true
        statuses:
          type: array
          items:
            type: string
          description: List of user-defined case statuses
        statusAssignments:
          type: object
          additionalProperties:
            type: string
          description: Maps status to role that should be assigned
        transitions:
          type: object
          description: Defines allowed status transitions
        roleTransitions:
          type: object
          description: Defines allowed role transitions
      required:
        - name
        - description
        - enabled
        - statuses
        - statusAssignments
        - transitions
        - roleTransitions
    CreateCaseWorkflow:
      type: object
      properties:
        name:
          type: string
          description: Human readable name for the workflow
        description:
          type: string
          description: Detailed description of the workflow
        enabled:
          type: boolean
          description: Whether the workflow is enabled
          default: true
        statuses:
          type: array
          items:
            type: string
          description: List of user-defined case statuses
        statusAssignments:
          type: object
          additionalProperties:
            type: string
          description: Maps status to role that should be assigned
        transitions:
          type: object
          description: Defines allowed status transitions
        roleTransitions:
          type: object
          description: Defines allowed role transitions
        workflowType:
          type: string
          enum:
            - case
        autoClose:
          type: boolean
          description: Whether cases can be automatically closed
      required:
        - name
        - description
        - enabled
        - statuses
        - statusAssignments
        - transitions
        - roleTransitions
        - autoClose
    CreateAlertWorkflow:
      type: object
      properties:
        name:
          type: string
          description: Human readable name for the workflow
        description:
          type: string
          description: Detailed description of the workflow
        enabled:
          type: boolean
          description: Whether the workflow is enabled
          default: true
        statuses:
          type: array
          items:
            type: string
          description: List of user-defined case statuses
        statusAssignments:
          type: object
          additionalProperties:
            type: string
          description: Maps status to role that should be assigned
        transitions:
          type: object
          description: Defines allowed status transitions
        roleTransitions:
          type: object
          description: Defines allowed role transitions
      required:
        - name
        - description
        - enabled
        - statuses
        - statusAssignments
        - transitions
        - roleTransitions
    NangoFreshdeskTicket:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        priority:
          type: integer
        email:
          type: string
        requesterId:
          type: string
        responderId:
          type: string
        source:
          type: integer
        subject:
          type: string
        toEmails:
          type: array
          items:
            type: string
        createdAt:
          type: integer
        updatedAt:
          type: integer
        isEscalated:
          type: boolean
        ccEmails:
          type: array
          items:
            type: string
        fwdEmails:
          type: array
          items:
            type: string
        replyCcEmails:
          type: array
          items:
            type: string
        tags:
          type: array
          items:
            type: string
        descriptionText:
          type: string
        conversations:
          type: array
          items:
            $ref: '#/components/schemas/NangoConversation'
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/NangoAttachments'
      required:
        - id
        - priority
    NangoTicket:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        priority:
          type: integer
        email:
          type: string
        requesterId:
          type: string
        responderId:
          type: string
        source:
          type: integer
        subject:
          type: string
        toEmails:
          type: array
          items:
            type: string
        createdAt:
          type: integer
        updatedAt:
          type: integer
        isEscalated:
          type: boolean
        ccEmails:
          type: array
          items:
            type: string
        fwdEmails:
          type: array
          items:
            type: string
        replyCcEmails:
          type: array
          items:
            type: string
        tags:
          type: array
          items:
            type: string
        descriptionText:
          type: string
        conversations:
          type: array
          items:
            $ref: '#/components/schemas/NangoConversation'
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/NangoAttachments'
      required:
        - id
        - priority
    NangoConversation:
      type: object
      properties:
        bodyText:
          type: string
        fromEmail:
          type: string
        toEmail:
          type: string
        createdAt:
          type: integer
        updatedAt:
          type: integer
        ccEmails:
          type: array
          items:
            type: string
    NangoAttachments:
      type: object
      properties:
        contentType:
          type: string
        size:
          type: integer
        updatedAt:
          type: integer
        name:
          type: string
        id:
          type: integer
        attachmentUrl:
          type: string
      required:
        - contentType
        - size
        - updatedAt
        - name
        - id
        - attachmentUrl
  securitySchemes:
    x-api-key:
      name: x-api-key
      type: apiKey
      in: header
      description: API keys are used to authenticate the requests.
