ecom_core 1.2.31 → 1.2.36
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.
- 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
|
@@ -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,23 @@
|
|
|
1
|
+
class CreateEcomCoreDimensionElements < ActiveRecord::Migration[6.0]
|
|
2
|
+
def change
|
|
3
|
+
create_table :ecom_core_dimension_elements do |t|
|
|
4
|
+
|
|
5
|
+
t.references :work_product,
|
|
6
|
+
null: false,
|
|
7
|
+
index: { name: 'dimension_on_wp_indx' },
|
|
8
|
+
foreign_key: { to_table: :ecom_core_work_products }
|
|
9
|
+
|
|
10
|
+
t.references :measurement_unit,
|
|
11
|
+
null: false,
|
|
12
|
+
index: { name: 'dimension_on_mu_indx' },
|
|
13
|
+
foreign_key: { to_table: :ecom_core_measurement_units }
|
|
14
|
+
|
|
15
|
+
t.string :dimension_element_name, null: false
|
|
16
|
+
t.float :amount
|
|
17
|
+
|
|
18
|
+
t.timestamps
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
add_index :ecom_core_dimension_elements, [:work_product_id, :dimension_element_name], unique: true, name: 'de_on_wp_and_den'
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -9,6 +9,7 @@ class CreateEcomCoreJobCards < ActiveRecord::Migration[6.0]
|
|
|
9
9
|
t.boolean :approved, null: false, default: false
|
|
10
10
|
t.boolean :checkin_confirmed, null: false, default: false
|
|
11
11
|
t.boolean :checkout_confirmed, null: false, default: false
|
|
12
|
+
t.boolean :costs_approved, null: false, default: false
|
|
12
13
|
t.references :maintenance_service_order,
|
|
13
14
|
null: false,
|
|
14
15
|
index: { name: 'jc_on_mso_indx' },
|
|
@@ -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
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
class CreateEcomCoreUnitCosts < ActiveRecord::Migration[6.0]
|
|
2
|
+
def change
|
|
3
|
+
create_table :ecom_core_unit_costs do |t|
|
|
4
|
+
t.references :resource_type,
|
|
5
|
+
null: false,
|
|
6
|
+
index: { name: 'uc_on_rt_indx' },
|
|
7
|
+
foreign_key: { to_table: :ecom_core_resource_types }
|
|
8
|
+
t.float :quantity
|
|
9
|
+
t.references :measurement_unit,
|
|
10
|
+
null: false,
|
|
11
|
+
index: { name: 'uc_on_mu_indx' },
|
|
12
|
+
foreign_key: { to_table: :ecom_core_measurement_units }
|
|
13
|
+
t.float :price
|
|
14
|
+
t.references :currency,
|
|
15
|
+
null: false,
|
|
16
|
+
index: { name: 'uc_on_currency_indx' },
|
|
17
|
+
foreign_key: { to_table: :ecom_core_currencies }
|
|
18
|
+
t.float :utilization_factor, default: 1
|
|
19
|
+
t.date :effective_date
|
|
20
|
+
t.boolean :active, default: true
|
|
21
|
+
t.references :set_by,
|
|
22
|
+
null: false,
|
|
23
|
+
index: { name: 'uc_on_user_indx' },
|
|
24
|
+
foreign_key: { to_table: :ecom_core_users }
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
t.timestamps
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
class CreateEcomCoreLookaheadPlanBacklogs < ActiveRecord::Migration[6.0]
|
|
2
|
+
def change
|
|
3
|
+
create_table :ecom_core_lookahead_plan_backlogs, id: false do |t|
|
|
4
|
+
t.references :lookahead_plan,
|
|
5
|
+
null: false,
|
|
6
|
+
index: { name: 'lpb_on_lp_indx' },
|
|
7
|
+
foreign_key: { to_table: :ecom_core_lookahead_plans }
|
|
8
|
+
|
|
9
|
+
t.references :task,
|
|
10
|
+
null: false,
|
|
11
|
+
index: { name: 'lpb_on_tas_indx' },
|
|
12
|
+
foreign_key: { to_table: :ecom_core_tasks }
|
|
13
|
+
|
|
14
|
+
t.timestamps
|
|
15
|
+
end
|
|
16
|
+
add_index :ecom_core_lookahead_plan_backlogs, [:lookahead_plan_id, :task_id], unique: true, name: 'lpb_on_lp_and_task'
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
class CreateEcomCoreLookaheadPlanHistories < ActiveRecord::Migration[6.0]
|
|
2
|
+
def change
|
|
3
|
+
create_table :ecom_core_lookahead_plan_histories do |t|
|
|
4
|
+
|
|
5
|
+
t.references :lookahead_plan,
|
|
6
|
+
null: false,
|
|
7
|
+
index: { name: 'lph_on_lp_indx' },
|
|
8
|
+
foreign_key: { to_table: :ecom_core_lookahead_plans }
|
|
9
|
+
|
|
10
|
+
t.references :task,
|
|
11
|
+
null: false,
|
|
12
|
+
index: { name: 'lph_on_tas_indx' },
|
|
13
|
+
foreign_key: { to_table: :ecom_core_tasks }
|
|
14
|
+
t.date :start_date, null: false
|
|
15
|
+
t.date :end_date, null: false
|
|
16
|
+
t.integer :lookahead_plan_revision_number, null: false
|
|
17
|
+
|
|
18
|
+
t.timestamps
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
class CreateEcomCoreLookaheadPlanTaskProgresses < ActiveRecord::Migration[6.0]
|
|
2
|
+
def change
|
|
3
|
+
create_table :ecom_core_lookahead_plan_task_progresses do |t|
|
|
4
|
+
|
|
5
|
+
t.references :lookahead_plan,
|
|
6
|
+
null: false,
|
|
7
|
+
index: { name: 'lptp_on_lp_indx' },
|
|
8
|
+
foreign_key: { to_table: :ecom_core_lookahead_plans }
|
|
9
|
+
|
|
10
|
+
t.references :task,
|
|
11
|
+
null: false,
|
|
12
|
+
index: { name: 'lptp_on_tas_indx' },
|
|
13
|
+
foreign_key: { to_table: :ecom_core_tasks }
|
|
14
|
+
t.date :started_on, null: false
|
|
15
|
+
t.date :ended_on, null: false
|
|
16
|
+
t.integer :lookahead_plan_revision_number, null: false
|
|
17
|
+
|
|
18
|
+
t.timestamps
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
class CreateEcomCoreTaskAttachments < ActiveRecord::Migration[6.0]
|
|
2
|
+
def change
|
|
3
|
+
create_table :ecom_core_task_attachments do |t|
|
|
4
|
+
t.string :title, null: false
|
|
5
|
+
t.string :description
|
|
6
|
+
t.string :file
|
|
7
|
+
t.references :task,
|
|
8
|
+
null: false,
|
|
9
|
+
index: { name: 'ta_on_task_indx' },
|
|
10
|
+
foreign_key: { to_table: :ecom_core_tasks }
|
|
11
|
+
|
|
12
|
+
t.timestamps
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
class CreateEcomCoreLookaheadPlanReviewTimes < ActiveRecord::Migration[6.0]
|
|
2
|
+
def change
|
|
3
|
+
create_table :ecom_core_lookahead_plan_review_times do |t|
|
|
4
|
+
|
|
5
|
+
t.references :lookahead_plan,
|
|
6
|
+
null: false,
|
|
7
|
+
index: { name: 'lprt_on_lp_indx' },
|
|
8
|
+
foreign_key: { to_table: :ecom_core_lookahead_plans }
|
|
9
|
+
|
|
10
|
+
t.datetime :review_time, null: false
|
|
11
|
+
t.string :status
|
|
12
|
+
t.integer :lookahead_plan_revision_number
|
|
13
|
+
|
|
14
|
+
t.timestamps
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
class CreateEcomCoreWorkItemResourceRequirementTemplates < ActiveRecord::Migration[6.0]
|
|
2
|
+
def change
|
|
3
|
+
create_table :ecom_core_work_item_resource_requirement_templates do |t|
|
|
4
|
+
t.references :project_work_item_template,
|
|
5
|
+
null: true,
|
|
6
|
+
index: { name: 'wirrl_on_pwit_indx' },
|
|
7
|
+
foreign_key: { to_table: :ecom_core_project_work_item_templates }
|
|
8
|
+
|
|
9
|
+
t.references :resource_type,
|
|
10
|
+
null: true,
|
|
11
|
+
index: { name: 'wirrl_on_rt_indx' },
|
|
12
|
+
foreign_key: { to_table: :ecom_core_resource_types }
|
|
13
|
+
|
|
14
|
+
t.float :work_item_quantity, null: false
|
|
15
|
+
|
|
16
|
+
t.references :work_item_quantity_measurement_unit,
|
|
17
|
+
null: true,
|
|
18
|
+
index: { name: 'wirrl_on_wiqmu_indx' },
|
|
19
|
+
foreign_key: { to_table: :ecom_core_measurement_units }
|
|
20
|
+
|
|
21
|
+
t.float :resource_quantity, null: false
|
|
22
|
+
|
|
23
|
+
t.references :resource_quantity_measurement_unit,
|
|
24
|
+
null: true,
|
|
25
|
+
index: { name: 'wirrl_on_rqmu_indx' },
|
|
26
|
+
foreign_key: { to_table: :ecom_core_measurement_units }
|
|
27
|
+
|
|
28
|
+
t.timestamps
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
class CreateEcomCoreResourceRequisitions < ActiveRecord::Migration[6.0]
|
|
2
|
+
def change
|
|
3
|
+
create_table :ecom_core_resource_requisitions do |t|
|
|
4
|
+
t.references :lookahead_plan,
|
|
5
|
+
null: false,
|
|
6
|
+
index: { name: 'rr_on_lp_indx' },
|
|
7
|
+
foreign_key: { to_table: :ecom_core_lookahead_plans }
|
|
8
|
+
|
|
9
|
+
t.references :reviewed_by,
|
|
10
|
+
null: true,
|
|
11
|
+
index: { name: 'rr_on_rb_indx' },
|
|
12
|
+
foreign_key: { to_table: :ecom_core_users }
|
|
13
|
+
t.references :approved_by,
|
|
14
|
+
null: true,
|
|
15
|
+
index: { name: 'rr_on_ab_indx' },
|
|
16
|
+
foreign_key: { to_table: :ecom_core_users }
|
|
17
|
+
t.string :delivery_point, null:false
|
|
18
|
+
t.string :status, null: false, default: 'Draft'
|
|
19
|
+
|
|
20
|
+
t.timestamps
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
class CreateEcomCoreResourceRequisitionItems < ActiveRecord::Migration[6.0]
|
|
2
|
+
def change
|
|
3
|
+
create_table :ecom_core_resource_requisition_items do |t|
|
|
4
|
+
t.references :resource_requisition,
|
|
5
|
+
null: false,
|
|
6
|
+
index: { name: 'rri_on_rr_indx' },
|
|
7
|
+
foreign_key: { to_table: :ecom_core_resource_requisitions }
|
|
8
|
+
|
|
9
|
+
t.references :resource_type,
|
|
10
|
+
null: false,
|
|
11
|
+
index: { name: 'rri_on_rt_indx' },
|
|
12
|
+
foreign_key: { to_table: :ecom_core_resource_types }
|
|
13
|
+
|
|
14
|
+
t.float :requested_quantity, null: false
|
|
15
|
+
|
|
16
|
+
t.references :requested_quantity_measurement_unit,
|
|
17
|
+
null: false,
|
|
18
|
+
index: { name: 'rri_on_rqmu_indx' },
|
|
19
|
+
foreign_key: { to_table: :ecom_core_measurement_units }
|
|
20
|
+
|
|
21
|
+
t.float :awaiting_quantity, null: false
|
|
22
|
+
|
|
23
|
+
t.references :awaiting_quantity_measurement_unit,
|
|
24
|
+
null: false,
|
|
25
|
+
index: { name: 'rri_on_aqmu_indx' },
|
|
26
|
+
foreign_key: { to_table: :ecom_core_measurement_units }
|
|
27
|
+
t.string :status, null: false, default: 'Pending'
|
|
28
|
+
t.datetime :due_date, null: false
|
|
29
|
+
|
|
30
|
+
t.timestamps
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
data/lib/ecom/core/version.rb
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
FactoryBot.define do
|
|
2
|
+
factory :crew_contract_transaction, class: Ecom::Core::CrewContractTransaction do
|
|
3
|
+
association :crew_contract
|
|
4
|
+
status { Ecom::Core::CrewContractTransaction::STATUSES.sample }
|
|
5
|
+
transaction_type { Ecom::Core::CrewContractTransaction::TRANSACTION_TYPES.sample }
|
|
6
|
+
effective_date { Date.today }
|
|
7
|
+
end
|
|
8
|
+
end
|
|
@@ -9,5 +9,17 @@ FactoryBot.define do
|
|
|
9
9
|
contract_signed { false }
|
|
10
10
|
date_contract_signed { Date.today }
|
|
11
11
|
association :crew
|
|
12
|
+
association :crew_type
|
|
13
|
+
wage { 75.0 }
|
|
14
|
+
wage_in_words { 'Seventy five birr only' }
|
|
15
|
+
status { :draft }
|
|
16
|
+
|
|
17
|
+
factory :active_crew_contract do
|
|
18
|
+
status { :in_effect }
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
factory :void_crew_contract do
|
|
22
|
+
status { :void }
|
|
23
|
+
end
|
|
12
24
|
end
|
|
13
25
|
end
|