productive 0.6.59 → 0.6.61

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c977425e19aa039f3141c9c9820e79bc9899bf7bee60672a7075360e5fe6fb31
4
- data.tar.gz: 931e85b9bfec1e7ce396906043fc7b358afc2309a9494db7fae8bd268664cba1
3
+ metadata.gz: a1fa7dbc3f6b6b926bbd59707a36c45bcc6b59016f1bc5ce7eec6d71955fb344
4
+ data.tar.gz: 5be468ef591d98b86d7b4e6c5fde8c89e185b1cb50a6bf9b19fb86b6872db77c
5
5
  SHA512:
6
- metadata.gz: 40950a5478f66abf477f960bd655ab2e4a62881fe6ff2bb5ed37d484bdd67d6abca4c476be40833f16ef92bef8a48b056e66c82a545c8fc26496f405b81b4af9
7
- data.tar.gz: 4cc670d8b290a89721428db68ec1ca5b957dc3774b042153d214ef191f822964fe04b20d5bcb17631b8a65285f5651c802a4580fff9af5981f31e84b974940c8
6
+ metadata.gz: 1338b329648fa312f37e5cd7e62b479b863c4840ddaaaa2aadff72229bc890002674e61698dcd6d082ca2068c16cdd84b2c96ba4e04b7d7f0cf9dfdf4e335e21
7
+ data.tar.gz: 2319384f1ea30d0e0d4ce3885a1a27867d17946ffe531a638d83f1b489ba0187347b96883abb52aeb757a1e24c2e60ae528170a9b86f294bb74856667f8b6e24
@@ -1,67 +1,15 @@
1
- require 'rack'
1
+ class JsonApiPaginator < JsonApiClient::Paginating::NestedParamPaginator
2
+ self.page_param = 'number'
3
+ self.per_page_param = 'size'
2
4
 
3
- class JsonApiPaginator
4
- attr_reader :params, :result_set, :links, :meta
5
+ attr_reader :meta
5
6
 
6
7
  def initialize(result_set, data)
7
- @params = params_for_uri(result_set.uri)
8
- @result_set = result_set
9
- @links = data['links'] || {}
8
+ super
10
9
  @meta = data['meta'] || {}
11
10
  end
12
11
 
13
- def next
14
- links['next'] ? result_set.links.fetch_link('next') : nil
15
- end
16
-
17
- def prev
18
- links['prev'] ? result_set.links.fetch_link('prev') : nil
19
- end
20
-
21
- def first
22
- links['first'] ? result_set.links.fetch_link('first') : nil
23
- end
24
-
25
- def last
26
- links['last'] ? result_set.links.fetch_link('last') : nil
27
- end
28
-
29
- def total_pages
30
- if links['last']
31
- uri = result_set.links.link_url_for('last')
32
- last_params = params_for_uri(uri)
33
- last_params['page']['number'].to_i
34
- else
35
- current_page
36
- end
37
- end
38
-
39
12
  def total_entries
40
- meta['total_count'].to_i || per_page * total_pages
41
- end
42
- alias_method :total_count, :total_entries
43
-
44
- def per_page
45
- params['page']['size'].to_i
46
- end
47
-
48
- def current_page
49
- (params['page']['number'] || 1).to_i
50
- end
51
-
52
- def previous_page
53
- current_page > 1 ? (current_page - 1) : nil
54
- end
55
-
56
- def next_page
57
- current_page < total_pages ? (current_page + 1) : nil
58
- end
59
-
60
- private
61
-
62
- def params_for_uri(uri)
63
- return {} unless uri
64
- uri = Addressable::URI.parse(uri)
65
- Rack::Utils.parse_nested_query(uri.query || '')
13
+ meta['total_count'].to_i || super
66
14
  end
67
15
  end
@@ -0,0 +1,9 @@
1
+ module Productive
2
+ module Reports
3
+ class SalaryReport < BaseAccount
4
+ def self.table_name
5
+ "reports/salary_reports"
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Productive
2
+ module Reports
3
+ class TimeReport < BaseAccount
4
+ def self.table_name
5
+ "reports/time_reports"
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module Productive
2
- VERSION = '0.6.59'.freeze
2
+ VERSION = '0.6.61'.freeze
3
3
  end
data/lib/productive.rb CHANGED
@@ -26,7 +26,6 @@ require 'productive/resources/document_type'
26
26
  require 'productive/resources/email'
27
27
  require 'productive/resources/entitlement'
28
28
  require 'productive/resources/event'
29
- require 'productive/resources/event_report'
30
29
  require 'productive/resources/expense'
31
30
  require 'productive/resources/filter'
32
31
  require 'productive/resources/holiday_calendar'
@@ -46,7 +45,6 @@ require 'productive/resources/payment'
46
45
  require 'productive/resources/person'
47
46
  require 'productive/resources/pipeline'
48
47
  require 'productive/resources/price'
49
- require 'productive/resources/profitability_report'
50
48
  require 'productive/resources/project'
51
49
  require 'productive/resources/project_assignment'
52
50
  require 'productive/resources/pulse'
@@ -69,13 +67,13 @@ require 'productive/resources/reports/payroll_item_report'
69
67
  require 'productive/resources/reports/person_report'
70
68
  require 'productive/resources/reports/price_report'
71
69
  require 'productive/resources/reports/project_report'
70
+ require 'productive/resources/reports/salary_report'
72
71
  require 'productive/resources/reports/service_report'
73
72
  require 'productive/resources/reports/task_report'
74
73
  require 'productive/resources/reports/time_entry_report'
74
+ require 'productive/resources/reports/time_report'
75
75
  require 'productive/resources/role'
76
76
  require 'productive/resources/salary'
77
- require 'productive/resources/salary_report'
78
- require 'productive/resources/sales_report'
79
77
  require 'productive/resources/section'
80
78
  require 'productive/resources/service'
81
79
  require 'productive/resources/subsidiary'
data/productive.gemspec CHANGED
@@ -13,7 +13,6 @@ Gem::Specification.new do |s|
13
13
  s.license = 'MIT'
14
14
  s.files = `git ls-files`.split("\n")
15
15
 
16
- s.add_dependency 'rack'
17
- s.add_dependency 'json_api_client', '>= 1.5.2'
16
+ s.add_dependency 'json_api_client', '>= 1.13.0', "<= 1.21.0"
18
17
  s.add_dependency 'request_store', '~> 1.3'
19
18
  end
metadata CHANGED
@@ -1,43 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: productive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.59
4
+ version: 0.6.61
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josip Bišćan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-03 00:00:00.000000000 Z
11
+ date: 2022-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: rack
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: json_api_client
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
17
  - - ">="
32
18
  - !ruby/object:Gem::Version
33
- version: 1.5.2
19
+ version: 1.13.0
20
+ - - "<="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.21.0
34
23
  type: :runtime
35
24
  prerelease: false
36
25
  version_requirements: !ruby/object:Gem::Requirement
37
26
  requirements:
38
27
  - - ">="
39
28
  - !ruby/object:Gem::Version
40
- version: 1.5.2
29
+ version: 1.13.0
30
+ - - "<="
31
+ - !ruby/object:Gem::Version
32
+ version: 1.21.0
41
33
  - !ruby/object:Gem::Dependency
42
34
  name: request_store
43
35
  requirement: !ruby/object:Gem::Requirement
@@ -93,7 +85,6 @@ files:
93
85
  - lib/productive/resources/email.rb
94
86
  - lib/productive/resources/entitlement.rb
95
87
  - lib/productive/resources/event.rb
96
- - lib/productive/resources/event_report.rb
97
88
  - lib/productive/resources/expense.rb
98
89
  - lib/productive/resources/filter.rb
99
90
  - lib/productive/resources/holiday_calendar.rb
@@ -113,7 +104,6 @@ files:
113
104
  - lib/productive/resources/person.rb
114
105
  - lib/productive/resources/pipeline.rb
115
106
  - lib/productive/resources/price.rb
116
- - lib/productive/resources/profitability_report.rb
117
107
  - lib/productive/resources/project.rb
118
108
  - lib/productive/resources/project_assignment.rb
119
109
  - lib/productive/resources/pulse.rb
@@ -136,13 +126,13 @@ files:
136
126
  - lib/productive/resources/reports/person_report.rb
137
127
  - lib/productive/resources/reports/price_report.rb
138
128
  - lib/productive/resources/reports/project_report.rb
129
+ - lib/productive/resources/reports/salary_report.rb
139
130
  - lib/productive/resources/reports/service_report.rb
140
131
  - lib/productive/resources/reports/task_report.rb
141
132
  - lib/productive/resources/reports/time_entry_report.rb
133
+ - lib/productive/resources/reports/time_report.rb
142
134
  - lib/productive/resources/role.rb
143
135
  - lib/productive/resources/salary.rb
144
- - lib/productive/resources/salary_report.rb
145
- - lib/productive/resources/sales_report.rb
146
136
  - lib/productive/resources/section.rb
147
137
  - lib/productive/resources/service.rb
148
138
  - lib/productive/resources/service_assignment.rb
@@ -1,6 +0,0 @@
1
- module Productive
2
- class EventReport < BaseAccount
3
- has_one :person
4
- has_one :event
5
- end
6
- end
@@ -1,8 +0,0 @@
1
- module Productive
2
- class ProfitabilityReport < BaseAccount
3
- has_one :deal
4
- has_one :company
5
- has_one :project
6
- has_one :manager, class_name: :person
7
- end
8
- end
@@ -1,5 +0,0 @@
1
- module Productive
2
- class SalaryReport < BaseAccount
3
- has_one :person
4
- end
5
- end
@@ -1,6 +0,0 @@
1
- module Productive
2
- class SalesReport < BaseAccount
3
- has_one :deal
4
- has_one :manager, class_name: :person
5
- end
6
- end