ecom_core 1.2.6 → 1.2.7
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8604bb41df95be804fb66c2ac48f3e1b55b8f776de07f2dee665c4704350858
|
4
|
+
data.tar.gz: 30decab7dc7997c9c4a22bc2a90548c0b72a67b6648e894b6f1234c785739166
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac72d68e86a4ff54ee5bf33d3068cf57eb44ab5038873481be623cf1eb1c461c8c65749385536e973a9909c8269e5e06a1125562ff7c14a8c9dba322257fe500
|
7
|
+
data.tar.gz: 44c1ff6ddcbb054bd262ef9a0a75ab2fb6f42d4558a74afe7866c0ee451b45c577003f8c988a60e4a3e8341212451864cb4f633ffa4a6bf5d95bce1615ac7065
|
@@ -2,15 +2,17 @@ module Ecom
|
|
2
2
|
module Core
|
3
3
|
class Crew < ApplicationRecord
|
4
4
|
PERMANENT = 'Permanent'.freeze
|
5
|
+
SUPERVISOR = 'Supervisor'.freeze
|
5
6
|
TEMPORARY = 'Temporary'.freeze
|
7
|
+
EMPLOYMENT_TYPES = [PERMANENT, SUPERVISOR, TEMPORARY].freeze
|
6
8
|
|
7
9
|
before_save :set_employment_date,
|
8
10
|
if: proc { |c| c.employment_date.nil? }
|
9
11
|
|
10
12
|
belongs_to :crew_type
|
11
13
|
|
12
|
-
validates :name, :qualification, presence: true
|
13
|
-
validates :employment, inclusion:
|
14
|
+
validates :name, :address, :qualification, :employment, :wage, :wage_in_words, presence: true
|
15
|
+
validates :employment, inclusion: EMPLOYMENT_TYPES
|
14
16
|
|
15
17
|
def set_employment_date
|
16
18
|
self.employment_date = Date.today
|
data/config/database.ci.yml
CHANGED
@@ -3,11 +3,13 @@ class CreateEcomCoreCrews < ActiveRecord::Migration[6.0]
|
|
3
3
|
create_table :ecom_core_crews do |t|
|
4
4
|
t.string :employee_id
|
5
5
|
t.string :name, null: false
|
6
|
+
t.string :address, null: false
|
6
7
|
t.string :phone
|
7
8
|
t.string :email
|
8
9
|
t.string :qualification, null: false
|
9
10
|
t.string :employment, null: false
|
10
|
-
t.float :wage
|
11
|
+
t.float :wage, null: false
|
12
|
+
t.string :wage_in_words, null: false
|
11
13
|
t.date :employment_date
|
12
14
|
t.boolean :sub_contracted, null: false, default: false
|
13
15
|
t.string :guarantor_name
|
data/lib/ecom/core/version.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
FactoryBot.define do
|
2
2
|
factory :crew, class: Ecom::Core::Crew do
|
3
3
|
name { FFaker::Name.name }
|
4
|
+
address { FFaker::Name.name }
|
4
5
|
phone { FFaker::Name.name }
|
5
6
|
email { FFaker::Name.name }
|
6
7
|
qualification { FFaker::Name.name }
|
7
8
|
employment { Ecom::Core::Crew::PERMANENT }
|
8
9
|
wage { FFaker::Random.rand(1000..5000) }
|
10
|
+
wage_in_words { FFaker::Name.name }
|
9
11
|
employment_date { Date.today - 1 }
|
10
12
|
sub_contracted { false }
|
11
13
|
guarantor_name { FFaker::Name.name }
|