cats_core 1.0.35 → 1.0.39
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/cats/core/hrp.rb +1 -1
- data/app/models/cats/core/hrp_item.rb +0 -1
- data/app/models/cats/core/hrp_item_detail.rb +11 -0
- data/app/models/cats/core/ration.rb +1 -4
- data/app/models/cats/core/ration_item.rb +14 -0
- data/db/migrate/20210717031216_create_cats_core_rations.rb +0 -5
- data/db/migrate/20210717031343_create_cats_core_ration_items.rb +21 -0
- data/db/migrate/20210717031810_create_cats_core_hrps.rb +1 -1
- data/db/migrate/20210717032024_create_cats_core_hrp_items.rb +0 -1
- data/db/migrate/20210717032240_create_cats_core_hrp_item_details.rb +18 -0
- data/lib/cats/core/version.rb +1 -1
- data/spec/factories/cats/core/hrp_item_details.rb +7 -0
- data/spec/factories/cats/core/hrp_items.rb +0 -1
- data/spec/factories/cats/core/ration_items.rb +8 -0
- data/spec/factories/cats/core/rations.rb +0 -2
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbd96f5c771c2adceaa0d3c058ba5643b6e38189b4a5afdfbe666affab5a3c36
|
4
|
+
data.tar.gz: b55e4ab59388139d7c591194059f001af370df848077f446640ec3e1dc25f975
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0812bb8e9484cc6dd7f375434c294e7f82320999a9a3ae7a5793c6ede1592fe9eefe50895892895cabe240d1c0fa12197dd9bf2479e1f816d8d31f3c98fe7575'
|
7
|
+
data.tar.gz: dc903f04dddb57c08c4c80c0a3c0135b85254a12bc634414a96eab76bdb39c85cf96e2f37abf47d4853b084651a843d45bd42b5cf2771d0667fdab152e260569
|
data/app/models/cats/core/hrp.rb
CHANGED
@@ -6,7 +6,6 @@ module Cats
|
|
6
6
|
belongs_to :operator
|
7
7
|
|
8
8
|
validates :beneficiaries, presence: true, numericality: { greater_than: 0 }
|
9
|
-
validates :commodity_amount, presence: true, numericality: { greater_than: 0 }
|
10
9
|
validates :hrp_id, uniqueness: { scope: :woreda_id }
|
11
10
|
|
12
11
|
delegate(:name, to: :woreda, prefix: true)
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Cats
|
2
|
+
module Core
|
3
|
+
class HrpItemDetail < ApplicationRecord
|
4
|
+
belongs_to :hrp_item
|
5
|
+
belongs_to :ration_item
|
6
|
+
|
7
|
+
validates :amount, presence: true, numericality: { greater_than: 0 }
|
8
|
+
validates :hrp_item_id, uniqueness: { scope: :ration_item_id }
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -2,11 +2,8 @@ module Cats
|
|
2
2
|
module Core
|
3
3
|
class Ration < ApplicationRecord
|
4
4
|
belongs_to :program
|
5
|
-
belongs_to :commodity_category
|
6
5
|
|
7
|
-
validates :reference_no, :
|
8
|
-
validates :reference_no, uniqueness: true
|
9
|
-
validates :amount, numericality: { greater_than: 0 }
|
6
|
+
validates :reference_no, presence: true, uniqueness: true
|
10
7
|
end
|
11
8
|
end
|
12
9
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Cats
|
2
|
+
module Core
|
3
|
+
class RationItem < ApplicationRecord
|
4
|
+
belongs_to :commodity_category
|
5
|
+
belongs_to :ration
|
6
|
+
belongs_to :unit_of_measure
|
7
|
+
|
8
|
+
validates :amount, presence: true, numericality: { greater_than: 0 }
|
9
|
+
|
10
|
+
delegate(:name, to: :commodity_category, prefix: true)
|
11
|
+
delegate(:abbreviation, to: :unit_of_measure, prefix: true)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -6,11 +6,6 @@ class CreateCatsCoreRations < ActiveRecord::Migration[6.1]
|
|
6
6
|
null: false,
|
7
7
|
index: { name: 'program_on_ration_indx' },
|
8
8
|
foreign_key: { to_table: :cats_core_programs }
|
9
|
-
t.references :commodity_category,
|
10
|
-
null: false,
|
11
|
-
index: { name: 'cc_on_ration_indx' },
|
12
|
-
foreign_key: { to_table: :cats_core_commodity_categories }
|
13
|
-
t.float :amount, null: false
|
14
9
|
t.boolean :current, null: false, default: true
|
15
10
|
|
16
11
|
t.timestamps
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class CreateCatsCoreRationItems < ActiveRecord::Migration[6.1]
|
2
|
+
def change
|
3
|
+
create_table :cats_core_ration_items do |t|
|
4
|
+
t.references :commodity_category,
|
5
|
+
null: false,
|
6
|
+
index: { name: 'cc_on_ration_indx' },
|
7
|
+
foreign_key: { to_table: :cats_core_commodity_categories }
|
8
|
+
t.references :ration,
|
9
|
+
null: false,
|
10
|
+
index: { name: 'ri_on_ration_indx' },
|
11
|
+
foreign_key: { to_table: :cats_core_rations }
|
12
|
+
t.references :unit_of_measure,
|
13
|
+
null: false,
|
14
|
+
index: { name: 'uom_on_ration_indx' },
|
15
|
+
foreign_key: { to_table: :cats_core_unit_of_measures }
|
16
|
+
t.float :amount, null: false
|
17
|
+
|
18
|
+
t.timestamps
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -10,7 +10,6 @@ class CreateCatsCoreHrpItems < ActiveRecord::Migration[6.1]
|
|
10
10
|
index: { name: 'woreda_on_hrp_items_idnx' },
|
11
11
|
foreign_key: { to_table: :cats_core_locations }
|
12
12
|
t.integer :beneficiaries, null: false
|
13
|
-
t.float :commodity_amount, null: false
|
14
13
|
t.references :operator,
|
15
14
|
null: false,
|
16
15
|
index: { name: 'operator_on_hrp_items_indx' },
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class CreateCatsCoreHrpItemDetails < ActiveRecord::Migration[6.1]
|
2
|
+
def change
|
3
|
+
create_table :cats_core_hrp_item_details do |t|
|
4
|
+
t.references :hrp_item,
|
5
|
+
null: false,
|
6
|
+
index: { name: 'hi_on_hid_indx' },
|
7
|
+
foreign_key: { to_table: :cats_core_hrp_items }
|
8
|
+
t.references :ration_item,
|
9
|
+
null: false,
|
10
|
+
index: { name: 'ri_on_hid_indx' },
|
11
|
+
foreign_key: { to_table: :cats_core_ration_items }
|
12
|
+
t.float :amount, null: false
|
13
|
+
|
14
|
+
t.timestamps
|
15
|
+
end
|
16
|
+
add_index(:cats_core_hrp_item_details, [:hrp_item_id, :ration_item_id], unique: true, name: 'hii_rii_on_hid_indx')
|
17
|
+
end
|
18
|
+
end
|
data/lib/cats/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cats_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.39
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henock L.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|
@@ -242,6 +242,7 @@ files:
|
|
242
242
|
- app/models/cats/core/gift_certificate.rb
|
243
243
|
- app/models/cats/core/hrp.rb
|
244
244
|
- app/models/cats/core/hrp_item.rb
|
245
|
+
- app/models/cats/core/hrp_item_detail.rb
|
245
246
|
- app/models/cats/core/location.rb
|
246
247
|
- app/models/cats/core/menu.rb
|
247
248
|
- app/models/cats/core/menu_item.rb
|
@@ -250,6 +251,7 @@ files:
|
|
250
251
|
- app/models/cats/core/program.rb
|
251
252
|
- app/models/cats/core/purchase_order.rb
|
252
253
|
- app/models/cats/core/ration.rb
|
254
|
+
- app/models/cats/core/ration_item.rb
|
253
255
|
- app/models/cats/core/receipt.rb
|
254
256
|
- app/models/cats/core/receipt_transaction.rb
|
255
257
|
- app/models/cats/core/rhn_request.rb
|
@@ -290,8 +292,10 @@ files:
|
|
290
292
|
- db/migrate/20210716210905_create_cats_core_suppliers.rb
|
291
293
|
- db/migrate/20210717031108_create_cats_core_donors.rb
|
292
294
|
- db/migrate/20210717031216_create_cats_core_rations.rb
|
295
|
+
- db/migrate/20210717031343_create_cats_core_ration_items.rb
|
293
296
|
- db/migrate/20210717031810_create_cats_core_hrps.rb
|
294
297
|
- db/migrate/20210717032024_create_cats_core_hrp_items.rb
|
298
|
+
- db/migrate/20210717032240_create_cats_core_hrp_item_details.rb
|
295
299
|
- db/migrate/20210717032330_create_cats_core_donations.rb
|
296
300
|
- db/migrate/20210717032602_create_cats_core_gift_certificates.rb
|
297
301
|
- db/migrate/20210717032855_create_cats_core_purchase_orders.rb
|
@@ -325,6 +329,7 @@ files:
|
|
325
329
|
- spec/factories/cats/core/donations.rb
|
326
330
|
- spec/factories/cats/core/donors.rb
|
327
331
|
- spec/factories/cats/core/gift_certificates.rb
|
332
|
+
- spec/factories/cats/core/hrp_item_details.rb
|
328
333
|
- spec/factories/cats/core/hrp_items.rb
|
329
334
|
- spec/factories/cats/core/hrps.rb
|
330
335
|
- spec/factories/cats/core/locations.rb
|
@@ -334,6 +339,7 @@ files:
|
|
334
339
|
- spec/factories/cats/core/operators.rb
|
335
340
|
- spec/factories/cats/core/programs.rb
|
336
341
|
- spec/factories/cats/core/purchase_orders.rb
|
342
|
+
- spec/factories/cats/core/ration_items.rb
|
337
343
|
- spec/factories/cats/core/rations.rb
|
338
344
|
- spec/factories/cats/core/receipt_transactions.rb
|
339
345
|
- spec/factories/cats/core/receipts.rb
|