| POST,OPTIONS | /v1/projects/{ProjectID}/certified-payroll/{Week}/submit |
|---|
<?php namespace dtos;
use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};
class CertifiedPayrollLine implements JsonSerializable
{
public function __construct(
/** @var int */
public int $CertifiedPayrollLineID=0,
/** @var int */
public int $CertifiedPayrollID=0,
/** @var string|null */
public ?string $WorkerName=null,
/** @var int|null */
public ?int $ContactID=null,
/** @var string|null */
public ?string $Classification=null,
/** @var float */
public float $HoursST=0.0,
/** @var float */
public float $HoursOT=0.0,
/** @var float */
public float $BaseRate=0.0,
/** @var float */
public float $FringeRate=0.0,
/** @var float */
public float $FringeCashRate=0.0,
/** @var float */
public float $FringePlanRate=0.0,
/** @var float */
public float $GrossPay=0.0,
/** @var bool|null */
public ?bool $Flagged=null,
/** @var float */
public float $RestitutionAmount=0.0,
/** @var string|null */
public ?string $RestitutionNote=null,
/** @var float */
public float $RequiredBase=0.0,
/** @var float */
public float $RequiredFringe=0.0,
/** @var int */
public int $SortOrder=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CertifiedPayrollLineID'])) $this->CertifiedPayrollLineID = $o['CertifiedPayrollLineID'];
if (isset($o['CertifiedPayrollID'])) $this->CertifiedPayrollID = $o['CertifiedPayrollID'];
if (isset($o['WorkerName'])) $this->WorkerName = $o['WorkerName'];
if (isset($o['ContactID'])) $this->ContactID = $o['ContactID'];
if (isset($o['Classification'])) $this->Classification = $o['Classification'];
if (isset($o['HoursST'])) $this->HoursST = $o['HoursST'];
if (isset($o['HoursOT'])) $this->HoursOT = $o['HoursOT'];
if (isset($o['BaseRate'])) $this->BaseRate = $o['BaseRate'];
if (isset($o['FringeRate'])) $this->FringeRate = $o['FringeRate'];
if (isset($o['FringeCashRate'])) $this->FringeCashRate = $o['FringeCashRate'];
if (isset($o['FringePlanRate'])) $this->FringePlanRate = $o['FringePlanRate'];
if (isset($o['GrossPay'])) $this->GrossPay = $o['GrossPay'];
if (isset($o['Flagged'])) $this->Flagged = $o['Flagged'];
if (isset($o['RestitutionAmount'])) $this->RestitutionAmount = $o['RestitutionAmount'];
if (isset($o['RestitutionNote'])) $this->RestitutionNote = $o['RestitutionNote'];
if (isset($o['RequiredBase'])) $this->RequiredBase = $o['RequiredBase'];
if (isset($o['RequiredFringe'])) $this->RequiredFringe = $o['RequiredFringe'];
if (isset($o['SortOrder'])) $this->SortOrder = $o['SortOrder'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CertifiedPayrollLineID)) $o['CertifiedPayrollLineID'] = $this->CertifiedPayrollLineID;
if (isset($this->CertifiedPayrollID)) $o['CertifiedPayrollID'] = $this->CertifiedPayrollID;
if (isset($this->WorkerName)) $o['WorkerName'] = $this->WorkerName;
if (isset($this->ContactID)) $o['ContactID'] = $this->ContactID;
if (isset($this->Classification)) $o['Classification'] = $this->Classification;
if (isset($this->HoursST)) $o['HoursST'] = $this->HoursST;
if (isset($this->HoursOT)) $o['HoursOT'] = $this->HoursOT;
if (isset($this->BaseRate)) $o['BaseRate'] = $this->BaseRate;
if (isset($this->FringeRate)) $o['FringeRate'] = $this->FringeRate;
if (isset($this->FringeCashRate)) $o['FringeCashRate'] = $this->FringeCashRate;
if (isset($this->FringePlanRate)) $o['FringePlanRate'] = $this->FringePlanRate;
if (isset($this->GrossPay)) $o['GrossPay'] = $this->GrossPay;
if (isset($this->Flagged)) $o['Flagged'] = $this->Flagged;
if (isset($this->RestitutionAmount)) $o['RestitutionAmount'] = $this->RestitutionAmount;
if (isset($this->RestitutionNote)) $o['RestitutionNote'] = $this->RestitutionNote;
if (isset($this->RequiredBase)) $o['RequiredBase'] = $this->RequiredBase;
if (isset($this->RequiredFringe)) $o['RequiredFringe'] = $this->RequiredFringe;
if (isset($this->SortOrder)) $o['SortOrder'] = $this->SortOrder;
return empty($o) ? new class(){} : $o;
}
}
class CertifiedPayroll implements JsonSerializable
{
public function __construct(
/** @var int */
public int $CertifiedPayrollID=0,
/** @var string */
public string $CertifiedPayrollUID='',
/** @var int */
public int $ProjectID=0,
/** @var int */
public int $PayrollNumber=0,
/** @var DateTime|null */
public ?DateTime $WeekEnding=null,
/** @var string|null */
public ?string $Status=null,
/** @var float */
public float $DbeParticipationPct=0.0,
/** @var float */
public float $DbeGoalPct=0.0,
/** @var float */
public float $OjtApprenticeHours=0.0,
/** @var float */
public float $OjtApprenticeGoalHours=0.0,
/** @var int */
public int $WorkerCount=0,
/** @var float */
public float $TotalHoursST=0.0,
/** @var float */
public float $TotalHoursOT=0.0,
/** @var float */
public float $TotalGrossPay=0.0,
/** @var int */
public int $FlaggedCount=0,
/** @var string|null */
public ?string $SubmittedBy=null,
/** @var DateTime|null */
public ?DateTime $SubmittedAt=null,
/** @var string|null */
public ?string $CreatedBy=null,
/** @var DateTime|null */
public ?DateTime $CreatedAt=null,
/** @var DateTime|null */
public ?DateTime $UpdatedAt=null,
/** @var array<CertifiedPayrollLine>|null */
public ?array $Lines=null,
/** @var string|null */
public ?string $DeterminationNo=null,
/** @var string|null */
public ?string $DeterminationType=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CertifiedPayrollID'])) $this->CertifiedPayrollID = $o['CertifiedPayrollID'];
if (isset($o['CertifiedPayrollUID'])) $this->CertifiedPayrollUID = $o['CertifiedPayrollUID'];
if (isset($o['ProjectID'])) $this->ProjectID = $o['ProjectID'];
if (isset($o['PayrollNumber'])) $this->PayrollNumber = $o['PayrollNumber'];
if (isset($o['WeekEnding'])) $this->WeekEnding = JsonConverters::from('DateTime', $o['WeekEnding']);
if (isset($o['Status'])) $this->Status = $o['Status'];
if (isset($o['DbeParticipationPct'])) $this->DbeParticipationPct = $o['DbeParticipationPct'];
if (isset($o['DbeGoalPct'])) $this->DbeGoalPct = $o['DbeGoalPct'];
if (isset($o['OjtApprenticeHours'])) $this->OjtApprenticeHours = $o['OjtApprenticeHours'];
if (isset($o['OjtApprenticeGoalHours'])) $this->OjtApprenticeGoalHours = $o['OjtApprenticeGoalHours'];
if (isset($o['WorkerCount'])) $this->WorkerCount = $o['WorkerCount'];
if (isset($o['TotalHoursST'])) $this->TotalHoursST = $o['TotalHoursST'];
if (isset($o['TotalHoursOT'])) $this->TotalHoursOT = $o['TotalHoursOT'];
if (isset($o['TotalGrossPay'])) $this->TotalGrossPay = $o['TotalGrossPay'];
if (isset($o['FlaggedCount'])) $this->FlaggedCount = $o['FlaggedCount'];
if (isset($o['SubmittedBy'])) $this->SubmittedBy = $o['SubmittedBy'];
if (isset($o['SubmittedAt'])) $this->SubmittedAt = JsonConverters::from('DateTime', $o['SubmittedAt']);
if (isset($o['CreatedBy'])) $this->CreatedBy = $o['CreatedBy'];
if (isset($o['CreatedAt'])) $this->CreatedAt = JsonConverters::from('DateTime', $o['CreatedAt']);
if (isset($o['UpdatedAt'])) $this->UpdatedAt = JsonConverters::from('DateTime', $o['UpdatedAt']);
if (isset($o['Lines'])) $this->Lines = JsonConverters::fromArray('CertifiedPayrollLine', $o['Lines']);
if (isset($o['DeterminationNo'])) $this->DeterminationNo = $o['DeterminationNo'];
if (isset($o['DeterminationType'])) $this->DeterminationType = $o['DeterminationType'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CertifiedPayrollID)) $o['CertifiedPayrollID'] = $this->CertifiedPayrollID;
if (isset($this->CertifiedPayrollUID)) $o['CertifiedPayrollUID'] = $this->CertifiedPayrollUID;
if (isset($this->ProjectID)) $o['ProjectID'] = $this->ProjectID;
if (isset($this->PayrollNumber)) $o['PayrollNumber'] = $this->PayrollNumber;
if (isset($this->WeekEnding)) $o['WeekEnding'] = JsonConverters::to('DateTime', $this->WeekEnding);
if (isset($this->Status)) $o['Status'] = $this->Status;
if (isset($this->DbeParticipationPct)) $o['DbeParticipationPct'] = $this->DbeParticipationPct;
if (isset($this->DbeGoalPct)) $o['DbeGoalPct'] = $this->DbeGoalPct;
if (isset($this->OjtApprenticeHours)) $o['OjtApprenticeHours'] = $this->OjtApprenticeHours;
if (isset($this->OjtApprenticeGoalHours)) $o['OjtApprenticeGoalHours'] = $this->OjtApprenticeGoalHours;
if (isset($this->WorkerCount)) $o['WorkerCount'] = $this->WorkerCount;
if (isset($this->TotalHoursST)) $o['TotalHoursST'] = $this->TotalHoursST;
if (isset($this->TotalHoursOT)) $o['TotalHoursOT'] = $this->TotalHoursOT;
if (isset($this->TotalGrossPay)) $o['TotalGrossPay'] = $this->TotalGrossPay;
if (isset($this->FlaggedCount)) $o['FlaggedCount'] = $this->FlaggedCount;
if (isset($this->SubmittedBy)) $o['SubmittedBy'] = $this->SubmittedBy;
if (isset($this->SubmittedAt)) $o['SubmittedAt'] = JsonConverters::to('DateTime', $this->SubmittedAt);
if (isset($this->CreatedBy)) $o['CreatedBy'] = $this->CreatedBy;
if (isset($this->CreatedAt)) $o['CreatedAt'] = JsonConverters::to('DateTime', $this->CreatedAt);
if (isset($this->UpdatedAt)) $o['UpdatedAt'] = JsonConverters::to('DateTime', $this->UpdatedAt);
if (isset($this->Lines)) $o['Lines'] = JsonConverters::toArray('CertifiedPayrollLine', $this->Lines);
if (isset($this->DeterminationNo)) $o['DeterminationNo'] = $this->DeterminationNo;
if (isset($this->DeterminationType)) $o['DeterminationType'] = $this->DeterminationType;
return empty($o) ? new class(){} : $o;
}
}
class CertifiedPayrollResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var CertifiedPayroll|null */
public ?CertifiedPayroll $Payroll=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['Payroll'])) $this->Payroll = JsonConverters::from('CertifiedPayroll', $o['Payroll']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->Payroll)) $o['Payroll'] = JsonConverters::to('CertifiedPayroll', $this->Payroll);
return empty($o) ? new class(){} : $o;
}
}
class CertifiedPayrollSubmitRequest implements JsonSerializable
{
public function __construct(
/** @var int */
public int $ProjectID=0,
/** @var string|null */
public ?string $Week=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ProjectID'])) $this->ProjectID = $o['ProjectID'];
if (isset($o['Week'])) $this->Week = $o['Week'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ProjectID)) $o['ProjectID'] = $this->ProjectID;
if (isset($this->Week)) $o['Week'] = $this->Week;
return empty($o) ? new class(){} : $o;
}
}
PHP CertifiedPayrollSubmitRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
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: text/csv
Content-Type: text/csv
Content-Length: length
{"ProjectID":0,"Week":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Payroll":{"CertifiedPayrollID":0,"CertifiedPayrollUID":"00000000000000000000000000000000","ProjectID":0,"PayrollNumber":0,"WeekEnding":"0001-01-01T00:00:00.0000000","Status":"String","DbeParticipationPct":0,"DbeGoalPct":0,"OjtApprenticeHours":0,"OjtApprenticeGoalHours":0,"WorkerCount":0,"TotalHoursST":0,"TotalHoursOT":0,"TotalGrossPay":0,"FlaggedCount":0,"SubmittedBy":"String","SubmittedAt":"0001-01-01T00:00:00.0000000","CreatedBy":"String","CreatedAt":"0001-01-01T00:00:00.0000000","UpdatedAt":"0001-01-01T00:00:00.0000000","Lines":[{"CertifiedPayrollLineID":0,"CertifiedPayrollID":0,"WorkerName":"String","ContactID":0,"Classification":"String","HoursST":0,"HoursOT":0,"BaseRate":0,"FringeRate":0,"FringeCashRate":0,"FringePlanRate":0,"GrossPay":0,"Flagged":false,"RestitutionAmount":0,"RestitutionNote":"String","RequiredBase":0,"RequiredFringe":0,"SortOrder":0}],"DeterminationNo":"String","DeterminationType":"String"}}