ecom_core 1.2.34 → 1.2.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/ecom/core/{project_crews_controller.rb → site_crews_controller.rb} +5 -4
- data/app/models/ecom/core/attendance_sheet.rb +19 -19
- data/app/models/ecom/core/available_unit_of_measurement.rb +10 -0
- data/app/models/ecom/core/crew.rb +3 -2
- data/app/models/ecom/core/crew_contract.rb +41 -1
- data/app/models/ecom/core/crew_contract_transaction.rb +29 -0
- data/app/models/ecom/core/crew_id_card.rb +36 -0
- data/app/models/ecom/core/inspection_checklist.rb +6 -0
- data/app/models/ecom/core/material.rb +6 -0
- data/app/models/ecom/core/material_identity.rb +21 -0
- data/app/models/ecom/core/material_item.rb +18 -0
- data/app/models/ecom/core/material_sub_type.rb +20 -0
- data/app/models/ecom/core/overtime_sheet.rb +13 -15
- data/app/models/ecom/core/payroll.rb +3 -3
- data/app/models/ecom/core/project.rb +0 -3
- data/app/models/ecom/core/project_template.rb +11 -0
- data/app/models/ecom/core/project_work_item_template.rb +9 -0
- data/app/models/ecom/core/{project_crew.rb → site.rb} +8 -4
- data/app/models/ecom/core/site_crew.rb +27 -0
- data/app/models/ecom/core/task.rb +22 -5
- data/app/models/ecom/core/task_inspection_checklist.rb +18 -0
- data/app/models/ecom/core/task_template.rb +18 -90
- data/app/models/ecom/core/task_template_inspection_checklist.rb +8 -0
- data/app/models/ecom/core/work_package.rb +3 -0
- data/app/models/ecom/core/work_product.rb +2 -18
- data/app/models/ecom/core/work_product_template.rb +2 -2
- data/app/services/ecom/core/crew_contract_transaction_service.rb +89 -0
- data/app/services/ecom/core/site_crew_service.rb +44 -0
- data/config/routes.rb +2 -2
- data/db/migrate/20191119012030_create_ecom_core_task_templates.rb +6 -8
- data/db/migrate/20191119013236_create_ecom_core_work_product_templates.rb +0 -15
- data/db/migrate/20191119021405_create_ecom_core_project_templates.rb +15 -0
- data/db/migrate/20191119034319_create_ecom_core_project_work_item_templates.rb +20 -0
- data/db/migrate/20191201145849_create_ecom_core_sites.rb +16 -0
- data/db/migrate/20191202222210_create_ecom_core_work_packages.rb +12 -0
- data/db/migrate/20191202235434_create_ecom_core_work_products.rb +2 -17
- data/db/migrate/20191207103735_create_ecom_core_tasks.rb +14 -6
- data/db/migrate/20191225140433_create_ecom_core_attendance_sheets.rb +4 -4
- data/db/migrate/20200126081005_create_ecom_core_payrolls.rb +3 -3
- data/db/migrate/20200410090701_create_ecom_core_overtime_sheets.rb +4 -4
- data/db/migrate/20200616044231_create_ecom_core_material_sub_types.rb +14 -0
- data/db/migrate/20200616051902_create_ecom_core_material_identities.rb +17 -0
- data/db/migrate/20200618105233_create_ecom_core_material_items.rb +16 -0
- data/db/migrate/20200813165555_create_ecom_core_available_unit_of_measurements.rb +16 -0
- data/db/migrate/20200901085227_create_ecom_core_crew_contracts.rb +7 -1
- data/db/migrate/20201013072924_create_ecom_core_crew_contract_transactions.rb +16 -0
- data/db/migrate/20201013090609_create_ecom_core_site_crews.rb.rb +22 -0
- data/db/migrate/20201013094100_create_ecom_core_crew_id_cards.rb +16 -0
- data/db/migrate/20201113050953_create_ecom_core_task_inspection_checklists.rb +22 -0
- data/db/migrate/20201113094302_create_ecom_core_task_template_inspection_checklists.rb +17 -0
- data/lib/ecom/core/version.rb +1 -1
- data/spec/factories/ecom/core/attendance_sheets.rb +1 -1
- data/spec/factories/ecom/core/available_unit_of_measurements.rb +6 -0
- data/spec/factories/ecom/core/crew_contract_transactions.rb +8 -0
- data/spec/factories/ecom/core/crew_contracts.rb +12 -0
- data/spec/factories/ecom/core/crew_id_cards.rb +8 -0
- data/spec/factories/{dimension_elements.rb → ecom/core/dimension_elements.rb} +0 -0
- data/spec/factories/ecom/core/inspection_checklists.rb +5 -0
- data/spec/factories/ecom/core/material_identities.rb +6 -0
- data/spec/factories/ecom/core/material_items.rb +6 -0
- data/spec/factories/ecom/core/material_sub_types.rb +6 -0
- data/spec/factories/ecom/core/materials.rb +5 -0
- data/spec/factories/{measurement_units.rb → ecom/core/measurement_units.rb} +6 -0
- data/spec/factories/ecom/core/overtime_sheets.rb +1 -1
- data/spec/factories/ecom/core/payrolls.rb +1 -1
- data/spec/factories/ecom/core/project_templates.rb +8 -0
- data/spec/factories/ecom/core/project_work_item_templates.rb +7 -0
- data/spec/factories/ecom/core/site_crews.rb +10 -0
- data/spec/factories/ecom/core/sites.rb +8 -0
- data/spec/factories/ecom/core/task_inspection_checklists.rb +11 -0
- data/spec/factories/ecom/core/task_template_inspection_checklists.rb +7 -0
- data/spec/factories/ecom/core/task_templates.rb +10 -6
- data/spec/factories/ecom/core/tasks.rb +8 -3
- data/spec/factories/ecom/core/work_packages.rb +6 -0
- data/spec/factories/ecom/core/work_product_templates.rb +0 -1
- data/spec/factories/ecom/core/work_products.rb +1 -7
- metadata +48 -20
- data/app/controllers/concerns/ecom/core/filterable.rb +0 -14
- data/app/models/ecom/core/takeoff_calculator.rb +0 -115
- data/app/models/ecom/core/task_step.rb +0 -85
- data/app/models/ecom/core/task_step_dependency.rb +0 -10
- data/app/services/ecom/core/project_crew_service.rb +0 -39
- data/db/migrate/20191119012027_create_ecom_core_takeoff_calculators.rb +0 -11
- data/db/migrate/20191225121850_create_ecom_core_project_crews.rb +0 -19
- data/db/migrate/20200820123719_create_ecom_core_task_steps.rb +0 -17
- data/db/migrate/20200821130934_create_ecom_core_task_step_dependencies.rb +0 -16
- data/spec/factories/ecom/core/project_crews.rb +0 -9
- data/spec/factories/ecom/core/takeoff_calculators.rb +0 -18
- data/spec/factories/ecom/core/task_step_dependencies.rb +0 -6
- data/spec/factories/ecom/core/task_steps.rb +0 -8
data/config/routes.rb
CHANGED
@@ -15,6 +15,6 @@ Ecom::Core::Engine.routes.draw do
|
|
15
15
|
resources :projects
|
16
16
|
resources :companies
|
17
17
|
get '/default_company', controller: :companies, action: :default_company
|
18
|
-
get '/
|
19
|
-
post '/
|
18
|
+
get '/sites/:id/crew', controller: :site_crews, action: :index
|
19
|
+
post '/site_crews', controller: :site_crews, action: :update
|
20
20
|
end
|
@@ -8,16 +8,14 @@ class CreateEcomCoreTaskTemplates < ActiveRecord::Migration[6.0]
|
|
8
8
|
null: false,
|
9
9
|
index: { name: 'tt_on_ttt_indx' },
|
10
10
|
foreign_key: { to_table: :ecom_core_task_template_types }
|
11
|
-
t.references :takeoff_calculator,
|
12
|
-
null: true,
|
13
|
-
index: { name: 'tt_on_tc_indx' },
|
14
|
-
foreign_key: { to_table: :ecom_core_takeoff_calculators }
|
15
11
|
t.string :ancestry, index: true
|
16
12
|
t.boolean :has_takeoff_fields, null:false, default: false
|
17
|
-
t.jsonb :
|
18
|
-
t.
|
19
|
-
t.
|
20
|
-
t.
|
13
|
+
t.jsonb :takeoff_fields, null: false, default: {}
|
14
|
+
t.integer :percentage_contribution
|
15
|
+
t.integer :task_sequence
|
16
|
+
t.boolean :has_inspection, null: false, default: false
|
17
|
+
t.boolean :discipline, null: false, default: false
|
18
|
+
t.jsonb :task_completion_detail, null: false, default: {}
|
21
19
|
|
22
20
|
t.timestamps
|
23
21
|
end
|
@@ -4,23 +4,8 @@ class CreateEcomCoreWorkProductTemplates < ActiveRecord::Migration[6.0]
|
|
4
4
|
t.string :code, null: false, unique: true
|
5
5
|
t.string :name, null: false, unique: true
|
6
6
|
t.string :description
|
7
|
-
t.references :task_template_type,
|
8
|
-
null: false,
|
9
|
-
index: { name: 'wpt_on_ttt_indx' },
|
10
|
-
foreign_key: { to_table: :ecom_core_task_template_types }
|
11
7
|
|
12
8
|
t.timestamps
|
13
9
|
end
|
14
|
-
|
15
|
-
create_table :ecom_core_task_templates_work_product_templates do |t|
|
16
|
-
t.references :task_template,
|
17
|
-
null: false,
|
18
|
-
index: { name: 'ttwpt_on_tt_indx' },
|
19
|
-
foreign_key: { to_table: :ecom_core_task_templates }
|
20
|
-
t.references :work_product_template,
|
21
|
-
null: false,
|
22
|
-
index: { name: 'ttwpt_on_wpt_indx' },
|
23
|
-
foreign_key: { to_table: :ecom_core_work_product_templates }
|
24
|
-
end
|
25
10
|
end
|
26
11
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class CreateEcomCoreProjectTemplates < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
create_table :ecom_core_project_templates do |t|
|
4
|
+
t.string :code, unique: true
|
5
|
+
t.string :name, null: false
|
6
|
+
t.string :description
|
7
|
+
t.references :task_template_type,
|
8
|
+
null: false,
|
9
|
+
index: { name: 'pt_on_ttt_indx' },
|
10
|
+
foreign_key: { to_table: :ecom_core_task_template_types }
|
11
|
+
|
12
|
+
t.timestamps
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class CreateEcomCoreProjectWorkItemTemplates < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
create_table :ecom_core_project_work_item_templates do |t|
|
4
|
+
t.references :task_template,
|
5
|
+
null: false,
|
6
|
+
index: { name: 'pwit_on_tt_indx' },
|
7
|
+
foreign_key: { to_table: :ecom_core_task_templates }
|
8
|
+
t.references :work_product_template,
|
9
|
+
null: false,
|
10
|
+
index: { name: 'pwit_on_wpt_indx' },
|
11
|
+
foreign_key: { to_table: :ecom_core_work_product_templates }
|
12
|
+
t.references :project_template,
|
13
|
+
null: false,
|
14
|
+
index: { name: 'pwit_on_pt_indx' },
|
15
|
+
foreign_key: { to_table: :ecom_core_project_templates }
|
16
|
+
|
17
|
+
t.timestamps
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateEcomCoreSites < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
create_table :ecom_core_sites do |t|
|
4
|
+
t.string :name, null: false
|
5
|
+
t.string :address, null: false
|
6
|
+
t.string :description
|
7
|
+
t.references :project,
|
8
|
+
null: false,
|
9
|
+
index: { name: 'site_on_project_indx' },
|
10
|
+
foreign_key: { to_table: :ecom_core_projects }
|
11
|
+
t.string :status, null: false, default: 'Active'
|
12
|
+
|
13
|
+
t.timestamps
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -6,6 +6,18 @@ class CreateEcomCoreWorkPackages < ActiveRecord::Migration[6.0]
|
|
6
6
|
t.string :description
|
7
7
|
t.date :start_date
|
8
8
|
t.date :end_date
|
9
|
+
t.string :location
|
10
|
+
t.decimal :budget, precision: 10, scale: 2
|
11
|
+
t.string :resource_required
|
12
|
+
t.string :concerns
|
13
|
+
t.references :site_engineer,
|
14
|
+
null: true,
|
15
|
+
index: { name: 'wp_on_si_indx' },
|
16
|
+
foreign_key: { to_table: :ecom_core_users }
|
17
|
+
t.references :project_manager,
|
18
|
+
null: true,
|
19
|
+
index: { name: 'wp_on_pm_indx' },
|
20
|
+
foreign_key: { to_table: :ecom_core_users }
|
9
21
|
t.references :project,
|
10
22
|
null: false,
|
11
23
|
index: { name: 'wp_on_project_indx' },
|
@@ -3,7 +3,7 @@ class CreateEcomCoreWorkProducts < ActiveRecord::Migration[6.0]
|
|
3
3
|
create_table :ecom_core_work_products do |t|
|
4
4
|
t.string :name, null: false
|
5
5
|
t.string :description
|
6
|
-
t.string :
|
6
|
+
t.string :design_reference, unique: true
|
7
7
|
t.references :product_group,
|
8
8
|
null: true,
|
9
9
|
index: { name: 'wp_on_pg_indx' },
|
@@ -16,28 +16,13 @@ class CreateEcomCoreWorkProducts < ActiveRecord::Migration[6.0]
|
|
16
16
|
null: false,
|
17
17
|
index: { name: 'projects_on_wp_indx' },
|
18
18
|
foreign_key: { to_table: :ecom_core_projects }
|
19
|
-
t.string :status, default: 'New'
|
20
|
-
t.integer :percent_completed, null: false, default: 0
|
21
19
|
t.string :remark
|
22
|
-
t.references :approver,
|
23
|
-
null: true,
|
24
|
-
index: false,
|
25
|
-
foreign_key: { to_table: :ecom_core_users }
|
26
|
-
t.references :supervisor,
|
27
|
-
null: true,
|
28
|
-
index: false,
|
29
|
-
foreign_key: { to_table: :ecom_core_users }
|
30
|
-
t.references :quality_controller,
|
31
|
-
null: true,
|
32
|
-
index: false,
|
33
|
-
foreign_key: { to_table: :ecom_core_users }
|
34
20
|
t.datetime :start_date
|
35
21
|
t.datetime :completion_date
|
36
|
-
t.boolean :tasks_generated, null: false, default: false
|
37
22
|
|
38
23
|
t.timestamps
|
39
24
|
end
|
40
25
|
|
41
|
-
add_index :ecom_core_work_products, %i[
|
26
|
+
add_index :ecom_core_work_products, %i[design_reference project_id], unique: true, name: 'wp_on_dr_pi_indx'
|
42
27
|
end
|
43
28
|
end
|
@@ -10,6 +10,14 @@ class CreateEcomCoreTasks < ActiveRecord::Migration[6.0]
|
|
10
10
|
t.string :status, null: false, default: :new
|
11
11
|
t.integer :percent_completed, null: false, default: 0
|
12
12
|
t.string :remark
|
13
|
+
t.date :inspection_submission_date
|
14
|
+
t.string :inspection_status, null: false, default: 'Not Inspected'
|
15
|
+
t.boolean :change_order, null: false, default: false
|
16
|
+
t.integer :percentage_contribution
|
17
|
+
t.references :change_order_for,
|
18
|
+
null: true,
|
19
|
+
index: { name: 'tasks_on_cot_indx' },
|
20
|
+
foreign_key: { to_table: :ecom_core_tasks }
|
13
21
|
t.references :work_package,
|
14
22
|
null: true,
|
15
23
|
index: { name: 'tasks_on_work_package_indx' },
|
@@ -26,17 +34,17 @@ class CreateEcomCoreTasks < ActiveRecord::Migration[6.0]
|
|
26
34
|
null: true,
|
27
35
|
index: { name: 'tasks_on_performer_indx' },
|
28
36
|
foreign_key: { to_table: :ecom_core_users }
|
29
|
-
t.references :
|
37
|
+
t.references :client_consultant,
|
30
38
|
null: true,
|
31
|
-
index: { name: '
|
39
|
+
index: { name: 'tasks_on_cc_indx' },
|
32
40
|
foreign_key: { to_table: :ecom_core_users }
|
33
|
-
t.references :
|
41
|
+
t.references :foreman,
|
34
42
|
null: true,
|
35
|
-
index: { name: '
|
43
|
+
index: { name: 'tasks_on_foreman_indx' },
|
36
44
|
foreign_key: { to_table: :ecom_core_users }
|
37
|
-
t.references :
|
45
|
+
t.references :inspector,
|
38
46
|
null: true,
|
39
|
-
index: { name: '
|
47
|
+
index: { name: 'tasks_on_inspector_indx' },
|
40
48
|
foreign_key: { to_table: :ecom_core_users }
|
41
49
|
t.references :work_product,
|
42
50
|
null: false,
|
@@ -7,13 +7,13 @@ class CreateEcomCoreAttendanceSheets < ActiveRecord::Migration[6.0]
|
|
7
7
|
t.datetime :approved_at
|
8
8
|
t.string :remark
|
9
9
|
t.string :status, null: false, default: 'Open'
|
10
|
-
t.references :
|
10
|
+
t.references :site,
|
11
11
|
null: false,
|
12
|
-
index: { name: '
|
13
|
-
foreign_key: { to_table: :
|
12
|
+
index: { name: 'as_on_site_indx' },
|
13
|
+
foreign_key: { to_table: :ecom_core_sites }
|
14
14
|
|
15
15
|
t.timestamps
|
16
16
|
end
|
17
|
-
add_index :ecom_core_attendance_sheets, %i[date
|
17
|
+
add_index :ecom_core_attendance_sheets, %i[date site_id], unique: true
|
18
18
|
end
|
19
19
|
end
|
@@ -4,10 +4,10 @@ class CreateEcomCorePayrolls < ActiveRecord::Migration[6.0]
|
|
4
4
|
t.integer :month, null: false
|
5
5
|
t.integer :year, null: false
|
6
6
|
t.boolean :approved, null: false, default: false
|
7
|
-
t.references :
|
7
|
+
t.references :site,
|
8
8
|
null: false,
|
9
|
-
index: { name: '
|
10
|
-
foreign_key: { to_table: :
|
9
|
+
index: { name: 'payroll_on_site_indx' },
|
10
|
+
foreign_key: { to_table: :ecom_core_sites }
|
11
11
|
|
12
12
|
t.timestamps
|
13
13
|
end
|
@@ -7,13 +7,13 @@ class CreateEcomCoreOvertimeSheets < ActiveRecord::Migration[6.0]
|
|
7
7
|
t.datetime :approved_at
|
8
8
|
t.string :remark
|
9
9
|
t.string :status, null: false, default: 'Open'
|
10
|
-
t.references :
|
10
|
+
t.references :site,
|
11
11
|
null: false,
|
12
|
-
index: { name: '
|
13
|
-
foreign_key: { to_table: :
|
12
|
+
index: { name: 'os_on_site_indx' },
|
13
|
+
foreign_key: { to_table: :ecom_core_sites }
|
14
14
|
|
15
15
|
t.timestamps
|
16
16
|
end
|
17
|
-
add_index :ecom_core_overtime_sheets, %i[date
|
17
|
+
add_index :ecom_core_overtime_sheets, %i[date site_id], unique: true
|
18
18
|
end
|
19
19
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateEcomCoreMaterialSubTypes < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
create_table :ecom_core_material_sub_types do |t|
|
4
|
+
t.string :name, null: false
|
5
|
+
|
6
|
+
t.references :material_type,
|
7
|
+
null: false,
|
8
|
+
index: { name: 'mst_on_mt_indx' },
|
9
|
+
foreign_key: { to_table: :ecom_core_resource_types }
|
10
|
+
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class CreateEcomCoreMaterialIdentities < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
create_table :ecom_core_material_identities do |t|
|
4
|
+
t.references :material_type,
|
5
|
+
null: false,
|
6
|
+
index: { name: 'mi_on_mt_indx' },
|
7
|
+
foreign_key: { to_table: :ecom_core_resource_types }
|
8
|
+
|
9
|
+
t.references :material_sub_type,
|
10
|
+
null: true,
|
11
|
+
index: { name: 'mi_on_mst_indx' },
|
12
|
+
foreign_key: { to_table: :ecom_core_material_sub_types }
|
13
|
+
|
14
|
+
t.timestamps
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateEcomCoreMaterialItems < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
create_table :ecom_core_material_items do |t|
|
4
|
+
|
5
|
+
t.references :material_identity,
|
6
|
+
null: false,
|
7
|
+
index: { name: 'mi_on_mi_indx' },
|
8
|
+
foreign_key: { to_table: :ecom_core_material_identities }
|
9
|
+
|
10
|
+
t.string :serial_number, null: false, unique: true
|
11
|
+
t.float :price
|
12
|
+
|
13
|
+
t.timestamps
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateEcomCoreAvailableUnitOfMeasurements < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
create_table :ecom_core_available_unit_of_measurements do |t|
|
4
|
+
t.references :material_type,
|
5
|
+
null: false,
|
6
|
+
index: { name: 'aum_on_mt_indx' },
|
7
|
+
foreign_key: { to_table: :ecom_core_resource_types }
|
8
|
+
|
9
|
+
t.references :measurement_unit,
|
10
|
+
null: false,
|
11
|
+
index: { name: 'aum_on_mu_indx' },
|
12
|
+
foreign_key: { to_table: :ecom_core_measurement_units }
|
13
|
+
t.timestamps
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -2,9 +2,12 @@ class CreateEcomCoreCrewContracts < ActiveRecord::Migration[6.0]
|
|
2
2
|
def change
|
3
3
|
create_table :ecom_core_crew_contracts do |t|
|
4
4
|
t.string :contract_no, null: false, unique: true
|
5
|
+
t.string :status, null: false, default: :draft
|
5
6
|
t.date :from, null: false
|
6
7
|
t.date :to, null: false
|
7
8
|
t.string :place_of_work, null: false
|
9
|
+
t.float :wage, null: false
|
10
|
+
t.string :wage_in_words, null: false
|
8
11
|
t.integer :probation_period, null: false
|
9
12
|
t.string :contract_type, null: false
|
10
13
|
t.boolean :contract_signed, null: false, default: false
|
@@ -13,7 +16,10 @@ class CreateEcomCoreCrewContracts < ActiveRecord::Migration[6.0]
|
|
13
16
|
null: false,
|
14
17
|
index: { name: 'cc_on_crew_indx' },
|
15
18
|
foreign_key: { to_table: :ecom_core_crews }
|
16
|
-
|
19
|
+
t.references :crew_type,
|
20
|
+
null: false,
|
21
|
+
index: { name: 'cc_on_ct_indx' },
|
22
|
+
foreign_key: { to_table: :ecom_core_resource_types }
|
17
23
|
t.timestamps
|
18
24
|
end
|
19
25
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateEcomCoreCrewContractTransactions < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
create_table :ecom_core_crew_contract_transactions do |t|
|
4
|
+
t.string :transaction_type, null: false
|
5
|
+
t.string :status, null: false, default: 'Pending'
|
6
|
+
t.datetime :effective_date, null: false
|
7
|
+
|
8
|
+
t.references :crew_contract,
|
9
|
+
null: false,
|
10
|
+
index: { name: 'cct_on_cc_indx' },
|
11
|
+
foreign_key: { to_table: :ecom_core_crew_contracts }
|
12
|
+
|
13
|
+
t.timestamps
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class CreateEcomCoreSiteCrews < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
create_table :ecom_core_site_crews do |t|
|
4
|
+
t.references :crew,
|
5
|
+
null: false,
|
6
|
+
index: { name: 'gp_on_crew_indx' },
|
7
|
+
foreign_key: { to_table: :ecom_core_crews }
|
8
|
+
|
9
|
+
t.references :site,
|
10
|
+
null: false,
|
11
|
+
index: { name: 'gp_on_site_indx' },
|
12
|
+
foreign_key: { to_table: :ecom_core_sites }
|
13
|
+
|
14
|
+
t.string :site_crew_type, null: false
|
15
|
+
t.string :start_date, null: false
|
16
|
+
t.string :end_date
|
17
|
+
t.string :status, null: false, default: 'Inactive'
|
18
|
+
|
19
|
+
t.timestamps
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateEcomCoreCrewIdCards < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
create_table :ecom_core_crew_id_cards do |t|
|
4
|
+
t.references :crew,
|
5
|
+
null: false,
|
6
|
+
index: { name: 'ci_on_crew_indx' },
|
7
|
+
foreign_key: { to_table: :ecom_core_crews }
|
8
|
+
|
9
|
+
t.datetime :issued_on, null: false
|
10
|
+
t.datetime :valid_until, null: false
|
11
|
+
t.string :status, null: false, default: 'Active'
|
12
|
+
|
13
|
+
t.timestamps
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class CreateEcomCoreTaskInspectionChecklists < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
create_table :ecom_core_task_inspection_checklists do |t|
|
4
|
+
t.string :name, null: false
|
5
|
+
t.date :date_of_inspection
|
6
|
+
t.references :inspected_by,
|
7
|
+
null: true,
|
8
|
+
index: { name: 'tic_on_ib_indx' },
|
9
|
+
foreign_key: { to_table: :ecom_core_users }
|
10
|
+
t.string :status, null: false, default: 'Not Inspected'
|
11
|
+
t.string :remark
|
12
|
+
t.string :recommendation
|
13
|
+
t.references :task,
|
14
|
+
null: false,
|
15
|
+
index: { name: 'tic_on_task_indx' },
|
16
|
+
foreign_key: { to_table: :ecom_core_tasks }
|
17
|
+
t.string :standard
|
18
|
+
|
19
|
+
t.timestamps
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class CreateEcomCoreTaskTemplateInspectionChecklists < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
create_table :ecom_core_task_template_inspection_checklists do |t|
|
4
|
+
t.references :task_template,
|
5
|
+
null: false,
|
6
|
+
index: { name: 'ttic_on_tt_indx' },
|
7
|
+
foreign_key: { to_table: :ecom_core_task_templates }
|
8
|
+
t.references :inspection_checklist,
|
9
|
+
null: false,
|
10
|
+
index: { name: 'ttic_on_ic_indx' },
|
11
|
+
foreign_key: { to_table: :ecom_core_lookups }
|
12
|
+
t.string :standard
|
13
|
+
|
14
|
+
t.timestamps
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|