cats_core 1.4.41 → 1.4.44

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/cats/core/cash_donations_controller.rb +19 -0
  3. data/app/controllers/cats/core/commodity_donations_controller.rb +22 -0
  4. data/app/controllers/cats/core/dispatch_plans_controller.rb +24 -0
  5. data/app/controllers/cats/core/loans_controller.rb +20 -0
  6. data/app/controllers/cats/core/purchase_orders_controller.rb +24 -0
  7. data/app/controllers/cats/core/round_beneficiaries_controller.rb +49 -0
  8. data/app/controllers/cats/core/swaps_controller.rb +21 -0
  9. data/app/models/cats/core/beneficiary.rb +9 -0
  10. data/app/models/cats/core/cash_donation.rb +11 -0
  11. data/app/models/cats/core/commodity_donation.rb +15 -0
  12. data/app/models/cats/core/dispatch_plan.rb +1 -1
  13. data/app/models/cats/core/donation.rb +2 -16
  14. data/app/models/cats/core/gift_certificate.rb +3 -23
  15. data/app/models/cats/core/loan.rb +15 -0
  16. data/app/models/cats/core/plan.rb +4 -0
  17. data/app/models/cats/core/purchase_order.rb +5 -13
  18. data/app/models/cats/core/rhn_request.rb +4 -4
  19. data/app/models/cats/core/round_beneficiary.rb +16 -0
  20. data/app/models/cats/core/round_plan.rb +2 -4
  21. data/app/models/cats/core/round_plan_item.rb +1 -0
  22. data/app/models/cats/core/swap.rb +19 -0
  23. data/app/models/concerns/cats/core/dispatchable.rb +8 -0
  24. data/app/serializers/cats/core/cash_donation_serializer.rb +8 -0
  25. data/app/serializers/cats/core/commodity_donation_serializer.rb +9 -0
  26. data/app/serializers/cats/core/loan_serializer.rb +8 -0
  27. data/app/serializers/cats/core/purchase_order_serializer.rb +9 -0
  28. data/app/serializers/cats/core/round_beneficiary_serializer.rb +8 -0
  29. data/app/serializers/cats/core/swap_serializer.rb +9 -0
  30. data/app/services/cats/core/beneficiary_service.rb +87 -0
  31. data/app/services/cats/core/dispatch_plan_service.rb +79 -0
  32. data/config/routes.rb +19 -0
  33. data/db/migrate/20210717032330_create_cats_core_commodity_donations.rb +29 -0
  34. data/db/migrate/20210717032408_create_cats_core_cash_donations.rb +20 -0
  35. data/db/migrate/20210717032602_create_cats_core_gift_certificates.rb +2 -8
  36. data/db/migrate/20210717032855_create_cats_core_purchase_orders.rb +9 -5
  37. data/db/migrate/20220511082354_create_cats_core_beneficiaries.rb +4 -0
  38. data/db/migrate/20220626063501_create_cats_core_loans.rb +21 -0
  39. data/db/migrate/20220626063757_create_cats_core_swaps.rb +29 -0
  40. data/db/migrate/20220626132050_create_cats_core_round_beneficiaries.rb +26 -0
  41. data/lib/cats/core/version.rb +1 -1
  42. data/spec/factories/cats/core/beneficiaries.rb +1 -0
  43. data/spec/factories/cats/core/cash_donations.rb +10 -0
  44. data/spec/factories/cats/core/{donations.rb → commodity_donations.rb} +3 -6
  45. data/spec/factories/cats/core/gift_certificates.rb +5 -6
  46. data/spec/factories/cats/core/loans.rb +11 -0
  47. data/spec/factories/cats/core/projects.rb +1 -1
  48. data/spec/factories/cats/core/purchase_orders.rb +3 -1
  49. data/spec/factories/cats/core/round_beneficiaries.rb +10 -0
  50. data/spec/factories/cats/core/swaps.rb +13 -0
  51. metadata +33 -7
  52. data/db/migrate/20210717032330_create_cats_core_donations.rb +0 -35
@@ -1,35 +0,0 @@
1
- class CreateCatsCoreDonations < ActiveRecord::Migration[6.1]
2
- def change
3
- create_table :cats_core_donations do |t|
4
- t.string :reference_no, unique: true
5
- t.string :description
6
- t.string :donation_type, null: false
7
- t.string :shipping_reference
8
- t.date :donated_on, null: false
9
- t.references :donor,
10
- null: false,
11
- index: { name: 'donor_on_donation_indx' },
12
- foreign_key: { to_table: :cats_core_donors }
13
- t.references :plan,
14
- null: true,
15
- index: { name: 'plan_on_donation_indx' },
16
- foreign_key: { to_table: :cats_core_plans }
17
- t.float :amount, null: false
18
- t.references :currency,
19
- null: true,
20
- index: { name: 'currency_on_donation_indx' },
21
- foreign_key: { to_table: :cats_core_currencies }
22
- t.references :commodity_category,
23
- null: true,
24
- index: { name: 'cc_on_donation_indx' },
25
- foreign_key: { to_table: :cats_core_commodity_categories }
26
- t.references :unit_of_measure,
27
- null: true,
28
- index: { name: 'uom_on_donation_indx' },
29
- foreign_key: { to_table: :cats_core_unit_of_measures }
30
- t.boolean :active, null: false, default: false
31
-
32
- t.timestamps
33
- end
34
- end
35
- end