schedule.vacation

Individual vacation management.

SUPPORTED METHODS:

GET

ParametersTypeDescription
token (required)Valid token
id (required)integerVacation id
force_user_timezoneenum (0, 1)0: do not force users time zone
1: force users time zone

CREATE

ParametersTypeDescription
token (required)Valid token
start_date (required)dateStart date
end_date (required)dateEnd date
employee (accepted)integerEmployee id
comments (accepted)varcharCommentes
start_time (accepted)timeStart time
end_time (accepted)timeEnd time
status (accepted)enum[-2,-1,0,1]0: un-approve
1: approve
-1: reject
-2: cancel
leavetype (accepted)varcharLeave type
notes (accepted)varcharNotes
is_hourly (accepted)enum (0, 1)0: not hourly leave
1: hourly leave
force_user_timezoneenum (0, 1)0: do not force users time zone
1: force users time zone

UPDATE

ParametersTypeDescription
token (required)Valid token
id (required)integerVacation id
start_date (accepted)dateStart date
end_date (accepted)dateEnd date
start_time (accepted)timeStart time
end_time (accepted)timeEnd time
comments (accepted)varcharComments
notes (accepted)varcharNotes
status (accepted)enum (0, 1, -1, -2)0: un-approve
1: approve
-1: reject
-2: cancel
force_user_timezone (accepted)enum (0,1)0: do not force users time zone
1: force users time zone
reasonvarcharReason

DELETE

ParametersTypeDescription
token (required)Valid token
id (required)integerVacation id

DOCUMENTATION

GET

Retrieves an individual vacation.
Level 5 is required (all users can fetch this module)

--

Example Request:

{
   "module":"schedule.vacation",
   "method":"GET",
   "request":{
      "id":"265"
   }
}

Example response:

{
   "status":1,
   "data":{
      "id":"265",
      "store":"11",
      "date":"1336655757",
      "requested_on":{
         "id":"1107",
         "month":"5",
         "day":"10",
         "year":"2017",
         "weekday":"Thu",
         "mname":"May",
         "week":"19",
         "dayid":5,
         "formatted":"May 10, 2017"
      },
      "approved_on":"1336656212",
      "status":"1",
      "admin":"2",
      "comments":"",
      "notes":"",
      "start_day":{
         "id":"1109",
         "month":"5",
         "day":"12",
         "year":"2017",
         "weekday":"Sat",
         "mname":"May",
         "week":"19",
         "dayid":7,
         "formatted":"May 12, 2017"
      },
      "end_day":{
         "id":"1109",
         "month":"5",
         "day":"12",
         "year":"2017",
         "weekday":"Sat",
         "mname":"May",
         "week":"19",
         "dayid":7,
         "formatted":"May 12, 2017"
      },
      "employee":"1444",
      "employee_name":"Alicia",
      "total_days":0
   },
   "token":"xxxxxxx"
}

CREATE
Creates an individual vacation.
Level 5 is required (all users can fetch this module)

--

Example Request:

{
   "module":"schedule.vacation",
   "method":"CREATE",
   "request":{
      "start_date":"May 19, 2017",
      "end_date":"May 22, 2017",
   }
}

Example Response:

{
   "status":1,
   "data":{
      "id":"265",
      "store":"11",
      "date":"1336655757",
      "requested_on":{
         "id":"1107",
         "month":"5",
         "day":"10",
         "year":"2017",
         "weekday":"Thu",
         "mname":"May",
         "week":"19",
         "dayid":5,
         "formatted":"May 5, 2017"
      },
      "approved_on":"1336656212",
      "status":"1",
      "admin":"2",
      "comments":"",
      "notes":"",
      "start_day":{
         "id":"1109",
         "month":"5",
         "day":"12",
         "year":"2017",
         "weekday":"Sat",
         "mname":"May",
         "week":"19",
         "dayid":7,
         "formatted":"May 19, 2017"
      },
      "end_day":{
         "id":"1109",
         "month":"5",
         "day":"12",
         "year":"2017",
         "weekday":"Sat",
         "mname":"May",
         "week":"19",
         "dayid":7,
         "formatted":"May 22, 2017"
      },
      "employee":"1444",
      "employee_name":"Alicia",
      "total_days":3
   },
   "token":"xxxxxxx"
}

UPDATE
Updates an individual vacation.
Level 5 is required (all users can fetch this module)

--

Example Request:

{
   "module":"schedule.vacation",
   "method":"CREATE",
   "request":{
      "start_date":"May 5, 2017",
      "end_date":"May 10, 2017",
      "comments":"Vacation",
      "status":"approve"
   }
}

Example Response:

{
   "status":1,
   "data":{
      "id":"265",
      "store":"11",
      "date":"1336655757",
      "requested_on":{
         "id":"1107",
         "month":"5",
         "day":"10",
         "year":"2017",
         "weekday":"Thu",
         "mname":"May",
         "week":"19",
         "dayid":5,
         "formatted":"May 10, 2017"
      },
      "approved_on":"1336656212",
      "status":"1",
      "admin":"2",
      "comments":"",
      "notes":"",
      "start_day":{
         "id":"1109",
         "month":"5",
         "day":"12",
         "year":"2017",
         "weekday":"Sat",
         "mname":"May",
         "week":"19",
         "dayid":7,
         "formatted":"May 12, 2017"
      },
      "end_day":{
         "id":"1109",
         "month":"5",
         "day":"12",
         "year":"2017",
         "weekday":"Sat",
         "mname":"May",
         "week":"19",
         "dayid":7,
         "formatted":"May 12, 2017"
      },
      "employee":"1444",
      "employee_name":"Alicia",
      "total_days":3
   },
   "token":"xxxxxxx"
}

DELETE
Deletes an individual vacation.
Level 5 is required (all users can fetch this module)

--

Example Request:

{
   "module":"schedule.vacation",
   "method":"DELETE",
   "request":{
      "id":"258"
   }
}

Example Response:

{
   "status":1,
   "data":"",
   "token":"xxxxxxx"
}