ecom_core 1.0.22 → 1.0.23

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f45781b38a120c782949fe3133566f994e81fe5723ce77f4e535b61b7d2ef3ad
4
- data.tar.gz: 66f86d09d7b065950b202b2c5ffce8943da5168d8f96cc80b1763a312afe2aa9
3
+ metadata.gz: c71dd789c02616763f898bdd8417b5f18e8ed743890d93024506b911142b1934
4
+ data.tar.gz: 457632bac3ee575a2dd699bb86955b8abf7203795b5d38d420aacc4458859ccf
5
5
  SHA512:
6
- metadata.gz: bc70b7327aa2af6160cdb074430fa6ddc744c80df67a264c40cb20a577f7d248733c07d32894b714a28f9dd1c6f49ffabbdb25beae6174da7f9e0c662bdf8686
7
- data.tar.gz: 4cc556044dc408bfec968a8e9f04c44c9a373fb02ed0a6af49ad2206d84fabc985cbeb404fae691740dbf1d209e5e6680c14f5499fd3c1494a9327b65fcd64cf
6
+ metadata.gz: b55f2bb4e3017e18f3231d39df50d23529e87bc4654b1c9ca3b64a9ffa5f1c99502fedbdff61d55dbca4e0a67a4a5995e7664b579824382dad0ddd2e5b29ac7f
7
+ data.tar.gz: f19f8aa6b7746d8ccc3887758797dc4f906fc94f3ce82ffd38dbb62908b5f6f33e425e46f5d9f479c9ad6e34ab3445043c529ee6760da25c8898b711d3250c26
@@ -0,0 +1,10 @@
1
+ module Ecom
2
+ module Core
3
+ class Equipment < ApplicationRecord
4
+ belongs_to :equipment_category
5
+
6
+ validates :name, :minimum_acquisition_time, presence: true
7
+ validates :name, uniqueness: { scope: :equipment_category_id }
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ module Ecom
2
+ module Core
3
+ class EquipmentCategory < ApplicationRecord
4
+ belongs_to :equipment_type
5
+
6
+ validates :name, presence: true, uniqueness: { scope: :equipment_type_id }
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Ecom
2
+ module Core
3
+ class EquipmentComponent < ApplicationRecord
4
+ belongs_to :equipment_item
5
+
6
+ validates :name, presence: true
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,14 @@
1
+ module Ecom
2
+ module Core
3
+ class EquipmentItem < ApplicationRecord
4
+ READY = 'Ready'
5
+ UNDER_MAINTENANCE = 'Under Maintenance'
6
+
7
+ belongs_to :equipment
8
+ belongs_to :current_location, class_name: 'Ecom::Core::EquipmentLocation'
9
+
10
+ validates :name, :status, :serial_number, :purchase_date, :purchase_price, presence: true
11
+ validates :serial_number, uniqueness: true
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,10 @@
1
+ module Ecom
2
+ module Core
3
+ class EquipmentLocation < ApplicationRecord
4
+ belongs_to :location_type
5
+
6
+ validates :name, :address, presence: true
7
+ validates :name, uniqueness: true
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ module Ecom
2
+ module Core
3
+ class EquipmentValuation < ApplicationRecord
4
+ belongs_to :equipment_item
5
+
6
+ validates :equipment_value, :residual_value, :work_hrs_per_yr, :life_year, :insurance_premium, presence: true
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,6 @@
1
+ module Ecom
2
+ module Core
3
+ class LocationType < Lookup
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,14 @@
1
+ class CreateEcomCoreEquipmentLocations < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :ecom_core_equipment_locations do |t|
4
+ t.string :name, null: false, unique: true
5
+ t.string :description
6
+ t.string :address, null: false
7
+ t.references :location_type, null: false, index: { name: 'ecel_on_lt_indx' }
8
+
9
+ t.timestamps
10
+ end
11
+
12
+ add_foreign_key :ecom_core_equipment_locations, :ecom_core_lookups, column: :location_type_id
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ class CreateEcomCoreEquipmentCategories < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :ecom_core_equipment_categories do |t|
4
+ t.string :name, null: false
5
+ t.string :description
6
+ t.references :equipment_type, null: false, index: { name: 'et_on_ecec_indx' }
7
+
8
+ t.timestamps
9
+ end
10
+
11
+ 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
+ end
14
+ end
@@ -0,0 +1,15 @@
1
+ class CreateEcomCoreEquipment < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :ecom_core_equipment do |t|
4
+ t.string :name, null: false
5
+ t.string :description
6
+ t.float :minimum_acquisition_time, null: false, default: 0
7
+ t.references :equipment_category, null: false, index: { name: 'ec_on_ece_indx' }
8
+
9
+ t.timestamps
10
+ end
11
+
12
+ 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
+ end
15
+ end
@@ -0,0 +1,23 @@
1
+ class CreateEcomCoreEquipmentItems < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :ecom_core_equipment_items do |t|
4
+ t.string :name, null: false
5
+ t.string :description
6
+ t.string :status, null: false
7
+ t.string :serial_number, unique: true
8
+ t.string :brand
9
+ t.string :item_model
10
+ t.float :purchase_price, null: false
11
+ t.date :purchase_date, null: false
12
+ t.float :license_fee
13
+ t.float :tax
14
+ t.references :equipment, null: false, index: { name: 'equipment_on_ei_indx' }
15
+ t.references :current_location, null: false, index: { name: 'equipment_on_el_indx' }
16
+
17
+ t.timestamps
18
+ 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
+ end
23
+ end
@@ -0,0 +1,21 @@
1
+ class CreateEcomCoreEquipmentValuations < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :ecom_core_equipment_valuations do |t|
4
+ t.float :equipment_value, null: false
5
+ t.float :residual_value, null: false
6
+ t.float :work_hrs_per_yr, null: false
7
+ t.float :life_year, null: false
8
+ t.float :insurance_premium, null: false
9
+ t.float :fuel_cost_per_hr
10
+ t.float :oil_cost
11
+ t.float :repair_rate
12
+ t.float :rate_of_return
13
+ t.boolean :current, null: false, default: true
14
+ t.references :equipment_item, index: { name: 'ev_on_ei_indx' }
15
+
16
+ t.timestamps
17
+ end
18
+
19
+ add_foreign_key :ecom_core_equipment_valuations, :ecom_core_equipment_items, column: :equipment_item_id
20
+ end
21
+ end
@@ -0,0 +1,13 @@
1
+ class CreateEcomCoreEquipmentComponents < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :ecom_core_equipment_components do |t|
4
+ t.string :serial_number
5
+ t.string :name, null: false
6
+ t.references :equipment_item, null: false, index: { name: 'ei_on_ec_indx' }
7
+
8
+ t.timestamps
9
+ end
10
+
11
+ add_foreign_key :ecom_core_equipment_components, :ecom_core_equipment_items, column: :equipment_item_id
12
+ end
13
+ end
@@ -1,5 +1,5 @@
1
1
  module Ecom
2
2
  module Core
3
- VERSION = '1.0.22'.freeze
3
+ VERSION = '1.0.23'.freeze
4
4
  end
5
5
  end
@@ -0,0 +1,8 @@
1
+ FactoryBot.define do
2
+ factory :equipment, class: 'Ecom::Core::Equipment' do
3
+ name { FFaker::Name.name }
4
+ description { FFaker::Name.name }
5
+ minimum_acquisition_time { 10 }
6
+ association :equipment_category
7
+ end
8
+ end
@@ -0,0 +1,7 @@
1
+ FactoryBot.define do
2
+ factory :equipment_category, class: 'Ecom::Core::EquipmentCategory' do
3
+ name { FFaker::Name.name }
4
+ description { FFaker::Name.name }
5
+ association :equipment_type
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ FactoryBot.define do
2
+ factory :equipment_component, class: 'Ecom::Core::EquipmentComponent' do
3
+ serial_number { FFaker::Name.name }
4
+ name { FFaker::Name.name }
5
+ association :equipment_item
6
+ end
7
+ end
@@ -0,0 +1,16 @@
1
+ FactoryBot.define do
2
+ factory :equipment_item, class: 'Ecom::Core::EquipmentItem' do
3
+ name { FFaker::Name.name }
4
+ description { FFaker::Name.name }
5
+ status { FFaker::Name.name }
6
+ serial_number { FFaker::Name.name }
7
+ brand { FFaker::Name.name }
8
+ item_model { FFaker::Name.name }
9
+ purchase_price { 1000 }
10
+ purchase_date { Date.today }
11
+ license_fee { 200 }
12
+ tax { 500 }
13
+ association :equipment
14
+ association :current_location, factory: :equipment_location
15
+ end
16
+ end
@@ -0,0 +1,8 @@
1
+ FactoryBot.define do
2
+ factory :equipment_location, class: 'Ecom::Core::EquipmentLocation' do
3
+ name { FFaker::Name.name }
4
+ description { FFaker::Name.name }
5
+ address { FFaker::Name.name }
6
+ association :location_type
7
+ end
8
+ end
@@ -0,0 +1,15 @@
1
+ FactoryBot.define do
2
+ factory :equipment_valuation, class: 'Ecom::Core::EquipmentValuation' do
3
+ equipment_value { 1500 }
4
+ residual_value { 150 }
5
+ work_hrs_per_yr { 150 }
6
+ life_year { 15 }
7
+ insurance_premium { 100 }
8
+ fuel_cost_per_hr { 1.5 }
9
+ oil_cost { 10 }
10
+ repair_rate { 1 }
11
+ rate_of_return { 3 }
12
+ current { false }
13
+ association :equipment_item
14
+ end
15
+ end
@@ -0,0 +1,5 @@
1
+ FactoryBot.define do
2
+ factory :location_type, class: 'Ecom::Core::LocationType', parent: :lookup do
3
+ type { 'Ecom::Core::LocationType' }
4
+ end
5
+ 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.0.22
4
+ version: 1.0.23
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-03-10 00:00:00.000000000 Z
11
+ date: 2020-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aasm
@@ -221,7 +221,14 @@ files:
221
221
  - app/models/ecom/core/crew_type.rb
222
222
  - app/models/ecom/core/currency.rb
223
223
  - app/models/ecom/core/custom_payment_detail.rb
224
+ - app/models/ecom/core/equipment.rb
225
+ - app/models/ecom/core/equipment_category.rb
226
+ - app/models/ecom/core/equipment_component.rb
227
+ - app/models/ecom/core/equipment_item.rb
228
+ - app/models/ecom/core/equipment_location.rb
224
229
  - app/models/ecom/core/equipment_type.rb
230
+ - app/models/ecom/core/equipment_valuation.rb
231
+ - app/models/ecom/core/location_type.rb
225
232
  - app/models/ecom/core/lookup.rb
226
233
  - app/models/ecom/core/material_type.rb
227
234
  - app/models/ecom/core/menu.rb
@@ -281,6 +288,12 @@ files:
281
288
  - db/migrate/20200210095535_add_advance_column_to_payment_details.rb
282
289
  - db/migrate/20200221123207_add_employee_id_to_crew.rb
283
290
  - db/migrate/20200307112519_create_ecom_core_custom_payment_details.rb
291
+ - db/migrate/20200315145215_create_ecom_core_equipment_locations.rb
292
+ - db/migrate/20200315150500_create_ecom_core_equipment_categories.rb
293
+ - db/migrate/20200315152143_create_ecom_core_equipment.rb
294
+ - db/migrate/20200315153640_create_ecom_core_equipment_items.rb
295
+ - db/migrate/20200315160810_create_ecom_core_equipment_valuations.rb
296
+ - db/migrate/20200316125323_create_ecom_core_equipment_components.rb
284
297
  - lib/ecom/core.rb
285
298
  - lib/ecom/core/engine.rb
286
299
  - lib/ecom/core/version.rb
@@ -292,7 +305,14 @@ files:
292
305
  - spec/factories/ecom/core/crews.rb
293
306
  - spec/factories/ecom/core/currencies.rb
294
307
  - spec/factories/ecom/core/custom_payment_details.rb
308
+ - spec/factories/ecom/core/equipment.rb
309
+ - spec/factories/ecom/core/equipment_categories.rb
310
+ - spec/factories/ecom/core/equipment_components.rb
311
+ - spec/factories/ecom/core/equipment_items.rb
312
+ - spec/factories/ecom/core/equipment_locations.rb
295
313
  - spec/factories/ecom/core/equipment_types.rb
314
+ - spec/factories/ecom/core/equipment_valuations.rb
315
+ - spec/factories/ecom/core/location_types.rb
296
316
  - spec/factories/ecom/core/lookups.rb
297
317
  - spec/factories/ecom/core/material_types.rb
298
318
  - spec/factories/ecom/core/menus.rb