ecom_core 1.2.5 → 1.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/ecom/core/attendance_sheet.rb +24 -19
- data/app/models/ecom/core/attendance_sheet_entry.rb +1 -1
- data/app/models/ecom/core/company.rb +10 -0
- data/app/models/ecom/core/crew.rb +0 -2
- data/app/models/ecom/core/crew_overtime.rb +1 -1
- data/app/models/ecom/core/crew_time.rb +0 -3
- data/app/models/ecom/core/overtime_sheet.rb +13 -10
- data/app/models/ecom/core/payment_detail.rb +1 -1
- data/app/models/ecom/core/payroll.rb +1 -0
- data/app/models/ecom/core/project.rb +4 -0
- data/app/models/ecom/core/project_crew.rb +15 -0
- data/db/migrate/20190101085530_create_ecom_core_companies.rb +14 -0
- data/db/migrate/20191119012030_create_ecom_core_task_templates.rb +4 -3
- data/db/migrate/20191119013236_create_ecom_core_work_product_templates.rb +4 -3
- data/db/migrate/20191119144618_create_ecom_core_stakeholders.rb +4 -3
- data/db/migrate/20191201131341_create_ecom_core_product_types.rb +4 -2
- data/db/migrate/20191201134420_create_ecom_core_work_component_templates.rb +8 -6
- data/db/migrate/20191201145848_create_ecom_core_projects.rb +28 -13
- data/db/migrate/20191202103735_create_ecom_core_tasks.rb +8 -5
- data/db/migrate/20191202105355_create_task_templates_resource_types.rb +8 -7
- data/db/migrate/20191202220832_create_ecom_core_users.rb +9 -6
- data/db/migrate/20191202220953_create_ecom_core_user_roles.rb +13 -8
- data/db/migrate/20191202221423_create_ecom_core_menus.rb +16 -9
- data/db/migrate/20191202235434_create_ecom_core_work_products.rb +29 -15
- data/db/migrate/20191206104247_create_ecom_core_work_components.rb +24 -14
- data/db/migrate/20191225100054_create_ecom_core_crews.rb +5 -3
- data/db/migrate/20191225121850_create_ecom_core_project_crews.rb +19 -0
- data/db/migrate/{20200401040433_create_ecom_core_attendance_sheets.rb → 20191225140433_create_ecom_core_attendance_sheets.rb} +4 -0
- data/db/migrate/20191225162539_create_ecom_core_attendance_sheet_entries.rb +17 -0
- data/db/migrate/20191225211712_create_ecom_core_crew_times.rb +15 -9
- data/db/migrate/20200126081005_create_ecom_core_payrolls.rb +4 -0
- data/db/migrate/20200126082103_create_ecom_core_payments.rb +6 -3
- data/db/migrate/20200126183218_create_ecom_core_payment_details.rb +10 -5
- data/db/migrate/20200307112519_create_ecom_core_custom_payment_details.rb +4 -3
- data/db/migrate/20200315145215_create_ecom_core_equipment_locations.rb +4 -3
- data/db/migrate/20200315150500_create_ecom_core_equipment_categories.rb +4 -2
- data/db/migrate/20200315152143_create_ecom_core_equipment.rb +4 -2
- data/db/migrate/20200315153640_create_ecom_core_equipment_items.rb +8 -5
- data/db/migrate/20200315160810_create_ecom_core_equipment_valuations.rb +4 -3
- data/db/migrate/20200316125323_create_ecom_core_equipment_components.rb +4 -3
- data/db/migrate/20200410090701_create_ecom_core_overtime_sheets.rb +4 -0
- data/db/migrate/20200410100035_create_ecom_core_overtime_sheet_entries.rb +8 -5
- data/db/migrate/20200410111827_create_ecom_core_crew_overtimes.rb +17 -11
- data/lib/ecom/core/version.rb +1 -1
- data/spec/factories/ecom/core/application_modules.rb +1 -1
- data/spec/factories/ecom/core/attendance_sheet_entries.rb +1 -1
- data/spec/factories/ecom/core/attendance_sheets.rb +2 -1
- data/spec/factories/ecom/core/companies.rb +9 -0
- data/spec/factories/ecom/core/crew_overtimes.rb +1 -1
- data/spec/factories/ecom/core/crew_times.rb +1 -1
- data/spec/factories/ecom/core/crew_types.rb +1 -1
- data/spec/factories/ecom/core/crews.rb +1 -1
- data/spec/factories/ecom/core/currencies.rb +1 -1
- data/spec/factories/ecom/core/custom_payment_details.rb +1 -1
- data/spec/factories/ecom/core/equipment.rb +1 -1
- data/spec/factories/ecom/core/equipment_categories.rb +1 -1
- data/spec/factories/ecom/core/equipment_components.rb +1 -1
- data/spec/factories/ecom/core/equipment_items.rb +1 -1
- data/spec/factories/ecom/core/equipment_locations.rb +1 -1
- data/spec/factories/ecom/core/equipment_types.rb +1 -1
- data/spec/factories/ecom/core/equipment_valuations.rb +1 -1
- data/spec/factories/ecom/core/location_types.rb +1 -1
- data/spec/factories/ecom/core/lookups.rb +1 -1
- data/spec/factories/ecom/core/material_types.rb +1 -1
- data/spec/factories/ecom/core/menus.rb +1 -1
- data/spec/factories/ecom/core/overtime_sheet_entries.rb +1 -1
- data/spec/factories/ecom/core/overtime_sheets.rb +2 -1
- data/spec/factories/ecom/core/overtime_types.rb +1 -1
- data/spec/factories/ecom/core/payment_details.rb +1 -1
- data/spec/factories/ecom/core/payments.rb +1 -1
- data/spec/factories/ecom/core/payrolls.rb +2 -1
- data/spec/factories/ecom/core/product_types.rb +1 -1
- data/spec/factories/ecom/core/project_crews.rb +9 -0
- data/spec/factories/ecom/core/projects.rb +2 -1
- data/spec/factories/ecom/core/resource_types.rb +1 -1
- data/spec/factories/ecom/core/stakeholder_types.rb +1 -1
- data/spec/factories/ecom/core/stakeholders.rb +1 -1
- data/spec/factories/ecom/core/task_template_types.rb +1 -1
- data/spec/factories/ecom/core/task_templates.rb +1 -1
- data/spec/factories/ecom/core/tasks.rb +1 -1
- data/spec/factories/ecom/core/user_roles.rb +1 -1
- data/spec/factories/ecom/core/users.rb +1 -1
- data/spec/factories/ecom/core/work_component_templates.rb +1 -1
- data/spec/factories/ecom/core/work_components.rb +1 -1
- data/spec/factories/ecom/core/work_product_templates.rb +1 -1
- data/spec/factories/ecom/core/work_products.rb +2 -2
- metadata +25 -15
- data/db/migrate/20200207035823_add_additional_columns_to_payment.rb +0 -6
- data/db/migrate/20200207040844_add_net_pay_column_to_payment_details.rb +0 -5
- data/db/migrate/20200210095535_add_advance_column_to_payment_details.rb +0 -5
- data/db/migrate/20200221123207_add_employee_id_to_crew.rb +0 -5
- data/db/migrate/20200401071343_remove_date_column_from_crew_times.rb +0 -5
- data/db/migrate/20200401122539_create_ecom_core_attendance_sheet_entries.rb +0 -14
- data/db/migrate/20200401142959_relate_crew_time_with_attendance_sheet_entry.rb +0 -8
- data/db/migrate/20200401144137_remove_crew_time_id_from_crew.rb +0 -7
- data/db/migrate/20200413144023_fix_crew_time_columns.rb +0 -17
- data/db/migrate/20200414044144_adjust_crew_overtime_column_names.rb +0 -6
- data/db/migrate/20200414185248_change_time_columns_to_datetime.rb +0 -8
@@ -7,24 +7,34 @@ class CreateEcomCoreWorkComponents < ActiveRecord::Migration[6.0]
|
|
7
7
|
t.string :task_status, null: false, default: :new
|
8
8
|
t.integer :percent_completed, null: false, default: 0
|
9
9
|
t.string :remark
|
10
|
-
t.references :performer,
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
t.references :performer,
|
11
|
+
null: true,
|
12
|
+
index: false,
|
13
|
+
foreign_key: { to_table: :ecom_core_users }
|
14
|
+
t.references :approver,
|
15
|
+
null: true,
|
16
|
+
index: false,
|
17
|
+
foreign_key: { to_table: :ecom_core_users }
|
18
|
+
t.references :supervisor,
|
19
|
+
null: true,
|
20
|
+
index: false,
|
21
|
+
foreign_key: { to_table: :ecom_core_users }
|
22
|
+
t.references :quality_controller,
|
23
|
+
null: true,
|
24
|
+
index: false,
|
25
|
+
foreign_key: { to_table: :ecom_core_users }
|
14
26
|
t.date :start_date
|
15
27
|
t.date :completion_date
|
16
|
-
t.references :work_component_template,
|
17
|
-
|
28
|
+
t.references :work_component_template,
|
29
|
+
null: false,
|
30
|
+
index: { name: 'wct_on_wc_indx' },
|
31
|
+
foreign_key: { to_table: :ecom_core_work_component_templates }
|
32
|
+
t.references :work_product,
|
33
|
+
null: false,
|
34
|
+
index: { name: 'wp_on_wc_indx' },
|
35
|
+
foreign_key: { to_table: :ecom_core_work_products }
|
18
36
|
|
19
37
|
t.timestamps
|
20
38
|
end
|
21
|
-
|
22
|
-
add_foreign_key :ecom_core_work_components, :ecom_core_users, column: :performer_id
|
23
|
-
add_foreign_key :ecom_core_work_components, :ecom_core_users, column: :approver_id
|
24
|
-
add_foreign_key :ecom_core_work_components, :ecom_core_users, column: :supervisor_id
|
25
|
-
add_foreign_key :ecom_core_work_components, :ecom_core_users, column: :quality_controller_id
|
26
|
-
add_foreign_key :ecom_core_work_components, :ecom_core_work_component_templates,
|
27
|
-
column: :work_component_template_id
|
28
|
-
add_foreign_key :ecom_core_work_components, :ecom_core_work_products, column: :work_product_id
|
29
39
|
end
|
30
40
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
class CreateEcomCoreCrews < ActiveRecord::Migration[6.0]
|
2
2
|
def change
|
3
3
|
create_table :ecom_core_crews do |t|
|
4
|
+
t.string :employee_id
|
4
5
|
t.string :name, null: false
|
5
6
|
t.string :phone
|
6
7
|
t.string :email
|
@@ -12,11 +13,12 @@ class CreateEcomCoreCrews < ActiveRecord::Migration[6.0]
|
|
12
13
|
t.string :guarantor_name
|
13
14
|
t.string :guarantor_phone
|
14
15
|
t.boolean :active, null: false, default: true
|
15
|
-
t.references :crew_type,
|
16
|
+
t.references :crew_type,
|
17
|
+
null: false,
|
18
|
+
index: { name: 'crew_on_ct_indx' },
|
19
|
+
foreign_key: { to_table: :ecom_core_resource_types }
|
16
20
|
|
17
21
|
t.timestamps
|
18
22
|
end
|
19
|
-
|
20
|
-
add_foreign_key :ecom_core_crews, :ecom_core_resource_types, column: :crew_type_id
|
21
23
|
end
|
22
24
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class CreateEcomCoreProjectCrews < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
create_table :ecom_core_project_crews do |t|
|
4
|
+
t.references :project,
|
5
|
+
null: false,
|
6
|
+
index: { name: 'pc_on_project_indx' },
|
7
|
+
foreign_key: { to_table: :ecom_core_projects }
|
8
|
+
t.references :crew,
|
9
|
+
null: false,
|
10
|
+
index: { name: 'pc_on_crew_indx' },
|
11
|
+
foreign_key: { to_table: :ecom_core_crews }
|
12
|
+
t.date :start_date, null: false
|
13
|
+
t.date :end_date
|
14
|
+
t.string :status, null: false, default: 'Inactive'
|
15
|
+
|
16
|
+
t.timestamps
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -6,6 +6,10 @@ class CreateEcomCoreAttendanceSheets < ActiveRecord::Migration[6.0]
|
|
6
6
|
t.time :closed_at
|
7
7
|
t.string :remark
|
8
8
|
t.string :status, null: false, default: 'Open'
|
9
|
+
t.references :project,
|
10
|
+
null: false,
|
11
|
+
index: { name: 'as_on_project_indx' },
|
12
|
+
foreign_key: { to_table: :ecom_core_projects }
|
9
13
|
|
10
14
|
t.timestamps
|
11
15
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class CreateEcomCoreAttendanceSheetEntries < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
create_table :ecom_core_attendance_sheet_entries do |t|
|
4
|
+
t.references :attendance_sheet,
|
5
|
+
null: false,
|
6
|
+
index: { name: 'ase_on_as_indx' },
|
7
|
+
foreign_key: { to_table: :ecom_core_attendance_sheets }
|
8
|
+
t.references :crew,
|
9
|
+
null: false,
|
10
|
+
index: { name: 'ase_on_crew_indx' },
|
11
|
+
foreign_key: { to_table: :ecom_core_crews }
|
12
|
+
t.float :total_hours
|
13
|
+
|
14
|
+
t.timestamps
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,19 +1,25 @@
|
|
1
1
|
class CreateEcomCoreCrewTimes < ActiveRecord::Migration[6.0]
|
2
2
|
def change
|
3
3
|
create_table :ecom_core_crew_times do |t|
|
4
|
-
t.
|
5
|
-
t.
|
6
|
-
t.time :checkout_time
|
4
|
+
t.datetime :checkin_time
|
5
|
+
t.datetime :checkout_time
|
7
6
|
t.float :hours, null: false
|
8
|
-
t.float :converted_hours, null: false, default: 0
|
9
|
-
t.references :crew, index: { name: 'ct_on_crew_indx' }
|
10
7
|
t.string :remark
|
11
|
-
t.boolean :
|
12
|
-
t.
|
8
|
+
t.boolean :revised, null: false, default: false
|
9
|
+
t.references :revision_to,
|
10
|
+
null: true,
|
11
|
+
index: { name: 'ct_on_rt_indx' },
|
12
|
+
foreign_key: { to_table: :ecom_core_crew_times }
|
13
|
+
t.references :created_by,
|
14
|
+
null: false,
|
15
|
+
index: { name: 'ct_on_cb_indx' },
|
16
|
+
foreign_key: { to_table: :ecom_core_users }
|
17
|
+
t.references :attendance_sheet_entry,
|
18
|
+
null: false,
|
19
|
+
index: { name: 'ct_on_ase_indx' },
|
20
|
+
foreign_key: { to_table: :ecom_core_attendance_sheet_entries }
|
13
21
|
|
14
22
|
t.timestamps
|
15
23
|
end
|
16
|
-
|
17
|
-
add_foreign_key :ecom_core_crew_times, :ecom_core_crews, column: :crew_id
|
18
24
|
end
|
19
25
|
end
|
@@ -4,6 +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 :project,
|
8
|
+
null: false,
|
9
|
+
index: { name: 'payroll_on_project_indx' },
|
10
|
+
foreign_key: { to_table: :ecom_core_projects }
|
7
11
|
|
8
12
|
t.timestamps
|
9
13
|
end
|
@@ -3,11 +3,14 @@ class CreateEcomCorePayments < ActiveRecord::Migration[6.0]
|
|
3
3
|
create_table :ecom_core_payments do |t|
|
4
4
|
t.date :from, null: false
|
5
5
|
t.date :to, null: false
|
6
|
-
t.
|
6
|
+
t.boolean :approved, null: false, default: false
|
7
|
+
t.integer :payment_order, null: false, default: 1
|
8
|
+
t.references :payroll,
|
9
|
+
null: false,
|
10
|
+
index: { name: 'payments_on_payroll_indx' },
|
11
|
+
foreign_key: { to_table: :ecom_core_payrolls }
|
7
12
|
|
8
13
|
t.timestamps
|
9
14
|
end
|
10
|
-
|
11
|
-
add_foreign_key :ecom_core_payments, :ecom_core_payrolls, column: :payroll_id
|
12
15
|
end
|
13
16
|
end
|
@@ -9,13 +9,18 @@ class CreateEcomCorePaymentDetails < ActiveRecord::Migration[6.0]
|
|
9
9
|
t.float :tax, null: false, default: 0
|
10
10
|
t.float :pension, null: false, default: 0
|
11
11
|
t.float :net_salary, null: false
|
12
|
-
t.
|
13
|
-
t.
|
12
|
+
t.float :advance, null: false, default: 0
|
13
|
+
t.float :net_pay, null: false, default: 0
|
14
|
+
t.references :crew,
|
15
|
+
null: false,
|
16
|
+
index: { name: 'pd_on_crew_indx' },
|
17
|
+
foreign_key: { to_table: :ecom_core_crews }
|
18
|
+
t.references :payment,
|
19
|
+
null: false,
|
20
|
+
index: { name: 'pd_on_payment_indx' },
|
21
|
+
foreign_key: { to_table: :ecom_core_payments }
|
14
22
|
|
15
23
|
t.timestamps
|
16
24
|
end
|
17
|
-
|
18
|
-
add_foreign_key :ecom_core_payment_details, :ecom_core_crews, column: :crew_id
|
19
|
-
add_foreign_key :ecom_core_payment_details, :ecom_core_payments, column: :payment_id
|
20
25
|
end
|
21
26
|
end
|
@@ -14,11 +14,12 @@ class CreateEcomCoreCustomPaymentDetails < ActiveRecord::Migration[6.0]
|
|
14
14
|
t.float :advance, null: false
|
15
15
|
t.float :wage, null: false
|
16
16
|
t.string :qualification
|
17
|
-
t.references :payment,
|
17
|
+
t.references :payment,
|
18
|
+
null: false,
|
19
|
+
index: { name: 'cpd_on_payment_indx' },
|
20
|
+
foreign_key: { to_table: :ecom_core_payments }
|
18
21
|
|
19
22
|
t.timestamps
|
20
23
|
end
|
21
|
-
|
22
|
-
add_foreign_key :ecom_core_custom_payment_details, :ecom_core_payments, column: :payment_id
|
23
24
|
end
|
24
25
|
end
|
@@ -4,11 +4,12 @@ class CreateEcomCoreEquipmentLocations < ActiveRecord::Migration[6.0]
|
|
4
4
|
t.string :name, null: false, unique: true
|
5
5
|
t.string :description
|
6
6
|
t.string :address, null: false
|
7
|
-
t.references :location_type,
|
7
|
+
t.references :location_type,
|
8
|
+
null: false,
|
9
|
+
index: { name: 'ecel_on_lt_indx' },
|
10
|
+
foreign_key: { to_table: :ecom_core_lookups }
|
8
11
|
|
9
12
|
t.timestamps
|
10
13
|
end
|
11
|
-
|
12
|
-
add_foreign_key :ecom_core_equipment_locations, :ecom_core_lookups, column: :location_type_id
|
13
14
|
end
|
14
15
|
end
|
@@ -3,12 +3,14 @@ class CreateEcomCoreEquipmentCategories < ActiveRecord::Migration[6.0]
|
|
3
3
|
create_table :ecom_core_equipment_categories do |t|
|
4
4
|
t.string :name, null: false
|
5
5
|
t.string :description
|
6
|
-
t.references :equipment_type,
|
6
|
+
t.references :equipment_type,
|
7
|
+
null: false,
|
8
|
+
index: { name: 'et_on_ecec_indx' },
|
9
|
+
foreign_key: { to_table: :ecom_core_resource_types }
|
7
10
|
|
8
11
|
t.timestamps
|
9
12
|
end
|
10
13
|
|
11
14
|
add_index :ecom_core_equipment_categories, %i[name equipment_type_id], unique: true, name: 'ecec_name_et_indx'
|
12
|
-
add_foreign_key :ecom_core_equipment_categories, :ecom_core_resource_types, column: :equipment_type_id
|
13
15
|
end
|
14
16
|
end
|
@@ -4,12 +4,14 @@ class CreateEcomCoreEquipment < ActiveRecord::Migration[6.0]
|
|
4
4
|
t.string :name, null: false
|
5
5
|
t.string :description
|
6
6
|
t.float :minimum_acquisition_time, null: false, default: 0
|
7
|
-
t.references :equipment_category,
|
7
|
+
t.references :equipment_category,
|
8
|
+
null: false,
|
9
|
+
index: { name: 'ec_on_ece_indx' },
|
10
|
+
foreign_key: { to_table: :ecom_core_equipment_categories }
|
8
11
|
|
9
12
|
t.timestamps
|
10
13
|
end
|
11
14
|
|
12
15
|
add_index :ecom_core_equipment, %i[name equipment_category_id], unique: true
|
13
|
-
add_foreign_key :ecom_core_equipment, :ecom_core_equipment_categories, column: :equipment_category_id
|
14
16
|
end
|
15
17
|
end
|
@@ -11,13 +11,16 @@ class CreateEcomCoreEquipmentItems < ActiveRecord::Migration[6.0]
|
|
11
11
|
t.date :purchase_date, null: false
|
12
12
|
t.float :license_fee
|
13
13
|
t.float :tax
|
14
|
-
t.references :equipment,
|
15
|
-
|
14
|
+
t.references :equipment,
|
15
|
+
null: false,
|
16
|
+
index: { name: 'equipment_on_ei_indx' },
|
17
|
+
foreign_key: { to_table: :ecom_core_equipment }
|
18
|
+
t.references :current_location,
|
19
|
+
null: false,
|
20
|
+
index: { name: 'equipment_on_el_indx' },
|
21
|
+
foreign_key: { to_table: :ecom_core_equipment_locations }
|
16
22
|
|
17
23
|
t.timestamps
|
18
24
|
end
|
19
|
-
|
20
|
-
add_foreign_key :ecom_core_equipment_items, :ecom_core_equipment, column: :equipment_id
|
21
|
-
add_foreign_key :ecom_core_equipment_items, :ecom_core_equipment_locations, column: :current_location_id
|
22
25
|
end
|
23
26
|
end
|
@@ -11,11 +11,12 @@ class CreateEcomCoreEquipmentValuations < ActiveRecord::Migration[6.0]
|
|
11
11
|
t.float :repair_rate
|
12
12
|
t.float :rate_of_return
|
13
13
|
t.boolean :current, null: false, default: true
|
14
|
-
t.references :equipment_item,
|
14
|
+
t.references :equipment_item,
|
15
|
+
null: false,
|
16
|
+
index: { name: 'ev_on_ei_indx' },
|
17
|
+
foreign_key: { to_table: :ecom_core_equipment_items }
|
15
18
|
|
16
19
|
t.timestamps
|
17
20
|
end
|
18
|
-
|
19
|
-
add_foreign_key :ecom_core_equipment_valuations, :ecom_core_equipment_items, column: :equipment_item_id
|
20
21
|
end
|
21
22
|
end
|
@@ -3,11 +3,12 @@ class CreateEcomCoreEquipmentComponents < ActiveRecord::Migration[6.0]
|
|
3
3
|
create_table :ecom_core_equipment_components do |t|
|
4
4
|
t.string :serial_number
|
5
5
|
t.string :name, null: false
|
6
|
-
t.references :equipment_item,
|
6
|
+
t.references :equipment_item,
|
7
|
+
null: false,
|
8
|
+
index: { name: 'ei_on_ec_indx' },
|
9
|
+
foreign_key: { to_table: :ecom_core_equipment_items }
|
7
10
|
|
8
11
|
t.timestamps
|
9
12
|
end
|
10
|
-
|
11
|
-
add_foreign_key :ecom_core_equipment_components, :ecom_core_equipment_items, column: :equipment_item_id
|
12
13
|
end
|
13
14
|
end
|
@@ -5,6 +5,10 @@ class CreateEcomCoreOvertimeSheets < ActiveRecord::Migration[6.0]
|
|
5
5
|
t.time :opened_at, null: false
|
6
6
|
t.time :submitted_at
|
7
7
|
t.string :status, null: false, default: 'Open'
|
8
|
+
t.references :project,
|
9
|
+
null: false,
|
10
|
+
index: { name: 'os_on_project_indx' },
|
11
|
+
foreign_key: { to_table: :ecom_core_projects }
|
8
12
|
|
9
13
|
t.timestamps
|
10
14
|
end
|
@@ -1,14 +1,17 @@
|
|
1
1
|
class CreateEcomCoreOvertimeSheetEntries < ActiveRecord::Migration[6.0]
|
2
2
|
def change
|
3
3
|
create_table :ecom_core_overtime_sheet_entries do |t|
|
4
|
-
t.references :overtime_sheet,
|
5
|
-
|
4
|
+
t.references :overtime_sheet,
|
5
|
+
null: false,
|
6
|
+
index: { name: 'ose_on_os_indx' },
|
7
|
+
foreign_key: { to_table: :ecom_core_overtime_sheets }
|
8
|
+
t.references :crew,
|
9
|
+
null: false,
|
10
|
+
index: { name: 'ose_on_crew_indx' },
|
11
|
+
foreign_key: { to_table: :ecom_core_crews }
|
6
12
|
t.float :total_overtime
|
7
13
|
|
8
14
|
t.timestamps
|
9
15
|
end
|
10
|
-
add_foreign_key :ecom_core_overtime_sheet_entries, :ecom_core_overtime_sheets,
|
11
|
-
column: :overtime_sheet_id
|
12
|
-
add_foreign_key :ecom_core_overtime_sheet_entries, :ecom_core_crews, column: :crew_id
|
13
16
|
end
|
14
17
|
end
|
@@ -1,21 +1,27 @@
|
|
1
1
|
class CreateEcomCoreCrewOvertimes < ActiveRecord::Migration[6.0]
|
2
2
|
def change
|
3
3
|
create_table :ecom_core_crew_overtimes do |t|
|
4
|
-
t.float :
|
5
|
-
t.float :
|
4
|
+
t.float :raw_hours, null: false
|
5
|
+
t.float :hours, null: false, default: 0
|
6
6
|
t.string :remark
|
7
|
-
t.references :overtime_type,
|
8
|
-
|
7
|
+
t.references :overtime_type,
|
8
|
+
null: false,
|
9
|
+
index: { name: 'ot_on_co_indx' },
|
10
|
+
foreign_key: { to_table: :ecom_core_overtime_types }
|
11
|
+
t.references :overtime_sheet_entry,
|
12
|
+
null: false,
|
13
|
+
index: { name: 'ose_on_co_indx' },
|
14
|
+
foreign_key: { to_table: :ecom_core_overtime_sheet_entries }
|
9
15
|
t.boolean :revised, null: false, default: false
|
10
|
-
t.references :revision_to,
|
11
|
-
|
16
|
+
t.references :revision_to,
|
17
|
+
null: true,
|
18
|
+
foreign_key: { to_table: :ecom_core_crew_overtimes }
|
19
|
+
t.references :created_by,
|
20
|
+
null: false,
|
21
|
+
index: { name: 'cb_on_co_indx' },
|
22
|
+
foreign_key: { to_table: :ecom_core_users }
|
12
23
|
|
13
24
|
t.timestamps
|
14
25
|
end
|
15
|
-
add_foreign_key :ecom_core_crew_overtimes, :ecom_core_overtime_types, column: :overtime_type_id
|
16
|
-
add_foreign_key :ecom_core_crew_overtimes, :ecom_core_overtime_sheet_entries,
|
17
|
-
column: :overtime_sheet_entry_id
|
18
|
-
add_foreign_key :ecom_core_crew_overtimes, :ecom_core_crew_overtimes, column: :revision_to_id
|
19
|
-
add_foreign_key :ecom_core_crew_overtimes, :ecom_core_users, column: :created_by_id
|
20
26
|
end
|
21
27
|
end
|
data/lib/ecom/core/version.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
FactoryBot.define do
|
2
|
-
factory :attendance_sheet_entry, class:
|
2
|
+
factory :attendance_sheet_entry, class: Ecom::Core::AttendanceSheetEntry do
|
3
3
|
association :attendance_sheet
|
4
4
|
association :crew
|
5
5
|
total_hours { FFaker::Random.rand(0..8) }
|
@@ -1,9 +1,10 @@
|
|
1
1
|
FactoryBot.define do
|
2
|
-
factory :attendance_sheet, class:
|
2
|
+
factory :attendance_sheet, class: Ecom::Core::AttendanceSheet do
|
3
3
|
date { Date.today }
|
4
4
|
opened_at { Time.now }
|
5
5
|
closed_at { nil }
|
6
6
|
remark { FFaker::Name.name }
|
7
7
|
status { Ecom::Core::AttendanceSheet::OPEN }
|
8
|
+
association :project
|
8
9
|
end
|
9
10
|
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
FactoryBot.define do
|
2
|
+
factory :company, class: Ecom::Core::Company do
|
3
|
+
code { FFaker::Name.name }
|
4
|
+
name { FFaker::Name.name }
|
5
|
+
address { FFaker::Address.street_address }
|
6
|
+
telephone { FFaker::PhoneNumber.phone_number }
|
7
|
+
email { FFaker::Internet.email }
|
8
|
+
end
|
9
|
+
end
|
@@ -1,8 +1,9 @@
|
|
1
1
|
FactoryBot.define do
|
2
|
-
factory :overtime_sheet, class:
|
2
|
+
factory :overtime_sheet, class: Ecom::Core::OvertimeSheet do
|
3
3
|
date { Date.today }
|
4
4
|
opened_at { Time.now }
|
5
5
|
submitted_at { Time.now + 1.day }
|
6
6
|
status { Ecom::Core::OvertimeSheet::OPEN }
|
7
|
+
association :project
|
7
8
|
end
|
8
9
|
end
|