getMyInterestedTickets method

Future<Map<String, dynamic>> getMyInterestedTickets({
  1. required String projectID,
  2. required String tenantProductID,
  3. int limit = 30,
  4. int offset = 0,
})

Implementation

Future<Map<String, dynamic>> getMyInterestedTickets({
    required String projectID,
    required String tenantProductID,
    int limit = 30,
    int offset = 0,
  }) async {
    const query = r'''
      query MyInterestedTickets($projectID: UUID!, $tenantProductID: UUID!, $limit: Int!, $offset: Int!) {
        myInterestedTickets(projectID: $projectID, tenantProductID: $tenantProductID, limit: $limit, offset: $offset) {
          success
          message
          total
          projectTickets {
            id
            ticketNumber
            projectID
            trackerID
            statusID
            priorityID
            parentID
            userAuthorID
            tenantUserAuthorID
            assigneeID
            tenantID
            tenantProductID
            subject
            description
            doneRatio
            estimatedHours
            isPrivate
            startDate
            dueDate
            createdAt
            updatedAt
            customValues

            tracker {
              id
              name
              description
              defaultStatusId
            }

            status {
              id
              name
            }

            priority {
              id
              name
            }

            userAuthor {
              id
              username
              email
              role {
                id
                name
              }
            }

            tenantAuthor {
              id
              username
              email
              firstName
              lastName
              location
              profile_Photo
            }

            assignee {
              id
              username
              email
            }

            parent {
              id
              ticketNumber
              subject
              status {
                name
              }
            }

            project {
              id
              name
              description
              createdAt
            }

            tenant {
              id
            }

            tenantProduct {
              id
              productId
              productToken
            }

            totalTimeSpent
            hasActiveTimer
            canEdit
            canDelete

            notes {
              id
              content
              author
              createdAt
              updatedAt
              canEdit
              canDelete
            }

            journal {
              id
              field
              oldValue
              newValue
              author
              createdAt
            }

            subtasks {
              id
              ticketNumber
              subject
              doneRatio
              status {
                name
              }
            }

            mediaFiles {
              url
              filename
              type
              label
              size
            }

            audioFiles {
              url
              filename
              type
              label
              size
            }

            videoFiles {
              url
              filename
              type
              label
              size
            }

            imageFiles {
              url
              filename
              type
              label
              size
            }

            documentFiles {
              url
              filename
              type
              label
              size
            }
          }
        }
      }
    ''';

    final result = await _api.graphql(query, {
      'projectID': projectID,
      'tenantProductID': tenantProductID,
      'limit': limit,
      'offset': offset,
    });

    return result['myInterestedTickets'] ?? {
      'success': false,
      'message': 'Failed to fetch interested tickets'
    };
  }