unidom-shipment 0.6.2 → 0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 347ea304d226d488dc4c245530ac07ba4a552b24
4
- data.tar.gz: 5378250e4a5421f432256e975e822ef50717c235
3
+ metadata.gz: 5c8cf38478b54a15a0ab39c5cf37efe4cf6192fe
4
+ data.tar.gz: ed29f6c4e1b7d1d5d21ffe967eb2c3c8abe805dc
5
5
  SHA512:
6
- metadata.gz: 3e6b1346f8e53ccab60df0d2ba0da26ffd2cb0ddd1c7df0ad49a7a933e74fc96e7e49c3e555c380abd8e78c920c0f93f86bf855cd5fe12e79a4a919a65f012fc
7
- data.tar.gz: 6d90d77d0fb276e997f230282f4769993cf7002ab60f06584f17aaee18a28007aa6b3756736669f11ae3c57641416d322f086dfc7c3f1aff0769ad1595d0bc77
6
+ metadata.gz: 8a02ff22c0f4a4a3137f5712e16072ae5bb484374652feda3df80c7cc13204c14626e8b9622f1ef00fa31f074c07213d7e4be249f33316b4b06eb2263e10daee
7
+ data.tar.gz: 22cda5161c64246d58c6c0c2d19f532cfed31b5d470e851394d55c0594f4db07fd6f507e318ea50e468a1909f18d2881b779fe77a35baa3ed9d77148c74f2691
data/README.md CHANGED
@@ -92,3 +92,18 @@ Unidom::Common.configure do |options|
92
92
 
93
93
  end
94
94
  ```
95
+
96
+
97
+
98
+ ## RSpec examples
99
+
100
+ ```ruby
101
+ # spec/models/unidom_spec.rb
102
+ require 'unidom/shipment/models_rspec'
103
+
104
+ # spec/types/unidom_spec.rb
105
+ require 'unidom/shipment/types_rspec'
106
+
107
+ # spec/validators/unidom_spec.rb
108
+ require 'unidom/shipment/validators_rspec'
109
+ ```
@@ -0,0 +1,23 @@
1
+ describe Unidom::Shipment::ShipmentItem, type: :model do
2
+
3
+ before :each do
4
+ end
5
+
6
+ after :each do
7
+ end
8
+
9
+ context do
10
+
11
+ model_attributes = {
12
+ shipment_id: SecureRandom.uuid,
13
+ shipped_id: SecureRandom.uuid,
14
+ shipped_type: 'Unidom::Shipment::Shipped::Mock',
15
+ ordinal: 1,
16
+ quantity: 10.00
17
+ }
18
+
19
+ it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
20
+
21
+ end
22
+
23
+ end
@@ -0,0 +1,21 @@
1
+ describe Unidom::Shipment::ShipmentPackageItem, type: :model do
2
+
3
+ before :each do
4
+ end
5
+
6
+ after :each do
7
+ end
8
+
9
+ context do
10
+
11
+ model_attributes = {
12
+ package_id: SecureRandom.uuid,
13
+ shipment_item_id: SecureRandom.uuid,
14
+ quantity: 10.00
15
+ }
16
+
17
+ it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
18
+
19
+ end
20
+
21
+ end
@@ -0,0 +1,19 @@
1
+ describe Unidom::Shipment::ShipmentPackage, type: :model do
2
+
3
+ before :each do
4
+ end
5
+
6
+ after :each do
7
+ end
8
+
9
+ context do
10
+
11
+ model_attributes = {
12
+ serial_number: '123456789012345678'
13
+ }
14
+
15
+ it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
16
+
17
+ end
18
+
19
+ end
@@ -0,0 +1,27 @@
1
+ describe Unidom::Shipment::ShipmentReceipt, type: :model do
2
+
3
+ before :each do
4
+ end
5
+
6
+ after :each do
7
+ end
8
+
9
+ context do
10
+
11
+ model_attributes = {
12
+ package_id: SecureRandom.uuid,
13
+ shipped_id: SecureRandom.uuid,
14
+ shipped_type: 'Unidom::Shipment::Shipped::Mock',
15
+ store_item_id: SecureRandom.uuid,
16
+ store_item_type: 'Unidom::Shipment::StoreItem::Mock',
17
+ accepted_quantity: 9,
18
+ rejected_quantity: 1,
19
+ received_at: Time.now,
20
+ rejection_reason: 'Broken'
21
+ }
22
+
23
+ it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
24
+
25
+ end
26
+
27
+ end
@@ -0,0 +1,44 @@
1
+ describe Unidom::Shipment::Shipment, type: :model do
2
+
3
+ before :each do
4
+ end
5
+
6
+ after :each do
7
+ end
8
+
9
+ context do
10
+
11
+ model_attributes = {
12
+ sender_party_id: SecureRandom.uuid,
13
+ sender_party_type: 'Unidom::Shipment::SenderParty::Mock',
14
+ sender_agent_id: SecureRandom.uuid,
15
+ sender_agent_type: 'Unidom::Shipment::SenderAgent::Mock',
16
+ sender_location_id: SecureRandom.uuid,
17
+ sender_location_type: 'Unidom::Shipment::SenderLocation::Mock',
18
+ sender_contact_id: SecureRandom.uuid,
19
+ sender_contact_type: 'Unidom::Shipment::SenderContact::Mock',
20
+ receiver_party_id: SecureRandom.uuid,
21
+ receiver_party_type: 'Unidom::Shipment::ReceiverParty::Mock',
22
+ receiver_agent_id: SecureRandom.uuid,
23
+ receiver_agent_type: 'Unidom::Shipment::ReceiverAgent::Mock',
24
+ receiver_location_id: SecureRandom.uuid,
25
+ receiver_location_type: 'Unidom::Shipment::ReceiverLocation::Mock',
26
+ receiver_contact_id: SecureRandom.uuid,
27
+ receiver_contact_type: 'Unidom::Shipment::ReceiverContact::Mock',
28
+ conveyance_code: 'CSSP',
29
+ estimated_ready_on: Date.current+2.days,
30
+ estimated_shipped_on: Date.current+3.days,
31
+ estimated_arrived_on: Date.current+9.days,
32
+ last_cancellable_at: Time.now+2.days,
33
+ shipped_at: Time.now+3.days,
34
+ received_at: Time.now+9.days,
35
+ cancelled_at: nil,
36
+ estimated_amount: 1_000.00,
37
+ actual_amount: 1_050.00
38
+ }
39
+
40
+ it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
41
+
42
+ end
43
+
44
+ end
@@ -0,0 +1,17 @@
1
+ describe Unidom::Shipment::Conveyance, type: :type do
2
+
3
+ before :each do
4
+ end
5
+
6
+ after :each do
7
+ end
8
+
9
+ it_behaves_like 'ProgneTapera::EnumConfig', 6, [
10
+ { code: 'CSSP', name: 'customer_shipment', localized_name: '客户装运' },
11
+ { code: 'CSRT', name: 'customer_return', localized_name: '客户退回' },
12
+ { code: 'PCSP', name: 'purchase_shipment', localized_name: '购买装运' },
13
+ { code: 'PCRT', name: 'purchase_return', localized_name: '进货退回' },
14
+ { code: 'TRSF', name: 'transfer', localized_name: '转运' },
15
+ { code: 'DROP', name: 'drop_shipment', localized_name: '直接装运' } ]
16
+
17
+ end
@@ -0,0 +1,5 @@
1
+ require 'rspec/models/unidom/shipment/shipment_spec' unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Shipment::Shipment'
2
+ require 'rspec/models/unidom/shipment/shipment_item_spec' unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Shipment::ShipmentItem'
3
+ require 'rspec/models/unidom/shipment/shipment_package_spec' unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Shipment::ShipmentPackage'
4
+ require 'rspec/models/unidom/shipment/shipment_package_item_spec' unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Shipment::ShipmentPackageItem'
5
+ require 'rspec/models/unidom/shipment/shipment_receipt_spec' unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Shipment::ShipmentReceipt'
@@ -0,0 +1 @@
1
+ require 'rspec/types/unidom/shipment/conveyance_spec'
File without changes
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Shipment
3
- VERSION = '0.6.2'.freeze
3
+ VERSION = '0.7'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-shipment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: '0.7'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Topbit Du
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-23 00:00:00.000000000 Z
11
+ date: 2017-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common
@@ -60,9 +60,18 @@ files:
60
60
  - db/migrate/20021011000000_create_unidom_shipment_packages.rb
61
61
  - db/migrate/20021012000000_create_unidom_shipment_package_items.rb
62
62
  - db/migrate/20021013000000_create_unidom_shipment_receipts.rb
63
+ - lib/rspec/models/unidom/shipment/shipment_item_spec.rb
64
+ - lib/rspec/models/unidom/shipment/shipment_package_item_spec.rb
65
+ - lib/rspec/models/unidom/shipment/shipment_package_spec.rb
66
+ - lib/rspec/models/unidom/shipment/shipment_receipt_spec.rb
67
+ - lib/rspec/models/unidom/shipment/shipment_spec.rb
68
+ - lib/rspec/types/unidom/shipment/conveyance_spec.rb
63
69
  - lib/tasks/shipment_tasks.rake
64
70
  - lib/unidom/shipment.rb
65
71
  - lib/unidom/shipment/engine.rb
72
+ - lib/unidom/shipment/models_rspec.rb
73
+ - lib/unidom/shipment/types_rspec.rb
74
+ - lib/unidom/shipment/validators_rspec.rb
66
75
  - lib/unidom/shipment/version.rb
67
76
  homepage: https://github.com/topbitdu/unidom-shipment
68
77
  licenses: