dear_inventory 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dear_inventory.rb +10 -0
- data/lib/dear_inventory/model.rb +3 -8
- data/lib/dear_inventory/models/bill_of_materials_product.rb +41 -0
- data/lib/dear_inventory/models/bill_of_materials_service.rb +33 -0
- data/lib/dear_inventory/models/product.rb +295 -0
- data/lib/dear_inventory/models/products.rb +26 -0
- data/lib/dear_inventory/models/products/movement.rb +65 -0
- data/lib/dear_inventory/models/reorder_level.rb +37 -0
- data/lib/dear_inventory/models/supplier.rb +49 -0
- data/lib/dear_inventory/parameters/product/index.rb +75 -0
- data/lib/dear_inventory/resources/product.rb +24 -0
- data/lib/dear_inventory/version.rb +1 -1
- metadata +10 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e7b894db20c76cbb175167334ce5abaa5c019fceae1389bb27bdf3fbf1a0d6e
|
4
|
+
data.tar.gz: 9bb10673c10deda7b5e7a10267c88b5a7486f0c7727fa96ef1b84e0b32280edc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e39397309918ad91208cdb5d8973deb3e4f32d281fa902e652e9870e9c2081addea6fa9bec3721056585252c01428560c6df721d4e7a710f8cce13871103018d
|
7
|
+
data.tar.gz: 3e744705693565470431673b54b4aff46db15fc1779e7fbeeaacb98511b4c1e19ddad11f8dc06d78c2e0aa30b4e4fcf31a1d16b22933359c4f0dce057bea9a14
|
data/lib/dear_inventory.rb
CHANGED
@@ -21,7 +21,10 @@ require "dear_inventory/model"
|
|
21
21
|
require "dear_inventory/models/additional_attributes"
|
22
22
|
require "dear_inventory/models/address"
|
23
23
|
require "dear_inventory/models/attachment"
|
24
|
+
require "dear_inventory/models/bill_of_materials_product"
|
25
|
+
require "dear_inventory/models/bill_of_materials_service"
|
24
26
|
require "dear_inventory/models/inventory_movement"
|
27
|
+
require "dear_inventory/models/products/movement"
|
25
28
|
require "dear_inventory/models/purchase_list"
|
26
29
|
require "dear_inventory/models/purchase_lists"
|
27
30
|
require "dear_inventory/models/purchases/additional_charge"
|
@@ -34,6 +37,7 @@ require "dear_inventory/models/purchases/manual_journal"
|
|
34
37
|
require "dear_inventory/models/purchases/stock_line"
|
35
38
|
require "dear_inventory/models/purchases/stock"
|
36
39
|
require "dear_inventory/models/purchases/unstock_line"
|
40
|
+
require "dear_inventory/models/reorder_level"
|
37
41
|
require "dear_inventory/models/sale_list"
|
38
42
|
require "dear_inventory/models/sales/additional_charge"
|
39
43
|
require "dear_inventory/models/sales/invoice_additional_charge"
|
@@ -45,6 +49,7 @@ require "dear_inventory/models/sales/order"
|
|
45
49
|
require "dear_inventory/models/sales/payment_line"
|
46
50
|
require "dear_inventory/models/sales/quote"
|
47
51
|
require "dear_inventory/models/shipping_address"
|
52
|
+
require "dear_inventory/models/supplier"
|
48
53
|
require "dear_inventory/models/transaction"
|
49
54
|
require "dear_inventory/models/sales/fulfilments/pick_pack_line"
|
50
55
|
require "dear_inventory/models/sales/fulfilments/pick_pack"
|
@@ -52,6 +57,9 @@ require "dear_inventory/models/sales/fulfilments/ship_line"
|
|
52
57
|
require "dear_inventory/models/sales/fulfilments/ship"
|
53
58
|
require "dear_inventory/models/sales/fulfilment"
|
54
59
|
require "dear_inventory/models/sale_lists"
|
60
|
+
|
61
|
+
require "dear_inventory/models/product"
|
62
|
+
require "dear_inventory/models/products"
|
55
63
|
require "dear_inventory/models/purchases/credit_note"
|
56
64
|
require "dear_inventory/models/purchases/invoice"
|
57
65
|
require "dear_inventory/models/purchases/order"
|
@@ -71,12 +79,14 @@ require "dear_inventory/validators/string"
|
|
71
79
|
require "dear_inventory/validators/time"
|
72
80
|
|
73
81
|
require "dear_inventory/parameters"
|
82
|
+
require "dear_inventory/parameters/product/index"
|
74
83
|
require "dear_inventory/parameters/purchase/index"
|
75
84
|
require "dear_inventory/parameters/purchase_list/index"
|
76
85
|
require "dear_inventory/parameters/sale/index"
|
77
86
|
require "dear_inventory/parameters/sale_list/index"
|
78
87
|
|
79
88
|
require "dear_inventory/resource"
|
89
|
+
require "dear_inventory/resources/product"
|
80
90
|
require "dear_inventory/resources/purchase"
|
81
91
|
require "dear_inventory/resources/purchase_list"
|
82
92
|
require "dear_inventory/resources/sale"
|
data/lib/dear_inventory/model.rb
CHANGED
@@ -63,14 +63,7 @@ module DearInventory
|
|
63
63
|
T::Hash[T.any(String, Symbol), T.untyped],
|
64
64
|
specifications:
|
65
65
|
T::Hash[Symbol, T.any(Symbol, T.class_of(DearInventory::Model))]
|
66
|
-
).returns(
|
67
|
-
T.nilable(
|
68
|
-
T.any(
|
69
|
-
Date, DateTime, String, Numeric, T::Boolean,
|
70
|
-
DearInventory::Model, T::Array[DearInventory::Model]
|
71
|
-
)
|
72
|
-
)
|
73
|
-
)
|
66
|
+
).returns(T.untyped)
|
74
67
|
end
|
75
68
|
def field_value(response_name, values, specifications)
|
76
69
|
model = T.cast(
|
@@ -80,6 +73,8 @@ module DearInventory
|
|
80
73
|
value = values[response_name.to_s]
|
81
74
|
|
82
75
|
case specifications[:type]
|
76
|
+
when :BigDecimal
|
77
|
+
value.to_d
|
83
78
|
when :Date
|
84
79
|
::Date.parse(value) unless value.nil?
|
85
80
|
when :DateTime
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# typed: strong
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module DearInventory
|
5
|
+
module Models
|
6
|
+
class BillOfMaterialsProduct < DearInventory::Model
|
7
|
+
extend T::Sig
|
8
|
+
|
9
|
+
fields(
|
10
|
+
ComponentProductID: {
|
11
|
+
name: :component_product_id,
|
12
|
+
type: :Guid,
|
13
|
+
},
|
14
|
+
ProductCode: {
|
15
|
+
name: :product_code,
|
16
|
+
type: :String,
|
17
|
+
},
|
18
|
+
Name: {
|
19
|
+
name: :name,
|
20
|
+
type: :String,
|
21
|
+
},
|
22
|
+
Quantity: {
|
23
|
+
name: :quantity,
|
24
|
+
type: :Float,
|
25
|
+
},
|
26
|
+
WastagePercent: {
|
27
|
+
name: :wastage_percent,
|
28
|
+
type: :Float,
|
29
|
+
},
|
30
|
+
WastageQuantity: {
|
31
|
+
name: :wastage_quantity,
|
32
|
+
type: :Float,
|
33
|
+
},
|
34
|
+
CostPercentage: {
|
35
|
+
name: :cost_percentage,
|
36
|
+
type: :Float,
|
37
|
+
}
|
38
|
+
)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# typed: strong
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module DearInventory
|
5
|
+
module Models
|
6
|
+
class BillOfMaterialsService < DearInventory::Model
|
7
|
+
extend T::Sig
|
8
|
+
|
9
|
+
fields(
|
10
|
+
ComponentProductID: {
|
11
|
+
name: :component_product_id,
|
12
|
+
type: :Guid,
|
13
|
+
},
|
14
|
+
Name: {
|
15
|
+
name: :name,
|
16
|
+
type: :String,
|
17
|
+
},
|
18
|
+
Quantity: {
|
19
|
+
name: :quantity,
|
20
|
+
type: :Float,
|
21
|
+
},
|
22
|
+
ExpenseAccount: {
|
23
|
+
name: :expense_account,
|
24
|
+
type: :String,
|
25
|
+
},
|
26
|
+
PriceTier: {
|
27
|
+
name: :price_tier,
|
28
|
+
type: :Integer,
|
29
|
+
}
|
30
|
+
)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,295 @@
|
|
1
|
+
# typed: strong
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module DearInventory
|
5
|
+
module Models
|
6
|
+
class Product < DearInventory::Model
|
7
|
+
extend T::Sig
|
8
|
+
|
9
|
+
fields(
|
10
|
+
ID: {
|
11
|
+
name: :id,
|
12
|
+
type: :Guid,
|
13
|
+
},
|
14
|
+
SKU: {
|
15
|
+
name: :sku,
|
16
|
+
type: :String,
|
17
|
+
},
|
18
|
+
Name: {
|
19
|
+
name: :name,
|
20
|
+
type: :String,
|
21
|
+
},
|
22
|
+
Category: {
|
23
|
+
name: :category,
|
24
|
+
type: :String,
|
25
|
+
},
|
26
|
+
Brand: {
|
27
|
+
name: :brand,
|
28
|
+
type: :String,
|
29
|
+
},
|
30
|
+
Type: {
|
31
|
+
name: :type,
|
32
|
+
type: :String,
|
33
|
+
},
|
34
|
+
CostingMethod: {
|
35
|
+
name: :costing_method,
|
36
|
+
type: :String,
|
37
|
+
},
|
38
|
+
DropShipMode: {
|
39
|
+
name: :drop_ship_mode,
|
40
|
+
type: :String,
|
41
|
+
},
|
42
|
+
DefaultLocation: {
|
43
|
+
name: :default_location,
|
44
|
+
type: :String,
|
45
|
+
},
|
46
|
+
Length: {
|
47
|
+
name: :length,
|
48
|
+
type: :Float,
|
49
|
+
},
|
50
|
+
Width: {
|
51
|
+
name: :width,
|
52
|
+
type: :Float,
|
53
|
+
},
|
54
|
+
Height: {
|
55
|
+
name: :height,
|
56
|
+
type: :Float,
|
57
|
+
},
|
58
|
+
Weight: {
|
59
|
+
name: :weight,
|
60
|
+
type: :Float,
|
61
|
+
},
|
62
|
+
UOM: {
|
63
|
+
name: :uom,
|
64
|
+
type: :String,
|
65
|
+
},
|
66
|
+
WeightUnits: {
|
67
|
+
name: :weight_units,
|
68
|
+
type: :String,
|
69
|
+
},
|
70
|
+
DimensionsUnits: {
|
71
|
+
name: :dimensions_units,
|
72
|
+
type: :String,
|
73
|
+
},
|
74
|
+
Barcode: {
|
75
|
+
name: :barcode,
|
76
|
+
type: :String,
|
77
|
+
},
|
78
|
+
MinimumBeforeReorder: {
|
79
|
+
name: :minimum_before_reorder,
|
80
|
+
type: :Float,
|
81
|
+
},
|
82
|
+
ReorderQuantity: {
|
83
|
+
name: :reorder_quantity,
|
84
|
+
type: :Float,
|
85
|
+
},
|
86
|
+
PriceTier1: {
|
87
|
+
name: :price_tier_1,
|
88
|
+
type: :BigDecimal,
|
89
|
+
},
|
90
|
+
PriceTier2: {
|
91
|
+
name: :price_tier_2,
|
92
|
+
type: :BigDecimal,
|
93
|
+
},
|
94
|
+
PriceTier3: {
|
95
|
+
name: :price_tier_3,
|
96
|
+
type: :BigDecimal,
|
97
|
+
},
|
98
|
+
PriceTier4: {
|
99
|
+
name: :price_tier_4,
|
100
|
+
type: :BigDecimal,
|
101
|
+
},
|
102
|
+
PriceTier5: {
|
103
|
+
name: :price_tier_5,
|
104
|
+
type: :BigDecimal,
|
105
|
+
},
|
106
|
+
PriceTier6: {
|
107
|
+
name: :price_tier_6,
|
108
|
+
type: :BigDecimal,
|
109
|
+
},
|
110
|
+
PriceTier7: {
|
111
|
+
name: :price_tier_7,
|
112
|
+
type: :BigDecimal,
|
113
|
+
},
|
114
|
+
PriceTier8: {
|
115
|
+
name: :price_tier_8,
|
116
|
+
type: :BigDecimal,
|
117
|
+
},
|
118
|
+
PriceTier9: {
|
119
|
+
name: :price_tier_9,
|
120
|
+
type: :BigDecimal,
|
121
|
+
},
|
122
|
+
PriceTier10: {
|
123
|
+
name: :price_tier_10,
|
124
|
+
type: :BigDecimal,
|
125
|
+
},
|
126
|
+
PriceTiers: {
|
127
|
+
name: :price_tiers,
|
128
|
+
type: :Untyped
|
129
|
+
},
|
130
|
+
AverageCost: {
|
131
|
+
name: :average_cost,
|
132
|
+
type: :BigDecimal,
|
133
|
+
},
|
134
|
+
ShortDescription: {
|
135
|
+
name: :short_description,
|
136
|
+
type: :String,
|
137
|
+
},
|
138
|
+
Description: {
|
139
|
+
name: :description,
|
140
|
+
type: :String,
|
141
|
+
},
|
142
|
+
AdditionalAttribute1: {
|
143
|
+
name: :additional_attribute_1,
|
144
|
+
type: :String,
|
145
|
+
},
|
146
|
+
AdditionalAttribute2: {
|
147
|
+
name: :additional_attribute_2,
|
148
|
+
type: :String,
|
149
|
+
},
|
150
|
+
AdditionalAttribute3: {
|
151
|
+
name: :additional_attribute_3,
|
152
|
+
type: :String,
|
153
|
+
},
|
154
|
+
AdditionalAttribute4: {
|
155
|
+
name: :additional_attribute_4,
|
156
|
+
type: :String,
|
157
|
+
},
|
158
|
+
AdditionalAttribute5: {
|
159
|
+
name: :additional_attribute_5,
|
160
|
+
type: :String,
|
161
|
+
},
|
162
|
+
AdditionalAttribute6: {
|
163
|
+
name: :additional_attribute_6,
|
164
|
+
type: :String,
|
165
|
+
},
|
166
|
+
AdditionalAttribute7: {
|
167
|
+
name: :additional_attribute_7,
|
168
|
+
type: :String,
|
169
|
+
},
|
170
|
+
AdditionalAttribute8: {
|
171
|
+
name: :additional_attribute_8,
|
172
|
+
type: :String,
|
173
|
+
},
|
174
|
+
AdditionalAttribute9: {
|
175
|
+
name: :additional_attribute_9,
|
176
|
+
type: :String,
|
177
|
+
},
|
178
|
+
AdditionalAttribute10: {
|
179
|
+
name: :additional_attribute_10,
|
180
|
+
type: :String,
|
181
|
+
},
|
182
|
+
AttributeSet: {
|
183
|
+
name: :attribute_set,
|
184
|
+
type: :String,
|
185
|
+
},
|
186
|
+
DiscountRule: {
|
187
|
+
name: :discount_rule,
|
188
|
+
type: :String,
|
189
|
+
},
|
190
|
+
Tags: {
|
191
|
+
name: :tags,
|
192
|
+
type: :String,
|
193
|
+
},
|
194
|
+
Status: {
|
195
|
+
name: :status,
|
196
|
+
type: :String,
|
197
|
+
},
|
198
|
+
StockLocator: {
|
199
|
+
name: :stock_locator,
|
200
|
+
type: :String,
|
201
|
+
},
|
202
|
+
COGSAccount: {
|
203
|
+
name: :cogs_account,
|
204
|
+
type: :String,
|
205
|
+
},
|
206
|
+
RevenueAccount: {
|
207
|
+
name: :revenue_account,
|
208
|
+
type: :String,
|
209
|
+
},
|
210
|
+
ExpenseAccount: {
|
211
|
+
name: :expense_account,
|
212
|
+
type: :String,
|
213
|
+
},
|
214
|
+
InventoryAccount: {
|
215
|
+
name: :inventory_account,
|
216
|
+
type: :String,
|
217
|
+
},
|
218
|
+
PurchaseTaxRule: {
|
219
|
+
name: :purchase_tax_rule,
|
220
|
+
type: :String,
|
221
|
+
},
|
222
|
+
SaleTaxRule: {
|
223
|
+
name: :sale_tax_rule,
|
224
|
+
type: :String,
|
225
|
+
},
|
226
|
+
LastModifiedOn: {
|
227
|
+
name: :last_modified_on,
|
228
|
+
type: :DateTime,
|
229
|
+
},
|
230
|
+
Sellable: {
|
231
|
+
name: :sellable,
|
232
|
+
type: :Boolean,
|
233
|
+
},
|
234
|
+
PickZones: {
|
235
|
+
name: :pick_zones,
|
236
|
+
type: :String,
|
237
|
+
},
|
238
|
+
BillOfMaterial: {
|
239
|
+
name: :bill_of_material,
|
240
|
+
type: :Boolean,
|
241
|
+
},
|
242
|
+
AutoAssembly: {
|
243
|
+
name: :auto_assembly,
|
244
|
+
type: :Boolean,
|
245
|
+
},
|
246
|
+
AutoDisassembly: {
|
247
|
+
name: :auto_disassembly,
|
248
|
+
type: :Boolean,
|
249
|
+
},
|
250
|
+
QuantityToProduce: {
|
251
|
+
name: :quantity_to_produce,
|
252
|
+
type: :Float,
|
253
|
+
},
|
254
|
+
AssemblyInstructionURL: {
|
255
|
+
name: :assembly_instruction_url,
|
256
|
+
type: :String,
|
257
|
+
},
|
258
|
+
AssemblyCostEstimationMethod: {
|
259
|
+
name: :assembly_cost_estimation_method,
|
260
|
+
type: :String,
|
261
|
+
},
|
262
|
+
Suppliers: {
|
263
|
+
name: :suppliers,
|
264
|
+
type: :Array,
|
265
|
+
model: DearInventory::Models::Supplier,
|
266
|
+
},
|
267
|
+
ReorderLevels: {
|
268
|
+
name: :reorder_levels,
|
269
|
+
type: :Array,
|
270
|
+
model: DearInventory::Models::ReorderLevel,
|
271
|
+
},
|
272
|
+
BillOfMaterialsProducts: {
|
273
|
+
name: :bill_of_materials_products,
|
274
|
+
type: :Array,
|
275
|
+
model: DearInventory::Models::BillOfMaterialsProduct,
|
276
|
+
},
|
277
|
+
BillOfMaterialsServices: {
|
278
|
+
name: :bill_of_materials_services,
|
279
|
+
type: :Array,
|
280
|
+
model: DearInventory::Models::BillOfMaterialsService,
|
281
|
+
},
|
282
|
+
Movements: {
|
283
|
+
name: :movements,
|
284
|
+
type: :Array,
|
285
|
+
model: DearInventory::Models::Products::Movement,
|
286
|
+
},
|
287
|
+
Attachments: {
|
288
|
+
name: :attachments,
|
289
|
+
type: :Array,
|
290
|
+
model: DearInventory::Models::Attachment,
|
291
|
+
}
|
292
|
+
)
|
293
|
+
end
|
294
|
+
end
|
295
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# typed: strong
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module DearInventory
|
5
|
+
module Models
|
6
|
+
class Products < DearInventory::Model
|
7
|
+
extend T::Sig
|
8
|
+
|
9
|
+
fields(
|
10
|
+
Total: {
|
11
|
+
name: :total,
|
12
|
+
type: :Integer,
|
13
|
+
},
|
14
|
+
Page: {
|
15
|
+
name: :page,
|
16
|
+
type: :Integer,
|
17
|
+
},
|
18
|
+
Products: {
|
19
|
+
name: :products,
|
20
|
+
type: :Array,
|
21
|
+
model: DearInventory::Models::Product,
|
22
|
+
}
|
23
|
+
)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# typed: strong
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
# This model has been designed to match the Dear API documentation, however,
|
5
|
+
# some of the field types don't make sense. Unfortunately, when trying to check
|
6
|
+
# what is being sent by the API, it turns out Dear is responding with an empty
|
7
|
+
# array even in situations where a movement exists for a product. The model will
|
8
|
+
# remain here incase the API is ever fixed but it will need to be reviewed in
|
9
|
+
# that case
|
10
|
+
module DearInventory
|
11
|
+
module Models
|
12
|
+
class Products < DearInventory::Model
|
13
|
+
class Movement < DearInventory::Model
|
14
|
+
extend T::Sig
|
15
|
+
|
16
|
+
fields(
|
17
|
+
TaskID: {
|
18
|
+
name: :task_id,
|
19
|
+
type: :Guid,
|
20
|
+
},
|
21
|
+
Type: {
|
22
|
+
name: :type,
|
23
|
+
type: :String,
|
24
|
+
},
|
25
|
+
Date: {
|
26
|
+
name: :date,
|
27
|
+
type: :DateTime,
|
28
|
+
},
|
29
|
+
Number: {
|
30
|
+
name: :number,
|
31
|
+
type: :String,
|
32
|
+
},
|
33
|
+
Status: {
|
34
|
+
name: :status,
|
35
|
+
type: :Integer,
|
36
|
+
},
|
37
|
+
Quantity: {
|
38
|
+
name: :quantity,
|
39
|
+
type: :Float,
|
40
|
+
},
|
41
|
+
Amount: {
|
42
|
+
name: :amount,
|
43
|
+
type: :BigDecimal,
|
44
|
+
},
|
45
|
+
Location: {
|
46
|
+
name: :location,
|
47
|
+
type: :Float,
|
48
|
+
},
|
49
|
+
BatchSN: {
|
50
|
+
name: :batch_sn,
|
51
|
+
type: :Float,
|
52
|
+
},
|
53
|
+
ExpiryDate: {
|
54
|
+
name: :expiry_date,
|
55
|
+
type: :DateTime,
|
56
|
+
},
|
57
|
+
FromTo: {
|
58
|
+
name: :from_to,
|
59
|
+
type: :String,
|
60
|
+
}
|
61
|
+
)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# typed: strong
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module DearInventory
|
5
|
+
module Models
|
6
|
+
class ReorderLevel < DearInventory::Model
|
7
|
+
extend T::Sig
|
8
|
+
|
9
|
+
fields(
|
10
|
+
LocationID: {
|
11
|
+
name: :location_id,
|
12
|
+
type: :Guid,
|
13
|
+
},
|
14
|
+
LocationName: {
|
15
|
+
name: :location_name,
|
16
|
+
type: :String,
|
17
|
+
},
|
18
|
+
MinimumBeforeReorder: {
|
19
|
+
name: :minimum_before_reorder,
|
20
|
+
type: :Float,
|
21
|
+
},
|
22
|
+
ReorderQuantity: {
|
23
|
+
name: :reorder_quantity,
|
24
|
+
type: :Float,
|
25
|
+
},
|
26
|
+
StockLocator: {
|
27
|
+
name: :stock_locator,
|
28
|
+
type: :String,
|
29
|
+
},
|
30
|
+
PickZones: {
|
31
|
+
name: :pick_zones,
|
32
|
+
type: :String,
|
33
|
+
}
|
34
|
+
)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# typed: strong
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module DearInventory
|
5
|
+
module Models
|
6
|
+
class Supplier < DearInventory::Model
|
7
|
+
extend T::Sig
|
8
|
+
|
9
|
+
fields(
|
10
|
+
SupplierID: {
|
11
|
+
name: :supplier_id,
|
12
|
+
type: :Guid,
|
13
|
+
},
|
14
|
+
SupplierName: {
|
15
|
+
name: :supplier_name,
|
16
|
+
type: :String,
|
17
|
+
},
|
18
|
+
SupplierInventoryCode: {
|
19
|
+
name: :supplier_inventory_code,
|
20
|
+
type: :String,
|
21
|
+
},
|
22
|
+
SupplierProductName: {
|
23
|
+
name: :supplier_product_name,
|
24
|
+
type: :String,
|
25
|
+
},
|
26
|
+
Cost: {
|
27
|
+
name: :cost,
|
28
|
+
type: :BigDecimal,
|
29
|
+
},
|
30
|
+
FixedCost: {
|
31
|
+
name: :fixed_cost,
|
32
|
+
type: :BigDecimal,
|
33
|
+
},
|
34
|
+
Currency: {
|
35
|
+
name: :currency,
|
36
|
+
type: :String,
|
37
|
+
},
|
38
|
+
DropShip: {
|
39
|
+
name: :drop_ship,
|
40
|
+
type: :Boolean,
|
41
|
+
},
|
42
|
+
URL: {
|
43
|
+
name: :url,
|
44
|
+
type: :String,
|
45
|
+
}
|
46
|
+
)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# typed: strict
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module DearInventory
|
5
|
+
class Parameters
|
6
|
+
module Product
|
7
|
+
class Index < DearInventory::Parameters
|
8
|
+
extend T::Sig
|
9
|
+
|
10
|
+
fields(
|
11
|
+
id: {
|
12
|
+
property: :ID,
|
13
|
+
type: :String,
|
14
|
+
required: false,
|
15
|
+
},
|
16
|
+
page: {
|
17
|
+
property: :Page,
|
18
|
+
type: :Integer,
|
19
|
+
required: false,
|
20
|
+
},
|
21
|
+
limit: {
|
22
|
+
property: :Limit,
|
23
|
+
type: :Integer,
|
24
|
+
required: false,
|
25
|
+
},
|
26
|
+
name: {
|
27
|
+
property: :Name,
|
28
|
+
type: :String,
|
29
|
+
required: false,
|
30
|
+
},
|
31
|
+
sku: {
|
32
|
+
property: :Sku,
|
33
|
+
type: :String,
|
34
|
+
required: false,
|
35
|
+
},
|
36
|
+
modified_since: {
|
37
|
+
property: :ModifiedSince,
|
38
|
+
type: :DateTime,
|
39
|
+
required: false,
|
40
|
+
},
|
41
|
+
include_deprecated: {
|
42
|
+
property: :IncludeDeprecated,
|
43
|
+
type: :Boolean,
|
44
|
+
required: false,
|
45
|
+
},
|
46
|
+
include_bom: {
|
47
|
+
property: :IncludeBOM,
|
48
|
+
type: :Boolean,
|
49
|
+
required: false,
|
50
|
+
},
|
51
|
+
include_suppliers: {
|
52
|
+
property: :IncludeSuppliers,
|
53
|
+
type: :Boolean,
|
54
|
+
required: false,
|
55
|
+
},
|
56
|
+
include_movements: {
|
57
|
+
property: :IncludeMovements,
|
58
|
+
type: :Boolean,
|
59
|
+
required: false,
|
60
|
+
},
|
61
|
+
include_attachments: {
|
62
|
+
property: :IncludeAttachments,
|
63
|
+
type: :Boolean,
|
64
|
+
required: false,
|
65
|
+
},
|
66
|
+
include_reorder_levels: {
|
67
|
+
property: :IncludeReorderLevels,
|
68
|
+
type: :Boolean,
|
69
|
+
required: false,
|
70
|
+
}
|
71
|
+
)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# typed: strict
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module DearInventory
|
5
|
+
class Product < Resource
|
6
|
+
class << self
|
7
|
+
extend T::Sig
|
8
|
+
|
9
|
+
# Product
|
10
|
+
#
|
11
|
+
# @param params [Hash] URL query string parameters that conform to
|
12
|
+
# DearInventory::Parameters::Product::Index
|
13
|
+
sig do
|
14
|
+
params(params: T::Hash[Symbol, T.untyped]).
|
15
|
+
returns(DearInventory::Response)
|
16
|
+
end
|
17
|
+
def index(params = {})
|
18
|
+
new.request(
|
19
|
+
:get, params: params, model: DearInventory::Models::Products
|
20
|
+
)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dear_inventory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Rice
|
@@ -233,7 +233,12 @@ files:
|
|
233
233
|
- lib/dear_inventory/models/additional_attributes.rb
|
234
234
|
- lib/dear_inventory/models/address.rb
|
235
235
|
- lib/dear_inventory/models/attachment.rb
|
236
|
+
- lib/dear_inventory/models/bill_of_materials_product.rb
|
237
|
+
- lib/dear_inventory/models/bill_of_materials_service.rb
|
236
238
|
- lib/dear_inventory/models/inventory_movement.rb
|
239
|
+
- lib/dear_inventory/models/product.rb
|
240
|
+
- lib/dear_inventory/models/products.rb
|
241
|
+
- lib/dear_inventory/models/products/movement.rb
|
237
242
|
- lib/dear_inventory/models/purchase.rb
|
238
243
|
- lib/dear_inventory/models/purchase_list.rb
|
239
244
|
- lib/dear_inventory/models/purchase_lists.rb
|
@@ -250,6 +255,7 @@ files:
|
|
250
255
|
- lib/dear_inventory/models/purchases/stock.rb
|
251
256
|
- lib/dear_inventory/models/purchases/stock_line.rb
|
252
257
|
- lib/dear_inventory/models/purchases/unstock_line.rb
|
258
|
+
- lib/dear_inventory/models/reorder_level.rb
|
253
259
|
- lib/dear_inventory/models/request.rb
|
254
260
|
- lib/dear_inventory/models/sale.rb
|
255
261
|
- lib/dear_inventory/models/sale_list.rb
|
@@ -271,13 +277,16 @@ files:
|
|
271
277
|
- lib/dear_inventory/models/sales/payment_line.rb
|
272
278
|
- lib/dear_inventory/models/sales/quote.rb
|
273
279
|
- lib/dear_inventory/models/shipping_address.rb
|
280
|
+
- lib/dear_inventory/models/supplier.rb
|
274
281
|
- lib/dear_inventory/models/transaction.rb
|
275
282
|
- lib/dear_inventory/parameters.rb
|
283
|
+
- lib/dear_inventory/parameters/product/index.rb
|
276
284
|
- lib/dear_inventory/parameters/purchase/index.rb
|
277
285
|
- lib/dear_inventory/parameters/purchase_list/index.rb
|
278
286
|
- lib/dear_inventory/parameters/sale/index.rb
|
279
287
|
- lib/dear_inventory/parameters/sale_list/index.rb
|
280
288
|
- lib/dear_inventory/resource.rb
|
289
|
+
- lib/dear_inventory/resources/product.rb
|
281
290
|
- lib/dear_inventory/resources/purchase.rb
|
282
291
|
- lib/dear_inventory/resources/purchase_list.rb
|
283
292
|
- lib/dear_inventory/resources/sale.rb
|