Skip to content

Commit 8ab3cc9

Browse files
author
sangeet-joy_xero
committed
Adding Bereavement enum to EmployeeStatutoryLeaveBalance and EmployeeStatutoryLeaveSummary for UK
1 parent f477868 commit 8ab3cc9

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

docs/payroll_uk/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,7 +1954,7 @@
19541954
"leaveType" : {
19551955
"type" : "string",
19561956
"description" : "The type of statutory leave",
1957-
"enum" : [ "Sick", "Adoption", "Maternity", "Paternity", "Sharedparental" ]
1957+
"enum" : [ "Sick", "Adoption", "Maternity", "Paternity", "Sharedparental", "Bereavement" ]
19581958
},
19591959
"balanceRemaining" : {
19601960
"type" : "number",
@@ -2002,7 +2002,7 @@
20022002
"type" : {
20032003
"type" : "string",
20042004
"description" : "The category of statutory leave",
2005-
"enum" : [ "Sick", "Adoption", "Maternity", "Paternity", "Sharedparental" ]
2005+
"enum" : [ "Sick", "Adoption", "Maternity", "Paternity", "Sharedparental", "Bereavement" ]
20062006
},
20072007
"startDate" : {
20082008
"type" : "string",

lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class EmployeeStatutoryLeaveBalance
2323
MATERNITY ||= "Maternity".freeze
2424
PATERNITY ||= "Paternity".freeze
2525
SHAREDPARENTAL ||= "Sharedparental".freeze
26+
BEREAVEMENT ||= "Bereavement".freeze
2627

2728
# The balance remaining for the corresponding leave type as of specified date.
2829
attr_accessor :balance_remaining
@@ -109,7 +110,7 @@ def list_invalid_properties
109110
# Check to see if the all the properties in the model are valid
110111
# @return true if the model is valid
111112
def valid?
112-
leave_type_validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental"])
113+
leave_type_validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental", "Bereavement"])
113114
return false unless leave_type_validator.valid?(@leave_type)
114115
units_validator = EnumAttributeValidator.new('String', ["Hours"])
115116
return false unless units_validator.valid?(@units)
@@ -119,7 +120,7 @@ def valid?
119120
# Custom attribute writer method checking allowed values (enum).
120121
# @param [Object] leave_type Object to be assigned
121122
def leave_type=(leave_type)
122-
validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental"])
123+
validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental", "Bereavement"])
123124
unless validator.valid?(leave_type)
124125
fail ArgumentError, "invalid value for \"leave_type\", must be one of #{validator.allowable_values}."
125126
end

lib/xero-ruby/models/payroll_uk/employee_statutory_leave_summary.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class EmployeeStatutoryLeaveSummary
2929
MATERNITY ||= "Maternity".freeze
3030
PATERNITY ||= "Paternity".freeze
3131
SHAREDPARENTAL ||= "Sharedparental".freeze
32+
BEREAVEMENT ||= "Bereavement".freeze
3233

3334
# The date when the leave starts
3435
attr_accessor :start_date
@@ -147,7 +148,7 @@ def list_invalid_properties
147148
# Check to see if the all the properties in the model are valid
148149
# @return true if the model is valid
149150
def valid?
150-
type_validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental"])
151+
type_validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental", "Bereavement"])
151152
return false unless type_validator.valid?(@type)
152153
status_validator = EnumAttributeValidator.new('String', ["Pending", "In-Progress", "Completed"])
153154
return false unless status_validator.valid?(@status)
@@ -157,7 +158,7 @@ def valid?
157158
# Custom attribute writer method checking allowed values (enum).
158159
# @param [Object] type Object to be assigned
159160
def type=(type)
160-
validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental"])
161+
validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental", "Bereavement"])
161162
unless validator.valid?(type)
162163
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
163164
end

0 commit comments

Comments
 (0)