order2cb 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/order2cb/order.rb +8 -0
- data/lib/order2cb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e2c5038c4f0f9ee2cc0f5c8a97a99c1d41800d2
|
4
|
+
data.tar.gz: 1affe00b1ec5ece28a35433fd60550e0e4d13782
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dae875b8bcdd8febfd4a7e3c54fdf2965ed170664cd64f9ecde65bf67cd64ea7d724bb40ccd70b696ab0d7d132e99dc377acbead818545f100222f54327e63e7
|
7
|
+
data.tar.gz: a13f50736bd1b88a7b76e2c668a2743825ea4b005dd4cffc64306491a01d937be9710353ef438f844cc3a0e42dc09205a6e82bcbe5d2891f1668d3b3ec29939e
|
data/lib/order2cb/order.rb
CHANGED
@@ -71,6 +71,10 @@ module Order2cb
|
|
71
71
|
'tyre_shopper_risk_assessment' => @data['risk_score'],
|
72
72
|
'tyre_shopper_risk_assessment_notes' => @data['risk_score_reasons'],
|
73
73
|
'order_source' => 'TyreShopper',
|
74
|
+
'is_van_tyre' => short_codes.include?("VN"),
|
75
|
+
'is_winter_tyre' => short_codes.include?("WN"),
|
76
|
+
'is_4x4_tyre' => short_codes.include?("4X"),
|
77
|
+
'is_run_flat_tyre' => short_codes.include?("RF"),
|
74
78
|
# set time to + 5 hours
|
75
79
|
'fitting_date' => @data['fitting_date'] + 5.hours,
|
76
80
|
'am_pm' => @data['fitting_day_part'],
|
@@ -79,6 +83,10 @@ module Order2cb
|
|
79
83
|
}
|
80
84
|
end
|
81
85
|
|
86
|
+
def short_codes
|
87
|
+
@data["short_code"].to_s.upcase.split("-")
|
88
|
+
end
|
89
|
+
|
82
90
|
def fitting_centre
|
83
91
|
channel_fields = $db_client.query("SELECT exp_channel_fields.* FROM exp_channel_fields JOIN exp_channels on exp_channels.channel_id = exp_channel_fields.group_id WHERE exp_channels.channel_name = 'branches'")
|
84
92
|
data_field_id = $db_client.query("SELECT exp_channel_fields.field_id FROM exp_channel_fields JOIN exp_channels on exp_channels.channel_id = exp_channel_fields.group_id WHERE exp_channels.channel_name = 'branches' and exp_channel_fields.field_name = 'dataflex_id'").first["field_id"]
|
data/lib/order2cb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: order2cb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- EmergeAdapt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|