dipps-client 0.5.0 → 0.6.1
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_page.rb +37 -0
- data/lib/dipps/client/queries/own_invoices_page.rb +38 -0
- data/lib/dipps/client/queries.rb +2 -0
- data/lib/dipps/client/version.rb +1 -1
- data/lib/dipps/client.rb +26 -0
- data/vendor/schema.json +1504 -536
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a753ac2c07f6cc8fea6668cbcd12715ff82ff2a396a31818a829b3ba759c8376
|
4
|
+
data.tar.gz: 6ceb9f8098aedd743b8521797ade8410487d02c9401482327a4eb24d20cbe1b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b249786c90f1de9efe4587f44d50053e1084e02604733b5b3ddeff4e6e80f5eb5255fd20dfdf1c541a8ec5ce336a1e9c12927d7fa1abadefeedc1f37679c2ca6
|
7
|
+
data.tar.gz: '096f4e1a9e76b7da535976a94f539375d1641d3aa5ba4053fa1bcd23660df8c0fb6a1883fa7c2fa922ff226c1a1b59dc1751fd349c853313648928a5b589ef5e'
|
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.1)
|
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,37 @@
|
|
1
|
+
module Dipps
|
2
|
+
module Client
|
3
|
+
module Queries
|
4
|
+
OwnCreditNotesPage = GraphqlClient.parse <<~GQL
|
5
|
+
query($filter: CreditNotesFilter, $sort_by: CreditNotesSortByEnum, $page: Int, $per_page: Int) {
|
6
|
+
ownCreditNotesPage(
|
7
|
+
filter: $filter, sortBy: $sort_by, page: $page, perPage: $per_page
|
8
|
+
) {
|
9
|
+
collection {
|
10
|
+
id
|
11
|
+
buyerReference
|
12
|
+
creditNoteNumber
|
13
|
+
creditedOn
|
14
|
+
orderReference
|
15
|
+
pdfDocument {
|
16
|
+
filename
|
17
|
+
downloadPath
|
18
|
+
}
|
19
|
+
receiverOrgNumber
|
20
|
+
receiverOrgName
|
21
|
+
serviceType
|
22
|
+
status
|
23
|
+
totalAmount
|
24
|
+
vat
|
25
|
+
}
|
26
|
+
_pagination {
|
27
|
+
count
|
28
|
+
currentPage
|
29
|
+
pages
|
30
|
+
perPage
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
GQL
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Dipps
|
2
|
+
module Client
|
3
|
+
module Queries
|
4
|
+
OwnInvoicesPage = GraphqlClient.parse <<~GQL
|
5
|
+
query($filter: InvoiceFilters, $sort_by: InvoicesSortByEnum, $page: Int, $per_page: Int) {
|
6
|
+
ownInvoicesPage(
|
7
|
+
filter: $filter, sortBy: $sort_by, page: $page, perPage: $per_page
|
8
|
+
) {
|
9
|
+
collection {
|
10
|
+
id
|
11
|
+
amount
|
12
|
+
buyerReference
|
13
|
+
invoiceNumber
|
14
|
+
invoicedOn
|
15
|
+
orderReference
|
16
|
+
pdfDocument {
|
17
|
+
filename
|
18
|
+
downloadPath
|
19
|
+
}
|
20
|
+
receiverOrgNumber
|
21
|
+
receiverOrgName
|
22
|
+
serviceType
|
23
|
+
status
|
24
|
+
totalAmount
|
25
|
+
vat
|
26
|
+
}
|
27
|
+
_pagination {
|
28
|
+
count
|
29
|
+
currentPage
|
30
|
+
pages
|
31
|
+
perPage
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
GQL
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/dipps/client/queries.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
require_relative 'graphql_client'
|
2
2
|
|
3
3
|
require_relative 'queries/create_own_invoice'
|
4
|
+
require_relative 'queries/own_invoices_page'
|
4
5
|
require_relative 'queries/clients'
|
6
|
+
require_relative 'queries/own_credit_notes_page'
|
5
7
|
require_relative 'queries/create_client'
|
6
8
|
require_relative 'queries/update_client'
|
7
9
|
|
data/lib/dipps/client/version.rb
CHANGED
data/lib/dipps/client.rb
CHANGED
@@ -44,6 +44,32 @@ module Dipps
|
|
44
44
|
)
|
45
45
|
end
|
46
46
|
|
47
|
+
def own_invoices_page(filter:, sort_by:, page: 1, per_page: 20)
|
48
|
+
perform_query(
|
49
|
+
query: Dipps::Client::Queries::OwnInvoicesPage,
|
50
|
+
result_field: 'ownInvoicesPage',
|
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_credit_notes_page(filter:, sort_by:, page: 1, per_page: 20)
|
61
|
+
perform_query(
|
62
|
+
query: Dipps::Client::Queries::OwnCreditNotesPage,
|
63
|
+
result_field: 'ownCreditNotesPage',
|
64
|
+
variables: {
|
65
|
+
filter: filter,
|
66
|
+
sort_by: sort_by,
|
67
|
+
page: page,
|
68
|
+
per_page: per_page
|
69
|
+
}
|
70
|
+
)
|
71
|
+
end
|
72
|
+
|
47
73
|
def clients(freelance_profile_id:, org_number: nil, email: nil)
|
48
74
|
perform_query(
|
49
75
|
query: Dipps::Client::Queries::Clients,
|