| POST | /purchase/simulate/v2 | Simulate Order |
|---|
<?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 Quantity implements JsonSerializable
{
public function __construct(
/** @description Unit */
// @ApiMember(Description="Unit", IsRequired=true)
/** @var string */
public string $unit='',
/** @description Value */
// @ApiMember(Description="Value", IsRequired=true)
/** @var float */
public float $value=0.0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['unit'])) $this->unit = $o['unit'];
if (isset($o['value'])) $this->value = $o['value'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->unit)) $o['unit'] = $this->unit;
if (isset($this->value)) $o['value'] = $this->value;
return empty($o) ? new class(){} : $o;
}
}
class Amount implements JsonSerializable
{
public function __construct(
/** @description Value */
// @ApiMember(Description="Value", IsRequired=true)
/** @var float */
public float $value=0.0,
/** @description Currency */
// @ApiMember(Description="Currency", IsRequired=true)
/** @var string */
public string $currency=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['value'])) $this->value = $o['value'];
if (isset($o['currency'])) $this->currency = $o['currency'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->value)) $o['value'] = $this->value;
if (isset($this->currency)) $o['currency'] = $this->currency;
return empty($o) ? new class(){} : $o;
}
}
class AmountAndQuantity implements JsonSerializable
{
public function __construct(
/** @description Amount */
// @ApiMember(Description="Amount", IsRequired=true)
/** @var Amount|null */
public ?Amount $amount=null,
/** @description Base Quantity */
// @ApiMember(Description="Base Quantity", IsRequired=true)
/** @var Quantity|null */
public ?Quantity $baseQuantity=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['amount'])) $this->amount = JsonConverters::from('Amount', $o['amount']);
if (isset($o['baseQuantity'])) $this->baseQuantity = JsonConverters::from('Quantity', $o['baseQuantity']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->amount)) $o['amount'] = JsonConverters::to('Amount', $this->amount);
if (isset($this->baseQuantity)) $o['baseQuantity'] = JsonConverters::to('Quantity', $this->baseQuantity);
return empty($o) ? new class(){} : $o;
}
}
class ItemTotalValues implements JsonSerializable
{
public function __construct(
/** @description Requested Quantity */
// @ApiMember(Description="Requested Quantity")
/** @var Quantity|null */
public ?Quantity $requestedQuantity=null,
/** @description Confirmed Quantity */
// @ApiMember(Description="Confirmed Quantity")
/** @var Quantity|null */
public ?Quantity $confirmedQuantity=null,
/** @description Available Quantity */
// @ApiMember(Description="Available Quantity")
/** @var Quantity|null */
public ?Quantity $availableQuantity=null,
/** @description Gross Weight */
// @ApiMember(Description="Gross Weight")
/** @var Quantity|null */
public ?Quantity $grossWeightMeasure=null,
/** @description Net Weight */
// @ApiMember(Description="Net Weight")
/** @var Quantity|null */
public ?Quantity $netWeightMeasure=null,
/** @description Volume */
// @ApiMember(Description="Volume")
/** @var Quantity|null */
public ?Quantity $volumeMeasure=null,
/** @description Net Amount Line Total */
// @ApiMember(Description="Net Amount Line Total")
/** @var Amount|null */
public ?Amount $netAmount=null,
/** @description Net Price Line Total */
// @ApiMember(Description="Net Price Line Total")
/** @var AmountAndQuantity|null */
public ?AmountAndQuantity $netPrice=null,
/** @description Tax Amount Line Total */
// @ApiMember(Description="Tax Amount Line Total")
/** @var Amount|null */
public ?Amount $taxAmount=null,
/** @description Retail Sales Price Line Total */
// @ApiMember(Description="Retail Sales Price Line Total")
/** @var Amount|null */
public ?Amount $retailSalesPriceAmount=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['requestedQuantity'])) $this->requestedQuantity = JsonConverters::from('Quantity', $o['requestedQuantity']);
if (isset($o['confirmedQuantity'])) $this->confirmedQuantity = JsonConverters::from('Quantity', $o['confirmedQuantity']);
if (isset($o['availableQuantity'])) $this->availableQuantity = JsonConverters::from('Quantity', $o['availableQuantity']);
if (isset($o['grossWeightMeasure'])) $this->grossWeightMeasure = JsonConverters::from('Quantity', $o['grossWeightMeasure']);
if (isset($o['netWeightMeasure'])) $this->netWeightMeasure = JsonConverters::from('Quantity', $o['netWeightMeasure']);
if (isset($o['volumeMeasure'])) $this->volumeMeasure = JsonConverters::from('Quantity', $o['volumeMeasure']);
if (isset($o['netAmount'])) $this->netAmount = JsonConverters::from('Amount', $o['netAmount']);
if (isset($o['netPrice'])) $this->netPrice = JsonConverters::from('AmountAndQuantity', $o['netPrice']);
if (isset($o['taxAmount'])) $this->taxAmount = JsonConverters::from('Amount', $o['taxAmount']);
if (isset($o['retailSalesPriceAmount'])) $this->retailSalesPriceAmount = JsonConverters::from('Amount', $o['retailSalesPriceAmount']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->requestedQuantity)) $o['requestedQuantity'] = JsonConverters::to('Quantity', $this->requestedQuantity);
if (isset($this->confirmedQuantity)) $o['confirmedQuantity'] = JsonConverters::to('Quantity', $this->confirmedQuantity);
if (isset($this->availableQuantity)) $o['availableQuantity'] = JsonConverters::to('Quantity', $this->availableQuantity);
if (isset($this->grossWeightMeasure)) $o['grossWeightMeasure'] = JsonConverters::to('Quantity', $this->grossWeightMeasure);
if (isset($this->netWeightMeasure)) $o['netWeightMeasure'] = JsonConverters::to('Quantity', $this->netWeightMeasure);
if (isset($this->volumeMeasure)) $o['volumeMeasure'] = JsonConverters::to('Quantity', $this->volumeMeasure);
if (isset($this->netAmount)) $o['netAmount'] = JsonConverters::to('Amount', $this->netAmount);
if (isset($this->netPrice)) $o['netPrice'] = JsonConverters::to('AmountAndQuantity', $this->netPrice);
if (isset($this->taxAmount)) $o['taxAmount'] = JsonConverters::to('Amount', $this->taxAmount);
if (isset($this->retailSalesPriceAmount)) $o['retailSalesPriceAmount'] = JsonConverters::to('Amount', $this->retailSalesPriceAmount);
return empty($o) ? new class(){} : $o;
}
}
class Warning implements JsonSerializable
{
public function __construct(
/** @description Id */
// @ApiMember(Description="Id", IsRequired=true)
/** @var string */
public string $id='',
/** @description Message */
// @ApiMember(Description="Message", IsRequired=true)
/** @var string */
public string $message='',
/** @description Severity code, possible values: 1, 2, 3, 4 */
// @ApiMember(Description="Severity code, possible values: 1, 2, 3, 4", IsRequired=true)
/** @var int */
public int $severityCode=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['message'])) $this->message = $o['message'];
if (isset($o['severityCode'])) $this->severityCode = $o['severityCode'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->message)) $o['message'] = $this->message;
if (isset($this->severityCode)) $o['severityCode'] = $this->severityCode;
return empty($o) ? new class(){} : $o;
}
}
class SimulateOrderItemResponseV2 implements JsonSerializable
{
public function __construct(
/** @description Line Number, e.g 20, 40, 21, 41 */
// @ApiMember(Description="Line Number, e.g 20, 40, 21, 41", IsRequired=true)
/** @var int */
public int $lineNumber=0,
/** @description Parent Line Number, e.g 20, 40 */
// @ApiMember(Description="Parent Line Number, e.g 20, 40", IsRequired=true)
/** @var int */
public int $parentLineNumber=0,
/** @description Original line number in the request. Line numbers are remapped after the split */
// @ApiMember(Description="Original line number in the request. Line numbers are remapped after the split", IsRequired=true)
/** @var int */
public int $requestLineNumber=0,
/** @description Reference No of item, e.g.: CRWB521234 */
// @ApiMember(Description="Reference No of item, e.g.: CRWB521234", IsRequired=true)
/** @var string */
public string $articleCode='',
/** @description Substituted reference No of item, e.g.: CRWB520003 */
// @ApiMember(Description="Substituted reference No of item, e.g.: CRWB520003")
/** @var string|null */
public ?string $substitutedArticleCode=null,
/** @description DeliveryPlantId of item, e.g.: CHD6 */
// @ApiMember(Description="DeliveryPlantId of item, e.g.: CHD6", IsRequired=true)
/** @var string */
public string $deliveryPlantId='',
/** @description Expected Delivery Date, e.g. '2020-12-30' */
// @ApiMember(Description="Expected Delivery Date, e.g. '2020-12-30'")
/** @var string|null */
public ?string $expectedDeliveryDate=null,
/** @description Buckle Summary, need to be forwarded to order creation */
// @ApiMember(Description="Buckle Summary, need to be forwarded to order creation")
/** @var string|null */
public ?string $buckleSummary=null,
/** @description Material Summary, need to be forwarded to order creation */
// @ApiMember(Description="Material Summary, need to be forwarded to order creation")
/** @var string|null */
public ?string $materialSummary=null,
/** @description Content Summary, need to be forwarded to order creation */
// @ApiMember(Description="Content Summary, need to be forwarded to order creation")
/** @var string|null */
public ?string $contentSummary=null,
/** @description Strap Summary, need to be forwarded to order creation */
// @ApiMember(Description="Strap Summary, need to be forwarded to order creation")
/** @var string|null */
public ?string $strapSummary=null,
/** @description Item Total Values */
// @ApiMember(Description="Item Total Values", IsRequired=true)
/** @var ItemTotalValues|null */
public ?ItemTotalValues $totalValues=null,
/** @description Warning list */
// @ApiMember(Description="Warning list", IsRequired=true)
/** @var array<Warning>|null */
public ?array $warnings=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['lineNumber'])) $this->lineNumber = $o['lineNumber'];
if (isset($o['parentLineNumber'])) $this->parentLineNumber = $o['parentLineNumber'];
if (isset($o['requestLineNumber'])) $this->requestLineNumber = $o['requestLineNumber'];
if (isset($o['articleCode'])) $this->articleCode = $o['articleCode'];
if (isset($o['substitutedArticleCode'])) $this->substitutedArticleCode = $o['substitutedArticleCode'];
if (isset($o['deliveryPlantId'])) $this->deliveryPlantId = $o['deliveryPlantId'];
if (isset($o['expectedDeliveryDate'])) $this->expectedDeliveryDate = $o['expectedDeliveryDate'];
if (isset($o['buckleSummary'])) $this->buckleSummary = $o['buckleSummary'];
if (isset($o['materialSummary'])) $this->materialSummary = $o['materialSummary'];
if (isset($o['contentSummary'])) $this->contentSummary = $o['contentSummary'];
if (isset($o['strapSummary'])) $this->strapSummary = $o['strapSummary'];
if (isset($o['totalValues'])) $this->totalValues = JsonConverters::from('ItemTotalValues', $o['totalValues']);
if (isset($o['warnings'])) $this->warnings = JsonConverters::fromArray('Warning', $o['warnings']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->lineNumber)) $o['lineNumber'] = $this->lineNumber;
if (isset($this->parentLineNumber)) $o['parentLineNumber'] = $this->parentLineNumber;
if (isset($this->requestLineNumber)) $o['requestLineNumber'] = $this->requestLineNumber;
if (isset($this->articleCode)) $o['articleCode'] = $this->articleCode;
if (isset($this->substitutedArticleCode)) $o['substitutedArticleCode'] = $this->substitutedArticleCode;
if (isset($this->deliveryPlantId)) $o['deliveryPlantId'] = $this->deliveryPlantId;
if (isset($this->expectedDeliveryDate)) $o['expectedDeliveryDate'] = $this->expectedDeliveryDate;
if (isset($this->buckleSummary)) $o['buckleSummary'] = $this->buckleSummary;
if (isset($this->materialSummary)) $o['materialSummary'] = $this->materialSummary;
if (isset($this->contentSummary)) $o['contentSummary'] = $this->contentSummary;
if (isset($this->strapSummary)) $o['strapSummary'] = $this->strapSummary;
if (isset($this->totalValues)) $o['totalValues'] = JsonConverters::to('ItemTotalValues', $this->totalValues);
if (isset($this->warnings)) $o['warnings'] = JsonConverters::toArray('Warning', $this->warnings);
return empty($o) ? new class(){} : $o;
}
}
class TotalValues implements JsonSerializable
{
public function __construct(
/** @description Gross Weight */
// @ApiMember(Description="Gross Weight", IsRequired=true)
/** @var Quantity|null */
public ?Quantity $grossWeightMeasure=null,
/** @description Net Weight */
// @ApiMember(Description="Net Weight", IsRequired=true)
/** @var Quantity|null */
public ?Quantity $netWeightMeasure=null,
/** @description Gross Volume */
// @ApiMember(Description="Gross Volume", IsRequired=true)
/** @var Quantity|null */
public ?Quantity $grossVolumeMeasure=null,
/** @description Gross Amount */
// @ApiMember(Description="Gross Amount", IsRequired=true)
/** @var Amount|null */
public ?Amount $grossAmount=null,
/** @description Net Amount */
// @ApiMember(Description="Net Amount", IsRequired=true)
/** @var Amount|null */
public ?Amount $netAmount=null,
/** @description Tax Amount */
// @ApiMember(Description="Tax Amount", IsRequired=true)
/** @var Amount|null */
public ?Amount $taxAmount=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['grossWeightMeasure'])) $this->grossWeightMeasure = JsonConverters::from('Quantity', $o['grossWeightMeasure']);
if (isset($o['netWeightMeasure'])) $this->netWeightMeasure = JsonConverters::from('Quantity', $o['netWeightMeasure']);
if (isset($o['grossVolumeMeasure'])) $this->grossVolumeMeasure = JsonConverters::from('Quantity', $o['grossVolumeMeasure']);
if (isset($o['grossAmount'])) $this->grossAmount = JsonConverters::from('Amount', $o['grossAmount']);
if (isset($o['netAmount'])) $this->netAmount = JsonConverters::from('Amount', $o['netAmount']);
if (isset($o['taxAmount'])) $this->taxAmount = JsonConverters::from('Amount', $o['taxAmount']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->grossWeightMeasure)) $o['grossWeightMeasure'] = JsonConverters::to('Quantity', $this->grossWeightMeasure);
if (isset($this->netWeightMeasure)) $o['netWeightMeasure'] = JsonConverters::to('Quantity', $this->netWeightMeasure);
if (isset($this->grossVolumeMeasure)) $o['grossVolumeMeasure'] = JsonConverters::to('Quantity', $this->grossVolumeMeasure);
if (isset($this->grossAmount)) $o['grossAmount'] = JsonConverters::to('Amount', $this->grossAmount);
if (isset($this->netAmount)) $o['netAmount'] = JsonConverters::to('Amount', $this->netAmount);
if (isset($this->taxAmount)) $o['taxAmount'] = JsonConverters::to('Amount', $this->taxAmount);
return empty($o) ? new class(){} : $o;
}
}
class Address implements JsonSerializable
{
public function __construct(
/** @description Country ID */
// @ApiMember(Description="Country ID")
/** @var string|null */
public ?string $countryId=null,
/** @description State ID */
// @ApiMember(Description="State ID")
/** @var string|null */
public ?string $stateId=null,
/** @description City Name */
// @ApiMember(Description="City Name")
/** @var string|null */
public ?string $city=null,
/** @description Street Name and Number */
// @ApiMember(Description="Street Name and Number")
/** @var string|null */
public ?string $street=null,
/** @description Postal Code */
// @ApiMember(Description="Postal Code")
/** @var string|null */
public ?string $zipCode=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['countryId'])) $this->countryId = $o['countryId'];
if (isset($o['stateId'])) $this->stateId = $o['stateId'];
if (isset($o['city'])) $this->city = $o['city'];
if (isset($o['street'])) $this->street = $o['street'];
if (isset($o['zipCode'])) $this->zipCode = $o['zipCode'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->countryId)) $o['countryId'] = $this->countryId;
if (isset($this->stateId)) $o['stateId'] = $this->stateId;
if (isset($this->city)) $o['city'] = $this->city;
if (isset($this->street)) $o['street'] = $this->street;
if (isset($this->zipCode)) $o['zipCode'] = $this->zipCode;
return empty($o) ? new class(){} : $o;
}
}
class Party implements JsonSerializable
{
public function __construct(
/** @description Internal ID of the Element */
// @ApiMember(Description="Internal ID of the Element", IsRequired=true)
/** @var string */
public string $id='',
/** @description Formatted Name of the Element */
// @ApiMember(Description="Formatted Name of the Element", IsRequired=true)
/** @var string */
public string $name='',
/** @description Geographic Address of the Element */
// @ApiMember(Description="Geographic Address of the Element")
/** @var Address|null */
public ?Address $address=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['address'])) $this->address = JsonConverters::from('Address', $o['address']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->address)) $o['address'] = JsonConverters::to('Address', $this->address);
return empty($o) ? new class(){} : $o;
}
}
class SplittedSimulateOrderResponse implements JsonSerializable
{
public function __construct(
/** @description Order Type */
// @ApiMember(Description="Order Type", IsRequired=true)
/** @var string */
public string $orderType='',
/** @description Product Type */
// @ApiMember(Description="Product Type", IsRequired=true)
/** @var string */
public string $productType='',
/** @description List of Articles simulated */
// @ApiMember(Description="List of Articles simulated", IsRequired=true)
/** @var array<SimulateOrderItemResponseV2>|null */
public ?array $orderItems=null,
/** @description Total Values */
// @ApiMember(Description="Total Values", IsRequired=true)
/** @var TotalValues|null */
public ?TotalValues $totalValues=null,
/** @description Addresses which order can be shipped to */
// @ApiMember(Description="Addresses which order can be shipped to", IsRequired=true)
/** @var array<Party>|null */
public ?array $shipTo=null,
/** @description Addresses which order can be final shipped to */
// @ApiMember(Description="Addresses which order can be final shipped to")
/** @var array<Party>|null */
public ?array $finalShipTo=null,
/** @description Addresses which order can be billed to */
// @ApiMember(Description="Addresses which order can be billed to", IsRequired=true)
/** @var array<Party>|null */
public ?array $billTo=null,
/** @description Address which order is made to */
// @ApiMember(Description="Address which order is made to", IsRequired=true)
/** @var Party|null */
public ?Party $soldTo=null,
/** @description Sales Representative */
// @ApiMember(Description="Sales Representative")
/** @var Party|null */
public ?Party $salesRepresentative=null,
/** @description Warning list */
// @ApiMember(Description="Warning list", IsRequired=true)
/** @var array<Warning>|null */
public ?array $warnings=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['orderType'])) $this->orderType = $o['orderType'];
if (isset($o['productType'])) $this->productType = $o['productType'];
if (isset($o['orderItems'])) $this->orderItems = JsonConverters::fromArray('SimulateOrderItemResponseV2', $o['orderItems']);
if (isset($o['totalValues'])) $this->totalValues = JsonConverters::from('TotalValues', $o['totalValues']);
if (isset($o['shipTo'])) $this->shipTo = JsonConverters::fromArray('Party', $o['shipTo']);
if (isset($o['finalShipTo'])) $this->finalShipTo = JsonConverters::fromArray('Party', $o['finalShipTo']);
if (isset($o['billTo'])) $this->billTo = JsonConverters::fromArray('Party', $o['billTo']);
if (isset($o['soldTo'])) $this->soldTo = JsonConverters::from('Party', $o['soldTo']);
if (isset($o['salesRepresentative'])) $this->salesRepresentative = JsonConverters::from('Party', $o['salesRepresentative']);
if (isset($o['warnings'])) $this->warnings = JsonConverters::fromArray('Warning', $o['warnings']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->orderType)) $o['orderType'] = $this->orderType;
if (isset($this->productType)) $o['productType'] = $this->productType;
if (isset($this->orderItems)) $o['orderItems'] = JsonConverters::toArray('SimulateOrderItemResponseV2', $this->orderItems);
if (isset($this->totalValues)) $o['totalValues'] = JsonConverters::to('TotalValues', $this->totalValues);
if (isset($this->shipTo)) $o['shipTo'] = JsonConverters::toArray('Party', $this->shipTo);
if (isset($this->finalShipTo)) $o['finalShipTo'] = JsonConverters::toArray('Party', $this->finalShipTo);
if (isset($this->billTo)) $o['billTo'] = JsonConverters::toArray('Party', $this->billTo);
if (isset($this->soldTo)) $o['soldTo'] = JsonConverters::to('Party', $this->soldTo);
if (isset($this->salesRepresentative)) $o['salesRepresentative'] = JsonConverters::to('Party', $this->salesRepresentative);
if (isset($this->warnings)) $o['warnings'] = JsonConverters::toArray('Warning', $this->warnings);
return empty($o) ? new class(){} : $o;
}
}
class SimulateOrderResponseV2 implements JsonSerializable
{
public function __construct(
/** @description List of splitted order simulation results */
// @ApiMember(Description="List of splitted order simulation results", IsRequired=true)
/** @var array<string,SplittedSimulateOrderResponse>|null */
public ?array $results=null,
/** @description Addresses which order can be shipped to (common list for all splitted orders) */
// @ApiMember(Description="Addresses which order can be shipped to (common list for all splitted orders)")
/** @var array<Party>|null */
public ?array $shipTo=null,
/** @description Addresses which order can be final shipped to (common list for all splitted orders) */
// @ApiMember(Description="Addresses which order can be final shipped to (common list for all splitted orders)")
/** @var array<Party>|null */
public ?array $finalShipTo=null,
/** @description Addresses which order can be billed to (common list for all splitted orders) */
// @ApiMember(Description="Addresses which order can be billed to (common list for all splitted orders)")
/** @var array<Party>|null */
public ?array $billTo=null,
/** @description Address which order is made to (common list for all splitted orders) */
// @ApiMember(Description="Address which order is made to (common list for all splitted orders)")
/** @var Party|null */
public ?Party $soldTo=null,
/** @description Sales representatives (common list for all splitted orders) */
// @ApiMember(Description="Sales representatives (common list for all splitted orders)")
/** @var Party|null */
public ?Party $salesRepresentative=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['results'])) $this->results = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','SplittedSimulateOrderResponse']), $o['results']);
if (isset($o['shipTo'])) $this->shipTo = JsonConverters::fromArray('Party', $o['shipTo']);
if (isset($o['finalShipTo'])) $this->finalShipTo = JsonConverters::fromArray('Party', $o['finalShipTo']);
if (isset($o['billTo'])) $this->billTo = JsonConverters::fromArray('Party', $o['billTo']);
if (isset($o['soldTo'])) $this->soldTo = JsonConverters::from('Party', $o['soldTo']);
if (isset($o['salesRepresentative'])) $this->salesRepresentative = JsonConverters::from('Party', $o['salesRepresentative']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->results)) $o['results'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','SplittedSimulateOrderResponse']), $this->results);
if (isset($this->shipTo)) $o['shipTo'] = JsonConverters::toArray('Party', $this->shipTo);
if (isset($this->finalShipTo)) $o['finalShipTo'] = JsonConverters::toArray('Party', $this->finalShipTo);
if (isset($this->billTo)) $o['billTo'] = JsonConverters::toArray('Party', $this->billTo);
if (isset($this->soldTo)) $o['soldTo'] = JsonConverters::to('Party', $this->soldTo);
if (isset($this->salesRepresentative)) $o['salesRepresentative'] = JsonConverters::to('Party', $this->salesRepresentative);
return empty($o) ? new class(){} : $o;
}
}
class StrapItem implements JsonSerializable
{
public function __construct(
/** @description Article reference */
// @ApiMember(Description="Article reference")
/** @var string|null */
public ?string $speakingArticleCode=null,
/** @description Buckle type Description */
// @ApiMember(Description="Buckle type Description")
/** @var string|null */
public ?string $buckleTypeDescription=null,
/** @description Buckle type */
// @ApiMember(Description="Buckle type")
/** @var string|null */
public ?string $buckleTypeCode=null,
/** @description watch 6 Length */
// @ApiMember(Description="watch 6 Length")
/** @var int|null */
public ?int $watch6Length=null,
/** @description watch 12 Length */
// @ApiMember(Description="watch 12 Length")
/** @var int|null */
public ?int $watch12Length=null,
/** @description Article Material Code */
// @ApiMember(Description="Article Material Code")
/** @var string|null */
public ?string $materialCode=null,
/** @description Article Material Description */
// @ApiMember(Description="Article Material Description")
/** @var string|null */
public ?string $materialDescription=null,
/** @description Article Color Code */
// @ApiMember(Description="Article Color Code")
/** @var string|null */
public ?string $colorCode=null,
/** @description Article Color Description */
// @ApiMember(Description="Article Color Description")
/** @var string|null */
public ?string $colorDescription=null,
/** @description Buckle Witdh */
// @ApiMember(Description="Buckle Witdh")
/** @var string|null */
public ?string $buckleWidth=null,
/** @description Article Lining Code */
// @ApiMember(Description="Article Lining Code")
/** @var string|null */
public ?string $liningCode=null,
/** @description Article Lining Description */
// @ApiMember(Description="Article Lining Description")
/** @var string|null */
public ?string $liningDescription=null,
/** @description Article Stitching Code */
// @ApiMember(Description="Article Stitching Code")
/** @var string|null */
public ?string $stitchingCode=null,
/** @description Article Stitching Description */
// @ApiMember(Description="Article Stitching Description")
/** @var string|null */
public ?string $stitchingDescription=null,
/** @description Article Edge Code */
// @ApiMember(Description="Article Edge Code")
/** @var string|null */
public ?string $edgeCode=null,
/** @description Article Edge Description */
// @ApiMember(Description="Article Edge Description")
/** @var string|null */
public ?string $edgeDescription=null,
/** @description Article Padding Code */
// @ApiMember(Description="Article Padding Code")
/** @var string|null */
public ?string $paddingCode=null,
/** @description Article Padding Description */
// @ApiMember(Description="Article Padding Description")
/** @var string|null */
public ?string $paddingDescription=null,
/** @description Article Speciality Code */
// @ApiMember(Description="Article Speciality Code")
/** @var string|null */
public ?string $specialtyCode=null,
/** @description Article Speciality Description */
// @ApiMember(Description="Article Speciality Description")
/** @var string|null */
public ?string $specialtyDescription=null,
/** @description Nuancier Code */
// @ApiMember(Description="Nuancier Code")
/** @var string|null */
public ?string $nuancierCode=null,
/** @description Strap Vip Order */
// @ApiMember(Description="Strap Vip Order")
/** @var bool|null */
public ?bool $isStrapVipOrder=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['speakingArticleCode'])) $this->speakingArticleCode = $o['speakingArticleCode'];
if (isset($o['buckleTypeDescription'])) $this->buckleTypeDescription = $o['buckleTypeDescription'];
if (isset($o['buckleTypeCode'])) $this->buckleTypeCode = $o['buckleTypeCode'];
if (isset($o['watch6Length'])) $this->watch6Length = $o['watch6Length'];
if (isset($o['watch12Length'])) $this->watch12Length = $o['watch12Length'];
if (isset($o['materialCode'])) $this->materialCode = $o['materialCode'];
if (isset($o['materialDescription'])) $this->materialDescription = $o['materialDescription'];
if (isset($o['colorCode'])) $this->colorCode = $o['colorCode'];
if (isset($o['colorDescription'])) $this->colorDescription = $o['colorDescription'];
if (isset($o['buckleWidth'])) $this->buckleWidth = $o['buckleWidth'];
if (isset($o['liningCode'])) $this->liningCode = $o['liningCode'];
if (isset($o['liningDescription'])) $this->liningDescription = $o['liningDescription'];
if (isset($o['stitchingCode'])) $this->stitchingCode = $o['stitchingCode'];
if (isset($o['stitchingDescription'])) $this->stitchingDescription = $o['stitchingDescription'];
if (isset($o['edgeCode'])) $this->edgeCode = $o['edgeCode'];
if (isset($o['edgeDescription'])) $this->edgeDescription = $o['edgeDescription'];
if (isset($o['paddingCode'])) $this->paddingCode = $o['paddingCode'];
if (isset($o['paddingDescription'])) $this->paddingDescription = $o['paddingDescription'];
if (isset($o['specialtyCode'])) $this->specialtyCode = $o['specialtyCode'];
if (isset($o['specialtyDescription'])) $this->specialtyDescription = $o['specialtyDescription'];
if (isset($o['nuancierCode'])) $this->nuancierCode = $o['nuancierCode'];
if (isset($o['isStrapVipOrder'])) $this->isStrapVipOrder = $o['isStrapVipOrder'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->speakingArticleCode)) $o['speakingArticleCode'] = $this->speakingArticleCode;
if (isset($this->buckleTypeDescription)) $o['buckleTypeDescription'] = $this->buckleTypeDescription;
if (isset($this->buckleTypeCode)) $o['buckleTypeCode'] = $this->buckleTypeCode;
if (isset($this->watch6Length)) $o['watch6Length'] = $this->watch6Length;
if (isset($this->watch12Length)) $o['watch12Length'] = $this->watch12Length;
if (isset($this->materialCode)) $o['materialCode'] = $this->materialCode;
if (isset($this->materialDescription)) $o['materialDescription'] = $this->materialDescription;
if (isset($this->colorCode)) $o['colorCode'] = $this->colorCode;
if (isset($this->colorDescription)) $o['colorDescription'] = $this->colorDescription;
if (isset($this->buckleWidth)) $o['buckleWidth'] = $this->buckleWidth;
if (isset($this->liningCode)) $o['liningCode'] = $this->liningCode;
if (isset($this->liningDescription)) $o['liningDescription'] = $this->liningDescription;
if (isset($this->stitchingCode)) $o['stitchingCode'] = $this->stitchingCode;
if (isset($this->stitchingDescription)) $o['stitchingDescription'] = $this->stitchingDescription;
if (isset($this->edgeCode)) $o['edgeCode'] = $this->edgeCode;
if (isset($this->edgeDescription)) $o['edgeDescription'] = $this->edgeDescription;
if (isset($this->paddingCode)) $o['paddingCode'] = $this->paddingCode;
if (isset($this->paddingDescription)) $o['paddingDescription'] = $this->paddingDescription;
if (isset($this->specialtyCode)) $o['specialtyCode'] = $this->specialtyCode;
if (isset($this->specialtyDescription)) $o['specialtyDescription'] = $this->specialtyDescription;
if (isset($this->nuancierCode)) $o['nuancierCode'] = $this->nuancierCode;
if (isset($this->isStrapVipOrder)) $o['isStrapVipOrder'] = $this->isStrapVipOrder;
return empty($o) ? new class(){} : $o;
}
}
class SimulateOrderItemRequestV2 implements JsonSerializable
{
public function __construct(
/** @description Line Number */
// @ApiMember(Description="Line Number", IsRequired=true)
/** @var int */
public int $lineNumber=0,
/** @description Reference ID of the article/product, e.g. 'CRWB520003' */
// @ApiMember(Description="Reference ID of the article/product, e.g. 'CRWB520003'", IsRequired=true)
/** @var string */
public string $articleCode='',
/** @description Desired quantity of the article */
// @ApiMember(Description="Desired quantity of the article", IsRequired=true)
/** @var int */
public int $quantity=0,
/** @description Requested Delivery Date of the Item, e.g. '2020-12-30' */
// @ApiMember(Description="Requested Delivery Date of the Item, e.g. '2020-12-30'")
/** @var DateTime|null */
public ?DateTime $requestedDeliveryDate=null,
/** @description Purchase order type, e.g. 'WCFS', null. Null for ordinary order */
// @ApiMember(Description="Purchase order type, e.g. 'WCFS', null. Null for ordinary order")
/** @var string|null */
public ?string $orderType=null,
/** @description Final Ship To Pos Code */
// @ApiMember(Description="Final Ship To Pos Code")
/** @var string|null */
public ?string $finalShipToId=null,
/** @description Strap definition */
// @ApiMember(Description="Strap definition")
/** @var StrapItem|null */
public ?StrapItem $strap=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['lineNumber'])) $this->lineNumber = $o['lineNumber'];
if (isset($o['articleCode'])) $this->articleCode = $o['articleCode'];
if (isset($o['quantity'])) $this->quantity = $o['quantity'];
if (isset($o['requestedDeliveryDate'])) $this->requestedDeliveryDate = JsonConverters::from('DateTime', $o['requestedDeliveryDate']);
if (isset($o['orderType'])) $this->orderType = $o['orderType'];
if (isset($o['finalShipToId'])) $this->finalShipToId = $o['finalShipToId'];
if (isset($o['strap'])) $this->strap = JsonConverters::from('StrapItem', $o['strap']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->lineNumber)) $o['lineNumber'] = $this->lineNumber;
if (isset($this->articleCode)) $o['articleCode'] = $this->articleCode;
if (isset($this->quantity)) $o['quantity'] = $this->quantity;
if (isset($this->requestedDeliveryDate)) $o['requestedDeliveryDate'] = JsonConverters::to('DateTime', $this->requestedDeliveryDate);
if (isset($this->orderType)) $o['orderType'] = $this->orderType;
if (isset($this->finalShipToId)) $o['finalShipToId'] = $this->finalShipToId;
if (isset($this->strap)) $o['strap'] = JsonConverters::to('StrapItem', $this->strap);
return empty($o) ? new class(){} : $o;
}
}
class EndCustomerDetails implements JsonSerializable
{
public function __construct(
/** @description Title of the end Customer, e.g. 'MR', 'MRS'. */
// @ApiMember(Description="Title of the end Customer, e.g. 'MR', 'MRS'.")
/** @var string|null */
public ?string $title=null,
/** @description First Name of the end Customer */
// @ApiMember(Description="First Name of the end Customer", IsRequired=true)
/** @var string */
public string $firstName='',
/** @description Last Name of the end Customer */
// @ApiMember(Description="Last Name of the end Customer", IsRequired=true)
/** @var string */
public string $lastName='',
/** @description Email of the end Customer */
// @ApiMember(Description="Email of the end Customer")
/** @var string|null */
public ?string $email=null,
/** @description Phone number of the end Customer, e.g. '0032477123456'. */
// @ApiMember(Description="Phone number of the end Customer, e.g. '0032477123456'. ")
/** @var string|null */
public ?string $phone=null,
/** @description Countr code in the shipping address, e.g. 'BE' (ISO Code) */
// @ApiMember(Description="Countr code in the shipping address, e.g. 'BE' (ISO Code)", IsRequired=true)
/** @var string */
public string $country='',
/** @description City name in the shipping address */
// @ApiMember(Description="City name in the shipping address", IsRequired=true)
/** @var string */
public string $city='',
/** @description Street name in the shipping address */
// @ApiMember(Description="Street name in the shipping address", IsRequired=true)
/** @var string */
public string $street='',
/** @description House number in the shipping address */
// @ApiMember(Description="House number in the shipping address")
/** @var string|null */
public ?string $houseNumber=null,
/** @description Building number in the shipping address */
// @ApiMember(Description="Building number in the shipping address")
/** @var string|null */
public ?string $building=null,
/** @description Postal code in the shipping address */
// @ApiMember(Description="Postal code in the shipping address")
/** @var string|null */
public ?string $postalCode=null,
/** @description Region code in the shipping address, e.g. 'VL' (ISO Code) */
// @ApiMember(Description="Region code in the shipping address, e.g. 'VL' (ISO Code)")
/** @var string|null */
public ?string $region=null,
/** @description District name in the shipping address */
// @ApiMember(Description="District name in the shipping address")
/** @var string|null */
public ?string $district=null,
/** @description Additional Info number to the shipping address */
// @ApiMember(Description="Additional Info number to the shipping address")
/** @var string|null */
public ?string $additionalInfo=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['title'])) $this->title = $o['title'];
if (isset($o['firstName'])) $this->firstName = $o['firstName'];
if (isset($o['lastName'])) $this->lastName = $o['lastName'];
if (isset($o['email'])) $this->email = $o['email'];
if (isset($o['phone'])) $this->phone = $o['phone'];
if (isset($o['country'])) $this->country = $o['country'];
if (isset($o['city'])) $this->city = $o['city'];
if (isset($o['street'])) $this->street = $o['street'];
if (isset($o['houseNumber'])) $this->houseNumber = $o['houseNumber'];
if (isset($o['building'])) $this->building = $o['building'];
if (isset($o['postalCode'])) $this->postalCode = $o['postalCode'];
if (isset($o['region'])) $this->region = $o['region'];
if (isset($o['district'])) $this->district = $o['district'];
if (isset($o['additionalInfo'])) $this->additionalInfo = $o['additionalInfo'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->title)) $o['title'] = $this->title;
if (isset($this->firstName)) $o['firstName'] = $this->firstName;
if (isset($this->lastName)) $o['lastName'] = $this->lastName;
if (isset($this->email)) $o['email'] = $this->email;
if (isset($this->phone)) $o['phone'] = $this->phone;
if (isset($this->country)) $o['country'] = $this->country;
if (isset($this->city)) $o['city'] = $this->city;
if (isset($this->street)) $o['street'] = $this->street;
if (isset($this->houseNumber)) $o['houseNumber'] = $this->houseNumber;
if (isset($this->building)) $o['building'] = $this->building;
if (isset($this->postalCode)) $o['postalCode'] = $this->postalCode;
if (isset($this->region)) $o['region'] = $this->region;
if (isset($this->district)) $o['district'] = $this->district;
if (isset($this->additionalInfo)) $o['additionalInfo'] = $this->additionalInfo;
return empty($o) ? new class(){} : $o;
}
}
class SimulateOrderV2 implements JsonSerializable
{
public function __construct(
/** @description Brand Trigram of the intended Order, e.g. 'IWC', 'CAR', etc. */
// @ApiMember(Description="Brand Trigram of the intended Order, e.g. 'IWC', 'CAR', etc.", IsRequired=true)
/** @var string */
public string $brand='',
/** @description Global Pos Code for the intended Order e.g. ES100:102048 */
// @ApiMember(Description="Global Pos Code for the intended Order e.g. ES100:102048", IsRequired=true)
/** @var string */
public string $posCode='',
/** @description Customer Reference */
// @ApiMember(Description="Customer Reference")
/** @var string|null */
public ?string $customerReference=null,
/** @description Additional Notes regarding the Order */
// @ApiMember(Description="Additional Notes regarding the Order")
/** @var string|null */
public ?string $notes=null,
/** @description Purchase order date, e.g. '2020-12-31' */
// @ApiMember(Description="Purchase order date, e.g. '2020-12-31'")
/** @var DateTime|null */
public ?DateTime $orderDate=null,
/** @description List of Articles to be simulated */
// @ApiMember(Description="List of Articles to be simulated", IsRequired=true)
/** @var array<SimulateOrderItemRequestV2>|null */
public ?array $orderItems=null,
/** @description Booster1 ID of the end Customer */
// @ApiMember(Description="Booster1 ID of the end Customer")
/** @var string|null */
public ?string $endCustomerBooster1Id=null,
/** @description Details of the end Customer */
// @ApiMember(Description="Details of the end Customer")
/** @var EndCustomerDetails|null */
public ?EndCustomerDetails $endCustomerDetails=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['brand'])) $this->brand = $o['brand'];
if (isset($o['posCode'])) $this->posCode = $o['posCode'];
if (isset($o['customerReference'])) $this->customerReference = $o['customerReference'];
if (isset($o['notes'])) $this->notes = $o['notes'];
if (isset($o['orderDate'])) $this->orderDate = JsonConverters::from('DateTime', $o['orderDate']);
if (isset($o['orderItems'])) $this->orderItems = JsonConverters::fromArray('SimulateOrderItemRequestV2', $o['orderItems']);
if (isset($o['endCustomerBooster1Id'])) $this->endCustomerBooster1Id = $o['endCustomerBooster1Id'];
if (isset($o['endCustomerDetails'])) $this->endCustomerDetails = JsonConverters::from('EndCustomerDetails', $o['endCustomerDetails']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->brand)) $o['brand'] = $this->brand;
if (isset($this->posCode)) $o['posCode'] = $this->posCode;
if (isset($this->customerReference)) $o['customerReference'] = $this->customerReference;
if (isset($this->notes)) $o['notes'] = $this->notes;
if (isset($this->orderDate)) $o['orderDate'] = JsonConverters::to('DateTime', $this->orderDate);
if (isset($this->orderItems)) $o['orderItems'] = JsonConverters::toArray('SimulateOrderItemRequestV2', $this->orderItems);
if (isset($this->endCustomerBooster1Id)) $o['endCustomerBooster1Id'] = $this->endCustomerBooster1Id;
if (isset($this->endCustomerDetails)) $o['endCustomerDetails'] = JsonConverters::to('EndCustomerDetails', $this->endCustomerDetails);
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.
POST /purchase/simulate/v2 HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"brand":"String","posCode":"String","customerReference":"String","notes":"String","orderDate":"\/Date(-62135596800000-0000)\/","orderItems":[{"lineNumber":0,"articleCode":"String","quantity":0,"requestedDeliveryDate":"\/Date(-62135596800000-0000)\/","orderType":"String","finalShipToId":"String","strap":{"speakingArticleCode":"String","buckleTypeDescription":"String","buckleTypeCode":"String","watch6Length":0,"watch12Length":0,"materialCode":"String","materialDescription":"String","colorCode":"String","colorDescription":"String","buckleWidth":"String","liningCode":"String","liningDescription":"String","stitchingCode":"String","stitchingDescription":"String","edgeCode":"String","edgeDescription":"String","paddingCode":"String","paddingDescription":"String","specialtyCode":"String","specialtyDescription":"String","nuancierCode":"String","isStrapVipOrder":false}}],"endCustomerBooster1Id":"String","endCustomerDetails":{"title":"String","firstName":"String","lastName":"String","email":"String","phone":"String","country":"String","city":"String","street":"String","houseNumber":"String","building":"String","postalCode":"String","region":"String","district":"String","additionalInfo":"String"}}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"results":{"String":{"orderType":"String","productType":"String","orderItems":[{"lineNumber":0,"parentLineNumber":0,"requestLineNumber":0,"articleCode":"String","substitutedArticleCode":"String","deliveryPlantId":"String","expectedDeliveryDate":"String","buckleSummary":"String","materialSummary":"String","contentSummary":"String","strapSummary":"String","totalValues":{"requestedQuantity":{"unit":"String","value":0},"confirmedQuantity":{"unit":"String","value":0},"availableQuantity":{"unit":"String","value":0},"grossWeightMeasure":{"unit":"String","value":0},"netWeightMeasure":{"unit":"String","value":0},"volumeMeasure":{"unit":"String","value":0},"netAmount":{"value":0,"currency":"String"},"netPrice":{"amount":{"value":0,"currency":"String"},"baseQuantity":{"unit":"String","value":0}},"taxAmount":{"value":0,"currency":"String"},"retailSalesPriceAmount":{"value":0,"currency":"String"}},"warnings":[{"id":"String","message":"String","severityCode":0}]}],"totalValues":{"grossWeightMeasure":{"unit":"String","value":0},"netWeightMeasure":{"unit":"String","value":0},"grossVolumeMeasure":{"unit":"String","value":0},"grossAmount":{"value":0,"currency":"String"},"netAmount":{"value":0,"currency":"String"},"taxAmount":{"value":0,"currency":"String"}},"shipTo":[{"id":"String","name":"String","address":{"countryId":"String","stateId":"String","city":"String","street":"String","zipCode":"String"}}],"finalShipTo":[{"id":"String","name":"String","address":{"countryId":"String","stateId":"String","city":"String","street":"String","zipCode":"String"}}],"billTo":[{"id":"String","name":"String","address":{"countryId":"String","stateId":"String","city":"String","street":"String","zipCode":"String"}}],"soldTo":{"id":"String","name":"String","address":{"countryId":"String","stateId":"String","city":"String","street":"String","zipCode":"String"}},"salesRepresentative":{"id":"String","name":"String","address":{"countryId":"String","stateId":"String","city":"String","street":"String","zipCode":"String"}},"warnings":[{"id":"String","message":"String","severityCode":0}]}},"shipTo":[{"id":"String","name":"String","address":{"countryId":"String","stateId":"String","city":"String","street":"String","zipCode":"String"}}],"finalShipTo":[{"id":"String","name":"String","address":{"countryId":"String","stateId":"String","city":"String","street":"String","zipCode":"String"}}],"billTo":[{"id":"String","name":"String","address":{"countryId":"String","stateId":"String","city":"String","street":"String","zipCode":"String"}}],"soldTo":{"id":"String","name":"String","address":{"countryId":"String","stateId":"String","city":"String","street":"String","zipCode":"String"}},"salesRepresentative":{"id":"String","name":"String","address":{"countryId":"String","stateId":"String","city":"String","street":"String","zipCode":"String"}}}