OrderResult

public struct OrderResult : Decodable

A result model representing the Orders that were fetched for a give OrderQuery

  • The total number of orders matching the given query

    Declaration

    Swift

    public let total: Int
  • An Array<Order> representing the results of the query

    Declaration

    Swift

    public private(set) var orders: [Int : Order]
  • The fromDate part of the OrderQuery that matches the result

    Declaration

    Swift

    public let fromDate: Date?
  • The toDate part of the OrderQuery that matches the result

    Declaration

    Swift

    public let toDate: Date
  • Determines if the given OrderResult is result-equivalent to self

    • to: The OrderResult to compare against

    Declaration

    Swift

    public func isResultEquivalent(to: OrderResult) -> Bool

    Return Value

    A Bool indicating result-equivalency

  • Merges self with the given OrderResult.

    • result: The OrderResult to merge with

    Declaration

    Swift

    public func merge(_ result: OrderResult) -> OrderResult?

    Return Value

    A merged OrderResult if the two OrderResults are result-equivalent; nil otherwise.

  • Updates a specific Orderin the internal storage

    • order: The Order to be updated

    Throws

    An OrderResultError if the Orderwas not part of the result

    Declaration

    Swift

    @discardableResult
    mutating public func update(_ order: Order) throws -> Int

    Return Value

    The index in which the Order was updated

  • Declaration

    Swift

    public init(from decoder: Decoder) throws