Class: CommandTower::Workflows::Messaging::Inbox::ListWorkflow
- Inherits:
-
BaseWorkflow
- Object
- ApplicationWorkflow
- BaseWorkflow
- CommandTower::Workflows::Messaging::Inbox::ListWorkflow
- Defined in:
- app/workflows/command_tower/workflows/messaging/inbox.rb
Constant Summary
Constants inherited from ApplicationWorkflow
ApplicationWorkflow::ALLOWED_RETRY_STRATEGIES, ApplicationWorkflow::InvalidTransactionResult, ApplicationWorkflow::TransactionFailure
Instance Method Summary collapse
Methods inherited from BaseWorkflow
Methods inherited from ApplicationWorkflow
call, call_from_job, continuation_max_attempts, declared_retry_strategy, mark_impersonation_activity!, retry_strategy, validate_retry_strategy!
Methods included from Impersonation::ActivityDeclaration
Methods included from Logging::LifecycleDeclaration
Methods included from Execution::ContextAccess
#audit, #execution_context, #log_debug, #log_error, #log_info, #log_warn, #publish_event
Methods included from Transactional
#fail_transaction!, #transaction
Instance Method Details
#call(user:, limit:, offset:, scope:) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'app/workflows/command_tower/workflows/messaging/inbox.rb', line 25 def call(user:, limit:, offset:, scope:) result = CommandTower::Services::Messaging::Inbox::List.call(user:, limit:, offset:, scope:) return result_or_failure(result) unless result.success? payload = result.data[:items].map { |item| CommandTower::Serializers::Messaging::Inbox::ItemSerializer.serialize(item) } = CommandTower::Serializers::Messaging::Inbox::PaginationMetaSerializer.serialize(result.data[:pagination]) success(payload:, meta:, http_status: :ok) end |