plexus.dashboard.api.models.feedback_item module
- class plexus.dashboard.api.models.feedback_item.FeedbackItem(id: str | None = None, accountId: str | None = None, scorecardId: str | None = None, cacheKey: str | None = None, scoreId: str | None = None, itemId: str | None = None, initialAnswerValue: str | None = None, finalAnswerValue: str | None = None, initialCommentValue: str | None = None, finalCommentValue: str | None = None, editCommentValue: str | None = None, editedAt: datetime | None = None, editorName: str | None = None, isAgreement: bool | None = None, createdAt: datetime | None = None, updatedAt: datetime | None = None, account: Account | None = None, scorecard: Scorecard | None = None, score: Score | None = None, item: Item | None = None, scoreResults: Any | None = None, _client: PlexusDashboardClient | None = None, _raw_data: Dict[str, Any] | None = None)
Bases:
BaseModelRepresents aggregated feedback results for a specific form/question combination. Corresponds to the FeedbackItem model in the GraphQL schema.
- GRAPHQL_BASE_FIELDS = ['id', 'accountId', 'scorecardId', 'cacheKey', 'scoreId', 'itemId', 'initialAnswerValue', 'finalAnswerValue', 'initialCommentValue', 'finalCommentValue', 'editCommentValue', 'editedAt', 'editorName', 'isAgreement', 'createdAt', 'updatedAt']
- GRAPHQL_RELATIONSHIP_FIELDS = {}
- __init__(id: str | None = None, accountId: str | None = None, scorecardId: str | None = None, cacheKey: str | None = None, scoreId: str | None = None, itemId: str | None = None, initialAnswerValue: str | None = None, finalAnswerValue: str | None = None, initialCommentValue: str | None = None, finalCommentValue: str | None = None, editCommentValue: str | None = None, editedAt: datetime | None = None, editorName: str | None = None, isAgreement: bool | None = None, createdAt: datetime | None = None, updatedAt: datetime | None = None, account: Account | None = None, scorecard: Scorecard | None = None, score: Score | None = None, item: Item | None = None, scoreResults: Any | None = None, _client: PlexusDashboardClient | None = None, _raw_data: Dict[str, Any] | None = None) None
- accountId: str | None = None
- cacheKey: str | None = None
- classmethod count_by_account_id(account_id: str, client: PlexusDashboardClient) int
Count the number of FeedbackItem records for a specific account.
- Args:
account_id: The ID of the account to count records for. client: The API client to use.
- Returns:
int: The number of FeedbackItem records for the account.
- classmethod create(client: PlexusDashboardClient, data: Dict[str, Any]) FeedbackItem | None
Create a new FeedbackItem.
- createdAt: datetime | None = None
- classmethod delete_all_by_account_id(account_id: str, client: PlexusDashboardClient, progress=None, task_id=None) int
Delete all FeedbackItem records for a specific account.
- Args:
account_id: The ID of the account to delete records for. client: The API client to use. progress: Optional progress bar instance to use for tracking progress. task_id: Optional task ID within the progress bar to update.
- Returns:
int: The number of records deleted.
- editCommentValue: str | None = None
- editedAt: datetime | None = None
- editorName: str | None = None
- finalAnswerValue: str | None = None
- finalCommentValue: str | None = None
- classmethod from_dict(data: Dict[str, Any], client: PlexusDashboardClient | None = None) FeedbackItem
Create a FeedbackItem instance from a dictionary.
- Args:
data: Dictionary containing the FeedbackItem data. client: Optional API client to associate with the instance.
- Returns:
A new FeedbackItem instance.
- classmethod generate_cache_key(score_id: str, form_id: str) str
Generate a cache key for a feedback item based on score ID and form ID.
- Args:
score_id: The score ID form_id: The form ID
- Returns:
A string that can be used as a cache key
- classmethod get(id: str, client: PlexusDashboardClient, fields: List[str] | None = None, relationship_fields: Dict[str, List[str]] | None = None) FeedbackItem | None
Retrieve a specific FeedbackItem by its ID.
- classmethod get_by_composite_key(client: PlexusDashboardClient, account_id: str, scorecard_id: str, score_id: str, cache_key: str) FeedbackItem | None
Efficiently retrieve a FeedbackItem using the combination of account, scorecard, score, and cache key.
- Args:
client: The API client account_id: Account ID scorecard_id: Scorecard ID score_id: Score ID cache_key: Cache key for this feedback item
- Returns:
FeedbackItem or None if not found
- id: str | None = None
- initialAnswerValue: str | None = None
- initialCommentValue: str | None = None
- isAgreement: bool | None = None
- itemId: str | None = None
- classmethod list(client: PlexusDashboardClient, account_id: str | None = None, scorecard_id: str | None = None, score_id: str | None = None, cache_key: str | None = None, limit: int = 100, next_token: str | None = None, fields: List[str] | None = None, relationship_fields: Dict[str, List[str]] | None = None, filter: Dict[str, Any] | None = None, index_name: str | None = None, sort_condition: Dict[str, Any] | None = None)
List FeedbackItems with optional filtering.
- Args:
client: The API client to use account_id: Optional account ID to filter by scorecard_id: Optional scorecard ID to filter by score_id: Optional score ID to filter by cache_key: Optional cache key to filter by limit: Maximum number of items to return next_token: Pagination token from a previous request fields: Optional list of fields to include in the response relationship_fields: Optional relationship fields to include filter: Optional additional filter parameters index_name: Optional GSI name to use (e.g., “byAccountScorecardScoreUpdatedAt”) sort_condition: Optional sort condition for the GSI query, particularly for date range filtering
- Returns:
Tuple of (list of FeedbackItem objects, next pagination token)
- load_change_details(force_reload: bool = False)
Loads the related FeedbackChangeDetail records.
- scoreId: str | None = None
- scoreResults: Any | None = None
- scorecardId: str | None = None
- updatedAt: datetime | None = None
- classmethod upsert_by_cache_key(client: PlexusDashboardClient, account_id: str, scorecard_id: str, score_id: str, cache_key: str, initial_answer_value: str | None = None, final_answer_value: str | None = None, initial_comment_value: str | None = None, final_comment_value: str | None = None, edit_comment_value: str | None = None, is_agreement: bool | None = None, edited_at: str | None = None, editor_name: str | None = None, item_id: str | None = None, debug: bool = False) Tuple[str, bool, str | None]
Create or update a FeedbackItem using cache key lookup for deduplication.
Uses the byCacheKey GSI for efficient lookup to prevent duplicates.
- Args:
client: The PlexusDashboardClient instance account_id: Account ID scorecard_id: Scorecard ID score_id: Score ID cache_key: Cache key for lookup (typically “{score_id}:{form_id}”) initial_answer_value: Initial answer value final_answer_value: Final answer value initial_comment_value: Initial comment value final_comment_value: Final comment value edit_comment_value: Edit comment value is_agreement: Whether initial and final answers agree edited_at: ISO timestamp when edited editor_name: Name of editor item_id: Associated Item ID debug: Enable debug logging
- Returns:
Tuple of (feedback_item_id, was_created, error_message) - feedback_item_id: ID of the FeedbackItem (None if error) - was_created: True if created, False if updated - error_message: Error description (None if successful)