fix some bugs from ghatreh
This commit is contained in:
@@ -234,6 +234,11 @@ export function getProductSellPrice(product?: Product | null): number {
|
||||
return base - resolveProductCashFeeSellRial(product, base)
|
||||
}
|
||||
|
||||
/** کارت فروشگاه: قیمت نمایشی صفر → «بدون قیمت» */
|
||||
export function isProductWithoutDisplayPrice(product?: Product | null): boolean {
|
||||
return getProductBuyPrice(product) <= 0
|
||||
}
|
||||
|
||||
export function isProductPriceInactive(product?: Product | null): boolean {
|
||||
if (!product) {
|
||||
return true
|
||||
|
||||
@@ -9,12 +9,14 @@ function asBool(value: boolean | number | null | undefined) {
|
||||
|
||||
export function isProductBuyOpen(product: TradeOpenProduct) {
|
||||
if (!product) return true
|
||||
return asBool(product?.open_buy)
|
||||
if (product.open_buy === undefined || product.open_buy === null) return true
|
||||
return asBool(product.open_buy)
|
||||
}
|
||||
|
||||
export function isProductSellOpen(product: TradeOpenProduct) {
|
||||
if (!product) return true
|
||||
return asBool(product?.open_sell)
|
||||
if (product.open_sell === undefined || product.open_sell === null) return true
|
||||
return asBool(product.open_sell)
|
||||
}
|
||||
|
||||
export function isAnyProductTradeOpen(product: TradeOpenProduct) {
|
||||
|
||||
Reference in New Issue
Block a user