2020-02-03 13:08:46 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module API
|
|
|
|
module Entities
|
|
|
|
class Milestone < Grape::Entity
|
|
|
|
expose :id, :iid
|
|
|
|
expose :project_id, if: -> (entity, options) { entity&.project_id }
|
|
|
|
expose :group_id, if: -> (entity, options) { entity&.group_id }
|
|
|
|
expose :title, :description
|
|
|
|
expose :state, :created_at, :updated_at
|
|
|
|
expose :due_date
|
|
|
|
expose :start_date
|
2020-08-21 11:10:03 -04:00
|
|
|
expose :expired?, as: :expired
|
2020-02-03 13:08:46 -05:00
|
|
|
|
|
|
|
expose :web_url do |milestone, _options|
|
|
|
|
Gitlab::UrlBuilder.build(milestone)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|