Click or drag to resize

ServiceRouterGetTimePunchState Method

Returns a GetTimePunchStateOut response with a result model List<GetTimePunchStateModel>

Namespace: AppOne.Services.V2
Assembly: AppOne.Web.Service (in AppOne.Web.Service.dll) Version: 1.0.141
Syntax
public GetTimePunchStateOut GetTimePunchState(
	GetTimePunchStateIn input
)

Parameters

input  GetTimePunchStateIn
A new GetTimePunchStateIn object

Return Value

GetTimePunchStateOut
A GetTimePunchStateOut object
Remarks
Use this method to get a results list of GetTimePunchStateModel which contains the next available possible punch types at a given time by user. For example if user has "clocked in", then what list of punch types are possible after "clocked in". The result list for PunchTypeId and PunchTypeName are returned in the order of the next available punch type. So if a user is not "clocked in" then the first result would be "ClockIn" otherwise the value will be dynamically set based on the users preferences/state and configuration settings.

DataAction Names

NameDescriptionValues Example
SELECT-EMPIDReturns only the users with the specified employee ID passed in the values property."abc-123","123","efg"...
Caution note  Caution
Please note the following

1. The preference policy of a user will control how the punch types can be displayed.
2. The payroll policy of a user will control which punch types are available.

Please validate the Preference/Payroll policy of each employee if results are not coming back as expected
Note  Note
Business Rules:
Punching in and out is the core of the time-web system. The WSTime class encapsulate the needed methods/operations to interact with a users time entry. Users can be assigned to different preferences and policies. These policies are what will affect the results of a users time entry into the system.

Setup:
Employee > Dashboard
Manager > Time Cards

Example
JSON Request
//EXAMPLE: Get the selected users punch state
{
    "AuthToken":"...",
    "DataAction":{
        "Name":"SELECT-EMPID",   
        "Values":["1234", "1337"]
    }
}
JSON Response
//EXAMPLE: Response for two requested users
{
    "Report": {
        "ProcessTime": "0.2025195",
        "RequestTime": "/Date(1430773866067-0700)/",
        "ResponseTime": "/Date(1430773866269-0700)/",
        "Results": 2
    },
    "Results": [
        {
            "EmpIdentifier": "1234",
            "PunchTypeId": "6,7,4,5,8,3,2",
            "PunchTypeName": "StartBreak,EndBreak,StartLunch,EndLunch,Transfer,ClockOut,ClockIn",
            "PunchStatus": "Blocked",
            "PunchMessage": "User is not eligible for a Begin Meal until 5/4/2015 3:42:00 PM"
        },
        {
            "EmpIdentifier": "1337",
            "PunchTypeId": "2,8,3",
            "PunchTypeName": "ClockIn,Transfer,ClockOut",
            "PunchStatus": "Valid",
            "PunchMessage": ""
        }
    ]
}
SOAP: C# WCF Sample
SoapServiceV2.GetTimePunchStateRequest request = new SoapServiceV2.GetTimePunchStateRequest();
request.input = new SoapServiceV2.GetTimePunchStateIn()
{
    AuthToken = AuthToken,
    DataAction = new DataAction()
    {
        Name = "SELECT-EMPID",
        Values = new List<string>() { "1234", "5555"}
    }
};
SoapServiceV2.GetTimePunchStateResponse response = client.GetTimePunchState(request);
Assert.IsTrue((response.GetTimePunchStateResult.Results != null ? response.GetTimePunchStateResult.Results.Count : 0) > 0);
See Also