Trendsic Platform Service

<back to all web services

CertifiedPayrollUpdateRequest

Requires Authentication
The following routes are available for this service:
PATCH,PUT,OPTIONS/v1/projects/{ProjectID}/certified-payroll/{Week}
<?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 CertifiedPayrollUpdateRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ProjectID=0,
        /** @var string|null */
        public ?string $Week=null,
        /** @var float|null */
        public ?float $DbeParticipationPct=null,
        /** @var float|null */
        public ?float $DbeGoalPct=null,
        /** @var float|null */
        public ?float $OjtApprenticeHours=null,
        /** @var float|null */
        public ?float $OjtApprenticeGoalHours=null,
        /** @var array<CertifiedPayrollLine>|null */
        public ?array $Lines=null,
        /** @var bool|null */
        public ?bool $SeedFromTime=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ProjectID'])) $this->ProjectID = $o['ProjectID'];
        if (isset($o['Week'])) $this->Week = $o['Week'];
        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['Lines'])) $this->Lines = JsonConverters::fromArray('CertifiedPayrollLine', $o['Lines']);
        if (isset($o['SeedFromTime'])) $this->SeedFromTime = $o['SeedFromTime'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ProjectID)) $o['ProjectID'] = $this->ProjectID;
        if (isset($this->Week)) $o['Week'] = $this->Week;
        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->Lines)) $o['Lines'] = JsonConverters::toArray('CertifiedPayrollLine', $this->Lines);
        if (isset($this->SeedFromTime)) $o['SeedFromTime'] = $this->SeedFromTime;
        return empty($o) ? new class(){} : $o;
    }
}

PHP CertifiedPayrollUpdateRequest 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.

PUT /v1/projects/{ProjectID}/certified-payroll/{Week} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<CertifiedPayrollUpdateRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <DbeGoalPct>0</DbeGoalPct>
  <DbeParticipationPct>0</DbeParticipationPct>
  <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>
  <ProjectID>0</ProjectID>
  <SeedFromTime>false</SeedFromTime>
  <Week>String</Week>
</CertifiedPayrollUpdateRequest>
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>