Trendsic Platform Service

<back to all web services

ApplyAssemblyRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
POST,OPTIONS/v1/Rfp/{RfpDocumentUID}/Estimate/Jobs/{TaskSeq}/assembly
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 ResourcedPosition:
    position_tag: Optional[str] = None
    hours: Optional[float] = None
    crew_size: Optional[float] = None
    utilization: Optional[float] = None
    fixed_days: Optional[float] = None
    headcount: Optional[int] = None
    source_reference: Optional[str] = None
    notes: Optional[str] = None
    is_in_catalog: bool = False
    contact_i_d: Optional[int] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ResourcedEquipment:
    equipment_i_d: int = 0
    equipment_name: Optional[str] = None
    make_model: Optional[str] = None
    quantity: Optional[float] = None
    duration_days: Optional[float] = None
    utilization: Optional[float] = None
    fixed_days: Optional[float] = None
    source_reference: Optional[str] = None
    notes: Optional[str] = None
    is_in_catalog: bool = False
    suggested_equipment_i_d: int = 0
    suggested_equipment_name: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ResourcedMaterial:
    material_i_d: int = 0
    material_name: Optional[str] = None
    make_model: Optional[str] = None
    quantity: Optional[float] = None
    quantity_per_unit: Optional[float] = None
    unit: Optional[str] = None
    source_reference: Optional[str] = None
    notes: Optional[str] = None
    is_in_catalog: bool = False
    suggested_material_i_d: int = 0
    suggested_material_name: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TaskResourcing:
    positions: List[ResourcedPosition] = field(default_factory=list)
    equipment: List[ResourcedEquipment] = field(default_factory=list)
    materials: List[ResourcedMaterial] = field(default_factory=list)
    resourced_for_quantity: Optional[float] = None
    production_rate_per_day: Optional[float] = None
    fixed_days: Optional[float] = 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 EstimateCrewLineResult:
    role: Optional[str] = None
    hours: Decimal = decimal.Decimal(0)
    st_hours: Decimal = decimal.Decimal(0)
    ot_hours: Decimal = decimal.Decimal(0)
    rrop: Decimal = decimal.Decimal(0)
    st_cost: Decimal = decimal.Decimal(0)
    ot_cost: Decimal = decimal.Decimal(0)
    cost: Decimal = decimal.Decimal(0)
    fringe_cost: Decimal = decimal.Decimal(0)
    premium_applied: bool = False
    has_ot: bool = False
    needs_rate: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EstimateEquipmentLineResult:
    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
    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 EstimateMaterialLineResult:
    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


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EstimateSubcontractLine:
    vendor: Optional[str] = None
    amount: Decimal = decimal.Decimal(0)
    scope: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EstimateJobResult:
    seq: int = 0
    depends_on: List[int] = field(default_factory=list)
    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
    work_package: Optional[WorkPackageView] = None
    crew: List[EstimateCrewLineResult] = field(default_factory=list)
    equipment: List[EstimateEquipmentLineResult] = field(default_factory=list)
    materials: List[EstimateMaterialLineResult] = field(default_factory=list)
    subcontracts: List[EstimateSubcontractLine] = field(default_factory=list)
    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
    pricing_rule_id: Optional[str] = None
    pricing_band_p25: Optional[Decimal] = None
    pricing_band_p75: Optional[Decimal] = None
    pricing_band_n: Optional[int] = None
    pricing_band_label: Optional[str] = None
    benchmark_unit_price: Optional[Decimal] = None
    benchmark_rate_min: Optional[Decimal] = None
    benchmark_rate_max: Optional[Decimal] = None
    benchmark_sample_size: Optional[int] = None
    benchmark_p25: Optional[Decimal] = None
    benchmark_p75: Optional[Decimal] = None
    benchmark_basis: Optional[str] = None
    unit_price_override: Optional[Decimal] = None
    override_basis: Optional[str] = None
    reference_price: Optional[Decimal] = None
    reference_range_min: Optional[Decimal] = None
    reference_range_max: Optional[Decimal] = None
    reference_n: Optional[int] = None
    reference_date: Optional[datetime.datetime] = None
    reference_basis: Optional[str] = None
    reference_url: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ApplyAssemblyResponse:
    response_status: Optional[ResponseStatus] = None
    task_seq: int = 0
    template_u_i_d: Optional[str] = None
    template_name: Optional[str] = None
    quantity: Decimal = decimal.Decimal(0)
    unit: Optional[str] = None
    resourcing: Optional[TaskResourcing] = None
    job: Optional[EstimateJobResult] = None
    headline: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ApplyAssemblyRequest:
    rfp_document_u_i_d: Optional[str] = None
    task_seq: int = 0
    template_u_i_d: Optional[str] = None

Python ApplyAssemblyRequest DTOs

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

HTTP + XML

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

POST /v1/Rfp/{RfpDocumentUID}/Estimate/Jobs/{TaskSeq}/assembly HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<ApplyAssemblyRequest 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>
  <TaskSeq>0</TaskSeq>
  <TemplateUID>00000000-0000-0000-0000-000000000000</TemplateUID>
</ApplyAssemblyRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ApplyAssemblyResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Headline>String</Headline>
  <Job>
    <BenchmarkBasis>String</BenchmarkBasis>
    <BenchmarkP25>0</BenchmarkP25>
    <BenchmarkP75>0</BenchmarkP75>
    <BenchmarkRateMax>0</BenchmarkRateMax>
    <BenchmarkRateMin>0</BenchmarkRateMin>
    <BenchmarkSampleSize>0</BenchmarkSampleSize>
    <BenchmarkUnitPrice>0</BenchmarkUnitPrice>
    <Category>String</Category>
    <Crew>
      <EstimateCrewLineResult>
        <Cost>0</Cost>
        <FringeCost>0</FringeCost>
        <HasOt>false</HasOt>
        <Hours>0</Hours>
        <NeedsRate>false</NeedsRate>
        <OtCost>0</OtCost>
        <OtHours>0</OtHours>
        <PremiumApplied>false</PremiumApplied>
        <Role>String</Role>
        <Rrop>0</Rrop>
        <StCost>0</StCost>
        <StHours>0</StHours>
      </EstimateCrewLineResult>
    </Crew>
    <CrewCost>0</CrewCost>
    <CrewPremiumApplied>false</CrewPremiumApplied>
    <Days>0</Days>
    <DependsOn xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:int>0</d3p1:int>
    </DependsOn>
    <Direct>0</Direct>
    <EffectiveProdPerDay>0</EffectiveProdPerDay>
    <Equipment>
      <EstimateEquipmentLineResult>
        <AvailabilityLabel>String</AvailabilityLabel>
        <AvailableFrom>0001-01-01T00:00:00</AvailableFrom>
        <BilledDays>0</BilledDays>
        <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>
      </EstimateEquipmentLineResult>
    </Equipment>
    <EquipmentCost>0</EquipmentCost>
    <FringeCost>0</FringeCost>
    <HoursPerDay>0</HoursPerDay>
    <IsNight>false</IsNight>
    <ItemNo>String</ItemNo>
    <MaterialCost>0</MaterialCost>
    <Materials>
      <EstimateMaterialLineResult>
        <Cost>0</Cost>
        <Name>String</Name>
        <NeedsRate>false</NeedsRate>
        <Quantity>0</Quantity>
        <Rate>0</Rate>
        <RateKey>String</RateKey>
        <Unit>String</Unit>
      </EstimateMaterialLineResult>
    </Materials>
    <Name>String</Name>
    <OtFraction>0</OtFraction>
    <OverrideBasis>String</OverrideBasis>
    <PatternCode>String</PatternCode>
    <PricingBandLabel>String</PricingBandLabel>
    <PricingBandN>0</PricingBandN>
    <PricingBandP25>0</PricingBandP25>
    <PricingBandP75>0</PricingBandP75>
    <PricingBasis>String</PricingBasis>
    <PricingRuleId>String</PricingRuleId>
    <Quantity>0</Quantity>
    <ReferenceBasis>String</ReferenceBasis>
    <ReferenceDate>0001-01-01T00:00:00</ReferenceDate>
    <ReferenceN>0</ReferenceN>
    <ReferencePrice>0</ReferencePrice>
    <ReferenceRangeMax>0</ReferenceRangeMax>
    <ReferenceRangeMin>0</ReferenceRangeMin>
    <ReferenceUrl>String</ReferenceUrl>
    <Seq>0</Seq>
    <SourceRef>String</SourceRef>
    <SubcontractCost>0</SubcontractCost>
    <Subcontracts>
      <EstimateSubcontractLine>
        <Amount>0</Amount>
        <Scope>String</Scope>
        <Vendor>String</Vendor>
      </EstimateSubcontractLine>
    </Subcontracts>
    <Unit>String</Unit>
    <UnitPriceOverride>0</UnitPriceOverride>
    <WeeklyHours>0</WeeklyHours>
    <WorkPackage>
      <Constraints xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1: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:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1: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>
  </Job>
  <Quantity>0</Quantity>
  <Resourcing>
    <Equipment>
      <ResourcedEquipment>
        <DurationDays>0</DurationDays>
        <EquipmentID>0</EquipmentID>
        <EquipmentName>String</EquipmentName>
        <FixedDays>0</FixedDays>
        <IsInCatalog>false</IsInCatalog>
        <MakeModel>String</MakeModel>
        <Notes>String</Notes>
        <Quantity>0</Quantity>
        <SourceReference>String</SourceReference>
        <SuggestedEquipmentID>0</SuggestedEquipmentID>
        <SuggestedEquipmentName>String</SuggestedEquipmentName>
        <Utilization>0</Utilization>
      </ResourcedEquipment>
    </Equipment>
    <FixedDays>0</FixedDays>
    <Materials>
      <ResourcedMaterial>
        <IsInCatalog>false</IsInCatalog>
        <MakeModel>String</MakeModel>
        <MaterialID>0</MaterialID>
        <MaterialName>String</MaterialName>
        <Notes>String</Notes>
        <Quantity>0</Quantity>
        <QuantityPerUnit>0</QuantityPerUnit>
        <SourceReference>String</SourceReference>
        <SuggestedMaterialID>0</SuggestedMaterialID>
        <SuggestedMaterialName>String</SuggestedMaterialName>
        <Unit>String</Unit>
      </ResourcedMaterial>
    </Materials>
    <Positions>
      <ResourcedPosition>
        <ContactID>0</ContactID>
        <CrewSize>0</CrewSize>
        <FixedDays>0</FixedDays>
        <Headcount>0</Headcount>
        <Hours>0</Hours>
        <IsInCatalog>false</IsInCatalog>
        <Notes>String</Notes>
        <PositionTag>String</PositionTag>
        <SourceReference>String</SourceReference>
        <Utilization>0</Utilization>
      </ResourcedPosition>
    </Positions>
    <ProductionRatePerDay>0</ProductionRatePerDay>
    <ResourcedForQuantity>0</ResourcedForQuantity>
  </Resourcing>
  <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>
  <TaskSeq>0</TaskSeq>
  <TemplateName>String</TemplateName>
  <TemplateUID>00000000-0000-0000-0000-000000000000</TemplateUID>
  <Unit>String</Unit>
</ApplyAssemblyResponse>