Skip to content

Commit c3ca276

Browse files
authored
Merge pull request #559 from andrew-cox-xero/feature/AUP-11286
Add LeaveApplications/v2 and approve/reject for AU
2 parents 4db6aae + b4f86eb commit c3ca276

File tree

1 file changed

+297
-8
lines changed

1 file changed

+297
-8
lines changed

xero-payroll-au.yaml

Lines changed: 297 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -703,10 +703,10 @@ paths:
703703
]
704704
}'
705705
'400':
706-
description: validation error for a bad request
707-
content:
708-
application/json:
709-
schema:
706+
description: validation error for a bad request
707+
content:
708+
application/json:
709+
schema:
710710
$ref: '#/components/schemas/APIException'
711711
post:
712712
security:
@@ -812,7 +812,7 @@ paths:
812812
"PayPeriodStartDate": "/Date(1572566400000+0000)/",
813813
"PayPeriodEndDate": "/Date(1573084800000+0000)/",
814814
"LeavePeriodStatus": "SCHEDULED",
815-
"NumberOfUnits": 0.6
815+
"NumberOfUnits": 7.6
816816
}
817817
],
818818
"Title": "Hello World",
@@ -842,6 +842,166 @@ paths:
842842
"EndDate": "/Date(1572645600000+0000)/"
843843
}
844844
]'
845+
/LeaveApplications/v2:
846+
parameters:
847+
- $ref: '#/components/parameters/requiredHeader'
848+
get:
849+
security:
850+
- OAuth2: [payroll.employees, payroll.employees.read]
851+
tags:
852+
- PayrollAu
853+
operationId: getLeaveApplicationsV2
854+
summary: Retrieves leave applications including leave requests
855+
parameters:
856+
- in: header
857+
name: If-Modified-Since
858+
x-snake: if_modified_since
859+
description: Only records created or modified since this timestamp will be returned
860+
example: "2020-02-06T12:17:43.202-08:00"
861+
schema:
862+
type: string
863+
format: date-time
864+
- in: query
865+
name: where
866+
description: Filter by an any element
867+
schema:
868+
type: string
869+
example: Status=="ACTIVE"
870+
- in: query
871+
name: order
872+
description: Order by an any element
873+
schema:
874+
type: string
875+
example: EmailAddress%20DESC
876+
- in: query
877+
name: page
878+
description: e.g. page=1 – Up to 100 objects will be returned in a single API call
879+
schema:
880+
type: integer
881+
responses:
882+
'200':
883+
description: search results matching criteria
884+
content:
885+
application/json:
886+
schema:
887+
$ref: '#/components/schemas/LeaveApplications'
888+
example: '{
889+
"Id": "00000000-0000-0000-0000-000000000000",
890+
"Status": "OK",
891+
"ProviderName": "provider-name",
892+
"DateTimeUTC": "/Date(1573679791199)/",
893+
"LeaveApplications": [
894+
{
895+
"LeaveApplicationID": "1d4cd583-0107-4386-936b-672eb3d1f624",
896+
"EmployeeID": "cdfb8371-0b21-4b8a-8903-1024df6c391e",
897+
"LeaveTypeID": "184ea8f7-d143-46dd-bef3-0c60e1aa6fca",
898+
"LeavePeriods": [
899+
{
900+
"PayPeriodStartDate": "/Date(1573171200000+0000)/",
901+
"PayPeriodEndDate": "/Date(1573689600000+0000)/",
902+
"LeavePeriodStatus": "REQUESTED",
903+
"NumberOfUnits": 4
904+
}
905+
],
906+
"Title": "vacation",
907+
"StartDate": "/Date(1573516800000+0000)/",
908+
"EndDate": "/Date(1573516800000+0000)/",
909+
"UpdatedDateUTC": "/Date(1573623008000+0000)/",
910+
"PayOutType": "DEFAULT"
911+
},
912+
{
913+
"LeaveApplicationID": "3b934902-1e16-4c02-a3d3-68fa7d63e01d",
914+
"EmployeeID": "cdfb8371-0b21-4b8a-8903-1024df6c391e",
915+
"LeaveTypeID": "184ea8f7-d143-46dd-bef3-0c60e1aa6fca",
916+
"LeavePeriods": [
917+
{
918+
"PayPeriodStartDate": "/Date(1573171200000+0000)/",
919+
"PayPeriodEndDate": "/Date(1573689600000+0000)/",
920+
"LeavePeriodStatus": "SCHEDULED",
921+
"NumberOfUnits": 8
922+
}
923+
],
924+
"Title": "Cashed Out",
925+
"StartDate": "/Date(1573516800000+0000)/",
926+
"EndDate": "/Date(1573516800000+0000)/",
927+
"UpdatedDateUTC": "/Date(1573623008000+0000)/"
928+
"PayOutType": "CASHED_OUT"
929+
},
930+
{
931+
"LeaveApplicationID": "62b90465-66e9-4c3a-8151-de1e6335554d",
932+
"EmployeeID": "b34e89ff-770d-4099-b7e5-f968767118bc",
933+
"LeaveTypeID": "184ea8f7-d143-46dd-bef3-0c60e1aa6fca",
934+
"LeavePeriods": [
935+
{
936+
"PayPeriodStartDate": "/Date(1571961600000+0000)/",
937+
"PayPeriodEndDate": "/Date(1572480000000+0000)/",
938+
"LeavePeriodStatus": "SCHEDULED",
939+
"NumberOfUnits": 8
940+
},
941+
{
942+
"PayPeriodStartDate": "/Date(1572566400000+0000)/",
943+
"PayPeriodEndDate": "/Date(1573084800000+0000)/",
944+
"LeavePeriodStatus": "SCHEDULED",
945+
"NumberOfUnits": 8
946+
}
947+
],
948+
"Title": "Yep Carer Leave",
949+
"Description": "My updated Description",
950+
"StartDate": "/Date(1572559200000+0000)/",
951+
"EndDate": "/Date(1572645600000+0000)/",
952+
"UpdatedDateUTC": "/Date(1573447344000+0000)/",
953+
"PayOutType": "DEFAULT"
954+
},
955+
{
956+
"LeaveApplicationID": "e8bd9eeb-18c9-4475-9c81-b298f9aa26c0",
957+
"EmployeeID": "b34e89ff-770d-4099-b7e5-f968767118bc",
958+
"LeaveTypeID": "184ea8f7-d143-46dd-bef3-0c60e1aa6fca",
959+
"LeavePeriods": [
960+
{
961+
"PayPeriodStartDate": "/Date(1571961600000+0000)/",
962+
"PayPeriodEndDate": "/Date(1572480000000+0000)/",
963+
"LeavePeriodStatus": "PROCESSED",
964+
"NumberOfUnits": 8
965+
},
966+
{
967+
"PayPeriodStartDate": "/Date(1572566400000+0000)/",
968+
"PayPeriodEndDate": "/Date(1573084800000+0000)/",
969+
"LeavePeriodStatus": "SCHEDULED",
970+
"NumberOfUnits": 8
971+
}
972+
],
973+
"Title": "Hello World",
974+
"StartDate": "/Date(1572559200000+0000)/",
975+
"EndDate": "/Date(1572645600000+0000)/",
976+
"UpdatedDateUTC": "/Date(1573447343000+0000)/",
977+
"PayOutType": "DEFAULT"
978+
},
979+
{
980+
"LeaveApplicationID": "3f93110a-df13-49c7-b82f-a069813df188",
981+
"EmployeeID": "cdfb8371-0b21-4b8a-8903-1024df6c391e",
982+
"LeaveTypeID": "184ea8f7-d143-46dd-bef3-0c60e1aa6fca",
983+
"LeavePeriods": [
984+
{
985+
"PayPeriodStartDate": "/Date(1573171200000+0000)/",
986+
"PayPeriodEndDate": "/Date(1573689600000+0000)/",
987+
"LeavePeriodStatus": "REJECTED",
988+
"NumberOfUnits": 8
989+
}
990+
],
991+
"Title": "vacation",
992+
"StartDate": "/Date(1573516800000+0000)/",
993+
"EndDate": "/Date(1573516800000+0000)/",
994+
"UpdatedDateUTC": "/Date(1573623008000+0000)/",
995+
"PayOutType": "DEFAULT"
996+
}
997+
]
998+
}'
999+
'400':
1000+
description: validation error for a bad request
1001+
content:
1002+
application/json:
1003+
schema:
1004+
$ref: '#/components/schemas/APIException'
8451005
/LeaveApplications/{LeaveApplicationID}:
8461006
parameters:
8471007
- $ref: '#/components/parameters/requiredHeader'
@@ -884,7 +1044,7 @@ paths:
8841044
"PayPeriodStartDate": "/Date(1573171200000+0000)/",
8851045
"PayPeriodEndDate": "/Date(1573689600000+0000)/",
8861046
"LeavePeriodStatus": "SCHEDULED",
887-
"NumberOfUnits": 0
1047+
"NumberOfUnits": 7.6
8881048
}
8891049
],
8901050
"Title": "vacation",
@@ -1008,7 +1168,7 @@ paths:
10081168
"PayPeriodStartDate": "/Date(1572566400000+0000)/",
10091169
"PayPeriodEndDate": "/Date(1573084800000+0000)/",
10101170
"LeavePeriodStatus": "SCHEDULED",
1011-
"NumberOfUnits": 0.6
1171+
"NumberOfUnits": 7.6
10121172
}
10131173
],
10141174
"Title": "vacation",
@@ -1033,12 +1193,141 @@ paths:
10331193
example: '[
10341194
{
10351195
"EmployeeID": "cdfb8371-0b21-4b8a-8903-1024df6c391e",
1196+
"LeaveApplicationID": "1d4cd583-0107-4386-936b-672eb3d1f624",
10361197
"LeaveTypeID": "184ea8f7-d143-46dd-bef3-0c60e1aa6fca",
1198+
"LeavePeriods": [
1199+
{
1200+
"PayPeriodStartDate": "/Date(1572566400000+0000)/",
1201+
"PayPeriodEndDate": "/Date(1573084800000+0000)/",
1202+
"LeavePeriodStatus": "SCHEDULED",
1203+
"NumberOfUnits": 7.6
1204+
}
1205+
],
1206+
"Title": "vacation",
1207+
"Description": "My updated Description",
10371208
"StartDate": "/Date(1572559200000+0000)/",
10381209
"EndDate": "/Date(1572645600000+0000)/",
1039-
"Description": "My updated Description"
1210+
"PayOutType": "DEFAULT"
10401211
}
10411212
]'
1213+
/LeaveApplications/{LeaveApplicationID}/approve:
1214+
parameters:
1215+
- $ref: '#/components/parameters/requiredHeader'
1216+
post:
1217+
security:
1218+
- OAuth2: [payroll.employees]
1219+
tags:
1220+
- PayrollAu
1221+
summary: Approve a requested leave application by a unique leave application id
1222+
operationId: approveLeaveApplication
1223+
parameters:
1224+
- name: LeaveApplicationID
1225+
x-snake: leave_application_id
1226+
in: path
1227+
required: true
1228+
description: Leave Application id for single object
1229+
schema:
1230+
type: string
1231+
format: uuid
1232+
example: 4ff1e5cc-9835-40d5-bb18-09fdb118db9c
1233+
responses:
1234+
'200':
1235+
description: Application successfully approved
1236+
content:
1237+
application/json:
1238+
schema:
1239+
$ref: '#/components/schemas/LeaveApplications'
1240+
example: '{
1241+
"Id": "00000000-0000-0000-0000-000000000000",
1242+
"Status": "OK",
1243+
"ProviderName": "provider-name",
1244+
"DateTimeUTC": "/Date(1573679791457)/",
1245+
"LeaveApplications": [
1246+
{
1247+
"LeaveApplicationID": "1d4cd583-0107-4386-936b-672eb3d1f624",
1248+
"EmployeeID": "cdfb8371-0b21-4b8a-8903-1024df6c391e",
1249+
"LeaveTypeID": "184ea8f7-d143-46dd-bef3-0c60e1aa6fca",
1250+
"LeavePeriods": [
1251+
{
1252+
"PayPeriodStartDate": "/Date(1573171200000+0000)/",
1253+
"PayPeriodEndDate": "/Date(1573689600000+0000)/",
1254+
"LeavePeriodStatus": "SCHEDULED",
1255+
"NumberOfUnits": 7.6
1256+
}
1257+
],
1258+
"Title": "Requested Leave",
1259+
"StartDate": "/Date(1573516800000+0000)/",
1260+
"EndDate": "/Date(1573516800000+0000)/",
1261+
"UpdatedDateUTC": "/Date(1573623008000+0000)/",
1262+
"PayOutType": "DEFAULT"
1263+
}
1264+
]
1265+
}'
1266+
'400':
1267+
description: validation error for a bad request
1268+
content:
1269+
application/json:
1270+
schema:
1271+
$ref: '#/components/schemas/APIException'
1272+
/LeaveApplications/{LeaveApplicationID}/reject:
1273+
parameters:
1274+
- $ref: '#/components/parameters/requiredHeader'
1275+
post:
1276+
security:
1277+
- OAuth2: [payroll.employees]
1278+
tags:
1279+
- PayrollAu
1280+
summary: Reject a leave application by a unique leave application id
1281+
operationId: rejectLeaveApplication
1282+
parameters:
1283+
- name: LeaveApplicationID
1284+
x-snake: leave_application_id
1285+
in: path
1286+
required: true
1287+
description: Leave Application id for single object
1288+
schema:
1289+
type: string
1290+
format: uuid
1291+
example: 4ff1e5cc-9835-40d5-bb18-09fdb118db9c
1292+
responses:
1293+
'200':
1294+
description: Application successfully rejected
1295+
content:
1296+
application/json:
1297+
schema:
1298+
$ref: '#/components/schemas/LeaveApplications'
1299+
example: '{
1300+
"Id": "00000000-0000-0000-0000-000000000000",
1301+
"Status": "OK",
1302+
"ProviderName": "provider-name",
1303+
"DateTimeUTC": "/Date(1573679791457)/",
1304+
"LeaveApplications": [
1305+
{
1306+
"LeaveApplicationID": "1d4cd583-0107-4386-936b-672eb3d1f624",
1307+
"EmployeeID": "cdfb8371-0b21-4b8a-8903-1024df6c391e",
1308+
"LeaveTypeID": "184ea8f7-d143-46dd-bef3-0c60e1aa6fca",
1309+
"LeavePeriods": [
1310+
{
1311+
"PayPeriodStartDate": "/Date(1573171200000+0000)/",
1312+
"PayPeriodEndDate": "/Date(1573689600000+0000)/",
1313+
"LeavePeriodStatus": "REJECTED",
1314+
"NumberOfUnits": 7.6
1315+
}
1316+
],
1317+
"Title": "Requested Leave",
1318+
"StartDate": "/Date(1573516800000+0000)/",
1319+
"EndDate": "/Date(1573516800000+0000)/",
1320+
"UpdatedDateUTC": "/Date(1573623008000+0000)/",
1321+
"PayOutType": "DEFAULT"
1322+
}
1323+
]
1324+
}'
1325+
'400':
1326+
description: validation error for a bad request
1327+
content:
1328+
application/json:
1329+
schema:
1330+
$ref: '#/components/schemas/APIException'
10421331
/PayItems:
10431332
parameters:
10441333
- $ref: '#/components/parameters/requiredHeader'

0 commit comments

Comments
 (0)