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.
- checksums.yaml +4 -4
- data/app/controllers/cats/core/cash_donations_controller.rb +19 -0
- data/app/controllers/cats/core/commodity_donations_controller.rb +22 -0
- data/app/controllers/cats/core/dispatch_plans_controller.rb +24 -0
- data/app/controllers/cats/core/loans_controller.rb +20 -0
- data/app/controllers/cats/core/purchase_orders_controller.rb +24 -0
- data/app/controllers/cats/core/round_beneficiaries_controller.rb +49 -0
- data/app/controllers/cats/core/swaps_controller.rb +21 -0
- data/app/models/cats/core/beneficiary.rb +9 -0
- data/app/models/cats/core/cash_donation.rb +11 -0
- data/app/models/cats/core/commodity_donation.rb +15 -0
- data/app/models/cats/core/dispatch_plan.rb +1 -1
- data/app/models/cats/core/donation.rb +2 -16
- data/app/models/cats/core/gift_certificate.rb +3 -23
- data/app/models/cats/core/loan.rb +15 -0
- data/app/models/cats/core/plan.rb +4 -0
- data/app/models/cats/core/purchase_order.rb +5 -13
- data/app/models/cats/core/rhn_request.rb +4 -4
- data/app/models/cats/core/round_beneficiary.rb +16 -0
- data/app/models/cats/core/round_plan.rb +2 -4
- data/app/models/cats/core/round_plan_item.rb +1 -0
- data/app/models/cats/core/swap.rb +19 -0
- data/app/models/concerns/cats/core/dispatchable.rb +8 -0
- data/app/serializers/cats/core/cash_donation_serializer.rb +8 -0
- data/app/serializers/cats/core/commodity_donation_serializer.rb +9 -0
- data/app/serializers/cats/core/loan_serializer.rb +8 -0
- data/app/serializers/cats/core/purchase_order_serializer.rb +9 -0
- data/app/serializers/cats/core/round_beneficiary_serializer.rb +8 -0
- data/app/serializers/cats/core/swap_serializer.rb +9 -0
- data/app/services/cats/core/beneficiary_service.rb +87 -0
- data/app/services/cats/core/dispatch_plan_service.rb +79 -0
- data/config/routes.rb +19 -0
- data/db/migrate/20210717032330_create_cats_core_commodity_donations.rb +29 -0
- data/db/migrate/20210717032408_create_cats_core_cash_donations.rb +20 -0
- data/db/migrate/20210717032602_create_cats_core_gift_certificates.rb +2 -8
- data/db/migrate/20210717032855_create_cats_core_purchase_orders.rb +9 -5
- data/db/migrate/20220511082354_create_cats_core_beneficiaries.rb +4 -0
- data/db/migrate/20220626063501_create_cats_core_loans.rb +21 -0
- data/db/migrate/20220626063757_create_cats_core_swaps.rb +29 -0
- data/db/migrate/20220626132050_create_cats_core_round_beneficiaries.rb +26 -0
- data/lib/cats/core/version.rb +1 -1
- data/spec/factories/cats/core/beneficiaries.rb +1 -0
- data/spec/factories/cats/core/cash_donations.rb +10 -0
- data/spec/factories/cats/core/{donations.rb → commodity_donations.rb} +3 -6
- data/spec/factories/cats/core/gift_certificates.rb +5 -6
- data/spec/factories/cats/core/loans.rb +11 -0
- data/spec/factories/cats/core/projects.rb +1 -1
- data/spec/factories/cats/core/purchase_orders.rb +3 -1
- data/spec/factories/cats/core/round_beneficiaries.rb +10 -0
- data/spec/factories/cats/core/swaps.rb +13 -0
- metadata +33 -7
- 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
|