InventoryItem

open class InventoryItem: Identifiable

Description

This is the base class for an inventory-managed product in the StockManagerAPI.

Dependencies

Foundation

Usage

let item = InventoryItem(name: "An Item", locations: [(Location("Somewhere"), .jHook, .processed)], customerAccessibleQuantity: 0, backstockQuantity: 0)

Inheritance

Identifiable

Initializers

init(userDesignatedID:name:locations:dateLastPurchased:customerAccessibleQuantity:backstockQuantity:)

public init(userDesignatedID: String = "", name: String, locations: [(Location, LocationType, Accessibility)] = [], dateLastPurchased: Date? = nil, customerAccessibleQuantity: Int = 0, backstockQuantity: Int = 0)

Properties

totalInStoreQuantity

var totalInStoreQuantity: Int

id

Description: The internal identifier, specific to our system. Type: UUID

var id: UUID

userDesignatedID

Description: Identifier optional if client has their own system identifier

var userDesignatedID: String

name

Description: The name of the item

var name: String

locations

An array of tuples describing an inventory item's location and accessibility

var locations: [(Location, LocationType, Accessibility)]
Tuple Members:

0: Location

1: LocationType

2: Accessibility

customerAccessibleQuantity

Description: The quantity of this item available for purchase by customers

var customerAccessibleQuantity: Int

backstockQuantity

Description: The quantity of this item NOT available for purchase by customers. This may be because the item is unprocessed, on hold, etc.

var backstockQuantity: Int

dateLastPurchased

Description: The date that this item was last purchased from a register at this location. (Independent of any store returns) Type: Date

var dateLastPurchased: Date?