activerecord-shipworks 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -10
- data/app/models/shipworks/amazon_order.rb +15 -0
- data/app/models/shipworks/amazon_order_item.rb +5 -0
- data/app/models/shipworks/order.rb +1 -0
- data/app/models/shipworks/order_item.rb +1 -0
- data/app/models/shipworks/store.rb +17 -0
- data/lib/shipworks/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a321ef833e2c013396c31e2828868169fbf46c2a52b0221f9784f06b8abe3c23
|
4
|
+
data.tar.gz: 2dd4b771c12188fffd8f9a5f4a85df24d16033069f1bfddfb53639ade9e6c16a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da58bfe0801de0a6083020454013304f53be8241329922cfe032567cb0f643ca0795d85d6d95c54bc7256020181635513ce012dbcb4d45ddaf7257bf65d6b082
|
7
|
+
data.tar.gz: 6f50663a4b1927938fc314401197a49e581a9f4f42196f89c1debfe79d42c2b577d7a598c45aa476845b569110178fe3868ad45cd893ca5859ce274de60328cf
|
data/README.md
CHANGED
@@ -35,16 +35,16 @@ Shipworks::Order.order(:OrderDate).last(10)
|
|
35
35
|
|
36
36
|
### ER Diagram
|
37
37
|
```
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
+---------------+
|
38
|
+
+---------+ +---------------+ +-------------------+
|
39
|
+
| | | | | |
|
40
|
+
| Store | | AmazonOrder | | AmazonOrderItem |
|
41
|
+
| | | | | |
|
42
|
+
+-------+-+ +-+-------------+ +---+---------------+
|
43
|
+
| | |
|
44
|
+
| | |
|
45
|
+
| | |
|
46
|
+
/|\ | |
|
47
|
+
+---------------+ +--+-----+--+ +---------+---+ +----------------------+
|
48
48
|
| |\ | | /| | /| |
|
49
49
|
| OrderCharge +---------+ Order +-------+ OrderItem +------+ OrderItemAttribute |
|
50
50
|
| |/ | | \| | \| |
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Shipworks
|
2
|
+
class AmazonOrder < ShipworksRecord
|
3
|
+
belongs_to :order, foreign_key: 'OrderID'
|
4
|
+
|
5
|
+
FULFILLMENT_CHANNEL_MAPPING = {
|
6
|
+
0 => 'Unavailable',
|
7
|
+
1 => 'Amazon',
|
8
|
+
2 => 'Merchant'
|
9
|
+
}
|
10
|
+
|
11
|
+
def FulfillmentChannelName
|
12
|
+
FULFILLMENT_CHANNEL_MAPPING[self.FulfillmentChannel] || FulfillmentChannel
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -1,5 +1,22 @@
|
|
1
1
|
module Shipworks
|
2
2
|
class Store < ShipworksRecord
|
3
3
|
has_many :orders, foreign_key: 'StoreID'
|
4
|
+
|
5
|
+
STORE_TYPE_MAPPING = {
|
6
|
+
1 => 'eBay',
|
7
|
+
10 => 'Amazon',
|
8
|
+
13 => 'Zen Cart',
|
9
|
+
31 => 'Generic - File',
|
10
|
+
34 => 'Newegg',
|
11
|
+
35 => 'Buy.com',
|
12
|
+
36 => 'Sears',
|
13
|
+
61 => 'Choxi',
|
14
|
+
75 => 'Walmart',
|
15
|
+
78 => 'GeekSeller'
|
16
|
+
}
|
17
|
+
|
18
|
+
def TypeName
|
19
|
+
STORE_TYPE_MAPPING[self.TypeCode] || self.TypeCode
|
20
|
+
end
|
4
21
|
end
|
5
22
|
end
|
data/lib/shipworks/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-shipworks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dennis Wu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord-sqlserver-adapter
|
@@ -34,6 +34,8 @@ files:
|
|
34
34
|
- MIT-LICENSE
|
35
35
|
- README.md
|
36
36
|
- Rakefile
|
37
|
+
- app/models/shipworks/amazon_order.rb
|
38
|
+
- app/models/shipworks/amazon_order_item.rb
|
37
39
|
- app/models/shipworks/note.rb
|
38
40
|
- app/models/shipworks/order.rb
|
39
41
|
- app/models/shipworks/order_charge.rb
|
@@ -69,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
71
|
version: '0'
|
70
72
|
requirements: []
|
71
73
|
rubyforge_project:
|
72
|
-
rubygems_version: 2.7.
|
74
|
+
rubygems_version: 2.7.6
|
73
75
|
signing_key:
|
74
76
|
specification_version: 4
|
75
77
|
summary: ActiveRecord for Shipworks.
|