cats_core 1.5.19 → 1.5.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/cats/core/commodities_controller.rb +3 -3
  3. data/app/controllers/cats/core/dispatch_authorizations_controller.rb +4 -4
  4. data/app/controllers/cats/core/dispatch_plan_items_controller.rb +1 -1
  5. data/app/controllers/cats/core/dispatch_plans_controller.rb +2 -2
  6. data/app/controllers/cats/core/dispatch_transactions_controller.rb +1 -1
  7. data/app/controllers/cats/core/dispatches_controller.rb +5 -5
  8. data/app/controllers/cats/core/loans_controller.rb +1 -1
  9. data/app/controllers/cats/core/purchase_orders_controller.rb +2 -2
  10. data/app/controllers/cats/core/receipt_authorizations_controller.rb +5 -5
  11. data/app/controllers/cats/core/receipt_transactions_controller.rb +2 -2
  12. data/app/controllers/cats/core/receipts_controller.rb +1 -1
  13. data/app/controllers/cats/core/roles_controller.rb +1 -1
  14. data/app/controllers/cats/core/round_beneficiaries_controller.rb +5 -5
  15. data/app/controllers/cats/core/round_plans_controller.rb +3 -3
  16. data/app/controllers/cats/core/stack_transactions_controller.rb +1 -1
  17. data/app/controllers/cats/core/stacks_controller.rb +2 -2
  18. data/app/controllers/cats/core/stores_controller.rb +1 -1
  19. data/app/controllers/cats/core/swaps_controller.rb +2 -2
  20. data/app/controllers/cats/core/users_controller.rb +1 -1
  21. data/app/controllers/concerns/cats/core/common.rb +15 -16
  22. data/app/models/cats/core/authorization.rb +1 -1
  23. data/app/models/cats/core/beneficiary_plan_item.rb +1 -1
  24. data/app/models/cats/core/commodity.rb +16 -12
  25. data/app/models/cats/core/commodity_substitution.rb +2 -2
  26. data/app/models/cats/core/dispatch.rb +29 -16
  27. data/app/models/cats/core/dispatch_authorization.rb +7 -3
  28. data/app/models/cats/core/dispatch_plan.rb +14 -6
  29. data/app/models/cats/core/dispatch_plan_item.rb +20 -10
  30. data/app/models/cats/core/dispatch_transaction.rb +15 -8
  31. data/app/models/cats/core/location.rb +2 -2
  32. data/app/models/cats/core/receipt_authorization.rb +18 -2
  33. data/app/models/cats/core/receipt_transaction.rb +17 -2
  34. data/app/models/cats/core/round_beneficiary.rb +4 -4
  35. data/app/models/cats/core/round_plan.rb +20 -2
  36. data/app/models/cats/core/round_plan_item.rb +24 -2
  37. data/app/models/cats/core/route.rb +15 -2
  38. data/app/models/cats/core/stack.rb +40 -30
  39. data/app/models/cats/core/stacking_rule.rb +2 -2
  40. data/app/models/cats/core/store.rb +21 -21
  41. data/app/models/cats/core/transporter.rb +2 -2
  42. data/app/models/cats/core/unit_conversion.rb +1 -3
  43. data/app/serializers/cats/core/cash_donation_serializer.rb +1 -1
  44. data/app/serializers/cats/core/commodity_donation_serializer.rb +2 -2
  45. data/app/serializers/cats/core/commodity_serializer.rb +2 -2
  46. data/app/serializers/cats/core/dispatch_authorization_serializer.rb +2 -2
  47. data/app/serializers/cats/core/dispatch_plan_item_serializer.rb +3 -3
  48. data/app/serializers/cats/core/dispatch_plan_serializer.rb +1 -1
  49. data/app/serializers/cats/core/dispatch_serializer.rb +2 -2
  50. data/app/serializers/cats/core/dispatch_transaction_serializer.rb +1 -1
  51. data/app/serializers/cats/core/loan_serializer.rb +1 -1
  52. data/app/serializers/cats/core/purchase_order_serializer.rb +2 -2
  53. data/app/serializers/cats/core/receipt_authorization_serializer.rb +2 -2
  54. data/app/serializers/cats/core/receipt_serializer.rb +1 -1
  55. data/app/serializers/cats/core/receipt_transaction_serializer.rb +2 -2
  56. data/app/serializers/cats/core/round_beneficiary_serializer.rb +1 -1
  57. data/app/serializers/cats/core/round_plan_serializer.rb +1 -1
  58. data/app/serializers/cats/core/stack_serializer.rb +1 -1
  59. data/app/serializers/cats/core/store_serializer.rb +1 -1
  60. data/app/serializers/cats/core/swap_serializer.rb +2 -2
  61. data/app/services/cats/core/authorization_service.rb +3 -9
  62. data/app/services/cats/core/beneficiary_service.rb +2 -2
  63. data/app/services/cats/core/dispatch_plan_service.rb +1 -1
  64. data/app/services/cats/core/dispatch_service.rb +18 -20
  65. data/app/services/cats/core/notification_service.rb +1 -1
  66. data/app/services/cats/core/round_plan_service.rb +4 -6
  67. data/app/services/cats/core/space_service.rb +6 -6
  68. data/app/services/cats/core/stack_service.rb +8 -8
  69. data/app/services/cats/core/user_service.rb +1 -1
  70. data/db/migrate/20210715114910_create_cats_core_users.rb +3 -3
  71. data/db/migrate/20210715120018_create_cats_core_roles.rb +11 -11
  72. data/db/migrate/20210715121244_create_cats_core_menus.rb +3 -3
  73. data/db/migrate/20210715122141_create_cats_core_menu_items.rb +3 -3
  74. data/db/migrate/20210715122423_create_cats_core_role_menus.rb +12 -12
  75. data/db/migrate/20210717031810_create_cats_core_plans.rb +3 -3
  76. data/db/migrate/20210717032024_create_cats_core_plan_items.rb +19 -19
  77. data/db/migrate/20210717032260_create_cats_core_beneficiary_categories.rb +3 -3
  78. data/db/migrate/20210717032270_create_cats_core_rations.rb +9 -9
  79. data/db/migrate/20210717032290_create_cats_core_beneficiary_plan_items.rb +7 -7
  80. data/db/migrate/20210717032295_create_cats_core_plan_item_details.rb +7 -7
  81. data/db/migrate/20210717032330_create_cats_core_commodity_donations.rb +12 -12
  82. data/db/migrate/20210717032408_create_cats_core_cash_donations.rb +6 -6
  83. data/db/migrate/20210717032602_create_cats_core_gift_certificates.rb +12 -12
  84. data/db/migrate/20210717032855_create_cats_core_purchase_orders.rb +12 -12
  85. data/db/migrate/20210717032927_create_cats_core_projects.rb +3 -3
  86. data/db/migrate/20210717033223_create_cats_core_commodities.rb +9 -9
  87. data/db/migrate/20210717140855_create_cats_core_stores.rb +3 -3
  88. data/db/migrate/20210717171101_create_cats_core_stacks.rb +9 -9
  89. data/db/migrate/20210718040129_create_cats_core_routes.rb +9 -9
  90. data/db/migrate/20210718042755_create_cats_core_rhn_requests.rb +6 -6
  91. data/db/migrate/20210718043328_create_cats_core_dispatch_plans.rb +6 -6
  92. data/db/migrate/20210718043401_create_cats_core_dispatch_plan_items.rb +15 -15
  93. data/db/migrate/20210718045516_create_cats_core_dispatches.rb +12 -12
  94. data/db/migrate/20210718055414_create_cats_core_dispatch_authorizations.rb +12 -12
  95. data/db/migrate/20210718202957_create_cats_core_dispatch_transactions.rb +10 -10
  96. data/db/migrate/20210727074646_create_cats_core_receipt_authorizations.rb +12 -12
  97. data/db/migrate/20210727105834_create_cats_core_receipts.rb +6 -6
  98. data/db/migrate/20210728041505_create_cats_core_lost_commodities.rb +6 -6
  99. data/db/migrate/20210814160628_create_cats_core_receipt_transactions.rb +9 -9
  100. data/db/migrate/20210814175406_create_cats_core_stack_transactions.rb +9 -9
  101. data/db/migrate/20211215114737_create_cats_core_transport_plans.rb +3 -3
  102. data/db/migrate/20211215114835_create_cats_core_transport_plan_items.rb +9 -9
  103. data/db/migrate/20211215121151_create_cats_core_transport_bids.rb +3 -3
  104. data/db/migrate/20211215124452_create_cats_core_transport_bid_items.rb +9 -9
  105. data/db/migrate/20211229160125_create_cats_core_transport_offers.rb +7 -7
  106. data/db/migrate/20211229160126_create_cats_core_offer_items.rb +6 -6
  107. data/db/migrate/20211229160127_create_cats_core_transport_contracts.rb +6 -6
  108. data/db/migrate/20211229160128_create_cats_core_contract_items.rb +9 -9
  109. data/db/migrate/20211229160129_create_cats_core_commodity_substitutions.rb +10 -10
  110. data/db/migrate/20220103152802_create_cats_core_tenderers.rb +6 -6
  111. data/db/migrate/20220107121752_create_cats_core_round_plans.rb +6 -6
  112. data/db/migrate/20220107122280_create_cats_core_round_rations.rb +12 -12
  113. data/db/migrate/20220107125025_create_cats_core_round_plan_items.rb +18 -18
  114. data/db/migrate/20220107126025_create_cats_core_beneficiary_round_plan_items.rb +7 -7
  115. data/db/migrate/20220107132433_create_cats_core_round_plan_item_details.rb +9 -9
  116. data/db/migrate/20220209083928_create_cats_core_hub_authorizations.rb +12 -12
  117. data/db/migrate/20220416143416_create_cats_core_unit_conversions.rb +7 -7
  118. data/db/migrate/20220417105839_create_cats_core_transport_requisitions.rb +12 -12
  119. data/db/migrate/20220417123835_create_cats_core_transport_requisition_items.rb +9 -9
  120. data/db/migrate/20220417151821_create_cats_core_transport_requisition_details.rb +6 -6
  121. data/db/migrate/20220506082329_create_cats_core_transport_orders.rb +9 -9
  122. data/db/migrate/20220506083042_create_cats_core_transport_order_items.rb +12 -12
  123. data/db/migrate/20220511082354_create_cats_core_beneficiaries.rb +6 -6
  124. data/db/migrate/20220626063501_create_cats_core_loans.rb +6 -6
  125. data/db/migrate/20220626063757_create_cats_core_swaps.rb +12 -12
  126. data/db/migrate/20220626132050_create_cats_core_round_beneficiaries.rb +12 -12
  127. data/db/migrate/20220923190857_create_cats_core_application_settings.rb +3 -3
  128. data/lib/cats/core/engine.rb +1 -3
  129. data/lib/cats/core/version.rb +1 -1
  130. data/spec/factories/cats/core/dispatch_authorizations.rb +1 -1
  131. data/spec/factories/cats/core/dispatch_plan_items.rb +1 -1
  132. data/spec/factories/cats/core/dispatches.rb +4 -4
  133. data/spec/factories/cats/core/round_plan_item_details.rb +1 -1
  134. metadata +41 -13
@@ -10,21 +10,21 @@ class CreateCatsCorePurchaseOrders < ActiveRecord::Migration[6.1]
10
10
  t.string :purchase_type, null: false
11
11
  t.float :price, null: false
12
12
  t.references :currency,
13
- null: false,
14
- index: {name: "currency_on_po_indx"},
15
- foreign_key: {to_table: :cats_core_currencies}
13
+ null: false,
14
+ index: {name: "currency_on_po_indx"},
15
+ foreign_key: {to_table: :cats_core_currencies}
16
16
  t.references :cash_donation,
17
- null: false,
18
- index: {name: "cd_on_po_indx"},
19
- foreign_key: {to_table: :cats_core_cash_donations}
17
+ null: false,
18
+ index: {name: "cd_on_po_indx"},
19
+ foreign_key: {to_table: :cats_core_cash_donations}
20
20
  t.references :commodity_category,
21
- null: false,
22
- index: {name: "cc_on_po_indx"},
23
- foreign_key: {to_table: :cats_core_commodity_categories}
21
+ null: false,
22
+ index: {name: "cc_on_po_indx"},
23
+ foreign_key: {to_table: :cats_core_commodity_categories}
24
24
  t.references :unit,
25
- null: false,
26
- index: {name: "unit_on_po_indx"},
27
- foreign_key: {to_table: :cats_core_unit_of_measures}
25
+ null: false,
26
+ index: {name: "unit_on_po_indx"},
27
+ foreign_key: {to_table: :cats_core_unit_of_measures}
28
28
 
29
29
  t.timestamps
30
30
  end
@@ -5,9 +5,9 @@ class CreateCatsCoreProjects < ActiveRecord::Migration[7.0]
5
5
  t.string :description
6
6
  t.references :source, polymorphic: true
7
7
  t.references :program,
8
- null: false,
9
- index: {name: "program_on_projects_indx"},
10
- foreign_key: {to_table: :cats_core_programs}
8
+ null: false,
9
+ index: {name: "program_on_projects_indx"},
10
+ foreign_key: {to_table: :cats_core_programs}
11
11
  t.integer :year, null: false
12
12
  t.string :implementing_agency, null: false
13
13
 
@@ -3,17 +3,17 @@ class CreateCatsCoreCommodities < ActiveRecord::Migration[6.1]
3
3
  create_table :cats_core_commodities do |t|
4
4
  t.string :batch_no, unique: true
5
5
  t.references :unit_of_measure,
6
- null: false,
7
- index: {name: "uom_on_commodities_indx"},
8
- foreign_key: {to_table: :cats_core_unit_of_measures}
6
+ null: false,
7
+ index: {name: "uom_on_commodities_indx"},
8
+ foreign_key: {to_table: :cats_core_unit_of_measures}
9
9
  t.references :project,
10
- null: false,
11
- index: {name: "project_on_commodity_indx"},
12
- foreign_key: {to_table: :cats_core_projects}
10
+ null: false,
11
+ index: {name: "project_on_commodity_indx"},
12
+ foreign_key: {to_table: :cats_core_projects}
13
13
  t.references :package_unit,
14
- null: true,
15
- index: {name: "pu_on_commodity_indx"},
16
- foreign_key: {to_table: :cats_core_unit_of_measures}
14
+ null: true,
15
+ index: {name: "pu_on_commodity_indx"},
16
+ foreign_key: {to_table: :cats_core_unit_of_measures}
17
17
 
18
18
  t.float :quantity, null: false
19
19
  t.string :description
@@ -14,9 +14,9 @@ class CreateCatsCoreStores < ActiveRecord::Migration[6.1]
14
14
  t.float :gangway_width
15
15
  t.float :gangway_corner_dist
16
16
  t.references :warehouse,
17
- null: false,
18
- index: {name: "warehouse_on_stores_indx"},
19
- foreign_key: {to_table: :cats_core_locations}
17
+ null: false,
18
+ index: {name: "warehouse_on_stores_indx"},
19
+ foreign_key: {to_table: :cats_core_locations}
20
20
 
21
21
  t.timestamps
22
22
  end
@@ -8,20 +8,20 @@ class CreateCatsCoreStacks < ActiveRecord::Migration[6.1]
8
8
  t.float :start_x, null: false
9
9
  t.float :start_y, null: false
10
10
  t.references :commodity,
11
- null: false,
12
- index: {name: "commodity_on_stack_indx"},
13
- foreign_key: {to_table: :cats_core_commodities}
11
+ null: false,
12
+ index: {name: "commodity_on_stack_indx"},
13
+ foreign_key: {to_table: :cats_core_commodities}
14
14
  t.references :store,
15
- null: false,
16
- index: {name: "store_on_stack_indx"},
17
- foreign_key: {to_table: :cats_core_stores}
15
+ null: false,
16
+ index: {name: "store_on_stack_indx"},
17
+ foreign_key: {to_table: :cats_core_stores}
18
18
  t.string :commodity_status, null: false, default: "Good"
19
19
  t.string :stack_status, null: false, default: "Reserved"
20
20
  t.float :quantity, null: false, default: 0
21
21
  t.references :unit,
22
- null: false,
23
- index: {name: "unit_on_stack_indx"},
24
- foreign_key: {to_table: :cats_core_unit_of_measures}
22
+ null: false,
23
+ index: {name: "unit_on_stack_indx"},
24
+ foreign_key: {to_table: :cats_core_unit_of_measures}
25
25
 
26
26
  t.timestamps
27
27
  end
@@ -3,17 +3,17 @@ class CreateCatsCoreRoutes < ActiveRecord::Migration[6.1]
3
3
  create_table :cats_core_routes do |t|
4
4
  t.string :name, null: false
5
5
  t.references :region,
6
- null: false,
7
- index: {name: "region_on_routes_indx"},
8
- foreign_key: {to_table: :cats_core_locations}
6
+ null: false,
7
+ index: {name: "region_on_routes_indx"},
8
+ foreign_key: {to_table: :cats_core_locations}
9
9
  t.references :source,
10
- null: false,
11
- index: {name: "source_on_routes_indx"},
12
- foreign_key: {to_table: :cats_core_locations}
10
+ null: false,
11
+ index: {name: "source_on_routes_indx"},
12
+ foreign_key: {to_table: :cats_core_locations}
13
13
  t.references :destination,
14
- null: false,
15
- index: {name: "destination_on_routes_indx"},
16
- foreign_key: {to_table: :cats_core_locations}
14
+ null: false,
15
+ index: {name: "destination_on_routes_indx"},
16
+ foreign_key: {to_table: :cats_core_locations}
17
17
 
18
18
  t.timestamps
19
19
 
@@ -3,14 +3,14 @@ class CreateCatsCoreRhnRequests < ActiveRecord::Migration[6.1]
3
3
  create_table :cats_core_rhn_requests do |t|
4
4
  t.string :reference_no, unique: true
5
5
  t.references :commodity,
6
- null: false,
7
- index: {name: "commodity_on_rhn_indx"},
8
- foreign_key: {to_table: :cats_core_commodities}
6
+ null: false,
7
+ index: {name: "commodity_on_rhn_indx"},
8
+ foreign_key: {to_table: :cats_core_commodities}
9
9
  t.float :quantity, null: false
10
10
  t.references :unit,
11
- null: false,
12
- index: {name: "unit_on_rhn_indx"},
13
- foreign_key: {to_table: :cats_core_unit_of_measures}
11
+ null: false,
12
+ index: {name: "unit_on_rhn_indx"},
13
+ foreign_key: {to_table: :cats_core_unit_of_measures}
14
14
  t.date :request_date, null: false
15
15
  t.string :requested_by
16
16
 
@@ -7,13 +7,13 @@ class CreateCatsCoreDispatchPlans < ActiveRecord::Migration[6.1]
7
7
  t.references :dispatchable, polymorphic: true
8
8
  t.boolean :upstream, null: false, default: false
9
9
  t.references :prepared_by,
10
- null: false,
11
- index: {name: "pb_on_dp_indx"},
12
- foreign_key: {to_table: :cats_core_users}
10
+ null: false,
11
+ index: {name: "pb_on_dp_indx"},
12
+ foreign_key: {to_table: :cats_core_users}
13
13
  t.references :approved_by,
14
- null: true,
15
- index: {name: "ab_on_dp_indx"},
16
- foreign_key: {to_table: :cats_core_users}
14
+ null: true,
15
+ index: {name: "ab_on_dp_indx"},
16
+ foreign_key: {to_table: :cats_core_users}
17
17
 
18
18
  t.timestamps
19
19
  end
@@ -3,26 +3,26 @@ class CreateCatsCoreDispatchPlanItems < ActiveRecord::Migration[6.1]
3
3
  create_table :cats_core_dispatch_plan_items do |t|
4
4
  t.string :reference_no, null: false, unique: true
5
5
  t.references :dispatch_plan,
6
- null: false,
7
- index: {name: "dpi_on_dp_indx"},
8
- foreign_key: {to_table: :cats_core_dispatch_plans}
6
+ null: false,
7
+ index: {name: "dpi_on_dp_indx"},
8
+ foreign_key: {to_table: :cats_core_dispatch_plans}
9
9
  t.references :source,
10
- null: false,
11
- index: {name: "dpi_on_source_indx"},
12
- foreign_key: {to_table: :cats_core_locations}
10
+ null: false,
11
+ index: {name: "dpi_on_source_indx"},
12
+ foreign_key: {to_table: :cats_core_locations}
13
13
  t.references :destination,
14
- null: false,
15
- index: {name: "dpi_on_destination_indx"},
16
- foreign_key: {to_table: :cats_core_locations}
14
+ null: false,
15
+ index: {name: "dpi_on_destination_indx"},
16
+ foreign_key: {to_table: :cats_core_locations}
17
17
  t.references :commodity,
18
- null: false,
19
- index: {name: "commodity_on_dpi_indx"},
20
- foreign_key: {to_table: :cats_core_commodities}
18
+ null: false,
19
+ index: {name: "commodity_on_dpi_indx"},
20
+ foreign_key: {to_table: :cats_core_commodities}
21
21
  t.float :quantity, null: false
22
22
  t.references :unit,
23
- null: false,
24
- index: {name: "unit_on_dpi_indx"},
25
- foreign_key: {to_table: :cats_core_unit_of_measures}
23
+ null: false,
24
+ index: {name: "unit_on_dpi_indx"},
25
+ foreign_key: {to_table: :cats_core_unit_of_measures}
26
26
  t.string :commodity_status, null: false, default: "Good"
27
27
  t.string :status, null: false, default: "Unauthorized"
28
28
 
@@ -3,27 +3,27 @@ class CreateCatsCoreDispatches < ActiveRecord::Migration[6.1]
3
3
  create_table :cats_core_dispatches do |t|
4
4
  t.string :reference_no, unique: true
5
5
  t.references :dispatch_plan_item,
6
- null: false,
7
- index: {name: "dpi_on_dispatches_indx"},
8
- foreign_key: {to_table: :cats_core_dispatch_plan_items}
6
+ null: false,
7
+ index: {name: "dpi_on_dispatches_indx"},
8
+ foreign_key: {to_table: :cats_core_dispatch_plan_items}
9
9
  t.references :transporter,
10
- null: false,
11
- index: {name: "transporter_on_dispatches_indx"},
12
- foreign_key: {to_table: :cats_core_transporters}
10
+ null: false,
11
+ index: {name: "transporter_on_dispatches_indx"},
12
+ foreign_key: {to_table: :cats_core_transporters}
13
13
  t.string :plate_no, null: false
14
14
  t.string :driver_name, null: false
15
15
  t.string :driver_phone, null: false
16
16
  t.float :quantity, null: false, default: 0
17
17
  t.references :unit,
18
- null: false,
19
- index: {name: "unit_on_dispatches_indx"},
20
- foreign_key: {to_table: :cats_core_unit_of_measures}
18
+ null: false,
19
+ index: {name: "unit_on_dispatches_indx"},
20
+ foreign_key: {to_table: :cats_core_unit_of_measures}
21
21
  t.string :commodity_status, null: false, default: "Good"
22
22
  t.string :remark
23
23
  t.references :prepared_by,
24
- null: false,
25
- index: {name: "pb_on_dispatches_indx"},
26
- foreign_key: {to_table: :cats_core_users}
24
+ null: false,
25
+ index: {name: "pb_on_dispatches_indx"},
26
+ foreign_key: {to_table: :cats_core_users}
27
27
  t.string :dispatch_status, null: false
28
28
  t.jsonb :auth_details
29
29
 
@@ -2,23 +2,23 @@ class CreateCatsCoreDispatchAuthorizations < ActiveRecord::Migration[7.0]
2
2
  def change
3
3
  create_table :cats_core_dispatch_authorizations do |t|
4
4
  t.references :dispatch,
5
- null: false,
6
- index: {name: "dispatch_on_da_indx"},
7
- foreign_key: {to_table: :cats_core_dispatches}
5
+ null: false,
6
+ index: {name: "dispatch_on_da_indx"},
7
+ foreign_key: {to_table: :cats_core_dispatches}
8
8
  t.references :store,
9
- null: false,
10
- index: {name: "store_on_da_indx"},
11
- foreign_key: {to_table: :cats_core_stores}
9
+ null: false,
10
+ index: {name: "store_on_da_indx"},
11
+ foreign_key: {to_table: :cats_core_stores}
12
12
  t.float :quantity, null: false
13
13
  t.references :unit,
14
- null: false,
15
- index: {name: "unit_on_da_indx"},
16
- foreign_key: {to_table: :cats_core_unit_of_measures}
14
+ null: false,
15
+ index: {name: "unit_on_da_indx"},
16
+ foreign_key: {to_table: :cats_core_unit_of_measures}
17
17
  t.string :status, null: false, default: "Authorized"
18
18
  t.references :authorized_by,
19
- null: false,
20
- index: {name: "ab_on_da_indx"},
21
- foreign_key: {to_table: :cats_core_users}
19
+ null: false,
20
+ index: {name: "ab_on_da_indx"},
21
+ foreign_key: {to_table: :cats_core_users}
22
22
 
23
23
  t.timestamps
24
24
  end
@@ -2,26 +2,26 @@ class CreateCatsCoreDispatchTransactions < ActiveRecord::Migration[6.1]
2
2
  def change
3
3
  create_table :cats_core_dispatch_transactions do |t|
4
4
  t.references :source,
5
- null: false,
6
- index: {name: "stack_on_dt_indx"},
7
- foreign_key: {to_table: :cats_core_stacks}
5
+ null: false,
6
+ index: {name: "stack_on_dt_indx"},
7
+ foreign_key: {to_table: :cats_core_stacks}
8
8
  t.references :dispatch_authorization,
9
- null: false,
10
- index: {name: "da_on_dt_indx"},
11
- foreign_key: {to_table: :cats_core_dispatch_authorizations}
9
+ null: false,
10
+ index: {name: "da_on_dt_indx"},
11
+ foreign_key: {to_table: :cats_core_dispatch_authorizations}
12
12
  t.date :transaction_date, null: false
13
13
  t.float :quantity, null: false
14
14
  t.references :unit,
15
- null: false,
16
- index: {name: "unit_on_dt_indx"},
17
- foreign_key: {to_table: :cats_core_unit_of_measures}
15
+ null: false,
16
+ index: {name: "unit_on_dt_indx"},
17
+ foreign_key: {to_table: :cats_core_unit_of_measures}
18
18
  t.string :status, null: false, default: "Draft"
19
19
 
20
20
  t.timestamps
21
21
  end
22
22
  add_index(
23
23
  :cats_core_dispatch_transactions,
24
- [:source_id, :dispatch_authorization_id],
24
+ %i[source_id dispatch_authorization_id],
25
25
  unique: true,
26
26
  name: "sda_on_dt_uniq_indx"
27
27
  )
@@ -2,27 +2,27 @@ class CreateCatsCoreReceiptAuthorizations < ActiveRecord::Migration[6.1]
2
2
  def change
3
3
  create_table :cats_core_receipt_authorizations do |t|
4
4
  t.references :dispatch,
5
- null: false,
6
- index: {name: "dispatch_on_receipt_authorizations_indx"},
7
- foreign_key: {to_table: :cats_core_dispatches}
5
+ null: false,
6
+ index: {name: "dispatch_on_receipt_authorizations_indx"},
7
+ foreign_key: {to_table: :cats_core_dispatches}
8
8
  t.references :store,
9
- null: false,
10
- index: {name: "store_on_ra_indx"},
11
- foreign_key: {to_table: :cats_core_stores}
9
+ null: false,
10
+ index: {name: "store_on_ra_indx"},
11
+ foreign_key: {to_table: :cats_core_stores}
12
12
  t.float :quantity, null: false
13
13
  t.references :unit,
14
- null: false,
15
- index: {name: "r_unit_on_da_indx"},
16
- foreign_key: {to_table: :cats_core_unit_of_measures}
14
+ null: false,
15
+ index: {name: "r_unit_on_da_indx"},
16
+ foreign_key: {to_table: :cats_core_unit_of_measures}
17
17
  t.float :received_quantity, null: false, default: 0
18
18
  t.string :status, null: false, default: "Authorized"
19
19
  t.string :remark
20
20
  t.jsonb :auth_details
21
21
  t.boolean :driver_confirmed, null: false, default: false
22
22
  t.references :authorized_by,
23
- null: false,
24
- index: {name: "ab_on_receipt_authorizations_indx"},
25
- foreign_key: {to_table: :cats_core_users}
23
+ null: false,
24
+ index: {name: "ab_on_receipt_authorizations_indx"},
25
+ foreign_key: {to_table: :cats_core_users}
26
26
 
27
27
  t.timestamps
28
28
  end
@@ -2,16 +2,16 @@ class CreateCatsCoreReceipts < ActiveRecord::Migration[7.0]
2
2
  def change
3
3
  create_table :cats_core_receipts do |t|
4
4
  t.references :receipt_authorization,
5
- null: false,
6
- index: {name: "ra_on_receipts_indx"},
7
- foreign_key: {to_table: :cats_core_receipt_authorizations}
5
+ null: false,
6
+ index: {name: "ra_on_receipts_indx"},
7
+ foreign_key: {to_table: :cats_core_receipt_authorizations}
8
8
  t.string :commodity_status, null: false
9
9
  t.string :commodity_grade
10
10
  t.float :quantity, null: false
11
11
  t.references :unit,
12
- null: false,
13
- index: {name: "unit_on_receipts_indx"},
14
- foreign_key: {to_table: :cats_core_unit_of_measures}
12
+ null: false,
13
+ index: {name: "unit_on_receipts_indx"},
14
+ foreign_key: {to_table: :cats_core_unit_of_measures}
15
15
  t.string :remark
16
16
 
17
17
  t.timestamps
@@ -2,14 +2,14 @@ class CreateCatsCoreLostCommodities < ActiveRecord::Migration[7.0]
2
2
  def change
3
3
  create_table :cats_core_lost_commodities do |t|
4
4
  t.references :receipt_authorization,
5
- null: false,
6
- index: {name: "ra_on_lc_indx"},
7
- foreign_key: {to_table: :cats_core_receipt_authorizations}
5
+ null: false,
6
+ index: {name: "ra_on_lc_indx"},
7
+ foreign_key: {to_table: :cats_core_receipt_authorizations}
8
8
  t.float :quantity, null: false
9
9
  t.references :unit,
10
- null: false,
11
- index: {name: "unit_on_lc_indx"},
12
- foreign_key: {to_table: :cats_core_unit_of_measures}
10
+ null: false,
11
+ index: {name: "unit_on_lc_indx"},
12
+ foreign_key: {to_table: :cats_core_unit_of_measures}
13
13
  t.string :remark
14
14
 
15
15
  t.timestamps
@@ -2,19 +2,19 @@ class CreateCatsCoreReceiptTransactions < ActiveRecord::Migration[6.1]
2
2
  def change
3
3
  create_table :cats_core_receipt_transactions do |t|
4
4
  t.references :receipt_authorization,
5
- null: false,
6
- index: {name: "receipt_authorization_on_rt_indx"},
7
- foreign_key: {to_table: :cats_core_receipt_authorizations}
5
+ null: false,
6
+ index: {name: "receipt_authorization_on_rt_indx"},
7
+ foreign_key: {to_table: :cats_core_receipt_authorizations}
8
8
  t.references :destination,
9
- null: false,
10
- index: {name: "stack_on_rt_indx"},
11
- foreign_key: {to_table: :cats_core_stacks}
9
+ null: false,
10
+ index: {name: "stack_on_rt_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
- null: false,
16
- index: {name: "r_unit_on_dt_indx"},
17
- foreign_key: {to_table: :cats_core_unit_of_measures}
15
+ null: false,
16
+ index: {name: "r_unit_on_dt_indx"},
17
+ foreign_key: {to_table: :cats_core_unit_of_measures}
18
18
  t.string :status, null: false, default: "Draft"
19
19
 
20
20
  t.timestamps
@@ -2,19 +2,19 @@ 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
- null: false,
6
- index: {name: "source_on_st_indx"},
7
- foreign_key: {to_table: :cats_core_stacks}
5
+ null: false,
6
+ index: {name: "source_on_st_indx"},
7
+ foreign_key: {to_table: :cats_core_stacks}
8
8
  t.references :destination,
9
- null: false,
10
- index: {name: "destination_on_st_indx"},
11
- foreign_key: {to_table: :cats_core_stacks}
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
- null: false,
16
- index: {name: "unit_on_st_indx"},
17
- foreign_key: {to_table: :cats_core_unit_of_measures}
15
+ null: false,
16
+ index: {name: "unit_on_st_indx"},
17
+ foreign_key: {to_table: :cats_core_unit_of_measures}
18
18
  t.string :status, null: false, default: "Draft"
19
19
 
20
20
  t.timestamps
@@ -4,9 +4,9 @@ class CreateCatsCoreTransportPlans < ActiveRecord::Migration[6.1]
4
4
  t.string :reference_no, unique: true
5
5
  t.string :plan_type, null: false, default: "Regional"
6
6
  t.references :region,
7
- null: true,
8
- index: {name: "region_on_tp_indx"},
9
- foreign_key: {to_table: :cats_core_locations}
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
- null: false,
6
- index: {name: "route_on_tpi_indx"},
7
- foreign_key: {to_table: :cats_core_routes}
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
- null: false,
10
- index: {name: "tp_on_tpi_indx"},
11
- foreign_key: {to_table: :cats_core_transport_plans}
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
- null: false,
15
- index: {name: "unit_on_tpi_indx"},
16
- foreign_key: {to_table: :cats_core_unit_of_measures}
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
@@ -9,9 +9,9 @@ class CreateCatsCoreTransportBids < ActiveRecord::Migration[6.1]
9
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
- null: false,
13
- index: {name: "tp_on_tb_indx"},
14
- foreign_key: {to_table: :cats_core_transport_plans}
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,18 +2,18 @@ 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
- null: false,
6
- index: {name: "tb_on_tbi_indx"},
7
- foreign_key: {to_table: :cats_core_transport_bids}
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
- null: false,
10
- index: {name: "tpi_on_tbi_indx"},
11
- foreign_key: {to_table: :cats_core_transport_plan_items}
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
- null: false,
15
- index: {name: "unit_on_tbi_indx"},
16
- foreign_key: {to_table: :cats_core_unit_of_measures}
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
@@ -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
- null: false,
6
- index: {name: "to_on_tb_indx"},
7
- foreign_key: {to_table: :cats_core_transport_bids}
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
- null: false,
10
- index: {name: "to_on_transporter_indx"},
11
- foreign_key: {to_table: :cats_core_transporters}
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: "tb_and_t_on_to_indx"
17
+ t.index %i[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
- null: false,
6
- index: {name: "to_on_oi_indx"},
7
- foreign_key: {to_table: :cats_core_transport_offers}
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
- null: false,
10
- index: {name: "tbi_on_to_indx"},
11
- foreign_key: {to_table: :cats_core_transport_bid_items}
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