| POST,OPTIONS | /v1/projects/{ProjectID}/change-orders/{ChangeOrderID}/reject |
|---|
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 ChangeOrderLine:
change_order_line_i_d: int = 0
change_order_i_d: int = 0
category: Optional[str] = None
description: Optional[str] = None
cost_u_s_d: Decimal = decimal.Decimal(0)
markup_pct: Decimal = decimal.Decimal(0)
cost_code: Optional[str] = None
sort_order: int = 0
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ChangeOrder:
change_order_i_d: int = 0
change_order_u_i_d: Optional[str] = None
project_i_d: int = 0
co_number: Optional[str] = None
title: Optional[str] = None
scope: Optional[str] = None
status: Optional[str] = None
cost_u_s_d: Decimal = decimal.Decimal(0)
price_u_s_d: Decimal = decimal.Decimal(0)
schedule_days: int = 0
overhead_profit_pct: Decimal = decimal.Decimal(0)
pricing_method: Optional[str] = None
origin_type: Optional[str] = None
origin_ref: Optional[str] = None
cost_code: Optional[str] = None
opened_at: Optional[datetime.datetime] = None
submitted_at: Optional[datetime.datetime] = None
decided_at: Optional[datetime.datetime] = None
created_by: Optional[str] = None
created_at: Optional[datetime.datetime] = None
updated_at: Optional[datetime.datetime] = None
days_open: int = 0
lines: List[ChangeOrderLine] = field(default_factory=list)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ChangeOrderContractSummary:
project_i_d: int = 0
original_contract: Decimal = decimal.Decimal(0)
approved_c_o_value: Decimal = decimal.Decimal(0)
approved_c_o_count: int = 0
pending_c_o_value: Decimal = decimal.Decimal(0)
pending_c_o_count: int = 0
revised_contract: Decimal = decimal.Decimal(0)
potential_contract: Decimal = decimal.Decimal(0)
approved_schedule_days: int = 0
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ChangeOrderResponse:
response_status: Optional[ResponseStatus] = None
order: Optional[ChangeOrder] = None
summary: Optional[ChangeOrderContractSummary] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ChangeOrderRejectRequest:
project_i_d: int = 0
change_order_i_d: int = 0
Python ChangeOrderRejectRequest 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/projects/{ProjectID}/change-orders/{ChangeOrderID}/reject HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
ProjectID: 0,
ChangeOrderID: 0
}
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
}
},
Order:
{
ChangeOrderID: 0,
ChangeOrderUID: 00000000000000000000000000000000,
ProjectID: 0,
CONumber: String,
Title: String,
Scope: String,
Status: String,
CostUSD: 0,
PriceUSD: 0,
ScheduleDays: 0,
OverheadProfitPct: 0,
PricingMethod: String,
OriginType: String,
OriginRef: String,
CostCode: String,
OpenedAt: 0001-01-01,
SubmittedAt: 0001-01-01,
DecidedAt: 0001-01-01,
CreatedBy: String,
CreatedAt: 0001-01-01,
UpdatedAt: 0001-01-01,
DaysOpen: 0,
Lines:
[
{
ChangeOrderLineID: 0,
ChangeOrderID: 0,
Category: String,
Description: String,
CostUSD: 0,
MarkupPct: 0,
CostCode: String,
SortOrder: 0
}
]
},
Summary:
{
ProjectID: 0,
OriginalContract: 0,
ApprovedCOValue: 0,
ApprovedCOCount: 0,
PendingCOValue: 0,
PendingCOCount: 0,
RevisedContract: 0,
PotentialContract: 0,
ApprovedScheduleDays: 0
}
}