| Requires any of the roles: | Agent, Administrator |
| POST,OPTIONS | /v1/Rfp/{RfpDocumentUID}/ApplyStart |
|---|
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 EstimateSettingsView:
rfp_estimate_i_d: int = 0
start_date: Optional[datetime.datetime] = None
deadline_date: Optional[datetime.datetime] = None
workdays_per_week: int = 0
hours_per_day: Decimal = decimal.Decimal(0)
weather_pct: Decimal = decimal.Decimal(0)
ohp_pct: Decimal = decimal.Decimal(0)
contingency_pct: Decimal = decimal.Decimal(0)
bond_pct: Decimal = decimal.Decimal(0)
holidays: List[datetime.datetime] = field(default_factory=list)
applied_start_date: Optional[datetime.datetime] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SpecRefView:
section: Optional[str] = None
title: Optional[str] = None
url: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DodItemView:
key: Optional[str] = None
text: Optional[str] = None
checked: bool = False
source: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class WorkPackageView:
has_package: bool = False
scope: Optional[str] = None
limits_of_work: Optional[str] = None
spec_refs: List[SpecRefView] = field(default_factory=list)
constraints: List[str] = field(default_factory=list)
hold_points: List[str] = field(default_factory=list)
dod: List[DodItemView] = field(default_factory=list)
safety_note: Optional[str] = None
provenance: Optional[str] = None
spec_book: Optional[str] = None
user_edited: bool = False
redraft_note: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EstimateCrewLineView:
role: Optional[str] = None
hours: Decimal = decimal.Decimal(0)
st_hours: Decimal = decimal.Decimal(0)
ot_hours: Decimal = decimal.Decimal(0)
has_ot: bool = False
premium_applied: bool = False
needs_rate: bool = False
rate_key: Optional[str] = None
chip: Optional[str] = None
rrop: Optional[Decimal] = None
st_cost: Optional[Decimal] = None
ot_cost: Optional[Decimal] = None
cost: Optional[Decimal] = None
fringe_cost: Optional[Decimal] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EstimateEquipmentLineView:
name: Optional[str] = None
quantity: Decimal = decimal.Decimal(0)
rate: Optional[Decimal] = None
needs_rate: bool = False
mob_cost: Decimal = decimal.Decimal(0)
cost: Decimal = decimal.Decimal(0)
is_availability_tracked: bool = False
is_owned: bool = False
availability_label: Optional[str] = None
freed_from_project: Optional[str] = None
available_from: Optional[datetime.datetime] = None
rate_key: Optional[str] = None
chip: Optional[str] = None
rental_explain: Optional[str] = None
usage_days: Decimal = decimal.Decimal(0)
billed_days: Decimal = decimal.Decimal(0)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EstimateMaterialLineView:
name: Optional[str] = None
quantity: Decimal = decimal.Decimal(0)
unit: Optional[str] = None
rate: Optional[Decimal] = None
needs_rate: bool = False
cost: Decimal = decimal.Decimal(0)
rate_key: Optional[str] = None
chip: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EstimateSubcontractView:
estimate_subcontract_i_d: int = 0
task_seq: int = 0
vendor: Optional[str] = None
amount: Decimal = decimal.Decimal(0)
scope: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EstimateJobView:
seq: int = 0
work_package: Optional[WorkPackageView] = None
item_no: Optional[str] = None
name: Optional[str] = None
category: Optional[str] = None
source_ref: Optional[str] = None
unit: Optional[str] = None
quantity: Decimal = decimal.Decimal(0)
pattern_code: Optional[str] = None
workdays: int = 0
hours_per_day: Decimal = decimal.Decimal(0)
is_night: bool = False
weekly_hours: Decimal = decimal.Decimal(0)
ot_fraction: Decimal = decimal.Decimal(0)
days: Decimal = decimal.Decimal(0)
effective_prod_per_day: Optional[Decimal] = None
crew_premium_applied: bool = False
crew_cost: Decimal = decimal.Decimal(0)
fringe_cost: Decimal = decimal.Decimal(0)
equipment_cost: Decimal = decimal.Decimal(0)
material_cost: Decimal = decimal.Decimal(0)
subcontract_cost: Decimal = decimal.Decimal(0)
direct: Decimal = decimal.Decimal(0)
pricing_basis: Optional[str] = None
benchmark_unit_price: Optional[Decimal] = None
crew: List[EstimateCrewLineView] = field(default_factory=list)
equipment: List[EstimateEquipmentLineView] = field(default_factory=list)
materials: List[EstimateMaterialLineView] = field(default_factory=list)
subcontracts: List[EstimateSubcontractView] = field(default_factory=list)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BidScheduleLine:
item_no: Optional[str] = None
description: Optional[str] = None
unit: Optional[str] = None
quantity: Decimal = decimal.Decimal(0)
unit_price: Decimal = decimal.Decimal(0)
extension: Decimal = decimal.Decimal(0)
pricing_basis: Optional[str] = None
benchmark_delta_pct: Optional[Decimal] = None
benchmark_flagged: bool = False
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EstimateVarianceLine:
seq: int = 0
item_no: Optional[str] = None
name: Optional[str] = None
unit: Optional[str] = None
quantity: Decimal = decimal.Decimal(0)
our_unit_price: Decimal = decimal.Decimal(0)
our_total: Decimal = decimal.Decimal(0)
benchmark_unit_price: Decimal = decimal.Decimal(0)
market_total: Decimal = decimal.Decimal(0)
delta_pct: Decimal = decimal.Decimal(0)
rate_min: Optional[Decimal] = None
rate_max: Optional[Decimal] = None
sample_size: Optional[int] = None
outside_range: Optional[bool] = None
is_floor: bool = False
severity: Optional[str] = None
note: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EstimateVarianceView:
lines: List[EstimateVarianceLine] = field(default_factory=list)
items_total: int = 0
items_benchmarked: int = 0
coverage_value_pct: Decimal = decimal.Decimal(0)
ours_total: Decimal = decimal.Decimal(0)
market_total: Decimal = decimal.Decimal(0)
aggregate_delta_pct: Optional[Decimal] = None
floored_count: int = 0
watch_count: int = 0
outlier_count: int = 0
critical_count: int = 0
note: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class IndicativeLine:
seq: int = 0
item_no: Optional[str] = None
name: Optional[str] = None
unit: Optional[str] = None
quantity: Decimal = decimal.Decimal(0)
source: Optional[str] = None
unit_price: Decimal = decimal.Decimal(0)
line_total: Decimal = decimal.Decimal(0)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class IndicativeBidView:
lines: List[IndicativeLine] = field(default_factory=list)
bottom_up_count: int = 0
bottom_up_total: Decimal = decimal.Decimal(0)
benchmark_count: int = 0
benchmark_total: Decimal = decimal.Decimal(0)
uncovered_count: int = 0
uncovered_floor_total: Decimal = decimal.Decimal(0)
indicative_total: Decimal = decimal.Decimal(0)
floor_total: Decimal = decimal.Decimal(0)
note: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EstimateSummaryView:
direct: Decimal = decimal.Decimal(0)
ohp_pct: Decimal = decimal.Decimal(0)
ohp_amount: Decimal = decimal.Decimal(0)
bond_pct: Decimal = decimal.Decimal(0)
bond_amount: Decimal = decimal.Decimal(0)
contingency_pct: Decimal = decimal.Decimal(0)
contingency_amount: Decimal = decimal.Decimal(0)
bid_total: Decimal = decimal.Decimal(0)
load_factor: Decimal = decimal.Decimal(0)
margin_pct: Decimal = decimal.Decimal(0)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EstimateTimingView:
total_workdays: Decimal = decimal.Decimal(0)
calendar_days: int = 0
finish: datetime.datetime = datetime.datetime(1, 1, 1)
feasible: bool = False
deadline: Optional[datetime.datetime] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EstimateReviewItemView:
task_seq: int = 0
task_name: Optional[str] = None
reason: Optional[str] = None
status: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EstimatingView:
rfp_document_i_d: int = 0
project_name: Optional[str] = None
client_name: Optional[str] = None
bid_due_date: Optional[str] = None
project_type: Optional[str] = None
settings: Optional[EstimateSettingsView] = None
jobs: List[EstimateJobView] = field(default_factory=list)
schedule: List[BidScheduleLine] = field(default_factory=list)
schedule_total: Decimal = decimal.Decimal(0)
variance: Optional[EstimateVarianceView] = None
indicative: Optional[IndicativeBidView] = None
summary: Optional[EstimateSummaryView] = None
timing: Optional[EstimateTimingView] = None
needs_rate_count: int = 0
needs_rate_keys: List[str] = field(default_factory=list)
review_items: List[EstimateReviewItemView] = field(default_factory=list)
needs_review_count: int = 0
can_approve: bool = False
can_see_pay: bool = False
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EstimateResponse:
response_status: Optional[ResponseStatus] = None
view: Optional[EstimatingView] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ApplyStartRequest:
rfp_document_u_i_d: Optional[str] = None
start_date: datetime.datetime = datetime.datetime(1, 1, 1)
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/Rfp/{RfpDocumentUID}/ApplyStart HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<ApplyStartRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<RfpDocumentUID>00000000-0000-0000-0000-000000000000</RfpDocumentUID>
<StartDate>0001-01-01T00:00:00</StartDate>
</ApplyStartRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<EstimateResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</ResponseStatus>
<View>
<BidDueDate>String</BidDueDate>
<CanApprove>false</CanApprove>
<CanSeePay>false</CanSeePay>
<ClientName>String</ClientName>
<Indicative>
<BenchmarkCount>0</BenchmarkCount>
<BenchmarkTotal>0</BenchmarkTotal>
<BottomUpCount>0</BottomUpCount>
<BottomUpTotal>0</BottomUpTotal>
<FloorTotal>0</FloorTotal>
<IndicativeTotal>0</IndicativeTotal>
<Lines>
<IndicativeLine>
<ItemNo>String</ItemNo>
<LineTotal>0</LineTotal>
<Name>String</Name>
<Quantity>0</Quantity>
<Seq>0</Seq>
<Source>String</Source>
<Unit>String</Unit>
<UnitPrice>0</UnitPrice>
</IndicativeLine>
</Lines>
<Note>String</Note>
<UncoveredCount>0</UncoveredCount>
<UncoveredFloorTotal>0</UncoveredFloorTotal>
</Indicative>
<Jobs>
<EstimateJobView>
<BenchmarkUnitPrice>0</BenchmarkUnitPrice>
<Category>String</Category>
<Crew>
<EstimateCrewLineView>
<Chip>String</Chip>
<Cost>0</Cost>
<FringeCost>0</FringeCost>
<HasOt>false</HasOt>
<Hours>0</Hours>
<NeedsRate>false</NeedsRate>
<OtCost>0</OtCost>
<OtHours>0</OtHours>
<PremiumApplied>false</PremiumApplied>
<RateKey>String</RateKey>
<Role>String</Role>
<Rrop>0</Rrop>
<StCost>0</StCost>
<StHours>0</StHours>
</EstimateCrewLineView>
</Crew>
<CrewCost>0</CrewCost>
<CrewPremiumApplied>false</CrewPremiumApplied>
<Days>0</Days>
<Direct>0</Direct>
<EffectiveProdPerDay>0</EffectiveProdPerDay>
<Equipment>
<EstimateEquipmentLineView>
<AvailabilityLabel>String</AvailabilityLabel>
<AvailableFrom>0001-01-01T00:00:00</AvailableFrom>
<BilledDays>0</BilledDays>
<Chip>String</Chip>
<Cost>0</Cost>
<FreedFromProject>String</FreedFromProject>
<IsAvailabilityTracked>false</IsAvailabilityTracked>
<IsOwned>false</IsOwned>
<MobCost>0</MobCost>
<Name>String</Name>
<NeedsRate>false</NeedsRate>
<Quantity>0</Quantity>
<Rate>0</Rate>
<RateKey>String</RateKey>
<RentalExplain>String</RentalExplain>
<UsageDays>0</UsageDays>
</EstimateEquipmentLineView>
</Equipment>
<EquipmentCost>0</EquipmentCost>
<FringeCost>0</FringeCost>
<HoursPerDay>0</HoursPerDay>
<IsNight>false</IsNight>
<ItemNo>String</ItemNo>
<MaterialCost>0</MaterialCost>
<Materials>
<EstimateMaterialLineView>
<Chip>String</Chip>
<Cost>0</Cost>
<Name>String</Name>
<NeedsRate>false</NeedsRate>
<Quantity>0</Quantity>
<Rate>0</Rate>
<RateKey>String</RateKey>
<Unit>String</Unit>
</EstimateMaterialLineView>
</Materials>
<Name>String</Name>
<OtFraction>0</OtFraction>
<PatternCode>String</PatternCode>
<PricingBasis>String</PricingBasis>
<Quantity>0</Quantity>
<Seq>0</Seq>
<SourceRef>String</SourceRef>
<SubcontractCost>0</SubcontractCost>
<Subcontracts>
<EstimateSubcontractView>
<Amount>0</Amount>
<EstimateSubcontractID>0</EstimateSubcontractID>
<Scope>String</Scope>
<TaskSeq>0</TaskSeq>
<Vendor>String</Vendor>
</EstimateSubcontractView>
</Subcontracts>
<Unit>String</Unit>
<WeeklyHours>0</WeeklyHours>
<WorkPackage>
<Constraints xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d6p1:string>String</d6p1:string>
</Constraints>
<Dod>
<RfpWorkPackageService.DodItemView>
<Checked>false</Checked>
<Key>String</Key>
<Source>String</Source>
<Text>String</Text>
</RfpWorkPackageService.DodItemView>
</Dod>
<HasPackage>false</HasPackage>
<HoldPoints xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d6p1:string>String</d6p1:string>
</HoldPoints>
<LimitsOfWork>String</LimitsOfWork>
<Provenance>String</Provenance>
<RedraftNote>String</RedraftNote>
<SafetyNote>String</SafetyNote>
<Scope>String</Scope>
<SpecBook>String</SpecBook>
<SpecRefs>
<RfpWorkPackageService.SpecRefView>
<Section>String</Section>
<Title>String</Title>
<Url>String</Url>
</RfpWorkPackageService.SpecRefView>
</SpecRefs>
<UserEdited>false</UserEdited>
</WorkPackage>
<Workdays>0</Workdays>
</EstimateJobView>
</Jobs>
<NeedsRateCount>0</NeedsRateCount>
<NeedsRateKeys xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:string>String</d3p1:string>
</NeedsRateKeys>
<NeedsReviewCount>0</NeedsReviewCount>
<ProjectName>String</ProjectName>
<ProjectType>String</ProjectType>
<ReviewItems>
<EstimateReviewItemView>
<Reason>String</Reason>
<Status>String</Status>
<TaskName>String</TaskName>
<TaskSeq>0</TaskSeq>
</EstimateReviewItemView>
</ReviewItems>
<RfpDocumentID>0</RfpDocumentID>
<Schedule>
<BidScheduleLine>
<BenchmarkDeltaPct>0</BenchmarkDeltaPct>
<BenchmarkFlagged>false</BenchmarkFlagged>
<Description>String</Description>
<Extension>0</Extension>
<ItemNo>String</ItemNo>
<PricingBasis>String</PricingBasis>
<Quantity>0</Quantity>
<Unit>String</Unit>
<UnitPrice>0</UnitPrice>
</BidScheduleLine>
</Schedule>
<ScheduleTotal>0</ScheduleTotal>
<Settings>
<AppliedStartDate>0001-01-01T00:00:00</AppliedStartDate>
<BondPct>0</BondPct>
<ContingencyPct>0</ContingencyPct>
<DeadlineDate>0001-01-01T00:00:00</DeadlineDate>
<Holidays xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:dateTime>0001-01-01T00:00:00</d4p1:dateTime>
</Holidays>
<HoursPerDay>0</HoursPerDay>
<OhpPct>0</OhpPct>
<RfpEstimateID>0</RfpEstimateID>
<StartDate>0001-01-01T00:00:00</StartDate>
<WeatherPct>0</WeatherPct>
<WorkdaysPerWeek>0</WorkdaysPerWeek>
</Settings>
<Summary>
<BidTotal>0</BidTotal>
<BondAmount>0</BondAmount>
<BondPct>0</BondPct>
<ContingencyAmount>0</ContingencyAmount>
<ContingencyPct>0</ContingencyPct>
<Direct>0</Direct>
<LoadFactor>0</LoadFactor>
<MarginPct>0</MarginPct>
<OhpAmount>0</OhpAmount>
<OhpPct>0</OhpPct>
</Summary>
<Timing>
<CalendarDays>0</CalendarDays>
<Deadline>0001-01-01T00:00:00</Deadline>
<Feasible>false</Feasible>
<Finish>0001-01-01T00:00:00</Finish>
<TotalWorkdays>0</TotalWorkdays>
</Timing>
<Variance>
<AggregateDeltaPct>0</AggregateDeltaPct>
<CoverageValuePct>0</CoverageValuePct>
<CriticalCount>0</CriticalCount>
<FlooredCount>0</FlooredCount>
<ItemsBenchmarked>0</ItemsBenchmarked>
<ItemsTotal>0</ItemsTotal>
<Lines>
<EstimateVarianceLine>
<BenchmarkUnitPrice>0</BenchmarkUnitPrice>
<DeltaPct>0</DeltaPct>
<IsFloor>false</IsFloor>
<ItemNo>String</ItemNo>
<MarketTotal>0</MarketTotal>
<Name>String</Name>
<Note>String</Note>
<OurTotal>0</OurTotal>
<OurUnitPrice>0</OurUnitPrice>
<OutsideRange>false</OutsideRange>
<Quantity>0</Quantity>
<RateMax>0</RateMax>
<RateMin>0</RateMin>
<SampleSize>0</SampleSize>
<Seq>0</Seq>
<Severity>String</Severity>
<Unit>String</Unit>
</EstimateVarianceLine>
</Lines>
<MarketTotal>0</MarketTotal>
<Note>String</Note>
<OursTotal>0</OursTotal>
<OutlierCount>0</OutlierCount>
<WatchCount>0</WatchCount>
</Variance>
</View>
</EstimateResponse>