ecom_core 1.2.16 → 1.2.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82c394e94081fae6031af51e74ef103dc091d16b6e30ff8be5301a6f2ce42563
4
- data.tar.gz: 988110edec8061117aecce19244003b94f56e5e810a7038614a8529fac3a52c4
3
+ metadata.gz: d4ad578f6c6d7aece965edd8d3ad059afb16ff3f90445ba63f55c6afdc530b8f
4
+ data.tar.gz: a31af1754f7ccdc5669a1fe5747745bb8d98d0e82371db261bee62cd08d50f38
5
5
  SHA512:
6
- metadata.gz: 7b2e2332eae3a441a0eee06a701d28a1d89f4ef853da5aac9837d9e06fcb483b8052234b12c15b9a2a6473b2e5488554a22d4b44db81eed5e9e1e415bff15da4
7
- data.tar.gz: 6b742e0294967e7759f0a9fe40dfc568aad618c3679cb43d5e054705331f8ffc7e4fb904e80617d2761bb4b53e9a82bd70285af9f7d6d53d170f44e8adaaf882
6
+ metadata.gz: 7720605e3fa55dd2ff8d12358a5ece0c11f11c47647b4ac1b9be6ca35d308592d3e2ffef33c9beea298c149f5abb301f0612a194934539ab357c78699529d3cb
7
+ data.tar.gz: 4c1a5cf5b05c9a8f247fb0b457b9904b9e98bb884a0b5e8a8da38b8268ae7177f631c51ab905dc947042f7117b1f8bf1525a1b92b76d3b1423c24ee157f0af5f
@@ -13,4 +13,4 @@ module Ecom
13
13
  validates :status, presence: true, inclusion: STATUSES
14
14
  end
15
15
  end
16
- end
16
+ end
@@ -1,7 +1,9 @@
1
- module Ecom::Core
2
- class ProductGroup < ApplicationRecord
3
- belongs_to :project
1
+ module Ecom
2
+ module Core
3
+ class ProductGroup < ApplicationRecord
4
+ belongs_to :project
4
5
 
5
- validates :name, presence: true, uniqueness: true
6
+ validates :name, presence: true, uniqueness: true
7
+ end
6
8
  end
7
9
  end
@@ -5,7 +5,7 @@ module Ecom
5
5
  belongs_to :contractor, class_name: 'Ecom::Core::Stakeholder'
6
6
  belongs_to :consultant, class_name: 'Ecom::Core::Stakeholder'
7
7
  belongs_to :project_manager, class_name: 'Ecom::Core::Stakeholder'
8
- belongs_to :task_template
8
+ belongs_to :task_template_type
9
9
  belongs_to :currency
10
10
  belongs_to :company
11
11
 
@@ -2,13 +2,9 @@ module Ecom
2
2
  module Core
3
3
  class WorkProductTemplate < ApplicationRecord
4
4
  validates :code, :name, presence: true, uniqueness: true
5
+ belongs_to :task_template_type
5
6
  has_and_belongs_to_many :task_templates
6
7
  has_many :product_types
7
-
8
- scope :filtered_by_template_type, lambda { |id|
9
- joins(:task_template).where('ecom_core_task_templates.task_template_type_id = ?', id)
10
- .order(:code)
11
- }
12
8
  end
13
9
  end
14
10
  end
@@ -7,7 +7,7 @@ module Ecom
7
7
  INNER JOIN ecom_core_menus_user_roles MUR ON MUR.menu_id = ecom_core_menus.id
8
8
  INNER JOIN ecom_core_user_roles UR ON MUR.user_role_id = UR.id
9
9
  SQL
10
- menu = Menu.joins(join_sql).where('UR.id IN (?)', role_ids).distinct
10
+ menu = Menu.joins(join_sql).where('UR.id IN (?)', role_ids).order(:id).distinct
11
11
  menu_list = menu.select { |m| m.parent.nil? }.each_with_object([]) do |item, list|
12
12
  list << { id: item.id, text: item.label, iconCss: item.icon, items: [] }
13
13
  end
@@ -4,7 +4,10 @@ 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.string :remark
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 }
8
11
 
9
12
  t.timestamps
10
13
  end
@@ -22,10 +22,10 @@ class CreateEcomCoreProjects < ActiveRecord::Migration[6.0]
22
22
  null: false,
23
23
  index: { name: 'employer_on_pm_indx' },
24
24
  foreign_key: { to_table: :ecom_core_stakeholders }
25
- t.references :task_template,
25
+ t.references :task_template_type,
26
26
  null: false,
27
27
  index: { name: 'employer_on_tt_indx' },
28
- foreign_key: { to_table: :ecom_core_task_templates }
28
+ foreign_key: { to_table: :ecom_core_task_template_types }
29
29
  t.string :contract_number, null: false
30
30
  t.date :date_contract_signed, null: false
31
31
  t.date :commencement_date, null: false
@@ -1,5 +1,5 @@
1
1
  module Ecom
2
2
  module Core
3
- VERSION = '1.2.16'.freeze
3
+ VERSION = '1.2.17'.freeze
4
4
  end
5
5
  end
@@ -9,7 +9,7 @@ FactoryBot.define do
9
9
  association :contractor, factory: :stakeholder
10
10
  association :consultant, factory: :stakeholder
11
11
  association :project_manager, factory: :stakeholder
12
- association :task_template
12
+ association :task_template_type
13
13
  contract_number { FFaker::Name.name }
14
14
  date_contract_signed { 30.days.ago }
15
15
  commencement_date { 1.day.ago }
@@ -7,6 +7,6 @@ FactoryBot.define do
7
7
  "Name#{n}"
8
8
  end
9
9
  description { FFaker::Name.name }
10
- remark { FFaker::Name.name }
10
+ association :task_template_type
11
11
  end
12
12
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecom_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.16
4
+ version: 1.2.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henock L.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-14 00:00:00.000000000 Z
11
+ date: 2020-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aasm
@@ -248,8 +248,6 @@ files:
248
248
  - app/models/ecom/core/task_template_type.rb
249
249
  - app/models/ecom/core/user.rb
250
250
  - app/models/ecom/core/user_role.rb
251
- - app/models/ecom/core/work_component.rb
252
- - app/models/ecom/core/work_component_template.rb
253
251
  - app/models/ecom/core/work_package.rb
254
252
  - app/models/ecom/core/work_product.rb
255
253
  - app/models/ecom/core/work_product_template.rb
@@ -273,7 +271,6 @@ files:
273
271
  - db/migrate/20191119144618_create_ecom_core_stakeholders.rb
274
272
  - db/migrate/20191119145711_create_ecom_core_resource_types.rb
275
273
  - db/migrate/20191201131341_create_ecom_core_product_types.rb
276
- - db/migrate/20191201134420_create_ecom_core_work_component_templates.rb
277
274
  - db/migrate/20191201145816_create_ecom_core_currencies.rb
278
275
  - db/migrate/20191201145848_create_ecom_core_projects.rb
279
276
  - db/migrate/20191201251015_create_ecom_core_product_groups.rb
@@ -284,7 +281,6 @@ files:
284
281
  - db/migrate/20191202221423_create_ecom_core_menus.rb
285
282
  - db/migrate/20191202222210_create_ecom_core_work_packages.rb
286
283
  - db/migrate/20191202235434_create_ecom_core_work_products.rb
287
- - db/migrate/20191206104247_create_ecom_core_work_components.rb
288
284
  - db/migrate/20191207103735_create_ecom_core_tasks.rb
289
285
  - db/migrate/20191210724614_create_ecom_core_task_resources.rb
290
286
  - db/migrate/20191225100054_create_ecom_core_crews.rb
@@ -360,8 +356,6 @@ files:
360
356
  - spec/factories/ecom/core/tasks.rb
361
357
  - spec/factories/ecom/core/user_roles.rb
362
358
  - spec/factories/ecom/core/users.rb
363
- - spec/factories/ecom/core/work_component_templates.rb
364
- - spec/factories/ecom/core/work_components.rb
365
359
  - spec/factories/ecom/core/work_packages.rb
366
360
  - spec/factories/ecom/core/work_product_templates.rb
367
361
  - spec/factories/ecom/core/work_products.rb
@@ -1,14 +0,0 @@
1
- module Ecom
2
- module Core
3
- class WorkComponent < ApplicationRecord
4
- belongs_to :performer, class_name: 'Ecom::Core::User'
5
- belongs_to :approver, class_name: 'Ecom::Core::User'
6
- belongs_to :supervisor, class_name: 'Ecom::Core::User'
7
- belongs_to :quality_controller, class_name: 'Ecom::Core::User'
8
- belongs_to :work_component_template
9
- belongs_to :task
10
-
11
- validates :name, :assignment_status, :task_status, :percent_completed, presence: true
12
- end
13
- end
14
- end
@@ -1,11 +0,0 @@
1
- module Ecom
2
- module Core
3
- class WorkComponentTemplate < ApplicationRecord
4
- belongs_to :work_product_template
5
- belongs_to :task_template
6
-
7
- validates :code, :name, presence: true
8
- validates :code, uniqueness: { scope: %i[work_product_template_id task_template_id] }
9
- end
10
- end
11
- end
@@ -1,25 +0,0 @@
1
- class CreateEcomCoreWorkComponentTemplates < ActiveRecord::Migration[6.0]
2
- def change
3
- create_table :ecom_core_work_component_templates do |t|
4
- t.string :code, null: false
5
- t.string :name, null: false
6
- t.string :description
7
- t.integer :relative_percentage
8
- t.json :dimension
9
- t.references :work_product_template,
10
- null: false,
11
- index: { name: 'wct_on_wpt_indx' },
12
- foreign_key: { to_table: :ecom_core_work_product_templates }
13
- t.references :task_template,
14
- null: false,
15
- index: { name: 'wct_on_tt_indx' },
16
- foreign_key: { to_table: :ecom_core_task_templates }
17
-
18
- t.timestamps
19
- end
20
-
21
- add_index :ecom_core_work_component_templates, %i[code work_product_template_id task_template_id],
22
- unique: true,
23
- name: 'wct_on_code_wpt_id_tt_id_indx'
24
- end
25
- end
@@ -1,40 +0,0 @@
1
- class CreateEcomCoreWorkComponents < ActiveRecord::Migration[6.0]
2
- def change
3
- create_table :ecom_core_work_components do |t|
4
- t.string :name, null: false
5
- t.json :dimension
6
- t.string :assignment_status, null: false, default: :unassigned
7
- t.string :task_status, null: false, default: :new
8
- t.integer :percent_completed, null: false, default: 0
9
- t.string :remark
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 }
26
- t.date :start_date
27
- t.date :completion_date
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 }
36
-
37
- t.timestamps
38
- end
39
- end
40
- end
@@ -1,13 +0,0 @@
1
- FactoryBot.define do
2
- factory :work_component_template, class: Ecom::Core::WorkComponentTemplate do
3
- sequence :code do |n|
4
- "WCTCode#{n}"
5
- end
6
- name { FFaker::Name.name }
7
- description { FFaker::Name.name }
8
- relative_percentage { FFaker::Random.rand(0..100) }
9
- dimension { [{ label: 'Length', name: 'length' }, { label: 'Width', name: 'width' }] }
10
- association :work_product_template
11
- association :task_template
12
- end
13
- end
@@ -1,18 +0,0 @@
1
- FactoryBot.define do
2
- factory :work_component, class: Ecom::Core::WorkComponent do
3
- name { FFaker::Name.name }
4
- dimension { [{ label: 'Length', name: 'length', value: 10 }] }
5
- assignment_status { :unassigned }
6
- task_status { :new }
7
- percent_completed { FFaker::Random.rand(1..100) }
8
- remark { FFaker::Name.name }
9
- association :performer, factory: :user
10
- association :approver, factory: :user
11
- association :supervisor, factory: :user
12
- association :quality_controller, factory: :user
13
- start_date { 1.day.ago }
14
- completion_date { Time.now.next_week }
15
- association :work_component_template
16
- association :work_product
17
- end
18
- end