From aaf7a83742873d9db18dff54f9359c940a678b5d Mon Sep 17 00:00:00 2001 From: Alireza Hassani Date: Wed, 9 Sep 2026 23:30:24 +0330 Subject: [PATCH] Add Schema.org JSON-LD, SEO meta overrides, and resilient bulk SMS. Expose Organization/LocalBusiness and Product/BlogPosting jsonLd, optional seoMeta fields on content/categories, and continue mass SMS after per-recipient failures. Co-authored-by: Cursor --- .../migrations/088_categories_metadata.sql | 6 + docs/website-api/AI_PROMPT.md | 64 ++++- docs/website-api/openapi.json | 47 +++- prisma/schema.prisma | 1 + src/blogs/blogs.service.ts | 100 +++++++- src/blogs/dto/blog.dto.ts | 21 ++ .../business-settings.service.ts | 12 + .../business-settings.types.ts | 38 +++ .../business-settings.util.ts | 9 + .../dto/update-business-settings.dto.ts | 39 +++ .../website-entity-schema.util.ts | 167 +++++++++++++ src/business-settings/website-schema.util.ts | 195 +++++++++++++++ src/categories/categories.service.ts | 27 ++ src/categories/dto/category.dto.ts | 31 ++- src/common/seo-meta.dto.ts | 23 ++ src/common/seo-meta.util.ts | 67 +++++ src/customers/customers.service.ts | 235 +++++++++--------- src/instructions/dto/instruction.dto.ts | 21 ++ src/instructions/instructions.service.ts | 22 +- src/portfolios/dto/portfolio.dto.ts | 21 ++ src/portfolios/portfolios.service.ts | 22 +- src/products/dto/product.dto.ts | 23 ++ src/products/products.service.ts | 94 ++++++- src/tenant/tenant.service.ts | 4 + src/user-products/dto/user-product.dto.ts | 11 + src/user-products/user-products.service.ts | 26 +- src/videos/dto/video.dto.ts | 21 ++ src/videos/videos.service.ts | 22 +- src/website-docs/static/AI_PROMPT.md | 64 ++++- src/website-docs/static/openapi.json | 47 +++- src/website/website-business-info.service.ts | 61 ++++- src/workshops/dto/workshop.dto.ts | 20 ++ src/workshops/workshops.service.ts | 22 +- 33 files changed, 1395 insertions(+), 188 deletions(-) create mode 100644 database/migrations/088_categories_metadata.sql create mode 100644 src/business-settings/website-entity-schema.util.ts create mode 100644 src/business-settings/website-schema.util.ts create mode 100644 src/common/seo-meta.dto.ts create mode 100644 src/common/seo-meta.util.ts diff --git a/database/migrations/088_categories_metadata.sql b/database/migrations/088_categories_metadata.sql new file mode 100644 index 0000000..ad6458e --- /dev/null +++ b/database/migrations/088_categories_metadata.sql @@ -0,0 +1,6 @@ +-- Optional SEO overrides for category pages (same keys as content metadata JSON). +ALTER TABLE categories + ADD COLUMN IF NOT EXISTS metadata JSONB NOT NULL DEFAULT '{}'::jsonb; + +COMMENT ON COLUMN categories.metadata IS + 'JSON bag for category SEO overrides: seoMetaTitle, seoMetaDescription'; diff --git a/docs/website-api/AI_PROMPT.md b/docs/website-api/AI_PROMPT.md index bd6ffa2..fdb09d8 100644 --- a/docs/website-api/AI_PROMPT.md +++ b/docs/website-api/AI_PROMPT.md @@ -319,11 +319,73 @@ These are **required on every crawlable page** (home, listing, product/blog/port **Open Graph (recommended)** - Set `og:title`, `og:description`, and `og:image` on important pages (home + detail pages) from CMS media when available. +### Site-wide Schema.org JSON-LD (Organization / LocalBusiness) + +Business admins configure this under **Website → Settings → Structured data**. The API builds a ready `jsonLd` object for you. + +1. `GET /tenants/{domain}/website/business-info` +2. If `schema.enabled` and `schema.jsonLd` is an object, render once in the root layout (or every public page): + +```html + +``` + +In Next.js App Router, put it in the root layout via ` +``` + +In Next.js App Router, put it in the root layout via `