From d613d16c82c4cc40ab7507dba971aed66d8734be Mon Sep 17 00:00:00 2001 From: "s.esmaeili" Date: Sat, 10 Oct 2026 17:17:14 +0330 Subject: [PATCH] fix: rename the henza brand to montzar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit اپ: اصلاح نام برند به منتزر Co-authored-by: Cursor --- .gitignore | 2 +- apps/admin-panel/src/assets/styles/utilities.less | 2 +- apps/api/prisma/schema.prisma | 4 ++-- apps/api/prisma/seed.ts | 6 ++++-- apps/api/scripts/legacy-import/index.ts | 4 ++-- apps/api/scripts/legacy-import/lib/context.ts | 6 +++--- apps/api/scripts/legacy-import/lib/normalize.ts | 2 +- apps/user-app/src/components/product/SingleProduct.vue | 2 +- docs/PWA-PORT-PLAN.md | 2 +- 9 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 032bcd9..6800c25 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,6 @@ apps/api/storage/uploads/* # apps/admin-panel/dist/ # apps/user-app/dist/ -# Live henza data dump (customers' personal data). Never commit. +# Live legacy data dump (customers' personal data). Never commit. # Only the structure-only oapi-struncture.sql belongs in the repo. /oapi.sql diff --git a/apps/admin-panel/src/assets/styles/utilities.less b/apps/admin-panel/src/assets/styles/utilities.less index 33b5dfd..e008cc2 100644 --- a/apps/admin-panel/src/assets/styles/utilities.less +++ b/apps/admin-panel/src/assets/styles/utilities.less @@ -29,7 +29,7 @@ // ant-design-pro boilerplate in Vue's own palette, inherited verbatim from // legacy and used as `@border-color-base`. That file is deleted (ADV4 has no // LESS build to feed); nothing in the app should reference `--primary`/ -// `--accent` any more — use the Henza tokens below instead. +// `--accent` any more — use the Montzar tokens below instead. :root { --primary-color: #1c2d56; --secondary-color: #836447; diff --git a/apps/api/prisma/schema.prisma b/apps/api/prisma/schema.prisma index 6ec28b7..69a07f0 100644 --- a/apps/api/prisma/schema.prisma +++ b/apps/api/prisma/schema.prisma @@ -473,14 +473,14 @@ model Customer { /// /// Legacy recorded NO reason: none of its 49 `customers` columns is a /// reason/note field, and on rejection it only sent a fixed SMS. So the 14 - /// rows migrated from henza carry the sentinel + /// rows migrated from the legacy system carry the sentinel /// «رد شده در سیستم قدیم — فاقد شرح علت ثبت‌شده» instead of NULL, so support /// knows why it is blank (owner ruling 2026-10-07). The migration tool /// writes it only WHERE this IS NULL, so a re-run cannot overwrite a real /// reason entered in the new system. verificationRejectionReason String? - /// NULL for rows migrated from henza — legacy recorded no rejection time. + /// NULL for rows migrated from the legacy system — it recorded no rejection time. verificationRejectedAt DateTime? /// Legacy customers.birth_date, populated on 917 of 1,595 rows. Kept for the diff --git a/apps/api/prisma/seed.ts b/apps/api/prisma/seed.ts index e0e9898..88134e2 100644 --- a/apps/api/prisma/seed.ts +++ b/apps/api/prisma/seed.ts @@ -385,10 +385,12 @@ async function main() { prisma.category.upsert({ where: { id: 'cat-coins' }, update: {}, create: { id: 'cat-coins', title: 'سکه و شمش' } }), ]); + // Databases seeded before the rename hold the old id; Product/Promotion FKs cascade on update. + await prisma.brand.updateMany({ where: { id: 'brand-henza' }, data: { id: 'brand-montzar' } }); const brandMontzar = await prisma.brand.upsert({ - where: { id: 'brand-henza' }, + where: { id: 'brand-montzar' }, update: { title: 'منتزر طلا' }, - create: { id: 'brand-henza', title: 'منتزر طلا' }, + create: { id: 'brand-montzar', title: 'منتزر طلا' }, }); const brandArtisan = await prisma.brand.upsert({ where: { id: 'brand-artisan' }, diff --git a/apps/api/scripts/legacy-import/index.ts b/apps/api/scripts/legacy-import/index.ts index cd37215..4c138de 100644 --- a/apps/api/scripts/legacy-import/index.ts +++ b/apps/api/scripts/legacy-import/index.ts @@ -1,5 +1,5 @@ /** - * henza (MySQL `oapi`) → gold-bank (PostgreSQL) data import. + * Legacy system (MySQL `oapi`) → montzar (PostgreSQL) data import. * * The rules live in docs/DATA-MIGRATION-MAP.md; every step cites its section. * @@ -8,7 +8,7 @@ * npx ts-node --transpile-only scripts/legacy-import/index.ts \ * --source "mysql://user:pass@127.0.0.1:3307/oapi" \ * --target "postgresql://user:pass@localhost:5432/goldbank_import_test" \ - * [--images "F:/henza/storage" --upload-dir "./storage/uploads"] \ + * [--images "F:/legacy/storage" --upload-dir "./storage/uploads"] \ * [--only customers,ledger] [--report ./legacy-import-report.md] --yes * * Safety: diff --git a/apps/api/scripts/legacy-import/lib/context.ts b/apps/api/scripts/legacy-import/lib/context.ts index a9ea22b..00963af 100644 --- a/apps/api/scripts/legacy-import/lib/context.ts +++ b/apps/api/scripts/legacy-import/lib/context.ts @@ -9,7 +9,7 @@ import { createPool, type Pool, type RowDataPacket } from 'mysql2/promise'; export interface Options { sourceUrl: string; targetUrl: string; - /** henza `storage/` folder holding the image files (optional). */ + /** Legacy system's `storage/` folder holding the image files (optional). */ imagesDir?: string; /** Target UPLOAD_DIR the files are copied into (required with imagesDir). */ uploadDir?: string; @@ -56,7 +56,7 @@ export class Report { } render(header: string[]): string { - const out: string[] = ['# henza → gold-bank import report', '', ...header, '']; + const out: string[] = ['# legacy (oapi) → montzar import report', '', ...header, '']; for (const [step, s] of this.sections) { out.push(`## ${step}`, ''); if (s.counts.size) { @@ -317,7 +317,7 @@ function copyImage(ctx: Ctx, file: string, step: string) { return; } if (!existsSync(from) || !statSync(from).isFile()) { - ctx.report.count('images', 'missing in henza storage'); + ctx.report.count('images', 'missing in legacy storage'); ctx.report.note('images', `missing file ${file} (referenced from ${step})`); return; } diff --git a/apps/api/scripts/legacy-import/lib/normalize.ts b/apps/api/scripts/legacy-import/lib/normalize.ts index 6c39d65..3e29d7f 100644 --- a/apps/api/scripts/legacy-import/lib/normalize.ts +++ b/apps/api/scripts/legacy-import/lib/normalize.ts @@ -1,5 +1,5 @@ /** - * Value conversion from the henza MySQL schema to the Prisma one. + * Value conversion from the legacy system's MySQL schema to the Prisma one. * * Every helper here is pure, so the rules can be read and tested in isolation. * Each rule is the one recorded in docs/DATA-MIGRATION-MAP.md. diff --git a/apps/user-app/src/components/product/SingleProduct.vue b/apps/user-app/src/components/product/SingleProduct.vue index 3b7d21b..ccd19be 100644 --- a/apps/user-app/src/components/product/SingleProduct.vue +++ b/apps/user-app/src/components/product/SingleProduct.vue @@ -279,7 +279,7 @@