ecom_core 1.2.31 → 1.2.36
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/controllers/ecom/core/unit_costs_controller.rb +29 -0
- 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 +15 -3
- 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/crew_time.rb +1 -1
- data/app/models/ecom/core/dimension_element.rb +22 -0
- data/app/models/ecom/core/inspection_checklist.rb +6 -0
- data/app/models/ecom/core/job_card.rb +1 -1
- data/app/models/ecom/core/lookahead_plan.rb +41 -0
- data/app/models/ecom/core/lookahead_plan_history.rb +16 -0
- data/app/models/ecom/core/lookahead_plan_review_time.rb +29 -0
- data/app/models/ecom/core/lookahead_plan_task_progress.rb +22 -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/measurement_unit.rb +45 -0
- data/app/models/ecom/core/overtime_sheet.rb +26 -16
- 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/resource_requisition.rb +21 -0
- data/app/models/ecom/core/resource_requisition_item.rb +45 -0
- data/app/models/ecom/core/schedule_setting.rb +8 -6
- 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/takeoff.rb +10 -0
- data/app/models/ecom/core/task.rb +28 -4
- data/app/models/ecom/core/task_attachment.rb +11 -0
- data/app/models/ecom/core/task_inspection_checklist.rb +18 -0
- data/app/models/ecom/core/task_resource.rb +2 -0
- data/app/models/ecom/core/task_template.rb +24 -2
- data/app/models/ecom/core/task_template_inspection_checklist.rb +8 -0
- data/app/models/ecom/core/unit_cost.rb +27 -0
- data/app/models/ecom/core/unit_of_measure.rb +8 -0
- data/app/models/ecom/core/work_item_resource_requirement_template.rb +18 -0
- data/app/models/ecom/core/work_order.rb +26 -0
- data/app/models/ecom/core/work_package.rb +3 -0
- data/app/models/ecom/core/work_product.rb +3 -18
- data/app/models/ecom/core/work_product_template.rb +2 -2
- data/app/serializers/ecom/core/unit_cost_serializer.rb +21 -0
- data/app/services/ecom/core/crew_contract_transaction_service.rb +89 -0
- data/app/services/ecom/core/site_crew_service.rb +44 -0
- data/app/uploaders/ecom/core/photo_uploader.rb +13 -2
- data/app/uploaders/ecom/core/task_attachment_uploader.rb +11 -0
- data/config/initializers/carrierwave.rb +9 -0
- data/config/routes.rb +4 -2
- data/db/migrate/20191118052213_create_ecom_core_unit_of_measures.rb +11 -0
- data/db/migrate/20191119012030_create_ecom_core_task_templates.rb +10 -1
- 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 -18
- data/db/migrate/{20191225100054_create_ecom_core_crews.rb → 20191207103729_create_ecom_core_crews.rb} +3 -3
- data/db/migrate/20191207103730_create_ecom_core_lookahead_plans.rb +19 -0
- data/db/migrate/20191207103731_create_ecom_core_work_orders.rb +23 -0
- data/db/migrate/20191207103735_create_ecom_core_tasks.rb +20 -7
- 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/20200813165553_create_ecom_core_measurement_units.rb +14 -0
- data/db/migrate/20200813165555_create_ecom_core_available_unit_of_measurements.rb +16 -0
- data/db/migrate/20200814043632_create_ecom_core_takeoffs.rb +14 -0
- data/db/migrate/20200901085227_create_ecom_core_crew_contracts.rb +7 -1
- data/db/migrate/20200901134912_create_ecom_core_dimension_elements.rb +23 -0
- data/db/migrate/20200919085613_create_ecom_core_job_cards.rb +1 -0
- 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/db/migrate/20201121064916_create_ecom_core_unit_costs.rb +30 -0
- data/db/migrate/20201122123227_create_ecom_core_lookahead_plan_backlogs.rb +18 -0
- data/db/migrate/20201122170645_create_ecom_core_lookahead_plan_histories.rb +21 -0
- data/db/migrate/20201122170724_create_ecom_core_lookahead_plan_task_progresses.rb +21 -0
- data/db/migrate/20201123134917_create_ecom_core_task_attachments.rb +15 -0
- data/db/migrate/20201124171642_create_ecom_core_lookahead_plan_review_times.rb +17 -0
- data/db/migrate/20201125191158_create_ecom_core_work_item_resource_requirement_templates.rb +31 -0
- data/db/migrate/20201126191334_create_ecom_core_resource_requisitions.rb +23 -0
- data/db/migrate/20201126191349_create_ecom_core_resource_requisition_items.rb +33 -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/ecom/core/dimension_elements.rb +8 -0
- data/spec/factories/ecom/core/inspection_checklists.rb +5 -0
- data/spec/factories/ecom/core/lookahead_plan_histories.rb +9 -0
- data/spec/factories/ecom/core/lookahead_plan_review_times.rb +8 -0
- data/spec/factories/ecom/core/lookahead_plan_task_progresses.rb +9 -0
- data/spec/factories/ecom/core/lookahead_plans.rb +10 -0
- data/spec/factories/ecom/core/maintenance_statuses.rb +1 -1
- 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/ecom/core/measurement_units.rb +16 -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/resource_requisition_items.rb +12 -0
- data/spec/factories/ecom/core/resource_requisitions.rb +9 -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/takeoffs.rb +6 -0
- data/spec/factories/ecom/core/task_attachments.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 +12 -1
- data/spec/factories/ecom/core/tasks.rb +9 -3
- data/spec/factories/ecom/core/unit_costs.rb +13 -0
- data/spec/factories/ecom/core/unit_of_measures.rb +7 -0
- data/spec/factories/ecom/core/work_item_resource_requirement_templates.rb +10 -0
- data/spec/factories/ecom/core/work_orders.rb +10 -0
- 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 -8
- metadata +155 -9
- data/app/services/ecom/core/project_crew_service.rb +0 -39
- data/db/migrate/20191225121850_create_ecom_core_project_crews.rb +0 -19
- data/db/migrate/20200922044959_add_costs_approved_to_job_card.rb +0 -5
- data/spec/factories/ecom/core/project_crews.rb +0 -9
data/config/routes.rb
CHANGED
@@ -15,6 +15,8 @@ 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
|
+
|
21
|
+
resources :unit_costs, only: %i[index create]
|
20
22
|
end
|
@@ -8,9 +8,18 @@ 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 :unit_of_measure,
|
12
|
+
null: false,
|
13
|
+
index: { name: 'tt_on_uof_indx' },
|
14
|
+
foreign_key: { to_table: :ecom_core_unit_of_measures }
|
11
15
|
t.string :ancestry, index: true
|
12
16
|
t.boolean :has_takeoff_fields, null:false, default: false
|
13
|
-
t.jsonb :
|
17
|
+
t.jsonb :takeoff_fields, null: false, default: {}
|
18
|
+
t.integer :percentage_contribution
|
19
|
+
t.integer :task_sequence
|
20
|
+
t.boolean :has_inspection, null: false, default: false
|
21
|
+
t.boolean :discipline, null: false, default: false
|
22
|
+
t.jsonb :task_completion_detail, null: false, default: {}
|
14
23
|
|
15
24
|
t.timestamps
|
16
25
|
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,8 +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 :
|
7
|
-
t.json :dimension
|
6
|
+
t.string :design_reference, unique: true
|
8
7
|
t.references :product_group,
|
9
8
|
null: true,
|
10
9
|
index: { name: 'wp_on_pg_indx' },
|
@@ -17,28 +16,13 @@ class CreateEcomCoreWorkProducts < ActiveRecord::Migration[6.0]
|
|
17
16
|
null: false,
|
18
17
|
index: { name: 'projects_on_wp_indx' },
|
19
18
|
foreign_key: { to_table: :ecom_core_projects }
|
20
|
-
t.string :status, default: 'New'
|
21
|
-
t.integer :percent_completed, null: false, default: 0
|
22
19
|
t.string :remark
|
23
|
-
t.references :approver,
|
24
|
-
null: true,
|
25
|
-
index: false,
|
26
|
-
foreign_key: { to_table: :ecom_core_users }
|
27
|
-
t.references :supervisor,
|
28
|
-
null: true,
|
29
|
-
index: false,
|
30
|
-
foreign_key: { to_table: :ecom_core_users }
|
31
|
-
t.references :quality_controller,
|
32
|
-
null: true,
|
33
|
-
index: false,
|
34
|
-
foreign_key: { to_table: :ecom_core_users }
|
35
20
|
t.datetime :start_date
|
36
21
|
t.datetime :completion_date
|
37
|
-
t.boolean :tasks_generated, null: false, default: false
|
38
22
|
|
39
23
|
t.timestamps
|
40
24
|
end
|
41
25
|
|
42
|
-
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'
|
43
27
|
end
|
44
28
|
end
|
@@ -9,12 +9,12 @@ class CreateEcomCoreCrews < ActiveRecord::Migration[6.0]
|
|
9
9
|
t.string :qualification, null: false
|
10
10
|
t.string :employment, null: false
|
11
11
|
t.float :wage, null: false
|
12
|
-
t.string :wage_in_words
|
12
|
+
t.string :wage_in_words
|
13
13
|
t.date :employment_date
|
14
14
|
t.boolean :sub_contracted, null: false, default: false
|
15
15
|
t.string :photo
|
16
|
-
t.string :guarantor_name
|
17
|
-
t.string :guarantor_phone
|
16
|
+
t.string :guarantor_name, null: false
|
17
|
+
t.string :guarantor_phone, null: false
|
18
18
|
t.boolean :active, null: false, default: true
|
19
19
|
t.references :crew_type,
|
20
20
|
null: false,
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class CreateEcomCoreLookaheadPlans < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
create_table :ecom_core_lookahead_plans do |t|
|
4
|
+
t.string :name, null: false
|
5
|
+
t.date :start_date, null: false
|
6
|
+
t.date :end_date, null: false
|
7
|
+
t.string :status, null: false, default: :new
|
8
|
+
t.integer :revision_number, default: 0
|
9
|
+
t.integer :lead_time, default: 336 # default lead time 2 weeks( 336 hours )
|
10
|
+
|
11
|
+
t.references :prepared_by,
|
12
|
+
null: false,
|
13
|
+
index: { name: 'lprt_on_pb_indx' },
|
14
|
+
foreign_key: { to_table: :ecom_core_users }
|
15
|
+
|
16
|
+
t.timestamps
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class CreateEcomCoreWorkOrders < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
create_table :ecom_core_work_orders do |t|
|
4
|
+
t.string :name
|
5
|
+
t.string :reference_number
|
6
|
+
t.references :assigned_to,
|
7
|
+
null: false,
|
8
|
+
index: { name: 'wo_on_at_indx' },
|
9
|
+
foreign_key: { to_table: :ecom_core_crews }
|
10
|
+
|
11
|
+
t.references :generated_by,
|
12
|
+
null: false,
|
13
|
+
index: { name: 'wo_on_gb_indx' },
|
14
|
+
foreign_key: { to_table: :ecom_core_users }
|
15
|
+
|
16
|
+
t.date :start_date, null: false
|
17
|
+
t.date :end_date, null: false
|
18
|
+
t.string :status, null: false, default: :new
|
19
|
+
|
20
|
+
t.timestamps
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -9,26 +9,39 @@ class CreateEcomCoreTasks < ActiveRecord::Migration[6.0]
|
|
9
9
|
t.date :end_date
|
10
10
|
t.string :status, null: false, default: :new
|
11
11
|
t.integer :percent_completed, null: false, default: 0
|
12
|
+
t.float :quantity
|
12
13
|
t.string :remark
|
14
|
+
t.date :inspection_submission_date
|
15
|
+
t.string :inspection_status, null: false, default: 'Not Inspected'
|
16
|
+
t.boolean :change_order, null: false, default: false
|
17
|
+
t.integer :percentage_contribution
|
18
|
+
t.references :change_order_for,
|
19
|
+
null: true,
|
20
|
+
index: { name: 'tasks_on_cot_indx' },
|
21
|
+
foreign_key: { to_table: :ecom_core_tasks }
|
13
22
|
t.references :work_package,
|
14
23
|
null: true,
|
15
|
-
index: { name: '
|
24
|
+
index: { name: 'tasks_on_work_package_indx' },
|
16
25
|
foreign_key: { to_table: :ecom_core_work_packages }
|
26
|
+
t.references :work_order,
|
27
|
+
null: true,
|
28
|
+
index: { name: 'tasks_on_wo_indx' },
|
29
|
+
foreign_key: { to_table: :ecom_core_work_orders }
|
17
30
|
t.references :performer,
|
18
31
|
null: true,
|
19
32
|
index: { name: 'tasks_on_performer_indx' },
|
20
33
|
foreign_key: { to_table: :ecom_core_users }
|
21
|
-
t.references :
|
34
|
+
t.references :client_consultant,
|
22
35
|
null: true,
|
23
|
-
index: { name: '
|
36
|
+
index: { name: 'tasks_on_cc_indx' },
|
24
37
|
foreign_key: { to_table: :ecom_core_users }
|
25
|
-
t.references :
|
38
|
+
t.references :foreman,
|
26
39
|
null: true,
|
27
|
-
index: { name: '
|
40
|
+
index: { name: 'tasks_on_foreman_indx' },
|
28
41
|
foreign_key: { to_table: :ecom_core_users }
|
29
|
-
t.references :
|
42
|
+
t.references :inspector,
|
30
43
|
null: true,
|
31
|
-
index: { name: '
|
44
|
+
index: { name: 'tasks_on_inspector_indx' },
|
32
45
|
foreign_key: { to_table: :ecom_core_users }
|
33
46
|
t.references :work_product,
|
34
47
|
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,14 @@
|
|
1
|
+
class CreateEcomCoreMeasurementUnits < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
create_table :ecom_core_measurement_units do |t|
|
4
|
+
t.string :name, null: false
|
5
|
+
t.string :abbrivation, null: false
|
6
|
+
t.string :physical_quantity, null: false
|
7
|
+
t.boolean :is_si_unit, null: false, default: false
|
8
|
+
t.float :conversion_factor, null: false
|
9
|
+
t.string :system_of_measurement, null: false
|
10
|
+
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
end
|
14
|
+
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
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateEcomCoreTakeoffs < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
create_table :ecom_core_takeoffs do |t|
|
4
|
+
t.references :task,
|
5
|
+
null: false,
|
6
|
+
index: { name: 'takeoff_on_task_indx' },
|
7
|
+
foreign_key: { to_table: :ecom_core_tasks }
|
8
|
+
|
9
|
+
t.float :takeoff_quantity, null: false
|
10
|
+
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|