2020-03-13 15:44:24 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module API
|
|
|
|
module Entities
|
|
|
|
class ProjectImportStatus < ProjectIdentity
|
|
|
|
expose :import_status
|
2020-04-22 19:07:51 +05:30
|
|
|
expose :correlation_id do |project, _options|
|
|
|
|
project.import_state&.correlation_id
|
|
|
|
end
|
|
|
|
|
|
|
|
expose :failed_relations, using: Entities::ProjectImportFailedRelation do |project, _options|
|
2020-04-25 10:58:03 +05:30
|
|
|
project.import_state&.relation_hard_failures(limit: 100) || []
|
2020-04-22 19:07:51 +05:30
|
|
|
end
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2021-02-22 17:27:13 +05:30
|
|
|
expose :import_error do |project, _options|
|
|
|
|
project.import_state&.last_error
|
2020-03-13 15:44:24 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|