| GET | /stock/{brand}/transferRequest | Get Transfer Requests | Get a list of Transfer Requests related to given POSes |
|---|
<?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 TransferRequest implements JsonSerializable
{
public function __construct(
/** @description Transfer Request ID, e.g. 1234567 */
// @ApiMember(Description="Transfer Request ID, e.g. 1234567", IsRequired=true)
/** @var int */
public int $transferRequestId=0,
/** @description Transfer Request Status: 'PEN', 'ACC', 'ERR', 'INP', 'COM', 'REJ', 'CAN' */
// @ApiMember(Description="Transfer Request Status: 'PEN', 'ACC', 'ERR', 'INP', 'COM', 'REJ', 'CAN'", IsRequired=true)
/** @var string */
public string $status='',
/** @description Transfer Request creation date e.g. 2022-01-01 */
// @ApiMember(Description="Transfer Request creation date e.g. 2022-01-01", IsRequired=true)
/** @var string */
public string $createdDate='',
/** @description Transfer Request created user */
// @ApiMember(Description="Transfer Request created user", IsRequired=true)
/** @var string */
public string $createdBy='',
/** @description POS Code of the transfer Source POS, e.g. ES100:102048 */
// @ApiMember(Description="POS Code of the transfer Source POS, e.g. ES100:102048", IsRequired=true)
/** @var string */
public string $posCodeFrom='',
/** @description POS Code of the transfer Target POS, e.g. ES100:101469 */
// @ApiMember(Description="POS Code of the transfer Target POS, e.g. ES100:101469", IsRequired=true)
/** @var string */
public string $posCodeTo='',
/** @description Legacy Article Code of the item to be transferred */
// @ApiMember(Description="Legacy Article Code of the item to be transferred", IsRequired=true)
/** @var string */
public string $articleCode='',
/** @description Serial Number of the Article to be transferred */
// @ApiMember(Description="Serial Number of the Article to be transferred")
/** @var string|null */
public ?string $serialNumber=null,
/** @description Notes */
// @ApiMember(Description="Notes")
/** @var string|null */
public ?string $notes=null,
/** @description Return Number of the Authroization form document / PDF if exists */
// @ApiMember(Description="Return Number of the Authroization form document / PDF if exists")
/** @var int|null */
public ?int $returnNumber=null,
/** @description Context of the Transfer request, can be either PUSH or PULL */
// @ApiMember(Description="Context of the Transfer request, can be either PUSH or PULL")
/** @var string|null */
public ?string $context=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['transferRequestId'])) $this->transferRequestId = $o['transferRequestId'];
if (isset($o['status'])) $this->status = $o['status'];
if (isset($o['createdDate'])) $this->createdDate = $o['createdDate'];
if (isset($o['createdBy'])) $this->createdBy = $o['createdBy'];
if (isset($o['posCodeFrom'])) $this->posCodeFrom = $o['posCodeFrom'];
if (isset($o['posCodeTo'])) $this->posCodeTo = $o['posCodeTo'];
if (isset($o['articleCode'])) $this->articleCode = $o['articleCode'];
if (isset($o['serialNumber'])) $this->serialNumber = $o['serialNumber'];
if (isset($o['notes'])) $this->notes = $o['notes'];
if (isset($o['returnNumber'])) $this->returnNumber = $o['returnNumber'];
if (isset($o['context'])) $this->context = $o['context'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->transferRequestId)) $o['transferRequestId'] = $this->transferRequestId;
if (isset($this->status)) $o['status'] = $this->status;
if (isset($this->createdDate)) $o['createdDate'] = $this->createdDate;
if (isset($this->createdBy)) $o['createdBy'] = $this->createdBy;
if (isset($this->posCodeFrom)) $o['posCodeFrom'] = $this->posCodeFrom;
if (isset($this->posCodeTo)) $o['posCodeTo'] = $this->posCodeTo;
if (isset($this->articleCode)) $o['articleCode'] = $this->articleCode;
if (isset($this->serialNumber)) $o['serialNumber'] = $this->serialNumber;
if (isset($this->notes)) $o['notes'] = $this->notes;
if (isset($this->returnNumber)) $o['returnNumber'] = $this->returnNumber;
if (isset($this->context)) $o['context'] = $this->context;
return empty($o) ? new class(){} : $o;
}
}
/**
* @template array of TransferRequest
*/
class GetTransferRequestResponse extends \ArrayObject implements JsonSerializable
{
public function __construct(TransferRequest ...$items) {
parent::__construct($items, \ArrayObject::STD_PROP_LIST);
}
/** @throws \Exception */
public function append($value): void {
if ($value instanceof TransferRequest)
parent::append($value);
else
throw new \Exception("Can only append a TransferRequest to " . __CLASS__);
}
/** @throws Exception */
public function fromMap($o): void {
foreach ($o as $item) {
$el = new TransferRequest();
$el->fromMap($item);
$this->append($el);
}
}
/** @throws Exception */
public function jsonSerialize(): array {
return parent::getArrayCopy();
}
}
class GetTransferRequest implements JsonSerializable
{
public function __construct(
/** @description Brand Trigram, e.g. CAR, IWC */
// @ApiMember(Description="Brand Trigram, e.g. CAR, IWC", IsRequired=true)
/** @var string */
public string $brand='',
/** @description List of POS Codes in interest, e.g. ES100:102048,ES100:101469 */
// @ApiMember(Description="List of POS Codes in interest, e.g. ES100:102048,ES100:101469", IsRequired=true)
/** @var array<string>|null */
public ?array $posCodes=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['brand'])) $this->brand = $o['brand'];
if (isset($o['posCodes'])) $this->posCodes = JsonConverters::fromArray('string', $o['posCodes']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->brand)) $o['brand'] = $this->brand;
if (isset($this->posCodes)) $o['posCodes'] = JsonConverters::toArray('string', $this->posCodes);
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /stock/{brand}/transferRequest HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: text/jsonl
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length []