unidom-shopping 1.7.8 → 2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/app/models/unidom/shopping/shopping_item.rb +2 -2
- data/db/migrate/20020501000000_create_unidom_shopping_carts.rb +2 -2
- data/db/migrate/20020502000000_create_unidom_shopping_items.rb +2 -2
- data/lib/rspec/models/unidom/shopping/shopping_item_spec.rb +2 -2
- data/lib/unidom/shopping/version.rb +1 -1
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 19549b0781e7a5a0740dacc5edaaf663856b27ab1e9fa75945af8cd885254a34
|
4
|
+
data.tar.gz: 5bb273a96325c1d43f22cea07b07f69fab9a788cbfbb16e22833962a791f4f78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0d760891d68cb4fb09c15f6807a566d393362e0ea8ecbd7fecd648f57dc6c4b0be8df067b9cbd70e68ca5b3aeb86b768f29fe9c994af22040b3528b56c0389b
|
7
|
+
data.tar.gz: b3e238a6198eb80537d64156a06a21502e99ad535245c917f11f9cc48f0307b5fbdb10c02409d5ab291c309d510c9c981a4e28fc92c18df264b627694235a91f
|
@@ -7,8 +7,8 @@ class Unidom::Shopping::ShoppingItem < Unidom::Shopping::ApplicationRecord
|
|
7
7
|
|
8
8
|
include Unidom::Common::Concerns::ModelExtension
|
9
9
|
|
10
|
-
validates :unit_price, presence: true, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to:
|
11
|
-
validates :quantity, presence: true, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to:
|
10
|
+
validates :unit_price, presence: true, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: Unidom::Common::MAXIMUM_AMOUNT }
|
11
|
+
validates :quantity, presence: true, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: Unidom::Common::MAXIMUM_AMOUNT }
|
12
12
|
|
13
13
|
belongs_to :shopping_cart, class_name: 'Unidom::Shopping::ShoppingCart'
|
14
14
|
belongs_to :shopper, polymorphic: true
|
@@ -10,8 +10,8 @@ class CreateUnidomShoppingCarts < ActiveRecord::Migration
|
|
10
10
|
polymorphic: { null: false, default: '', limit: 200 }
|
11
11
|
|
12
12
|
t.column :state, 'char(1)', null: false, default: 'C'
|
13
|
-
t.datetime :opened_at, null: false, default: ::
|
14
|
-
t.datetime :closed_at, null: false, default: ::
|
13
|
+
t.datetime :opened_at, null: false, default: Unidom::Common::OPENED_AT
|
14
|
+
t.datetime :closed_at, null: false, default: Unidom::Common::CLOSED_AT
|
15
15
|
t.boolean :defunct, null: false, default: false
|
16
16
|
t.jsonb :notation, null: false, default: {}
|
17
17
|
|
@@ -14,8 +14,8 @@ class CreateUnidomShoppingItems < ActiveRecord::Migration
|
|
14
14
|
t.decimal :quantity, null: false, default: 0.0, precision: 12, scale: 2
|
15
15
|
|
16
16
|
t.column :state, 'char(1)', null: false, default: 'C'
|
17
|
-
t.datetime :opened_at, null: false, default: ::
|
18
|
-
t.datetime :closed_at, null: false, default: ::
|
17
|
+
t.datetime :opened_at, null: false, default: Unidom::Common::OPENED_AT
|
18
|
+
t.datetime :closed_at, null: false, default: Unidom::Common::CLOSED_AT
|
19
19
|
t.boolean :defunct, null: false, default: false
|
20
20
|
t.jsonb :notation, null: false, default: {}
|
21
21
|
|
@@ -21,9 +21,9 @@ describe Unidom::Shopping::ShoppingItem, type: :model do
|
|
21
21
|
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
22
22
|
|
23
23
|
it_behaves_like 'validates numericality', model_attributes, :unit_price,
|
24
|
-
range: 0..
|
24
|
+
range: 0..Unidom::Common::MAXIMUM_AMOUNT, minimum_inclusive: true, maximum_inclusive: true
|
25
25
|
it_behaves_like 'validates numericality', model_attributes, :quantity,
|
26
|
-
range: 0..
|
26
|
+
range: 0..Unidom::Common::MAXIMUM_AMOUNT, minimum_inclusive: true, maximum_inclusive: true
|
27
27
|
|
28
28
|
shopping_cart_attributes = {
|
29
29
|
shopper_id: SecureRandom.uuid,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-shopping
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: '2.0'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Topbit Du
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.0'
|
27
27
|
description: Unidom (UNIfied Domain Object Model) is a series of domain model engines.
|
28
28
|
The Shopping domain model engine includes Shopping Cart and Shopping Item models.
|
29
29
|
Unidom (统一领域对象模型)是一系列的领域模型引擎。购物领域模型引擎包括购物车和购物项的模型。
|
@@ -87,8 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '0'
|
89
89
|
requirements: []
|
90
|
-
|
91
|
-
rubygems_version: 2.6.4
|
90
|
+
rubygems_version: 3.1.2
|
92
91
|
signing_key:
|
93
92
|
specification_version: 4
|
94
93
|
summary: Unidom Shopping Domain Model Engine 购物领域模型引擎
|