| GET | /warranty | Get a list of Sale Details | Get a list of Sale Details based on the search parameters submitted |
|---|
<?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 SaleDetail implements JsonSerializable
{
public function __construct(
/** @description Unique Identifier of the Sell-out created in Booster */
// @ApiMember(Description="Unique Identifier of the Sell-out created in Booster", IsRequired=true)
/** @var int */
public int $saleId=0,
/** @description Unique Identifier of the Sell-out created in Booster */
// @ApiMember(Description="Unique Identifier of the Sell-out created in Booster", IsRequired=true)
/** @var int */
public int $saleDetailId=0,
/** @description Booster Customer Id */
// @ApiMember(Description="Booster Customer Id")
/** @var int|null */
public ?int $boosterCustomerId=null,
/** @description Richemont POS code */
// @ApiMember(Description="Richemont POS code", IsRequired=true)
/** @var string */
public string $posCode='',
/** @description Receipt or Invoice Number */
// @ApiMember(Description="Receipt or Invoice Number")
/** @var string|null */
public ?string $documentNumber=null,
/** @description Date of the Sell-out */
// @ApiMember(Description="Date of the Sell-out", IsRequired=true)
/** @var string */
public string $documentDate='',
/** @description Position Number */
// @ApiMember(Description="Position Number")
/** @var int|null */
public ?int $documentLineNumber=null,
/** @description Richemont Reference Code of the item */
// @ApiMember(Description="Richemont Reference Code of the item", IsRequired=true)
/** @var string */
public string $articleCode='',
/** @description Serial Number of the item */
// @ApiMember(Description="Serial Number of the item")
/** @var string|null */
public ?string $serialNumber=null,
/** @description Use positive for standard Sell-out and negative quantity for return */
// @ApiMember(Description="Use positive for standard Sell-out and negative quantity for return", IsRequired=true)
/** @var int */
public int $quantity=0,
/** @description Retail Price */
// @ApiMember(Description="Retail Price")
/** @var float|null */
public ?float $retailPrice=null,
/** @description Sold Price */
// @ApiMember(Description="Sold Price")
/** @var float|null */
public ?float $unitPrice=null,
/** @description Currency of the sold price */
// @ApiMember(Description="Currency of the sold price")
/** @var string|null */
public ?string $currencyCode=null,
/** @description CCP Status Code */
// @ApiMember(Description="CCP Status Code")
/** @var string|null */
public ?string $ccpStatusCode=null,
/** @description CCP Status Description */
// @ApiMember(Description="CCP Status Description")
/** @var string|null */
public ?string $ccpStatusDescription=null,
/** @description CCP Retrigger enable */
// @ApiMember(Description="CCP Retrigger enable")
/** @var bool|null */
public ?bool $retriggerEnabled=null,
/** @description Warranty Extention Status */
// @ApiMember(Description="Warranty Extention Status")
/** @var int|null */
public ?int $warrantyExtentionStatusId=null,
/** @description Warranty Extention Status */
// @ApiMember(Description="Warranty Extention Status")
/** @var string|null */
public ?string $warrantyExtentionStatusDescription=null,
/** @description Sale Representative Email */
// @ApiMember(Description="Sale Representative Email")
/** @var array<string>|null */
public ?array $saleRepresentativeEmails=null,
/** @description Promoter Type IDs, possible values are: DAI, FIT, GRT */
// @ApiMember(Description="Promoter Type IDs, possible values are: DAI, FIT, GRT")
/** @var string|null */
public ?string $promoterTypeId=null,
/** @description Sellout Type, possible values are: 'standard' or 'consigned' */
// @ApiMember(Description="Sellout Type, possible values are: 'standard' or 'consigned'", IsRequired=true)
/** @var string */
public string $type='',
/** @description Original Sale Detail Id */
// @ApiMember(Description="Original Sale Detail Id")
/** @var int|null */
public ?int $originalSaleDetailId=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['saleId'])) $this->saleId = $o['saleId'];
if (isset($o['saleDetailId'])) $this->saleDetailId = $o['saleDetailId'];
if (isset($o['boosterCustomerId'])) $this->boosterCustomerId = $o['boosterCustomerId'];
if (isset($o['posCode'])) $this->posCode = $o['posCode'];
if (isset($o['documentNumber'])) $this->documentNumber = $o['documentNumber'];
if (isset($o['documentDate'])) $this->documentDate = $o['documentDate'];
if (isset($o['documentLineNumber'])) $this->documentLineNumber = $o['documentLineNumber'];
if (isset($o['articleCode'])) $this->articleCode = $o['articleCode'];
if (isset($o['serialNumber'])) $this->serialNumber = $o['serialNumber'];
if (isset($o['quantity'])) $this->quantity = $o['quantity'];
if (isset($o['retailPrice'])) $this->retailPrice = $o['retailPrice'];
if (isset($o['unitPrice'])) $this->unitPrice = $o['unitPrice'];
if (isset($o['currencyCode'])) $this->currencyCode = $o['currencyCode'];
if (isset($o['ccpStatusCode'])) $this->ccpStatusCode = $o['ccpStatusCode'];
if (isset($o['ccpStatusDescription'])) $this->ccpStatusDescription = $o['ccpStatusDescription'];
if (isset($o['retriggerEnabled'])) $this->retriggerEnabled = $o['retriggerEnabled'];
if (isset($o['warrantyExtentionStatusId'])) $this->warrantyExtentionStatusId = $o['warrantyExtentionStatusId'];
if (isset($o['warrantyExtentionStatusDescription'])) $this->warrantyExtentionStatusDescription = $o['warrantyExtentionStatusDescription'];
if (isset($o['saleRepresentativeEmails'])) $this->saleRepresentativeEmails = JsonConverters::fromArray('string', $o['saleRepresentativeEmails']);
if (isset($o['promoterTypeId'])) $this->promoterTypeId = $o['promoterTypeId'];
if (isset($o['type'])) $this->type = $o['type'];
if (isset($o['originalSaleDetailId'])) $this->originalSaleDetailId = $o['originalSaleDetailId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->saleId)) $o['saleId'] = $this->saleId;
if (isset($this->saleDetailId)) $o['saleDetailId'] = $this->saleDetailId;
if (isset($this->boosterCustomerId)) $o['boosterCustomerId'] = $this->boosterCustomerId;
if (isset($this->posCode)) $o['posCode'] = $this->posCode;
if (isset($this->documentNumber)) $o['documentNumber'] = $this->documentNumber;
if (isset($this->documentDate)) $o['documentDate'] = $this->documentDate;
if (isset($this->documentLineNumber)) $o['documentLineNumber'] = $this->documentLineNumber;
if (isset($this->articleCode)) $o['articleCode'] = $this->articleCode;
if (isset($this->serialNumber)) $o['serialNumber'] = $this->serialNumber;
if (isset($this->quantity)) $o['quantity'] = $this->quantity;
if (isset($this->retailPrice)) $o['retailPrice'] = $this->retailPrice;
if (isset($this->unitPrice)) $o['unitPrice'] = $this->unitPrice;
if (isset($this->currencyCode)) $o['currencyCode'] = $this->currencyCode;
if (isset($this->ccpStatusCode)) $o['ccpStatusCode'] = $this->ccpStatusCode;
if (isset($this->ccpStatusDescription)) $o['ccpStatusDescription'] = $this->ccpStatusDescription;
if (isset($this->retriggerEnabled)) $o['retriggerEnabled'] = $this->retriggerEnabled;
if (isset($this->warrantyExtentionStatusId)) $o['warrantyExtentionStatusId'] = $this->warrantyExtentionStatusId;
if (isset($this->warrantyExtentionStatusDescription)) $o['warrantyExtentionStatusDescription'] = $this->warrantyExtentionStatusDescription;
if (isset($this->saleRepresentativeEmails)) $o['saleRepresentativeEmails'] = JsonConverters::toArray('string', $this->saleRepresentativeEmails);
if (isset($this->promoterTypeId)) $o['promoterTypeId'] = $this->promoterTypeId;
if (isset($this->type)) $o['type'] = $this->type;
if (isset($this->originalSaleDetailId)) $o['originalSaleDetailId'] = $this->originalSaleDetailId;
return empty($o) ? new class(){} : $o;
}
}
class GetSaleDetailsResponse implements JsonSerializable
{
public function __construct(
/** @description Index of the result set returnedr */
// @ApiMember(Description="Index of the result set returnedr", IsRequired=true)
/** @var int */
public int $page=0,
/** @description Size of the result set returned */
// @ApiMember(Description="Size of the result set returned", IsRequired=true)
/** @var int */
public int $items=0,
/** @description Total amount of pages / result sets */
// @ApiMember(Description="Total amount of pages / result sets", IsRequired=true)
/** @var int */
public int $totalPages=0,
/** @description Total amount of results */
// @ApiMember(Description="Total amount of results", IsRequired=true)
/** @var int */
public int $totalResults=0,
/** @description List of Sale Details */
// @ApiMember(Description="List of Sale Details", IsRequired=true)
/** @var array<SaleDetail>|null */
public ?array $elements=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['page'])) $this->page = $o['page'];
if (isset($o['items'])) $this->items = $o['items'];
if (isset($o['totalPages'])) $this->totalPages = $o['totalPages'];
if (isset($o['totalResults'])) $this->totalResults = $o['totalResults'];
if (isset($o['elements'])) $this->elements = JsonConverters::fromArray('SaleDetail', $o['elements']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->page)) $o['page'] = $this->page;
if (isset($this->items)) $o['items'] = $this->items;
if (isset($this->totalPages)) $o['totalPages'] = $this->totalPages;
if (isset($this->totalResults)) $o['totalResults'] = $this->totalResults;
if (isset($this->elements)) $o['elements'] = JsonConverters::toArray('SaleDetail', $this->elements);
return empty($o) ? new class(){} : $o;
}
}
class ProductCategory implements JsonSerializable
{
public function __construct(
/** @description Brand Category ID */
// @ApiMember(Description="Brand Category ID")
/** @var string|null */
public ?string $brandCategoryId=null,
/** @description Grand Category ID */
// @ApiMember(Description="Grand Category ID", IsRequired=true)
/** @var string */
public string $grandCategoryId='',
/** @description Master Category ID */
// @ApiMember(Description="Master Category ID")
/** @var string|null */
public ?string $masterCategoryId=null,
/** @description Category ID */
// @ApiMember(Description="Category ID")
/** @var string|null */
public ?string $categoryId=null,
/** @description Sub Category ID */
// @ApiMember(Description="Sub Category ID")
/** @var string|null */
public ?string $subCategoryId=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['brandCategoryId'])) $this->brandCategoryId = $o['brandCategoryId'];
if (isset($o['grandCategoryId'])) $this->grandCategoryId = $o['grandCategoryId'];
if (isset($o['masterCategoryId'])) $this->masterCategoryId = $o['masterCategoryId'];
if (isset($o['categoryId'])) $this->categoryId = $o['categoryId'];
if (isset($o['subCategoryId'])) $this->subCategoryId = $o['subCategoryId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->brandCategoryId)) $o['brandCategoryId'] = $this->brandCategoryId;
if (isset($this->grandCategoryId)) $o['grandCategoryId'] = $this->grandCategoryId;
if (isset($this->masterCategoryId)) $o['masterCategoryId'] = $this->masterCategoryId;
if (isset($this->categoryId)) $o['categoryId'] = $this->categoryId;
if (isset($this->subCategoryId)) $o['subCategoryId'] = $this->subCategoryId;
return empty($o) ? new class(){} : $o;
}
}
class GetSaleDetails implements IPagedRequest, JsonSerializable
{
public function __construct(
/** @description Richemont Brand ID */
// @ApiMember(Description="Richemont Brand ID", IsRequired=true)
/** @var string */
public string $brand='',
/** @description Richemont POS code */
// @ApiMember(Description="Richemont POS code", IsRequired=true)
/** @var string */
public string $posCode='',
/** @description Receipt or Invoice Number */
// @ApiMember(Description="Receipt or Invoice Number")
/** @var string|null */
public ?string $documentNumber=null,
/** @description Date of the Sell-out Start */
// @ApiMember(Description="Date of the Sell-out Start ")
/** @var DateTime|null */
public ?DateTime $documentDateFrom=null,
/** @description Date of the Sell-out End */
// @ApiMember(Description="Date of the Sell-out End")
/** @var DateTime|null */
public ?DateTime $documentDateTo=null,
/** @description Richemont Reference Code of the item */
// @ApiMember(Description="Richemont Reference Code of the item")
/** @var string|null */
public ?string $articleCode=null,
/** @description Serial Number of the item */
// @ApiMember(Description="Serial Number of the item")
/** @var string|null */
public ?string $serialNumber=null,
/** @description Unique Identifier of the Sell-out created in Booster */
// @ApiMember(Description="Unique Identifier of the Sell-out created in Booster")
/** @var int|null */
public ?int $saleDetailId=null,
/** @description Unique Identifier of the Sell-out created in Booster */
// @ApiMember(Description="Unique Identifier of the Sell-out created in Booster")
/** @var int|null */
public ?int $saleId=null,
/** @description Booster Customer Id */
// @ApiMember(Description="Booster Customer Id")
/** @var int|null */
public ?int $boosterCustomerId=null,
/** @description Possible warranty extention status IDs, 1 (Activated), 2 (Requested), 3 (Refused), 4 (Error), 5 (Action Required), 6 (Pending) */
// @ApiMember(Description="Possible warranty extention status IDs, 1 (Activated), 2 (Requested), 3 (Refused), 4 (Error), 5 (Action Required), 6 (Pending)")
/** @var array<int>|null */
public ?array $warrantyExtensionStatusIds=null,
/** @description Product Categories */
// @ApiMember(Description="Product Categories")
/** @var array<ProductCategory>|null */
public ?array $productCategories=null,
/** @description Index of the result set returned */
// @ApiMember(Description="Index of the result set returned", IsRequired=true)
/** @var int */
public int $page=0,
/** @description Size of the result set returned */
// @ApiMember(Description="Size of the result set returned", IsRequired=true)
/** @var int */
public int $items=0,
/** @description Omit precise record count - save on performance */
// @ApiMember(Description="Omit precise record count - save on performance")
/** @var bool|null */
public ?bool $noCount=null,
/** @description Sort Expression, Possible values: 'SaleDetailIdDESC', 'DocumentDate'. */
// @ApiMember(Description="Sort Expression, Possible values: 'SaleDetailIdDESC', 'DocumentDate'.")
/** @var string|null */
public ?string $sortBy=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['documentNumber'])) $this->documentNumber = $o['documentNumber'];
if (isset($o['documentDateFrom'])) $this->documentDateFrom = JsonConverters::from('DateTime', $o['documentDateFrom']);
if (isset($o['documentDateTo'])) $this->documentDateTo = JsonConverters::from('DateTime', $o['documentDateTo']);
if (isset($o['articleCode'])) $this->articleCode = $o['articleCode'];
if (isset($o['serialNumber'])) $this->serialNumber = $o['serialNumber'];
if (isset($o['saleDetailId'])) $this->saleDetailId = $o['saleDetailId'];
if (isset($o['saleId'])) $this->saleId = $o['saleId'];
if (isset($o['boosterCustomerId'])) $this->boosterCustomerId = $o['boosterCustomerId'];
if (isset($o['warrantyExtensionStatusIds'])) $this->warrantyExtensionStatusIds = JsonConverters::fromArray('int', $o['warrantyExtensionStatusIds']);
if (isset($o['productCategories'])) $this->productCategories = JsonConverters::fromArray('ProductCategory', $o['productCategories']);
if (isset($o['page'])) $this->page = $o['page'];
if (isset($o['items'])) $this->items = $o['items'];
if (isset($o['noCount'])) $this->noCount = $o['noCount'];
if (isset($o['sortBy'])) $this->sortBy = $o['sortBy'];
}
/** @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->documentNumber)) $o['documentNumber'] = $this->documentNumber;
if (isset($this->documentDateFrom)) $o['documentDateFrom'] = JsonConverters::to('DateTime', $this->documentDateFrom);
if (isset($this->documentDateTo)) $o['documentDateTo'] = JsonConverters::to('DateTime', $this->documentDateTo);
if (isset($this->articleCode)) $o['articleCode'] = $this->articleCode;
if (isset($this->serialNumber)) $o['serialNumber'] = $this->serialNumber;
if (isset($this->saleDetailId)) $o['saleDetailId'] = $this->saleDetailId;
if (isset($this->saleId)) $o['saleId'] = $this->saleId;
if (isset($this->boosterCustomerId)) $o['boosterCustomerId'] = $this->boosterCustomerId;
if (isset($this->warrantyExtensionStatusIds)) $o['warrantyExtensionStatusIds'] = JsonConverters::toArray('int', $this->warrantyExtensionStatusIds);
if (isset($this->productCategories)) $o['productCategories'] = JsonConverters::toArray('ProductCategory', $this->productCategories);
if (isset($this->page)) $o['page'] = $this->page;
if (isset($this->items)) $o['items'] = $this->items;
if (isset($this->noCount)) $o['noCount'] = $this->noCount;
if (isset($this->sortBy)) $o['sortBy'] = $this->sortBy;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /warranty HTTP/1.1 Host: dev-api-booster.richemont.com Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"page":0,"items":0,"totalPages":0,"totalResults":0}