| GET | /aggregatedStock/{brand}/{posCode} | Get aggregated stock |
|---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ClusterStockItem:
# @ApiMember(Description="Article Code", IsRequired=true)
article_code: Optional[str] = None
"""
Article Code
"""
# @ApiMember(Description="Asset Quantity", IsRequired=true)
asset_quantity: int = 0
"""
Asset Quantity
"""
# @ApiMember(Description="Consignment Quantity", IsRequired=true)
consignment_quantity: int = 0
"""
Consignment Quantity
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ClusterStock:
# @ApiMember(Description="Cluster code", IsRequired=true)
cluster_code: Optional[str] = None
"""
Cluster code
"""
# @ApiMember(Description="Stock Items", IsRequired=true)
stock_items: Optional[List[ClusterStockItem]] = None
"""
Stock Items
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AggregatedStockResponse(ClusterStock):
pass
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetAggregatedStock:
# @ApiMember(Description="Brand", IsRequired=true)
brand: Optional[str] = None
"""
Brand
"""
# @ApiMember(Description="Authorized POS Code e.g. ES100:102048", IsRequired=true)
pos_code: Optional[str] = None
"""
Authorized POS Code e.g. ES100:102048
"""
# @ApiMember(Description="Article Codes")
article_codes: Optional[List[str]] = None
"""
Article Codes
"""
Python GetAggregatedStock DTOs
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.
GET /aggregatedStock/{brand}/{posCode} HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
clusterCode: String,
stockItems:
[
{
articleCode: String,
assetQuantity: 0,
consignmentQuantity: 0
}
]
}