comee_core 0.2.43 → 0.2.45

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: 7582c73d3be5ab210b408c454805a16f33df40d492cce06474875e5b26a5a2c4
4
- data.tar.gz: 1daa7de3b7dabe7e85a56e5de900b94fb8eab9a663f3cdaeedeacc0f27517e18
3
+ metadata.gz: a1d7353fb7039356a39d2eedf68c094b9663f68f5ad0d0a191ce50c1e98ac3bb
4
+ data.tar.gz: fc932fba0284fd9500977c93d610436981fee065638701d34ca00612f82d2915
5
5
  SHA512:
6
- metadata.gz: ff79ef5f31c2d0a148a6433403506c6ecd6ebad536028b8dfe01e462f2230384d212202eaca41f68a7dd8076d474c89814a40e48332568d0c4100c5b828ee87d
7
- data.tar.gz: 4591014a4548e65b87d77256e6002ad88e59380682a6b18a418d4a2ab1a8282ae1e0f3a614147fc5826affaee433cc6bbf7055dd706ce44eb8e8d084d0eb1471
6
+ metadata.gz: c0ddba235217d36dc1a6ed7109cb6d07771b053953f03b0abd9952e7dc031a208a86c76170acf0a8d7c3078acbb4c6dc694834fbf475ad3b9aa9cd7498c07332
7
+ data.tar.gz: e1cbe900f0969cf6a78e8770ed2dcf6b144bf96063bb12b795b13657b1910e55831259ad7dccc2ad2d7641d3d6d13eaa29f2f0b5631f100b555abd5d9792bc19
@@ -4,6 +4,7 @@ module Comee
4
4
  belongs_to :supplier
5
5
  has_many :purchase_order_items
6
6
 
7
+ validates :po_number, presence: true, uniqueness: true
7
8
  validates :order_date, :delivery_address, :status, :delivery_date, presence: true
8
9
  enum status: {
9
10
  draft: 0,
@@ -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
@@ -1,6 +1,7 @@
1
1
  class CreateComeeCorePurchaseOrders < ActiveRecord::Migration[7.1]
2
2
  def change
3
3
  create_table :comee_core_purchase_orders do |t|
4
+ t.string :po_number, null: false
4
5
  t.references :supplier,
5
6
  null: false,
6
7
  index: {name: "suppliers_on_ccpo_indx"},
@@ -9,8 +10,10 @@ class CreateComeeCorePurchaseOrders < ActiveRecord::Migration[7.1]
9
10
  t.integer :status, default: 0
10
11
  t.string :delivery_address, null: false
11
12
  t.date :delivery_date, null: false
13
+ t.string :terms
12
14
 
13
15
  t.timestamps
14
16
  end
17
+ add_index :comee_core_purchase_orders, :po_number, unique: true
15
18
  end
16
19
  end
@@ -1,5 +1,5 @@
1
1
  module Comee
2
2
  module Core
3
- VERSION = "0.2.43".freeze
3
+ VERSION = "0.2.45".freeze
4
4
  end
5
5
  end
@@ -1,9 +1,11 @@
1
1
  FactoryBot.define do
2
2
  factory :purchase_order, class: "Comee::Core::PurchaseOrder" do
3
+ po_number { Faker::Alphanumeric.alpha(number: 20) }
3
4
  supplier
4
5
  order_date { Date.current }
5
6
  status { 0 }
6
7
  delivery_address { "Korsu warehouse address" }
7
8
  delivery_date { Date.current.advance(days: 10) }
9
+ terms { Faker::Lorem.sentence }
8
10
  end
9
11
  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.43
4
+ version: 0.2.45
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-26 00:00:00.000000000 Z
11
+ date: 2024-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers