feat: implement DEV_TICKETS including product categories seeding, SEO metaTitle/metaDescription, scientificTagline, requiresRx notice, and suitableFor normalization
Deploy Canina / deploy (push) Successful in 2m19s
E2E Playwright Tests / Run Full E2E & Security Suites (push) Failing after 7s

This commit is contained in:
parsa committed 2026-09-24 03:20:46 +03:30
1 parent 913e6acd3d
commit d6d4158cbe
7 files changed
+116 -24

No files matched your search

+18 -2
View File
@@ -508,6 +508,14 @@ export class AdminService {
: {}),
};
let resolvedCategorySlug = data.categorySlug;
if (data.categoryId && (!resolvedCategorySlug || resolvedCategorySlug === 'general')) {
const cat = await this.prisma.category.findUnique({ where: { id: data.categoryId } });
if (cat) {
resolvedCategorySlug = cat.slug;
}
}
const product = await this.prisma.product.create({
data: {
artNo: data.artNo || `ART-${Date.now()}`,
@@ -518,7 +526,7 @@ export class AdminService {
shortDescription: data.shortDescription || '',
ingredients: data.ingredients || null,
categoryId: data.categoryId || '',
categorySlug: data.categorySlug || 'general',
categorySlug: resolvedCategorySlug || 'general',
buyPrice: data.buyPrice !== undefined ? data.buyPrice : 0,
marginRetailPercent:
marginRetail !== undefined ? marginRetail : undefined,
@@ -662,6 +670,14 @@ export class AdminService {
: {}),
};
let resolvedCategorySlug = data.categorySlug;
if (data.categoryId && !resolvedCategorySlug) {
const cat = await this.prisma.category.findUnique({ where: { id: data.categoryId } });
if (cat) {
resolvedCategorySlug = cat.slug;
}
}
const product = await this.prisma.product.update({
where: { id },
data: {
@@ -673,7 +689,7 @@ export class AdminService {
shortDescription: data.shortDescription,
ingredients: data.ingredients !== undefined ? data.ingredients : undefined,
categoryId: data.categoryId,
categorySlug: data.categorySlug,
categorySlug: resolvedCategorySlug !== undefined ? resolvedCategorySlug : undefined,
buyPrice: data.buyPrice !== undefined ? data.buyPrice : undefined,
marginRetailPercent:
marginRetail !== undefined ? marginRetail : undefined,