| GET | /stock/{brand}/movement | Get movements |
|---|
import Foundation
import ServiceStack
public class GetMovements : MovementsRequest, IPagedRequest
{
/**
* Index of the result set returned
*/
// @ApiMember(Description="Index of the result set returned")
public var page:Int
/**
* Size of the result set returned
*/
// @ApiMember(Description="Size of the result set returned")
public var items:Int
/**
* Omit precise record count - save on performance
*/
// @ApiMember(Description="Omit precise record count - save on performance")
public var noCount:Bool
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case page
case items
case noCount
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
page = try container.decodeIfPresent(Int.self, forKey: .page)
items = try container.decodeIfPresent(Int.self, forKey: .items)
noCount = try container.decodeIfPresent(Bool.self, forKey: .noCount)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if page != nil { try container.encode(page, forKey: .page) }
if items != nil { try container.encode(items, forKey: .items) }
if noCount != nil { try container.encode(noCount, forKey: .noCount) }
}
}
public class MovementsRequest : Codable
{
/**
* Brand
*/
// @ApiMember(Description="Brand", IsRequired=true)
public var brand:String
/**
* POS Legacy
*/
// @ApiMember(Description="POS Legacy", IsRequired=true)
public var posCodes:[String] = []
/**
* Movement Type Ids
*/
// @ApiMember(Description="Movement Type Ids")
public var movementTypeIds:[Int] = []
/**
* Search Key (Article or SerialNumber)
*/
// @ApiMember(Description="Search Key (Article or SerialNumber)")
public var searchKey:String
/**
* In Stock Since date from
*/
// @ApiMember(Description="In Stock Since date from ")
public var dateFrom:Date?
/**
* In Stock Since date to
*/
// @ApiMember(Description="In Stock Since date to")
public var dateTo:Date?
/**
* Sort by date could be: 'DateDESC' or 'DateASC' (default is descending)
*/
// @ApiMember(Description="Sort by date could be: 'DateDESC' or 'DateASC' (default is descending) ")
public var sortBy:String
required public init(){}
}
public class GetMovementsResponse : Codable
{
/**
* Total Pages
*/
// @ApiMember(Description="Total Pages", IsRequired=true)
public var totalPages:Int
/**
* Total Results
*/
// @ApiMember(Description="Total Results", IsRequired=true)
public var totalResults:Int
/**
* Index of the result set returned
*/
// @ApiMember(Description="Index of the result set returned", IsRequired=true)
public var page:Int
/**
* Size of the result set returned
*/
// @ApiMember(Description="Size of the result set returned", IsRequired=true)
public var items:Int
/**
* List of movements
*/
// @ApiMember(Description="List of movements", IsRequired=true)
public var elements:[Movement] = []
required public init(){}
}
public class Movement : Codable
{
/**
* Movement Id
*/
// @ApiMember(Description="Movement Id", IsRequired=true)
public var movementId:Int
/**
* Pos Code
*/
// @ApiMember(Description="Pos Code", IsRequired=true)
public var posCode:String
/**
* Pos Name
*/
// @ApiMember(Description="Pos Name", IsRequired=true)
public var posName:String
/**
* Created By
*/
// @ApiMember(Description="Created By", IsRequired=true)
public var createdBy:String
/**
* Movement Date
*/
// @ApiMember(Description="Movement Date", IsRequired=true)
public var movementDate:String
/**
* Article Code
*/
// @ApiMember(Description="Article Code", IsRequired=true)
public var articleCode:String
/**
* Serial Number
*/
// @ApiMember(Description="Serial Number", IsRequired=true)
public var serialNumber:String
/**
* Quantity
*/
// @ApiMember(Description="Quantity", IsRequired=true)
public var quantity:Int
/**
* Movement Type Id
*/
// @ApiMember(Description="Movement Type Id", IsRequired=true)
public var movementTypeId:Int
/**
* Comments
*/
// @ApiMember(Description="Comments", IsRequired=true)
public var comments:String
required public init(){}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
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: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"totalPages":0,"totalResults":0,"page":0,"items":0}