| POST | /uplift/finalise |
|---|
<?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 ApiServiceRequest implements IServiceRequest, IHasApiKey, IHasDeviceInfo, JsonSerializable
{
public function __construct(
/** @description The API Key required for authentication */
// @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
/** @var string */
public string $apiKey='',
/** @description Latitude of the user making this request */
// @ApiMember(DataType="double", Description="Latitude of the user making this request")
/** @var float */
public float $latitude=0.0,
/** @description Longitude of the user making this request */
// @ApiMember(DataType="double", Description="Longitude of the user making this request")
/** @var float */
public float $longitude=0.0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['apiKey'])) $this->apiKey = $o['apiKey'];
if (isset($o['latitude'])) $this->latitude = $o['latitude'];
if (isset($o['longitude'])) $this->longitude = $o['longitude'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->apiKey)) $o['apiKey'] = $this->apiKey;
if (isset($this->latitude)) $o['latitude'] = $this->latitude;
if (isset($this->longitude)) $o['longitude'] = $this->longitude;
return empty($o) ? new class(){} : $o;
}
}
class ApiServiceResponse implements IServiceResponse, JsonSerializable
{
public function __construct(
/** @description Information about the response. */
// @ApiMember(Description="Information about the response.", IsRequired=true)
/** @var string */
public string $description='',
/** @description Heading or summary of the response. */
// @ApiMember(Description="Heading or summary of the response.", IsRequired=true)
/** @var string */
public string $heading='',
/** @description Did the intended operation for this response complete successfully? */
// @ApiMember(DataType="boolean", Description="Did the intended operation for this response complete successfully?", IsRequired=true)
/** @var bool|null */
public ?bool $wasSuccessful=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $responseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['description'])) $this->description = $o['description'];
if (isset($o['heading'])) $this->heading = $o['heading'];
if (isset($o['wasSuccessful'])) $this->wasSuccessful = $o['wasSuccessful'];
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->description)) $o['description'] = $this->description;
if (isset($this->heading)) $o['heading'] = $this->heading;
if (isset($this->wasSuccessful)) $o['wasSuccessful'] = $this->wasSuccessful;
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
return empty($o) ? new class(){} : $o;
}
}
class UpliftProductData implements JsonSerializable
{
public function __construct(
/** @var int */
public int $upliftProductId=0,
/** @var int */
public int $upliftId=0,
/** @var int */
public int $productId=0,
/** @var float */
public float $unitPrice=0.0,
/** @var string|null */
public ?string $name=null,
/** @var string|null */
public ?string $category=null,
/** @var string|null */
public ?string $unitBarcode=null,
/** @var string|null */
public ?string $unitSize=null,
/** @var float */
public float $unitWeight=0.0,
/** @var string|null */
public ?string $code=null,
/** @var array<Object>|null */
public ?array $upliftImages=null,
/** @var float */
public float $quantity=0.0,
/** @var float */
public float $value=0.0,
/** @var bool|null */
public ?bool $priceOverMax=null,
/** @var bool|null */
public ?bool $quantityOverMax=null,
/** @var bool|null */
public ?bool $quantityOverRequirement=null,
/** @var string|null */
public ?string $serialNumber=null,
/** @var string|null */
public ?string $batchCode=null,
/** @var int */
public int $stockStatusId=0,
/** @var string|null */
public ?string $lotNumber=null,
/** @var string|null */
public ?string $expiryDate=null,
/** @var string|null */
public ?string $manufactureDate=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['upliftProductId'])) $this->upliftProductId = $o['upliftProductId'];
if (isset($o['upliftId'])) $this->upliftId = $o['upliftId'];
if (isset($o['productId'])) $this->productId = $o['productId'];
if (isset($o['unitPrice'])) $this->unitPrice = $o['unitPrice'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['category'])) $this->category = $o['category'];
if (isset($o['unitBarcode'])) $this->unitBarcode = $o['unitBarcode'];
if (isset($o['unitSize'])) $this->unitSize = $o['unitSize'];
if (isset($o['unitWeight'])) $this->unitWeight = $o['unitWeight'];
if (isset($o['code'])) $this->code = $o['code'];
if (isset($o['upliftImages'])) $this->upliftImages = JsonConverters::fromArray('Object', $o['upliftImages']);
if (isset($o['quantity'])) $this->quantity = $o['quantity'];
if (isset($o['value'])) $this->value = $o['value'];
if (isset($o['priceOverMax'])) $this->priceOverMax = $o['priceOverMax'];
if (isset($o['quantityOverMax'])) $this->quantityOverMax = $o['quantityOverMax'];
if (isset($o['quantityOverRequirement'])) $this->quantityOverRequirement = $o['quantityOverRequirement'];
if (isset($o['serialNumber'])) $this->serialNumber = $o['serialNumber'];
if (isset($o['batchCode'])) $this->batchCode = $o['batchCode'];
if (isset($o['stockStatusId'])) $this->stockStatusId = $o['stockStatusId'];
if (isset($o['lotNumber'])) $this->lotNumber = $o['lotNumber'];
if (isset($o['expiryDate'])) $this->expiryDate = $o['expiryDate'];
if (isset($o['manufactureDate'])) $this->manufactureDate = $o['manufactureDate'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->upliftProductId)) $o['upliftProductId'] = $this->upliftProductId;
if (isset($this->upliftId)) $o['upliftId'] = $this->upliftId;
if (isset($this->productId)) $o['productId'] = $this->productId;
if (isset($this->unitPrice)) $o['unitPrice'] = $this->unitPrice;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->category)) $o['category'] = $this->category;
if (isset($this->unitBarcode)) $o['unitBarcode'] = $this->unitBarcode;
if (isset($this->unitSize)) $o['unitSize'] = $this->unitSize;
if (isset($this->unitWeight)) $o['unitWeight'] = $this->unitWeight;
if (isset($this->code)) $o['code'] = $this->code;
if (isset($this->upliftImages)) $o['upliftImages'] = JsonConverters::toArray('Object', $this->upliftImages);
if (isset($this->quantity)) $o['quantity'] = $this->quantity;
if (isset($this->value)) $o['value'] = $this->value;
if (isset($this->priceOverMax)) $o['priceOverMax'] = $this->priceOverMax;
if (isset($this->quantityOverMax)) $o['quantityOverMax'] = $this->quantityOverMax;
if (isset($this->quantityOverRequirement)) $o['quantityOverRequirement'] = $this->quantityOverRequirement;
if (isset($this->serialNumber)) $o['serialNumber'] = $this->serialNumber;
if (isset($this->batchCode)) $o['batchCode'] = $this->batchCode;
if (isset($this->stockStatusId)) $o['stockStatusId'] = $this->stockStatusId;
if (isset($this->lotNumber)) $o['lotNumber'] = $this->lotNumber;
if (isset($this->expiryDate)) $o['expiryDate'] = $this->expiryDate;
if (isset($this->manufactureDate)) $o['manufactureDate'] = $this->manufactureDate;
return empty($o) ? new class(){} : $o;
}
}
class UpliftSealData implements JsonSerializable
{
public function __construct(
/** @var bool|null */
public ?bool $unbagged=null,
/** @var string|null */
public ?string $sealNumber=null,
/** @var string|null */
public ?string $antelSealNumber=null,
/** @var array<UpliftProductData>|null */
public ?array $products=null,
/** @var float */
public float $totalPrice=0.0,
/** @var float */
public float $totalQuantity=0.0,
/** @var float */
public float $netWeight=0.0,
/** @var float */
public float $grossWeight=0.0,
/** @var bool|null */
public ?bool $billableSeal=null,
/** @var bool|null */
public ?bool $invalidAntelSealNumber=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['unbagged'])) $this->unbagged = $o['unbagged'];
if (isset($o['sealNumber'])) $this->sealNumber = $o['sealNumber'];
if (isset($o['antelSealNumber'])) $this->antelSealNumber = $o['antelSealNumber'];
if (isset($o['products'])) $this->products = JsonConverters::fromArray('UpliftProductData', $o['products']);
if (isset($o['totalPrice'])) $this->totalPrice = $o['totalPrice'];
if (isset($o['totalQuantity'])) $this->totalQuantity = $o['totalQuantity'];
if (isset($o['netWeight'])) $this->netWeight = $o['netWeight'];
if (isset($o['grossWeight'])) $this->grossWeight = $o['grossWeight'];
if (isset($o['billableSeal'])) $this->billableSeal = $o['billableSeal'];
if (isset($o['invalidAntelSealNumber'])) $this->invalidAntelSealNumber = $o['invalidAntelSealNumber'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->unbagged)) $o['unbagged'] = $this->unbagged;
if (isset($this->sealNumber)) $o['sealNumber'] = $this->sealNumber;
if (isset($this->antelSealNumber)) $o['antelSealNumber'] = $this->antelSealNumber;
if (isset($this->products)) $o['products'] = JsonConverters::toArray('UpliftProductData', $this->products);
if (isset($this->totalPrice)) $o['totalPrice'] = $this->totalPrice;
if (isset($this->totalQuantity)) $o['totalQuantity'] = $this->totalQuantity;
if (isset($this->netWeight)) $o['netWeight'] = $this->netWeight;
if (isset($this->grossWeight)) $o['grossWeight'] = $this->grossWeight;
if (isset($this->billableSeal)) $o['billableSeal'] = $this->billableSeal;
if (isset($this->invalidAntelSealNumber)) $o['invalidAntelSealNumber'] = $this->invalidAntelSealNumber;
return empty($o) ? new class(){} : $o;
}
}
class UpliftClaimData implements JsonSerializable
{
public function __construct(
/** @var int */
public int $upliftClaimId=0,
/** @var int */
public int $claimUnits=0,
/** @var string|null */
public ?string $claimNumber=null,
/** @var float */
public float $claimValue=0.0,
/** @var array<Object>|null */
public ?array $claimDocumentImages=null,
/** @var string|null */
public ?string $returnOrderNumber=null,
/** @var int */
public int $lineCount=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['upliftClaimId'])) $this->upliftClaimId = $o['upliftClaimId'];
if (isset($o['claimUnits'])) $this->claimUnits = $o['claimUnits'];
if (isset($o['claimNumber'])) $this->claimNumber = $o['claimNumber'];
if (isset($o['claimValue'])) $this->claimValue = $o['claimValue'];
if (isset($o['claimDocumentImages'])) $this->claimDocumentImages = JsonConverters::fromArray('Object', $o['claimDocumentImages']);
if (isset($o['returnOrderNumber'])) $this->returnOrderNumber = $o['returnOrderNumber'];
if (isset($o['lineCount'])) $this->lineCount = $o['lineCount'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->upliftClaimId)) $o['upliftClaimId'] = $this->upliftClaimId;
if (isset($this->claimUnits)) $o['claimUnits'] = $this->claimUnits;
if (isset($this->claimNumber)) $o['claimNumber'] = $this->claimNumber;
if (isset($this->claimValue)) $o['claimValue'] = $this->claimValue;
if (isset($this->claimDocumentImages)) $o['claimDocumentImages'] = JsonConverters::toArray('Object', $this->claimDocumentImages);
if (isset($this->returnOrderNumber)) $o['returnOrderNumber'] = $this->returnOrderNumber;
if (isset($this->lineCount)) $o['lineCount'] = $this->lineCount;
return empty($o) ? new class(){} : $o;
}
}
class SaveUpliftResponse extends ApiServiceResponse implements JsonSerializable
{
/**
* @param string $description
* @param string $heading
* @param bool|null $wasSuccessful
* @param ResponseStatus|null $responseStatus
*/
public function __construct(
string $description='',
string $heading='',
?bool $wasSuccessful=null,
?ResponseStatus $responseStatus=null,
/** @var int */
public int $upliftId=0,
/** @var string */
public string $upliftAuthRequestId='',
/** @var array<UpliftSealData>|null */
public ?array $seals=null,
/** @var UpliftSealData|null */
public ?UpliftSealData $unbaggedItems=null,
/** @var array<UpliftClaimData>|null */
public ?array $claims=null,
/** @var bool|null */
public ?bool $deleteFromDevice=null,
/** @var array<string>|null */
public ?array $imageIds=null,
/** @var bool|null */
public ?bool $invalidAntelSeal=null
) {
parent::__construct($description,$heading,$wasSuccessful,$responseStatus);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['upliftId'])) $this->upliftId = $o['upliftId'];
if (isset($o['upliftAuthRequestId'])) $this->upliftAuthRequestId = $o['upliftAuthRequestId'];
if (isset($o['seals'])) $this->seals = JsonConverters::fromArray('UpliftSealData', $o['seals']);
if (isset($o['unbaggedItems'])) $this->unbaggedItems = JsonConverters::from('UpliftSealData', $o['unbaggedItems']);
if (isset($o['claims'])) $this->claims = JsonConverters::fromArray('UpliftClaimData', $o['claims']);
if (isset($o['deleteFromDevice'])) $this->deleteFromDevice = $o['deleteFromDevice'];
if (isset($o['imageIds'])) $this->imageIds = JsonConverters::fromArray('string', $o['imageIds']);
if (isset($o['invalidAntelSeal'])) $this->invalidAntelSeal = $o['invalidAntelSeal'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->upliftId)) $o['upliftId'] = $this->upliftId;
if (isset($this->upliftAuthRequestId)) $o['upliftAuthRequestId'] = $this->upliftAuthRequestId;
if (isset($this->seals)) $o['seals'] = JsonConverters::toArray('UpliftSealData', $this->seals);
if (isset($this->unbaggedItems)) $o['unbaggedItems'] = JsonConverters::to('UpliftSealData', $this->unbaggedItems);
if (isset($this->claims)) $o['claims'] = JsonConverters::toArray('UpliftClaimData', $this->claims);
if (isset($this->deleteFromDevice)) $o['deleteFromDevice'] = $this->deleteFromDevice;
if (isset($this->imageIds)) $o['imageIds'] = JsonConverters::toArray('string', $this->imageIds);
if (isset($this->invalidAntelSeal)) $o['invalidAntelSeal'] = $this->invalidAntelSeal;
return empty($o) ? new class(){} : $o;
}
}
class FinaliseUplift extends ApiServiceRequest implements JsonSerializable
{
/**
* @param string $apiKey
* @param float $latitude
* @param float $longitude
*/
public function __construct(
string $apiKey='',
float $latitude=0.0,
float $longitude=0.0,
/** @var int */
public int $upliftId=0,
/** @var string */
public string $incompleteUpliftId=''
) {
parent::__construct($apiKey,$latitude,$longitude);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['upliftId'])) $this->upliftId = $o['upliftId'];
if (isset($o['incompleteUpliftId'])) $this->incompleteUpliftId = $o['incompleteUpliftId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->upliftId)) $o['upliftId'] = $this->upliftId;
if (isset($this->incompleteUpliftId)) $o['incompleteUpliftId'] = $this->incompleteUpliftId;
return empty($o) ? new class(){} : $o;
}
}
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 /uplift/finalise HTTP/1.1
Host: antel.api.dev.86degrees.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
upliftId: 0,
apiKey: String,
latitude: 0,
longitude: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
upliftId: 0,
seals:
[
{
unbagged: False,
sealNumber: String,
antelSealNumber: String,
products:
[
{
upliftProductId: 0,
upliftId: 0,
productId: 0,
unitPrice: 0,
name: String,
category: String,
unitBarcode: String,
unitSize: String,
unitWeight: 0,
code: String,
upliftImages:
[
{
}
],
quantity: 0,
value: 0,
priceOverMax: False,
quantityOverMax: False,
quantityOverRequirement: False,
serialNumber: String,
batchCode: String,
stockStatusId: 0,
lotNumber: String,
expiryDate: String,
manufactureDate: String
}
],
totalPrice: 0,
totalQuantity: 0,
netWeight: 0,
grossWeight: 0,
billableSeal: False,
invalidAntelSealNumber: False
}
],
unbaggedItems:
{
unbagged: False,
sealNumber: String,
antelSealNumber: String,
products:
[
{
upliftProductId: 0,
upliftId: 0,
productId: 0,
unitPrice: 0,
name: String,
category: String,
unitBarcode: String,
unitSize: String,
unitWeight: 0,
code: String,
upliftImages:
[
{
}
],
quantity: 0,
value: 0,
priceOverMax: False,
quantityOverMax: False,
quantityOverRequirement: False,
serialNumber: String,
batchCode: String,
stockStatusId: 0,
lotNumber: String,
expiryDate: String,
manufactureDate: String
}
],
totalPrice: 0,
totalQuantity: 0,
netWeight: 0,
grossWeight: 0,
billableSeal: False,
invalidAntelSealNumber: False
},
claims:
[
{
upliftClaimId: 0,
claimUnits: 0,
claimNumber: String,
claimValue: 0,
claimDocumentImages:
[
{
}
],
returnOrderNumber: String,
lineCount: 0
}
],
deleteFromDevice: False,
imageIds:
[
String
],
invalidAntelSeal: False,
description: String,
heading: String,
wasSuccessful: False,
responseStatus:
{
errorCode: String,
message: String,
stackTrace: String,
errors:
[
{
errorCode: String,
fieldName: String,
message: String,
meta:
{
String: String
}
}
],
meta:
{
String: String
}
}
}