Trendsic Platform Service

<back to all web services

FieldLogSubmitRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/fieldlog/submit
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 FieldLogSubmitResponse:
    response_status: Optional[ResponseStatus] = None
    field_log_id: int = 0
    field_log_u_i_d: Optional[str] = None
    status: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FieldLogCrew:
    contact_id: int = 0
    status_code: Optional[str] = None
    hours: float = 0.0
    cost_code: Optional[str] = None
    split_cost_code: Optional[str] = None
    split_hours: float = 0.0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FieldLogEquipment:
    equipment_id: int = 0
    equipment_key: Optional[str] = None
    status_code: Optional[str] = None
    engine_hours: float = 0.0
    fuel_gallons: float = 0.0
    idle_reason: Optional[str] = None
    down_note: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FieldLogSub:
    contact_id: int = 0
    name: Optional[str] = None
    trade: Optional[str] = None
    head_count: int = 0
    hours_per: float = 0.0
    source_code: Optional[str] = None
    reporter: Optional[str] = None
    note: Optional[str] = None
    verified: bool = False
    state_code: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FieldLogQuantity:
    pay_item_code: Optional[str] = None
    name: Optional[str] = None
    unit: Optional[str] = None
    today_qty: float = 0.0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FieldLogDelivery:
    po: Optional[str] = None
    material: Optional[str] = None
    status_code: Optional[str] = None
    qty_received: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FieldLogConsumed:
    name: Optional[str] = None
    qty: Optional[str] = None
    use: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FieldLogSubmitRequest:
    project_id: int = 0
    job_id: int = 0
    log_date: Optional[str] = None
    notes: Optional[str] = None
    weather: Optional[str] = None
    temp_f: int = 0
    weather_delay_hours: float = 0.0
    toolbox_talk: Optional[str] = None
    incident_occurred: bool = False
    incident_type: Optional[str] = None
    incident_note: Optional[str] = None
    incident_photo_count: int = 0
    crew: List[FieldLogCrew] = field(default_factory=list)
    equipment: List[FieldLogEquipment] = field(default_factory=list)
    subs: List[FieldLogSub] = field(default_factory=list)
    quantities: List[FieldLogQuantity] = field(default_factory=list)
    deliveries: List[FieldLogDelivery] = field(default_factory=list)
    consumed: List[FieldLogConsumed] = field(default_factory=list)

Python FieldLogSubmitRequest 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/fieldlog/submit HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	ProjectId: 0,
	JobId: 0,
	LogDate: String,
	Notes: String,
	Weather: String,
	TempF: 0,
	WeatherDelayHours: 0,
	ToolboxTalk: String,
	IncidentOccurred: False,
	IncidentType: String,
	IncidentNote: String,
	IncidentPhotoCount: 0,
	Crew: 
	[
		{
			ContactId: 0,
			StatusCode: String,
			Hours: 0,
			CostCode: String,
			SplitCostCode: String,
			SplitHours: 0
		}
	],
	Equipment: 
	[
		{
			EquipmentId: 0,
			EquipmentKey: String,
			StatusCode: String,
			EngineHours: 0,
			FuelGallons: 0,
			IdleReason: String,
			DownNote: String
		}
	],
	Subs: 
	[
		{
			ContactId: 0,
			Name: String,
			Trade: String,
			HeadCount: 0,
			HoursPer: 0,
			SourceCode: String,
			Reporter: String,
			Note: String,
			Verified: False,
			StateCode: String
		}
	],
	Quantities: 
	[
		{
			PayItemCode: String,
			Name: String,
			Unit: String,
			TodayQty: 0
		}
	],
	Deliveries: 
	[
		{
			Po: String,
			Material: String,
			StatusCode: String,
			QtyReceived: String
		}
	],
	Consumed: 
	[
		{
			Name: String,
			Qty: String,
			Use: 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
		}
	},
	FieldLogId: 0,
	FieldLogUID: 00000000000000000000000000000000,
	Status: String
}