cashctrl 0.0.1 → 0.1.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/LICENSE.txt +21 -0
- data/README.md +549 -14
- data/lib/cashctrl/client.rb +216 -0
- data/lib/cashctrl/collection.rb +77 -0
- data/lib/cashctrl/configuration.rb +30 -0
- data/lib/cashctrl/error.rb +27 -0
- data/lib/cashctrl/localized_string.rb +115 -0
- data/lib/cashctrl/models/account.rb +35 -0
- data/lib/cashctrl/models/article.rb +40 -0
- data/lib/cashctrl/models/asset.rb +32 -0
- data/lib/cashctrl/models/bank.rb +16 -0
- data/lib/cashctrl/models/category.rb +13 -0
- data/lib/cashctrl/models/certificate_document.rb +14 -0
- data/lib/cashctrl/models/certificate_template.rb +13 -0
- data/lib/cashctrl/models/cost_center.rb +15 -0
- data/lib/cashctrl/models/currency.rb +18 -0
- data/lib/cashctrl/models/custom_field.rb +18 -0
- data/lib/cashctrl/models/custom_field_group.rb +12 -0
- data/lib/cashctrl/models/file.rb +19 -0
- data/lib/cashctrl/models/fiscal_period.rb +16 -0
- data/lib/cashctrl/models/fiscal_period_task.rb +14 -0
- data/lib/cashctrl/models/history.rb +19 -0
- data/lib/cashctrl/models/insurance_type.rb +13 -0
- data/lib/cashctrl/models/journal.rb +56 -0
- data/lib/cashctrl/models/journal_import.rb +18 -0
- data/lib/cashctrl/models/journal_import_entry.rb +20 -0
- data/lib/cashctrl/models/loader.rb +52 -0
- data/lib/cashctrl/models/location.rb +22 -0
- data/lib/cashctrl/models/order.rb +46 -0
- data/lib/cashctrl/models/order_book_entry.rb +17 -0
- data/lib/cashctrl/models/order_document.rb +15 -0
- data/lib/cashctrl/models/order_layout.rb +18 -0
- data/lib/cashctrl/models/order_payment.rb +16 -0
- data/lib/cashctrl/models/person.rb +72 -0
- data/lib/cashctrl/models/report.rb +15 -0
- data/lib/cashctrl/models/report_collection.rb +13 -0
- data/lib/cashctrl/models/report_element.rb +16 -0
- data/lib/cashctrl/models/rounding.rb +15 -0
- data/lib/cashctrl/models/salary_book_entry.rb +16 -0
- data/lib/cashctrl/models/salary_certificate.rb +15 -0
- data/lib/cashctrl/models/salary_document.rb +15 -0
- data/lib/cashctrl/models/salary_field.rb +16 -0
- data/lib/cashctrl/models/salary_layout.rb +13 -0
- data/lib/cashctrl/models/salary_payment.rb +16 -0
- data/lib/cashctrl/models/salary_setting.rb +12 -0
- data/lib/cashctrl/models/salary_statement.rb +17 -0
- data/lib/cashctrl/models/salary_status.rb +12 -0
- data/lib/cashctrl/models/salary_sum.rb +14 -0
- data/lib/cashctrl/models/salary_template.rb +12 -0
- data/lib/cashctrl/models/salary_type.rb +14 -0
- data/lib/cashctrl/models/sequence_number.rb +13 -0
- data/lib/cashctrl/models/setting.rb +33 -0
- data/lib/cashctrl/models/tax.rb +17 -0
- data/lib/cashctrl/models/text.rb +13 -0
- data/lib/cashctrl/models/title.rb +13 -0
- data/lib/cashctrl/models/unit.rb +11 -0
- data/lib/cashctrl/resource.rb +190 -0
- data/lib/cashctrl/resources/account/bank.rb +24 -0
- data/lib/cashctrl/resources/account/category.rb +22 -0
- data/lib/cashctrl/resources/account/cost_center/category.rb +24 -0
- data/lib/cashctrl/resources/account/cost_center.rb +48 -0
- data/lib/cashctrl/resources/account.rb +54 -0
- data/lib/cashctrl/resources/base.rb +161 -0
- data/lib/cashctrl/resources/currency.rb +26 -0
- data/lib/cashctrl/resources/custom_field/group.rb +24 -0
- data/lib/cashctrl/resources/custom_field.rb +30 -0
- data/lib/cashctrl/resources/file/category.rb +22 -0
- data/lib/cashctrl/resources/file.rb +66 -0
- data/lib/cashctrl/resources/fiscal_period/task.rb +30 -0
- data/lib/cashctrl/resources/fiscal_period.rb +96 -0
- data/lib/cashctrl/resources/history.rb +44 -0
- data/lib/cashctrl/resources/inventory/article/category.rb +24 -0
- data/lib/cashctrl/resources/inventory/article.rb +34 -0
- data/lib/cashctrl/resources/inventory/asset/category.rb +24 -0
- data/lib/cashctrl/resources/inventory/asset.rb +34 -0
- data/lib/cashctrl/resources/inventory/unit.rb +12 -0
- data/lib/cashctrl/resources/journal/import/entry.rb +54 -0
- data/lib/cashctrl/resources/journal/import.rb +22 -0
- data/lib/cashctrl/resources/journal.rb +94 -0
- data/lib/cashctrl/resources/location.rb +10 -0
- data/lib/cashctrl/resources/order/book_entry.rb +12 -0
- data/lib/cashctrl/resources/order/category.rb +32 -0
- data/lib/cashctrl/resources/order/document.rb +38 -0
- data/lib/cashctrl/resources/order/layout.rb +12 -0
- data/lib/cashctrl/resources/order/payment.rb +56 -0
- data/lib/cashctrl/resources/order.rb +94 -0
- data/lib/cashctrl/resources/person/category.rb +22 -0
- data/lib/cashctrl/resources/person/title.rb +12 -0
- data/lib/cashctrl/resources/person.rb +40 -0
- data/lib/cashctrl/resources/report/collection.rb +72 -0
- data/lib/cashctrl/resources/report/element.rb +80 -0
- data/lib/cashctrl/resources/report.rb +60 -0
- data/lib/cashctrl/resources/rounding.rb +10 -0
- data/lib/cashctrl/resources/salary/book_entry.rb +12 -0
- data/lib/cashctrl/resources/salary/category.rb +22 -0
- data/lib/cashctrl/resources/salary/certificate/document.rb +72 -0
- data/lib/cashctrl/resources/salary/certificate/template.rb +24 -0
- data/lib/cashctrl/resources/salary/certificate.rb +30 -0
- data/lib/cashctrl/resources/salary/document.rb +62 -0
- data/lib/cashctrl/resources/salary/field.rb +38 -0
- data/lib/cashctrl/resources/salary/insurance/type.rb +14 -0
- data/lib/cashctrl/resources/salary/layout.rb +12 -0
- data/lib/cashctrl/resources/salary/payment.rb +56 -0
- data/lib/cashctrl/resources/salary/setting.rb +12 -0
- data/lib/cashctrl/resources/salary/statement.rb +77 -0
- data/lib/cashctrl/resources/salary/status.rb +24 -0
- data/lib/cashctrl/resources/salary/sum.rb +12 -0
- data/lib/cashctrl/resources/salary/template.rb +22 -0
- data/lib/cashctrl/resources/salary/type.rb +24 -0
- data/lib/cashctrl/resources/sequence_number.rb +20 -0
- data/lib/cashctrl/resources/setting.rb +52 -0
- data/lib/cashctrl/resources/tax.rb +10 -0
- data/lib/cashctrl/resources/text.rb +10 -0
- data/lib/cashctrl/schema.yml +601 -0
- data/lib/cashctrl/version.rb +1 -1
- data/lib/cashctrl.rb +114 -2
- data/lib/generators/model_generator.rb +92 -0
- metadata +115 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cashctrl
|
|
4
|
+
module Resources
|
|
5
|
+
class Order
|
|
6
|
+
class Category < Base
|
|
7
|
+
api_path "order/category"
|
|
8
|
+
model_class Models::Category
|
|
9
|
+
|
|
10
|
+
class << self
|
|
11
|
+
def read_status(id:)
|
|
12
|
+
client.get("#{api_path}/read_status.json", id: id)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def reorder(ids:)
|
|
16
|
+
ids_param = Array(ids).join(",")
|
|
17
|
+
client.post("#{api_path}/reorder.json", ids: ids_param)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def read_status(id:)
|
|
22
|
+
client.get("#{api_path}/read_status.json", id: id)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def reorder(ids:)
|
|
26
|
+
ids_param = Array(ids).join(",")
|
|
27
|
+
client.post("#{api_path}/reorder.json", ids: ids_param)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cashctrl
|
|
4
|
+
module Resources
|
|
5
|
+
class Order
|
|
6
|
+
class Document < Base
|
|
7
|
+
api_path "order/document"
|
|
8
|
+
model_class Models::OrderDocument
|
|
9
|
+
|
|
10
|
+
class << self
|
|
11
|
+
def read_pdf(id:)
|
|
12
|
+
client.get_raw("#{api_path}/read.pdf", id: id)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def read_zip(id:)
|
|
16
|
+
client.get_raw("#{api_path}/read.zip", id: id)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def mail(id:, recipient_email:, **params)
|
|
20
|
+
client.post("#{api_path}/mail.json", { id: id, recipientEmail: recipient_email, **params })
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def read_pdf(id:)
|
|
25
|
+
client.get_raw("#{api_path}/read.pdf", id: id)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def read_zip(id:)
|
|
29
|
+
client.get_raw("#{api_path}/read.zip", id: id)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def mail(id:, recipient_email:, **params)
|
|
33
|
+
client.post("#{api_path}/mail.json", { id: id, recipientEmail: recipient_email, **params })
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cashctrl
|
|
4
|
+
module Resources
|
|
5
|
+
class Order
|
|
6
|
+
class Payment < Base
|
|
7
|
+
api_path "order/payment"
|
|
8
|
+
model_class Models::OrderPayment
|
|
9
|
+
|
|
10
|
+
class << self
|
|
11
|
+
def list
|
|
12
|
+
raise NotImplementedError, "Order::Payment does not support list"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def read(id:)
|
|
16
|
+
raise NotImplementedError, "Order::Payment does not support read"
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def update(id:, **params)
|
|
20
|
+
raise NotImplementedError, "Order::Payment does not support update"
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def delete(ids:)
|
|
24
|
+
raise NotImplementedError, "Order::Payment does not support delete"
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def download(ids:)
|
|
28
|
+
ids_param = Array(ids).join(",")
|
|
29
|
+
client.get_raw("#{api_path}/download", ids: ids_param)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def list
|
|
34
|
+
raise NotImplementedError, "Order::Payment does not support list"
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def read(id:)
|
|
38
|
+
raise NotImplementedError, "Order::Payment does not support read"
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def update(id:, **params)
|
|
42
|
+
raise NotImplementedError, "Order::Payment does not support update"
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def delete(ids:)
|
|
46
|
+
raise NotImplementedError, "Order::Payment does not support delete"
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def download(ids:)
|
|
50
|
+
ids_param = Array(ids).join(",")
|
|
51
|
+
client.get_raw("#{api_path}/download", ids: ids_param)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cashctrl
|
|
4
|
+
module Resources
|
|
5
|
+
class Order < Base
|
|
6
|
+
api_path "order"
|
|
7
|
+
model_class Models::Order
|
|
8
|
+
|
|
9
|
+
class << self
|
|
10
|
+
def update_status(id:, status:)
|
|
11
|
+
client.post("#{api_path}/update_status.json", id: id, status: status)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def update_recurrence(id:, recurrence: nil, start_date: nil, end_date: nil, days_before: nil,
|
|
15
|
+
notify_type: nil, notify_person_id: nil, notify_user_id: nil, notify_email: nil)
|
|
16
|
+
params = { id: id }
|
|
17
|
+
params[:recurrence] = recurrence if recurrence
|
|
18
|
+
params[:startDate] = start_date if start_date
|
|
19
|
+
params[:endDate] = end_date if end_date
|
|
20
|
+
params[:daysBefore] = days_before if days_before
|
|
21
|
+
params[:notifyType] = notify_type if notify_type
|
|
22
|
+
params[:notifyPersonId] = notify_person_id if notify_person_id
|
|
23
|
+
params[:notifyUserId] = notify_user_id if notify_user_id
|
|
24
|
+
params[:notifyEmail] = notify_email if notify_email
|
|
25
|
+
client.post("#{api_path}/update_recurrence.json", params)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def continue(id:)
|
|
29
|
+
client.post("#{api_path}/continue.json", id: id)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def dossier(id:)
|
|
33
|
+
client.get("#{api_path}/dossier.json", id: id)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def dossier_add(id:, dossier_ids:)
|
|
37
|
+
dossier_ids_param = Array(dossier_ids).join(",")
|
|
38
|
+
client.post("#{api_path}/dossier_add.json", id: id, dossierIds: dossier_ids_param)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def dossier_remove(id:, dossier_ids:)
|
|
42
|
+
dossier_ids_param = Array(dossier_ids).join(",")
|
|
43
|
+
client.post("#{api_path}/dossier_remove.json", id: id, dossierIds: dossier_ids_param)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def update_attachments(id:, file_ids:)
|
|
47
|
+
file_ids_param = Array(file_ids).join(",")
|
|
48
|
+
client.post("#{api_path}/update_attachments.json", id: id, fileIds: file_ids_param)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def update_status(id:, status:)
|
|
53
|
+
client.post("#{api_path}/update_status.json", id: id, status: status)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def update_recurrence(id:, recurrence: nil, start_date: nil, end_date: nil, days_before: nil,
|
|
57
|
+
notify_type: nil, notify_person_id: nil, notify_user_id: nil, notify_email: nil)
|
|
58
|
+
params = { id: id }
|
|
59
|
+
params[:recurrence] = recurrence if recurrence
|
|
60
|
+
params[:startDate] = start_date if start_date
|
|
61
|
+
params[:endDate] = end_date if end_date
|
|
62
|
+
params[:daysBefore] = days_before if days_before
|
|
63
|
+
params[:notifyType] = notify_type if notify_type
|
|
64
|
+
params[:notifyPersonId] = notify_person_id if notify_person_id
|
|
65
|
+
params[:notifyUserId] = notify_user_id if notify_user_id
|
|
66
|
+
params[:notifyEmail] = notify_email if notify_email
|
|
67
|
+
client.post("#{api_path}/update_recurrence.json", params)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def continue(id:)
|
|
71
|
+
client.post("#{api_path}/continue.json", id: id)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def dossier(id:)
|
|
75
|
+
client.get("#{api_path}/dossier.json", id: id)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def dossier_add(id:, dossier_ids:)
|
|
79
|
+
dossier_ids_param = Array(dossier_ids).join(",")
|
|
80
|
+
client.post("#{api_path}/dossier_add.json", id: id, dossierIds: dossier_ids_param)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def dossier_remove(id:, dossier_ids:)
|
|
84
|
+
dossier_ids_param = Array(dossier_ids).join(",")
|
|
85
|
+
client.post("#{api_path}/dossier_remove.json", id: id, dossierIds: dossier_ids_param)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def update_attachments(id:, file_ids:)
|
|
89
|
+
file_ids_param = Array(file_ids).join(",")
|
|
90
|
+
client.post("#{api_path}/update_attachments.json", id: id, fileIds: file_ids_param)
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cashctrl
|
|
4
|
+
module Resources
|
|
5
|
+
class Person
|
|
6
|
+
class Category < Base
|
|
7
|
+
api_path "person/category"
|
|
8
|
+
model_class Models::Category
|
|
9
|
+
|
|
10
|
+
class << self
|
|
11
|
+
def tree
|
|
12
|
+
client.get("#{api_path}/tree.json")
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def tree
|
|
17
|
+
client.get("#{api_path}/tree.json")
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cashctrl
|
|
4
|
+
module Resources
|
|
5
|
+
class Person < Base
|
|
6
|
+
api_path "person"
|
|
7
|
+
model_class Models::Person
|
|
8
|
+
|
|
9
|
+
class << self
|
|
10
|
+
def categorize(ids:, target:)
|
|
11
|
+
ids_param = Array(ids).join(",")
|
|
12
|
+
client.post("#{api_path}/categorize.json", ids: ids_param, target: target)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def update_attachments(id:, file_ids:)
|
|
16
|
+
file_ids_param = Array(file_ids).join(",")
|
|
17
|
+
client.post("#{api_path}/update_attachments.json", id: id, fileIds: file_ids_param)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def list_vcf(**params)
|
|
21
|
+
client.get_raw("#{api_path}/list.vcf", params)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def categorize(ids:, target:)
|
|
26
|
+
ids_param = Array(ids).join(",")
|
|
27
|
+
client.post("#{api_path}/categorize.json", ids: ids_param, target: target)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def update_attachments(id:, file_ids:)
|
|
31
|
+
file_ids_param = Array(file_ids).join(",")
|
|
32
|
+
client.post("#{api_path}/update_attachments.json", id: id, fileIds: file_ids_param)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def list_vcf(**params)
|
|
36
|
+
client.get_raw("#{api_path}/list.vcf", params)
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cashctrl
|
|
4
|
+
module Resources
|
|
5
|
+
class Report
|
|
6
|
+
class Collection < Base
|
|
7
|
+
api_path "report/collection"
|
|
8
|
+
model_class Models::ReportCollection
|
|
9
|
+
|
|
10
|
+
class << self
|
|
11
|
+
def list
|
|
12
|
+
raise NotImplementedError, "Report::Collection does not support list"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def meta(id:)
|
|
16
|
+
client.get("#{api_path}/meta.json", id: id)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def download_pdf(id:, **params)
|
|
20
|
+
client.get_raw("#{api_path}/download.pdf", { id: id, **params })
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def download_csv(id:, **params)
|
|
24
|
+
client.get_raw("#{api_path}/download.csv", { id: id, **params })
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def download_xlsx(id:, **params)
|
|
28
|
+
client.get_raw("#{api_path}/download.xlsx", { id: id, **params })
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def download_annual_report(id:, **params)
|
|
32
|
+
client.get_raw("#{api_path}/download_annualreport.pdf", { id: id, **params })
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def reorder(ids:)
|
|
36
|
+
ids_param = Array(ids).join(",")
|
|
37
|
+
client.post("#{api_path}/reorder.json", ids: ids_param)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def list
|
|
42
|
+
raise NotImplementedError, "Report::Collection does not support list"
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def meta(id:)
|
|
46
|
+
client.get("#{api_path}/meta.json", id: id)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def download_pdf(id:, **params)
|
|
50
|
+
client.get_raw("#{api_path}/download.pdf", { id: id, **params })
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def download_csv(id:, **params)
|
|
54
|
+
client.get_raw("#{api_path}/download.csv", { id: id, **params })
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def download_xlsx(id:, **params)
|
|
58
|
+
client.get_raw("#{api_path}/download.xlsx", { id: id, **params })
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def download_annual_report(id:, **params)
|
|
62
|
+
client.get_raw("#{api_path}/download_annualreport.pdf", { id: id, **params })
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def reorder(ids:)
|
|
66
|
+
ids_param = Array(ids).join(",")
|
|
67
|
+
client.post("#{api_path}/reorder.json", ids: ids_param)
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cashctrl
|
|
4
|
+
module Resources
|
|
5
|
+
class Report
|
|
6
|
+
class Element < Base
|
|
7
|
+
api_path "report/element"
|
|
8
|
+
model_class Models::ReportElement
|
|
9
|
+
|
|
10
|
+
class << self
|
|
11
|
+
def list
|
|
12
|
+
raise NotImplementedError, "Report::Element does not support list"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def data(id:, **params)
|
|
16
|
+
client.get("#{api_path}/data.json", { id: id, **params })
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def data_html(id:, **params)
|
|
20
|
+
client.get_raw("#{api_path}/data.html", { id: id, **params })
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def meta(id:)
|
|
24
|
+
client.get("#{api_path}/meta.json", id: id)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def download_pdf(id:, **params)
|
|
28
|
+
client.get_raw("#{api_path}/download.pdf", { id: id, **params })
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def download_csv(id:, **params)
|
|
32
|
+
client.get_raw("#{api_path}/download.csv", { id: id, **params })
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def download_xlsx(id:, **params)
|
|
36
|
+
client.get_raw("#{api_path}/download.xlsx", { id: id, **params })
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def reorder(ids:)
|
|
40
|
+
ids_param = Array(ids).join(",")
|
|
41
|
+
client.post("#{api_path}/reorder.json", ids: ids_param)
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def list
|
|
46
|
+
raise NotImplementedError, "Report::Element does not support list"
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def data(id:, **params)
|
|
50
|
+
client.get("#{api_path}/data.json", { id: id, **params })
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def data_html(id:, **params)
|
|
54
|
+
client.get_raw("#{api_path}/data.html", { id: id, **params })
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def meta(id:)
|
|
58
|
+
client.get("#{api_path}/meta.json", id: id)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def download_pdf(id:, **params)
|
|
62
|
+
client.get_raw("#{api_path}/download.pdf", { id: id, **params })
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def download_csv(id:, **params)
|
|
66
|
+
client.get_raw("#{api_path}/download.csv", { id: id, **params })
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def download_xlsx(id:, **params)
|
|
70
|
+
client.get_raw("#{api_path}/download.xlsx", { id: id, **params })
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def reorder(ids:)
|
|
74
|
+
ids_param = Array(ids).join(",")
|
|
75
|
+
client.post("#{api_path}/reorder.json", ids: ids_param)
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cashctrl
|
|
4
|
+
module Resources
|
|
5
|
+
class Report < Base
|
|
6
|
+
api_path "report"
|
|
7
|
+
model_class Models::Report
|
|
8
|
+
|
|
9
|
+
class << self
|
|
10
|
+
def list
|
|
11
|
+
raise NotImplementedError, "Report does not support list, use tree instead"
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def read(id:)
|
|
15
|
+
raise NotImplementedError, "Report does not support read"
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def create(**params)
|
|
19
|
+
raise NotImplementedError, "Report does not support create"
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def update(id:, **params)
|
|
23
|
+
raise NotImplementedError, "Report does not support update"
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def delete(ids:)
|
|
27
|
+
raise NotImplementedError, "Report does not support delete"
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def tree
|
|
31
|
+
client.get("#{api_path}/tree.json")
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def list
|
|
36
|
+
raise NotImplementedError, "Report does not support list, use tree instead"
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def read(id:)
|
|
40
|
+
raise NotImplementedError, "Report does not support read"
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def create(**params)
|
|
44
|
+
raise NotImplementedError, "Report does not support create"
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def update(id:, **params)
|
|
48
|
+
raise NotImplementedError, "Report does not support update"
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def delete(ids:)
|
|
52
|
+
raise NotImplementedError, "Report does not support delete"
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def tree
|
|
56
|
+
client.get("#{api_path}/tree.json")
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cashctrl
|
|
4
|
+
module Resources
|
|
5
|
+
module Salary
|
|
6
|
+
class Category < Base
|
|
7
|
+
api_path "salary/category"
|
|
8
|
+
model_class Models::Category
|
|
9
|
+
|
|
10
|
+
class << self
|
|
11
|
+
def tree
|
|
12
|
+
client.get("#{api_path}/tree.json")
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def tree
|
|
17
|
+
client.get("#{api_path}/tree.json")
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cashctrl
|
|
4
|
+
module Resources
|
|
5
|
+
module Salary
|
|
6
|
+
class Certificate
|
|
7
|
+
class Document < Base
|
|
8
|
+
api_path "salary/certificate/document"
|
|
9
|
+
model_class Models::CertificateDocument
|
|
10
|
+
|
|
11
|
+
class << self
|
|
12
|
+
def list
|
|
13
|
+
raise NotImplementedError, "Salary::Certificate::Document does not support list"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def create(**params)
|
|
17
|
+
raise NotImplementedError, "Salary::Certificate::Document does not support create"
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def update(id:, **params)
|
|
21
|
+
raise NotImplementedError, "Salary::Certificate::Document does not support update"
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def delete(ids:)
|
|
25
|
+
raise NotImplementedError, "Salary::Certificate::Document does not support delete"
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def read_pdf(id:)
|
|
29
|
+
client.get_raw("#{api_path}/read.pdf", id: id)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def read_zip(id:)
|
|
33
|
+
client.get_raw("#{api_path}/read.zip", id: id)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def mail(id:, recipient_email:, **params)
|
|
37
|
+
client.post("#{api_path}/mail.json", { id: id, recipientEmail: recipient_email, **params })
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def list
|
|
42
|
+
raise NotImplementedError, "Salary::Certificate::Document does not support list"
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def create(**params)
|
|
46
|
+
raise NotImplementedError, "Salary::Certificate::Document does not support create"
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def update(id:, **params)
|
|
50
|
+
raise NotImplementedError, "Salary::Certificate::Document does not support update"
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def delete(ids:)
|
|
54
|
+
raise NotImplementedError, "Salary::Certificate::Document does not support delete"
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def read_pdf(id:)
|
|
58
|
+
client.get_raw("#{api_path}/read.pdf", id: id)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def read_zip(id:)
|
|
62
|
+
client.get_raw("#{api_path}/read.zip", id: id)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def mail(id:, recipient_email:, **params)
|
|
66
|
+
client.post("#{api_path}/mail.json", { id: id, recipientEmail: recipient_email, **params })
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cashctrl
|
|
4
|
+
module Resources
|
|
5
|
+
module Salary
|
|
6
|
+
class Certificate
|
|
7
|
+
class Template < Base
|
|
8
|
+
api_path "salary/certificate/template"
|
|
9
|
+
model_class Models::CertificateTemplate
|
|
10
|
+
|
|
11
|
+
class << self
|
|
12
|
+
def tree
|
|
13
|
+
client.get("#{api_path}/tree.json")
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def tree
|
|
18
|
+
client.get("#{api_path}/tree.json")
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|