cats_core 1.5.17 → 1.5.19
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 +22 -9
- 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 +29 -17
- 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 +5 -1
- 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 +22 -21
- 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 +18 -2
data/config/routes.rb
CHANGED
@@ -1,226 +1,231 @@
|
|
1
1
|
Cats::Core::Engine.routes.draw do
|
2
|
-
get
|
3
|
-
get
|
4
|
-
post
|
5
|
-
|
6
|
-
get
|
7
|
-
|
2
|
+
get "locations/index"
|
3
|
+
get "locations/children"
|
4
|
+
post "/login", controller: :access, action: :login
|
5
|
+
patch "/change_pass", controller: :users, action: :change_password
|
6
|
+
get "/notifications/unread", controller: :notifications, action: :unread
|
7
|
+
get "/notifications/read", controller: :notifications, action: :read
|
8
|
+
|
8
9
|
resources :application_modules, param: :prefix do
|
9
10
|
member do
|
10
|
-
get
|
11
|
-
get
|
11
|
+
get "roles", controller: :roles, action: :index
|
12
|
+
get "users", controller: :users, action: :index
|
12
13
|
end
|
13
14
|
end
|
14
15
|
|
15
16
|
resources :menus, only: [:index]
|
16
17
|
resources :notifications, only: [:index] do
|
17
18
|
member do
|
18
|
-
post
|
19
|
-
post
|
19
|
+
post "mark_as_read", controller: :notifications, action: :mark_as_read
|
20
|
+
post "mark_as_unread", controller: :notifications, action: :mark_as_unread
|
20
21
|
end
|
21
22
|
end
|
22
23
|
|
23
|
-
get
|
24
|
+
get "/roles/:id/", controller: :roles, action: :show
|
24
25
|
resources :roles, param: :name do
|
25
26
|
member do
|
26
|
-
get
|
27
|
+
get "users", controller: :roles, action: :users
|
27
28
|
end
|
28
29
|
end
|
29
30
|
resources :users do
|
30
31
|
member do
|
31
|
-
get
|
32
|
-
get
|
33
|
-
get
|
34
|
-
get
|
35
|
-
get
|
36
|
-
get
|
37
|
-
post
|
38
|
-
post
|
32
|
+
get "roles"
|
33
|
+
get "unassigned_roles", controller: :roles, action: :unassigned_roles
|
34
|
+
get "stores", controller: :users, action: :stores
|
35
|
+
get "warehouse", controller: :users, action: :warehouse
|
36
|
+
get "hub", controller: :users, action: :hub
|
37
|
+
get "plans", controller: :dispatch_plans, action: :plans_for_user
|
38
|
+
post "assign_role"
|
39
|
+
post "revoke_role"
|
39
40
|
end
|
40
41
|
end
|
41
42
|
|
42
|
-
get
|
43
|
-
post
|
44
|
-
post
|
43
|
+
get "/regions/:id/woredas", controller: :locations, action: :woredas, as: :region_woredas
|
44
|
+
post "/locations/filter", controller: :locations, action: :filter
|
45
|
+
post "/locations/fdp/create", controller: :locations, action: :create_fdp
|
45
46
|
resources :locations, except: %i[destroy] do
|
46
47
|
member do
|
47
|
-
get
|
48
|
+
get "children"
|
48
49
|
end
|
49
50
|
end
|
50
51
|
|
51
|
-
get
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
get
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
get
|
60
|
-
|
61
|
-
|
62
|
-
get
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
get
|
68
|
-
get
|
52
|
+
get "/hubs/:id/space",
|
53
|
+
to: "spaces#available_space",
|
54
|
+
as: :hub_space,
|
55
|
+
defaults: {level: Cats::Core::SpaceService::HUB}
|
56
|
+
get "/warehouses/:id/space",
|
57
|
+
to: "spaces#available_space",
|
58
|
+
as: :warehouse_space,
|
59
|
+
defaults: {level: Cats::Core::SpaceService::WAREHOUSE}
|
60
|
+
get "/warehouses/:id/stack_transactions",
|
61
|
+
to: "stack_transactions#index",
|
62
|
+
as: :warehouse_stack_transactions
|
63
|
+
get "/stores/:id/space",
|
64
|
+
to: "spaces#available_space",
|
65
|
+
as: :store_space,
|
66
|
+
defaults: {level: Cats::Core::SpaceService::STORE}
|
67
|
+
|
68
|
+
get "/commodity_categories/roots", to: "commodity_categories#root", as: :commodity_category_roots
|
69
|
+
get "/commodity_categories/all", to: "commodity_categories#all", as: :commodity_category_all
|
69
70
|
resources :commodity_categories, except: %i[destroy] do
|
70
71
|
member do
|
71
|
-
get
|
72
|
+
get "children"
|
72
73
|
end
|
73
74
|
end
|
74
|
-
post
|
75
|
+
post "/commodities/filter", controller: :commodities, action: :filter
|
75
76
|
resources :commodities, except: %i[destroy] do
|
76
77
|
member do
|
77
|
-
post
|
78
|
+
post "approve"
|
78
79
|
end
|
79
80
|
end
|
80
81
|
resources :currencies, except: %i[destroy]
|
81
82
|
resources :unit_of_measures, except: %i[destroy]
|
82
83
|
resources :unit_conversions, except: %i[destroy]
|
83
84
|
|
84
|
-
post
|
85
|
+
post "/transporters/filter", controller: :transporters, action: :filter
|
85
86
|
resources :transporters, except: %i[destroy]
|
86
87
|
|
87
|
-
post
|
88
|
-
post
|
88
|
+
post "/routes/filter", controller: :routes, action: :filter
|
89
|
+
post "/routes/bulk_create", controller: :routes, action: :bulk_create
|
89
90
|
resources :routes, except: %i[destroy]
|
90
91
|
|
91
92
|
resources :commodity_donations, except: %i[destroy]
|
92
93
|
resources :purchase_orders, except: %i[index destroy]
|
93
94
|
resources :cash_donations, except: %i[destroy] do
|
94
95
|
member do
|
95
|
-
get
|
96
|
+
get "purchase_orders", controller: :purchase_orders, action: :index
|
96
97
|
end
|
97
98
|
end
|
98
99
|
resources :swaps, except: %i[destory]
|
99
100
|
resources :loans, except: %i[destory]
|
100
101
|
|
101
|
-
post
|
102
|
-
post
|
102
|
+
post "/dispatch_plans/filter", controller: :dispatch_plans, action: :filter
|
103
|
+
post "/dispatch_plans/bulk_create"
|
103
104
|
resources :dispatch_plans do
|
104
105
|
member do
|
105
|
-
get
|
106
|
-
post
|
106
|
+
get "items", controller: :dispatch_plan_items, action: :index
|
107
|
+
post "approve"
|
107
108
|
end
|
108
109
|
end
|
109
110
|
|
110
111
|
resources :dispatch_plan_items, except: %i[index destroy]
|
111
112
|
|
112
|
-
post
|
113
|
-
get
|
113
|
+
post "/dispatch_plan_items/filter", controller: :dispatch_plan_items, action: :filter
|
114
|
+
get "/dispatch_plan_items/:id/dispatches", controller: :dispatches, action: :index, as: :dispatches_plan_item
|
114
115
|
|
115
|
-
post
|
116
|
-
get
|
116
|
+
post "/dispatches/filter", controller: :dispatches, action: :filter
|
117
|
+
get "/dispatches/search", controller: :dispatches, action: :search, as: :search_dispatches
|
117
118
|
resources :dispatches, except: %i[index destroy] do
|
118
119
|
member do
|
119
|
-
get
|
120
|
-
get
|
121
|
-
get
|
122
|
-
get
|
123
|
-
post
|
124
|
-
post
|
125
|
-
post
|
126
|
-
post
|
120
|
+
get "dispatch_authorizations", controller: :dispatch_authorizations, action: :index
|
121
|
+
get "receipt_authorizations", controller: :receipt_authorizations, action: :index
|
122
|
+
get "receipts", controller: :receipts, action: :index
|
123
|
+
get "commodity"
|
124
|
+
post "approve"
|
125
|
+
post "start"
|
126
|
+
post "confirm"
|
127
|
+
post "start_with_pin"
|
127
128
|
end
|
128
129
|
end
|
129
130
|
|
131
|
+
post "/dispatch_authorizations/filter", controller: :dispatch_authorizations, action: :filter
|
130
132
|
resources :dispatch_authorizations, except: %i[index destory] do
|
131
133
|
member do
|
132
|
-
get
|
133
|
-
post
|
134
|
+
get "transactions", controller: :dispatch_transactions, action: :index
|
135
|
+
post "confirm", controller: :dispatch_authorizations, action: :confirm
|
134
136
|
end
|
135
137
|
end
|
136
138
|
|
137
139
|
get(
|
138
|
-
|
140
|
+
"/storekeeper/:id/dispatch_authorizations",
|
139
141
|
controller: :dispatch_authorizations,
|
140
142
|
action: :storekeeper_authorizations,
|
141
143
|
as: :storekeeper_dispatch_authorizations
|
142
144
|
)
|
143
145
|
get(
|
144
|
-
|
146
|
+
"/storekeeper/:id/receipt_authorizations",
|
145
147
|
controller: :receipt_authorizations,
|
146
148
|
action: :storekeeper_authorizations,
|
147
149
|
as: :storekeeper_receipt_authorizations
|
148
150
|
)
|
149
151
|
post(
|
150
|
-
|
152
|
+
"/storekeeper/:id/assign_stores",
|
151
153
|
controller: :stores,
|
152
154
|
action: :assign_store,
|
153
155
|
as: :assign_stores_to_storekeeper
|
154
156
|
)
|
155
157
|
post(
|
156
|
-
|
158
|
+
"/storekeeper/:id/unassign_stores",
|
157
159
|
controller: :stores,
|
158
160
|
action: :unassign_store,
|
159
161
|
as: :unassign_stores_to_storekeeper
|
160
162
|
)
|
161
163
|
post(
|
162
|
-
|
164
|
+
"/receipt_authorizations/generate",
|
163
165
|
controller: :receipt_authorizations,
|
164
166
|
action: :generate,
|
165
167
|
as: :generate_receipt_authorizations
|
166
168
|
)
|
169
|
+
|
170
|
+
post "/receipt_authorizations/filter", controller: :receipt_authorizations, action: :filter
|
171
|
+
|
167
172
|
resources :receipt_authorizations, except: %i[index destroy] do
|
168
173
|
member do
|
169
|
-
get
|
170
|
-
get
|
171
|
-
get
|
172
|
-
get
|
173
|
-
post
|
174
|
-
post
|
175
|
-
post
|
174
|
+
get "transactions", controller: :receipt_transactions, action: :index
|
175
|
+
get "lost", controller: :lost_commodities, action: :index
|
176
|
+
get "receipts", controller: :receipts, action: :index
|
177
|
+
get "stacks", controller: :stacks, action: :receipt_stacks
|
178
|
+
post "confirm"
|
179
|
+
post "driver_confirm"
|
180
|
+
post "stack"
|
176
181
|
end
|
177
182
|
end
|
178
183
|
|
179
184
|
resources :receipts, except: %i[index destroy]
|
180
185
|
post(
|
181
|
-
|
186
|
+
"dispatch_transactions/allocation",
|
182
187
|
controller: :dispatch_transactions,
|
183
188
|
action: :create_allocation,
|
184
189
|
as: :allocation_transaction
|
185
190
|
)
|
186
|
-
post
|
191
|
+
post "/dispatch_transactions/filter", controller: :dispatch_transactions, action: :filter
|
187
192
|
resources :dispatch_transactions, except: %i[index new edit destroy]
|
188
|
-
post
|
193
|
+
post "/receipt_transactions/filter", controller: :receipt_transactions, action: :filter
|
189
194
|
resources :receipt_transactions, except: %i[index new edit destroy]
|
190
195
|
resources :stack_transactions, except: %i[index new edit destroy]
|
191
196
|
resources :lost_commodities, except: %i[index destroy]
|
192
|
-
get
|
193
|
-
|
194
|
-
post
|
197
|
+
get "/plans/:id/round_plans", controller: :round_plans, action: :index, as: :round_plans_plan
|
198
|
+
|
199
|
+
post "/round_beneficiaries/filter"
|
195
200
|
resources :round_beneficiaries, only: %i[show]
|
196
|
-
post
|
197
|
-
post
|
201
|
+
post "/round_plans/generate"
|
202
|
+
post "/round_plans/filter"
|
198
203
|
resources :round_plans, except: %i[index destroy] do
|
199
204
|
member do
|
200
|
-
post
|
201
|
-
post
|
202
|
-
post
|
203
|
-
post
|
204
|
-
post
|
205
|
-
post
|
206
|
-
post
|
207
|
-
get
|
205
|
+
post "generate_dispatch_plan", controller: :dispatch_plans, action: :generate
|
206
|
+
post "remove_items"
|
207
|
+
post "remove_beneficiaries", controller: :round_beneficiaries, action: :remove_beneficiaries
|
208
|
+
post "confirm_receipt", controller: :round_beneficiaries, action: :confirm_receipt
|
209
|
+
post "generate_round_needs"
|
210
|
+
post "approve"
|
211
|
+
post "generate_distribution_list", controller: :round_beneficiaries, action: :generate
|
212
|
+
get "beneficiaries", controller: :round_beneficiaries, action: :index
|
208
213
|
end
|
209
214
|
end
|
210
215
|
|
211
|
-
get
|
212
|
-
post
|
213
|
-
get
|
214
|
-
get
|
215
|
-
get
|
216
|
-
resources :stacks, only: %i[show index create update]
|
216
|
+
get "/stores/:id/stacks", controller: :stacks, action: :index, as: :stacks_store
|
217
|
+
post "/stores/:id/stacks", controller: :stacks, action: :filter
|
218
|
+
get "/stacks/items_for_location", controller: :stacks, action: :items_for_location, as: :items_for_location
|
219
|
+
get "/receipts/:id/stacks", controller: :stacks, action: :receipt_stacks, as: :receipt_stacks
|
220
|
+
get "/dispatches/:id/stacks", controller: :stacks, action: :dispatch_stacks, as: :dispatch_stacks
|
221
|
+
resources :stacks, only: %i[show index create update destroy]
|
217
222
|
|
218
|
-
get
|
219
|
-
get
|
223
|
+
get "/warehouses/:id/stores", controller: :stores, action: :index, as: :stores_warehouse
|
224
|
+
get "/hubs/:id/stores", controller: :stores, action: :stores_for_hub, as: :stores_hub
|
220
225
|
resources :stores, only: %i[index show create update] do
|
221
226
|
member do
|
222
|
-
get
|
227
|
+
get "fdp"
|
223
228
|
end
|
224
229
|
end
|
225
|
-
post
|
230
|
+
post "/stores/filter", controller: :stores, action: :filter
|
226
231
|
end
|
data/config/spring.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Spring.application_root = "./spec/dummy"
|
@@ -9,9 +9,9 @@ class CreateCatsCoreUsers < ActiveRecord::Migration[6.1]
|
|
9
9
|
t.jsonb :details, null: false, default: {}
|
10
10
|
t.string :phone_number
|
11
11
|
t.references :application_module,
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
null: false,
|
13
|
+
index: {name: "am_on_users_indx"},
|
14
|
+
foreign_key: {to_table: :cats_core_application_modules}
|
15
15
|
|
16
16
|
t.timestamps
|
17
17
|
end
|
@@ -2,27 +2,27 @@ class CreateCatsCoreRoles < ActiveRecord::Migration[6.1]
|
|
2
2
|
def change
|
3
3
|
create_table(:cats_core_roles) do |t|
|
4
4
|
t.string :name
|
5
|
-
t.references :resource, :
|
5
|
+
t.references :resource, polymorphic: true
|
6
6
|
t.references :application_module,
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
null: false,
|
8
|
+
index: {name: "am_on_roles_indx"},
|
9
|
+
foreign_key: {to_table: :cats_core_application_modules}
|
10
10
|
|
11
11
|
t.timestamps
|
12
12
|
end
|
13
13
|
|
14
|
-
create_table(:cats_core_users_cats_core_roles, :
|
14
|
+
create_table(:cats_core_users_cats_core_roles, id: false) do |t|
|
15
15
|
t.references :user,
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
null: false,
|
17
|
+
index: {name: "user_on_ur_indx"},
|
18
|
+
foreign_key: {to_table: :cats_core_users}
|
19
19
|
t.references :role,
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
null: false,
|
21
|
+
index: {name: "role_on_ur_indx"},
|
22
|
+
foreign_key: {to_table: :cats_core_roles}
|
23
23
|
end
|
24
|
-
|
25
|
-
add_index(:cats_core_roles, [
|
26
|
-
add_index(:cats_core_users_cats_core_roles, [
|
24
|
+
|
25
|
+
add_index(:cats_core_roles, [:name, :resource_type, :resource_id])
|
26
|
+
add_index(:cats_core_users_cats_core_roles, [:user_id, :role_id], unique: true)
|
27
27
|
end
|
28
28
|
end
|
@@ -4,9 +4,9 @@ class CreateCatsCoreMenus < ActiveRecord::Migration[6.1]
|
|
4
4
|
t.string :label, null: false
|
5
5
|
t.string :icon
|
6
6
|
t.references :application_module,
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
null: false,
|
8
|
+
index: {name: "am_on_menus_indx"},
|
9
|
+
foreign_key: {to_table: :cats_core_application_modules}
|
10
10
|
|
11
11
|
t.timestamps
|
12
12
|
end
|
@@ -5,9 +5,9 @@ class CreateCatsCoreMenuItems < ActiveRecord::Migration[6.1]
|
|
5
5
|
t.string :icon
|
6
6
|
t.string :route, null: false
|
7
7
|
t.references :menu,
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
null: false,
|
9
|
+
index: {name: "menu_on_mi_indx"},
|
10
|
+
foreign_key: {to_table: :cats_core_menus}
|
11
11
|
|
12
12
|
t.timestamps
|
13
13
|
end
|
@@ -2,27 +2,27 @@ class CreateCatsCoreRoleMenus < ActiveRecord::Migration[6.1]
|
|
2
2
|
def change
|
3
3
|
create_table :cats_core_role_menus do |t|
|
4
4
|
t.references :role,
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
null: false,
|
6
|
+
index: {name: "role_on_rm_indx"},
|
7
|
+
foreign_key: {to_table: :cats_core_roles}
|
8
8
|
t.references :menu,
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
null: false,
|
10
|
+
index: {name: "menu_on_rm_indx"},
|
11
|
+
foreign_key: {to_table: :cats_core_menus}
|
12
12
|
t.string :description
|
13
13
|
|
14
14
|
t.timestamps
|
15
15
|
end
|
16
16
|
|
17
|
-
create_table(:cats_core_role_menus_menu_items, :
|
17
|
+
create_table(:cats_core_role_menus_menu_items, id: false) do |t|
|
18
18
|
t.references :role_menu,
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
null: false,
|
20
|
+
index: {name: "rm_on_ummi_indx"},
|
21
|
+
foreign_key: {to_table: :cats_core_role_menus}
|
22
22
|
t.references :menu_item,
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
null: false,
|
24
|
+
index: {name: "mi_on_ummi_indx"},
|
25
|
+
foreign_key: {to_table: :cats_core_menu_items}
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -4,15 +4,15 @@ class CreateCatsCorePlans < ActiveRecord::Migration[6.1]
|
|
4
4
|
t.string :reference_no, unique: true
|
5
5
|
t.integer :year, null: false
|
6
6
|
t.string :season, null: false
|
7
|
-
t.string :status, null: false, default:
|
7
|
+
t.string :status, null: false, default: "Draft"
|
8
8
|
t.date :start_date
|
9
9
|
t.integer :total_days, null: false, default: 180
|
10
10
|
t.integer :rounds, null: false
|
11
11
|
|
12
12
|
t.references :program,
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
null: false,
|
14
|
+
index: {name: "program_on_plan_indx"},
|
15
|
+
foreign_key: {to_table: :cats_core_programs}
|
16
16
|
|
17
17
|
t.timestamps
|
18
18
|
end
|
@@ -2,29 +2,29 @@ class CreateCatsCorePlanItems < ActiveRecord::Migration[6.1]
|
|
2
2
|
def change
|
3
3
|
create_table :cats_core_plan_items do |t|
|
4
4
|
t.references :plan,
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
null: false,
|
6
|
+
index: {name: "plan_on_plan_items_indx"},
|
7
|
+
foreign_key: {to_table: :cats_core_plans}
|
8
8
|
t.references :region,
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
null: false,
|
10
|
+
index: {name: "region_on_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_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_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_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_plan_items_indx"},
|
27
|
+
foreign_key: {to_table: :cats_core_operators}
|
28
28
|
|
29
29
|
t.timestamps
|
30
30
|
end
|
@@ -4,9 +4,9 @@ class CreateCatsCoreBeneficiaryCategories < ActiveRecord::Migration[7.0]
|
|
4
4
|
t.string :code, unique: true
|
5
5
|
t.string :name, null: false
|
6
6
|
t.references :plan,
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
null: false,
|
8
|
+
index: {name: "plan_on_bc_indx"},
|
9
|
+
foreign_key: {to_table: :cats_core_plans}
|
10
10
|
|
11
11
|
t.timestamps
|
12
12
|
end
|
@@ -3,20 +3,20 @@ class CreateCatsCoreRations < ActiveRecord::Migration[6.1]
|
|
3
3
|
create_table :cats_core_rations do |t|
|
4
4
|
t.string :reference_no, unique: true
|
5
5
|
t.references :beneficiary_category,
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
null: false,
|
7
|
+
index: {name: "bc_on_ration_indx"},
|
8
|
+
foreign_key: {to_table: :cats_core_beneficiary_categories}
|
9
9
|
t.references :commodity_category,
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
null: false,
|
11
|
+
index: {name: "cc_on_ration_indx"},
|
12
|
+
foreign_key: {to_table: :cats_core_commodity_categories}
|
13
13
|
t.references :unit_of_measure,
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
null: false,
|
15
|
+
index: {name: "uom_on_ration_indx"},
|
16
|
+
foreign_key: {to_table: :cats_core_unit_of_measures}
|
17
17
|
t.float :quantity, null: false
|
18
18
|
t.integer :no_of_days, null: false
|
19
|
-
|
19
|
+
|
20
20
|
t.timestamps
|
21
21
|
end
|
22
22
|
end
|
@@ -2,13 +2,13 @@ class CreateCatsCoreBeneficiaryPlanItems < ActiveRecord::Migration[7.0]
|
|
2
2
|
def change
|
3
3
|
create_table :cats_core_beneficiary_plan_items do |t|
|
4
4
|
t.references :plan_item,
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
null: false,
|
6
|
+
index: {name: "pi_on_bpi_indx"},
|
7
|
+
foreign_key: {to_table: :cats_core_plan_items}
|
8
8
|
t.references :beneficiary_category,
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
null: false,
|
10
|
+
index: {name: "bc_on_bpi_indx"},
|
11
|
+
foreign_key: {to_table: :cats_core_beneficiary_categories}
|
12
12
|
t.integer :beneficiaries, null: false
|
13
13
|
|
14
14
|
t.integer :rounds
|
@@ -20,7 +20,7 @@ class CreateCatsCoreBeneficiaryPlanItems < ActiveRecord::Migration[7.0]
|
|
20
20
|
:cats_core_beneficiary_plan_items,
|
21
21
|
[:plan_item_id, :beneficiary_category_id],
|
22
22
|
unique: true,
|
23
|
-
name:
|
23
|
+
name: "pii_on_bci_uniq_indx"
|
24
24
|
)
|
25
25
|
end
|
26
26
|
end
|