mks_rate 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +28 -0
  4. data/Rakefile +38 -0
  5. data/app/controllers/mks/rate/application_controller.rb +8 -0
  6. data/app/controllers/mks/rate/chargeable_services_controller.rb +52 -0
  7. data/app/controllers/mks/rate/rate_change_requests_controller.rb +62 -0
  8. data/app/controllers/mks/rate/service_bundles_controller.rb +72 -0
  9. data/app/controllers/mks/rate/service_delivery_units_controller.rb +39 -0
  10. data/app/controllers/mks/rate/service_rates_controller.rb +14 -0
  11. data/app/controllers/mks/rate/service_types_controller.rb +45 -0
  12. data/app/controllers/mks/rate/unit_of_charges_controller.rb +11 -0
  13. data/app/models/mks/rate/application_record.rb +21 -0
  14. data/app/models/mks/rate/chargeable_service.rb +27 -0
  15. data/app/models/mks/rate/chargeable_service_discount.rb +31 -0
  16. data/app/models/mks/rate/rate_change_request.rb +16 -0
  17. data/app/models/mks/rate/service_bundle.rb +14 -0
  18. data/app/models/mks/rate/service_delivery_unit.rb +8 -0
  19. data/app/models/mks/rate/service_rate.rb +17 -0
  20. data/app/models/mks/rate/service_type.rb +7 -0
  21. data/app/models/mks/rate/unit_of_charge.rb +8 -0
  22. data/app/serializers/mks/rate/bundle_discount_serializer.rb +8 -0
  23. data/app/serializers/mks/rate/chargeable_service_serializer.rb +8 -0
  24. data/app/serializers/mks/rate/service_bundle_serializer.rb +7 -0
  25. data/app/serializers/mks/rate/service_rate_serializer.rb +8 -0
  26. data/app/serializers/mks/rate/working_rate_serializer.rb +8 -0
  27. data/app/services/mks/rate/rate_change_request_service.rb +61 -0
  28. data/app/services/mks/rate/service_bundle_service.rb +18 -0
  29. data/config/routes.rb +34 -0
  30. data/db/migrate/20171212165507_create_mks_rate_unit_of_charges.rb +10 -0
  31. data/db/migrate/20171213152154_create_mks_rate_service_delivery_units.rb +11 -0
  32. data/db/migrate/20171213152159_create_mks_rate_service_types.rb +10 -0
  33. data/db/migrate/20171214152030_create_mks_rate_chargeable_services.rb +19 -0
  34. data/db/migrate/20171215092528_create_mks_rate_chargeable_service_discounts.rb +16 -0
  35. data/db/migrate/20171218113530_create_mks_rate_service_rates.rb +15 -0
  36. data/db/migrate/20171219134144_create_mks_rate_service_bundles.rb +15 -0
  37. data/db/migrate/20171220133826_create_mks_rate_rate_change_requests.rb +21 -0
  38. data/db/migrate/20171221110018_create_mks_rate_service_bundles_chargeable_services.rb +12 -0
  39. data/db/seeds.rb +39 -0
  40. data/lib/mks/rate/engine.rb +24 -0
  41. data/lib/mks/rate/version.rb +5 -0
  42. data/lib/mks/rate.rb +4 -0
  43. data/lib/mks_rate.rb +2 -0
  44. data/lib/tasks/mks_rate_tasks.rake +4 -0
  45. data/spec/controllers/mks/rate/chargeable_services_controller_spec.rb +102 -0
  46. data/spec/controllers/mks/rate/rate_change_requests_controller_spec.rb +132 -0
  47. data/spec/controllers/mks/rate/service_bundles_controller_spec.rb +161 -0
  48. data/spec/controllers/mks/rate/service_delivery_units_controller_spec.rb +83 -0
  49. data/spec/controllers/mks/rate/service_rates_controller_spec.rb +34 -0
  50. data/spec/controllers/mks/rate/service_types_controller_spec.rb +103 -0
  51. data/spec/controllers/mks/rate/unit_of_charges_controller_spec.rb +24 -0
  52. data/spec/dummy/Rakefile +6 -0
  53. data/spec/dummy/app/assets/config/manifest.js +5 -0
  54. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  55. data/spec/dummy/app/assets/javascripts/cable.js +13 -0
  56. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  57. data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
  58. data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
  59. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  60. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  61. data/spec/dummy/app/jobs/application_job.rb +2 -0
  62. data/spec/dummy/app/mailers/application_mailer.rb +4 -0
  63. data/spec/dummy/app/models/application_record.rb +3 -0
  64. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  65. data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
  66. data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
  67. data/spec/dummy/bin/bundle +3 -0
  68. data/spec/dummy/bin/rails +4 -0
  69. data/spec/dummy/bin/rake +4 -0
  70. data/spec/dummy/bin/setup +34 -0
  71. data/spec/dummy/bin/update +29 -0
  72. data/spec/dummy/config/application.rb +31 -0
  73. data/spec/dummy/config/boot.rb +5 -0
  74. data/spec/dummy/config/cable.yml +9 -0
  75. data/spec/dummy/config/database.yml +25 -0
  76. data/spec/dummy/config/environment.rb +5 -0
  77. data/spec/dummy/config/environments/development.rb +54 -0
  78. data/spec/dummy/config/environments/production.rb +86 -0
  79. data/spec/dummy/config/environments/test.rb +42 -0
  80. data/spec/dummy/config/initializers/application_controller_renderer.rb +6 -0
  81. data/spec/dummy/config/initializers/assets.rb +11 -0
  82. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  83. data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
  84. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  85. data/spec/dummy/config/initializers/inflections.rb +16 -0
  86. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  87. data/spec/dummy/config/initializers/new_framework_defaults.rb +24 -0
  88. data/spec/dummy/config/initializers/session_store.rb +3 -0
  89. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  90. data/spec/dummy/config/locales/en.yml +23 -0
  91. data/spec/dummy/config/puma.rb +47 -0
  92. data/spec/dummy/config/routes.rb +3 -0
  93. data/spec/dummy/config/secrets.yml +22 -0
  94. data/spec/dummy/config/spring.rb +6 -0
  95. data/spec/dummy/config.ru +5 -0
  96. data/spec/dummy/db/schema.rb +440 -0
  97. data/spec/dummy/log/development.log +16917 -0
  98. data/spec/dummy/log/test.log +58746 -0
  99. data/spec/dummy/public/404.html +67 -0
  100. data/spec/dummy/public/422.html +67 -0
  101. data/spec/dummy/public/500.html +66 -0
  102. data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
  103. data/spec/dummy/public/apple-touch-icon.png +0 -0
  104. data/spec/dummy/public/favicon.ico +0 -0
  105. data/spec/factories/application_modules.rb +6 -0
  106. data/spec/factories/chargeable_service.rb +10 -0
  107. data/spec/factories/equipment_categories.rb +8 -0
  108. data/spec/factories/equipment_items.rb +14 -0
  109. data/spec/factories/equipment_locations.rb +9 -0
  110. data/spec/factories/equipment_types.rb +7 -0
  111. data/spec/factories/equipments.rb +9 -0
  112. data/spec/factories/location_types.rb +7 -0
  113. data/spec/factories/menus.rb +10 -0
  114. data/spec/factories/rate_change_requests.rb +15 -0
  115. data/spec/factories/service_bundles.rb +9 -0
  116. data/spec/factories/service_delivery_units.rb +7 -0
  117. data/spec/factories/service_rate.rb +8 -0
  118. data/spec/factories/service_types.rb +6 -0
  119. data/spec/factories/unit_of_charges.rb +6 -0
  120. data/spec/factories/user_roles.rb +18 -0
  121. data/spec/factories/users.rb +27 -0
  122. data/spec/models/mks/rate/chargeable_service_spec.rb +41 -0
  123. data/spec/models/mks/rate/rate_change_request_spec.rb +44 -0
  124. data/spec/models/mks/rate/service_bundle_spec.rb +28 -0
  125. data/spec/models/mks/rate/service_delivery_unit_spec.rb +24 -0
  126. data/spec/models/mks/rate/service_rate_spec.rb +21 -0
  127. data/spec/models/mks/rate/service_type_spec.rb +29 -0
  128. data/spec/models/mks/rate/unit_of_charge_spec.rb +24 -0
  129. data/spec/rails_helper.rb +57 -0
  130. data/spec/services/mks/rate/rate_change_request_service_spec.rb +53 -0
  131. data/spec/services/mks/rate/service_bundle_service_spec.rb +58 -0
  132. data/spec/spec_helper.rb +108 -0
  133. data/spec/support/factory_bot.rb +5 -0
  134. metadata +405 -0
@@ -0,0 +1,440 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # Note that this schema.rb definition is the authoritative source for your
6
+ # database schema. If you need to create the application database on another
7
+ # system, you should be using db:schema:load, not running all the migrations
8
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
9
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
10
+ #
11
+ # It's strongly recommended that you check this file into your version control system.
12
+
13
+ ActiveRecord::Schema.define(version: 20180401110018) do
14
+
15
+ # These are extensions that must be enabled in order to support this database
16
+ enable_extension "plpgsql"
17
+
18
+ create_table "mks_auth_application_modules", id: :serial, force: :cascade do |t|
19
+ t.string "code", null: false
20
+ t.string "name", null: false
21
+ t.datetime "created_at", null: false
22
+ t.datetime "updated_at", null: false
23
+ end
24
+
25
+ create_table "mks_auth_menus", id: :serial, force: :cascade do |t|
26
+ t.string "text", null: false
27
+ t.string "icon_cls"
28
+ t.string "class_name"
29
+ t.string "location"
30
+ t.integer "parent_id"
31
+ t.integer "application_module_id"
32
+ t.datetime "created_at", null: false
33
+ t.datetime "updated_at", null: false
34
+ t.index ["application_module_id"], name: "index_mks_auth_menus_on_application_module_id"
35
+ t.index ["parent_id"], name: "index_mks_auth_menus_on_parent_id"
36
+ end
37
+
38
+ create_table "mks_auth_menus_user_roles", id: :serial, force: :cascade do |t|
39
+ t.integer "menu_id"
40
+ t.integer "user_role_id"
41
+ t.index ["menu_id", "user_role_id"], name: "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id"
42
+ end
43
+
44
+ create_table "mks_auth_user_roles", id: :serial, force: :cascade do |t|
45
+ t.string "name", null: false
46
+ t.integer "application_module_id"
47
+ t.datetime "created_at", null: false
48
+ t.datetime "updated_at", null: false
49
+ t.index ["application_module_id"], name: "index_mks_auth_user_roles_on_application_module_id"
50
+ end
51
+
52
+ create_table "mks_auth_users", id: :serial, force: :cascade do |t|
53
+ t.string "first_name", null: false
54
+ t.string "last_name", null: false
55
+ t.string "email", null: false
56
+ t.boolean "active", default: true, null: false
57
+ t.string "password_digest"
58
+ t.datetime "created_at", null: false
59
+ t.datetime "updated_at", null: false
60
+ end
61
+
62
+ create_table "mks_auth_users_application_modules", id: false, force: :cascade do |t|
63
+ t.bigint "user_id"
64
+ t.bigint "application_module_id"
65
+ t.index ["user_id", "application_module_id"], name: "am_on_users_indx"
66
+ end
67
+
68
+ create_table "mks_auth_users_user_roles", id: false, force: :cascade do |t|
69
+ t.integer "user_id"
70
+ t.integer "user_role_id"
71
+ t.index ["user_id", "user_role_id"], name: "index_mks_auth_users_user_roles_on_user_id_and_user_role_id"
72
+ end
73
+
74
+ create_table "mks_edm_equipment_categories", force: :cascade do |t|
75
+ t.string "code"
76
+ t.string "name", null: false
77
+ t.string "description"
78
+ t.bigint "equipment_type_id"
79
+ t.datetime "created_at", null: false
80
+ t.datetime "updated_at", null: false
81
+ t.index ["equipment_type_id"], name: "ec_on_et_indx"
82
+ end
83
+
84
+ create_table "mks_edm_equipment_components", force: :cascade do |t|
85
+ t.string "serial_no"
86
+ t.string "name", null: false
87
+ t.bigint "equipment_item_id"
88
+ t.datetime "created_at", null: false
89
+ t.datetime "updated_at", null: false
90
+ t.index ["equipment_item_id"], name: "ei_on_ec_indx"
91
+ end
92
+
93
+ create_table "mks_edm_equipment_items", force: :cascade do |t|
94
+ t.string "code"
95
+ t.string "name", null: false
96
+ t.string "description"
97
+ t.string "status", default: "READY"
98
+ t.string "serial_number"
99
+ t.string "brand"
100
+ t.string "item_model"
101
+ t.float "purchase_price", null: false
102
+ t.date "purchase_date", null: false
103
+ t.float "license_fee"
104
+ t.float "tax"
105
+ t.bigint "equipment_id"
106
+ t.bigint "current_location_id"
107
+ t.datetime "created_at", null: false
108
+ t.datetime "updated_at", null: false
109
+ t.index ["current_location_id"], name: "equipment_on_el_indx"
110
+ t.index ["equipment_id"], name: "equipment_on_ei_indx"
111
+ end
112
+
113
+ create_table "mks_edm_equipment_locations", force: :cascade do |t|
114
+ t.string "code"
115
+ t.string "name", null: false
116
+ t.bigint "location_type_id"
117
+ t.string "description"
118
+ t.string "address"
119
+ t.datetime "created_at", null: false
120
+ t.datetime "updated_at", null: false
121
+ t.index ["location_type_id"], name: "lt_on_el_indx"
122
+ end
123
+
124
+ create_table "mks_edm_equipment_types", force: :cascade do |t|
125
+ t.string "code"
126
+ t.string "name", null: false
127
+ t.string "description"
128
+ t.datetime "created_at", null: false
129
+ t.datetime "updated_at", null: false
130
+ end
131
+
132
+ create_table "mks_edm_equipment_valuations", force: :cascade do |t|
133
+ t.bigint "equipment_item_id"
134
+ t.float "initial_cost", null: false
135
+ t.float "residual_value", null: false
136
+ t.float "work_hrs_per_yr", null: false
137
+ t.float "life_year", null: false
138
+ t.float "insurance_premium", null: false
139
+ t.float "fuel_cost_per_hr"
140
+ t.float "oil_rate"
141
+ t.float "repair_rate"
142
+ t.float "rate_of_return"
143
+ t.string "dep_method"
144
+ t.boolean "is_current", default: true
145
+ t.datetime "created_at", null: false
146
+ t.datetime "updated_at", null: false
147
+ t.index ["equipment_item_id"], name: "ev_on_ei_indx"
148
+ end
149
+
150
+ create_table "mks_edm_equipments", force: :cascade do |t|
151
+ t.string "code"
152
+ t.string "name", null: false
153
+ t.string "description"
154
+ t.float "minimum_acquisition_time", default: 0.0, null: false
155
+ t.bigint "equipment_category_id"
156
+ t.datetime "created_at", null: false
157
+ t.datetime "updated_at", null: false
158
+ t.index ["equipment_category_id"], name: "equipment_on_ec_indx"
159
+ end
160
+
161
+ create_table "mks_edm_location_types", force: :cascade do |t|
162
+ t.string "code"
163
+ t.string "name"
164
+ t.string "description"
165
+ t.datetime "created_at", null: false
166
+ t.datetime "updated_at", null: false
167
+ end
168
+
169
+ create_table "mks_maintenance_cost_types", force: :cascade do |t|
170
+ t.string "code"
171
+ t.string "name"
172
+ t.json "fields", null: false
173
+ t.datetime "created_at", null: false
174
+ t.datetime "updated_at", null: false
175
+ end
176
+
177
+ create_table "mks_maintenance_job_cards", force: :cascade do |t|
178
+ t.bigint "maintenance_service_order_id"
179
+ t.string "code"
180
+ t.date "start_date"
181
+ t.date "due_date"
182
+ t.bigint "service_provider_id"
183
+ t.date "checkout_date"
184
+ t.bigint "checkout_by_id"
185
+ t.bigint "checkout_to_id"
186
+ t.bigint "maintenance_status_id"
187
+ t.date "checkin_date"
188
+ t.bigint "checkin_by_id"
189
+ t.bigint "checkin_to_id"
190
+ t.datetime "created_at", null: false
191
+ t.datetime "updated_at", null: false
192
+ t.boolean "approved", default: false
193
+ t.boolean "checkout_confirmed", default: false
194
+ t.boolean "checkin_confirmed", default: false
195
+ t.boolean "costs_approved", default: false
196
+ t.integer "prepared_by_id"
197
+ t.index ["checkin_by_id"], name: "chb_on_jc_indx"
198
+ t.index ["checkin_to_id"], name: "cht_on_jc_indx"
199
+ t.index ["checkout_by_id"], name: "cb_on_jc_indx"
200
+ t.index ["checkout_to_id"], name: "ct_on_jc_indx"
201
+ t.index ["maintenance_service_order_id"], name: "mso_on_jc_indx"
202
+ t.index ["maintenance_status_id"], name: "ms_on_jc_indx"
203
+ t.index ["service_provider_id"], name: "sp_on_jc_indx"
204
+ end
205
+
206
+ create_table "mks_maintenance_maintenance_categories", force: :cascade do |t|
207
+ t.string "code"
208
+ t.string "name"
209
+ t.string "description"
210
+ t.datetime "created_at", null: false
211
+ t.datetime "updated_at", null: false
212
+ end
213
+
214
+ create_table "mks_maintenance_maintenance_costs", force: :cascade do |t|
215
+ t.bigint "job_card_id"
216
+ t.bigint "cost_type_id"
217
+ t.json "cost_detail", null: false
218
+ t.string "remark"
219
+ t.datetime "created_at", null: false
220
+ t.datetime "updated_at", null: false
221
+ t.index ["cost_type_id"], name: "ct_on_mc_indx"
222
+ t.index ["job_card_id"], name: "jc_on_mc_indx"
223
+ end
224
+
225
+ create_table "mks_maintenance_maintenance_service_orders", force: :cascade do |t|
226
+ t.string "title", null: false
227
+ t.string "description"
228
+ t.bigint "equipment_item_id"
229
+ t.bigint "maintenance_type_id"
230
+ t.date "start_date"
231
+ t.date "end_date"
232
+ t.bigint "prepared_by_id"
233
+ t.boolean "approved", default: false
234
+ t.string "status", default: "draft"
235
+ t.bigint "approved_by_id"
236
+ t.string "remark"
237
+ t.float "current_reading", null: false
238
+ t.datetime "created_at", null: false
239
+ t.datetime "updated_at", null: false
240
+ t.index ["approved_by_id"], name: "ab_on_mso_indx"
241
+ t.index ["equipment_item_id"], name: "ei_on_mso_indx"
242
+ t.index ["maintenance_type_id"], name: "mt_on_mso_indx"
243
+ t.index ["prepared_by_id"], name: "pb_on_mso_indx"
244
+ end
245
+
246
+ create_table "mks_maintenance_maintenance_statuses", force: :cascade do |t|
247
+ t.string "code"
248
+ t.string "name"
249
+ t.string "description"
250
+ t.datetime "created_at", null: false
251
+ t.datetime "updated_at", null: false
252
+ end
253
+
254
+ create_table "mks_maintenance_maintenance_types", force: :cascade do |t|
255
+ t.string "code"
256
+ t.string "name", null: false
257
+ t.string "description"
258
+ t.bigint "maintenance_category_id"
259
+ t.datetime "created_at", null: false
260
+ t.datetime "updated_at", null: false
261
+ t.index ["maintenance_category_id"], name: "mt_on_mc_indx"
262
+ end
263
+
264
+ create_table "mks_maintenance_schedule_settings", force: :cascade do |t|
265
+ t.bigint "equipment_id"
266
+ t.bigint "maintenance_type_id"
267
+ t.bigint "schedule_unit_id"
268
+ t.float "value", null: false
269
+ t.datetime "created_at", null: false
270
+ t.datetime "updated_at", null: false
271
+ t.index ["equipment_id"], name: "equipment_on_ss_indx"
272
+ t.index ["maintenance_type_id"], name: "mt_on_ss_indx"
273
+ t.index ["schedule_unit_id"], name: "su_on_ss_indx"
274
+ end
275
+
276
+ create_table "mks_maintenance_schedule_units", force: :cascade do |t|
277
+ t.string "code"
278
+ t.string "name"
279
+ t.string "description"
280
+ t.datetime "created_at", null: false
281
+ t.datetime "updated_at", null: false
282
+ end
283
+
284
+ create_table "mks_rate_chargeable_service_discounts", force: :cascade do |t|
285
+ t.string "unit_variable", null: false
286
+ t.float "from", null: false
287
+ t.float "to", null: false
288
+ t.float "value", null: false
289
+ t.integer "chargeable_service_id"
290
+ t.datetime "created_at", null: false
291
+ t.datetime "updated_at", null: false
292
+ end
293
+
294
+ create_table "mks_rate_chargeable_services", force: :cascade do |t|
295
+ t.string "code", null: false
296
+ t.string "name", null: false
297
+ t.integer "service_type_id"
298
+ t.integer "base_unit_id"
299
+ t.integer "utilization_unit_id"
300
+ t.integer "service_delivery_unit_id"
301
+ t.datetime "created_at", null: false
302
+ t.datetime "updated_at", null: false
303
+ t.index ["base_unit_id"], name: "bu_on_cs_indx"
304
+ t.index ["service_delivery_unit_id"], name: "sdu_on_cs_indx"
305
+ t.index ["service_type_id"], name: "st_on_cs_indx"
306
+ t.index ["utilization_unit_id"], name: "uu_on_cs_indx"
307
+ end
308
+
309
+ create_table "mks_rate_rate_change_requests", force: :cascade do |t|
310
+ t.string "reference_number"
311
+ t.string "authorized_by", null: false
312
+ t.date "effective_on", null: false
313
+ t.date "authorized_on", null: false
314
+ t.json "rates", null: false
315
+ t.string "status", default: "SUBMITTED", null: false
316
+ t.bigint "created_by_id"
317
+ t.bigint "approved_by_id"
318
+ t.string "remark"
319
+ t.datetime "created_at", null: false
320
+ t.datetime "updated_at", null: false
321
+ t.index ["approved_by_id"], name: "ab_on_rcr_indx"
322
+ t.index ["created_by_id"], name: "cb_on_rcr_indx"
323
+ t.index ["reference_number"], name: "index_mks_rate_rate_change_requests_on_reference_number", unique: true
324
+ end
325
+
326
+ create_table "mks_rate_service_bundles", force: :cascade do |t|
327
+ t.string "code"
328
+ t.string "name", null: false
329
+ t.string "description"
330
+ t.float "percent_discount", default: 0.0, null: false
331
+ t.bigint "service_delivery_unit_id"
332
+ t.datetime "created_at", null: false
333
+ t.datetime "updated_at", null: false
334
+ t.index ["service_delivery_unit_id"], name: "sdu_on_sb_indx"
335
+ end
336
+
337
+ create_table "mks_rate_service_bundles_chargeable_services", id: false, force: :cascade do |t|
338
+ t.bigint "service_bundle_id"
339
+ t.bigint "chargeable_service_id"
340
+ t.index ["service_bundle_id", "chargeable_service_id"], name: "sb_on_cs_indx"
341
+ end
342
+
343
+ create_table "mks_rate_service_delivery_units", force: :cascade do |t|
344
+ t.string "code", null: false
345
+ t.string "name", null: false
346
+ t.string "address", null: false
347
+ t.datetime "created_at", null: false
348
+ t.datetime "updated_at", null: false
349
+ end
350
+
351
+ create_table "mks_rate_service_rates", force: :cascade do |t|
352
+ t.bigint "chargeable_service_id"
353
+ t.bigint "equipment_item_id"
354
+ t.float "base_rate", default: 0.0
355
+ t.float "utilization_rate", default: 0.0
356
+ t.datetime "created_at", null: false
357
+ t.datetime "updated_at", null: false
358
+ t.index ["chargeable_service_id"], name: "cs_on_sr_indx"
359
+ t.index ["equipment_item_id"], name: "cs_on_ei_indx"
360
+ end
361
+
362
+ create_table "mks_rate_service_types", force: :cascade do |t|
363
+ t.string "code"
364
+ t.string "name"
365
+ t.datetime "created_at", null: false
366
+ t.datetime "updated_at", null: false
367
+ end
368
+
369
+ create_table "mks_rate_unit_of_charges", force: :cascade do |t|
370
+ t.string "name", null: false
371
+ t.json "unit_variables", null: false
372
+ t.datetime "created_at", null: false
373
+ t.datetime "updated_at", null: false
374
+ end
375
+
376
+ create_table "mks_rent_clients", force: :cascade do |t|
377
+ t.string "name", null: false
378
+ t.string "address"
379
+ t.datetime "created_at", null: false
380
+ t.datetime "updated_at", null: false
381
+ end
382
+
383
+ create_table "mks_rent_offer_requests", force: :cascade do |t|
384
+ t.bigint "client_id"
385
+ t.string "description"
386
+ t.string "destination"
387
+ t.bigint "prepared_by_id"
388
+ t.string "status", default: "DRAFT", null: false
389
+ t.datetime "created_at", null: false
390
+ t.datetime "updated_at", null: false
391
+ t.index ["client_id"], name: "client_on_er_indx"
392
+ t.index ["prepared_by_id"], name: "equipment_on_rb_indx"
393
+ end
394
+
395
+ add_foreign_key "mks_auth_menus", "mks_auth_application_modules", column: "application_module_id"
396
+ add_foreign_key "mks_auth_menus", "mks_auth_menus", column: "parent_id"
397
+ add_foreign_key "mks_auth_menus_user_roles", "mks_auth_menus", column: "menu_id"
398
+ add_foreign_key "mks_auth_menus_user_roles", "mks_auth_user_roles", column: "user_role_id"
399
+ add_foreign_key "mks_auth_user_roles", "mks_auth_application_modules", column: "application_module_id"
400
+ add_foreign_key "mks_auth_users_application_modules", "mks_auth_application_modules", column: "application_module_id"
401
+ add_foreign_key "mks_auth_users_application_modules", "mks_auth_users", column: "user_id"
402
+ add_foreign_key "mks_auth_users_user_roles", "mks_auth_user_roles", column: "user_role_id"
403
+ add_foreign_key "mks_auth_users_user_roles", "mks_auth_users", column: "user_id"
404
+ add_foreign_key "mks_edm_equipment_categories", "mks_edm_equipment_types", column: "equipment_type_id"
405
+ add_foreign_key "mks_edm_equipment_components", "mks_edm_equipment_items", column: "equipment_item_id"
406
+ add_foreign_key "mks_edm_equipment_items", "mks_edm_equipment_locations", column: "current_location_id"
407
+ add_foreign_key "mks_edm_equipment_items", "mks_edm_equipments", column: "equipment_id"
408
+ add_foreign_key "mks_edm_equipment_locations", "mks_edm_location_types", column: "location_type_id"
409
+ add_foreign_key "mks_edm_equipment_valuations", "mks_edm_equipment_items", column: "equipment_item_id"
410
+ add_foreign_key "mks_edm_equipments", "mks_edm_equipment_categories", column: "equipment_category_id"
411
+ add_foreign_key "mks_maintenance_job_cards", "mks_auth_users", column: "checkin_by_id"
412
+ add_foreign_key "mks_maintenance_job_cards", "mks_auth_users", column: "checkout_by_id"
413
+ add_foreign_key "mks_maintenance_job_cards", "mks_auth_users", column: "prepared_by_id"
414
+ add_foreign_key "mks_maintenance_job_cards", "mks_edm_equipment_locations", column: "checkin_to_id"
415
+ add_foreign_key "mks_maintenance_job_cards", "mks_edm_equipment_locations", column: "checkout_to_id"
416
+ add_foreign_key "mks_maintenance_job_cards", "mks_edm_equipment_locations", column: "service_provider_id"
417
+ add_foreign_key "mks_maintenance_job_cards", "mks_maintenance_maintenance_service_orders", column: "maintenance_service_order_id"
418
+ add_foreign_key "mks_maintenance_job_cards", "mks_maintenance_maintenance_statuses", column: "maintenance_status_id"
419
+ add_foreign_key "mks_maintenance_maintenance_service_orders", "mks_auth_users", column: "approved_by_id"
420
+ add_foreign_key "mks_maintenance_maintenance_service_orders", "mks_auth_users", column: "prepared_by_id"
421
+ add_foreign_key "mks_maintenance_maintenance_service_orders", "mks_edm_equipment_items", column: "equipment_item_id"
422
+ add_foreign_key "mks_maintenance_maintenance_service_orders", "mks_maintenance_maintenance_types", column: "maintenance_type_id"
423
+ add_foreign_key "mks_maintenance_maintenance_types", "mks_maintenance_maintenance_categories", column: "maintenance_category_id"
424
+ add_foreign_key "mks_maintenance_schedule_settings", "mks_edm_equipments", column: "equipment_id"
425
+ add_foreign_key "mks_maintenance_schedule_settings", "mks_maintenance_maintenance_types", column: "maintenance_type_id"
426
+ add_foreign_key "mks_maintenance_schedule_settings", "mks_maintenance_schedule_units", column: "schedule_unit_id"
427
+ add_foreign_key "mks_rate_chargeable_service_discounts", "mks_rate_chargeable_services", column: "chargeable_service_id"
428
+ add_foreign_key "mks_rate_chargeable_services", "mks_rate_service_delivery_units", column: "service_delivery_unit_id"
429
+ add_foreign_key "mks_rate_chargeable_services", "mks_rate_service_types", column: "service_type_id"
430
+ add_foreign_key "mks_rate_chargeable_services", "mks_rate_unit_of_charges", column: "base_unit_id"
431
+ add_foreign_key "mks_rate_chargeable_services", "mks_rate_unit_of_charges", column: "utilization_unit_id"
432
+ add_foreign_key "mks_rate_rate_change_requests", "mks_auth_users", column: "approved_by_id"
433
+ add_foreign_key "mks_rate_rate_change_requests", "mks_auth_users", column: "created_by_id"
434
+ add_foreign_key "mks_rate_service_bundles", "mks_rate_service_delivery_units", column: "service_delivery_unit_id"
435
+ add_foreign_key "mks_rate_service_bundles_chargeable_services", "mks_rate_chargeable_services", column: "chargeable_service_id"
436
+ add_foreign_key "mks_rate_service_bundles_chargeable_services", "mks_rate_service_bundles", column: "service_bundle_id"
437
+ add_foreign_key "mks_rate_service_rates", "mks_edm_equipment_items", column: "equipment_item_id"
438
+ add_foreign_key "mks_rate_service_rates", "mks_rate_chargeable_services", column: "chargeable_service_id"
439
+ add_foreign_key "mks_rent_offer_requests", "mks_auth_users", column: "prepared_by_id"
440
+ end