import { DaffProductFacadeInterface } from '@daffodil/product/state'
A facade for getting state about a particular product.
interface DaffProductFacadeInterface<T extends DaffProduct = DaffProduct> {
getProduct(id: T["id"]): Observable<T>
getPrice(id: T["id"]): Observable<number>
hasDiscount(id: T["id"]): Observable<boolean>
getDiscountAmount(id: T["id"]): Observable<number>
getDiscountedPrice(id: T["id"]): Observable<number>
getDiscountPercent(id: T["id"]): Observable<number>
isOutOfStock(id: T["id"]): Observable<boolean>
}
ObservableGet a product.
| Parameter | id: T["id"] |
|---|---|
| Description | a product id |
ObservableGet the original price for a product.
| Parameter | id: T["id"] |
|---|---|
| Description | a product id |
ObservableWhether a particular product has a discount.
| Parameter | id: T["id"] |
|---|---|
| Description | a product id |
ObservableGet the discount amount of a product.
| Parameter | id: T["id"] |
|---|---|
| Description | a product id |
ObservableGet the discounted price for a product.
| Parameter | id: T["id"] |
|---|---|
| Description | a product id |
ObservableGet the discount percent of a product.
| Parameter | id: T["id"] |
|---|---|
| Description | a product id |
ObservableWhether a product is out of stock.
| Parameter | id: T["id"] |
|---|---|
| Description | a product id |