dipps-client 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Gemfile.lock +19 -9
- data/lib/dipps/client/queries/own_credit_notes.rb +29 -0
- data/lib/dipps/client/queries/own_credit_notes_pagination.rb +18 -0
- data/lib/dipps/client/queries/own_invoices.rb +30 -0
- data/lib/dipps/client/queries/own_invoices_pagination.rb +18 -0
- data/lib/dipps/client/queries.rb +4 -0
- data/lib/dipps/client/version.rb +1 -1
- data/lib/dipps/client.rb +50 -0
- data/vendor/schema.json +1455 -527
- metadata +11 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91e47a4520ae0c85e7657c865120986121806dcfe377c3cc82e5f0a3c2855d97
|
4
|
+
data.tar.gz: f8471594262f88da0a504d99cb4f4aaacf4913af26c0238ba9d8b0812448a2b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fce99749e4cdac009dc5bb20c9236cb140d647354228768a558d922f6194d25937f19e215887bcad09b7682f96594d60bc39d6975aedaebe4bb8f37c1bd71203
|
7
|
+
data.tar.gz: 6bd16c9e19c01ceb0dc620a3a2c460b3a8e05bebdd090e5ace6e976cc97bb558efbc2f177f4813a54ff2fbfb84c4c83d656cc46bde9e0916b453bf7b86353b28
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,30 +1,40 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dipps-client (0.
|
4
|
+
dipps-client (0.6.0)
|
5
5
|
activesupport (>= 4.0)
|
6
6
|
graphql-client (~> 0.17.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activesupport (
|
11
|
+
activesupport (7.1.3.4)
|
12
|
+
base64
|
13
|
+
bigdecimal
|
12
14
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
15
|
+
connection_pool (>= 2.2.5)
|
16
|
+
drb
|
13
17
|
i18n (>= 1.6, < 2)
|
14
18
|
minitest (>= 5.1)
|
19
|
+
mutex_m
|
15
20
|
tzinfo (~> 2.0)
|
16
|
-
|
21
|
+
base64 (0.2.0)
|
22
|
+
bigdecimal (3.1.8)
|
17
23
|
coderay (1.1.3)
|
18
|
-
concurrent-ruby (1.
|
24
|
+
concurrent-ruby (1.3.3)
|
25
|
+
connection_pool (2.4.1)
|
19
26
|
diff-lcs (1.4.4)
|
20
|
-
|
27
|
+
drb (2.2.1)
|
28
|
+
graphql (1.13.23)
|
29
|
+
base64
|
21
30
|
graphql-client (0.17.0)
|
22
31
|
activesupport (>= 3.0)
|
23
32
|
graphql (~> 1.10)
|
24
|
-
i18n (1.
|
33
|
+
i18n (1.14.5)
|
25
34
|
concurrent-ruby (~> 1.0)
|
26
35
|
method_source (1.0.0)
|
27
|
-
minitest (5.
|
36
|
+
minitest (5.24.1)
|
37
|
+
mutex_m (0.2.0)
|
28
38
|
pry (0.14.1)
|
29
39
|
coderay (~> 1.1)
|
30
40
|
method_source (~> 1.0)
|
@@ -42,11 +52,11 @@ GEM
|
|
42
52
|
diff-lcs (>= 1.2.0, < 2.0)
|
43
53
|
rspec-support (~> 3.10.0)
|
44
54
|
rspec-support (3.10.2)
|
45
|
-
tzinfo (2.0.
|
55
|
+
tzinfo (2.0.6)
|
46
56
|
concurrent-ruby (~> 1.0)
|
47
|
-
zeitwerk (2.4.2)
|
48
57
|
|
49
58
|
PLATFORMS
|
59
|
+
ruby
|
50
60
|
x86_64-darwin-20
|
51
61
|
|
52
62
|
DEPENDENCIES
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Dipps
|
2
|
+
module Client
|
3
|
+
module Queries
|
4
|
+
OwnCreditNotes = GraphqlClient.parse <<~GQL
|
5
|
+
query($filter: CreditNotesFilter, $sort_by: CreditNotesSortByEnum, $page: Int, $per_page: Int) {
|
6
|
+
ownCreditNotes(
|
7
|
+
filter: $filter, sortBy: $sort_by, page: $page, perPage: $per_page
|
8
|
+
) {
|
9
|
+
id
|
10
|
+
buyerReference
|
11
|
+
creditNoteNumber
|
12
|
+
creditedOn
|
13
|
+
orderReference
|
14
|
+
pdfDocument {
|
15
|
+
filename
|
16
|
+
downloadPath
|
17
|
+
}
|
18
|
+
receiverOrgNumber
|
19
|
+
receiverOrgName
|
20
|
+
serviceType
|
21
|
+
status
|
22
|
+
totalAmount
|
23
|
+
vat
|
24
|
+
}
|
25
|
+
}
|
26
|
+
GQL
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Dipps
|
2
|
+
module Client
|
3
|
+
module Queries
|
4
|
+
OwnCreditNotesPagination = GraphqlClient.parse <<~GQL
|
5
|
+
query($filter: CreditNotesFilter, $page: Int, $per_page: Int) {
|
6
|
+
ownCreditNotesPagination(
|
7
|
+
filter: $filter, page: $page, perPage: $per_page
|
8
|
+
) {
|
9
|
+
count
|
10
|
+
currentPage
|
11
|
+
pages
|
12
|
+
perPage
|
13
|
+
}
|
14
|
+
}
|
15
|
+
GQL
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Dipps
|
2
|
+
module Client
|
3
|
+
module Queries
|
4
|
+
OwnInvoices = GraphqlClient.parse <<~GQL
|
5
|
+
query($filter: InvoiceFilters, $sort_by: InvoicesSortByEnum, $page: Int, $per_page: Int) {
|
6
|
+
ownInvoices(
|
7
|
+
filter: $filter, sortBy: $sort_by, page: $page, perPage: $per_page
|
8
|
+
) {
|
9
|
+
id
|
10
|
+
amount
|
11
|
+
buyerReference
|
12
|
+
invoiceNumber
|
13
|
+
invoicedOn
|
14
|
+
orderReference
|
15
|
+
pdfDocument {
|
16
|
+
filename
|
17
|
+
downloadPath
|
18
|
+
}
|
19
|
+
receiverOrgNumber
|
20
|
+
receiverOrgName
|
21
|
+
serviceType
|
22
|
+
status
|
23
|
+
totalAmount
|
24
|
+
vat
|
25
|
+
}
|
26
|
+
}
|
27
|
+
GQL
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Dipps
|
2
|
+
module Client
|
3
|
+
module Queries
|
4
|
+
OwnInvoicesPagination = GraphqlClient.parse <<~GQL
|
5
|
+
query($filter: InvoiceFilters, $page: Int, $per_page: Int) {
|
6
|
+
ownInvoicesPagination(
|
7
|
+
filter: $filter, page: $page, perPage: $per_page
|
8
|
+
) {
|
9
|
+
count
|
10
|
+
currentPage
|
11
|
+
pages
|
12
|
+
perPage
|
13
|
+
}
|
14
|
+
}
|
15
|
+
GQL
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/dipps/client/queries.rb
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
require_relative 'graphql_client'
|
2
2
|
|
3
3
|
require_relative 'queries/create_own_invoice'
|
4
|
+
require_relative 'queries/own_invoices'
|
5
|
+
require_relative 'queries/own_invoices_pagination'
|
4
6
|
require_relative 'queries/clients'
|
7
|
+
require_relative 'queries/own_credit_notes'
|
8
|
+
require_relative 'queries/own_credit_notes_pagination'
|
5
9
|
require_relative 'queries/create_client'
|
6
10
|
require_relative 'queries/update_client'
|
7
11
|
|
data/lib/dipps/client/version.rb
CHANGED
data/lib/dipps/client.rb
CHANGED
@@ -44,6 +44,56 @@ module Dipps
|
|
44
44
|
)
|
45
45
|
end
|
46
46
|
|
47
|
+
def own_invoices(filter:, sort_by:, page: 1, per_page: 20)
|
48
|
+
perform_query(
|
49
|
+
query: Dipps::Client::Queries::OwnInvoices,
|
50
|
+
result_field: 'ownInvoices',
|
51
|
+
variables: {
|
52
|
+
filter: filter,
|
53
|
+
sort_by: sort_by,
|
54
|
+
page: page,
|
55
|
+
per_page: per_page
|
56
|
+
}
|
57
|
+
)
|
58
|
+
end
|
59
|
+
|
60
|
+
def own_invoices_pagination(filter:, page: 1, per_page: 20)
|
61
|
+
perform_query(
|
62
|
+
query: Dipps::Client::Queries::OwnInvoicesPagination,
|
63
|
+
result_field: 'ownInvoicesPagination',
|
64
|
+
variables: {
|
65
|
+
filter: filter,
|
66
|
+
page: page,
|
67
|
+
per_page: per_page
|
68
|
+
}
|
69
|
+
)
|
70
|
+
end
|
71
|
+
|
72
|
+
def own_credit_notes(filter:, sort_by:, page: 1, per_page: 20)
|
73
|
+
perform_query(
|
74
|
+
query: Dipps::Client::Queries::OwnCreditNotes,
|
75
|
+
result_field: 'ownCreditNotes',
|
76
|
+
variables: {
|
77
|
+
filter: filter,
|
78
|
+
sort_by: sort_by,
|
79
|
+
page: page,
|
80
|
+
per_page: per_page
|
81
|
+
}
|
82
|
+
)
|
83
|
+
end
|
84
|
+
|
85
|
+
def own_credit_notes_pagination(filter:, page: 1, per_page: 20)
|
86
|
+
perform_query(
|
87
|
+
query: Dipps::Client::Queries::OwnCreditNotesPagination,
|
88
|
+
result_field: 'ownCreditNotesPagination',
|
89
|
+
variables: {
|
90
|
+
filter: filter,
|
91
|
+
page: page,
|
92
|
+
per_page: per_page
|
93
|
+
}
|
94
|
+
)
|
95
|
+
end
|
96
|
+
|
47
97
|
def clients(freelance_profile_id:, org_number: nil, email: nil)
|
48
98
|
perform_query(
|
49
99
|
query: Dipps::Client::Queries::Clients,
|