File Coverage

blib/lib/WebService/BambooHR/Employee.pm
Criterion Covered Total %
statement 9 11 81.8
branch n/a
condition n/a
subroutine 3 4 75.0
pod 0 1 0.0
total 12 16 75.0


line stmt bran cond sub pod time code
1             package WebService::BambooHR::Employee;
2             $WebService::BambooHR::Employee::VERSION = '0.04';
3 5     5   117 use 5.006;
  5         18  
  5         197  
4 5     5   29 use Moo;
  5         9  
  5         46  
5             use overload
6 5         48 q{""} => 'as_string',
7 5     5   1657 fallback => 1;
  5         65  
8              
9             sub as_string
10             {
11 0     0 0   my $self = shift;
12              
13 0           return $self->firstName.' '.$self->lastName;
14             }
15              
16             has 'address1' => (is => 'ro');
17             has 'address2' => (is => 'ro');
18             has 'age' => (is => 'ro');
19             has 'bestEmail' => (is => 'ro');
20             has 'birthday' => (is => 'ro');
21             has 'bonusAmount' => (is => 'ro');
22             has 'bonusComment' => (is => 'ro');
23             has 'bonusDate' => (is => 'ro');
24             has 'bonusReason' => (is => 'ro');
25             has 'city' => (is => 'ro');
26             has 'commisionDate' => (is => 'ro');
27             has 'commissionAmount' => (is => 'ro');
28             has 'commissionComment' => (is => 'ro');
29             has 'commissionDate' => (is => 'ro');
30             has 'country' => (is => 'ro');
31             has 'dateOfBirth' => (is => 'ro');
32             has 'department' => (is => 'ro');
33             has 'displayName' => (is => 'ro');
34             has 'division' => (is => 'ro');
35             has 'eeo' => (is => 'ro');
36             has 'employeeNumber' => (is => 'ro');
37             has 'employmentHistoryStatus' => (is => 'ro');
38             has 'employmentStatus' => (is => 'ro');
39             has 'ethnicity' => (is => 'ro');
40             has 'exempt' => (is => 'ro');
41             has 'firstName' => (is => 'ro');
42             has 'flsaCode' => (is => 'ro');
43             has 'fullName1' => (is => 'ro');
44             has 'fullName2' => (is => 'ro');
45             has 'fullName3' => (is => 'ro');
46             has 'fullName4' => (is => 'ro');
47             has 'fullName5' => (is => 'ro');
48             has 'gender' => (is => 'ro');
49             has 'hireDate' => (is => 'ro');
50             has 'homeEmail' => (is => 'ro');
51             has 'homePhone' => (is => 'ro');
52             has 'id' => (is => 'ro');
53             has 'jobTitle' => (is => 'ro');
54             has 'lastChanged' => (is => 'ro');
55             has 'lastName' => (is => 'ro');
56             has 'location' => (is => 'ro');
57             has 'maritalStatus' => (is => 'ro');
58             has 'middleName' => (is => 'ro');
59             has 'mobilePhone' => (is => 'ro');
60             has 'nickname' => (is => 'ro');
61             has 'payChangeReason' => (is => 'ro');
62             has 'payGroup' => (is => 'ro');
63             has 'payGroupId' => (is => 'ro');
64             has 'payRate' => (is => 'ro');
65             has 'payRateEffectiveDate' => (is => 'ro');
66             has 'payType' => (is => 'ro');
67             has 'photoUploaded' => (is => 'ro');
68             has 'rehireDate' => (is => 'ro');
69             has 'selfServiceAccess' => (is => 'ro', init_arg => 1610);
70             has 'sin' => (is => 'ro');
71             has 'ssn' => (is => 'ro');
72             has 'standardHoursPerWeek' => (is => 'ro');
73             has 'state' => (is => 'ro');
74             has 'stateCode' => (is => 'ro');
75             has 'status' => (is => 'ro');
76             has 'supervisor' => (is => 'ro');
77             has 'supervisorEId' => (is => 'ro');
78             has 'supervisorId' => (is => 'ro');
79             has 'terminationDate' => (is => 'ro');
80             has 'terminationReason' => (is => 'ro', init_arg => 1361);
81             has 'terminationType' => (is => 'ro', init_arg => 1360);
82             has 'workEmail' => (is => 'ro');
83             has 'workPhone' => (is => 'ro');
84             has 'workPhoneExtension' => (is => 'ro');
85             has 'workPhonePlusExtension' => (is => 'ro');
86             has 'zipcode' => (is => 'ro');
87              
88             1;
89              
90             =head1 NAME
91              
92             WebService::BambooHR::Employee - data class for holding details of one employee
93              
94             =head1 SYNOPSIS
95              
96             $employee = WebService::BambooHR::Employee->new(
97             firstName => 'Ford',
98             lastName => 'Prefect',
99             workEmail => 'ford@betelgeuse.org',
100             );
101              
102             =head1 DESCRIPTION
103              
104             WebService::BambooHR::Employee is a class for data objects that are used
105             by L.
106              
107             It supports attributes for all of the employee fields supported by BambooHR.
108             You can get a list of these from the BambooHR documentation. The attributes
109             are named exactly the same as the fields. The named fields are:
110              
111             address1 address2 age
112             bestEmail birthday bonusAmount
113             bonusComment bonusDate bonusReason
114             city commisionDate commissionAmount
115             commissionComment commissionDate country
116             dateOfBirth department displayName
117             division eeo employeeNumber
118             employmentHistoryStatus employmentStatus ethnicity
119             exempt firstName flsaCode
120             fullName1 fullName2 fullName3
121             fullName4 fullName5 gender
122             hireDate homeEmail homePhone
123             id jobTitle lastChanged
124             lastName location maritalStatus
125             middleName mobilePhone nickname
126             payChangeReason payGroup payGroupId
127             payRate payRateEffectiveDate payType
128             photoUploaded rehireDate sin
129             ssn standardHoursPerWeek state
130             stateCode status supervisor
131             supervisorEId supervisorId terminationDate
132             workEmail workPhone workPhoneExtension
133             workPhonePlusExtension zipcode
134              
135             In addition, the following fields are supported, which aren't listed
136             in the BambooHR documentation:
137              
138             =over 4
139              
140             =item selfServiceAccess
141              
142             Returns 'Yes' or 'No' to signify whether the employee is able to login
143             to the BambooHR service.
144              
145             =item terminationType
146              
147             Returns one of 'Death', 'Voluntary', or 'Involuntary'. When someone is marked
148             as terminated via the user interface, it is optional to specify the termination type.
149             If not specified this will return C.
150              
151             =item terminationReason
152              
153             This might be one of the standard reasons
154             ('Attendance', 'Other employment', 'Performance', or 'Relocation'),
155             but it may also be a custom string that was entered by the person who recorded
156             the termination.
157              
158             =back
159              
160             =head1 SEE ALSO
161              
162             L
163              
164             L
165             on BambooHR's website.
166              
167             =head1 AUTHOR
168              
169             Neil Bowers Eneilb@cpan.orgE
170              
171             =head1 COPYRIGHT AND LICENSE
172              
173             This software is copyright (c) 2014 by Neil Bowers .
174              
175             This is free software; you can redistribute it and/or modify it under
176             the same terms as the Perl 5 programming language system itself.
177              
178             =cut