cats_core 1.5.16 → 1.5.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +7 -7
- data/app/controllers/cats/core/access_controller.rb +4 -4
- data/app/controllers/cats/core/application_controller.rb +4 -4
- data/app/controllers/cats/core/commodities_controller.rb +7 -7
- data/app/controllers/cats/core/commodity_categories_controller.rb +4 -4
- data/app/controllers/cats/core/dispatch_authorizations_controller.rb +30 -7
- data/app/controllers/cats/core/dispatch_plan_items_controller.rb +4 -4
- data/app/controllers/cats/core/dispatch_plans_controller.rb +10 -10
- data/app/controllers/cats/core/dispatch_transactions_controller.rb +5 -5
- data/app/controllers/cats/core/dispatches_controller.rb +19 -19
- data/app/controllers/cats/core/loans_controller.rb +1 -1
- data/app/controllers/cats/core/locations_controller.rb +4 -4
- data/app/controllers/cats/core/menus_controller.rb +1 -1
- data/app/controllers/cats/core/notifications_controller.rb +5 -5
- data/app/controllers/cats/core/purchase_orders_controller.rb +3 -3
- data/app/controllers/cats/core/receipt_authorizations_controller.rb +30 -18
- data/app/controllers/cats/core/receipt_transactions_controller.rb +4 -4
- data/app/controllers/cats/core/receipts_controller.rb +1 -1
- data/app/controllers/cats/core/roles_controller.rb +3 -3
- data/app/controllers/cats/core/round_beneficiaries_controller.rb +13 -13
- data/app/controllers/cats/core/round_plans_controller.rb +13 -13
- data/app/controllers/cats/core/routes_controller.rb +2 -2
- data/app/controllers/cats/core/spaces_controller.rb +1 -1
- data/app/controllers/cats/core/stack_transactions_controller.rb +3 -3
- data/app/controllers/cats/core/stacks_controller.rb +15 -7
- data/app/controllers/cats/core/stores_controller.rb +14 -14
- data/app/controllers/cats/core/swaps_controller.rb +2 -2
- data/app/controllers/cats/core/transporters_controller.rb +1 -1
- data/app/controllers/cats/core/users_controller.rb +24 -12
- data/app/controllers/concerns/cats/core/common.rb +24 -23
- data/app/helpers/cats/core/document_helper.rb +1 -1
- data/app/models/cats/core/authorization.rb +9 -9
- data/app/models/cats/core/beneficiary.rb +6 -6
- data/app/models/cats/core/beneficiary_plan_item.rb +9 -9
- data/app/models/cats/core/beneficiary_round_plan_item.rb +2 -2
- data/app/models/cats/core/cash_donation.rb +1 -1
- data/app/models/cats/core/commodity.rb +47 -33
- data/app/models/cats/core/commodity_donation.rb +2 -2
- data/app/models/cats/core/commodity_substitution.rb +15 -7
- data/app/models/cats/core/contract_item.rb +2 -2
- data/app/models/cats/core/dispatch.rb +36 -21
- data/app/models/cats/core/dispatch_authorization.rb +31 -5
- data/app/models/cats/core/dispatch_plan.rb +19 -10
- data/app/models/cats/core/dispatch_plan_item.rb +27 -14
- data/app/models/cats/core/dispatch_transaction.rb +15 -5
- data/app/models/cats/core/gift_certificate.rb +3 -3
- data/app/models/cats/core/hub_authorization.rb +7 -7
- data/app/models/cats/core/loan.rb +2 -2
- data/app/models/cats/core/location.rb +12 -8
- data/app/models/cats/core/lost_commodity.rb +2 -2
- data/app/models/cats/core/notification.rb +2 -2
- data/app/models/cats/core/offer_item.rb +4 -4
- data/app/models/cats/core/plan.rb +9 -9
- data/app/models/cats/core/plan_item.rb +5 -5
- data/app/models/cats/core/plan_item_detail.rb +2 -2
- data/app/models/cats/core/project.rb +1 -1
- data/app/models/cats/core/purchase_order.rb +5 -5
- data/app/models/cats/core/ration.rb +1 -1
- data/app/models/cats/core/receipt.rb +5 -5
- data/app/models/cats/core/receipt_authorization.rb +6 -2
- data/app/models/cats/core/receipt_transaction.rb +8 -4
- data/app/models/cats/core/rhn_request.rb +8 -8
- data/app/models/cats/core/role_menu.rb +1 -1
- data/app/models/cats/core/round_beneficiary.rb +10 -2
- data/app/models/cats/core/round_plan.rb +15 -11
- data/app/models/cats/core/round_plan_item.rb +9 -5
- data/app/models/cats/core/round_plan_item_detail.rb +3 -3
- data/app/models/cats/core/round_ration.rb +2 -2
- data/app/models/cats/core/route.rb +12 -8
- data/app/models/cats/core/stack.rb +52 -34
- data/app/models/cats/core/stack_transaction.rb +3 -3
- data/app/models/cats/core/stacking_rule.rb +2 -2
- data/app/models/cats/core/store.rb +29 -7
- data/app/models/cats/core/swap.rb +5 -5
- data/app/models/cats/core/transaction.rb +6 -6
- data/app/models/cats/core/transport_bid.rb +13 -13
- data/app/models/cats/core/transport_bid_item.rb +2 -2
- data/app/models/cats/core/transport_offer.rb +3 -3
- data/app/models/cats/core/transport_order.rb +8 -8
- data/app/models/cats/core/transport_order_item.rb +2 -2
- data/app/models/cats/core/transport_plan.rb +7 -7
- data/app/models/cats/core/transport_plan_item.rb +2 -2
- data/app/models/cats/core/transport_requisition.rb +9 -9
- data/app/models/cats/core/transport_requisition_detail.rb +2 -2
- data/app/models/cats/core/transport_requisition_item.rb +3 -3
- data/app/models/cats/core/transporter.rb +4 -0
- data/app/models/cats/core/unit_conversion.rb +4 -4
- data/app/models/cats/core/unit_of_measure.rb +4 -4
- data/app/models/cats/core/user.rb +11 -11
- data/app/models/concerns/cats/core/dispatchable.rb +3 -3
- data/app/notifications/cats/core/allocation_notification.rb +1 -1
- data/app/notifications/cats/core/dispatch_authorization_notification.rb +35 -0
- data/app/notifications/cats/core/dispatch_notification.rb +1 -1
- data/app/notifications/cats/core/receipt_authorization_notification.rb +1 -1
- data/app/notifications/cats/core/round_plan_notification.rb +1 -1
- data/app/notifications/cats/core/simple_notification.rb +1 -1
- data/app/serializers/cats/core/cash_donation_serializer.rb +1 -1
- data/app/serializers/cats/core/commodity_donation_serializer.rb +2 -2
- data/app/serializers/cats/core/commodity_serializer.rb +2 -2
- data/app/serializers/cats/core/dispatch_authorization_serializer.rb +2 -2
- data/app/serializers/cats/core/dispatch_plan_item_serializer.rb +3 -3
- data/app/serializers/cats/core/dispatch_plan_serializer.rb +1 -1
- data/app/serializers/cats/core/dispatch_serializer.rb +2 -2
- data/app/serializers/cats/core/dispatch_transaction_serializer.rb +1 -1
- data/app/serializers/cats/core/loan_serializer.rb +1 -1
- data/app/serializers/cats/core/purchase_order_serializer.rb +2 -2
- data/app/serializers/cats/core/receipt_authorization_serializer.rb +2 -2
- data/app/serializers/cats/core/receipt_serializer.rb +1 -1
- data/app/serializers/cats/core/receipt_transaction_serializer.rb +2 -2
- data/app/serializers/cats/core/round_beneficiary_serializer.rb +1 -1
- data/app/serializers/cats/core/round_plan_serializer.rb +1 -1
- data/app/serializers/cats/core/stack_serializer.rb +1 -1
- data/app/serializers/cats/core/store_serializer.rb +1 -1
- data/app/serializers/cats/core/swap_serializer.rb +2 -2
- data/app/services/cats/core/authorization_service.rb +36 -18
- data/app/services/cats/core/beneficiary_service.rb +11 -11
- data/app/services/cats/core/dispatch_plan_service.rb +10 -10
- data/app/services/cats/core/dispatch_service.rb +31 -31
- data/app/services/cats/core/notification_service.rb +5 -5
- data/app/services/cats/core/round_plan_service.rb +23 -23
- data/app/services/cats/core/space_service.rb +11 -11
- data/app/services/cats/core/stack_service.rb +10 -10
- data/app/services/cats/core/token_auth_service.rb +4 -4
- data/app/services/cats/core/user_service.rb +19 -0
- data/app/utils/cats/core/util.rb +1 -1
- data/config/routes.rb +110 -105
- data/config/spring.rb +1 -0
- data/db/migrate/20210715114910_create_cats_core_users.rb +3 -3
- data/db/migrate/20210715120018_create_cats_core_roles.rb +14 -14
- data/db/migrate/20210715121244_create_cats_core_menus.rb +3 -3
- data/db/migrate/20210715122141_create_cats_core_menu_items.rb +3 -3
- data/db/migrate/20210715122423_create_cats_core_role_menus.rb +13 -13
- data/db/migrate/20210717031810_create_cats_core_plans.rb +4 -4
- data/db/migrate/20210717032024_create_cats_core_plan_items.rb +18 -18
- data/db/migrate/20210717032260_create_cats_core_beneficiary_categories.rb +3 -3
- data/db/migrate/20210717032270_create_cats_core_rations.rb +10 -10
- data/db/migrate/20210717032290_create_cats_core_beneficiary_plan_items.rb +7 -7
- data/db/migrate/20210717032295_create_cats_core_plan_item_details.rb +7 -7
- data/db/migrate/20210717032330_create_cats_core_commodity_donations.rb +12 -12
- data/db/migrate/20210717032408_create_cats_core_cash_donations.rb +6 -6
- data/db/migrate/20210717032602_create_cats_core_gift_certificates.rb +12 -12
- data/db/migrate/20210717032855_create_cats_core_purchase_orders.rb +12 -12
- data/db/migrate/20210717032927_create_cats_core_projects.rb +3 -3
- data/db/migrate/20210717033223_create_cats_core_commodities.rb +10 -10
- data/db/migrate/20210717140855_create_cats_core_stores.rb +3 -3
- data/db/migrate/20210717171101_create_cats_core_stacks.rb +11 -11
- data/db/migrate/20210718040129_create_cats_core_routes.rb +9 -9
- data/db/migrate/20210718042755_create_cats_core_rhn_requests.rb +6 -6
- data/db/migrate/20210718043328_create_cats_core_dispatch_plans.rb +7 -7
- data/db/migrate/20210718043401_create_cats_core_dispatch_plan_items.rb +17 -17
- data/db/migrate/20210718045516_create_cats_core_dispatches.rb +13 -13
- data/db/migrate/20210718055414_create_cats_core_dispatch_authorizations.rb +13 -13
- data/db/migrate/20210718202957_create_cats_core_dispatch_transactions.rb +11 -11
- data/db/migrate/20210727074646_create_cats_core_receipt_authorizations.rb +13 -13
- data/db/migrate/20210727105834_create_cats_core_receipts.rb +6 -6
- data/db/migrate/20210728041505_create_cats_core_lost_commodities.rb +6 -6
- data/db/migrate/20210814160628_create_cats_core_receipt_transactions.rb +10 -10
- data/db/migrate/20210814175406_create_cats_core_stack_transactions.rb +10 -10
- data/db/migrate/20211024063240_add_status_to_cats_core_rhn_requests.rb +1 -1
- data/db/migrate/20211030133752_add_status_to_cats_core_commodities.rb +1 -1
- data/db/migrate/20211215114737_create_cats_core_transport_plans.rb +4 -4
- data/db/migrate/20211215114835_create_cats_core_transport_plan_items.rb +9 -9
- data/db/migrate/20211215121151_create_cats_core_transport_bids.rb +4 -4
- data/db/migrate/20211215124452_create_cats_core_transport_bid_items.rb +10 -10
- data/db/migrate/20211229160125_create_cats_core_transport_offers.rb +7 -7
- data/db/migrate/20211229160126_create_cats_core_offer_items.rb +6 -6
- data/db/migrate/20211229160127_create_cats_core_transport_contracts.rb +6 -6
- data/db/migrate/20211229160128_create_cats_core_contract_items.rb +9 -9
- data/db/migrate/20211229160129_create_cats_core_commodity_substitutions.rb +10 -10
- data/db/migrate/20220103152802_create_cats_core_tenderers.rb +6 -6
- data/db/migrate/20220107121752_create_cats_core_round_plans.rb +7 -7
- data/db/migrate/20220107122280_create_cats_core_round_rations.rb +12 -12
- data/db/migrate/20220107125025_create_cats_core_round_plan_items.rb +19 -19
- data/db/migrate/20220107126025_create_cats_core_beneficiary_round_plan_items.rb +8 -8
- data/db/migrate/20220107132433_create_cats_core_round_plan_item_details.rb +9 -9
- data/db/migrate/20220209083928_create_cats_core_hub_authorizations.rb +12 -12
- data/db/migrate/20220416143416_create_cats_core_unit_conversions.rb +6 -6
- data/db/migrate/20220417105839_create_cats_core_transport_requisitions.rb +12 -12
- data/db/migrate/20220417123835_create_cats_core_transport_requisition_items.rb +9 -9
- data/db/migrate/20220417151821_create_cats_core_transport_requisition_details.rb +6 -6
- data/db/migrate/20220506082329_create_cats_core_transport_orders.rb +10 -10
- data/db/migrate/20220506083042_create_cats_core_transport_order_items.rb +13 -13
- data/db/migrate/20220511082354_create_cats_core_beneficiaries.rb +6 -6
- data/db/migrate/20220626063501_create_cats_core_loans.rb +6 -6
- data/db/migrate/20220626063757_create_cats_core_swaps.rb +12 -12
- data/db/migrate/20220626132050_create_cats_core_round_beneficiaries.rb +13 -13
- data/db/migrate/20220923190857_create_cats_core_application_settings.rb +3 -3
- data/lib/cats/core/engine.rb +4 -4
- data/lib/cats/core/version.rb +1 -1
- data/lib/cats_core.rb +8 -8
- data/spec/factories/cats/core/application_modules.rb +1 -1
- data/spec/factories/cats/core/application_settings.rb +1 -1
- data/spec/factories/cats/core/beneficiaries.rb +3 -3
- data/spec/factories/cats/core/beneficiary_categories.rb +1 -1
- data/spec/factories/cats/core/beneficiary_plan_items.rb +1 -1
- data/spec/factories/cats/core/beneficiary_round_plan_items.rb +1 -1
- data/spec/factories/cats/core/cash_donations.rb +1 -1
- data/spec/factories/cats/core/commodities.rb +1 -1
- data/spec/factories/cats/core/commodity_categories.rb +1 -1
- data/spec/factories/cats/core/commodity_donations.rb +1 -1
- data/spec/factories/cats/core/commodity_substitutions.rb +2 -2
- data/spec/factories/cats/core/contract_items.rb +1 -1
- data/spec/factories/cats/core/currencies.rb +1 -1
- data/spec/factories/cats/core/dispatch_authorizations.rb +7 -11
- data/spec/factories/cats/core/dispatch_plan_items.rb +16 -1
- data/spec/factories/cats/core/dispatch_plans.rb +1 -1
- data/spec/factories/cats/core/dispatch_transactions.rb +2 -4
- data/spec/factories/cats/core/dispatches.rb +16 -25
- data/spec/factories/cats/core/donors.rb +1 -1
- data/spec/factories/cats/core/gift_certificates.rb +1 -1
- data/spec/factories/cats/core/hub_authorizations.rb +1 -1
- data/spec/factories/cats/core/loans.rb +1 -1
- data/spec/factories/cats/core/locations.rb +6 -6
- data/spec/factories/cats/core/lost_commodities.rb +1 -1
- data/spec/factories/cats/core/menu_items.rb +1 -1
- data/spec/factories/cats/core/menus.rb +1 -1
- data/spec/factories/cats/core/notification_rules.rb +1 -1
- data/spec/factories/cats/core/notifications.rb +2 -2
- data/spec/factories/cats/core/offer_items.rb +1 -1
- data/spec/factories/cats/core/operators.rb +1 -1
- data/spec/factories/cats/core/plan_item_details.rb +1 -1
- data/spec/factories/cats/core/plan_items.rb +1 -1
- data/spec/factories/cats/core/plans.rb +1 -1
- data/spec/factories/cats/core/programs.rb +1 -1
- data/spec/factories/cats/core/projects.rb +1 -1
- data/spec/factories/cats/core/purchase_orders.rb +1 -1
- data/spec/factories/cats/core/rations.rb +1 -1
- data/spec/factories/cats/core/receipt_authorizations.rb +1 -1
- data/spec/factories/cats/core/receipt_transactions.rb +2 -2
- data/spec/factories/cats/core/receipts.rb +1 -1
- data/spec/factories/cats/core/rhn_requests.rb +1 -1
- data/spec/factories/cats/core/role_menus.rb +1 -1
- data/spec/factories/cats/core/roles.rb +1 -1
- data/spec/factories/cats/core/round_beneficiaries.rb +1 -1
- data/spec/factories/cats/core/round_plan_item_details.rb +3 -3
- data/spec/factories/cats/core/round_plan_items.rb +1 -1
- data/spec/factories/cats/core/round_plans.rb +1 -1
- data/spec/factories/cats/core/round_rations.rb +1 -1
- data/spec/factories/cats/core/routes.rb +1 -1
- data/spec/factories/cats/core/stack_transactions.rb +1 -1
- data/spec/factories/cats/core/stacking_rules.rb +1 -1
- data/spec/factories/cats/core/stacks.rb +1 -1
- data/spec/factories/cats/core/stores.rb +1 -1
- data/spec/factories/cats/core/suppliers.rb +1 -1
- data/spec/factories/cats/core/swaps.rb +1 -1
- data/spec/factories/cats/core/tenderers.rb +1 -1
- data/spec/factories/cats/core/transport_bid_items.rb +1 -1
- data/spec/factories/cats/core/transport_bids.rb +1 -1
- data/spec/factories/cats/core/transport_contracts.rb +1 -1
- data/spec/factories/cats/core/transport_offers.rb +1 -1
- data/spec/factories/cats/core/transport_order_items.rb +1 -1
- data/spec/factories/cats/core/transport_orders.rb +1 -1
- data/spec/factories/cats/core/transport_plan_items.rb +1 -1
- data/spec/factories/cats/core/transport_plans.rb +1 -1
- data/spec/factories/cats/core/transport_requisition_details.rb +1 -1
- data/spec/factories/cats/core/transport_requisition_items.rb +1 -1
- data/spec/factories/cats/core/transport_requisitions.rb +1 -1
- data/spec/factories/cats/core/transporters.rb +1 -1
- data/spec/factories/cats/core/unit_conversions.rb +1 -1
- data/spec/factories/cats/core/unit_of_measures.rb +1 -1
- data/spec/factories/cats/core/users.rb +2 -2
- metadata +19 -2
@@ -2,20 +2,20 @@ class CreateCatsCoreStackTransactions < ActiveRecord::Migration[6.1]
|
|
2
2
|
def change
|
3
3
|
create_table :cats_core_stack_transactions do |t|
|
4
4
|
t.references :source,
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
null: false,
|
6
|
+
index: {name: "source_on_st_indx"},
|
7
|
+
foreign_key: {to_table: :cats_core_stacks}
|
8
8
|
t.references :destination,
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
null: false,
|
10
|
+
index: {name: "destination_on_st_indx"},
|
11
|
+
foreign_key: {to_table: :cats_core_stacks}
|
12
12
|
t.date :transaction_date, null: false
|
13
13
|
t.float :quantity, null: false
|
14
14
|
t.references :unit,
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
t.string :status, null: false, default:
|
15
|
+
null: false,
|
16
|
+
index: {name: "unit_on_st_indx"},
|
17
|
+
foreign_key: {to_table: :cats_core_unit_of_measures}
|
18
|
+
t.string :status, null: false, default: "Draft"
|
19
19
|
|
20
20
|
t.timestamps
|
21
21
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class AddStatusToCatsCoreCommodities < ActiveRecord::Migration[6.1]
|
2
2
|
def change
|
3
|
-
add_column :cats_core_commodities, :status, :string, null: false, default:
|
3
|
+
add_column :cats_core_commodities, :status, :string, null: false, default: "Draft"
|
4
4
|
remove_column :cats_core_commodities, :approved, :boolean
|
5
5
|
end
|
6
6
|
end
|
@@ -2,11 +2,11 @@ class CreateCatsCoreTransportPlans < ActiveRecord::Migration[6.1]
|
|
2
2
|
def change
|
3
3
|
create_table :cats_core_transport_plans do |t|
|
4
4
|
t.string :reference_no, unique: true
|
5
|
-
t.string :plan_type, null: false, default:
|
5
|
+
t.string :plan_type, null: false, default: "Regional"
|
6
6
|
t.references :region,
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
null: true,
|
8
|
+
index: {name: "region_on_tp_indx"},
|
9
|
+
foreign_key: {to_table: :cats_core_locations}
|
10
10
|
|
11
11
|
t.timestamps
|
12
12
|
end
|
@@ -2,18 +2,18 @@ class CreateCatsCoreTransportPlanItems < ActiveRecord::Migration[6.1]
|
|
2
2
|
def change
|
3
3
|
create_table :cats_core_transport_plan_items do |t|
|
4
4
|
t.references :route,
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
null: false,
|
6
|
+
index: {name: "route_on_tpi_indx"},
|
7
|
+
foreign_key: {to_table: :cats_core_routes}
|
8
8
|
t.references :transport_plan,
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
null: false,
|
10
|
+
index: {name: "tp_on_tpi_indx"},
|
11
|
+
foreign_key: {to_table: :cats_core_transport_plans}
|
12
12
|
t.float :quantity, null: false
|
13
13
|
t.references :unit,
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
null: false,
|
15
|
+
index: {name: "unit_on_tpi_indx"},
|
16
|
+
foreign_key: {to_table: :cats_core_unit_of_measures}
|
17
17
|
t.boolean :planned, null: false, default: false
|
18
18
|
|
19
19
|
t.timestamps
|
@@ -6,12 +6,12 @@ class CreateCatsCoreTransportBids < ActiveRecord::Migration[6.1]
|
|
6
6
|
t.datetime :start_date, null: false
|
7
7
|
t.datetime :end_date, null: false
|
8
8
|
t.datetime :opening_date, null: false
|
9
|
-
t.string :status, null: false, default:
|
9
|
+
t.string :status, null: false, default: "New"
|
10
10
|
t.float :bid_bond_amount, null: false, default: 0
|
11
11
|
t.references :transport_plan,
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
null: false,
|
13
|
+
index: {name: "tp_on_tb_indx"},
|
14
|
+
foreign_key: {to_table: :cats_core_transport_plans}
|
15
15
|
|
16
16
|
t.timestamps
|
17
17
|
end
|
@@ -2,22 +2,22 @@ class CreateCatsCoreTransportBidItems < ActiveRecord::Migration[6.1]
|
|
2
2
|
def change
|
3
3
|
create_table :cats_core_transport_bid_items do |t|
|
4
4
|
t.references :transport_bid,
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
null: false,
|
6
|
+
index: {name: "tb_on_tbi_indx"},
|
7
|
+
foreign_key: {to_table: :cats_core_transport_bids}
|
8
8
|
t.references :transport_plan_item,
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
null: false,
|
10
|
+
index: {name: "tpi_on_tbi_indx"},
|
11
|
+
foreign_key: {to_table: :cats_core_transport_plan_items}
|
12
12
|
t.float :quantity, null: false
|
13
13
|
t.references :unit,
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
null: false,
|
15
|
+
index: {name: "unit_on_tbi_indx"},
|
16
|
+
foreign_key: {to_table: :cats_core_unit_of_measures}
|
17
17
|
|
18
18
|
t.timestamps
|
19
19
|
end
|
20
20
|
|
21
|
-
add_index :cats_core_transport_bid_items, :transport_plan_item_id, unique: true, name:
|
21
|
+
add_index :cats_core_transport_bid_items, :transport_plan_item_id, unique: true, name: "tbi_on_tpi_uniq_indx"
|
22
22
|
end
|
23
23
|
end
|
@@ -2,19 +2,19 @@ class CreateCatsCoreTransportOffers < ActiveRecord::Migration[6.1]
|
|
2
2
|
def change
|
3
3
|
create_table :cats_core_transport_offers do |t|
|
4
4
|
t.references :transport_bid,
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
null: false,
|
6
|
+
index: {name: "to_on_tb_indx"},
|
7
|
+
foreign_key: {to_table: :cats_core_transport_bids}
|
8
8
|
t.references :transporter,
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
null: false,
|
10
|
+
index: {name: "to_on_transporter_indx"},
|
11
|
+
foreign_key: {to_table: :cats_core_transporters}
|
12
12
|
t.date :offer_date, null: false
|
13
13
|
t.float :bid_bond_amount, null: false, default: 0
|
14
14
|
|
15
15
|
t.timestamps
|
16
16
|
|
17
|
-
t.index [:transport_bid_id, :transporter_id], unique: true, name:
|
17
|
+
t.index [:transport_bid_id, :transporter_id], unique: true, name: "tb_and_t_on_to_indx"
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -2,13 +2,13 @@ class CreateCatsCoreOfferItems < ActiveRecord::Migration[6.1]
|
|
2
2
|
def change
|
3
3
|
create_table :cats_core_offer_items do |t|
|
4
4
|
t.references :transport_offer,
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
null: false,
|
6
|
+
index: {name: "to_on_oi_indx"},
|
7
|
+
foreign_key: {to_table: :cats_core_transport_offers}
|
8
8
|
t.references :transport_bid_item,
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
null: false,
|
10
|
+
index: {name: "tbi_on_to_indx"},
|
11
|
+
foreign_key: {to_table: :cats_core_transport_bid_items}
|
12
12
|
t.float :price, null: false
|
13
13
|
t.boolean :winner, null: false, default: false
|
14
14
|
t.integer :rank
|
@@ -3,13 +3,13 @@ class CreateCatsCoreTransportContracts < ActiveRecord::Migration[6.1]
|
|
3
3
|
create_table :cats_core_transport_contracts do |t|
|
4
4
|
t.string :contract_no, unique: true
|
5
5
|
t.references :transporter,
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
null: false,
|
7
|
+
index: {name: "transporter_on_tc_indx"},
|
8
|
+
foreign_key: {to_table: :cats_core_transporters}
|
9
9
|
t.references :transport_bid,
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
null: false,
|
11
|
+
index: {name: "tb_on_tc_indx"},
|
12
|
+
foreign_key: {to_table: :cats_core_transport_bids}
|
13
13
|
t.date :contract_date, null: false
|
14
14
|
t.date :expires_on, null: false
|
15
15
|
t.string :payment_term
|
@@ -2,18 +2,18 @@ class CreateCatsCoreContractItems < ActiveRecord::Migration[6.1]
|
|
2
2
|
def change
|
3
3
|
create_table :cats_core_contract_items do |t|
|
4
4
|
t.references :transport_contract,
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
null: false,
|
6
|
+
index: {name: "tc_on_ci_indx"},
|
7
|
+
foreign_key: {to_table: :cats_core_transport_contracts}
|
8
8
|
t.references :route,
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
null: false,
|
10
|
+
index: {name: "route_on_ci_indx"},
|
11
|
+
foreign_key: {to_table: :cats_core_routes}
|
12
12
|
t.float :price, null: false
|
13
13
|
t.references :unit,
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
null: false,
|
15
|
+
index: {name: "unit_on_ci_indx"},
|
16
|
+
foreign_key: {to_table: :cats_core_unit_of_measures}
|
17
17
|
|
18
18
|
t.timestamps
|
19
19
|
end
|
@@ -2,22 +2,22 @@ class CreateCatsCoreCommoditySubstitutions < ActiveRecord::Migration[6.1]
|
|
2
2
|
def change
|
3
3
|
create_table :cats_core_commodity_substitutions do |t|
|
4
4
|
t.references :program,
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
null: false,
|
6
|
+
index: {name: "program_on_cs_indx"},
|
7
|
+
foreign_key: {to_table: :cats_core_programs}
|
8
8
|
t.references :commodity,
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
null: false,
|
10
|
+
index: {name: "commodity_on_cs_indx"},
|
11
|
+
foreign_key: {to_table: :cats_core_commodity_categories}
|
12
12
|
t.references :replaced_by,
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
null: false,
|
14
|
+
index: {name: "rb_on_cs_indx"},
|
15
|
+
foreign_key: {to_table: :cats_core_commodity_categories}
|
16
16
|
t.string :ratio, null: false
|
17
17
|
|
18
18
|
t.timestamps
|
19
19
|
|
20
|
-
t.index [:program_id, :commodity_id, :replaced_by_id], unique: true, name:
|
20
|
+
t.index [:program_id, :commodity_id, :replaced_by_id], unique: true, name: "pcr_on_cs_indx"
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
@@ -2,13 +2,13 @@ class CreateCatsCoreTenderers < ActiveRecord::Migration[6.1]
|
|
2
2
|
def change
|
3
3
|
create_table :cats_core_tenderers do |t|
|
4
4
|
t.references :transport_bid,
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
null: false,
|
6
|
+
index: {name: "tb_on_tenderer_indx"},
|
7
|
+
foreign_key: {to_table: :cats_core_transport_bids}
|
8
8
|
t.references :transporter,
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
null: false,
|
10
|
+
index: {name: "transporter_on_tenderer_indx"},
|
11
|
+
foreign_key: {to_table: :cats_core_transporters}
|
12
12
|
t.string :purchased_by, null: false
|
13
13
|
t.string :phone_no, null: false
|
14
14
|
|
@@ -3,15 +3,15 @@ class CreateCatsCoreRoundPlans < ActiveRecord::Migration[6.1]
|
|
3
3
|
create_table :cats_core_round_plans do |t|
|
4
4
|
t.string :reference_no, unique: true
|
5
5
|
t.integer :rounds, array: true, default: []
|
6
|
-
t.string :status, null: false, default:
|
6
|
+
t.string :status, null: false, default: "Draft"
|
7
7
|
t.references :plan,
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
null: false,
|
9
|
+
index: {name: "plan_on_mp_indx"},
|
10
|
+
foreign_key: {to_table: :cats_core_plans}
|
11
11
|
t.references :region,
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
null: false,
|
13
|
+
index: {name: "region_on_mp_indx"},
|
14
|
+
foreign_key: {to_table: :cats_core_locations}
|
15
15
|
|
16
16
|
t.timestamps
|
17
17
|
end
|
@@ -2,22 +2,22 @@ class CreateCatsCoreRoundRations < ActiveRecord::Migration[6.1]
|
|
2
2
|
def change
|
3
3
|
create_table :cats_core_round_rations do |t|
|
4
4
|
t.references :beneficiary_category,
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
null: false,
|
6
|
+
index: {name: "bc_on_rr_indx"},
|
7
|
+
foreign_key: {to_table: :cats_core_beneficiary_categories}
|
8
8
|
t.references :commodity_category,
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
null: false,
|
10
|
+
index: {name: "cc_on_rr_indx"},
|
11
|
+
foreign_key: {to_table: :cats_core_commodity_categories}
|
12
12
|
t.float :quantity, null: false
|
13
13
|
t.references :unit_of_measure,
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
null: false,
|
15
|
+
index: {name: "uom_on_rr_indx"},
|
16
|
+
foreign_key: {to_table: :cats_core_unit_of_measures}
|
17
17
|
t.references :round_plan,
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
null: false,
|
19
|
+
index: {name: "rp_on_rr_indx"},
|
20
|
+
foreign_key: {to_table: :cats_core_round_plans}
|
21
21
|
t.integer :no_of_days, null: false
|
22
22
|
|
23
23
|
t.timestamps
|
@@ -2,31 +2,31 @@ class CreateCatsCoreRoundPlanItems < ActiveRecord::Migration[6.1]
|
|
2
2
|
def change
|
3
3
|
create_table :cats_core_round_plan_items do |t|
|
4
4
|
t.references :round_plan,
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
null: false,
|
6
|
+
index: {name: "mp_on_mpi_indx"},
|
7
|
+
foreign_key: {to_table: :cats_core_round_plans, on_delete: :cascade}
|
8
8
|
t.references :region,
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
null: false,
|
10
|
+
index: {name: "region_on_round_plan_items_indx"},
|
11
|
+
foreign_key: {to_table: :cats_core_locations}
|
12
12
|
t.references :zone,
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
null: false,
|
14
|
+
index: {name: "zone_on_round_plan_items_indx"},
|
15
|
+
foreign_key: {to_table: :cats_core_locations}
|
16
16
|
t.references :woreda,
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
null: false,
|
18
|
+
index: {name: "woreda_on_round_plan_items_idnx"},
|
19
|
+
foreign_key: {to_table: :cats_core_locations}
|
20
20
|
t.references :fdp,
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
null: false,
|
22
|
+
index: {name: "fdp_on_round_plan_items_indx"},
|
23
|
+
foreign_key: {to_table: :cats_core_locations}
|
24
24
|
t.references :operator,
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
null: false,
|
26
|
+
index: {name: "operator_on_rpi_indx"},
|
27
|
+
foreign_key: {to_table: :cats_core_operators}
|
28
28
|
t.integer :plan_item_id, null: false
|
29
|
-
|
29
|
+
|
30
30
|
t.timestamps
|
31
31
|
end
|
32
32
|
end
|
@@ -2,13 +2,13 @@ class CreateCatsCoreBeneficiaryRoundPlanItems < ActiveRecord::Migration[7.0]
|
|
2
2
|
def change
|
3
3
|
create_table :cats_core_beneficiary_round_plan_items do |t|
|
4
4
|
t.references :round_plan_item,
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
null: false,
|
6
|
+
index: {name: "rpi_on_brpi_indx"},
|
7
|
+
foreign_key: {to_table: :cats_core_round_plan_items}
|
8
8
|
t.references :beneficiary_category,
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
null: false,
|
10
|
+
index: {name: "bc_on_brpi_indx"},
|
11
|
+
foreign_key: {to_table: :cats_core_beneficiary_categories}
|
12
12
|
t.integer :planned_beneficiaries, null: false
|
13
13
|
t.integer :beneficiaries, null: false
|
14
14
|
t.integer :beneficiary_plan_item_id, null: false
|
@@ -17,9 +17,9 @@ class CreateCatsCoreBeneficiaryRoundPlanItems < ActiveRecord::Migration[7.0]
|
|
17
17
|
end
|
18
18
|
add_index(
|
19
19
|
:cats_core_beneficiary_round_plan_items,
|
20
|
-
[
|
20
|
+
[:round_plan_item_id, :beneficiary_category_id],
|
21
21
|
unique: true,
|
22
|
-
name:
|
22
|
+
name: "rpii_on_bci_uniq_indx"
|
23
23
|
)
|
24
24
|
end
|
25
25
|
end
|
@@ -2,18 +2,18 @@ class CreateCatsCoreRoundPlanItemDetails < ActiveRecord::Migration[6.1]
|
|
2
2
|
def change
|
3
3
|
create_table :cats_core_round_plan_item_details do |t|
|
4
4
|
t.references :beneficiary_round_plan_item,
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
null: false,
|
6
|
+
index: {name: "brpi_on_rpid_indx"},
|
7
|
+
foreign_key: {to_table: :cats_core_beneficiary_round_plan_items}
|
8
8
|
t.references :round_ration,
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
null: false,
|
10
|
+
index: {name: "rr_on_rpid_indx"},
|
11
|
+
foreign_key: {to_table: :cats_core_round_rations}
|
12
12
|
t.float :quantity, null: false
|
13
13
|
t.references :unit,
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
null: false,
|
15
|
+
index: {name: "unit_on_rpid_indx"},
|
16
|
+
foreign_key: {to_table: :cats_core_unit_of_measures}
|
17
17
|
|
18
18
|
t.timestamps
|
19
19
|
end
|
@@ -2,23 +2,23 @@ class CreateCatsCoreHubAuthorizations < ActiveRecord::Migration[7.0]
|
|
2
2
|
def change
|
3
3
|
create_table :cats_core_hub_authorizations do |t|
|
4
4
|
t.references :dispatch_plan_item,
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
null: true,
|
6
|
+
index: {name: "dpi_on_ha_indx"},
|
7
|
+
foreign_key: {to_table: :cats_core_dispatch_plan_items}
|
8
8
|
t.references :store,
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
null: false,
|
10
|
+
index: {name: "store_on_ha_indx"},
|
11
|
+
foreign_key: {to_table: :cats_core_stores}
|
12
12
|
t.float :quantity, null: false
|
13
13
|
t.references :unit,
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
null: false,
|
15
|
+
index: {name: "unit_on_ha_indx"},
|
16
|
+
foreign_key: {to_table: :cats_core_unit_of_measures}
|
17
17
|
t.string :authorization_type, null: false
|
18
18
|
t.references :authorized_by,
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
null: false,
|
20
|
+
index: {name: "ab_on_ha_indx"},
|
21
|
+
foreign_key: {to_table: :cats_core_users}
|
22
22
|
|
23
23
|
t.timestamps
|
24
24
|
end
|
@@ -2,13 +2,13 @@ class CreateCatsCoreUnitConversions < ActiveRecord::Migration[7.0]
|
|
2
2
|
def change
|
3
3
|
create_table :cats_core_unit_conversions do |t|
|
4
4
|
t.references :from,
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
null: false,
|
6
|
+
index: {name: "from_on_uc_indx"},
|
7
|
+
foreign_key: {to_table: :cats_core_unit_of_measures}
|
8
8
|
t.references :to,
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
null: false,
|
10
|
+
index: {name: "to_on_uc_indx"},
|
11
|
+
foreign_key: {to_table: :cats_core_unit_of_measures}
|
12
12
|
t.float :factor, null: false
|
13
13
|
|
14
14
|
t.timestamps
|
@@ -2,23 +2,23 @@ class CreateCatsCoreTransportRequisitions < ActiveRecord::Migration[7.0]
|
|
2
2
|
def change
|
3
3
|
create_table :cats_core_transport_requisitions do |t|
|
4
4
|
t.references :dispatch_plan,
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
null: false,
|
6
|
+
index: {name: "dp_on_tr_indx"},
|
7
|
+
foreign_key: {to_table: :cats_core_dispatch_plans}
|
8
8
|
t.string :reference_no, null: false, unique: true
|
9
9
|
t.references :requested_by,
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
null: false,
|
11
|
+
index: {name: "rb_on_tr_indx"},
|
12
|
+
foreign_key: {to_table: :cats_core_users}
|
13
13
|
t.references :approved_by,
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
null: true,
|
15
|
+
index: {name: "ab_on_tr_indx"},
|
16
|
+
foreign_key: {to_table: :cats_core_users}
|
17
17
|
t.string :status, null: false
|
18
18
|
t.references :unit,
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
null: false,
|
20
|
+
index: {name: "unit_on_tr_indx"},
|
21
|
+
foreign_key: {to_table: :cats_core_unit_of_measures}
|
22
22
|
|
23
23
|
t.timestamps
|
24
24
|
end
|
@@ -2,18 +2,18 @@ class CreateCatsCoreTransportRequisitionItems < ActiveRecord::Migration[7.0]
|
|
2
2
|
def change
|
3
3
|
create_table :cats_core_transport_requisition_items do |t|
|
4
4
|
t.references :transport_requisition,
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
null: false,
|
6
|
+
index: {name: "tr_on_tri_indx"},
|
7
|
+
foreign_key: {to_table: :cats_core_transport_requisitions}
|
8
8
|
t.references :dispatch_plan_item,
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
null: false,
|
10
|
+
index: {name: "dpi_on_tri_indx"},
|
11
|
+
foreign_key: {to_table: :cats_core_dispatch_plan_items}
|
12
12
|
t.float :quantity, null: false
|
13
13
|
t.references :unit,
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
null: false,
|
15
|
+
index: {name: "unit_on_tri_indx"},
|
16
|
+
foreign_key: {to_table: :cats_core_unit_of_measures}
|
17
17
|
|
18
18
|
t.timestamps
|
19
19
|
end
|
@@ -2,14 +2,14 @@ class CreateCatsCoreTransportRequisitionDetails < ActiveRecord::Migration[7.0]
|
|
2
2
|
def change
|
3
3
|
create_table :cats_core_transport_requisition_details do |t|
|
4
4
|
t.references :transport_requisition_item,
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
null: false,
|
6
|
+
index: {name: "tri_on_trd_indx"},
|
7
|
+
foreign_key: {to_table: :cats_core_transport_requisition_items}
|
8
8
|
t.float :quantity, null: false
|
9
9
|
t.references :fdp,
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
null: false,
|
11
|
+
index: {name: "fdp_on_tri_indx"},
|
12
|
+
foreign_key: {to_table: :cats_core_locations}
|
13
13
|
|
14
14
|
t.timestamps
|
15
15
|
end
|