cats_core 1.3.9 → 1.3.10

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: 060d0c6d315bf7f71c6745ceb159793b3815e1656ba8894f0e00e2672a25b315
4
- data.tar.gz: 4506f7254df1d32e8ff3560fcfa556a83b9c536e7a775eb2753dc01b8a8ecf41
3
+ metadata.gz: 4b11b523effee1abb0d25abc8f495da5417f4a92d260339588bd30dfd617bd4e
4
+ data.tar.gz: adb1c8af3fd35b7d40b6d1b462110dad73b5128dd3a7ab1064c401aef2a9218d
5
5
  SHA512:
6
- metadata.gz: 05070066e3f2ff98cf049935d6e04c1cc6b20ebe22fe7bedcc304ec858cdf07d72bacc354349989095377333069ab37f342fc834924a40e96d68ffdd4a1c4d32
7
- data.tar.gz: e244c97987112f7c0a82f6f0086d05ebcbe993a14a5c975c2fe99b4b2cf818e946072155b941ba889a0247217bf4998ef3b6877bb8babad4759c3e8466b6f587
6
+ metadata.gz: af209110dee908a47a8b8dd6e6bf156a7b9ec72b17aaef38dc2ebb49fc052bc72edb5bd566ac4711a4714c68f9fb81a863a777c2feb7345696d7ed295a30ecc3
7
+ data.tar.gz: 7880e17c8a0bebc41bfa79f012ea0e5db7ac1ead2cd00ecd7d3680eae9253d3af76813426ddd492d72985c631e57119f1960e2ffb45b5404a7b0b2efbd7b5044
@@ -6,6 +6,7 @@ module Cats
6
6
  belongs_to :regional_request
7
7
 
8
8
  has_many :monthly_plan_items
9
+ has_many :monthly_rations
9
10
 
10
11
  validates :reference_no, presence: true, uniqueness: true
11
12
  validates :status, presence: true, inclusion: { in: Cats::Core::Plan::STATUSES }
@@ -0,0 +1,11 @@
1
+ module Cats
2
+ module Core
3
+ class MonthlyRation < ApplicationRecord
4
+ belongs_to :commodity_category
5
+ belongs_to :unit_of_measure
6
+ belongs_to :monthly_plan
7
+
8
+ validates :amount, :no_of_days, presence: true, numericality: { greater_than: 0 }
9
+ end
10
+ end
11
+ end
@@ -14,7 +14,7 @@ class CreateCatsCoreMonthlyPlans < ActiveRecord::Migration[6.1]
14
14
  t.references :regional_request,
15
15
  null: false,
16
16
  index: { name: 'rr_on_mp_indx' },
17
- foreign_key: { to_table: :cats_core_regional_requests }
17
+ foreign_key: { to_table: :cats_core_regional_requests }
18
18
 
19
19
  t.timestamps
20
20
  end
@@ -0,0 +1,22 @@
1
+ class CreateCatsCoreMonthlyRations < ActiveRecord::Migration[6.1]
2
+ def change
3
+ create_table :cats_core_monthly_rations do |t|
4
+ t.references :commodity_category,
5
+ null: false,
6
+ index: { name: 'cc_on_mr_indx' },
7
+ foreign_key: { to_table: :cats_core_commodity_categories }
8
+ t.float :amount, null: false
9
+ t.references :unit_of_measure,
10
+ null: false,
11
+ index: { name: 'uom_on_mr_indx' },
12
+ foreign_key: { to_table: :cats_core_unit_of_measures }
13
+ t.integer :no_of_days, null: false
14
+ t.references :monthly_plan,
15
+ index: { name: 'mp_on_mr_indx' },
16
+ null: false,
17
+ foreign_key: { to_table: :cats_core_monthly_plans }
18
+
19
+ t.timestamps
20
+ end
21
+ end
22
+ end
@@ -1,5 +1,5 @@
1
1
  module Cats
2
2
  module Core
3
- VERSION = '1.3.9'.freeze
3
+ VERSION = '1.3.10'.freeze
4
4
  end
5
5
  end
@@ -0,0 +1,9 @@
1
+ FactoryBot.define do
2
+ factory :monthly_ration, class: 'Cats::Core::MonthlyRation' do
3
+ commodity_category
4
+ amount { 100 }
5
+ unit_of_measure
6
+ no_of_days { 30 }
7
+ monthly_plan
8
+ end
9
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cats_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.9
4
+ version: 1.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henock L.
@@ -272,6 +272,7 @@ files:
272
272
  - app/models/cats/core/monthly_plan.rb
273
273
  - app/models/cats/core/monthly_plan_item.rb
274
274
  - app/models/cats/core/monthly_plan_item_detail.rb
275
+ - app/models/cats/core/monthly_ration.rb
275
276
  - app/models/cats/core/notification.rb
276
277
  - app/models/cats/core/notification_rule.rb
277
278
  - app/models/cats/core/offer_item.rb
@@ -388,6 +389,7 @@ files:
388
389
  - db/migrate/20220107121752_create_cats_core_monthly_plans.rb
389
390
  - db/migrate/20220107125025_create_cats_core_monthly_plan_items.rb
390
391
  - db/migrate/20220107132433_create_cats_core_monthly_plan_item_details.rb
392
+ - db/migrate/20220107224630_create_cats_core_monthly_rations.rb
391
393
  - lib/cats/core.rb
392
394
  - lib/cats/core/engine.rb
393
395
  - lib/cats/core/version.rb
@@ -414,6 +416,7 @@ files:
414
416
  - spec/factories/cats/core/monthly_plan_item_details.rb
415
417
  - spec/factories/cats/core/monthly_plan_items.rb
416
418
  - spec/factories/cats/core/monthly_plans.rb
419
+ - spec/factories/cats/core/monthly_rations.rb
417
420
  - spec/factories/cats/core/notification_rules.rb
418
421
  - spec/factories/cats/core/notifications.rb
419
422
  - spec/factories/cats/core/offer_items.rb