| All Verbs | /ValidateDispatchReturnsItem |
|---|
<?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 StockAdditional implements JsonSerializable
{
public function __construct(
/** @var int */
public int $StockID=0,
/** @var string */
public string $Gtin='',
/** @var string */
public string $StockLocation='',
/** @var float */
public float $PhysicalQuantityStockLocation=0.0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['StockID'])) $this->StockID = $o['StockID'];
if (isset($o['Gtin'])) $this->Gtin = $o['Gtin'];
if (isset($o['StockLocation'])) $this->StockLocation = $o['StockLocation'];
if (isset($o['PhysicalQuantityStockLocation'])) $this->PhysicalQuantityStockLocation = $o['PhysicalQuantityStockLocation'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->StockID)) $o['StockID'] = $this->StockID;
if (isset($this->Gtin)) $o['Gtin'] = $this->Gtin;
if (isset($this->StockLocation)) $o['StockLocation'] = $this->StockLocation;
if (isset($this->PhysicalQuantityStockLocation)) $o['PhysicalQuantityStockLocation'] = $this->PhysicalQuantityStockLocation;
return empty($o) ? new class(){} : $o;
}
}
class Stock implements JsonSerializable
{
public function __construct(
/** @var int */
public int $StockID=0,
/** @var string */
public string $ProductID='',
/** @var string */
public string $ProductAttributeID='',
/** @var string */
public string $Reference='',
/** @var string */
public string $Gtin='',
/** @var string */
public string $GtinAttribute='',
/** @var string */
public string $Label='',
/** @var string */
public string $StockLocation='',
/** @var float */
public float $PhysicalQuantityStockLocation=0.0,
/** @var string */
public string $ReserveStockLocation='',
/** @var float */
public float $PhysicalQuantityReserveStockLocation=0.0,
/** @var int|null */
public ?int $NbSKUInPackage=null,
/** @var string */
public string $PackageReference='',
/** @var int|null */
public ?int $NbSKUInPackage2=null,
/** @var string */
public string $PackageReference2='',
/** @var string */
public string $Weight='',
/** @var bool|null */
public ?bool $FillInBatchNumber=null,
/** @var bool|null */
public ?bool $FillInDate=null,
/** @var string */
public string $PictureURL='',
/** @var array<StockAdditional>|null */
public ?array $StockAdditionals=null,
/** @var string */
public string $SearchKey=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['StockID'])) $this->StockID = $o['StockID'];
if (isset($o['ProductID'])) $this->ProductID = $o['ProductID'];
if (isset($o['ProductAttributeID'])) $this->ProductAttributeID = $o['ProductAttributeID'];
if (isset($o['Reference'])) $this->Reference = $o['Reference'];
if (isset($o['Gtin'])) $this->Gtin = $o['Gtin'];
if (isset($o['GtinAttribute'])) $this->GtinAttribute = $o['GtinAttribute'];
if (isset($o['Label'])) $this->Label = $o['Label'];
if (isset($o['StockLocation'])) $this->StockLocation = $o['StockLocation'];
if (isset($o['PhysicalQuantityStockLocation'])) $this->PhysicalQuantityStockLocation = $o['PhysicalQuantityStockLocation'];
if (isset($o['ReserveStockLocation'])) $this->ReserveStockLocation = $o['ReserveStockLocation'];
if (isset($o['PhysicalQuantityReserveStockLocation'])) $this->PhysicalQuantityReserveStockLocation = $o['PhysicalQuantityReserveStockLocation'];
if (isset($o['NbSKUInPackage'])) $this->NbSKUInPackage = $o['NbSKUInPackage'];
if (isset($o['PackageReference'])) $this->PackageReference = $o['PackageReference'];
if (isset($o['NbSKUInPackage2'])) $this->NbSKUInPackage2 = $o['NbSKUInPackage2'];
if (isset($o['PackageReference2'])) $this->PackageReference2 = $o['PackageReference2'];
if (isset($o['Weight'])) $this->Weight = $o['Weight'];
if (isset($o['FillInBatchNumber'])) $this->FillInBatchNumber = $o['FillInBatchNumber'];
if (isset($o['FillInDate'])) $this->FillInDate = $o['FillInDate'];
if (isset($o['PictureURL'])) $this->PictureURL = $o['PictureURL'];
if (isset($o['StockAdditionals'])) $this->StockAdditionals = JsonConverters::fromArray('StockAdditional', $o['StockAdditionals']);
if (isset($o['SearchKey'])) $this->SearchKey = $o['SearchKey'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->StockID)) $o['StockID'] = $this->StockID;
if (isset($this->ProductID)) $o['ProductID'] = $this->ProductID;
if (isset($this->ProductAttributeID)) $o['ProductAttributeID'] = $this->ProductAttributeID;
if (isset($this->Reference)) $o['Reference'] = $this->Reference;
if (isset($this->Gtin)) $o['Gtin'] = $this->Gtin;
if (isset($this->GtinAttribute)) $o['GtinAttribute'] = $this->GtinAttribute;
if (isset($this->Label)) $o['Label'] = $this->Label;
if (isset($this->StockLocation)) $o['StockLocation'] = $this->StockLocation;
if (isset($this->PhysicalQuantityStockLocation)) $o['PhysicalQuantityStockLocation'] = $this->PhysicalQuantityStockLocation;
if (isset($this->ReserveStockLocation)) $o['ReserveStockLocation'] = $this->ReserveStockLocation;
if (isset($this->PhysicalQuantityReserveStockLocation)) $o['PhysicalQuantityReserveStockLocation'] = $this->PhysicalQuantityReserveStockLocation;
if (isset($this->NbSKUInPackage)) $o['NbSKUInPackage'] = $this->NbSKUInPackage;
if (isset($this->PackageReference)) $o['PackageReference'] = $this->PackageReference;
if (isset($this->NbSKUInPackage2)) $o['NbSKUInPackage2'] = $this->NbSKUInPackage2;
if (isset($this->PackageReference2)) $o['PackageReference2'] = $this->PackageReference2;
if (isset($this->Weight)) $o['Weight'] = $this->Weight;
if (isset($this->FillInBatchNumber)) $o['FillInBatchNumber'] = $this->FillInBatchNumber;
if (isset($this->FillInDate)) $o['FillInDate'] = $this->FillInDate;
if (isset($this->PictureURL)) $o['PictureURL'] = $this->PictureURL;
if (isset($this->StockAdditionals)) $o['StockAdditionals'] = JsonConverters::toArray('StockAdditional', $this->StockAdditionals);
if (isset($this->SearchKey)) $o['SearchKey'] = $this->SearchKey;
return empty($o) ? new class(){} : $o;
}
}
enum ReturnRackPositionStatus : string
{
case EMPTY = 'EMPTY';
case USED = 'USED';
case FULL = 'FULL';
}
class ReturnsDispatchingRackPosition implements JsonSerializable
{
public function __construct(
/** @var int */
public int $ID=0,
/** @var int */
public int $ReturnsDispersionRackID=0,
/** @var string */
public string $Name='',
/** @var string */
public string $EAN='',
/** @var string */
public string $BatchNumber='',
/** @var DateTime|null */
public ?DateTime $ItemDate=null,
/** @var int */
public int $Quantity=0,
/** @var ReturnRackPositionStatus|null */
public ?ReturnRackPositionStatus $Status=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ID'])) $this->ID = $o['ID'];
if (isset($o['ReturnsDispersionRackID'])) $this->ReturnsDispersionRackID = $o['ReturnsDispersionRackID'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['EAN'])) $this->EAN = $o['EAN'];
if (isset($o['BatchNumber'])) $this->BatchNumber = $o['BatchNumber'];
if (isset($o['ItemDate'])) $this->ItemDate = JsonConverters::from('DateTime', $o['ItemDate']);
if (isset($o['Quantity'])) $this->Quantity = $o['Quantity'];
if (isset($o['Status'])) $this->Status = JsonConverters::from('ReturnRackPositionStatus', $o['Status']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ID)) $o['ID'] = $this->ID;
if (isset($this->ReturnsDispersionRackID)) $o['ReturnsDispersionRackID'] = $this->ReturnsDispersionRackID;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->EAN)) $o['EAN'] = $this->EAN;
if (isset($this->BatchNumber)) $o['BatchNumber'] = $this->BatchNumber;
if (isset($this->ItemDate)) $o['ItemDate'] = JsonConverters::to('DateTime', $this->ItemDate);
if (isset($this->Quantity)) $o['Quantity'] = $this->Quantity;
if (isset($this->Status)) $o['Status'] = JsonConverters::to('ReturnRackPositionStatus', $this->Status);
return empty($o) ? new class(){} : $o;
}
}
class ReturnsResultInfo implements JsonSerializable
{
public function __construct(
/** @var string */
public string $Result='',
/** @var string */
public string $Error='',
/** @var Stock|null */
public ?Stock $Stock=null,
/** @var ReturnsDispatchingRackPosition|null */
public ?ReturnsDispatchingRackPosition $RackPosition=null,
/** @var int */
public int $RackID=0,
/** @var string */
public string $EAN='',
/** @var string */
public string $BatchNumber='',
/** @var DateTime|null */
public ?DateTime $ItemDate=null,
/** @var array<string>|null */
public ?array $SpecificCaseToBeTreated=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Result'])) $this->Result = $o['Result'];
if (isset($o['Error'])) $this->Error = $o['Error'];
if (isset($o['Stock'])) $this->Stock = JsonConverters::from('Stock', $o['Stock']);
if (isset($o['RackPosition'])) $this->RackPosition = JsonConverters::from('ReturnsDispatchingRackPosition', $o['RackPosition']);
if (isset($o['RackID'])) $this->RackID = $o['RackID'];
if (isset($o['EAN'])) $this->EAN = $o['EAN'];
if (isset($o['BatchNumber'])) $this->BatchNumber = $o['BatchNumber'];
if (isset($o['ItemDate'])) $this->ItemDate = JsonConverters::from('DateTime', $o['ItemDate']);
if (isset($o['SpecificCaseToBeTreated'])) $this->SpecificCaseToBeTreated = JsonConverters::fromArray('string', $o['SpecificCaseToBeTreated']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Result)) $o['Result'] = $this->Result;
if (isset($this->Error)) $o['Error'] = $this->Error;
if (isset($this->Stock)) $o['Stock'] = JsonConverters::to('Stock', $this->Stock);
if (isset($this->RackPosition)) $o['RackPosition'] = JsonConverters::to('ReturnsDispatchingRackPosition', $this->RackPosition);
if (isset($this->RackID)) $o['RackID'] = $this->RackID;
if (isset($this->EAN)) $o['EAN'] = $this->EAN;
if (isset($this->BatchNumber)) $o['BatchNumber'] = $this->BatchNumber;
if (isset($this->ItemDate)) $o['ItemDate'] = JsonConverters::to('DateTime', $this->ItemDate);
if (isset($this->SpecificCaseToBeTreated)) $o['SpecificCaseToBeTreated'] = JsonConverters::toArray('string', $this->SpecificCaseToBeTreated);
return empty($o) ? new class(){} : $o;
}
}
class ValidateDispatchReturnsItem implements JsonSerializable
{
public function __construct(
/** @description Returns rack result */
// @ApiMember(Description="Returns rack result ", IsRequired=true)
/** @var ReturnsResultInfo|null */
public ?ReturnsResultInfo $ReturnsResult=null,
/** @description rack id */
// @ApiMember(Description="rack id", IsRequired=true)
/** @var int */
public int $RackID=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ReturnsResult'])) $this->ReturnsResult = JsonConverters::from('ReturnsResultInfo', $o['ReturnsResult']);
if (isset($o['RackID'])) $this->RackID = $o['RackID'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ReturnsResult)) $o['ReturnsResult'] = JsonConverters::to('ReturnsResultInfo', $this->ReturnsResult);
if (isset($this->RackID)) $o['RackID'] = $this->RackID;
return empty($o) ? new class(){} : $o;
}
}
PHP ValidateDispatchReturnsItem 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 /ValidateDispatchReturnsItem HTTP/1.1
Host: clouddemo.pickeos.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
ReturnsResult:
{
Result: String,
Error: String,
Stock:
{
StockID: 0,
ProductID: String,
ProductAttributeID: String,
Reference: String,
Gtin: String,
GtinAttribute: String,
Label: String,
StockLocation: String,
PhysicalQuantityStockLocation: 0,
ReserveStockLocation: String,
PhysicalQuantityReserveStockLocation: 0,
NbSKUInPackage: 0,
PackageReference: String,
NbSKUInPackage2: 0,
PackageReference2: String,
Weight: String,
FillInBatchNumber: False,
FillInDate: False,
PictureURL: String,
StockAdditionals:
[
{
StockID: 0,
Gtin: String,
StockLocation: String,
PhysicalQuantityStockLocation: 0
}
],
SearchKey: String-String-String-String-String
},
RackPosition:
{
ID: 0,
ReturnsDispersionRackID: 0,
Name: String,
EAN: String,
BatchNumber: String,
ItemDate: 0001-01-01,
Quantity: 0,
Status: EMPTY
},
RackID: 0,
EAN: String,
BatchNumber: String,
ItemDate: 0001-01-01,
SpecificCaseToBeTreated:
[
String
]
},
RackID: 0
}