comee_core 0.1.37 → 0.1.38

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
  SHA256:
3
- metadata.gz: 3a91ef93f610041828b30a4314955a251b123e71b398a3c8aaf07753f6854366
4
- data.tar.gz: 0d22f7ae8ff4bc59c4f28f3ea87d43ad1ee3d1f4bff7fa87037c772b767af7bd
3
+ metadata.gz: d518d7f15ac11cb1ec5a0012735296eb98ae3ba1a93b5601d85e7fe63d7b5956
4
+ data.tar.gz: 6dee4dcf892b4938f1f7fab7b1d7c527b2a11aad1295c816b67db553c6ba7b32
5
5
  SHA512:
6
- metadata.gz: 375e624d6f06175480b93da329955438586439309682de2c71ef47690743e5d6e5472857c879c5e4d5a173386699539bde8a7b44b375fa526a0ffc8179382b8f
7
- data.tar.gz: cdca031b93eae9ce1bbf07f0eea311e39b068662648299d95d9433310f700d2f23e0126cfe2876b02045ba8bd21736016912a12f46671a6c46a2168ecb02c918
6
+ metadata.gz: 7da654c516653060647c6dcc8f8d5e8a40cd71ae6add8b4ee88801cb7b1b90951ba677301ccfee0855d08fd70bd941d81ddc5b22ab72342f8ebdb80c239bf1dd
7
+ data.tar.gz: 91676640c9c221f560007d0058eb628f61b1d9567b5e8227775125b3bc16d0b874cb4206300eca0fd796da45ceee57a37e02c36ab599580cf79652dfc5041133
@@ -3,6 +3,7 @@ module Comee
3
3
  class ClientPrice < Price
4
4
  belongs_to :client
5
5
  belongs_to :previous_price, class_name: "Comee::Core::ClientPrice", optional: true
6
+ belongs_to :next_price, class_name: "Comee::Core::ClientPrice", optional: true
6
7
 
7
8
  validates :price, presence: true
8
9
  validates :price, numericality: {greater_than: 0}
@@ -18,6 +19,7 @@ module Comee
18
19
  product_id
19
20
  client_id
20
21
  previous_price_id
22
+ next_price_id
21
23
  ]
22
24
  end
23
25
 
@@ -3,6 +3,7 @@ module Comee
3
3
  class MasterPrice < Price
4
4
  belongs_to :supplier
5
5
  belongs_to :previous_price, class_name: "Comee::Core::MasterPrice", optional: true
6
+ belongs_to :next_price, class_name: "Comee::Core::MasterPrice", optional: true
6
7
 
7
8
  validates :purchase_price, :selling_price, presence: true
8
9
  validates :margin, presence: true, numericality: {greater_than_or_equal_to: 0, less_than_or_equal_to: 100}
@@ -32,6 +33,7 @@ module Comee
32
33
  product_id
33
34
  supplier_id
34
35
  previous_price_id
36
+ next_price_id
35
37
  ]
36
38
  end
37
39
 
@@ -24,6 +24,10 @@ class CreateComeeCoreMasterPrices < ActiveRecord::Migration[7.0]
24
24
  null: true,
25
25
  index: {name: "previous_price_on_ccsp_indx"},
26
26
  foreign_key: {to_table: :comee_core_master_prices}
27
+ t.references :next_price,
28
+ null: true,
29
+ index: {name: "next_price_on_ccsp_indx"},
30
+ foreign_key: {to_table: :comee_core_master_prices}
27
31
  t.boolean :propagated_to_client, null: false, default: false
28
32
 
29
33
  t.timestamps
@@ -22,6 +22,10 @@ class CreateComeeCoreClientPrices < ActiveRecord::Migration[7.0]
22
22
  null: true,
23
23
  index: {name: "previous_price_on_cccp_indx"},
24
24
  foreign_key: {to_table: :comee_core_client_prices}
25
+ t.references :next_price,
26
+ null: true,
27
+ index: {name: "next_price_on_cccp_indx"},
28
+ foreign_key: {to_table: :comee_core_client_prices}
25
29
 
26
30
  t.timestamps
27
31
  end
@@ -1,5 +1,5 @@
1
1
  module Comee
2
2
  module Core
3
- VERSION = "0.1.37".freeze
3
+ VERSION = "0.1.38".freeze
4
4
  end
5
5
  end
@@ -9,6 +9,7 @@ FactoryBot.define do
9
9
  unit
10
10
  discount { 0 }
11
11
  previous_price { nil }
12
+ next_price { nil }
12
13
 
13
14
  trait :past do
14
15
  valid_from { Date.current.advance(months: -2) }
@@ -10,6 +10,7 @@ FactoryBot.define do
10
10
  supplier
11
11
  unit
12
12
  previous_price { nil }
13
+ next_price { nil }
13
14
  propagated_to_client { false }
14
15
 
15
16
  trait :past do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comee_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.37
4
+ version: 0.1.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henock L.