comee_core 0.1.37 → 0.1.38
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/comee/core/client_price.rb +2 -0
- data/app/models/comee/core/master_price.rb +2 -0
- data/db/migrate/20230813235946_create_comee_core_master_prices.rb +4 -0
- data/db/migrate/20230814151601_create_comee_core_client_prices.rb +4 -0
- data/lib/comee/core/version.rb +1 -1
- data/spec/factories/comee/core/client_prices.rb +1 -0
- data/spec/factories/comee/core/master_prices.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d518d7f15ac11cb1ec5a0012735296eb98ae3ba1a93b5601d85e7fe63d7b5956
|
4
|
+
data.tar.gz: 6dee4dcf892b4938f1f7fab7b1d7c527b2a11aad1295c816b67db553c6ba7b32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/comee/core/version.rb
CHANGED