| GET | /aggregatedStock/{brand}/{posCode} | Get aggregated stock |
|---|
import 'package:servicestack/servicestack.dart';
class ClusterStockItem implements IConvertible
{
/**
* Article Code
*/
// @ApiMember(Description="Article Code", IsRequired=true)
String articleCode = "";
/**
* Asset Quantity
*/
// @ApiMember(Description="Asset Quantity", IsRequired=true)
int assetQuantity = 0;
/**
* Consignment Quantity
*/
// @ApiMember(Description="Consignment Quantity", IsRequired=true)
int consignmentQuantity = 0;
ClusterStockItem({this.articleCode="",this.assetQuantity=0,this.consignmentQuantity=0});
ClusterStockItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
articleCode = json['articleCode'] ?? "";
assetQuantity = json['assetQuantity'] ?? 0;
consignmentQuantity = json['consignmentQuantity'] ?? 0;
return this;
}
Map<String, dynamic> toJson() => {
'articleCode': articleCode,
'assetQuantity': assetQuantity,
'consignmentQuantity': consignmentQuantity
};
getTypeName() => "ClusterStockItem";
TypeContext? context = _ctx;
}
class ClusterStock implements IConvertible
{
/**
* Cluster code
*/
// @ApiMember(Description="Cluster code", IsRequired=true)
String clusterCode = "";
/**
* Stock Items
*/
// @ApiMember(Description="Stock Items", IsRequired=true)
List<ClusterStockItem> stockItems = [];
ClusterStock({this.clusterCode="",this.stockItems=const []});
ClusterStock.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
clusterCode = json['clusterCode'] ?? "";
stockItems = JsonConverters.fromJson(json['stockItems'],'List<ClusterStockItem>',context!) ?? [];
return this;
}
Map<String, dynamic> toJson() => {
'clusterCode': clusterCode,
'stockItems': JsonConverters.toJson(stockItems,'List<ClusterStockItem>',context!)
};
getTypeName() => "ClusterStock";
TypeContext? context = _ctx;
}
class AggregatedStockResponse extends ClusterStock implements IConvertible
{
AggregatedStockResponse();
AggregatedStockResponse.fromJson(Map<String, dynamic> json) : super.fromJson(json);
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
return this;
}
Map<String, dynamic> toJson() => super.toJson();
getTypeName() => "AggregatedStockResponse";
TypeContext? context = _ctx;
}
class GetAggregatedStock implements IConvertible
{
/**
* Brand
*/
// @ApiMember(Description="Brand", IsRequired=true)
String brand = "";
/**
* Authorized POS Code e.g. ES100:102048
*/
// @ApiMember(Description="Authorized POS Code e.g. ES100:102048", IsRequired=true)
String posCode = "";
/**
* Article Codes
*/
// @ApiMember(Description="Article Codes")
List<String>? articleCodes;
/**
* Storage Location Identifier e.g. CPO, NEW, REP
*/
// @ApiMember(Description="Storage Location Identifier e.g. CPO, NEW, REP")
String? storageLocationId;
/**
* Inventory segment e.g. CPO or empty
*/
// @ApiMember(Description="Inventory segment e.g. CPO or empty")
String? inventorySegment;
GetAggregatedStock({this.brand="",this.posCode="",this.articleCodes,this.storageLocationId,this.inventorySegment});
GetAggregatedStock.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
brand = json['brand'] ?? "";
posCode = json['posCode'] ?? "";
articleCodes = JsonConverters.fromJson(json['articleCodes'],'List<String>',context!);
storageLocationId = json['storageLocationId'];
inventorySegment = json['inventorySegment'];
return this;
}
Map<String, dynamic> toJson() => {
'brand': brand,
'posCode': posCode,
'articleCodes': JsonConverters.toJson(articleCodes,'List<String>',context!),
'storageLocationId': storageLocationId,
'inventorySegment': inventorySegment
};
getTypeName() => "GetAggregatedStock";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'dev_api_booster.richemont.com', types: <String, TypeInfo> {
'ClusterStockItem': TypeInfo(TypeOf.Class, create:() => ClusterStockItem()),
'ClusterStock': TypeInfo(TypeOf.Class, create:() => ClusterStock()),
'List<ClusterStockItem>': TypeInfo(TypeOf.Class, create:() => <ClusterStockItem>[]),
'AggregatedStockResponse': TypeInfo(TypeOf.Class, create:() => AggregatedStockResponse()),
'GetAggregatedStock': TypeInfo(TypeOf.Class, create:() => GetAggregatedStock()),
});
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 /aggregatedStock/{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
{"clusterCode":"String","stockItems":[{"articleCode":"String","assetQuantity":0,"consignmentQuantity":0}]}