feat(seo): implement technical SEO for product catalog, dynamic sitemaps, RSS feeds and graphify update
Deploy Canina / deploy (push) Has been cancelled
Deploy Canina / deploy (push) Has been cancelled
This commit is contained in:
1 parent
5705354429
commit
75b9d55a24
14 files changed
+826
-153
No files matched your search
@@ -223,7 +223,13 @@ model Product {
|
||||
metaDescription String? @map("meta_description") @db.Text
|
||||
canonicalUrl String? @map("canonical_url") @db.Text
|
||||
keywords String? @db.Text
|
||||
stockStatus StockStatus @default(IN_STOCK) @map("stock_status")
|
||||
noIndex Boolean @default(false) @map("no_index")
|
||||
noFollow Boolean @default(false) @map("no_follow")
|
||||
ogImage String? @map("og_image") @db.Text
|
||||
featuredImageAlt String? @map("featured_image_alt") @db.VarChar(255)
|
||||
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz()
|
||||
updatedAt DateTime @default(now()) @updatedAt @map("updated_at") @db.Timestamptz()
|
||||
|
||||
category Category @relation(fields: [categoryId], references: [id])
|
||||
ingredientList ProductIngredient[]
|
||||
@@ -242,6 +248,13 @@ model Product {
|
||||
@@map("products")
|
||||
}
|
||||
|
||||
enum StockStatus {
|
||||
IN_STOCK
|
||||
OUT_OF_STOCK
|
||||
PRE_ORDER
|
||||
DISCONTINUED
|
||||
}
|
||||
|
||||
|
||||
|
||||
model ProductIngredient {
|
||||
|
||||
@@ -436,6 +436,11 @@ export class AdminService {
|
||||
metaDescription: data.metaDescription || '',
|
||||
keywords: data.keywords || '',
|
||||
canonicalUrl: data.canonicalUrl || '',
|
||||
stockStatus: data.stockStatus || 'IN_STOCK',
|
||||
noIndex: data.noIndex ?? false,
|
||||
noFollow: data.noFollow ?? false,
|
||||
ogImage: data.ogImage || null,
|
||||
featuredImageAlt: data.featuredImageAlt || null,
|
||||
slug: data.slug || data.artNo || `slug-${Date.now()}`,
|
||||
},
|
||||
});
|
||||
@@ -511,6 +516,11 @@ export class AdminService {
|
||||
metaDescription: data.metaDescription,
|
||||
keywords: data.keywords,
|
||||
canonicalUrl: data.canonicalUrl,
|
||||
stockStatus: data.stockStatus !== undefined ? data.stockStatus : undefined,
|
||||
noIndex: data.noIndex !== undefined ? data.noIndex : undefined,
|
||||
noFollow: data.noFollow !== undefined ? data.noFollow : undefined,
|
||||
ogImage: data.ogImage !== undefined ? data.ogImage : undefined,
|
||||
featuredImageAlt: data.featuredImageAlt !== undefined ? data.featuredImageAlt : undefined,
|
||||
slug: data.slug || data.artNo,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -198,6 +198,31 @@ export class ProductDto {
|
||||
@IsArray()
|
||||
symptoms?: string[];
|
||||
|
||||
@ApiPropertyOptional({ description: 'وضعیت موجودی کالا (IN_STOCK, OUT_OF_STOCK, PRE_ORDER, DISCONTINUED)' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
stockStatus?: 'IN_STOCK' | 'OUT_OF_STOCK' | 'PRE_ORDER' | 'DISCONTINUED';
|
||||
|
||||
@ApiPropertyOptional({ description: 'عدم ایندکس توسط موتورهای جستجو' })
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
noIndex?: boolean;
|
||||
|
||||
@ApiPropertyOptional({ description: 'عدم دنبال کردن لینکها توسط موتورهای جستجو' })
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
noFollow?: boolean;
|
||||
|
||||
@ApiPropertyOptional({ description: 'تصویر کارت شبکههای اجتماعی (og:image)' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
ogImage?: string | null;
|
||||
|
||||
@ApiPropertyOptional({ description: 'متن جایگزین تصویر اصلی (alt)' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
featuredImageAlt?: string | null;
|
||||
|
||||
@ApiPropertyOptional({ description: 'آیا پیشخرید فعال است؟' })
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
|
||||
@@ -152,6 +152,18 @@ export class ProductsService {
|
||||
include: {
|
||||
ingredientList: true,
|
||||
symptoms: true,
|
||||
reviews: {
|
||||
where: { status: 'APPROVED' },
|
||||
orderBy: { createdAt: 'desc' },
|
||||
select: {
|
||||
id: true,
|
||||
userName: true,
|
||||
rating: true,
|
||||
comment: true,
|
||||
status: true,
|
||||
createdAt: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user