cats_core 1.4.13 → 1.4.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/cats/core/{monthly_plans_controller.rb → round_plans_controller.rb} +11 -10
  3. data/app/models/cats/core/beneficiary.rb +15 -0
  4. data/app/models/cats/core/beneficiary_category.rb +11 -0
  5. data/app/models/cats/core/beneficiary_plan_item.rb +12 -0
  6. data/app/models/cats/core/beneficiary_round_plan_item.rb +14 -0
  7. data/app/models/cats/core/plan.rb +5 -2
  8. data/app/models/cats/core/plan_item.rb +10 -3
  9. data/app/models/cats/core/plan_item_detail.rb +4 -4
  10. data/app/models/cats/core/ration.rb +8 -1
  11. data/app/models/cats/core/{monthly_plan.rb → round_plan.rb} +22 -11
  12. data/app/models/cats/core/round_plan_item.rb +25 -0
  13. data/app/models/cats/core/round_plan_item_detail.rb +11 -0
  14. data/app/models/cats/core/round_ration.rb +17 -0
  15. data/app/serializers/cats/core/round_plan_serializer.rb +7 -0
  16. data/app/services/cats/core/round_plan_service.rb +108 -0
  17. data/config/routes.rb +5 -5
  18. data/db/migrate/20210717031810_create_cats_core_plans.rb +0 -4
  19. data/db/migrate/20210717032024_create_cats_core_plan_items.rb +13 -2
  20. data/db/migrate/20210717032260_create_cats_core_beneficiary_categories.rb +14 -0
  21. data/db/migrate/{20210717031343_create_cats_core_ration_items.rb → 20210717032270_create_cats_core_rations.rb} +9 -8
  22. data/db/migrate/20210717032290_create_cats_core_beneficiary_plan_items.rb +23 -0
  23. data/db/migrate/20210717032295_create_cats_core_plan_item_details.rb +18 -0
  24. data/db/migrate/{20220107121752_create_cats_core_monthly_plans.rb → 20220107121752_create_cats_core_round_plans.rb} +3 -4
  25. data/db/migrate/20220107122280_create_cats_core_round_rations.rb +26 -0
  26. data/db/migrate/20220107125025_create_cats_core_round_plan_items.rb +33 -0
  27. data/db/migrate/20220107126025_create_cats_core_beneficiary_round_plan_items.rb +24 -0
  28. data/db/migrate/20220107132433_create_cats_core_round_plan_item_details.rb +17 -0
  29. data/db/migrate/20220511082354_create_cats_core_beneficiaries.rb +16 -0
  30. data/lib/cats/core/version.rb +1 -1
  31. data/spec/factories/cats/core/beneficiaries.rb +9 -0
  32. data/spec/factories/cats/core/beneficiary_categories.rb +7 -0
  33. data/spec/factories/cats/core/beneficiary_plan_items.rb +7 -0
  34. data/spec/factories/cats/core/beneficiary_round_plan_items.rb +8 -0
  35. data/spec/factories/cats/core/dispatch_plans.rb +3 -3
  36. data/spec/factories/cats/core/locations.rb +4 -4
  37. data/spec/factories/cats/core/plan_item_details.rb +3 -3
  38. data/spec/factories/cats/core/plan_items.rb +4 -2
  39. data/spec/factories/cats/core/plans.rb +0 -1
  40. data/spec/factories/cats/core/rations.rb +5 -2
  41. data/spec/factories/cats/core/round_plan_item_details.rb +7 -0
  42. data/spec/factories/cats/core/round_plan_items.rb +11 -0
  43. data/spec/factories/cats/core/{monthly_plans.rb → round_plans.rb} +2 -3
  44. data/spec/factories/cats/core/round_rations.rb +10 -0
  45. metadata +31 -22
  46. data/app/models/cats/core/monthly_plan_item.rb +0 -15
  47. data/app/models/cats/core/monthly_plan_item_detail.rb +0 -14
  48. data/app/models/cats/core/monthly_ration.rb +0 -15
  49. data/app/models/cats/core/ration_item.rb +0 -14
  50. data/app/serializers/cats/core/monthly_plan_serializer.rb +0 -8
  51. data/app/services/cats/core/monthly_plan_service.rb +0 -86
  52. data/db/migrate/20210717031216_create_cats_core_rations.rb +0 -14
  53. data/db/migrate/20210717032240_create_cats_core_plan_item_details.rb +0 -18
  54. data/db/migrate/20220107124630_create_cats_core_monthly_rations.rb +0 -22
  55. data/db/migrate/20220107125025_create_cats_core_monthly_plan_items.rb +0 -17
  56. data/db/migrate/20220107132433_create_cats_core_monthly_plan_item_details.rb +0 -17
  57. data/spec/factories/cats/core/monthly_plan_item_details.rb +0 -7
  58. data/spec/factories/cats/core/monthly_plan_items.rb +0 -7
  59. data/spec/factories/cats/core/monthly_rations.rb +0 -9
  60. data/spec/factories/cats/core/ration_items.rb +0 -9
@@ -1,22 +0,0 @@
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,17 +0,0 @@
1
- class CreateCatsCoreMonthlyPlanItems < ActiveRecord::Migration[6.1]
2
- def change
3
- create_table :cats_core_monthly_plan_items do |t|
4
- t.references :monthly_plan,
5
- null: false,
6
- index: { name: 'mp_on_mpi_indx' },
7
- foreign_key: { to_table: :cats_core_monthly_plans }
8
- t.integer :beneficiaries, null: false
9
- t.references :plan_item,
10
- null: false,
11
- index: { name: 'pi_on_mpi_indx' },
12
- foreign_key: { to_table: :cats_core_plan_items }
13
-
14
- t.timestamps
15
- end
16
- end
17
- end
@@ -1,17 +0,0 @@
1
- class CreateCatsCoreMonthlyPlanItemDetails < ActiveRecord::Migration[6.1]
2
- def change
3
- create_table :cats_core_monthly_plan_item_details do |t|
4
- t.references :monthly_plan_item,
5
- null: false,
6
- index: { name: 'mpi_on_mpid_indx' },
7
- foreign_key: { to_table: :cats_core_monthly_plan_items }
8
- t.references :monthly_ration,
9
- null: false,
10
- index: { name: 'ri_on_mr_indx' },
11
- foreign_key: { to_table: :cats_core_monthly_rations }
12
- t.float :amount, null: false
13
-
14
- t.timestamps
15
- end
16
- end
17
- end
@@ -1,7 +0,0 @@
1
- FactoryBot.define do
2
- factory :monthly_plan_item_detail, class: 'Cats::Core::MonthlyPlanItemDetail' do
3
- monthly_plan_item
4
- monthly_ration
5
- amount { 150 }
6
- end
7
- end
@@ -1,7 +0,0 @@
1
- FactoryBot.define do
2
- factory :monthly_plan_item, class: 'Cats::Core::MonthlyPlanItem' do
3
- monthly_plan
4
- beneficiaries { 100 }
5
- plan_item
6
- end
7
- end
@@ -1,9 +0,0 @@
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
@@ -1,9 +0,0 @@
1
- FactoryBot.define do
2
- factory :ration_item, class: 'Cats::Core::RationItem' do
3
- commodity_category
4
- ration
5
- amount { 150 }
6
- unit_of_measure
7
- no_of_days { 1 }
8
- end
9
- end