5ae9a44aa1
The API get projects/:id/traffic/fetches allows user with write access to the repository to get the number of clones for the last 30 days.
21 lines
366 B
Ruby
21 lines
366 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Projects
|
|
class DailyStatisticsFinder
|
|
attr_reader :project
|
|
|
|
def initialize(project)
|
|
@project = project
|
|
end
|
|
|
|
def fetches
|
|
ProjectDailyStatistic.of_project(project)
|
|
.of_last_30_days
|
|
.sorted_by_date_desc
|
|
end
|
|
|
|
def total_fetch_count
|
|
fetches.sum_fetch_count
|
|
end
|
|
end
|
|
end
|