feat(inventory): implement numeric stock inventory across fullstack and improve prescription UX handoff
This commit is contained in:
1 parent
e9582430e6
commit
741365f04c
13 files changed
+177
-47
No files matched your search
@@ -581,7 +581,8 @@ export class AdminService {
|
||||
metaDescription: data.metaDescription || '',
|
||||
keywords: data.keywords || '',
|
||||
canonicalUrl: data.canonicalUrl || '',
|
||||
stockStatus: data.stockStatus || 'IN_STOCK',
|
||||
stock: data.stock !== undefined ? Number(data.stock) : (data.stockStatus === 'OUT_OF_STOCK' ? 0 : 100),
|
||||
stockStatus: data.stockStatus || (data.stock !== undefined && Number(data.stock) <= 0 ? 'OUT_OF_STOCK' : 'IN_STOCK'),
|
||||
noIndex: data.noIndex ?? false,
|
||||
noFollow: data.noFollow ?? false,
|
||||
ogImage: data.ogImage || null,
|
||||
@@ -761,8 +762,14 @@ export class AdminService {
|
||||
metaDescription: data.metaDescription,
|
||||
keywords: data.keywords,
|
||||
canonicalUrl: data.canonicalUrl,
|
||||
stock:
|
||||
data.stock !== undefined ? Number(data.stock) : undefined,
|
||||
stockStatus:
|
||||
data.stockStatus !== undefined ? data.stockStatus : undefined,
|
||||
data.stockStatus !== undefined
|
||||
? data.stockStatus
|
||||
: (data.stock !== undefined
|
||||
? (Number(data.stock) <= 0 ? 'OUT_OF_STOCK' : 'IN_STOCK')
|
||||
: undefined),
|
||||
noIndex: data.noIndex !== undefined ? data.noIndex : undefined,
|
||||
noFollow: data.noFollow !== undefined ? data.noFollow : undefined,
|
||||
ogImage: data.ogImage !== undefined ? data.ogImage : undefined,
|
||||
|
||||
@@ -241,6 +241,11 @@ export class ProductDto {
|
||||
@IsString()
|
||||
stockStatus?: 'IN_STOCK' | 'OUT_OF_STOCK' | 'PRE_ORDER' | 'DISCONTINUED';
|
||||
|
||||
@ApiPropertyOptional({ description: 'تعداد موجودی در انبار' })
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
stock?: number;
|
||||
|
||||
@ApiPropertyOptional({ description: 'عدم ایندکس توسط موتورهای جستجو' })
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
|
||||
Reference in new issue
Block a user