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.
Files changed (263) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +7 -7
  3. data/app/controllers/cats/core/access_controller.rb +4 -4
  4. data/app/controllers/cats/core/application_controller.rb +4 -4
  5. data/app/controllers/cats/core/commodities_controller.rb +7 -7
  6. data/app/controllers/cats/core/commodity_categories_controller.rb +4 -4
  7. data/app/controllers/cats/core/dispatch_authorizations_controller.rb +30 -7
  8. data/app/controllers/cats/core/dispatch_plan_items_controller.rb +4 -4
  9. data/app/controllers/cats/core/dispatch_plans_controller.rb +10 -10
  10. data/app/controllers/cats/core/dispatch_transactions_controller.rb +5 -5
  11. data/app/controllers/cats/core/dispatches_controller.rb +19 -19
  12. data/app/controllers/cats/core/loans_controller.rb +1 -1
  13. data/app/controllers/cats/core/locations_controller.rb +4 -4
  14. data/app/controllers/cats/core/menus_controller.rb +1 -1
  15. data/app/controllers/cats/core/notifications_controller.rb +5 -5
  16. data/app/controllers/cats/core/purchase_orders_controller.rb +3 -3
  17. data/app/controllers/cats/core/receipt_authorizations_controller.rb +30 -18
  18. data/app/controllers/cats/core/receipt_transactions_controller.rb +4 -4
  19. data/app/controllers/cats/core/receipts_controller.rb +1 -1
  20. data/app/controllers/cats/core/roles_controller.rb +3 -3
  21. data/app/controllers/cats/core/round_beneficiaries_controller.rb +13 -13
  22. data/app/controllers/cats/core/round_plans_controller.rb +13 -13
  23. data/app/controllers/cats/core/routes_controller.rb +2 -2
  24. data/app/controllers/cats/core/spaces_controller.rb +1 -1
  25. data/app/controllers/cats/core/stack_transactions_controller.rb +3 -3
  26. data/app/controllers/cats/core/stacks_controller.rb +15 -7
  27. data/app/controllers/cats/core/stores_controller.rb +14 -14
  28. data/app/controllers/cats/core/swaps_controller.rb +2 -2
  29. data/app/controllers/cats/core/transporters_controller.rb +1 -1
  30. data/app/controllers/cats/core/users_controller.rb +24 -12
  31. data/app/controllers/concerns/cats/core/common.rb +24 -23
  32. data/app/helpers/cats/core/document_helper.rb +1 -1
  33. data/app/models/cats/core/authorization.rb +9 -9
  34. data/app/models/cats/core/beneficiary.rb +6 -6
  35. data/app/models/cats/core/beneficiary_plan_item.rb +9 -9
  36. data/app/models/cats/core/beneficiary_round_plan_item.rb +2 -2
  37. data/app/models/cats/core/cash_donation.rb +1 -1
  38. data/app/models/cats/core/commodity.rb +47 -33
  39. data/app/models/cats/core/commodity_donation.rb +2 -2
  40. data/app/models/cats/core/commodity_substitution.rb +15 -7
  41. data/app/models/cats/core/contract_item.rb +2 -2
  42. data/app/models/cats/core/dispatch.rb +36 -21
  43. data/app/models/cats/core/dispatch_authorization.rb +31 -5
  44. data/app/models/cats/core/dispatch_plan.rb +19 -10
  45. data/app/models/cats/core/dispatch_plan_item.rb +27 -14
  46. data/app/models/cats/core/dispatch_transaction.rb +15 -5
  47. data/app/models/cats/core/gift_certificate.rb +3 -3
  48. data/app/models/cats/core/hub_authorization.rb +7 -7
  49. data/app/models/cats/core/loan.rb +2 -2
  50. data/app/models/cats/core/location.rb +12 -8
  51. data/app/models/cats/core/lost_commodity.rb +2 -2
  52. data/app/models/cats/core/notification.rb +2 -2
  53. data/app/models/cats/core/offer_item.rb +4 -4
  54. data/app/models/cats/core/plan.rb +9 -9
  55. data/app/models/cats/core/plan_item.rb +5 -5
  56. data/app/models/cats/core/plan_item_detail.rb +2 -2
  57. data/app/models/cats/core/project.rb +1 -1
  58. data/app/models/cats/core/purchase_order.rb +5 -5
  59. data/app/models/cats/core/ration.rb +1 -1
  60. data/app/models/cats/core/receipt.rb +5 -5
  61. data/app/models/cats/core/receipt_authorization.rb +6 -2
  62. data/app/models/cats/core/receipt_transaction.rb +8 -4
  63. data/app/models/cats/core/rhn_request.rb +8 -8
  64. data/app/models/cats/core/role_menu.rb +1 -1
  65. data/app/models/cats/core/round_beneficiary.rb +10 -2
  66. data/app/models/cats/core/round_plan.rb +15 -11
  67. data/app/models/cats/core/round_plan_item.rb +9 -5
  68. data/app/models/cats/core/round_plan_item_detail.rb +3 -3
  69. data/app/models/cats/core/round_ration.rb +2 -2
  70. data/app/models/cats/core/route.rb +12 -8
  71. data/app/models/cats/core/stack.rb +52 -34
  72. data/app/models/cats/core/stack_transaction.rb +3 -3
  73. data/app/models/cats/core/stacking_rule.rb +2 -2
  74. data/app/models/cats/core/store.rb +29 -7
  75. data/app/models/cats/core/swap.rb +5 -5
  76. data/app/models/cats/core/transaction.rb +6 -6
  77. data/app/models/cats/core/transport_bid.rb +13 -13
  78. data/app/models/cats/core/transport_bid_item.rb +2 -2
  79. data/app/models/cats/core/transport_offer.rb +3 -3
  80. data/app/models/cats/core/transport_order.rb +8 -8
  81. data/app/models/cats/core/transport_order_item.rb +2 -2
  82. data/app/models/cats/core/transport_plan.rb +7 -7
  83. data/app/models/cats/core/transport_plan_item.rb +2 -2
  84. data/app/models/cats/core/transport_requisition.rb +9 -9
  85. data/app/models/cats/core/transport_requisition_detail.rb +2 -2
  86. data/app/models/cats/core/transport_requisition_item.rb +3 -3
  87. data/app/models/cats/core/transporter.rb +4 -0
  88. data/app/models/cats/core/unit_conversion.rb +4 -4
  89. data/app/models/cats/core/unit_of_measure.rb +4 -4
  90. data/app/models/cats/core/user.rb +11 -11
  91. data/app/models/concerns/cats/core/dispatchable.rb +3 -3
  92. data/app/notifications/cats/core/allocation_notification.rb +1 -1
  93. data/app/notifications/cats/core/dispatch_authorization_notification.rb +35 -0
  94. data/app/notifications/cats/core/dispatch_notification.rb +1 -1
  95. data/app/notifications/cats/core/receipt_authorization_notification.rb +1 -1
  96. data/app/notifications/cats/core/round_plan_notification.rb +1 -1
  97. data/app/notifications/cats/core/simple_notification.rb +1 -1
  98. data/app/serializers/cats/core/cash_donation_serializer.rb +1 -1
  99. data/app/serializers/cats/core/commodity_donation_serializer.rb +2 -2
  100. data/app/serializers/cats/core/commodity_serializer.rb +2 -2
  101. data/app/serializers/cats/core/dispatch_authorization_serializer.rb +2 -2
  102. data/app/serializers/cats/core/dispatch_plan_item_serializer.rb +3 -3
  103. data/app/serializers/cats/core/dispatch_plan_serializer.rb +1 -1
  104. data/app/serializers/cats/core/dispatch_serializer.rb +2 -2
  105. data/app/serializers/cats/core/dispatch_transaction_serializer.rb +1 -1
  106. data/app/serializers/cats/core/loan_serializer.rb +1 -1
  107. data/app/serializers/cats/core/purchase_order_serializer.rb +2 -2
  108. data/app/serializers/cats/core/receipt_authorization_serializer.rb +2 -2
  109. data/app/serializers/cats/core/receipt_serializer.rb +1 -1
  110. data/app/serializers/cats/core/receipt_transaction_serializer.rb +2 -2
  111. data/app/serializers/cats/core/round_beneficiary_serializer.rb +1 -1
  112. data/app/serializers/cats/core/round_plan_serializer.rb +1 -1
  113. data/app/serializers/cats/core/stack_serializer.rb +1 -1
  114. data/app/serializers/cats/core/store_serializer.rb +1 -1
  115. data/app/serializers/cats/core/swap_serializer.rb +2 -2
  116. data/app/services/cats/core/authorization_service.rb +36 -18
  117. data/app/services/cats/core/beneficiary_service.rb +11 -11
  118. data/app/services/cats/core/dispatch_plan_service.rb +10 -10
  119. data/app/services/cats/core/dispatch_service.rb +31 -31
  120. data/app/services/cats/core/notification_service.rb +5 -5
  121. data/app/services/cats/core/round_plan_service.rb +23 -23
  122. data/app/services/cats/core/space_service.rb +11 -11
  123. data/app/services/cats/core/stack_service.rb +10 -10
  124. data/app/services/cats/core/token_auth_service.rb +4 -4
  125. data/app/services/cats/core/user_service.rb +19 -0
  126. data/app/utils/cats/core/util.rb +1 -1
  127. data/config/routes.rb +110 -105
  128. data/config/spring.rb +1 -0
  129. data/db/migrate/20210715114910_create_cats_core_users.rb +3 -3
  130. data/db/migrate/20210715120018_create_cats_core_roles.rb +14 -14
  131. data/db/migrate/20210715121244_create_cats_core_menus.rb +3 -3
  132. data/db/migrate/20210715122141_create_cats_core_menu_items.rb +3 -3
  133. data/db/migrate/20210715122423_create_cats_core_role_menus.rb +13 -13
  134. data/db/migrate/20210717031810_create_cats_core_plans.rb +4 -4
  135. data/db/migrate/20210717032024_create_cats_core_plan_items.rb +18 -18
  136. data/db/migrate/20210717032260_create_cats_core_beneficiary_categories.rb +3 -3
  137. data/db/migrate/20210717032270_create_cats_core_rations.rb +10 -10
  138. data/db/migrate/20210717032290_create_cats_core_beneficiary_plan_items.rb +7 -7
  139. data/db/migrate/20210717032295_create_cats_core_plan_item_details.rb +7 -7
  140. data/db/migrate/20210717032330_create_cats_core_commodity_donations.rb +12 -12
  141. data/db/migrate/20210717032408_create_cats_core_cash_donations.rb +6 -6
  142. data/db/migrate/20210717032602_create_cats_core_gift_certificates.rb +12 -12
  143. data/db/migrate/20210717032855_create_cats_core_purchase_orders.rb +12 -12
  144. data/db/migrate/20210717032927_create_cats_core_projects.rb +3 -3
  145. data/db/migrate/20210717033223_create_cats_core_commodities.rb +10 -10
  146. data/db/migrate/20210717140855_create_cats_core_stores.rb +3 -3
  147. data/db/migrate/20210717171101_create_cats_core_stacks.rb +11 -11
  148. data/db/migrate/20210718040129_create_cats_core_routes.rb +9 -9
  149. data/db/migrate/20210718042755_create_cats_core_rhn_requests.rb +6 -6
  150. data/db/migrate/20210718043328_create_cats_core_dispatch_plans.rb +7 -7
  151. data/db/migrate/20210718043401_create_cats_core_dispatch_plan_items.rb +17 -17
  152. data/db/migrate/20210718045516_create_cats_core_dispatches.rb +13 -13
  153. data/db/migrate/20210718055414_create_cats_core_dispatch_authorizations.rb +13 -13
  154. data/db/migrate/20210718202957_create_cats_core_dispatch_transactions.rb +11 -11
  155. data/db/migrate/20210727074646_create_cats_core_receipt_authorizations.rb +13 -13
  156. data/db/migrate/20210727105834_create_cats_core_receipts.rb +6 -6
  157. data/db/migrate/20210728041505_create_cats_core_lost_commodities.rb +6 -6
  158. data/db/migrate/20210814160628_create_cats_core_receipt_transactions.rb +10 -10
  159. data/db/migrate/20210814175406_create_cats_core_stack_transactions.rb +10 -10
  160. data/db/migrate/20211024063240_add_status_to_cats_core_rhn_requests.rb +1 -1
  161. data/db/migrate/20211030133752_add_status_to_cats_core_commodities.rb +1 -1
  162. data/db/migrate/20211215114737_create_cats_core_transport_plans.rb +4 -4
  163. data/db/migrate/20211215114835_create_cats_core_transport_plan_items.rb +9 -9
  164. data/db/migrate/20211215121151_create_cats_core_transport_bids.rb +4 -4
  165. data/db/migrate/20211215124452_create_cats_core_transport_bid_items.rb +10 -10
  166. data/db/migrate/20211229160125_create_cats_core_transport_offers.rb +7 -7
  167. data/db/migrate/20211229160126_create_cats_core_offer_items.rb +6 -6
  168. data/db/migrate/20211229160127_create_cats_core_transport_contracts.rb +6 -6
  169. data/db/migrate/20211229160128_create_cats_core_contract_items.rb +9 -9
  170. data/db/migrate/20211229160129_create_cats_core_commodity_substitutions.rb +10 -10
  171. data/db/migrate/20220103152802_create_cats_core_tenderers.rb +6 -6
  172. data/db/migrate/20220107121752_create_cats_core_round_plans.rb +7 -7
  173. data/db/migrate/20220107122280_create_cats_core_round_rations.rb +12 -12
  174. data/db/migrate/20220107125025_create_cats_core_round_plan_items.rb +19 -19
  175. data/db/migrate/20220107126025_create_cats_core_beneficiary_round_plan_items.rb +8 -8
  176. data/db/migrate/20220107132433_create_cats_core_round_plan_item_details.rb +9 -9
  177. data/db/migrate/20220209083928_create_cats_core_hub_authorizations.rb +12 -12
  178. data/db/migrate/20220416143416_create_cats_core_unit_conversions.rb +6 -6
  179. data/db/migrate/20220417105839_create_cats_core_transport_requisitions.rb +12 -12
  180. data/db/migrate/20220417123835_create_cats_core_transport_requisition_items.rb +9 -9
  181. data/db/migrate/20220417151821_create_cats_core_transport_requisition_details.rb +6 -6
  182. data/db/migrate/20220506082329_create_cats_core_transport_orders.rb +10 -10
  183. data/db/migrate/20220506083042_create_cats_core_transport_order_items.rb +13 -13
  184. data/db/migrate/20220511082354_create_cats_core_beneficiaries.rb +6 -6
  185. data/db/migrate/20220626063501_create_cats_core_loans.rb +6 -6
  186. data/db/migrate/20220626063757_create_cats_core_swaps.rb +12 -12
  187. data/db/migrate/20220626132050_create_cats_core_round_beneficiaries.rb +13 -13
  188. data/db/migrate/20220923190857_create_cats_core_application_settings.rb +3 -3
  189. data/lib/cats/core/engine.rb +4 -4
  190. data/lib/cats/core/version.rb +1 -1
  191. data/lib/cats_core.rb +8 -8
  192. data/spec/factories/cats/core/application_modules.rb +1 -1
  193. data/spec/factories/cats/core/application_settings.rb +1 -1
  194. data/spec/factories/cats/core/beneficiaries.rb +3 -3
  195. data/spec/factories/cats/core/beneficiary_categories.rb +1 -1
  196. data/spec/factories/cats/core/beneficiary_plan_items.rb +1 -1
  197. data/spec/factories/cats/core/beneficiary_round_plan_items.rb +1 -1
  198. data/spec/factories/cats/core/cash_donations.rb +1 -1
  199. data/spec/factories/cats/core/commodities.rb +1 -1
  200. data/spec/factories/cats/core/commodity_categories.rb +1 -1
  201. data/spec/factories/cats/core/commodity_donations.rb +1 -1
  202. data/spec/factories/cats/core/commodity_substitutions.rb +2 -2
  203. data/spec/factories/cats/core/contract_items.rb +1 -1
  204. data/spec/factories/cats/core/currencies.rb +1 -1
  205. data/spec/factories/cats/core/dispatch_authorizations.rb +7 -11
  206. data/spec/factories/cats/core/dispatch_plan_items.rb +16 -1
  207. data/spec/factories/cats/core/dispatch_plans.rb +1 -1
  208. data/spec/factories/cats/core/dispatch_transactions.rb +2 -4
  209. data/spec/factories/cats/core/dispatches.rb +16 -25
  210. data/spec/factories/cats/core/donors.rb +1 -1
  211. data/spec/factories/cats/core/gift_certificates.rb +1 -1
  212. data/spec/factories/cats/core/hub_authorizations.rb +1 -1
  213. data/spec/factories/cats/core/loans.rb +1 -1
  214. data/spec/factories/cats/core/locations.rb +6 -6
  215. data/spec/factories/cats/core/lost_commodities.rb +1 -1
  216. data/spec/factories/cats/core/menu_items.rb +1 -1
  217. data/spec/factories/cats/core/menus.rb +1 -1
  218. data/spec/factories/cats/core/notification_rules.rb +1 -1
  219. data/spec/factories/cats/core/notifications.rb +2 -2
  220. data/spec/factories/cats/core/offer_items.rb +1 -1
  221. data/spec/factories/cats/core/operators.rb +1 -1
  222. data/spec/factories/cats/core/plan_item_details.rb +1 -1
  223. data/spec/factories/cats/core/plan_items.rb +1 -1
  224. data/spec/factories/cats/core/plans.rb +1 -1
  225. data/spec/factories/cats/core/programs.rb +1 -1
  226. data/spec/factories/cats/core/projects.rb +1 -1
  227. data/spec/factories/cats/core/purchase_orders.rb +1 -1
  228. data/spec/factories/cats/core/rations.rb +1 -1
  229. data/spec/factories/cats/core/receipt_authorizations.rb +1 -1
  230. data/spec/factories/cats/core/receipt_transactions.rb +2 -2
  231. data/spec/factories/cats/core/receipts.rb +1 -1
  232. data/spec/factories/cats/core/rhn_requests.rb +1 -1
  233. data/spec/factories/cats/core/role_menus.rb +1 -1
  234. data/spec/factories/cats/core/roles.rb +1 -1
  235. data/spec/factories/cats/core/round_beneficiaries.rb +1 -1
  236. data/spec/factories/cats/core/round_plan_item_details.rb +3 -3
  237. data/spec/factories/cats/core/round_plan_items.rb +1 -1
  238. data/spec/factories/cats/core/round_plans.rb +1 -1
  239. data/spec/factories/cats/core/round_rations.rb +1 -1
  240. data/spec/factories/cats/core/routes.rb +1 -1
  241. data/spec/factories/cats/core/stack_transactions.rb +1 -1
  242. data/spec/factories/cats/core/stacking_rules.rb +1 -1
  243. data/spec/factories/cats/core/stacks.rb +1 -1
  244. data/spec/factories/cats/core/stores.rb +1 -1
  245. data/spec/factories/cats/core/suppliers.rb +1 -1
  246. data/spec/factories/cats/core/swaps.rb +1 -1
  247. data/spec/factories/cats/core/tenderers.rb +1 -1
  248. data/spec/factories/cats/core/transport_bid_items.rb +1 -1
  249. data/spec/factories/cats/core/transport_bids.rb +1 -1
  250. data/spec/factories/cats/core/transport_contracts.rb +1 -1
  251. data/spec/factories/cats/core/transport_offers.rb +1 -1
  252. data/spec/factories/cats/core/transport_order_items.rb +1 -1
  253. data/spec/factories/cats/core/transport_orders.rb +1 -1
  254. data/spec/factories/cats/core/transport_plan_items.rb +1 -1
  255. data/spec/factories/cats/core/transport_plans.rb +1 -1
  256. data/spec/factories/cats/core/transport_requisition_details.rb +1 -1
  257. data/spec/factories/cats/core/transport_requisition_items.rb +1 -1
  258. data/spec/factories/cats/core/transport_requisitions.rb +1 -1
  259. data/spec/factories/cats/core/transporters.rb +1 -1
  260. data/spec/factories/cats/core/unit_conversions.rb +1 -1
  261. data/spec/factories/cats/core/unit_of_measures.rb +1 -1
  262. data/spec/factories/cats/core/users.rb +2 -2
  263. metadata +19 -2
@@ -2,17 +2,17 @@ class CreateCatsCorePlanItemDetails < ActiveRecord::Migration[6.1]
2
2
  def change
3
3
  create_table :cats_core_plan_item_details do |t|
4
4
  t.references :beneficiary_plan_item,
5
- null: false,
6
- index: { name: 'bpi_on_pid_indx' },
7
- foreign_key: { to_table: :cats_core_beneficiary_plan_items }
5
+ null: false,
6
+ index: {name: "bpi_on_pid_indx"},
7
+ foreign_key: {to_table: :cats_core_beneficiary_plan_items}
8
8
  t.references :ration,
9
- null: false,
10
- index: { name: 'ration_on_pid_indx' },
11
- foreign_key: { to_table: :cats_core_rations }
9
+ null: false,
10
+ index: {name: "ration_on_pid_indx"},
11
+ foreign_key: {to_table: :cats_core_rations}
12
12
  t.float :quantity, null: false
13
13
 
14
14
  t.timestamps
15
15
  end
16
- add_index(:cats_core_plan_item_details, [:beneficiary_plan_item_id, :ration_id], unique: true, name: 'bpii_ri_on_pid_indx')
16
+ add_index(:cats_core_plan_item_details, [:beneficiary_plan_item_id, :ration_id], unique: true, name: "bpii_ri_on_pid_indx")
17
17
  end
18
18
  end
@@ -6,22 +6,22 @@ class CreateCatsCoreCommodityDonations < ActiveRecord::Migration[6.1]
6
6
  t.string :shipping_reference
7
7
  t.date :donated_on, null: false
8
8
  t.references :donor,
9
- null: false,
10
- index: { name: 'donor_on_cd_indx' },
11
- foreign_key: { to_table: :cats_core_donors }
9
+ null: false,
10
+ index: {name: "donor_on_cd_indx"},
11
+ foreign_key: {to_table: :cats_core_donors}
12
12
  t.references :commodity_category,
13
- null: false,
14
- index: { name: 'cc_on_cd_indx' },
15
- foreign_key: { to_table: :cats_core_commodity_categories }
13
+ null: false,
14
+ index: {name: "cc_on_cd_indx"},
15
+ foreign_key: {to_table: :cats_core_commodity_categories}
16
16
  t.references :plan,
17
- null: true,
18
- index: { name: 'plan_on_cd_indx' },
19
- foreign_key: { to_table: :cats_core_plans }
17
+ null: true,
18
+ index: {name: "plan_on_cd_indx"},
19
+ foreign_key: {to_table: :cats_core_plans}
20
20
  t.float :quantity, null: false
21
21
  t.references :unit,
22
- null: false,
23
- index: { name: 'unit_on_cd_indx' },
24
- foreign_key: { to_table: :cats_core_unit_of_measures }
22
+ null: false,
23
+ index: {name: "unit_on_cd_indx"},
24
+ foreign_key: {to_table: :cats_core_unit_of_measures}
25
25
 
26
26
  t.timestamps
27
27
  end
@@ -5,14 +5,14 @@ class CreateCatsCoreCashDonations < ActiveRecord::Migration[7.0]
5
5
  t.string :description
6
6
  t.date :donated_on, null: false
7
7
  t.references :donor,
8
- null: false,
9
- index: { name: 'donor_on_cad_indx' },
10
- foreign_key: { to_table: :cats_core_donors }
8
+ null: false,
9
+ index: {name: "donor_on_cad_indx"},
10
+ foreign_key: {to_table: :cats_core_donors}
11
11
  t.float :amount, null: false
12
12
  t.references :currency,
13
- null: false,
14
- index: { name: 'currency_on_cad_indx' },
15
- foreign_key: { to_table: :cats_core_currencies }
13
+ null: false,
14
+ index: {name: "currency_on_cad_indx"},
15
+ foreign_key: {to_table: :cats_core_currencies}
16
16
 
17
17
  t.timestamps
18
18
  end
@@ -11,23 +11,23 @@ class CreateCatsCoreGiftCertificates < ActiveRecord::Migration[6.1]
11
11
  t.string :bill_of_lading_no
12
12
  t.float :quantity, null: false
13
13
  t.references :commodity_category,
14
- null: false,
15
- index: { name: 'gc_on_cc_indx' },
16
- foreign_key: { to_table: :cats_core_commodity_categories }
14
+ null: false,
15
+ index: {name: "gc_on_cc_indx"},
16
+ foreign_key: {to_table: :cats_core_commodity_categories}
17
17
  t.references :unit,
18
- null: false,
19
- index: { name: 'unit_on_gc_indx' },
20
- foreign_key: { to_table: :cats_core_unit_of_measures }
18
+ null: false,
19
+ index: {name: "unit_on_gc_indx"},
20
+ foreign_key: {to_table: :cats_core_unit_of_measures}
21
21
  t.references :destination_warehouse,
22
- null: false,
23
- index: { name: 'dw_on_gc_indx' },
24
- foreign_key: { to_table: :cats_core_locations }
22
+ null: false,
23
+ index: {name: "dw_on_gc_indx"},
24
+ foreign_key: {to_table: :cats_core_locations}
25
25
  t.float :estimated_price
26
26
  t.float :estimated_tax
27
27
  t.references :currency,
28
- null: false,
29
- index: { name: 'currency_on_gc_indx' },
30
- foreign_key: { to_table: :cats_core_currencies }
28
+ null: false,
29
+ index: {name: "currency_on_gc_indx"},
30
+ foreign_key: {to_table: :cats_core_currencies}
31
31
  t.string :registration_no
32
32
  t.string :requested_by, null: false
33
33
  t.string :request_reference
@@ -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,23 +3,23 @@ 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
20
20
  t.date :best_use_before, null: false
21
21
  t.float :volume_per_metric_ton
22
- t.string :arrival_status, null: false, default: 'At Source'
22
+ t.string :arrival_status, null: false, default: "At Source"
23
23
  t.boolean :approved, null: false, default: false
24
24
  t.string :shipping_reference
25
25
  t.string :commodity_grade
@@ -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 }
18
- t.string :commodity_status, null: false, default: 'Good'
19
- t.string :stack_status, null: false, default: 'Reserved'
15
+ null: false,
16
+ index: {name: "store_on_stack_indx"},
17
+ foreign_key: {to_table: :cats_core_stores}
18
+ t.string :commodity_status, null: false, default: "Good"
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
 
@@ -3,17 +3,17 @@ class CreateCatsCoreDispatchPlans < ActiveRecord::Migration[6.1]
3
3
  create_table :cats_core_dispatch_plans do |t|
4
4
  t.string :reference_no, unique: true
5
5
  t.string :description
6
- t.string :status, null: false, default: 'Draft'
6
+ t.string :status, null: false, default: "Draft"
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,28 +3,28 @@ 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 }
26
- t.string :commodity_status, null: false, default: 'Good'
27
- t.string :status, null: false, default: 'Unauthorized'
23
+ null: false,
24
+ index: {name: "unit_on_dpi_indx"},
25
+ foreign_key: {to_table: :cats_core_unit_of_measures}
26
+ t.string :commodity_status, null: false, default: "Good"
27
+ t.string :status, null: false, default: "Unauthorized"
28
28
 
29
29
  t.timestamps
30
30
  end
@@ -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 }
21
- t.string :commodity_status, null: false, default: 'Good'
18
+ null: false,
19
+ index: {name: "unit_on_dispatches_indx"},
20
+ foreign_key: {to_table: :cats_core_unit_of_measures}
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 }
17
- t.string :status, null: false, default: 'Authorized'
14
+ null: false,
15
+ index: {name: "unit_on_da_indx"},
16
+ foreign_key: {to_table: :cats_core_unit_of_measures}
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,20 +2,20 @@ 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 }
18
- t.string :status, null: false, default: 'Draft'
15
+ null: false,
16
+ index: {name: "unit_on_dt_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
@@ -23,7 +23,7 @@ class CreateCatsCoreDispatchTransactions < ActiveRecord::Migration[6.1]
23
23
  :cats_core_dispatch_transactions,
24
24
  [:source_id, :dispatch_authorization_id],
25
25
  unique: true,
26
- name: 'sda_on_dt_uniq_indx'
26
+ name: "sda_on_dt_uniq_indx"
27
27
  )
28
28
  end
29
29
  end
@@ -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
- t.string :status, null: false, default: 'Authorized'
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,20 +2,20 @@ 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 }
18
- t.string :status, null: false, default: 'Draft'
15
+ null: false,
16
+ index: {name: "r_unit_on_dt_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