mints 0.0.17 → 0.0.21
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 +2 -1
- data/lib/client.rb +96 -37
- data/lib/contact.rb +659 -94
- data/lib/generators/mints_files_generator.rb +6 -0
- data/lib/generators/mints_link.rb +61 -0
- data/lib/generators/short_link_controller.rb +41 -0
- data/lib/mints/controllers/admin_base_controller.rb +2 -2
- data/lib/mints/controllers/base_api_controller.rb +12 -11
- data/lib/mints/controllers/base_controller.rb +38 -9
- data/lib/mints_helper.rb +47 -0
- data/lib/pub.rb +258 -139
- data/lib/user/config/api_keys.rb +65 -0
- data/lib/user/config/appointments.rb +221 -0
- data/lib/user/config/attribute_groups.rb +77 -0
- data/lib/user/config/attributes.rb +86 -0
- data/lib/user/config/calendars.rb +89 -0
- data/lib/user/config/config.rb +65 -0
- data/lib/user/config/importers.rb +184 -0
- data/lib/user/config/public_folders.rb +108 -0
- data/lib/user/config/relationships.rb +138 -0
- data/lib/user/config/roles.rb +84 -0
- data/lib/user/config/seeds.rb +14 -0
- data/lib/user/config/system_settings.rb +53 -0
- data/lib/user/config/tags.rb +63 -0
- data/lib/user/config/taxonomies.rb +124 -0
- data/lib/user/config/teams.rb +70 -0
- data/lib/user/config/users.rb +76 -0
- data/lib/user/contacts/contacts.rb +21 -0
- data/lib/user/content/assets.rb +260 -0
- data/lib/user/content/content.rb +235 -0
- data/lib/user/content/content_instances.rb +147 -0
- data/lib/user/content/content_templates.rb +111 -0
- data/lib/user/content/conversations.rb +174 -0
- data/lib/user/content/dam.rb +88 -0
- data/lib/user/content/forms.rb +168 -0
- data/lib/user/content/message_templates.rb +162 -0
- data/lib/user/content/messages.rb +90 -0
- data/lib/user/content/pages.rb +81 -0
- data/lib/user/content/stories.rb +164 -0
- data/lib/user/content/story_templates.rb +95 -0
- data/lib/user/crm/companies.rb +111 -0
- data/lib/user/crm/contacts.rb +312 -0
- data/lib/user/crm/crm.rb +21 -0
- data/lib/user/crm/deals.rb +111 -0
- data/lib/user/crm/favorites.rb +17 -0
- data/lib/user/crm/segments.rb +132 -0
- data/lib/user/crm/users.rb +22 -0
- data/lib/user/crm/workflow_step_objects.rb +89 -0
- data/lib/user/crm/workflow_steps.rb +49 -0
- data/lib/user/crm/workflows.rb +70 -0
- data/lib/user/ecommerce/ecommerce.rb +29 -0
- data/lib/user/ecommerce/item_prices.rb +86 -0
- data/lib/user/ecommerce/locations.rb +166 -0
- data/lib/user/ecommerce/order_items_groups.rb +109 -0
- data/lib/user/ecommerce/order_statuses.rb +26 -0
- data/lib/user/ecommerce/orders.rb +258 -0
- data/lib/user/ecommerce/price_lists.rb +73 -0
- data/lib/user/ecommerce/product_templates.rb +104 -0
- data/lib/user/ecommerce/product_variations.rb +129 -0
- data/lib/user/ecommerce/products.rb +169 -0
- data/lib/user/ecommerce/skus.rb +88 -0
- data/lib/user/ecommerce/taxes.rb +82 -0
- data/lib/user/ecommerce/variant_options.rb +69 -0
- data/lib/user/ecommerce/variant_values.rb +72 -0
- data/lib/user/helpers/helpers.rb +113 -0
- data/lib/user/helpers/object_activities.rb +83 -0
- data/lib/user/helpers/object_folders.rb +82 -0
- data/lib/user/helpers/user_folders.rb +83 -0
- data/lib/user/marketing/marketing.rb +120 -0
- data/lib/user/profile/profile.rb +111 -0
- data/lib/user.rb +24 -368
- metadata +64 -2
@@ -0,0 +1,166 @@
|
|
1
|
+
module Locations
|
2
|
+
##
|
3
|
+
# == Locations
|
4
|
+
#
|
5
|
+
|
6
|
+
# === Get locations.
|
7
|
+
# Get a collection of locations.
|
8
|
+
#
|
9
|
+
# ==== Parameters
|
10
|
+
# use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
|
11
|
+
#
|
12
|
+
# ==== First Example
|
13
|
+
# @data = @mints_user.get_locations
|
14
|
+
#
|
15
|
+
# ==== Second Example
|
16
|
+
# @data = @mints_user.get_locations(false)
|
17
|
+
def get_locations(use_post = true)
|
18
|
+
return get_query_results("/ecommerce/locations", nil, use_post)
|
19
|
+
end
|
20
|
+
|
21
|
+
# === Get location.
|
22
|
+
# Get a location info.
|
23
|
+
#
|
24
|
+
# ==== Parameters
|
25
|
+
# id:: (Integer) -- Location id.
|
26
|
+
#
|
27
|
+
# ==== Example
|
28
|
+
# @data = @mints_user.get_location(2)
|
29
|
+
def get_location(id)
|
30
|
+
return @client.raw("get", "/ecommerce/locations/#{id}")
|
31
|
+
end
|
32
|
+
|
33
|
+
# === Create location.
|
34
|
+
# Create a location with data.
|
35
|
+
#
|
36
|
+
# ==== Parameters
|
37
|
+
# data:: (Hash) -- Data to be submited.
|
38
|
+
#
|
39
|
+
# ==== Example
|
40
|
+
# data = {
|
41
|
+
# "title": "New Location",
|
42
|
+
# "location_template_id": 1
|
43
|
+
# }
|
44
|
+
# @data = @mints_user.create_location(data)
|
45
|
+
def create_location(data)
|
46
|
+
return @client.raw("post", "/ecommerce/locations", nil, data_transform(data))
|
47
|
+
end
|
48
|
+
|
49
|
+
# === Update location.
|
50
|
+
# Update a location info.
|
51
|
+
#
|
52
|
+
# ==== Parameters
|
53
|
+
# id:: (Integer) -- Location id.
|
54
|
+
# data:: (Hash) -- Data to be submited.
|
55
|
+
#
|
56
|
+
# ==== Example
|
57
|
+
# data = {
|
58
|
+
# "title": "New Location Modified"
|
59
|
+
# }
|
60
|
+
# @data = @mints_user.update_location(5, data.to_json)
|
61
|
+
def update_location(id, data)
|
62
|
+
return @client.raw("put", "/ecommerce/locations/#{id}", nil, data)
|
63
|
+
end
|
64
|
+
|
65
|
+
# === Delete location.
|
66
|
+
# Delete a location.
|
67
|
+
#
|
68
|
+
# ==== Parameters
|
69
|
+
# id:: (Integer) -- Location id.
|
70
|
+
#
|
71
|
+
# ==== Example
|
72
|
+
# @data = @mints_user.delete_location(5)
|
73
|
+
def delete_location(id)
|
74
|
+
return @client.raw("delete", "/ecommerce/locations/#{id}")
|
75
|
+
end
|
76
|
+
|
77
|
+
##
|
78
|
+
# == Locations Templates
|
79
|
+
#
|
80
|
+
|
81
|
+
# === Get location template support data.
|
82
|
+
# Get support data used in a location template.
|
83
|
+
#
|
84
|
+
# ==== Parameters
|
85
|
+
# id:: (Integer) -- Location template id.
|
86
|
+
#
|
87
|
+
# ==== Example
|
88
|
+
# @data = @mints_user.get_location_template_support_data(1)
|
89
|
+
def get_location_template_support_data(id)
|
90
|
+
return @client.raw("get", "/ecommerce/location-templates/#{id}/support-data")
|
91
|
+
end
|
92
|
+
|
93
|
+
# === Get location templates support data.
|
94
|
+
# Get support data used in location templates.
|
95
|
+
#
|
96
|
+
# ==== Example
|
97
|
+
# @data = @mints_user.get_location_templates_support_data
|
98
|
+
def get_location_templates_support_data
|
99
|
+
return @client.raw("get", "/ecommerce/location-templates/support-data")
|
100
|
+
end
|
101
|
+
|
102
|
+
# === Get location templates.
|
103
|
+
# Get a collection of location templates.
|
104
|
+
#
|
105
|
+
# ==== Parameters
|
106
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
107
|
+
#
|
108
|
+
# ==== First Example
|
109
|
+
# @data = @mints_user.get_location_templates
|
110
|
+
#
|
111
|
+
# ==== Second Example
|
112
|
+
# options = { "fields": "title" }
|
113
|
+
# @data = @mints_user.get_location_templates(options)
|
114
|
+
def get_location_templates(options = nil)
|
115
|
+
return @client.raw("get", "/ecommerce/location-templates", options)
|
116
|
+
end
|
117
|
+
|
118
|
+
# === Get location template.
|
119
|
+
# Get a location template info.
|
120
|
+
#
|
121
|
+
# ==== Parameters
|
122
|
+
# id:: (Integer) -- Location template id.
|
123
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
124
|
+
#
|
125
|
+
# ==== First Example
|
126
|
+
# @data = @mints_user.get_location_template(1)
|
127
|
+
#
|
128
|
+
# ==== Second Example
|
129
|
+
# options = { "fields": "title" }
|
130
|
+
# @data = @mints_user.get_location_template(1, options)
|
131
|
+
def get_location_template(id, options = nil)
|
132
|
+
return @client.raw("get", "/ecommerce/location-templates/#{id}", options)
|
133
|
+
end
|
134
|
+
|
135
|
+
# === Create location template.
|
136
|
+
# Create a location template with data.
|
137
|
+
#
|
138
|
+
# ==== Parameters
|
139
|
+
# data:: (Hash) -- Data to be submited.
|
140
|
+
#
|
141
|
+
# ==== Example
|
142
|
+
# data = {
|
143
|
+
# "title": "New Location Template",
|
144
|
+
# "slug": "new-location-template"
|
145
|
+
# }
|
146
|
+
# @data = @mints_user.create_location_template(data)
|
147
|
+
def create_location_template(data)
|
148
|
+
return @client.raw("post", "/ecommerce/location-templates", nil, data_transform(data))
|
149
|
+
end
|
150
|
+
|
151
|
+
# === Update location template.
|
152
|
+
# Update a location template info.
|
153
|
+
#
|
154
|
+
# ==== Parameters
|
155
|
+
# id:: (Integer) -- Location template id.
|
156
|
+
# data:: (Hash) -- Data to be submited.
|
157
|
+
#
|
158
|
+
# ==== Example
|
159
|
+
# data = {
|
160
|
+
# "title": "New Location Template Modified"
|
161
|
+
# }
|
162
|
+
# @data = @mints_user.update_location_template(3, data)
|
163
|
+
def update_location_template(id, data)
|
164
|
+
return @client.raw("put", "/ecommerce/location-templates/#{id}", nil, data_transform(data))
|
165
|
+
end
|
166
|
+
end
|
@@ -0,0 +1,109 @@
|
|
1
|
+
module OrderItemsGroups
|
2
|
+
##
|
3
|
+
# == Order Items Groups
|
4
|
+
#
|
5
|
+
|
6
|
+
# === Get pending order template from order item group.
|
7
|
+
# Get a pending order template from an order item group.
|
8
|
+
#
|
9
|
+
# ==== Parameters
|
10
|
+
# parentOrderId:: (Integer) -- Order items group id.
|
11
|
+
# orderTemplateId:: (Integer) -- Order template id.
|
12
|
+
#
|
13
|
+
# ==== Example
|
14
|
+
# @data = @mints_user.get_pending_order_template_from_order_item_group(1, 1)
|
15
|
+
def get_pending_order_template_from_order_item_group(parentOrderId, orderTemplateId)
|
16
|
+
return @client.raw("get", "/ecommerce/order-items-groups/#{parentOrderId}/pending-items/order-template/#{orderTemplateId}")
|
17
|
+
end
|
18
|
+
|
19
|
+
# === Get order item group support data by order id.
|
20
|
+
# Get support data of an order item group by an order id.
|
21
|
+
#
|
22
|
+
# ==== Parameters
|
23
|
+
# orderId:: (Integer) -- Order id.
|
24
|
+
#
|
25
|
+
# ==== Example
|
26
|
+
# @data = @mints_user.get_order_item_group_support_data_by_order_id(1)
|
27
|
+
def get_order_item_group_support_data_by_order_id(orderId) #FIXME: Return in OrderItemsGroupController.getTemplateSupportDataByOrderId method doesnt create data variable.
|
28
|
+
return @client.raw("get", "/ecommerce/order-items-groups/support-data/#{orderId}")
|
29
|
+
end
|
30
|
+
|
31
|
+
# === Get order item groups.
|
32
|
+
# Get a collection of order item groups.
|
33
|
+
#
|
34
|
+
# ==== Parameters
|
35
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
36
|
+
#
|
37
|
+
# ==== First Example
|
38
|
+
# @data = @mints_user.get_order_item_groups
|
39
|
+
#
|
40
|
+
# ==== Second Example
|
41
|
+
# options = { "fields": "name" }
|
42
|
+
# @data = @mints_user.get_order_item_groups(options)
|
43
|
+
def get_order_item_groups(options = nil)
|
44
|
+
return @client.raw("get", "/ecommerce/order-items-groups", options)
|
45
|
+
end
|
46
|
+
|
47
|
+
# === Get order item group.
|
48
|
+
# Get a order item group info.
|
49
|
+
#
|
50
|
+
# ==== Parameters
|
51
|
+
# id:: (Integer) -- Order item group id.
|
52
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
53
|
+
#
|
54
|
+
# ==== First Example
|
55
|
+
# @data = @mints_user.get_order_item_group(1)
|
56
|
+
#
|
57
|
+
# ==== Second Example
|
58
|
+
# options = { "fields": "name" }
|
59
|
+
# @data = @mints_user.get_order_item_group(1, options)
|
60
|
+
def get_order_item_group(id, options = nil)
|
61
|
+
return @client.raw("get", "/ecommerce/order-items-groups/#{id}", options)
|
62
|
+
end
|
63
|
+
|
64
|
+
# === Create order item group.
|
65
|
+
# Create a order item group with data.
|
66
|
+
#
|
67
|
+
# ==== Parameters
|
68
|
+
# data:: (Hash) -- Data to be submited.
|
69
|
+
#
|
70
|
+
# ==== Example
|
71
|
+
# data = {
|
72
|
+
# "name": "New Order Item Group",
|
73
|
+
# "order_id": 1,
|
74
|
+
# "quantity": 1,
|
75
|
+
# "sale_price": 200
|
76
|
+
# }
|
77
|
+
# @data = @mints_user.create_order_item_group(data)
|
78
|
+
def create_order_item_group(data)
|
79
|
+
return @client.raw("post", "/ecommerce/order-items-groups", nil, data_transform(data))
|
80
|
+
end
|
81
|
+
|
82
|
+
# === Update order item group.
|
83
|
+
# Update a order item group info.
|
84
|
+
#
|
85
|
+
# ==== Parameters
|
86
|
+
# id:: (Integer) -- Order item group id.
|
87
|
+
# data:: (Hash) -- Data to be submited.
|
88
|
+
#
|
89
|
+
# ==== Example
|
90
|
+
# data = {
|
91
|
+
# "name": "New Order Item Group Modified"
|
92
|
+
# }
|
93
|
+
# @data = @mints_user.update_order_item_group(147, data)
|
94
|
+
def update_order_item_group(id, data)
|
95
|
+
return @client.raw("put", "/ecommerce/order-items-groups/#{id}", nil, data_transform(data))
|
96
|
+
end
|
97
|
+
|
98
|
+
# === Delete order item group.
|
99
|
+
# Delete a order item group.
|
100
|
+
#
|
101
|
+
# ==== Parameters
|
102
|
+
# id:: (Integer) -- Order item group id.
|
103
|
+
#
|
104
|
+
# ==== Example
|
105
|
+
# @data = @mints_user.delete_order_item_group(147)
|
106
|
+
def delete_order_item_group(id)
|
107
|
+
return @client.raw("delete", "/ecommerce/order-items-groups/#{id}")
|
108
|
+
end
|
109
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module OrderStatuses
|
2
|
+
##
|
3
|
+
# == Order Statuses
|
4
|
+
#
|
5
|
+
|
6
|
+
# === Get order statuses.
|
7
|
+
# Get order statuses.
|
8
|
+
#
|
9
|
+
# ==== First Example
|
10
|
+
# @data = @mints_user.get_order_statuses
|
11
|
+
def get_order_statuses
|
12
|
+
return @client.raw("get", "/ecommerce/order-statuses")
|
13
|
+
end
|
14
|
+
|
15
|
+
# === Get order status.
|
16
|
+
# Get status of an order.
|
17
|
+
#
|
18
|
+
# ==== Parameters
|
19
|
+
# id:: (Integer) -- Order id.
|
20
|
+
#
|
21
|
+
# ==== First Example
|
22
|
+
# @data = @mints_user.get_order_status(1)
|
23
|
+
def get_order_status(id)
|
24
|
+
return @client.raw("get", "/ecommerce/order-statuses/#{id}")
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,258 @@
|
|
1
|
+
module Orders
|
2
|
+
##
|
3
|
+
# == Orders
|
4
|
+
#
|
5
|
+
|
6
|
+
# === Duplicate order.
|
7
|
+
# Duplicate an order.
|
8
|
+
#
|
9
|
+
# ==== Parameters
|
10
|
+
# orderId:: (Integer) -- Order id.
|
11
|
+
# data:: (Hash) -- Data to be submited.
|
12
|
+
#
|
13
|
+
def duplicate_order(orderId, data) #FIXME: Doesnt read options from data and sale_price_cents column doesnt have to be null
|
14
|
+
return @client.raw("post", "/ecommerce/orders/duplicate/#{orderId}", nil, data)
|
15
|
+
end
|
16
|
+
|
17
|
+
# === Delete orders.
|
18
|
+
# Delete orders.
|
19
|
+
#
|
20
|
+
# ==== Parameters
|
21
|
+
# data:: (Hash) -- Data to be submited.
|
22
|
+
#
|
23
|
+
# ==== Example
|
24
|
+
# data = {
|
25
|
+
# "ids": [ 18 ]
|
26
|
+
# }
|
27
|
+
# @data = @mints_user.delete_orders(data)
|
28
|
+
def delete_orders(data) #TODO: Inform method should return another response like 'success'
|
29
|
+
return @client.raw("delete", "/ecommerce/orders/delete", nil, data_transform(data))
|
30
|
+
end
|
31
|
+
|
32
|
+
# === Get orders support data.
|
33
|
+
# Get support data used in orders.
|
34
|
+
#
|
35
|
+
# ==== Example
|
36
|
+
# @data = @mints_user.get_orders_support_data
|
37
|
+
def get_orders_support_data
|
38
|
+
return @client.raw("get", "/ecommerce/orders/support-data")
|
39
|
+
end
|
40
|
+
|
41
|
+
# === Get orders.
|
42
|
+
# Get a collection of orders.
|
43
|
+
#
|
44
|
+
# ==== Parameters
|
45
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
46
|
+
# use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
|
47
|
+
#
|
48
|
+
# ==== First Example
|
49
|
+
# @data = @mints_user.get_orders
|
50
|
+
#
|
51
|
+
# ==== Second Example
|
52
|
+
# options = { "fields": "id, title" }
|
53
|
+
# @data = @mints_user.get_orders(options)
|
54
|
+
#
|
55
|
+
# ==== Third Example
|
56
|
+
# options = { "fields": "id, title" }
|
57
|
+
# @data = @mints_user.get_orders(options, false)
|
58
|
+
def get_orders(options = nil, use_post = true)
|
59
|
+
return get_query_results("/ecommerce/orders", options, use_post)
|
60
|
+
end
|
61
|
+
|
62
|
+
# === Get order.
|
63
|
+
# Get a order info.
|
64
|
+
#
|
65
|
+
# ==== Parameters
|
66
|
+
# id:: (Integer) -- Order id.
|
67
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
68
|
+
#
|
69
|
+
# ==== First Example
|
70
|
+
# @data = @mints_user.get_order(1)
|
71
|
+
#
|
72
|
+
# ==== Second Example
|
73
|
+
# options = { "fields": "title" }
|
74
|
+
# @data = @mints_user.get_order(1, options)
|
75
|
+
def get_order(id, options = nil)
|
76
|
+
return @client.raw("get", "/ecommerce/orders/#{id}", options)
|
77
|
+
end
|
78
|
+
|
79
|
+
# === Create order.
|
80
|
+
# Create a order with data.
|
81
|
+
#
|
82
|
+
# ==== Parameters
|
83
|
+
# data:: (Hash) -- Data to be submited.
|
84
|
+
#
|
85
|
+
# ==== Example
|
86
|
+
# data = {
|
87
|
+
# "title": "New Order",
|
88
|
+
# "order_template_id": 2
|
89
|
+
# }
|
90
|
+
# @data = @mints_user.create_order(data)
|
91
|
+
def create_order(data)
|
92
|
+
return @client.raw("post", "/ecommerce/orders", nil, data_transform(data))
|
93
|
+
end
|
94
|
+
|
95
|
+
# === Update order.
|
96
|
+
# Update a order info.
|
97
|
+
#
|
98
|
+
# ==== Parameters
|
99
|
+
# id:: (Integer) -- Order id.
|
100
|
+
# data:: (Hash) -- Data to be submited.
|
101
|
+
#
|
102
|
+
# ==== Example
|
103
|
+
# data = {
|
104
|
+
# "title": "New Order Modified"
|
105
|
+
# }
|
106
|
+
# @data = @mints_user.update_order(26, data)
|
107
|
+
def update_order(id, data)
|
108
|
+
return @client.raw("put", "/ecommerce/orders/#{id}", nil, data_transform(data))
|
109
|
+
end
|
110
|
+
|
111
|
+
##
|
112
|
+
# == Order Templates
|
113
|
+
#
|
114
|
+
|
115
|
+
# === Get order template support data.
|
116
|
+
# Get support data from a order template.
|
117
|
+
#
|
118
|
+
# ==== Parameters
|
119
|
+
# id:: (Integer) -- Order template id.
|
120
|
+
#
|
121
|
+
# ==== Example
|
122
|
+
# @data = @mints_user.get_order_template_support_data(1)
|
123
|
+
def get_order_template_support_data(id)
|
124
|
+
return @client.raw("get", "/ecommerce/order-templates/support-data/#{id}")
|
125
|
+
end
|
126
|
+
|
127
|
+
# === Get order templates.
|
128
|
+
# Get a collection of order templates.
|
129
|
+
#
|
130
|
+
# ==== Parameters
|
131
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
132
|
+
#
|
133
|
+
# ==== First Example
|
134
|
+
# @data = @mints_user.get_order_templates
|
135
|
+
#
|
136
|
+
# ==== Second Example
|
137
|
+
# options = { "fields": "title" }
|
138
|
+
# @data = @mints_user.get_order_templates(options)
|
139
|
+
def get_order_templates(options = nil)
|
140
|
+
return @client.raw("get", "/ecommerce/order-templates", options)
|
141
|
+
end
|
142
|
+
|
143
|
+
# === Get order template.
|
144
|
+
# Get a order template info.
|
145
|
+
#
|
146
|
+
# ==== Parameters
|
147
|
+
# id:: (Integer) -- Order template id.
|
148
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
149
|
+
#
|
150
|
+
# ==== First Example
|
151
|
+
# @data = @mints_user.get_order_template(1)
|
152
|
+
#
|
153
|
+
# ==== Second Example
|
154
|
+
# options = { "fields": "title" }
|
155
|
+
# @data = @mints_user.get_order_template(1, options)
|
156
|
+
def get_order_template(id, options = nil)
|
157
|
+
return @client.raw("get", "/ecommerce/order-templates/#{id}", options)
|
158
|
+
end
|
159
|
+
|
160
|
+
# === Update order template.
|
161
|
+
# Update a order template info.
|
162
|
+
#
|
163
|
+
# ==== Parameters
|
164
|
+
# id:: (Integer) -- Order template id.
|
165
|
+
# data:: (Hash) -- Data to be submited.
|
166
|
+
#
|
167
|
+
# ==== Example
|
168
|
+
# data = {
|
169
|
+
# "title": "Inventory Increase"
|
170
|
+
# }
|
171
|
+
# @data = @mints_user.update_order_template(12, data)
|
172
|
+
def update_order_template(id, data)
|
173
|
+
return @client.raw("put", "/ecommerce/order-templates/#{id}", nil, data_transform(data))
|
174
|
+
end
|
175
|
+
|
176
|
+
##
|
177
|
+
# == Order Items
|
178
|
+
#
|
179
|
+
|
180
|
+
# === Get order items support data.
|
181
|
+
# Get support data used in order items.
|
182
|
+
#
|
183
|
+
# ==== Example
|
184
|
+
# @data = @mints_user.get_order_items_support_data
|
185
|
+
def get_order_items_support_data
|
186
|
+
return @client.raw("get", "/ecommerce/order-items/support-data")
|
187
|
+
end
|
188
|
+
|
189
|
+
#TODO: The following two methods receive objects instead integer variable. Research use and test it.
|
190
|
+
# === Detach order item from order item group.
|
191
|
+
# Detach an order item from an order item group.
|
192
|
+
#
|
193
|
+
# ==== Parameters
|
194
|
+
# orderItemId:: (Integer) -- Order item id.
|
195
|
+
# groupId:: (Integer) -- Order items group id.
|
196
|
+
#
|
197
|
+
def detach_order_item_from_order_item_group(orderItemId, groupId) #TODO: Research use
|
198
|
+
return @client.raw("put", "/ecommerce/order-items/detach/#{orderItemId}/order-items-groups/#{groupId}")
|
199
|
+
end
|
200
|
+
|
201
|
+
# === Update order item from order item group.
|
202
|
+
# Update an order item data from an order item group.
|
203
|
+
#
|
204
|
+
# ==== Parameters
|
205
|
+
# orderItemId:: (Integer) -- Order item id.
|
206
|
+
# groupId:: (Integer) -- Order items group id.
|
207
|
+
#
|
208
|
+
def update_order_item_from_order_item_group(orderItemId, groupId, data) #TODO: Research use
|
209
|
+
return @client.raw("put", "/ecommerce/order-items/update/#{orderItemId}/order-items-groups/#{groupId}", nil, data_transform(data))
|
210
|
+
end
|
211
|
+
|
212
|
+
# === Get order items.
|
213
|
+
# Get a collection of order items.
|
214
|
+
#
|
215
|
+
# ==== Parameters
|
216
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
217
|
+
#
|
218
|
+
# ==== First Example
|
219
|
+
# @data = @mints_user.get_order_items
|
220
|
+
#
|
221
|
+
# ==== Second Example
|
222
|
+
# options = { "fields": "id" }
|
223
|
+
# @data = @mints_user.get_order_items(options)
|
224
|
+
def get_order_items(options = nil) #FIXME: CaliRouter POST method not supported.
|
225
|
+
return @client.raw("get", "/ecommerce/order-items", options)
|
226
|
+
end
|
227
|
+
|
228
|
+
# === Get order item.
|
229
|
+
# Get a order item info.
|
230
|
+
#
|
231
|
+
# ==== Parameters
|
232
|
+
# id:: (Integer) -- Order item id.
|
233
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
234
|
+
#
|
235
|
+
# ==== First Example
|
236
|
+
# @data = @mints_user.get_order_item(1)
|
237
|
+
#
|
238
|
+
# ==== Second Example
|
239
|
+
# options = { "fields": "id" }
|
240
|
+
# @data = @mints_user.get_order_item(1, options)
|
241
|
+
def get_order_item(id, options = nil)
|
242
|
+
return @client.raw("get", "/ecommerce/order-items/#{id}", options)
|
243
|
+
end
|
244
|
+
|
245
|
+
# === Update order item.
|
246
|
+
# Update a order item info.
|
247
|
+
#
|
248
|
+
# ==== Parameters
|
249
|
+
# id:: (Integer) -- Order item id.
|
250
|
+
# data:: (Hash) -- Data to be submited.
|
251
|
+
#
|
252
|
+
# ==== Example
|
253
|
+
# data = { "title": "No title in order items" }
|
254
|
+
# @data = @mints_user.update_order_item(1, data)
|
255
|
+
def update_order_item(id, data) #TODO: Research what can update
|
256
|
+
return @client.raw("put", "/ecommerce/order-items/#{id}", nil, data_transform(data))
|
257
|
+
end
|
258
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
module PriceList
|
2
|
+
##
|
3
|
+
# == Price List
|
4
|
+
#
|
5
|
+
|
6
|
+
# === Get price lists.
|
7
|
+
# Get a collection of price lists.
|
8
|
+
#
|
9
|
+
# ==== Parameters
|
10
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
11
|
+
#
|
12
|
+
# ==== First Example
|
13
|
+
# @data = @mints_user.get_price_lists
|
14
|
+
#
|
15
|
+
# ==== Second Example
|
16
|
+
# options = {
|
17
|
+
# "fields": "title"
|
18
|
+
# }
|
19
|
+
# @data = @mints_user.get_price_lists(options)
|
20
|
+
def get_price_lists(options = nil)
|
21
|
+
return get_query_results("/ecommerce/price-list", options)
|
22
|
+
end
|
23
|
+
|
24
|
+
# === Get price list.
|
25
|
+
# Get a price list info.
|
26
|
+
#
|
27
|
+
# ==== Parameters
|
28
|
+
# id:: (Integer) -- Price list id.
|
29
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
30
|
+
#
|
31
|
+
# ==== First Example
|
32
|
+
# @data = @mints_user.get_price_list(1)
|
33
|
+
#
|
34
|
+
# ==== Second Example
|
35
|
+
# options = {
|
36
|
+
# "fields": "title"
|
37
|
+
# }
|
38
|
+
# @data = @mints_user.get_price_list(1, options)
|
39
|
+
def get_price_list(id, options = nil)
|
40
|
+
return @client.raw("get", "/ecommerce/price-list/#{id}", options)
|
41
|
+
end
|
42
|
+
|
43
|
+
# === Create price list.
|
44
|
+
# Create a price list with data.
|
45
|
+
#
|
46
|
+
# ==== Parameters
|
47
|
+
# data:: (Hash) -- Data to be submited.
|
48
|
+
#
|
49
|
+
# ==== Example
|
50
|
+
# data = {
|
51
|
+
# "title": "New Price List"
|
52
|
+
# }
|
53
|
+
# @data = @mints_user.create_price_list(data)
|
54
|
+
def create_price_list(data)
|
55
|
+
return @client.raw("post", "/ecommerce/price-list", nil, data_transform(data))
|
56
|
+
end
|
57
|
+
|
58
|
+
# === Update price list.
|
59
|
+
# Update a price list info.
|
60
|
+
#
|
61
|
+
# ==== Parameters
|
62
|
+
# id:: (Integer) -- Price list id.
|
63
|
+
# data:: (Hash) -- Data to be submited.
|
64
|
+
#
|
65
|
+
# ==== Example
|
66
|
+
# data = {
|
67
|
+
# "title": "New Price List Modified"
|
68
|
+
# }
|
69
|
+
# @data = @mints_user.update_price_list(8, data)
|
70
|
+
def update_price_list(id, data)
|
71
|
+
return @client.raw("put", "/ecommerce/price-list/#{id}", nil, data_transform(data))
|
72
|
+
end
|
73
|
+
end
|