2020-11-24 15:15:51 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Atlassian
|
|
|
|
module JiraConnect
|
|
|
|
module Serializers
|
|
|
|
class RepositoryEntity < BaseEntity
|
|
|
|
expose :id, format_with: :string
|
|
|
|
expose :name
|
|
|
|
expose :description
|
|
|
|
expose :url do |project|
|
|
|
|
project_url(project)
|
|
|
|
end
|
|
|
|
expose :avatar do |project|
|
|
|
|
project.avatar_url(only_path: false)
|
|
|
|
end
|
|
|
|
|
|
|
|
expose :commits do |project, options|
|
2021-01-29 00:20:46 +05:30
|
|
|
JiraConnect::Serializers::CommitEntity.represent options[:commits], project: project, update_sequence_id: options[:update_sequence_id]
|
2020-11-24 15:15:51 +05:30
|
|
|
end
|
|
|
|
expose :branches do |project, options|
|
2021-01-29 00:20:46 +05:30
|
|
|
JiraConnect::Serializers::BranchEntity.represent options[:branches], project: project, update_sequence_id: options[:update_sequence_id]
|
2020-11-24 15:15:51 +05:30
|
|
|
end
|
|
|
|
expose :pullRequests do |project, options|
|
2021-01-29 00:20:46 +05:30
|
|
|
JiraConnect::Serializers::PullRequestEntity.represent(
|
|
|
|
options[:merge_requests],
|
|
|
|
update_sequence_id: options[:update_sequence_id],
|
|
|
|
user_notes_count: options[:user_notes_count]
|
|
|
|
)
|
2020-11-24 15:15:51 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|