comee_core 0.2.40 → 0.2.42

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: 5c02cd93edacf9b24065620e3bd4f6002bef4514fe78a9b97c04d95a58f8da18
4
- data.tar.gz: 385dfc6ed87f75ba8090f36e42b50b6003dbca38b76a37dfe98c6ffb967bb956
3
+ metadata.gz: 5951c1379bb4b8d73cac18c899638b0467cc0e2f5c3d53cd919262bf4855a1d2
4
+ data.tar.gz: 108d49442722624bc32ae0f7690a21e4ec089c9daf3433a9a2a749f0ae47bdb5
5
5
  SHA512:
6
- metadata.gz: 1a621fc4b3f4f6a28a7bce0d57002d83efb0bb841251bad531218e8aa9ac9bcef9e907f0e76cc9fc58d41054780804fe5c1c087e2f41417da5816351256bca21
7
- data.tar.gz: 41a9ccb017d6bbaf6bc357f0dcb6625519a0c7193376ddf21c5fbfb1189e4fb57f1c48c787bb880a712418719357549169fd1c36ae59d0c669f6edf2e619830e
6
+ metadata.gz: 4d739a2063e916853695c66f2eb7b7a1a73d1b0386c0cdea529cc895a02789baee67ada44412a14c25fb850bd457ce8c4545b2e033cc40f2f0b0f4ea0a7951b7
7
+ data.tar.gz: 7c671d0abb884fec73dbfe3b4d5ff0fea4019483bdec2b2346e458709cea53f0b329b61589c4729fbe29063f0914d7c98cf2c8fcb8ae84d7222df956fcf28be1
@@ -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}
@@ -12,7 +12,7 @@ module Comee
12
12
  belongs_to :purchase_requisition
13
13
  belongs_to :purchase_order_item, optional: true
14
14
 
15
- validates :processing_status, presence: true
15
+ validates :processing_status, :delivery_date, presence: true
16
16
  validates :quantity, :price, presence: true, numericality: {greater_than_or_equal_to: 0}
17
17
 
18
18
  def calculate_total_price
@@ -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"},
@@ -3,6 +3,7 @@ class CreateComeeCorePurchaseRequisitions < ActiveRecord::Migration[7.1]
3
3
  create_table :comee_core_purchase_requisitions do |t|
4
4
  t.string :requisition_no, null: false
5
5
  t.date :requisition_date, null: false
6
+ t.date :delivery_date
6
7
  t.string :remark
7
8
  t.integer :status, null: false, default: 0
8
9
  t.float :total_price, null: false, default: 0
@@ -24,6 +24,7 @@ class CreateComeeCorePurchaseRequisitionItems < ActiveRecord::Migration[7.1]
24
24
  t.float :quantity, null: false
25
25
  t.float :price, null: false
26
26
  t.float :total_price, null: false
27
+ t.date :delivery_date, null: false
27
28
  t.integer :processing_status, null: false, default: 0
28
29
 
29
30
  t.timestamps
@@ -1,5 +1,5 @@
1
1
  module Comee
2
2
  module Core
3
- VERSION = "0.2.40".freeze
3
+ VERSION = "0.2.42".freeze
4
4
  end
5
5
  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 }
@@ -7,6 +7,7 @@ FactoryBot.define do
7
7
  purchase_order_item { nil }
8
8
  quantity { 10 }
9
9
  price { 15 }
10
+ delivery_date { purchase_requisition.delivery_date }
10
11
  processing_status { Comee::Core::PurchaseRequisitionItem.processing_statuses[:unprocessed] }
11
12
  end
12
13
  end
@@ -2,6 +2,7 @@ FactoryBot.define do
2
2
  factory :purchase_requisition, class: "Comee::Core::PurchaseRequisition" do
3
3
  requisition_no { Faker::Alphanumeric.alpha(number: 10) }
4
4
  requisition_date { Date.current }
5
+ delivery_date { Date.current.advance(days: 10) }
5
6
  remark { Faker::Lorem.sentence }
6
7
  status { Comee::Core::PurchaseRequisition.statuses[:draft] }
7
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.40
4
+ version: 0.2.42
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-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers