comee_core 0.2.41 → 0.2.43

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
  SHA256:
3
- metadata.gz: '09414cc0b1fa45cb52e089e2854a51bf135502177ada40425077d7e4b7587a8a'
4
- data.tar.gz: e65ffb3986a085e460196af5d068319bdf66fc857c0295d24c45d00b8bab51b5
3
+ metadata.gz: 7582c73d3be5ab210b408c454805a16f33df40d492cce06474875e5b26a5a2c4
4
+ data.tar.gz: 1daa7de3b7dabe7e85a56e5de900b94fb8eab9a663f3cdaeedeacc0f27517e18
5
5
  SHA512:
6
- metadata.gz: a07511623828729350a1dd4a4707101b1402ced5f2e9b06978c722249d38a202a905dd8ba4b737ac46dc86782fb4a34c83d37e6ec636a80d0d8f3f37367c8172
7
- data.tar.gz: c7887f7a54b2be7808d6aefd54e187edf4f47ded2ef873c60ae3d59e7f3afc087bb51752e883c9a083965fff41217a63bc5325c1cc6605dc34978f2fc7f9b08a
6
+ metadata.gz: ff79ef5f31c2d0a148a6433403506c6ecd6ebad536028b8dfe01e462f2230384d212202eaca41f68a7dd8076d474c89814a40e48332568d0c4100c5b828ee87d
7
+ data.tar.gz: 4591014a4548e65b87d77256e6002ad88e59380682a6b18a418d4a2ab1a8282ae1e0f3a614147fc5826affaee433cc6bbf7055dd706ce44eb8e8d084d0eb1471
@@ -6,6 +6,7 @@ module Comee
6
6
  enum status: {active: 0, canceled: 1}
7
7
 
8
8
  belongs_to :purchase_order
9
+ belongs_to :product
9
10
  belongs_to :unit
10
11
 
11
12
  validates :quantity, presence: true, numericality: {greater_than: 0}
@@ -0,0 +1,9 @@
1
+ module Comee
2
+ module Core
3
+ class PurchaseOrderItemDiff < ApplicationRecord
4
+ belongs_to :purchase_order_item
5
+
6
+ validates :quantity_diff, :price_diff, presence: true, numericality: {greater_than_or_equal_to: 0}
7
+ end
8
+ end
9
+ end
@@ -8,6 +8,10 @@ class CreateComeeCorePurchaseOrderItems < ActiveRecord::Migration[7.1]
8
8
 
9
9
  t.float :quantity, null: false
10
10
  t.float :confirmed_quantity, null: false
11
+ t.references :product,
12
+ null: false,
13
+ index: {name: "product_on_ccpoitm_indx"},
14
+ foreign_key: {to_table: :comee_core_products}
11
15
  t.references :unit,
12
16
  null: false,
13
17
  index: {name: "unit_on_ccpoitm_indx"},
@@ -0,0 +1,15 @@
1
+ class CreateComeeCorePurchaseOrderItemDiffs < ActiveRecord::Migration[7.1]
2
+ def change
3
+ create_table :comee_core_purchase_order_item_diffs do |t|
4
+ t.references :purchase_order_item,
5
+ null: false,
6
+ index: {name: "poi_on_ccpoid_indx"},
7
+ foreign_key: {to_table: :comee_core_purchase_order_items}
8
+ t.float :quantity_diff, null: false, default: 0
9
+ t.float :price_diff, null: false, default: 0
10
+ t.date :original_delivery_date
11
+
12
+ t.timestamps
13
+ end
14
+ end
15
+ end
@@ -1,5 +1,5 @@
1
1
  module Comee
2
2
  module Core
3
- VERSION = "0.2.41".freeze
3
+ VERSION = "0.2.43".freeze
4
4
  end
5
5
  end
@@ -0,0 +1,8 @@
1
+ FactoryBot.define do
2
+ factory :purchase_order_item_diff, class: "Comee::Core::PurchaseOrderItemDiff" do
3
+ purchase_order_item
4
+ quantity_diff { 50 }
5
+ price_diff { 20 }
6
+ original_delivery_date { Date.current.advance(days: 5) }
7
+ end
8
+ end
@@ -1,6 +1,7 @@
1
1
  FactoryBot.define do
2
2
  factory :purchase_order_item, class: "Comee::Core::PurchaseOrderItem" do
3
3
  purchase_order
4
+ product
4
5
  unit
5
6
  quantity { 10 }
6
7
  confirmed_quantity { quantity }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comee_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.41
4
+ version: 0.2.43
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henock L.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-24 00:00:00.000000000 Z
11
+ date: 2024-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers
@@ -332,6 +332,7 @@ files:
332
332
  - app/models/comee/core/product_lookup.rb
333
333
  - app/models/comee/core/purchase_order.rb
334
334
  - app/models/comee/core/purchase_order_item.rb
335
+ - app/models/comee/core/purchase_order_item_diff.rb
335
336
  - app/models/comee/core/purchase_requisition.rb
336
337
  - app/models/comee/core/purchase_requisition_item.rb
337
338
  - app/models/comee/core/quotation_request.rb
@@ -437,6 +438,7 @@ files:
437
438
  - db/migrate/20240125044630_create_comee_core_payments.rb
438
439
  - db/migrate/20240314111117_create_comee_core_purchase_requisitions.rb
439
440
  - db/migrate/20240314111307_create_comee_core_purchase_requisition_items.rb
441
+ - db/migrate/20240325155406_create_comee_core_purchase_order_item_diffs.rb
440
442
  - lib/comee/core.rb
441
443
  - lib/comee/core/engine.rb
442
444
  - lib/comee/core/version.rb
@@ -473,6 +475,7 @@ files:
473
475
  - spec/factories/comee/core/pods.rb
474
476
  - spec/factories/comee/core/product_lookups.rb
475
477
  - spec/factories/comee/core/products.rb
478
+ - spec/factories/comee/core/purchase_order_item_diffs.rb
476
479
  - spec/factories/comee/core/purchase_order_items.rb
477
480
  - spec/factories/comee/core/purchase_orders.rb
478
481
  - spec/factories/comee/core/purchase_requisition_items.rb