Class JpaSkuInventory

  • All Implemented Interfaces:
    com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware, com.broadleafcommerce.data.tracking.core.ApplicationTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking>, com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware, com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable, com.broadleafcommerce.data.tracking.core.Trackable, com.broadleafcommerce.data.tracking.core.TypedTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking>, Serializable

    @Entity
    @TrackableExtension(APPLICATION)
    public class JpaSkuInventory
    extends Object
    implements Serializable, com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable, com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware, com.broadleafcommerce.data.tracking.core.ApplicationTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking>
    See Also:
    Serialized Form
    • Constructor Detail

      • JpaSkuInventory

        public JpaSkuInventory()
    • Method Detail

      • getBusinessDomainType

        public Class<?> getBusinessDomainType()
        Specified by:
        getBusinessDomainType in interface com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
      • fromMe

        public org.modelmapper.ModelMapper fromMe()
        Specified by:
        fromMe in interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
      • toMe

        public org.modelmapper.ModelMapper toMe()
        Specified by:
        toMe in interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
      • getContextId

        public String getContextId()
        The jpa primary key.
        Specified by:
        getContextId in interface com.broadleafcommerce.data.tracking.core.Trackable
        Returns:
        The jpa primary key
      • getInventoryLocationContextId

        public String getInventoryLocationContextId()
        This is a soft foreign key reference to JpaInventoryLocation.
      • getSkuCode

        public String getSkuCode()
        Arbitrary code or identifier for a unique SKU. This is mot necessarily a primary key nor a reference to an external system's primary key. Rather, this is an arbitrary SKU code, or additional reference. For example this could be a customer-facing SKU reference code.
      • getExternalId

        public String getExternalId()
        External (1st or 3rd party) system reference to a unique SKU. For example, ERP or 3rd party inventory system primary key for a SKU reference. This is essentially a soft foreign key to a non-Broadleaf system..
      • getUpc

        public String getUpc()
        Meant to hold UPC, or Universal Product Code. UPC is a subset of GTIN-12, GTIN-13, and GTIN-14. UPC-A is most common and contains 12 digits. UPC-A and EAN-13 are essentially the same, except for a country code. Less common UPC formats include UPC-B, UPC-C, UPC-D, UPC-E, UPC-2, and UPC-5. We hold it here to allow us to store a particular UPC in addition to a different EAN and a GTIN-14, for example.
      • getEan

        public String getEan()
        Meant to hold EAN, or European Article Number (a.k.a. International Article Number). EAN is a subset of GTIN-8 and GTIN-13. EAN-13 is essentially the same as UPC-A, except that it contains an additional digit representing the country code.
      • getGtin

        public String getGtin()
        GTIN (Global Trade Item Number) This holds all GTIN formats. GTIN-14 is 14 digits. This is a GS1 superset that generally includes:

        GTIN-12 (UPC-A)

        GTIN-8 (EAN/UCC-8)

        GTIN-13 (EAN/UCC-13)

        GTIN-14 (EAN/UCC-14 or ITF-14)

      • getSkuName

        public String getSkuName()
        Optional convenience field to store a human readable name for the SKU. Especially useful when administering inventory via the Broadleaf Admin, or when looking at inventory data in the database.
        Returns:
      • getQuantityAvailable

        public Integer getQuantityAvailable()
        This is really a calculated field. It should be (quantityOnHand - quantityReserved - safetyStock). We store it to conveniently query for available items.
      • getQuantityReserved

        public Integer getQuantityReserved()
        Quantity of items that are reserved (i.e. been sold but not fulfilled).
      • getQuantityOnHand

        public Integer getQuantityOnHand()
        Physical count of items available.
      • getQuantityOnOrder

        public Integer getQuantityOnOrder()
        Optional number of items that are expected to arrive in the warehouse in the near term. This does not affect availability, but allows for backorder capabilities.
      • getSafetyStock

        public Integer getSafetyStock()
        An optional field that indicates how many should be reserved in the count or calculation of availability.
      • getTracking

        public com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking getTracking()
        Specified by:
        getTracking in interface com.broadleafcommerce.data.tracking.core.Trackable
        See Also:
        ApplicationJpaTracking
      • setContextId

        public void setContextId​(String contextId)
        The jpa primary key.
        Specified by:
        setContextId in interface com.broadleafcommerce.data.tracking.core.Trackable
        Parameters:
        INVENTORY_ID - (or contextId) - The jpa primary key
      • setInventoryLocationContextId

        public void setInventoryLocationContextId​(String inventoryLocationContextId)
        This is a soft foreign key reference to JpaInventoryLocation.
      • setSkuCode

        public void setSkuCode​(String skuCode)
        Arbitrary code or identifier for a unique SKU. This is mot necessarily a primary key nor a reference to an external system's primary key. Rather, this is an arbitrary SKU code, or additional reference. For example this could be a customer-facing SKU reference code.
      • setExternalId

        public void setExternalId​(String externalId)
        External (1st or 3rd party) system reference to a unique SKU. For example, ERP or 3rd party inventory system primary key for a SKU reference. This is essentially a soft foreign key to a non-Broadleaf system..
      • setUpc

        public void setUpc​(String upc)
        Meant to hold UPC, or Universal Product Code. UPC is a subset of GTIN-12, GTIN-13, and GTIN-14. UPC-A is most common and contains 12 digits. UPC-A and EAN-13 are essentially the same, except for a country code. Less common UPC formats include UPC-B, UPC-C, UPC-D, UPC-E, UPC-2, and UPC-5. We hold it here to allow us to store a particular UPC in addition to a different EAN and a GTIN-14, for example.
      • setEan

        public void setEan​(String ean)
        Meant to hold EAN, or European Article Number (a.k.a. International Article Number). EAN is a subset of GTIN-8 and GTIN-13. EAN-13 is essentially the same as UPC-A, except that it contains an additional digit representing the country code.
      • setGtin

        public void setGtin​(String gtin)
        GTIN (Global Trade Item Number) This holds all GTIN formats. GTIN-14 is 14 digits. This is a GS1 superset that generally includes:

        GTIN-12 (UPC-A)

        GTIN-8 (EAN/UCC-8)

        GTIN-13 (EAN/UCC-13)

        GTIN-14 (EAN/UCC-14 or ITF-14)

      • setSkuName

        public void setSkuName​(String skuName)
        Optional convenience field to store a human readable name for the SKU. Especially useful when administering inventory via the Broadleaf Admin, or when looking at inventory data in the database.
        Parameters:
        skuName -
      • setQuantityAvailable

        public void setQuantityAvailable​(Integer quantityAvailable)
        This is really a calculated field. It should be (quantityOnHand - quantityReserved - safetyStock). We store it to conveniently query for available items.
      • setQuantityReserved

        public void setQuantityReserved​(Integer quantityReserved)
        Quantity of items that are reserved (i.e. been sold but not fulfilled).
      • setQuantityOnHand

        public void setQuantityOnHand​(Integer quantityOnHand)
        Physical count of items available.
      • setQuantityOnOrder

        public void setQuantityOnOrder​(Integer quantityOnOrder)
        Optional number of items that are expected to arrive in the warehouse in the near term. This does not affect availability, but allows for backorder capabilities.
      • setSafetyStock

        public void setSafetyStock​(Integer safetyStock)
        An optional field that indicates how many should be reserved in the count or calculation of availability.
      • setTracking

        public void setTracking​(com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking tracking)
        Specified by:
        setTracking in interface com.broadleafcommerce.data.tracking.core.TypedTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking>
        See Also:
        ApplicationJpaTracking
      • canEqual

        protected boolean canEqual​(Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object