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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ae7ea7b7ce37f9e2175e1cfb5b6ea571d8e487bf
4
- data.tar.gz: cae78a1bdfc17538c70fd939c6fa7698012b8288
3
+ metadata.gz: 8213fae471e8288934e33eb3998d8e963415a15c
4
+ data.tar.gz: 3858cd7e5803f75875e33dbfbe44372ef8d10336
5
5
  SHA512:
6
- metadata.gz: 3d29943e072be1c3109a5efe7964ba99bbf918a26fd3b04ba5b39798f2090ec252893449ba730bd6cc1101bdcfe584d8cad5b547a6f9fa5f03879c556566b853
7
- data.tar.gz: 330734b9fcd88e5b2525d4e45a5583bc63653cf41b506f6353bace1316412ebdc9786714241615811fea933a6700592f3b00887036f4fe7778efb31f907b586c
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
- 1. Define the has_many :prices macro as: ``has_many :prices, class_name: 'Unidom::Price::Price', as: :priced``
83
- 2. Define the #is_priced! method as: ``is_priced!(amount, by: nil, at: Time.now)``
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
- 1. Define the has_many :pricings macro as: ``has_many :pricings, class_name: 'Unidom::Price::Price', as: :pricer``
90
- 2. Define the #price! method as: ``price!(it, amount, at: Time.now)``
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
+ ```
@@ -0,0 +1,7 @@
1
+ class Unidom::Price::Pricing < ActiveRecord::Type::Value
2
+
3
+ include ProgneTapera::EnumConfig
4
+
5
+ enum :unidom_pricing
6
+
7
+ end
data/config/enum.yml CHANGED
@@ -8,11 +8,25 @@ enum:
8
8
 
9
9
  unidom_charging:
10
10
  one_time:
11
- code: ONCE
11
+ code: ONCE
12
12
  description: such as for buying a good
13
13
  recurring:
14
- code: RECR
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: UTLZ
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:
@@ -9,3 +9,9 @@
9
9
  one_time: 一次性收费
10
10
  recurring: 重复性收费
11
11
  utilization: 使用率收费
12
+
13
+ unidom_pricing:
14
+ base: 基价
15
+ discount: 折扣成分
16
+ surcharge: 额外收费成分
17
+ manufacturer_suggested: 厂家建议价
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Price
3
- VERSION = '1.5'.freeze
3
+ VERSION = '1.6'.freeze
4
4
  end
5
5
  end
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.5'
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: 2016-12-26 00:00:00.000000000 Z
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