-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b92be8c
commit 7ec0fe1
Showing
4 changed files
with
43 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
# frozen_string_literal: true | ||
|
||
class EpicEstimationHistoryPresenter | ||
def initialize(epic_id:) | ||
def initialize(epic_id:, labels_filter: nil) | ||
@epic_id = epic_id | ||
@labels_filter = labels_filter | ||
end | ||
|
||
def estimation_items | ||
Estimation.where(epic_id: epic_id).order(created_at: :desc).to_dto( | ||
items = Estimation.where(epic_id: epic_id).order(created_at: :desc) | ||
items = items.where("filters_applied->>'labels' = ?", labels_filter) if labels_filter.present? | ||
items.to_dto( | ||
methods: %i[estimated_finish_date estimated_finish_date_with_uncertainty label] | ||
) | ||
end | ||
|
||
private | ||
|
||
attr_reader :epic_id | ||
attr_reader :epic_id, :labels_filter | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters