unidom-price 1.4.1 → 1.5

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: fe9219a0cf558b7b993f9ffa1ae6319b0426146e
4
- data.tar.gz: d530e863abbfdf75513020eff153168b56ed8956
3
+ metadata.gz: ae7ea7b7ce37f9e2175e1cfb5b6ea571d8e487bf
4
+ data.tar.gz: cae78a1bdfc17538c70fd939c6fa7698012b8288
5
5
  SHA512:
6
- metadata.gz: 091c073ff4fb9f0e213fb1dac1ed3d4156f3aeae05f59d629150a939e61634169576181a39b75a94d0d79094db2f7493a23e5221d03a0f6eeae30487e6eb0430
7
- data.tar.gz: d41e82b520e5a62f29c7f24eb948d3f592bf473ed390174a93bcdc50eca349753f55712e178f2cb7ebb3da3bfc34da81382a8262a9d418269e975dae6263798a
6
+ metadata.gz: 3d29943e072be1c3109a5efe7964ba99bbf918a26fd3b04ba5b39798f2090ec252893449ba730bd6cc1101bdcfe584d8cad5b547a6f9fa5f03879c556566b853
7
+ data.tar.gz: 330734b9fcd88e5b2525d4e45a5583bc63653cf41b506f6353bace1316412ebdc9786714241615811fea933a6700592f3b00887036f4fe7778efb31f907b586c
data/README.md CHANGED
@@ -97,6 +97,14 @@ The As Priced concern do the following tasks for the includer automatically:
97
97
  ### Calculation enum code
98
98
 
99
99
  ```ruby
100
- Unidom::Price::Calculation::AMOUNT
101
- Unidom::Price::Calculation::PERCENTAGE
100
+ Unidom::Price::Calculation::AMOUNT # 金额
101
+ Unidom::Price::Calculation::PERCENTAGE # 百分比
102
+ ```
103
+
104
+ ### Charging enum code
105
+
106
+ ```ruby
107
+ Unidom::Price::Charging::ONE_TIME # 一次性收费
108
+ Unidom::Price::Charging::RECURRING # 重复性收费
109
+ Unidom::Price::Charging::UTILIZATION # 使用率收费
102
110
  ```
@@ -18,6 +18,7 @@ class Unidom::Price::Price < Unidom::Price::ApplicationRecord
18
18
  scope :priced_is, ->(priced) { where priced: priced }
19
19
 
20
20
  code :calculation, Unidom::Price::Calculation
21
+ code :charging, Unidom::Price::Charging
21
22
 
22
23
  def self.price!(priced, amount: 0, pricer: nil, calculation_code: 'AMNT', pricing_code: 'BASE', charging_code: 'ONCE', opened_at: Time.now)
23
24
  price = priced_is(priced).calculation_coded_as(calculation_code).pricing_coded_as(pricing_code).charging_coded_as(charging_code).valid_at.alive.first
@@ -0,0 +1,7 @@
1
+ class Unidom::Price::Charging < ActiveRecord::Type::Value
2
+
3
+ include ProgneTapera::EnumConfig
4
+
5
+ enum :unidom_charging
6
+
7
+ end
data/config/enum.yml CHANGED
@@ -5,3 +5,14 @@ enum:
5
5
  code: AMNT
6
6
  percentage:
7
7
  code: PCTG
8
+
9
+ unidom_charging:
10
+ one_time:
11
+ code: ONCE
12
+ description: such as for buying a good
13
+ recurring:
14
+ code: RECR
15
+ description: an ongoing charge such as a monthly fee for a standard type of service
16
+ utilization:
17
+ code: UTLZ
18
+ description: usage of a product
@@ -4,3 +4,8 @@
4
4
  unidom_calculation:
5
5
  amount: 金额
6
6
  percentage: 百分比
7
+
8
+ unidom_charging:
9
+ one_time: 一次性收费
10
+ recurring: 重复性收费
11
+ utilization: 使用率收费
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Price
3
- VERSION = '1.4.1'.freeze
3
+ VERSION = '1.5'.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.4.1
4
+ version: '1.5'
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-06 00:00:00.000000000 Z
11
+ date: 2016-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common
@@ -47,6 +47,7 @@ files:
47
47
  - app/models/unidom/price/concerns/as_pricer.rb
48
48
  - app/models/unidom/price/price.rb
49
49
  - app/types/unidom/price/calculation.rb
50
+ - app/types/unidom/price/charging.rb
50
51
  - app/views/layouts/unidom/price/application.html.erb
51
52
  - config/enum.yml
52
53
  - config/locales/enum.zh-CN.yml