| GET | /stock/{brand}/movement | Get movements |
|---|
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 MovementsRequest:
# @ApiMember(Description="Brand", IsRequired=true)
brand: Optional[str] = None
"""
Brand
"""
# @ApiMember(Description="POS Legacy", IsRequired=true)
pos_codes: Optional[List[str]] = None
"""
POS Legacy
"""
# @ApiMember(Description="Movement Type Ids")
movement_type_ids: Optional[List[int]] = None
"""
Movement Type Ids
"""
# @ApiMember(Description="Search Key (Article or SerialNumber)")
search_key: Optional[str] = None
"""
Search Key (Article or SerialNumber)
"""
# @ApiMember(Description="In Stock Since date from ")
date_from: Optional[datetime.datetime] = None
"""
In Stock Since date from
"""
# @ApiMember(Description="In Stock Since date to")
date_to: Optional[datetime.datetime] = None
"""
In Stock Since date to
"""
# @ApiMember(Description="Sort by date could be: 'DateDESC' or 'DateASC' (default is descending) ")
sort_by: Optional[str] = None
"""
Sort by date could be: 'DateDESC' or 'DateASC' (default is descending)
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Movement:
# @ApiMember(Description="Movement Id", IsRequired=true)
movement_id: int = 0
"""
Movement Id
"""
# @ApiMember(Description="Pos Code", IsRequired=true)
pos_code: Optional[str] = None
"""
Pos Code
"""
# @ApiMember(Description="Pos Name", IsRequired=true)
pos_name: Optional[str] = None
"""
Pos Name
"""
# @ApiMember(Description="Created By", IsRequired=true)
created_by: Optional[str] = None
"""
Created By
"""
# @ApiMember(Description="Movement Date", IsRequired=true)
movement_date: Optional[str] = None
"""
Movement Date
"""
# @ApiMember(Description="Article Code", IsRequired=true)
article_code: Optional[str] = None
"""
Article Code
"""
# @ApiMember(Description="Serial Number", IsRequired=true)
serial_number: Optional[str] = None
"""
Serial Number
"""
# @ApiMember(Description="Quantity", IsRequired=true)
quantity: int = 0
"""
Quantity
"""
# @ApiMember(Description="Movement Type Id", IsRequired=true)
movement_type_id: int = 0
"""
Movement Type Id
"""
# @ApiMember(Description="Comments", IsRequired=true)
comments: Optional[str] = None
"""
Comments
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetMovementsResponse:
# @ApiMember(Description="Total Pages", IsRequired=true)
total_pages: int = 0
"""
Total Pages
"""
# @ApiMember(Description="Total Results", IsRequired=true)
total_results: int = 0
"""
Total Results
"""
# @ApiMember(Description="Index of the result set returned", IsRequired=true)
page: int = 0
"""
Index of the result set returned
"""
# @ApiMember(Description="Size of the result set returned", IsRequired=true)
items: int = 0
"""
Size of the result set returned
"""
# @ApiMember(Description="List of movements", IsRequired=true)
elements: Optional[List[Movement]] = None
"""
List of movements
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetMovements(MovementsRequest, IPagedRequest):
# @ApiMember(Description="Index of the result set returned")
page: int = 0
"""
Index of the result set returned
"""
# @ApiMember(Description="Size of the result set returned")
items: int = 0
"""
Size of the result set returned
"""
# @ApiMember(Description="Omit precise record count - save on performance")
no_count: bool = False
"""
Omit precise record count - save on performance
"""
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}/movement 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}