All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sphere.sdk.inventory.InventoryEntry Maven / Gradle / Ivy

There is a newer version: 1.0.0-M26
Show newest version
package io.sphere.sdk.inventory;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.sphere.sdk.channels.Channel;
import io.sphere.sdk.models.Resource;
import io.sphere.sdk.models.Reference;

import javax.annotation.Nullable;
import java.time.ZonedDateTime;

@JsonDeserialize(as = InventoryEntryImpl.class)
public interface InventoryEntry extends Resource {
    Long getAvailableQuantity();

    @Nullable
    ZonedDateTime getExpectedDelivery();

    Long getQuantityOnStock();

    @Nullable
    Integer getRestockableInDays();

    String getSku();

    @Nullable
    Reference getSupplyChannel();

    //reservations are internal

    default Reference toReference() {
        return Reference.of(referenceTypeId(), getId(), this);
    }

    static String referenceTypeId(){
        return "inventory-entry";
    }

    /**
     *
     * @deprecated use {@link #referenceTypeId()} instead
     */
    @Deprecated
    static String typeId(){
        return "inventory-entry";
    }

    static TypeReference typeReference(){
        return new TypeReference() {
            @Override
            public String toString() {
                return "TypeReference";
            }
        };
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy