| Requires any of the roles: | Agent, Administrator |
| 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 .jsv suffix or ?format=jsv
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: text/jsv
Content-Type: text/jsv
Content-Length: length
{
RfpDocumentUID: 00000000000000000000000000000000,
TaskSeq: 0,
TemplateUID: 00000000000000000000000000000000
}
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
}
},
TaskSeq: 0,
TemplateUID: 00000000000000000000000000000000,
TemplateName: String,
Quantity: 0,
Unit: String,
Resourcing:
{
Positions:
[
{
PositionTag: String,
Hours: 0,
CrewSize: 0,
Utilization: 0,
FixedDays: 0,
Headcount: 0,
SourceReference: String,
Notes: String,
IsInCatalog: False,
ContactID: 0
}
],
Equipment:
[
{
EquipmentID: 0,
EquipmentName: String,
MakeModel: String,
Quantity: 0,
DurationDays: 0,
Utilization: 0,
FixedDays: 0,
SourceReference: String,
Notes: String,
IsInCatalog: False,
SuggestedEquipmentID: 0,
SuggestedEquipmentName: String
}
],
Materials:
[
{
MaterialID: 0,
MaterialName: String,
MakeModel: String,
Quantity: 0,
QuantityPerUnit: 0,
Unit: String,
SourceReference: String,
Notes: String,
IsInCatalog: False,
SuggestedMaterialID: 0,
SuggestedMaterialName: String
}
],
ResourcedForQuantity: 0,
ProductionRatePerDay: 0,
FixedDays: 0
},
Job:
{
Seq: 0,
DependsOn:
[
0
],
ItemNo: String,
Name: String,
Category: String,
SourceRef: String,
Unit: String,
Quantity: 0,
PatternCode: String,
Workdays: 0,
HoursPerDay: 0,
IsNight: False,
WeeklyHours: 0,
OtFraction: 0,
Days: 0,
EffectiveProdPerDay: 0,
CrewPremiumApplied: False,
WorkPackage:
{
HasPackage: False,
Scope: String,
LimitsOfWork: String,
SpecRefs:
[
{
Section: String,
Title: String,
Url: String
}
],
Constraints:
[
String
],
HoldPoints:
[
String
],
Dod:
[
{
Key: String,
Text: String,
Checked: False,
Source: String
}
],
SafetyNote: String,
Provenance: String,
SpecBook: String,
UserEdited: False,
RedraftNote: String
},
Crew:
[
{
Role: String,
Hours: 0,
StHours: 0,
OtHours: 0,
Rrop: 0,
StCost: 0,
OtCost: 0,
Cost: 0,
FringeCost: 0,
PremiumApplied: False,
HasOt: False,
NeedsRate: False
}
],
Equipment:
[
{
Name: String,
Quantity: 0,
Rate: 0,
NeedsRate: False,
MobCost: 0,
Cost: 0,
IsAvailabilityTracked: False,
IsOwned: False,
AvailabilityLabel: String,
FreedFromProject: String,
AvailableFrom: 0001-01-01,
RateKey: String,
RentalExplain: String,
UsageDays: 0,
BilledDays: 0
}
],
Materials:
[
{
Name: String,
Quantity: 0,
Unit: String,
Rate: 0,
NeedsRate: False,
Cost: 0,
RateKey: String
}
],
Subcontracts:
[
{
Vendor: String,
Amount: 0,
Scope: String
}
],
CrewCost: 0,
FringeCost: 0,
EquipmentCost: 0,
MaterialCost: 0,
SubcontractCost: 0,
Direct: 0,
PricingBasis: String,
PricingRuleId: String,
PricingBandP25: 0,
PricingBandP75: 0,
PricingBandN: 0,
PricingBandLabel: String,
BenchmarkUnitPrice: 0,
BenchmarkRateMin: 0,
BenchmarkRateMax: 0,
BenchmarkSampleSize: 0,
BenchmarkP25: 0,
BenchmarkP75: 0,
BenchmarkBasis: String,
UnitPriceOverride: 0,
OverrideBasis: String,
ReferencePrice: 0,
ReferenceRangeMin: 0,
ReferenceRangeMax: 0,
ReferenceN: 0,
ReferenceDate: 0001-01-01,
ReferenceBasis: String,
ReferenceUrl: String
},
Headline: String
}