stackone_migration 1.5.0 → 1.6.1
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/Gemfile.lock +1 -1
 - data/lib/stackone_migration/api/link_token_api.rb +5 -2
 - data/lib/stackone_migration/mappers/employees_mapper.rb +10 -2
 - data/lib/stackone_migration/models/employee.rb +7 -0
 - data/lib/stackone_migration/models/employment.rb +7 -0
 - data/lib/stackone_migration/version.rb +1 -1
 - data/lib/stackone_migration.rb +4 -0
 - data/spec/api/link_token_api_spec.rb +2 -2
 - data/spec/mappers/employees_mapper_spec.rb +3 -0
 - metadata +4 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 5dc167022ee197e8544e7ed8d29ff67ac243c8125c55de8a447f45a8bafabc58
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 70623c0e8c55683ed893e5122b2305fa65b56401e75264993779c109c51b42bd
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 0de75d646ce9ff4f4838bf87eb0eed2fc668827376efac8fae801e1707fa1a0a50fe929d0500a73811f722317c1c4dbbd03460f713d00c3f236cfc15e11abfed
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: a64114273afce17ade79067c0714f5154e0f244dacaab3467816d6cbd53b0990c766697dcaffcd195ae7cd139860e0874ae6a7be4886a5b48c978b7dfae23010
         
     | 
    
        data/Gemfile.lock
    CHANGED
    
    
| 
         @@ -6,16 +6,19 @@ module MergeHRISClient 
     | 
|
| 
       6 
6 
     | 
    
         | 
| 
       7 
7 
     | 
    
         
             
                def link_token_create(end_user_details_request, opts = {})
         
     | 
| 
       8 
8 
     | 
    
         
             
                  return original_link_token_create(end_user_details_request, opts) if opts.key?(:use_merge) && opts[:use_merge]
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
                  mapped_integration_name = StackOneMigration::ProviderMapper.map_to_stackone_provider_name(end_user_details_request.integration)
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
       9 
12 
     | 
    
         
             
                  connect_session_create_request = StackOneHRIS::ConnectSessionCreate.new(
         
     | 
| 
       10 
13 
     | 
    
         
             
                    :origin_owner_id => end_user_details_request.end_user_origin_id,
         
     | 
| 
       11 
14 
     | 
    
         
             
                    :origin_owner_name => end_user_details_request.end_user_organization_name || end_user_details_request.end_user_email_address,
         
     | 
| 
       12 
15 
     | 
    
         
             
                    :origin_username => end_user_details_request.end_user_email_address,
         
     | 
| 
       13 
     | 
    
         
            -
                    :provider =>  
     | 
| 
      
 16 
     | 
    
         
            +
                    :provider => mapped_integration_name,
         
     | 
| 
       14 
17 
     | 
    
         
             
                    :categories => end_user_details_request.categories,
         
     | 
| 
       15 
18 
     | 
    
         
             
                  )
         
     | 
| 
       16 
19 
     | 
    
         | 
| 
       17 
20 
     | 
    
         
             
                  created_session = StackOneHRIS::ConnectSessionsApi.new.connect_sessions_create(connect_session_create_request)
         
     | 
| 
       18 
     | 
    
         
            -
                  MergeHRISClient::LinkToken.new(:link_token => created_session.token, :integration_name =>  
     | 
| 
      
 21 
     | 
    
         
            +
                  MergeHRISClient::LinkToken.new(:link_token => created_session.token, :integration_name => mapped_integration_name)
         
     | 
| 
       19 
22 
     | 
    
         | 
| 
       20 
23 
     | 
    
         
             
                rescue StackOneHRIS::ApiError
         
     | 
| 
       21 
24 
     | 
    
         
             
                  raise MergeHRISClient::ApiError
         
     | 
| 
         @@ -91,7 +91,7 @@ module StackOneMigration 
     | 
|
| 
       91 
91 
     | 
    
         
             
                def self.map_to_employee_model(employee)
         
     | 
| 
       92 
92 
     | 
    
         
             
                  return nil if employee.nil?
         
     | 
| 
       93 
93 
     | 
    
         | 
| 
       94 
     | 
    
         
            -
                  MergeHRISClient::Employee.new(
         
     | 
| 
      
 94 
     | 
    
         
            +
                  new_employee = MergeHRISClient::Employee.new(
         
     | 
| 
       95 
95 
     | 
    
         
             
                    :id => employee.id,
         
     | 
| 
       96 
96 
     | 
    
         
             
                    :remote_id => employee.id,
         
     | 
| 
       97 
97 
     | 
    
         
             
                    :first_name => employee.first_name,
         
     | 
| 
         @@ -114,6 +114,10 @@ module StackOneMigration 
     | 
|
| 
       114 
114 
     | 
    
         
             
                    :work_location => map_to_location_model(employee.work_location),
         
     | 
| 
       115 
115 
     | 
    
         
             
                    :employments => map_employments(employee.employments),
         
     | 
| 
       116 
116 
     | 
    
         
             
                  )
         
     | 
| 
      
 117 
     | 
    
         
            +
             
     | 
| 
      
 118 
     | 
    
         
            +
                  new_employee.employment_contract_type = employee.employment_contract_type unless employee.employment_contract_type.nil?
         
     | 
| 
      
 119 
     | 
    
         
            +
             
     | 
| 
      
 120 
     | 
    
         
            +
                  new_employee
         
     | 
| 
       117 
121 
     | 
    
         
             
                end
         
     | 
| 
       118 
122 
     | 
    
         | 
| 
       119 
123 
     | 
    
         
             
                def self.map_to_location_model(location)
         
     | 
| 
         @@ -137,7 +141,7 @@ module StackOneMigration 
     | 
|
| 
       137 
141 
     | 
    
         
             
                def self.map_to_employment_model(employment)
         
     | 
| 
       138 
142 
     | 
    
         
             
                  return nil if employment.nil?
         
     | 
| 
       139 
143 
     | 
    
         | 
| 
       140 
     | 
    
         
            -
                  MergeHRISClient::Employment.new(
         
     | 
| 
      
 144 
     | 
    
         
            +
                  new_employment = MergeHRISClient::Employment.new(
         
     | 
| 
       141 
145 
     | 
    
         
             
                    :job_title => employment.job_title,
         
     | 
| 
       142 
146 
     | 
    
         
             
                    :pay_rate => employment.pay_rate,
         
     | 
| 
       143 
147 
     | 
    
         
             
                    :pay_period => build_merge_enum(MergeHRISClient::PayPeriodEnum, pay_period_enum_hash, employment.pay_period),
         
     | 
| 
         @@ -146,6 +150,10 @@ module StackOneMigration 
     | 
|
| 
       146 
150 
     | 
    
         
             
                    :effective_date => employment.effective_date,
         
     | 
| 
       147 
151 
     | 
    
         
             
                    :employment_type => build_merge_enum(MergeHRISClient::EmploymentTypeEnum, employment_type_enum_hash, employment.employment_type),
         
     | 
| 
       148 
152 
     | 
    
         
             
                  )
         
     | 
| 
      
 153 
     | 
    
         
            +
             
     | 
| 
      
 154 
     | 
    
         
            +
                  new_employment.employment_contract_type = employment.employment_contract_type unless employment.employment_contract_type.nil?
         
     | 
| 
      
 155 
     | 
    
         
            +
             
     | 
| 
      
 156 
     | 
    
         
            +
                  new_employment
         
     | 
| 
       149 
157 
     | 
    
         
             
                end
         
     | 
| 
       150 
158 
     | 
    
         | 
| 
       151 
159 
     | 
    
         
             
                def self.map_employments(employments)
         
     | 
    
        data/lib/stackone_migration.rb
    CHANGED
    
    | 
         @@ -6,6 +6,10 @@ require 'merge_hris_client' 
     | 
|
| 
       6 
6 
     | 
    
         
             
            # Common files
         
     | 
| 
       7 
7 
     | 
    
         
             
            require 'stackone_migration/version'
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
      
 9 
     | 
    
         
            +
            # Models
         
     | 
| 
      
 10 
     | 
    
         
            +
            require 'stackone_migration/models/employee'
         
     | 
| 
      
 11 
     | 
    
         
            +
            require 'stackone_migration/models/employment'
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
       9 
13 
     | 
    
         
             
            # APIs
         
     | 
| 
       10 
14 
     | 
    
         
             
            require 'stackone_migration/api/employees_api'
         
     | 
| 
       11 
15 
     | 
    
         
             
            require 'stackone_migration/api/account_token_api'
         
     | 
| 
         @@ -33,12 +33,12 @@ describe MergeHRISClient::LinkTokenApi do 
     | 
|
| 
       33 
33 
     | 
    
         
             
                      :end_user_email_address => 'tos@potig.er',
         
     | 
| 
       34 
34 
     | 
    
         
             
                      :end_user_origin_id => 'user_origin_id',
         
     | 
| 
       35 
35 
     | 
    
         
             
                      :categories => ['hris'],
         
     | 
| 
       36 
     | 
    
         
            -
                      :integration => ' 
     | 
| 
      
 36 
     | 
    
         
            +
                      :integration => 'adp-workforce-now',
         
     | 
| 
       37 
37 
     | 
    
         
             
                    )
         
     | 
| 
       38 
38 
     | 
    
         | 
| 
       39 
39 
     | 
    
         
             
                    result = subject.link_token_create(end_user_details_request)
         
     | 
| 
       40 
40 
     | 
    
         | 
| 
       41 
     | 
    
         
            -
                    expect(result).to have_attributes(:link_token => 'test_token', :integration_name => ' 
     | 
| 
      
 41 
     | 
    
         
            +
                    expect(result).to have_attributes(:link_token => 'test_token', :integration_name => 'adpworkforcenow', :magic_link_url => nil)
         
     | 
| 
       42 
42 
     | 
    
         
             
                  end
         
     | 
| 
       43 
43 
     | 
    
         | 
| 
       44 
44 
     | 
    
         
             
                  it 'calls the connect sessions api with the right parameters' do
         
     | 
| 
         @@ -21,6 +21,7 @@ describe StackOneMigration::EmployeesMapper do 
     | 
|
| 
       21 
21 
     | 
    
         
             
                  :ethnicity => StackOneHRIS::EthnicityEnum.new(value: 'white', source_value: 'White'),
         
     | 
| 
       22 
22 
     | 
    
         
             
                  :marital_status => StackOneHRIS::MaritalStatusEnum.new(value: 'married', source_value: 'Married'),
         
     | 
| 
       23 
23 
     | 
    
         
             
                  :employment_status => StackOneHRIS::EmploymentStatusEnum.new(value: 'terminated', source_value: 'Terminated'),
         
     | 
| 
      
 24 
     | 
    
         
            +
                  :employment_contract_type => StackOneHRIS::EmploymentTypeEnum.new(value: 'full_time', source_value: 'Full time'),
         
     | 
| 
       24 
25 
     | 
    
         
             
                  :work_phone_number => '(456) 787-3508',
         
     | 
| 
       25 
26 
     | 
    
         
             
                  :job_title => 'Manager',
         
     | 
| 
       26 
27 
     | 
    
         
             
                  :department => 'Human Resources',
         
     | 
| 
         @@ -135,6 +136,7 @@ describe StackOneMigration::EmployeesMapper do 
     | 
|
| 
       135 
136 
     | 
    
         
             
                  expect(target_model.ethnicity).to have_attributes(:value => 'WHITE', :raw_value => 'White')
         
     | 
| 
       136 
137 
     | 
    
         
             
                  expect(target_model.marital_status).to have_attributes(:value => 'MARRIED_FILING_JOINTLY', :raw_value => 'Married')
         
     | 
| 
       137 
138 
     | 
    
         
             
                  expect(target_model.employment_status).to have_attributes(:value => 'INACTIVE', :raw_value => 'Terminated')
         
     | 
| 
      
 139 
     | 
    
         
            +
                  expect(target_model.employment_contract_type).to have_attributes(:value => 'full_time', :source_value => 'Full time')
         
     | 
| 
       138 
140 
     | 
    
         
             
                end
         
     | 
| 
       139 
141 
     | 
    
         | 
| 
       140 
142 
     | 
    
         
             
                context 'when the employee record has the avatar base64 field instead of url' do
         
     | 
| 
         @@ -337,6 +339,7 @@ describe StackOneMigration::EmployeesMapper do 
     | 
|
| 
       337 
339 
     | 
    
         
             
                  expect(target_model.pay_currency).to have_attributes(:value => 'USD', :raw_value => 'USD')
         
     | 
| 
       338 
340 
     | 
    
         
             
                  expect(target_model.effective_date).to eq('2018-01-01')
         
     | 
| 
       339 
341 
     | 
    
         
             
                  expect(target_model.employment_type).to have_attributes(:value => 'CONTRACTOR', :raw_value => 'Contractor')
         
     | 
| 
      
 342 
     | 
    
         
            +
                  expect(target_model.employment_contract_type).to have_attributes(:value => 'full_time', :source_value => 'Full time')
         
     | 
| 
       340 
343 
     | 
    
         
             
                end
         
     | 
| 
       341 
344 
     | 
    
         
             
              end
         
     | 
| 
       342 
345 
     | 
    
         | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: stackone_migration
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.6.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - StackOne
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2023- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2023-10-03 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: merge_hris_client
         
     | 
| 
         @@ -78,6 +78,8 @@ files: 
     | 
|
| 
       78 
78 
     | 
    
         
             
            - lib/stackone_migration/helpers/account_helper.rb
         
     | 
| 
       79 
79 
     | 
    
         
             
            - lib/stackone_migration/mappers/employees_mapper.rb
         
     | 
| 
       80 
80 
     | 
    
         
             
            - lib/stackone_migration/mappers/provider_mapper.rb
         
     | 
| 
      
 81 
     | 
    
         
            +
            - lib/stackone_migration/models/employee.rb
         
     | 
| 
      
 82 
     | 
    
         
            +
            - lib/stackone_migration/models/employment.rb
         
     | 
| 
       81 
83 
     | 
    
         
             
            - lib/stackone_migration/version.rb
         
     | 
| 
       82 
84 
     | 
    
         
             
            - spec/api/account_token_api_spec.rb
         
     | 
| 
       83 
85 
     | 
    
         
             
            - spec/api/delete_account_api_spec.rb
         
     |