| GET | /stock/{brand}/{posCode} | Get Paginated Stock |
|---|
import 'package:servicestack/servicestack.dart';
class RetailSalesPrice implements IConvertible
{
/**
* Currency Iso Code
*/
// @ApiMember(Description="Currency Iso Code", IsRequired=true)
String? currencyIsoCode;
/**
* Value
*/
// @ApiMember(Description="Value", IsRequired=true)
double? value;
RetailSalesPrice({this.currencyIsoCode,this.value});
RetailSalesPrice.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
currencyIsoCode = json['currencyIsoCode'];
value = JsonConverters.toDouble(json['value']);
return this;
}
Map<String, dynamic> toJson() => {
'currencyIsoCode': currencyIsoCode,
'value': value
};
getTypeName() => "RetailSalesPrice";
TypeContext? context = _ctx;
}
class PaginatedStockElement implements IConvertible
{
/**
* Pos Code
*/
// @ApiMember(Description="Pos Code", IsRequired=true)
String? posCode;
/**
* Pos Code To Be Displayed
*/
// @ApiMember(Description="Pos Code To Be Displayed", IsRequired=true)
String? posCodeToBeDisplayed;
/**
* Article Code
*/
// @ApiMember(Description="Article Code", IsRequired=true)
String? articleCode;
/**
* Serial Number
*/
// @ApiMember(Description="Serial Number")
String? serialNumber;
/**
* Current Stock Quantity
*/
// @ApiMember(Description="Current Stock Quantity", IsRequired=true)
int? quantity;
/**
* Type e.g. consignment or standard
*/
// @ApiMember(Description="Type e.g. consignment or standard", IsRequired=true)
String? type;
/**
* Is Consignment Sellable
*/
// @ApiMember(Description="Is Consignment Sellable ", IsRequired=true)
bool? isConsignmentSellable;
/**
* Retail Sales Price
*/
// @ApiMember(Description="Retail Sales Price", IsRequired=true)
RetailSalesPrice? retailSalesPrice;
PaginatedStockElement({this.posCode,this.posCodeToBeDisplayed,this.articleCode,this.serialNumber,this.quantity,this.type,this.isConsignmentSellable,this.retailSalesPrice});
PaginatedStockElement.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
posCode = json['posCode'];
posCodeToBeDisplayed = json['posCodeToBeDisplayed'];
articleCode = json['articleCode'];
serialNumber = json['serialNumber'];
quantity = json['quantity'];
type = json['type'];
isConsignmentSellable = json['isConsignmentSellable'];
retailSalesPrice = JsonConverters.fromJson(json['retailSalesPrice'],'RetailSalesPrice',context!);
return this;
}
Map<String, dynamic> toJson() => {
'posCode': posCode,
'posCodeToBeDisplayed': posCodeToBeDisplayed,
'articleCode': articleCode,
'serialNumber': serialNumber,
'quantity': quantity,
'type': type,
'isConsignmentSellable': isConsignmentSellable,
'retailSalesPrice': JsonConverters.toJson(retailSalesPrice,'RetailSalesPrice',context!)
};
getTypeName() => "PaginatedStockElement";
TypeContext? context = _ctx;
}
class GetStockPaginatedResponse implements IConvertible
{
/**
* Total Pages
*/
// @ApiMember(Description="Total Pages", IsRequired=true)
int? totalPages;
/**
* Total Results
*/
// @ApiMember(Description="Total Results", IsRequired=true)
int? totalResults;
/**
* Index of the result set returned
*/
// @ApiMember(Description="Index of the result set returned", IsRequired=true)
int? page;
/**
* Size of the result set returned
*/
// @ApiMember(Description="Size of the result set returned", IsRequired=true)
int? items;
/**
* List of movements
*/
// @ApiMember(Description="List of movements", IsRequired=true)
List<PaginatedStockElement>? elements;
GetStockPaginatedResponse({this.totalPages,this.totalResults,this.page,this.items,this.elements});
GetStockPaginatedResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
totalPages = json['totalPages'];
totalResults = json['totalResults'];
page = json['page'];
items = json['items'];
elements = JsonConverters.fromJson(json['elements'],'List<PaginatedStockElement>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'totalPages': totalPages,
'totalResults': totalResults,
'page': page,
'items': items,
'elements': JsonConverters.toJson(elements,'List<PaginatedStockElement>',context!)
};
getTypeName() => "GetStockPaginatedResponse";
TypeContext? context = _ctx;
}
class GetStockPaginated implements IPagedRequest, IConvertible
{
/**
* Brand
*/
// @ApiMember(Description="Brand", IsRequired=true)
String? brand;
/**
* POS Legacy
*/
// @ApiMember(Description="POS Legacy", IsRequired=true)
String? posCode;
/**
* Search Key (Article or SerialNumber)
*/
// @ApiMember(Description="Search Key (Article or SerialNumber)")
String? searchKey;
/**
* Index of the result set returned
*/
// @ApiMember(Description="Index of the result set returned")
int? page;
/**
* Size of the result set returned
*/
// @ApiMember(Description="Size of the result set returned")
int? items;
/**
* Omit precise record count - save on performance
*/
// @ApiMember(Description="Omit precise record count - save on performance")
bool? noCount;
/**
* Sorting expression
*/
// @ApiMember(Description="Sorting expression")
String? sortBy;
/**
* Parameter - Include Chain POSes Stock
*/
// @ApiMember(Description="Parameter - Include Chain POSes Stock ")
bool? includeChainPosesStock;
/**
* Include Retail Sales Price in the Output, by default: false
*/
// @ApiMember(Description="Include Retail Sales Price in the Output, by default: false")
bool? includeRSP;
GetStockPaginated({this.brand,this.posCode,this.searchKey,this.page,this.items,this.noCount,this.sortBy,this.includeChainPosesStock,this.includeRSP});
GetStockPaginated.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
brand = json['brand'];
posCode = json['posCode'];
searchKey = json['searchKey'];
page = json['page'];
items = json['items'];
noCount = json['noCount'];
sortBy = json['sortBy'];
includeChainPosesStock = json['includeChainPosesStock'];
includeRSP = json['includeRSP'];
return this;
}
Map<String, dynamic> toJson() => {
'brand': brand,
'posCode': posCode,
'searchKey': searchKey,
'page': page,
'items': items,
'noCount': noCount,
'sortBy': sortBy,
'includeChainPosesStock': includeChainPosesStock,
'includeRSP': includeRSP
};
getTypeName() => "GetStockPaginated";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'dev_api_booster.richemont.com', types: <String, TypeInfo> {
'RetailSalesPrice': TypeInfo(TypeOf.Class, create:() => RetailSalesPrice()),
'PaginatedStockElement': TypeInfo(TypeOf.Class, create:() => PaginatedStockElement()),
'GetStockPaginatedResponse': TypeInfo(TypeOf.Class, create:() => GetStockPaginatedResponse()),
'List<PaginatedStockElement>': TypeInfo(TypeOf.Class, create:() => <PaginatedStockElement>[]),
'GetStockPaginated': TypeInfo(TypeOf.Class, create:() => GetStockPaginated()),
});
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}/{posCode} HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"totalPages":0,"totalResults":0,"page":0,"items":0}