Trendsic Platform Service

<back to all web services

TimecardCheckInRequest

Requires Authentication
Required role:Administrator
The following routes are available for this service:
GET,POST,PUT,DELETE,OPTIONS/v1/TimeTracker/{CheckInId}
GET,POST,PUT,DELETE,OPTIONS/v1/TimeTracker
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TimeCard:
    agent_id: int = 0
    check_in_id: int = 0
    date_logged: datetime.datetime = datetime.datetime(1, 1, 1)
    time_in: datetime.timedelta = datetime.timedelta()
    time_in_date: datetime.datetime = datetime.datetime(1, 1, 1)
    time_out: datetime.timedelta = datetime.timedelta()
    time_out_date: datetime.datetime = datetime.datetime(1, 1, 1)
    time_logged: Decimal = decimal.Decimal(0)
    payment_type: int = 0
    service_code_id: int = 0
    service_code: Optional[str] = None
    service_rate: Decimal = decimal.Decimal(0)
    service_description: Optional[str] = None
    work_description: Optional[str] = None
    adjusted_time_in: datetime.timedelta = datetime.timedelta()
    adjusted_time_in_date: datetime.datetime = datetime.datetime(1, 1, 1)
    adjusted_time_out: datetime.timedelta = datetime.timedelta()
    adjusted_time_out_date: datetime.datetime = datetime.datetime(1, 1, 1)
    is_valid: bool = False
    adjusted: bool = False
    project_i_d: int = 0
    project_name: Optional[str] = None
    client_i_d: int = 0
    client_name: Optional[str] = None
    category_i_d: int = 0
    category_name: Optional[str] = None
    job_i_d: int = 0
    job_name: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TimecardCheckInResponse:
    response_status: Optional[ResponseStatus] = None
    timecard_check_in: List[TimeCard] = field(default_factory=list)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TimecardCheckInRequest:
    check_in_id: int = 0
    timecard_check_in: List[TimeCard] = field(default_factory=list)

Python TimecardCheckInRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/TimeTracker/{CheckInId} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	CheckInId: 0,
	TimecardCheckIn: 
	[
		{
			AgentId: 0,
			CheckInId: 0,
			DateLogged: 0001-01-01,
			TimeIn: PT0S,
			TimeInDate: 0001-01-01T00:00:00.0000000+00:00,
			TimeOut: PT0S,
			TimeOutDate: 0001-01-01T00:00:00.0000000+00:00,
			TimeLogged: 0,
			PaymentType: 0,
			ServiceCodeId: 0,
			ServiceCode: String,
			ServiceRate: 0,
			ServiceDescription: String,
			WorkDescription: String,
			AdjustedTimeIn: PT0S,
			AdjustedTimeInDate: 0001-01-01T00:00:00.0000000+00:00,
			AdjustedTimeOut: PT0S,
			AdjustedTimeOutDate: 0001-01-01T00:00:00.0000000+00:00,
			IsValid: False,
			Adjusted: False,
			ProjectID: 0,
			ProjectName: String,
			ClientID: 0,
			ClientName: String,
			CategoryID: 0,
			CategoryName: String,
			JobID: 0,
			JobName: String
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	TimecardCheckIn: 
	[
		{
			AgentId: 0,
			CheckInId: 0,
			DateLogged: 0001-01-01,
			TimeIn: PT0S,
			TimeInDate: 0001-01-01T00:00:00.0000000+00:00,
			TimeOut: PT0S,
			TimeOutDate: 0001-01-01T00:00:00.0000000+00:00,
			TimeLogged: 0,
			PaymentType: 0,
			ServiceCodeId: 0,
			ServiceCode: String,
			ServiceRate: 0,
			ServiceDescription: String,
			WorkDescription: String,
			AdjustedTimeIn: PT0S,
			AdjustedTimeInDate: 0001-01-01T00:00:00.0000000+00:00,
			AdjustedTimeOut: PT0S,
			AdjustedTimeOutDate: 0001-01-01T00:00:00.0000000+00:00,
			IsValid: False,
			Adjusted: False,
			ProjectID: 0,
			ProjectName: String,
			ClientID: 0,
			ClientName: String,
			CategoryID: 0,
			CategoryName: String,
			JobID: 0,
			JobName: String
		}
	]
}