comee_core 0.2.42 → 0.2.44

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: 5951c1379bb4b8d73cac18c899638b0467cc0e2f5c3d53cd919262bf4855a1d2
4
- data.tar.gz: 108d49442722624bc32ae0f7690a21e4ec089c9daf3433a9a2a749f0ae47bdb5
3
+ metadata.gz: c0a5388d85c1ae2d3c4c16843203f97ae1eb4f43887e6fc9ce7e54d851844077
4
+ data.tar.gz: f35b9ca46c598a6929c59c5b8a2fe9cf0eb2f244cd41392a0bf2af7fe752459b
5
5
  SHA512:
6
- metadata.gz: 4d739a2063e916853695c66f2eb7b7a1a73d1b0386c0cdea529cc895a02789baee67ada44412a14c25fb850bd457ce8c4545b2e033cc40f2f0b0f4ea0a7951b7
7
- data.tar.gz: 7c671d0abb884fec73dbfe3b4d5ff0fea4019483bdec2b2346e458709cea53f0b329b61589c4729fbe29063f0914d7c98cf2c8fcb8ae84d7222df956fcf28be1
6
+ metadata.gz: b699bf44a44dd78cb2ab70795a342aa930b235706950978d5547b5caf1354b51211ec6c774619ad58f748859bd6d9a8a76acb99631d563a66bba973bb401bd1c
7
+ data.tar.gz: 7a454118edcdf24e1ff36f538a48c05bc96179ba50ecd55a4dc116b0324a2d7b8b6c4cdd3a102c40291d9009a85814acf821f2a5fa1c7426b71a6cfd04f7c113
@@ -3,6 +3,8 @@ module Comee
3
3
  class PurchaseOrderItem < ApplicationRecord
4
4
  before_save :calculate_total_price, :calculate_confirmation_values
5
5
 
6
+ has_one :purchase_order_item_diff
7
+
6
8
  enum status: {active: 0, canceled: 1}
7
9
 
8
10
  belongs_to :purchase_order
@@ -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
@@ -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.42".freeze
3
+ VERSION = "0.2.44".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
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.42
4
+ version: 0.2.44
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-25 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