unidom-price 1.5 → 1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -6
- data/app/types/unidom/price/pricing.rb +7 -0
- data/config/enum.yml +17 -3
- data/config/locales/enum.zh-CN.yml +6 -0
- data/lib/unidom/price/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8213fae471e8288934e33eb3998d8e963415a15c
|
4
|
+
data.tar.gz: 3858cd7e5803f75875e33dbfbe44372ef8d10336
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a92d9872083c5354cca02e3aee0045bc09dcb669d8fe172693d7c882233f86a0e20bca455a8578d4e51c062304d33636afaf67945b6ba047d409563ab3a2f712
|
7
|
+
data.tar.gz: 35b588b28ae53121b89fd326c840d2439dccd6f545d5bd382ab21b3c206e1481e3420b9a720165dfea8214b3fc863289b253dcaf66077eb18b350ea82bab37f7
|
data/README.md
CHANGED
@@ -78,16 +78,22 @@ include Unidom::Price::Concerns::AsPricer
|
|
78
78
|
|
79
79
|
### As Priced
|
80
80
|
|
81
|
-
The As Priced concern do the following tasks for the includer automatically:
|
82
|
-
|
83
|
-
|
81
|
+
The As Priced concern do the following tasks for the includer automatically:
|
82
|
+
|
83
|
+
1. Define the has_many :prices macro as: ``has_many :prices, class_name: 'Unidom::Price::Price', as: :priced``
|
84
|
+
|
85
|
+
2. Define the #is_priced! method as: ``is_priced!(amount, by: nil, at: Time.now)``
|
86
|
+
|
84
87
|
3. Define the #is_priced? method as: ``is_priced?(at: Time.now)``
|
85
88
|
|
86
89
|
### As Pricer
|
87
90
|
|
88
|
-
The As Priced concern do the following tasks for the includer automatically:
|
89
|
-
|
90
|
-
|
91
|
+
The As Priced concern do the following tasks for the includer automatically:
|
92
|
+
|
93
|
+
1. Define the has_many :pricings macro as: ``has_many :pricings, class_name: 'Unidom::Price::Price', as: :pricer``
|
94
|
+
|
95
|
+
2. Define the #price! method as: ``price!(it, amount, at: Time.now)``
|
96
|
+
|
91
97
|
3. Define the #price? method as: ``price?(it, at: Time.now)``
|
92
98
|
|
93
99
|
|
@@ -108,3 +114,12 @@ Unidom::Price::Charging::ONE_TIME # 一次性收费
|
|
108
114
|
Unidom::Price::Charging::RECURRING # 重复性收费
|
109
115
|
Unidom::Price::Charging::UTILIZATION # 使用率收费
|
110
116
|
```
|
117
|
+
|
118
|
+
### Pricing enum code
|
119
|
+
|
120
|
+
```ruby
|
121
|
+
Unidom::Price::Pricing::BASE # 基价
|
122
|
+
Unidom::Price::Pricing::DISCOUNT # 折扣成分
|
123
|
+
Unidom::Price::Pricing::SURCHARGE # 额外收费成分
|
124
|
+
Unidom::Price::Pricing::MANUFACTURER_SUGGESTED # 厂家建议价
|
125
|
+
```
|
data/config/enum.yml
CHANGED
@@ -8,11 +8,25 @@ enum:
|
|
8
8
|
|
9
9
|
unidom_charging:
|
10
10
|
one_time:
|
11
|
-
code:
|
11
|
+
code: ONCE
|
12
12
|
description: such as for buying a good
|
13
13
|
recurring:
|
14
|
-
code:
|
14
|
+
code: RECR
|
15
15
|
description: an ongoing charge such as a monthly fee for a standard type of service
|
16
16
|
utilization:
|
17
|
-
code:
|
17
|
+
code: UTLZ
|
18
18
|
description: usage of a product
|
19
|
+
|
20
|
+
unidom_pricing:
|
21
|
+
base:
|
22
|
+
code: BASE
|
23
|
+
description: 产品的起始价格
|
24
|
+
discount:
|
25
|
+
code: DSCT
|
26
|
+
description: 相对于基价的有效折扣
|
27
|
+
surcharge:
|
28
|
+
code: SCHG
|
29
|
+
description: 附加收费
|
30
|
+
manufacturer_suggested:
|
31
|
+
code: MFSG
|
32
|
+
description:
|
data/lib/unidom/price/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-price
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.6'
|
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: 2017-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|
@@ -48,6 +48,7 @@ files:
|
|
48
48
|
- app/models/unidom/price/price.rb
|
49
49
|
- app/types/unidom/price/calculation.rb
|
50
50
|
- app/types/unidom/price/charging.rb
|
51
|
+
- app/types/unidom/price/pricing.rb
|
51
52
|
- app/views/layouts/unidom/price/application.html.erb
|
52
53
|
- config/enum.yml
|
53
54
|
- config/locales/enum.zh-CN.yml
|