tiny_builder 0.1.6 → 0.1.7
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/lib/models/mongo_variant_listing.rb +1 -1
- data/lib/tiny_builder/allocation.rb +10 -0
- data/lib/tiny_builder/data_loader.rb +2 -2
- data/lib/tiny_builder/price_builder.rb +4 -3
- data/lib/tiny_builder/quantity_counter.rb +2 -0
- data/lib/tiny_builder/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e20c10255db94b0cf6230a515694e43f4610ac3831fc74156fe35569cc08eeec
|
4
|
+
data.tar.gz: 4488169a21ca18332eb190ff34bf359a2b1fd1790567574235133d8bda486262
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e96b6ee2cf58f9a104298d30ab1d96881a8d559029daff97a766cf7e91268848759f32b8274a28a42f62624b772b998a0148e66950dbccdff8b05d5ffca6c270
|
7
|
+
data.tar.gz: 3311798b4728533192c05f00670f8d02eefae4c4b380370a9002a4e969663496e6fea0a323c8939bda8922ac6e682ee0286ec447abfbf62ca76f828bb2a88631
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Allocation
|
4
|
+
include Mongoid::Document
|
5
|
+
include Mongoid::Attributes::Dynamic
|
6
|
+
|
7
|
+
store_in collection: 'warehouse_space_allocations', client: 'inventory'
|
8
|
+
|
9
|
+
belongs_to :warehouse_space, class_name: 'MongoWarehouseSpace'
|
10
|
+
end
|
@@ -45,7 +45,7 @@ class TinyBuilder
|
|
45
45
|
|
46
46
|
def collect_associated_listings
|
47
47
|
data = []
|
48
|
-
MongoVariantListing.in(master_variant_id: variant_ids).each do |listing|
|
48
|
+
MongoVariantListing.in(master_variant_id: variant_ids).where(:local_id.exists => true).each do |listing|
|
49
49
|
begin
|
50
50
|
listing.icava_id
|
51
51
|
data << listing
|
@@ -83,7 +83,7 @@ class TinyBuilder
|
|
83
83
|
]
|
84
84
|
end.to_h
|
85
85
|
end
|
86
|
-
|
86
|
+
|
87
87
|
def get_mongo_wh_spaces
|
88
88
|
spaces = []
|
89
89
|
MongoWarehouseSpace.in(item_variant_id: variant_ids).where(:warehouse_id.exists => true).each do |ws|
|
@@ -22,11 +22,12 @@ class TinyBuilder
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def warehouse_prices(listing)
|
25
|
-
|
25
|
+
multi_warehouse_spaces(listing).map do |wh_space|
|
26
26
|
{
|
27
|
-
|
27
|
+
id: wh_space&.warehouse_id,
|
28
|
+
warehouse_id: mapped_wh_mappings[wh_space.warehouse_id]
|
28
29
|
}.merge(price_hash(listing))
|
29
|
-
|
30
|
+
end
|
30
31
|
end
|
31
32
|
|
32
33
|
def sale_price(listing)
|
data/lib/tiny_builder/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tiny_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hayakaza
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -137,6 +137,7 @@ files:
|
|
137
137
|
- lib/tiny_builder.rb
|
138
138
|
- lib/tiny_builder/active_builder.rb
|
139
139
|
- lib/tiny_builder/allocated_stock.rb
|
140
|
+
- lib/tiny_builder/allocation.rb
|
140
141
|
- lib/tiny_builder/apigateway_helper.rb
|
141
142
|
- lib/tiny_builder/base_builder.rb
|
142
143
|
- lib/tiny_builder/data_loader.rb
|