TimeOffBooking Examples

Query All Time Off Bookings

Query all time off bookings.

[
  {
    "Action": "Query",
    "QueryType": "TimeOffBookingAll",
    "DomainType": "Replicon.TimeOff.Domain.TimeOffBooking",
    "Args": []
  }
]

Query Bookings by User & Date Range

Query all time off bookings for user #45 that have days booked off in August 2010.

[
  {
    "Action": "Query",
    "QueryType": "TimeOffBookingByUserDateRange",
    "DomainType": "Replicon.TimeOff.Domain.TimeOffBooking",
    "Args": [
      {
        "__type": "Replicon.Domain.User",
        "Identity": "45"
      },
      {
        "__type": "Date",
        "Year": 2010,
        "Month": 8,
        "Day": 1
      },
      {
        "__type": "Date",
        "Year": 2010,
        "Month": 8,
        "Day": 31
      }
    ]
  }
]

Query Bookings by Users, Date Range, & TimeOff Codes

Query all time off bookings for User #45 & #46 that have days booked off in August 2010 for TimeOff Code #1 & #2

[
  {
    "Action": "Query",
    "QueryType": "TimeOffBookingByUsersDateRangeCodes",
    "DomainType": "Replicon.TimeOff.Domain.TimeOffBooking",
    "Args": [
      [
        {
          "__type": "Replicon.Domain.User",
          "Identity": "45"
        },
        {
          "__type": "Replicon.Domain.User",
          "Identity": "46"
        }
      ],
      {
        "__type": "Date",
        "Year": 2010,
        "Month": 8,
        "Day": 1
      },
      {
        "__type": "Date",
        "Year": 2010,
        "Month": 8,
        "Day": 31
      },
      [
        {
          "__type": "Replicon.TimeOff.Domain.TimeOffCode",
          "Identity": "1"
        },
        {
          "__type": "Replicon.TimeOff.Domain.TimeOffCode",
          "Identity": "2"
        }
      ]
    ]
  }
]

Query Bookings by Date Range

Query all time off bookings that have days booked off in August 2010.

[
  {
    "Action": "Query",
    "QueryType": "TimeOffBookingByDateRange",
    "DomainType": "Replicon.TimeOff.Domain.TimeOffBooking",
    "Args": [
      {
        "__type": "Date",
        "Year": 2010,
        "Month": 8,
        "Day": 1
      },
      {
        "__type": "Date",
        "Year": 2010,
        "Month": 8,
        "Day": 31
      }
    ]
  }
]

Query Bookings By Modified Since

Query all time off bookings since the specified modified time.

[
  {
    "Action": "Query",
    "QueryType": "TimeOffBookingByModifiedSince",
    "DomainType": "Replicon.TimeOff.Domain.TimeOffBooking",
    "Args": [
      {
        "__type": "DateTime",
        "Year": 2011,
        "Month": 5,
        "Day": 19,
        "Hour": 19,
        "Minute": 16
      }
    ]
  }
]

Query Bookings By User and Modified Since

Query all time off bookings for a given user since the specified modified time.

[
  {
    "Action": "Query",
    "QueryType": "TimeOffBookingByUserModifiedSince",
    "DomainType": "Replicon.TimeOff.Domain.TimeOffBooking",
    "Args": [
      {
        "__type": "Replicon.Domain.User",
        "Identity": "2"
      },
      {
        "__type": "DateTime",
        "Year": 2011,
        "Month": 5,
        "Day": 19,
        "Hour": 19,
        "Minute": 16
      }
    ]
  }
]

Query Bookings by User

Query all time off bookings for user #45.

[
  {
    "Action": "Query",
    "QueryType": "TimeOffBookingByUser",
    "DomainType": "Replicon.TimeOff.Domain.TimeOffBooking",
    "Args": [
      {
        "__type": "Replicon.Domain.User",
        "Identity": "45"
      }
    ]
  }
]

Query Bookings by TimeOff Code

Query all time off bookings associated with time off type #1.

[
  {
    "Action": "Query",
    "QueryType": "TimeOffBookingByCode",
    "DomainType": "Replicon.TimeOff.Domain.TimeOffBooking",
    "Args": [
      {
        "__type": "Replicon.TimeOff.Domain.TimeOffCode",
        "Identity": "1"
      }
    ]
  }
]

Create and Submit Time Off Booking

Create a time off booking for the user with Id #45, for the time off type with Id #2, with a user defined field "Udf Number". The booking is from August 2nd to 6th, and is submitted immediately (all time off bookings are submitted immediately).

[
  {
    "Action": "Create",
    "Type": "Replicon.TimeOff.Domain.TimeOffBooking",
    "Operations": [
      {
        "__operation": "SetProperties",
        "User": {
          "__type": "Replicon.TimeOff.Domain.User",
          "Identity": "45"
        },
        "TimeOffCode": {
          "__type": "Replicon.TimeOff.Domain.TimeOffCode",
          "Identity": "1"
        },
        "Comments": "Going on a vacation to Seattle."
      },
      {
        "__operation": "SetUdfValues",
        "Udf Number": 10
      },
      {
        "__operation": "SetTimeSpan",
        "StartDate": {
          "__type": "Date",
          "Year": 2010,
          "Month": 8,
          "Day": 2
        },
        "EndDate": {
          "__type": "Date",
          "Year": 2010,
          "Month": 8,
          "Day": 6
        }
      },
      {
        "__operation": "Submit"
      }
    ]
  }
]

Partial Day Booking without Times

Create a time off booking with a partial start and end date. A half day is booked off on the start date, and an hour and a half is booked off on the end date. These are the time off resolution options: FullDay (same as not specifying a duration type), HalfDay, ThreeFourthDay, QuarterDay, and PartialDay (requires StartDayDuration or EndDayDuration to be specified).

[
  {
    "Action": "Create",
    "Type": "Replicon.TimeOff.Domain.TimeOffBooking",
    "Operations": [
      {
        "__operation": "SetProperties",
        "User": {
          "__type": "Replicon.TimeOff.Domain.User",
          "Identity": "45"
        },
        "TimeOffCode": {
          "__type": "Replicon.TimeOff.Domain.TimeOffCode",
          "Identity": "1"
        },
        "Comments": "Going on a vacation to Seattle."
      },
      {
        "__operation": "SetTimeSpan",
        "StartDate": {
          "__type": "Date",
          "Year": 2010,
          "Month": 8,
          "Day": 2
        },
        "StartDayDurationType": {
          "__type": "Replicon.Domain.TimeResolution",
          "Identity": "HalfDay"
        },
        "EndDate": {
          "__type": "Date",
          "Year": 2010,
          "Month": 8,
          "Day": 6
        },
        "EndDayDurationType": {
          "__type": "Replicon.Domain.TimeResolution",
          "Identity": "PartialDay"
        },
        "EndDayDuration": {
          "__type": "TimeSpan",
          "Hours": 1,
          "Minutes": 30
        }
      },
      {
        "__operation": "Submit"
      }
    ]
  }
]

Partial Day Booking with Times

Create a time off booking with a partial day off with start and end times specified. On the start date, 4 hours are booked off, beginning at noon and ending at 4pm. If start/end times are enabled for the system, it may be necessary to specify StartDayStartTime/StartDayEndTime and/or EndDayStartTime/EndDayEndTime with the booking.

[
  {
    "Action": "Create",
    "Type": "Replicon.TimeOff.Domain.TimeOffBooking",
    "Operations": [
      {
        "__operation": "SetProperties",
        "User": {
          "__type": "Replicon.TimeOff.Domain.User",
          "Identity": "2"
        },
        "TimeOffCode": {
          "__type": "Replicon.TimeOff.Domain.TimeOffCode",
          "Identity": "1"
        },
        "Comments": "Going on a vacation to Seattle."
      },
      {
        "__operation": "SetTimeSpan",
        "StartDate": {
          "__type": "Date",
          "Year": 2010,
          "Month": 8,
          "Day": 2
        },
        "StartDayDurationType": {
          "__type": "Replicon.Domain.TimeResolution",
          "Identity": "PartialDay"
        },
        "StartDayDuration": {
          "__type": "TimeSpan",
          "Hours": 4
        },
        "StartDayStartTime": {
          "__type": "Time",
          "Hour": 12,
          "Minute": 0
        },
        "EndDate": {
          "__type": "Date",
          "Year": 2010,
          "Month": 8,
          "Day": 6
        }
      },
      {
        "__operation": "Submit"
      }
    ]
  }
]

Edit an existing booking

Change the time span of an existing time off booking, and resubmit the booking.

[
  {
    "Action": "Edit",
    "Type": "Replicon.TimeOff.Domain.TimeOffBooking",
    "Identity": "10",
    "Operations": [
      {
        "__operation": "SetTimeSpan",
        "StartDate": {
          "__type": "Date",
          "Year": 2010,
          "Month": 8,
          "Day": 2
        },
        "EndDate": {
          "__type": "Date",
          "Year": 2010,
          "Month": 8,
          "Day": 13
        }
      },
      {
        "__operation": "Submit"
      }
    ]
  }
]

Edit an existing booking (change timeoff type)

Change the time off type of an existing booking.

[
  {
    "Action": "Edit",
    "Type": "Replicon.TimeOff.Domain.TimeOffBooking",
    "Identity": "74",
    "Operations": [
      {
        "__operation": "SetProperties",
        "TimeOffCode": {
          "__type": "Replicon.TimeOff.Domain.TimeOffCode",
          "Identity": "2"
        }
      },
      {
        "__operation": "Submit"
      }
    ]
  }
]

Approve a Booking

Approve a time off booking.

[
  {
    "Action": "Edit",
    "Type": "Replicon.TimeOff.Domain.TimeOffBooking",
    "Identity": "121",
    "Operations": [
      {
        "__operation": "Approve",
        "Comment": "I approve this booking!"
      }
    ]
  }
]

Reject a Booking

Reject a time off booking.

[
  {
    "Action": "Edit",
    "Type": "Replicon.TimeOff.Domain.TimeOffBooking",
    "Identity": "121",
    "Operations": [
      {
        "__operation": "Reject",
        "Comment": "I reject this booking!"
      }
    ]
  }
]