Trendsic Platform Service

<back to all web services

ProjectTimelineRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
GET,OPTIONS/v1/project/{ProjectID}/timeline
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 TimelineCrew:
    project_job_crew_member_i_d: int = 0
    contact_i_d: int = 0
    contact_name: Optional[str] = None
    budgeted_hours: Optional[Decimal] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TimelineEquipment:
    project_job_equipment_i_d: int = 0
    equipment_i_d: int = 0
    equipment_name: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TimelineJob:
    job_i_d: int = 0
    job_name: Optional[str] = None
    expected_start_date: Optional[datetime.datetime] = None
    expected_completion_date: Optional[datetime.datetime] = None
    actual_start_date: Optional[datetime.datetime] = None
    actual_end_date: Optional[datetime.datetime] = None
    percent_complete: Decimal = decimal.Decimal(0)
    status_i_d: Optional[int] = None
    job_category: Optional[str] = None
    is_agreement_visit: bool = False
    occurrence_date: Optional[datetime.datetime] = None
    crew: List[TimelineCrew] = field(default_factory=list)
    equipment: List[TimelineEquipment] = field(default_factory=list)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class JobDependency:
    job_dependency_i_d: int = 0
    tenant_id: Optional[str] = None
    project_i_d: int = 0
    predecessor_job_i_d: int = 0
    successor_job_i_d: int = 0
    dependency_type: Optional[str] = None
    lag_days: int = 0
    created_by: Optional[str] = None
    created_at: Optional[datetime.datetime] = None
    updated_at: Optional[datetime.datetime] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ProjectTimeline:
    project_i_d: int = 0
    jobs: List[TimelineJob] = field(default_factory=list)
    dependencies: List[JobDependency] = field(default_factory=list)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ProjectTimelineResponse:
    response_status: Optional[ResponseStatus] = None
    timeline: Optional[ProjectTimeline] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ProjectTimelineRequest:
    project_i_d: int = 0

Python ProjectTimelineRequest 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.

GET /v1/project/{ProjectID}/timeline HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
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
		}
	},
	Timeline: 
	{
		ProjectID: 0,
		Jobs: 
		[
			{
				JobID: 0,
				JobName: String,
				ExpectedStartDate: 0001-01-01,
				ExpectedCompletionDate: 0001-01-01,
				ActualStartDate: 0001-01-01,
				ActualEndDate: 0001-01-01,
				PercentComplete: 0,
				StatusID: 0,
				JobCategory: String,
				IsAgreementVisit: False,
				OccurrenceDate: 0001-01-01,
				Crew: 
				[
					{
						ProjectJobCrewMemberID: 0,
						ContactID: 0,
						ContactName: String,
						BudgetedHours: 0
					}
				],
				Equipment: 
				[
					{
						ProjectJobEquipmentID: 0,
						EquipmentID: 0,
						EquipmentName: String
					}
				]
			}
		],
		Dependencies: 
		[
			{
				JobDependencyID: 0,
				TenantId: 00000000000000000000000000000000,
				ProjectID: 0,
				PredecessorJobID: 0,
				SuccessorJobID: 0,
				DependencyType: String,
				LagDays: 0,
				CreatedBy: String,
				CreatedAt: 0001-01-01,
				UpdatedAt: 0001-01-01
			}
		]
	}
}