| POST,OPTIONS | /v1/projects/{ProjectID}/certified-payroll/{Week}/submit |
|---|
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 CertifiedPayrollLine:
certified_payroll_line_i_d: int = 0
certified_payroll_i_d: int = 0
worker_name: Optional[str] = None
contact_i_d: Optional[int] = None
classification: Optional[str] = None
hours_s_t: Decimal = decimal.Decimal(0)
hours_o_t: Decimal = decimal.Decimal(0)
base_rate: Decimal = decimal.Decimal(0)
fringe_rate: Decimal = decimal.Decimal(0)
fringe_cash_rate: Decimal = decimal.Decimal(0)
fringe_plan_rate: Decimal = decimal.Decimal(0)
gross_pay: Decimal = decimal.Decimal(0)
flagged: bool = False
restitution_amount: Decimal = decimal.Decimal(0)
restitution_note: Optional[str] = None
required_base: Decimal = decimal.Decimal(0)
required_fringe: Decimal = decimal.Decimal(0)
sort_order: int = 0
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CertifiedPayroll:
certified_payroll_i_d: int = 0
certified_payroll_u_i_d: Optional[str] = None
project_i_d: int = 0
payroll_number: int = 0
week_ending: Optional[datetime.datetime] = None
status: Optional[str] = None
dbe_participation_pct: Decimal = decimal.Decimal(0)
dbe_goal_pct: Decimal = decimal.Decimal(0)
ojt_apprentice_hours: Decimal = decimal.Decimal(0)
ojt_apprentice_goal_hours: Decimal = decimal.Decimal(0)
worker_count: int = 0
total_hours_s_t: Decimal = decimal.Decimal(0)
total_hours_o_t: Decimal = decimal.Decimal(0)
total_gross_pay: Decimal = decimal.Decimal(0)
flagged_count: int = 0
submitted_by: Optional[str] = None
submitted_at: Optional[datetime.datetime] = None
created_by: Optional[str] = None
created_at: Optional[datetime.datetime] = None
updated_at: Optional[datetime.datetime] = None
lines: List[CertifiedPayrollLine] = field(default_factory=list)
determination_no: Optional[str] = None
determination_type: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CertifiedPayrollResponse:
response_status: Optional[ResponseStatus] = None
payroll: Optional[CertifiedPayroll] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CertifiedPayrollSubmitRequest:
project_i_d: int = 0
week: Optional[str] = None
Python CertifiedPayrollSubmitRequest DTOs
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/projects/{ProjectID}/certified-payroll/{Week}/submit HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CertifiedPayrollSubmitRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<ProjectID>0</ProjectID>
<Week>String</Week>
</CertifiedPayrollSubmitRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<CertifiedPayrollResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Payroll>
<CertifiedPayrollID>0</CertifiedPayrollID>
<CertifiedPayrollUID>00000000-0000-0000-0000-000000000000</CertifiedPayrollUID>
<CreatedAt>0001-01-01T00:00:00</CreatedAt>
<CreatedBy>String</CreatedBy>
<DbeGoalPct>0</DbeGoalPct>
<DbeParticipationPct>0</DbeParticipationPct>
<DeterminationNo>String</DeterminationNo>
<DeterminationType>String</DeterminationType>
<FlaggedCount>0</FlaggedCount>
<Lines>
<CertifiedPayrollLine>
<BaseRate>0</BaseRate>
<CertifiedPayrollID>0</CertifiedPayrollID>
<CertifiedPayrollLineID>0</CertifiedPayrollLineID>
<Classification>String</Classification>
<ContactID>0</ContactID>
<Flagged>false</Flagged>
<FringeCashRate>0</FringeCashRate>
<FringePlanRate>0</FringePlanRate>
<FringeRate>0</FringeRate>
<GrossPay>0</GrossPay>
<HoursOT>0</HoursOT>
<HoursST>0</HoursST>
<RequiredBase>0</RequiredBase>
<RequiredFringe>0</RequiredFringe>
<RestitutionAmount>0</RestitutionAmount>
<RestitutionNote>String</RestitutionNote>
<SortOrder>0</SortOrder>
<WorkerName>String</WorkerName>
</CertifiedPayrollLine>
</Lines>
<OjtApprenticeGoalHours>0</OjtApprenticeGoalHours>
<OjtApprenticeHours>0</OjtApprenticeHours>
<PayrollNumber>0</PayrollNumber>
<ProjectID>0</ProjectID>
<Status>String</Status>
<SubmittedAt>0001-01-01T00:00:00</SubmittedAt>
<SubmittedBy>String</SubmittedBy>
<TotalGrossPay>0</TotalGrossPay>
<TotalHoursOT>0</TotalHoursOT>
<TotalHoursST>0</TotalHoursST>
<UpdatedAt>0001-01-01T00:00:00</UpdatedAt>
<WeekEnding>0001-01-01T00:00:00</WeekEnding>
<WorkerCount>0</WorkerCount>
</Payroll>
<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>
</CertifiedPayrollResponse>