ish_models 0.0.33.63 → 0.0.33.64
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/co_tailors/order.rb +12 -0
- data/lib/co_tailors/order_item.rb +9 -6
- data/lib/co_tailors/pant.rb +4 -0
- data/lib/co_tailors/profile_measurement.rb +8 -8
- data/lib/co_tailors/shirt.rb +4 -0
- data/lib/co_tailors/suit.rb +4 -0
- data/lib/ish/lead.rb +3 -3
- data/lib/ish_models/user_profile.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f1d96797ec6ad7709537223d88645bdc4518d17
|
4
|
+
data.tar.gz: 64798fa03ed516e21802138b44cd1fcc8d855ed9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95f0c33727628d17dfec77fab6270f0fd69e72769aad7f7500c3654b798a5b2146cb07893e75665113e1e099ec7f2e71fcb16c9e2ddde76ba3ffffbdcd364c4b
|
7
|
+
data.tar.gz: bfdc57e6bf7961883634d964c160d8be05e75b53aef2ee668e7502322d6c8c07b79178f8efc3e81f807a5c0d4d3adf705f9779bea9d0ce39aab87381711f280b
|
data/lib/co_tailors/order.rb
CHANGED
@@ -10,5 +10,17 @@ class CoTailors::Order
|
|
10
10
|
|
11
11
|
field :submitted_at, :type => Time
|
12
12
|
|
13
|
+
MEASUREMENT_PARAMS = [ :neck_around, :chest_around, :waist_around, :sleeve_length, :shoulder_width, :shirt_length, :bicep_around ]
|
14
|
+
|
15
|
+
def grand_total
|
16
|
+
tax = 0.05
|
17
|
+
shipping = 0 # 1200
|
18
|
+
|
19
|
+
subtotal = items.all.map { |i| i.cost }.reduce( :+ )
|
20
|
+
subtotal = subtotal * (tax + 1)
|
21
|
+
subtotal += shipping
|
22
|
+
return subtotal.to_i
|
23
|
+
end
|
24
|
+
|
13
25
|
end
|
14
26
|
|
@@ -5,15 +5,15 @@ class CoTailors::OrderItem
|
|
5
5
|
|
6
6
|
belongs_to :order, :class_name => 'CoTailors::Order'
|
7
7
|
|
8
|
-
KIND_SHIRT =
|
9
|
-
KIND_PANTS =
|
10
|
-
KIND_SUIT
|
11
|
-
KINDS
|
12
|
-
field :kind, :type =>
|
8
|
+
KIND_SHIRT = 'const-kind-shirt'
|
9
|
+
KIND_PANTS = 'const-kind-pants'
|
10
|
+
KIND_SUIT = 'const-kind-suits'
|
11
|
+
KINDS = %w{ const-kind-shirt const-kind-pants const-kind-suits }
|
12
|
+
field :kind, :type => String
|
13
13
|
validates :kind, :presence => true
|
14
14
|
|
15
15
|
FABRICS = [ :white, :black, :light_blue, :dark_blue, :dark_green, :pink, :gray ]
|
16
|
-
field :fabric, :type =>
|
16
|
+
field :fabric, :type => String
|
17
17
|
validates :fabric, :presence => true
|
18
18
|
|
19
19
|
has_one :measurement, :class_name => 'CoTailors::ProfileMeasurement'
|
@@ -22,5 +22,8 @@ class CoTailors::OrderItem
|
|
22
22
|
field :quantity, :type => Integer
|
23
23
|
validates :quantity, :presence => true
|
24
24
|
|
25
|
+
field :cost, :type => Integer # pennies!
|
26
|
+
validates :cost, :presence => true
|
27
|
+
|
25
28
|
end
|
26
29
|
|
data/lib/co_tailors/pant.rb
CHANGED
@@ -12,14 +12,14 @@ class CoTailors::ProfileMeasurement
|
|
12
12
|
belongs_to :order_item, :class_name => 'CoTailors::OrderItem', :optional => true
|
13
13
|
|
14
14
|
## shirt
|
15
|
-
field :neck_around, :type => Float
|
16
|
-
field :chest_around, :type => Float
|
17
|
-
field :waist_around, :type => Float
|
18
|
-
field :sleeve_length, :type => Float
|
19
|
-
field :shoulder_width, :type => Float
|
20
|
-
field :shirt_length, :type => Float
|
21
|
-
field :bicep_around, :type => Float
|
22
|
-
field :wrist_around, :type => Float
|
15
|
+
field :neck_around, :type => Float, :default => 0
|
16
|
+
field :chest_around, :type => Float, :default => 0
|
17
|
+
field :waist_around, :type => Float, :default => 0
|
18
|
+
field :sleeve_length, :type => Float, :default => 0
|
19
|
+
field :shoulder_width, :type => Float, :default => 0
|
20
|
+
field :shirt_length, :type => Float, :default => 0
|
21
|
+
field :bicep_around, :type => Float, :default => 0
|
22
|
+
field :wrist_around, :type => Float, :default => 0 # Is this optional? I want less here
|
23
23
|
## pants
|
24
24
|
# length
|
25
25
|
# waist
|
data/lib/co_tailors/shirt.rb
CHANGED
data/lib/co_tailors/suit.rb
CHANGED
data/lib/ish/lead.rb
CHANGED
@@ -25,15 +25,15 @@ class Ish::Lead
|
|
25
25
|
|
26
26
|
field :description
|
27
27
|
|
28
|
-
STATES =
|
29
|
-
field :state, :type =>
|
28
|
+
STATES = %w( considering applied )
|
29
|
+
field :state, :type => String
|
30
30
|
|
31
31
|
field :is_done, :type => Boolean, :default => false
|
32
32
|
field :is_trash, :type => Boolean, :default => false
|
33
33
|
|
34
34
|
field :applied_on, :type => Time
|
35
35
|
|
36
|
-
field :tag # 'hired_com_ror', not enumerated for now _vp_ 20180103
|
36
|
+
field :tag, :type => String # 'hired_com_ror', not enumerated for now _vp_ 20180103
|
37
37
|
field :location
|
38
38
|
|
39
39
|
field :raw_phone, :type => String
|
@@ -66,7 +66,7 @@ class IshModels::UserProfile
|
|
66
66
|
end
|
67
67
|
|
68
68
|
# colombia tailors
|
69
|
-
|
69
|
+
has_one :measurement, :class_name => '::CoTailors::ProfileMeasurement'
|
70
70
|
has_many :addresses, :class_name => '::CoTailors::Address'
|
71
71
|
has_many :orders, :class_name => '::CoTailors::Order'
|
72
72
|
|