openapi: 3.1.0
info:
  title: TMT API
  description: API for loading projects by tenant.
  version: 1.0.0
paths:
  /api/v2/rpc (LOAD_PROJECTS_BY_TENANT):
    post:
      summary: List parent projects
      description: >
        Return the parent projects that are being assigned to the calling user.
        A parent project can contain multiple sub projects, that can be queried
        via operation [List sub
        projects](./project#/paths/~1api~1v2~1rpc%20(LIST_SUB_PROJECTS)/post)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/LoadParentProjectRequestItem'
              examples:
                - id: RMProjectSubproject-rmRoleProjectSourceUnknown
                  jsonrpc: '2.0'
                  method: LOAD_PROJECTS_BY_TENANT
                  params: {}
      responses:
        '200':
          description: A list of parent projects
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LoadParentProjectResponseItem'
                examples:
                  - jsonrpc: '2.0'
                    id: RMProjectSubproject-rmRoleProjectSourceUnknown
                    result:
                      - linkRef:
                          linkDescriptor:
                            relationshipModel: ProjectSubproject-rm
                            entities:
                              - role: null
                                modelName: null
                                docRef: null
                              - role: Project
                                modelName: Project-dm
                                docRef: Project-dm/6300
                            predecessorLinkRef: null
                            position: TOP
                          id: null
                        document:
                          Root:
                            General:
                              Title: 0_Trung.Phan
                              Id: P_28
                              TechnicalId: 284a3939-a949-44b4-88e6-6336caa9dd49
                              TenantId: T_1
                              ParentId: _
                              Description: new décription
                              TestSuites: 7
                              TestRuns: 1/3
                            Metadata:
                              CreatedBy: tmtdev
                              DisplayCreatedOn: '2023-03-14T03:05:26'
                              CreatedOn: 1678763126588
                              EditedBy: viethuynh
                              DisplayEditedOn: '2024-09-06T03:22:06'
                              EditedOn: 1725592926737
                          __meta:
                            creator: tmtdev
                            modifier: viethuynh
                            docRef: Project-dm/6300
                            modelReference: Project-dm
                            createdAt: '2023-03-14T03:05:26'
                            modifiedAt: '2024-09-06T03:22:06'
                            modelVersion: null
                          docRef: Project-dm/6300
                      - linkRef:
                          linkDescriptor:
                            relationshipModel: ProjectSubproject-rm
                            entities:
                              - role: null
                                modelName: null
                                docRef: null
                              - role: Project
                                modelName: Project-dm
                                docRef: Project-dm/332906
                            predecessorLinkRef: null
                            position: TOP
                          id: null
                        document:
                          Root:
                            General:
                              Title: Export QF
                              TenantId: T_1
                              TechnicalId: 741a9cc2-4e91-447b-bab0-bf54b352e41b
                              Id: P_186
                              ParentId: _
                              TestSuites: 2
                              TestRuns: 3/3
                            Metadata:
                              CreatedBy: tmtdev
                              DisplayCreatedOn: '2024-06-04T03:53:52'
                              CreatedOn: 1717473232892
                              EditedBy: trung
                              DisplayEditedOn: '2024-11-07T09:02:50'
                              EditedOn: 1730970170788
                            Attachments:
                              - FileName: Screenshot 2024-10-12 at 08.38.29.png
                                CreatedAt: '2024-11-07T09:02:47'
                                UploadOn: '2024-11-07'
                                OriginalFileName: Screenshot 2024-10-12 at 08.38.29.png
                                UploadBy: trung
                                Referenced: false
                                CopyNumber: 0
                                ThumbnailId: 5bc53f80-1b7d-43c1-86a8-d243ba6509a7
                                File:
                                  content: null
                                  attachment_id: 4ceb97fe-ce0f-499c-959b-dd0bf35da26d
                                  internal_filename: >-
                                    1730970164198-6bb49d5d-0d27-4f0e-96f2-56afaf62a498.png
                                  original_filename: Screenshot 2024-10-12 at 08.38.29.png
                                  size: 302995
                                  mime_type: image/png
                          __meta:
                            creator: tmtdev
                            modifier: trung
                            docRef: Project-dm/332906
                            modelReference: Project-dm
                            createdAt: '2024-06-04T03:53:52'
                            modifiedAt: '2024-11-07T09:02:50'
                            modelVersion: null
                          docRef: Project-dm/332906
                      - linkRef:
                          linkDescriptor:
                            relationshipModel: ProjectSubproject-rm
                            entities:
                              - role: null
                                modelName: null
                                docRef: null
                              - role: Project
                                modelName: Project-dm
                                docRef: Project-dm/26
                            predecessorLinkRef: null
                            position: TOP
                          id: null
                        document:
                          Root:
                            General:
                              Title: TN Project
                              Id: P_2
                              TechnicalId: 6567d397-19f3-4b69-bc6b-233dcd6c2390
                              TenantId: T_1
                              ParentId: _
                              TestSuites: 10
                              TestRuns: 4/7
                            Metadata:
                              CreatedBy: tmtdev
                              DisplayCreatedOn: '2022-11-29T03:56:21'
                              CreatedOn: 1669694181806
                              EditedBy: tmtdev
                              DisplayEditedOn: '2022-11-29T03:56:21'
                              EditedOn: 1669694181806
                          __meta:
                            creator: tmtdev
                            modifier: tmtdev
                            docRef: Project-dm/26
                            modelReference: Project-dm
                            createdAt: '2022-11-29T03:56:21'
                            modifiedAt: '2023-04-17T10:45:57'
                            modelVersion: null
                          docRef: Project-dm/26
  /api/v2/rpc (LIST_SUB_PROJECTS):
    post:
      summary: List sub projects
      description: >-
        Return the sub projects that are being assigned to the calling user for
        given parent projects
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListSubProjectsRequest'
              examples:
                $ref: example/LOAD_SUB_PROJECTS-request.json
      responses:
        '200':
          description: Successful response with sub-projects information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListSubProjectsResponse'
                examples:
                  $ref: example/LOAD_SUB_PROJECTS-response.json
  /api/v2/rpc (LOAD_PROJECT_WITH_VERSION):
    post:
      summary: Load project with version
      description: Return the project information along with its latest version info
      parameters:
        - $ref: '#/components/parameters/ProjectIdHeader'
        - $ref: '#/components/parameters/SubProjectIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoadProjectWithVersionRequest'
              examples:
                $ref: example/LOAD_PROJECT_WITH_VERSION-request.json
      responses:
        '200':
          description: Project information with its latest version detail
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoadProjectWithVersionResponse'
                examples:
                  $ref: example/LOAD_PROJECT_WITH_VERSION-response.json
  /api/v2/rpc (LOAD_PROJECT_SETTING):
    post:
      summary: Load project setting
      description: Load setting of a project
      parameters:
        - $ref: '#/components/parameters/ProjectIdHeader'
        - $ref: '#/components/parameters/SubProjectIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoadProjectSettingRequest'
              examples:
                $ref: example/LOAD_PROJECT_SETTING-request.json
      responses:
        '200':
          description: Setting of the project
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoadProjectSettingResponse'
                examples:
                  $ref: example/LOAD_PROJECT_SETTING-response.json
  /api/v2/rpc (GET_DOCUMENT for Project):
    post:
      summary: Get project detail
      description: Load project document
      parameters:
        - $ref: '#/components/parameters/ProjectIdHeader'
        - $ref: '#/components/parameters/SubProjectIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetDocumentRequest'
              examples:
                $ref: example/GET_PROJECT-request.json
      responses:
        '200':
          description: Setting of the project
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectDocumentResponse'
                examples:
                  $ref: example/GET_PROJECT-response.json
  /api/v2/rpc (MODIFY_DOCUMENT for Project):
    post:
      summary: Update project detail
      description: Update project document
      parameters:
        - $ref: '#/components/parameters/ProjectIdHeader'
        - $ref: '#/components/parameters/SubProjectIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModifyProjectRequest'
              examples:
                $ref: example/UPDATE_PROJECT-request.json
      responses:
        '200':
          description: Successful response after update project
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModifyDocumentResponse'
                examples:
                  $ref: example/UPDATE_PROJECT-response.json
  /api/v2/rpc (CREATE_PROJECT_VERSION):
    post:
      summary: Create new project version
      description: >-
        Trigger a task request to create new project version. Task request will
        then run on background. When done, the new version should have test
        suites and test cases of the derived version. Please refer to [Get task
        request](./task#/paths/~1api~1v2~1rpc%20(GET_DOCUMENT)/post) to check
        the progress of the process
      parameters:
        - $ref: '#/components/parameters/ProjectIdHeader'
        - $ref: '#/components/parameters/SubProjectIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProjectVersionRequest'
              examples:
                $ref: example/CREATE_PROJECT_VERSION-request.json
      responses:
        '200':
          description: >-
            Document reference of **Task Request** document. User can use Get
            task request API to get status of the task.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateProjectVersionResponse'
                examples:
                  $ref: example/CREATE_PROJECT_VERSION-response.json
security:
  - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
  schemas:
    ModifyProjectRequest:
      allOf:
        - $ref: '#/components/schemas/ModifyDocumentRequest'
        - type: object
          required:
            - method
            - params
          properties:
            method:
              description: MODIFY_DOCUMENT
            params:
              required:
                - docRef
                - locale
                - document
              properties:
                document:
                  $ref: '#/components/schemas/ProjectDocument'
      examples:
        - id: update-project-dm-t1
          method: MODIFY_DOCUMENT
          params:
            document:
              Root:
                General:
                  Title: Export QF edited
                  TenantId: T_1
                  TechnicalId: 741a9cc2-4e91-447b-bab0-bf54b352e41b
                  Id: P_186
                  ParentId: _
                  Description: This is new description
                Attachments:
                  - FileName: Screenshot 2024-10-12 at 08.38.29.png
                    CreatedAt: '2024-11-07T09:02:47'
                    UploadOn: '2024-11-07'
                    OriginalFileName: Screenshot 2024-10-12 at 08.38.29.png
                    UploadBy: trung
                    Referenced: false
                    CopyNumber: 0
                    ThumbnailId: 5bc53f80-1b7d-43c1-86a8-d243ba6509a7
                    File:
                      content: null
                      attachment_id: 4ceb97fe-ce0f-499c-959b-dd0bf35da26d
                      internal_filename: 1730970164198-6bb49d5d-0d27-4f0e-96f2-56afaf62a498.png
                      original_filename: Screenshot 2024-10-12 at 08.38.29.png
                      size: 302995
                      mime_type: image/png
            locale: en
            docRef: Project-dm/332906
    ProjectDocumentResponse:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
        - type: object
          properties:
            result:
              allOf:
                - $ref: '#/components/schemas/DocumentResult'
                - type: object
                - properties:
                    document:
                      $ref: '#/components/schemas/ProjectDocument'
      examples:
        - jsonrpc: '2.0'
          id: TestSuites.DataProvider-98
          result:
            docRef: Project-dm/332906
            documentModelName: Project-dm
            document:
              Root:
                General:
                  Title: Export QF
                  TenantId: T_1
                  TechnicalId: 741a9cc2-4e91-447b-bab0-bf54b352e41b
                  Id: P_186
                  ParentId: _
                  Description: This is a description
                Metadata:
                  CreatedBy: tmtdev
                  DisplayCreatedOn: '2024-06-04T03:53:52'
                  CreatedOn: 1717473232892
                  EditedBy: trung
                  DisplayEditedOn: '2024-11-08T06:49:26'
                  EditedOn: 1731048566538
                Attachments:
                  - FileName: Screenshot 2024-10-12 at 08.38.29.png
                    CreatedAt: '2024-11-07T09:02:47'
                    UploadOn: '2024-11-07'
                    OriginalFileName: Screenshot 2024-10-12 at 08.38.29.png
                    UploadBy: trung
                    Referenced: false
                    CopyNumber: 0
                    ThumbnailId: 5bc53f80-1b7d-43c1-86a8-d243ba6509a7
                    File:
                      content: null
                      attachment_id: 4ceb97fe-ce0f-499c-959b-dd0bf35da26d
                      internal_filename: 1730970164198-6bb49d5d-0d27-4f0e-96f2-56afaf62a498.png
                      original_filename: Screenshot 2024-10-12 at 08.38.29.png
                      size: 302995
                      mime_type: image/png
              __meta:
                creator: tmtdev
                modifier: trung
                docRef: Project-dm/332906
                modelReference: Project-dm
                createdAt: '2024-06-04T03:53:52'
                modifiedAt: '2024-11-08T06:49:26'
                modelVersion: null
    LoadParentProjectRequestItem:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
          properties:
            method:
              type: string
              description: LOAD_PROJECTS_BY_TENANT
              example: LOAD_PROJECTS_BY_TENANT
            params:
              type: object
              description: Empty
    LoadParentProjectResponseItem:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
        - type: object
          properties:
            result:
              type: array
              description: list of parent projects
              items:
                $ref: '#/components/schemas/Project'
    Project:
      type: object
      properties:
        linkRef:
          $ref: '#/components/schemas/LinkRef'
        document:
          $ref: '#/components/schemas/TargetDocument'
    Root:
      type: object
      properties:
        General:
          $ref: '#/components/schemas/General'
        Metadata:
          $ref: '#/components/schemas/Metadata'
        Attachments:
          type: array
          description: list of attachments are being assigned to this project document
          items:
            $ref: '#/components/schemas/Attachment'
          nullable: true
    General:
      type: object
      properties:
        Title:
          type: string
          description: project name
        Id:
          description: The Id of the project. It is unique within a tenant
          type: string
        TechnicalId:
          description: The unique ID of the project within a whole system
          type: string
        TenantId:
          description: The ID of the tenant the project belongs to
          type: string
        ParentId:
          description: >-
            Id of the parent project. It will be "_" if this is already parent
            project
          type: string
        Description:
          type: string
          description: description of the project
          nullable: true
        TestSuites:
          description: The total test suites of the latest version
          type: integer
        TestRuns:
          description: The number of closed run and all runs
          type: string
    ListSubProjectsRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
          required:
            - params
          properties:
            method:
              type: string
              description: LIST_SUB_PROJECTS
            params:
              type: object
              required:
                - sources
                - page
              properties:
                page:
                  $ref: '#/components/schemas/PageSpec'
                filter:
                  description: Not implemented yet
                  $ref: '#/components/schemas/FilterSpec'
                sort:
                  description: Not implemented yet
                  $ref: '#/components/schemas/SortSpec'
                sources:
                  type: array
                  items:
                    $ref: '#/components/schemas/LoadSubProjectRequestSource'
      examples:
        - jsonrpc: '2.0'
          id: LIST_SUB_PROJECTS_2ddc679a-75c5-4981-b7e7-8f9f99c6f73c
          method: LIST_SUB_PROJECTS
          params:
            page:
              offset: 0
              limit: 2147483647
            filter: {}
            sort: {}
            sources:
              - docRef: Project-dm/6300
                relationshipModel: ProjectSubproject-rm
                role: Project
              - docRef: Project-dm/332906
                relationshipModel: ProjectSubproject-rm
                role: Project
              - docRef: Project-dm/26
                relationshipModel: ProjectSubproject-rm
                role: Project
    ListSubProjectsResponse:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
          properties:
            result:
              type: array
              items:
                $ref: '#/components/schemas/SubProjectResult'
      examples:
        - jsonrpc: '2.0'
          id: LIST_SUB_PROJECTS_2ddc679a-75c5-4981-b7e7-8f9f99c6f73c
          result:
            - source:
                relationshipModel: ProjectSubproject-rm
                role: Project
                docRef: Project-dm/6300
              linkResultEntries:
                fullSize: 1
                page:
                  offset: 0
                  limit: 2147483647
                entries:
                  - linkRef:
                      linkDescriptor:
                        relationshipModel: ProjectSubproject-rm
                        entities:
                          - role: Project
                            modelName: Project-dm
                            docRef: Project-dm/6300
                          - role: Subproject
                            modelName: Project-dm
                            docRef: Project-dm/66419
                        predecessorLinkRef: null
                        position: TOP
                      id: '65983'
                    document:
                      target:
                        Root:
                          General:
                            ParentId: P_28
                            Title: test
                            TenantId: T_1
                            TechnicalId: 9dd88714-c335-4101-b4a2-4a2c1190ac28
                            Id: SP_1
                            ParentDocRef: Project-dm/6300
                            TestSuites: 14
                            TestRuns: 3/4
                          Metadata:
                            CreatedBy: sontrinh
                            DisplayCreatedOn: '2023-11-27T07:56:59'
                            CreatedOn: 1701071819340
                            EditedBy: tmtdev
                            DisplayEditedOn: '2024-03-12T09:24:18'
                            EditedOn: 1710235458578
                        __meta:
                          creator: sontrinh
                          modifier: sontrinh
                          docRef: Project-dm/66419
                          modelReference: Project-dm
                          createdAt: '2023-11-27T07:56:59'
                          modifiedAt: '2024-03-12T09:24:26'
                          modelVersion: null
                        docRef: Project-dm/66419
            - source:
                relationshipModel: ProjectSubproject-rm
                role: Project
                docRef: Project-dm/332906
              linkResultEntries:
                fullSize: 0
                page:
                  offset: 0
                  limit: 2147483647
                entries: []
            - source:
                relationshipModel: ProjectSubproject-rm
                role: Project
                docRef: Project-dm/26
              linkResultEntries:
                fullSize: 3
                page:
                  offset: 0
                  limit: 2147483647
                entries:
                  - linkRef:
                      linkDescriptor:
                        relationshipModel: ProjectSubproject-rm
                        entities:
                          - role: Project
                            modelName: Project-dm
                            docRef: Project-dm/26
                          - role: Subproject
                            modelName: Project-dm
                            docRef: Project-dm/161
                        predecessorLinkRef: null
                        position: TOP
                      id: '189'
                    document:
                      target:
                        Root:
                          General:
                            ParentId: P_2
                            Title: TN subproject
                            Id: SP_1
                            TechnicalId: 8a0995f0-6379-4e25-91fa-aefec5179581
                            TenantId: T_1
                            TestSuites: 11
                            TestRuns: 2/4
                          Metadata:
                            CreatedBy: tmtdev
                            DisplayCreatedOn: '2022-11-29T06:54:07'
                            CreatedOn: 1669704847116
                            EditedBy: tmtdev
                            DisplayEditedOn: '2022-11-29T06:54:07'
                            EditedOn: 1669704847116
                        __meta:
                          creator: tmtdev
                          modifier: tmtdev
                          docRef: Project-dm/161
                          modelReference: Project-dm
                          createdAt: '2022-11-29T06:54:07'
                          modifiedAt: '2022-11-29T06:54:07'
                          modelVersion: null
                        docRef: Project-dm/161
                  - linkRef:
                      linkDescriptor:
                        relationshipModel: ProjectSubproject-rm
                        entities:
                          - role: Project
                            modelName: Project-dm
                            docRef: Project-dm/26
                          - role: Subproject
                            modelName: Project-dm
                            docRef: Project-dm/165
                        predecessorLinkRef: null
                        position: TOP
                      id: '193'
                    document:
                      target:
                        Root:
                          General:
                            ParentId: P_2
                            Title: TN SJ2
                            Id: SP_2
                            TechnicalId: 2358a5ec-255f-4790-b1ed-8d09e0814319
                            TenantId: T_1
                            TestSuites: 3
                            TestRuns: ''
                          Metadata:
                            CreatedBy: tmtdev
                            DisplayCreatedOn: '2022-11-29T06:54:19'
                            CreatedOn: 1669704859708
                            EditedBy: tmtdev
                            DisplayEditedOn: '2022-11-29T06:54:19'
                            EditedOn: 1669704859708
                        __meta:
                          creator: tmtdev
                          modifier: tmtdev
                          docRef: Project-dm/165
                          modelReference: Project-dm
                          createdAt: '2022-11-29T06:54:19'
                          modifiedAt: '2022-11-29T06:54:19'
                          modelVersion: null
                        docRef: Project-dm/165
                  - linkRef:
                      linkDescriptor:
                        relationshipModel: ProjectSubproject-rm
                        entities:
                          - role: Project
                            modelName: Project-dm
                            docRef: Project-dm/26
                          - role: Subproject
                            modelName: Project-dm
                            docRef: Project-dm/545
                        predecessorLinkRef: null
                        position: TOP
                      id: '483'
                    document:
                      target:
                        Root:
                          General:
                            ParentId: P_2
                            Title: PJ error
                            Id: SP_3
                            TechnicalId: a57997a1-82ed-40bc-a975-238c9060fdca
                            TenantId: T_1
                            TestSuites: 0
                            TestRuns: ''
                          Metadata:
                            CreatedBy: titnguyen
                            DisplayCreatedOn: '2022-11-29T09:09:23'
                            CreatedOn: 1669712963556
                            EditedBy: titnguyen
                            DisplayEditedOn: '2022-11-29T09:09:23'
                            EditedOn: 1669712963556
                        __meta:
                          creator: titnguyen
                          modifier: titnguyen
                          docRef: Project-dm/545
                          modelReference: Project-dm
                          createdAt: '2022-11-29T09:09:23'
                          modifiedAt: '2022-11-29T09:09:23'
                          modelVersion: null
                        docRef: Project-dm/545
    SubProjectResult:
      type: object
      properties:
        source:
          $ref: '#/components/schemas/Source'
        linkResultEntries:
          $ref: '#/components/schemas/LinkResultEntries'
    LinkResultEntries:
      type: object
      properties:
        fullSize:
          type: integer
          example: 1
        page:
          $ref: '#/components/schemas/PageSpec'
        entries:
          type: array
          items:
            $ref: '#/components/schemas/Entry'
    Entry:
      type: object
      properties:
        linkRef:
          $ref: '#/components/schemas/LinkRef'
        document:
          $ref: '#/components/schemas/TargetDocument'
    TargetDocument:
      type: object
      properties:
        target:
          $ref: '#/components/schemas/Target'
        __meta:
          $ref: '#/components/schemas/Metadata'
    Target:
      type: object
      properties:
        Root:
          $ref: '#/components/schemas/Root'
        docRef:
          type: string
          description: document reference of the document
    CreateProjectVersionRequest:
      allOf:
        - $ref: '#/components/schemas/ModifyDocumentRequest'
        - type: object
          required:
            - method
            - params
          properties:
            method:
              description: MODIFY_DOCUMENT
            params:
              required:
                - docRef
                - locale
                - document
              properties:
                document:
                  $ref: '#/components/schemas/VersionDocument'
      examples:
        - jsonrpc: '2.0'
          id: CREATE_PROJECT_VERSION_3edca49d-5d1e-47b8-b40d-b89d726797f4
          method: CREATE_PROJECT_VERSION
          params:
            document:
              Root:
                General:
                  ProjectId: P_186
                  SubprojectId: _
                  VersionNumber: 1.0.1
                  DerivedVersionNumber: 1.0.0
                  DerivedVersionCreatedOn: 1717473233273
                  DerivedVersionTitle: 2_Export QF
                  Status: open
                  Title: Version 1.0.1
                  KeyPoints: this is the keypoints
                  Description: this is the description
                Attachments:
                  - FileName: Screenshot 2024-11-06 at 15.43.34.png
                    File:
                      content: null
                      attachment_id: 17779c20-8c31-4502-8d20-1de4b3028ee4
                      internal_filename: 1731055890896-d57cd3f6-a4b3-4a78-ae46-4a54381b48b9.png
                      original_filename: Screenshot 2024-11-06 at 15.43.34.png
                      size: 183806
                      mime_type: image/png
                    CreatedAt: '2024-11-08T08:51:32'
                    UploadOn: '2024-11-08'
                    OriginalFileName: Screenshot 2024-11-06 at 15.43.34.png
                    UploadBy: trung
                    Referenced: false
                    CopyNumber: 0
                    ThumbnailId: 7b81f0ae-b402-49f7-982f-58ba868a70b3
    CreateProjectVersionResponse:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
        - type: object
          required:
            - method
            - params
          properties:
            method:
              type: string
              description: CREATE_PROJECT_VERSION
            params:
              required:
                - docRef
              properties:
                docRef:
                  type: string
                  description: document reference
      examples:
        - jsonrpc: '2.0'
          id: CREATE_PROJECT_VERSION_3edca49d-5d1e-47b8-b40d-b89d726797f4
          result:
            docRef: TaskRequest-dm/484103c3-b70a-42c4-b4d9-2b0e5369cdcb
    LoadSubProjectRequestSource:
      type: object
      required:
        - docRef
        - relationshipModel
        - role
      properties:
        docRef:
          description: the document reference of the parent project
          type: string
        relationshipModel:
          type: string
          description: Must be **ProjectSubproject-rm**
        role:
          description: the role of the parent project
          type: string
    LoadProjectWithVersionRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
          required:
            - method
            - params
          properties:
            method:
              type: string
              description: LOAD_PROJECT_WITH_VERSION
            params:
              required:
                - projectId
                - subProjectId
              $ref: '#/components/schemas/ProjectVersionSpec'
      examples:
        - jsonrpc: '2.0'
          id: ProjectWithVersionOperation
          method: LOAD_PROJECT_WITH_VERSION
          params:
            projectSpec:
              projectId: P_28
              subProjectId: _
    LoadProjectWithVersionResponse:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
        - type: object
          properties:
            result:
              allOf:
                - $ref: '#/components/schemas/DocumentResult'
                - type: object
                - properties:
                    document:
                      $ref: '#/components/schemas/ProjectWithVersionDocument'
      examples:
        - jsonrpc: '2.0'
          id: ProjectWithVersionOperation
          result:
            docRef: Project-dm/6300
            documentModelName: Project-dm
            document:
              Root:
                General:
                  Title: Toy space
                  Id: P_28
                  TechnicalId: 284a3939-a949-44b4-88e6-6336caa9dd49
                  TenantId: T_1
                  ParentId: _
                  Description: everyone can play with this project
                Metadata:
                  CreatedBy: tphan
                  DisplayCreatedOn: '2023-03-14T03:05:26'
                  CreatedOn: 1678763126588
                  EditedBy: viethuynh
                  DisplayEditedOn: '2024-09-06T03:22:06'
                  EditedOn: 1725592926737
                Version:
                  DocRef: Version-dm/de0332f3-06ff-4ed4-a06e-2978d16b3ba6
                  General:
                    ProjectId: P_28
                    SubprojectId: _
                    VersionNumber: 2.0.0
                    DerivedVersionNumber: 1.0.0
                    DerivedVersionCreatedOn: 1678763129233
                    DerivedVersionTitle: 0_Trung.Phan
                    Status: open
                    Title: '200'
                    TenantId: T_1
                    Id: 929e1fb7-4c44-4e05-afdc-03c6e6a3cfe2
                    TechnicalId: 56fb5a72-4ad4-46ba-a38c-c791d0c00b5f
                    WrapperNode: false
                    UseSubjectSpecificOrderForTestSuite: false
                    Ancestors: '|[1.0.0]|'
                    IsLatestVersion: true
                  Metadata:
                    CreatedBy: sontrinh
                    DisplayCreatedOn: '2024-10-18T03:17:54'
                    CreatedOn: 1729221474841
                    EditedBy: sontrinh
                    DisplayEditedOn: '2024-10-18T03:17:54'
                    EditedOn: 1729221474841
              __meta:
                creator: tphan
                modifier: viethuynh
                docRef: Project-dm/6300
                modelReference: Project-dm
                createdAt: '2023-03-14T03:05:26'
                modifiedAt: '2024-09-06T03:22:06'
                modelVersion: null
    ProjectWithVersionDocument:
      type: object
      description: Project with version document
      properties:
        Root:
          $ref: '#/components/schemas/ProjectWithVersionRoot'
        __meta:
          $ref: '#/components/schemas/Meta'
    ProjectWithVersionRoot:
      allOf:
        - $ref: '#/components/schemas/ProjectDocumentWithDocRef'
        - type: object
        - properties:
            Version:
              $ref: '#/components/schemas/VersionDocumentWithDocRef'
    LoadProjectSettingRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
          required:
            - method
            - params
          properties:
            method:
              type: string
              description: LOAD_PROJECT_SETTING
            params:
              required:
                - projectId
                - subProjectId
              $ref: '#/components/schemas/ProjectSpec'
      examples:
        - jsonrpc: '2.0'
          id: LoadProjectSettingOperation
          method: LOAD_PROJECT_SETTING
          params:
            projectId: P_28
            subProjectId: _
    LoadProjectSettingResponse:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
        - type: object
          properties:
            result:
              $ref: '#/components/schemas/ProjectSettingResult'
      examples:
        - jsonrpc: '2.0'
          id: LoadProjectSettingOperation
          result:
            testSuiteSetting:
              testSuiteOverview: []
              testCaseOverview:
                - column-92b35
                - column-c5709
                - column-78bec
                - column-f4ffc
                - column-f73e5
                - column-50c55
                - column-2f15a
                - column-3bc42
                - column-860db
                - column-ea604
                - column-6369d
                - column-62746
                - column-ad8b3
                - column-f9bc0
                - column-fdde0
                - column-a2e75
                - column-c83ca
                - column-a6ce7
                - column-4b613
                - column-66b95
              testCaseOverviewDisplayedFields:
                - Root.General.Title
                - Root.General.Id
                - Root.General.Status
                - Root.General.User
                - Root.General.Automation
                - Root.Risk.Likelihood
                - Root.Risk.Impact
                - Root.Criteria.Tags
            testRunSetting:
              testRunOverview:
                - column-9a045
                - column-cf6d8
                - column-17b62
              testSelection: []
              testCaseOverview:
                - column-d68fa
                - column-092f0
                - column-7e7a3
              testCaseOverviewDisplayedFields:
                - Root.General.Title
                - Root.General.Id
                - Root.General.User
              testScope:
                - column-60fb2
            generalSetting:
              jiraSetting:
                DefaultUrl: https://mgm.com/jira/browse/
                AdditionalInstances:
                  - Token: TMT
                    Url: https://jira.com/jira/browse/
              azureDevOpsSetting:
                defaultUrl: ''
              testCaseTreeSetting:
                lazyLoadingEnable: false
                expandLevel: 2
              tdsSetting:
                inTdsTenant: false
                tdsUrl: http://localhost:3000/from-tmt
                elster: false
              riskBaseSetting:
                TestHistoryFrequency: 20,40,60,80
                TestHistorySeverity: 0.75,1.5,3.5,5
                ClusterDefectWeightMapping: "{\n\t\t\"PriorityToDefectCluster\": {\n\t\t\t\"Blocker\": \"Blocker\",\n\n\t\t\t\"Critical\": \"Critical\",\n\t\t\t\"Highest\": \"Critical\",\n\n\t\t\t\"Major\": \"Major\",\n\t\t\t\"High\": \"Major\",\n\n\t\t\t\"Medium\": \"Normal\",\n\t\t\t\"Normal\": \"Normal\",\n\t\t\t\"NotPrioritized\": \"Normal\",\n\n\t\t\t\"Low\": \"Minor\",\n\t\t\t\"Minor\": \"Minor\",\n\t\t\t\"Trivial\": \"Minor\",\n\t\t\t\"Lowest\": \"Minor\"\n\t\t},\n\t\t\"DefectClusterToDefectWeight\": {\n\t\t\t\"Blocker\": 10,\n\t\t\t\"Critical\": 5,\n\t\t\t\"Major\": 2,\n\t\t\t\"Normal\": 1,\n\t\t\t\"Minor\": 0.5\n\t\t}\n\t}"
                testHistoryRiskLevelMatrixStr: H,H,H,H,M;H,H,M,M,L;H,M,M,M,L;H,M,M,L,L;M,L,L,L,L
    ProjectSettingResult:
      type: object
      properties:
        testSuiteSetting:
          $ref: '#/components/schemas/TestSuiteSetting'
        testRunSetting:
          $ref: '#/components/schemas/TestRunSetting'
        generalSetting:
          $ref: '#/components/schemas/GeneralSetting'
    TestSuiteSetting:
      type: object
      properties:
        testSuiteOverview:
          type: array
          items:
            type: string
        testCaseOverview:
          type: array
          items:
            type: string
        testCaseOverviewDisplayedFields:
          type: array
          items:
            type: string
    TestRunSetting:
      type: object
      properties:
        testRunOverview:
          type: array
          items:
            type: string
        testSelection:
          type: array
          items:
            type: string
        testCaseOverview:
          type: array
          items:
            type: string
        testCaseOverviewDisplayedFields:
          type: array
          items:
            type: string
        testScope:
          type: array
          items:
            type: string
    GeneralSetting:
      type: object
      properties:
        jiraSetting:
          $ref: '#/components/schemas/JiraSetting'
        azureDevOpsSetting:
          $ref: '#/components/schemas/AzureDevOpsSetting'
        testCaseTreeSetting:
          $ref: '#/components/schemas/TestCaseTreeSetting'
        tdsSetting:
          $ref: '#/components/schemas/TdsSetting'
        riskBaseSetting:
          $ref: '#/components/schemas/RiskBaseSetting'
    JiraSetting:
      type: object
      properties:
        DefaultUrl:
          type: string
        AdditionalInstances:
          type: array
          items:
            $ref: '#/components/schemas/JiraInstance'
    JiraInstance:
      type: object
      properties:
        Url:
          type: string
          description: url of the jira site
        Token:
          type: string
          description: project token
    AzureDevOpsSetting:
      type: object
      properties:
        defaultUrl:
          type: string
    TestCaseTreeSetting:
      type: object
      properties:
        lazyLoadingEnable:
          type: boolean
        expandLevel:
          type: integer
    TdsSetting:
      type: object
      properties:
        inTdsTenant:
          type: boolean
        tdsUrl:
          type: string
        elster:
          type: boolean
    RiskBaseSetting:
      type: object
      properties:
        TestHistoryFrequency:
          type: string
          description: >-
            The range [0, 100] is divided into 5 sections, defined by 4
            boundaries.
        TestHistorySeverity:
          type: string
          description: >-
            The range [0, 10] is divided into 5 sections, defined by 4
            boundaries.
        ClusterDefectWeightMapping:
          type: String
          description: >-
            A config to define the mapping between priority and defect cluster,
            and from defect cluster to defect weight.
        testHistoryRiskLevelMatrixStr:
          type: string
          description: >-
            A config to define mapping risk level based on Severity (row) and
            Frequency (column).
    RpcRequestWithIdAndJsonRpc:
      type: object
      required:
        - id
        - jsonrpc
      properties:
        id:
          type: string
          description: id of the operation
        jsonrpc:
          type: string
          description: must be 2.0
          example: '2.0'
    RpcResult:
      type: object
      properties:
        jsonrpc:
          type: string
          description: request jsonrpc version
        id:
          type: string
          description: id of the operation
        result:
          type: object
    Entity:
      type: object
      properties:
        role:
          type: string
          description: Role of the entity that participates into this relationship
        modelName:
          type: string
          description: Model name of the entity that participates into this relationship
        docRef:
          type: string
          description: Document reference of the entity
    LinkDescriptor:
      type: object
      description: Information of entities in the relationship
      properties:
        relationshipModel:
          type: string
          description: Name of the relationship model
        entities:
          type: array
          description: Contains 2 items which are the parent and child
          items:
            $ref: '#/components/schemas/Entity'
        predecessorLinkRef:
          type: string
          description: Link reference of the predecessor
          nullable: true
        position:
          type: number
          description: The position of the node to the predecessorLinkRef
    LinkRef:
      type: object
      description: Represent the link contains the documents
      properties:
        linkDescriptor:
          $ref: '#/components/schemas/LinkDescriptor'
        id:
          type: string
          description: id of the relationship link
    Metadata:
      type: object
      readOnly: true
      description: >-
        \[**Read only**] Metadata of the document. It will be ignored if
        included in the request of the add/update operations (e.g ADD_DOCUMENT,
        MODIFY_DOCUMENT)
      properties:
        CreatedBy:
          type: string
          description: who created this project
        DisplayCreatedOn:
          type: string
          format: date-time
          description: creation time in the human readable format (UTC time zone)
        CreatedOn:
          type: integer
          description: creation time of the project
        EditedBy:
          description: the last person who edited this project document
          type: string
        DisplayEditedOn:
          type: string
          format: date-time
          description: edited time in the human readable format (UTC time zone)
        EditedOn:
          description: the last edited time of the project
          type: integer
    File:
      type: object
      properties:
        content:
          type: string
          nullable: true
          description: Content of the file in base64 format.
        attachment_id:
          type: string
          description: Unique identifier for the attachment.
        internal_filename:
          type: string
          description: Internal storage filename for the attachment.
        original_filename:
          type: string
          description: Original name of the uploaded file.
        size:
          type: integer
          description: Size of the file in bytes.
        mime_type:
          type: string
          description: MIME type of the file.
    Attachment:
      type: object
      properties:
        FileName:
          type: string
          description: Name of the file attached.
        CreatedAt:
          type: string
          format: date-time
          description: Timestamp when the attachment was created.
        UploadOn:
          type: string
          format: date
          description: Date when the file was uploaded.
        OriginalFileName:
          type: string
          description: Original filename as provided during upload.
        UploadBy:
          type: string
          description: Username of the uploader.
        Referenced:
          type: boolean
          description: Indicates if the attachment is referenced elsewhere.
        CopyNumber:
          type: integer
          description: Number of times the attachment has been copied.
        ThumbnailId:
          type: string
          description: Identifier for the attachment’s thumbnail image.
        File:
          $ref: '#/components/schemas/File'
    PageSpec:
      description: pagination specification
      type: object
      properties:
        offset:
          type: integer
        limit:
          type: integer
    FilterSpec:
      description: filter specification.
      type: object
      properties:
        fullText:
          type: string
          description: the full text search
        filters:
          type: Array<String>
          description: Array of filter
        lang:
          type: string
          description: requested language
    SortSpec:
      description: type is a specification of the sorting to be applied on the server side.
      type: object
      properties:
        order:
          type: string
        lang:
          type: string
    ProjectVersionSpec:
      type: object
      description: project specification
      properties:
        projectId:
          type: string
          description: id of the project
        subProjectId:
          type: string
          description: >-
            id of the sub project. Must be "_" if working with parent project
            only
        projectVersionNumber:
          type: string
          description: version of the project
    DocumentResult:
      type: object
      properties:
        docRef:
          type: string
          description: document reference
        documentModelName:
          type: string
          description: model name
        document:
          type: object
    ProjectGeneral:
      type: object
      properties:
        ParentId:
          type: string
          description: >-
            Id of the parent project. Will be "_" if the current project is
            already a parent
          example: P_221
        Title:
          type: string
          description: name of the project
          example: A12
        TenantId:
          type: string
          description: current tenant id
          example: T_1
        Id:
          type: string
          description: Id of the project
          example: P_221
        TechnicalId:
          type: string
          description: technical id of the document, which is. unique in the whole system
          example: 5f9b153d-fc81-443f-995a-c1878c8710c2
    schemas-Root:
      type: object
      properties:
        General:
          $ref: '#/components/schemas/ProjectGeneral'
        Metadata:
          $ref: '#/components/schemas/Metadata'
        Attachments:
          type: array
          items:
            $ref: '#/components/schemas/Attachment'
    Meta:
      type: object
      readOnly: true
      description: >-
        \[**Read only**] Contain the meta data information of the document. **It
        will be ignored if included in the request of the update operations**
        (e.g MODIFY_DOCUMENT)
      properties:
        creator:
          type: string
          readOnly: true
          description: The user who created the document
        modifier:
          type: string
          readOnly: true
          description: The user who last modified the document
        docRef:
          type: string
          description: Reference to the document
        modelReference:
          type: string
          description: Reference to the model associated with the document
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the document was created
        modifiedAt:
          type: string
          format: date-time
          description: Timestamp when the document was last modified
        modelVersion:
          type: string
          nullable: true
          description: Version of the model associated with the document
    ProjectDocument:
      type: object
      properties:
        Root:
          $ref: '#/components/schemas/schemas-Root'
        __meta:
          $ref: '#/components/schemas/Meta'
    ProjectDocumentWithDocRef:
      allOf:
        - $ref: '#/components/schemas/ProjectDocument'
        - type: object
        - properties:
            DocRef:
              type: string
    VersionGeneral:
      type: object
      properties:
        ProjectId:
          type: string
          example: P_221
        SubprojectId:
          type: string
          example: _
        VersionNumber:
          type: string
          example: 1.1.0
        DerivedVersionNumber:
          type: string
          example: 1.0.0
        DerivedVersionCreatedOn:
          type: integer
          example: 1725588957371
        DerivedVersionTitle:
          type: string
          example: A12 update
        Status:
          type: string
          example: open
        Title:
          type: string
          example: A12
        TenantId:
          type: string
          example: T_1
        Id:
          type: string
          example: 4b686566-b28c-4978-a06a-7a1aebe37a78
        TechnicalId:
          type: string
          example: 5f9b153d-fc81-443f-995a-c1878c8710c2
        WrapperNode:
          type: boolean
          example: false
        UseSubjectSpecificOrderForTestSuite:
          type: boolean
          example: false
        IsLatestVersion:
          type: boolean
          example: true
        KeyPoints:
          type: string
          example: ''
        Description:
          type: string
          example: ''
        Ancestors:
          type: string
          example: '|[1.0.0]|'
        CloseRequestOn:
          type: number
          description: Timestamp indicating when the closure was requested
        DisplayCloseRequestOn:
          type: string
          description: Formatted display string for CloseRequestOn field
        CloseStartOn:
          type: number
          description: Timestamp when the closing process actually started
        DisplayCloseStartOn:
          type: string
          description: Formatted display string for CloseStartOn field
        CloseFinishedOn:
          type: number
          description: Timestamp marking when the version was fully closed
        DisplayCloseFinishedOn:
          type: string
          description: Formatted display string for CloseFinishedOn field
        IsAwaitingClosure:
          type: boolean
          description: >-
            Boolean indicating whether the version is in the process of being
            closed but not yet finalized.
    components-schemas-Root:
      type: object
      properties:
        General:
          $ref: '#/components/schemas/VersionGeneral'
        Metadata:
          $ref: '#/components/schemas/Metadata'
        Attachments:
          type: array
          items:
            $ref: '#/components/schemas/Attachment'
    VersionDocument:
      type: object
      properties:
        Root:
          $ref: '#/components/schemas/components-schemas-Root'
        __meta:
          $ref: '#/components/schemas/Meta'
    VersionDocumentWithDocRef:
      allOf:
        - $ref: '#/components/schemas/VersionDocument'
        - type: object
        - properties:
            DocRef:
              type: string
              deprecated: true
              description: This field will be removed in v4.7.
    ProjectSpec:
      type: object
      description: project specification
      properties:
        projectId:
          type: string
          description: id of the project
        subProjectId:
          type: string
          description: >-
            id of the sub project. Must be "_" if working with parent project
            only
    GetDocumentRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
          required:
            - method
            - params
          properties:
            method:
              type: string
              description: GET_DOCUMENT
            params:
              required:
                - docRef
              properties:
                docRef:
                  type: string
                  description: document reference
      examples:
        - id: TestSuites.DataProvider-98
          jsonrpc: '2.0'
          method: GET_DOCUMENT
          params:
            docRef: Project-dm/332906
    ModifyDocumentRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
          required:
            - method
            - params
          properties:
            method:
              type: string
              description: MODIFY_DOCUMENT
            params:
              required:
                - docRef
              properties:
                docRef:
                  type: string
                  description: document reference
                locale:
                  type: string
                  description: locale of the request. 'en' or 'de'
                document:
                  type: object
                  description: modified document content
    ModifyDocumentResponse:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
        - type: object
          properties:
            result:
              type: object
              description: null value
      examples:
        - jsonrpc: '2.0'
          id: update-project-dm-t1
          result: null
    Source:
      type: object
      properties:
        docRef:
          type: string
          description: the document reference of the document within a relationship
        relationshipModel:
          type: string
          description: name of the relationship model
        role:
          type: string
          description: the role of the document within a relationship
  parameters:
    ProjectIdHeader:
      name: Project-Id
      in: header
      required: true
      schema:
        type: string
      description: Project Id or the project document reference
    SubProjectIdHeader:
      name: Subproject-Id
      in: header
      required: false
      schema:
        type: string
      description: >-
        Sub Project Id or the project document reference. It might be required
        if you want to access the sub project's resource
