feat(cms): align service claims with the real product range via migration (MITHOME-129)
The site promised more than the production server delivers (99.9%, "nearly 100%", 1–100 GB SSD, unlimited traffic, 1–20 GB per mailbox, Python/Node/PostgreSQL, DNSSEC, developer API, worldwide name servers, immediate response). The 20260929_service_claims migration applies the owner-confirmed texts C1–C14 (docs/termekkor-es-szerverkapacitas- elemzes.md, ch. 9) and adds the 90% mailbox warning feature. reviseContent() only replaces an exact Hungarian match, only rewrites English that is still the old AI draft (human edits are kept and reported), inserts list items once, and sends an approved page back to ai-draft when its English changed. Published doc + latest version only. Legal texts (terms, privacy) are left for legal review. The translation memory gains the new pairs. Verified on a staging DB copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
c468585ab9
commit
d0dafa8471
@@ -0,0 +1,122 @@
|
||||
/**
|
||||
* MITHOME-129: a weboldal szolgáltatási állításainak összehangolása a valós
|
||||
* termékkörrel (docs/termekkor-es-szerverkapacitas-elemzes.md, 9. fejezet,
|
||||
* C1–C14). A jogi szövegek (C15 ÁSZF, C16 Adatvédelem) NEM itt változnak —
|
||||
* azok jogi átnézés után jönnek.
|
||||
*
|
||||
* Csak pontos magyar egyezésnél cserél; az angolt csak akkor, ha még a régi
|
||||
* AI-draft (src/lib/content-revision.ts). Csak a publikált dokumentumot és a
|
||||
* legutóbbi verziót írja, a történetet nem. Idempotens.
|
||||
*
|
||||
* DECISION: a mIT csomagneveket itt nem írjuk a szövegbe (C4, C7) — a nevek
|
||||
* bevezetése előtt védjegyjogászi vizsgálat kell (PLATFM-3); a nevek a
|
||||
* „Csomagok” oldallal (MITHOME-130) kerülnek ki.
|
||||
*/
|
||||
import type { MigrateDownArgs, MigrateUpArgs } from '@payloadcms/db-mongodb'
|
||||
import { randomBytes } from 'crypto'
|
||||
|
||||
import { Home } from '../globals/Home'
|
||||
import { About } from '../globals/About'
|
||||
import { Services } from '../globals/Services'
|
||||
import { Contact } from '../globals/Contact'
|
||||
import translations from '../content/translations/en.json'
|
||||
import { reviseContent, type ListInsertion, type TextRevision } from '../lib/content-revision'
|
||||
import { collectLocalizedPaths, topLevelKeys } from '../lib/localize-paths'
|
||||
import { rewriteDocs } from '../lib/migrate-global-docs'
|
||||
|
||||
const MEMORY: Record<string, string> = translations
|
||||
|
||||
/** [old hu, new hu, new en] — the old English is looked up in the memory. */
|
||||
const CHANGES: readonly [string, string, string][] = [
|
||||
// C1
|
||||
['Éves szinten 99,9%-os rendelkezésre állási cél, tervezett karbantartások kivételével',
|
||||
'Éves szinten 99,5%-os rendelkezésre állási cél, az előre bejelentett karbantartások kivételével',
|
||||
'99.5% annual availability target, excluding pre-announced maintenance'],
|
||||
// C2
|
||||
['24/7 monitoring biztosítja szolgáltatásaink közel 100%-os rendelkezésre állását.',
|
||||
'0–24 órás automatizált felügyelet riasztással és gyors hibaelhárítással.',
|
||||
'Round-the-clock automated monitoring with alerting and fast troubleshooting.'],
|
||||
// C3
|
||||
['Weboldalak biztonságos és gyors üzemeltetése SSD tárolással, automatikus biztonsági mentéssel és 24/7 monitoringgal. Támogatjuk a PHP, Python, Node.js technológiákat és MySQL/PostgreSQL adatbázisokat.',
|
||||
'Weboldalak biztonságos és gyors üzemeltetése Enterprise SSD tárolással, hardveres RAID-1 tükrözéssel, napi külső mentéssel és 0–24 órás automatizált felügyelettel. PHP (több verzió) és MariaDB/MySQL adatbázis.',
|
||||
'Secure, fast website hosting on enterprise SSD storage with hardware RAID-1 mirroring, daily off-site backups and round-the-clock automated monitoring. PHP (multiple versions) and MariaDB/MySQL databases.'],
|
||||
// C4
|
||||
['SSD tárhely 1GB-tól 100GB-ig', 'Enterprise SSD tárhely: 3 GB vagy 8 GB, csomagtól függően', 'Enterprise SSD storage: 3 GB or 8 GB, depending on the plan'],
|
||||
// C5
|
||||
['Havi adatforgalom: korlátlan', 'Bőséges havi adatforgalom, méltányos használat mellett', 'Generous monthly traffic under fair use'],
|
||||
// C6
|
||||
['Automatikus napi biztonsági mentés',
|
||||
'Automatikus napi mentés független, külső mentési szerverre, 7 napos visszaállítással',
|
||||
'Automatic daily backup to an independent off-site server, with 7-day restore'],
|
||||
// C7
|
||||
['1GB–20GB tárhelyet fiókként',
|
||||
'Levéltárhely csomagszinten: 1 GB vagy 4 GB, szabadon elosztva a fiókok között',
|
||||
'Mail storage per plan: 1 GB or 4 GB, freely shared between mailboxes'],
|
||||
// C8
|
||||
['Backup és archiválás ', 'Napi mentés, 7 napos visszaállítással', 'Daily backup with 7-day restore'],
|
||||
// C10
|
||||
['Teljes DNS kezelés domain regisztrációval, átvitellel és professzionális beállításokkal. Gyors propagáció és megbízható névszerverek világszerte.',
|
||||
'Teljes DNS-kezelés domainregisztrációval, átvitellel és szakszerű beállításokkal. Redundáns elsődleges és másodlagos névszerver két független szerveren.',
|
||||
'Complete DNS management including domain registration, transfers and professional configuration. Redundant primary and secondary name servers on two independent servers.'],
|
||||
// C11
|
||||
['DNSSEC támogatás', 'DNSSEC egyedi egyeztetés alapján', 'DNSSEC on request'],
|
||||
// C12
|
||||
['API hozzáférés fejlesztőknek', 'Egyedi API-integráció egyeztetés alapján', 'Custom API integration on request'],
|
||||
// C13
|
||||
['Azonnali beavatkozás', '0–24 órás riasztás, a beavatkozás tipikusan 2–4 órán belül megkezdődik', '24/7 alerting; work typically starts within 2–4 hours'],
|
||||
// C14a–d
|
||||
['24 órán belüli válasz', 'Munkanapokon 24 órán belüli válasz', 'Reply within 24 hours on business days'],
|
||||
['Munkaidőben elérhető', 'Hétköznap 8–17 óra között', 'Weekdays 8:00–17:00'],
|
||||
['24 órán belül válaszolunk', 'Munkanapokon 24 órán belül válaszolunk', 'We reply within 24 hours on business days'],
|
||||
['Email üzenetekre 24 órán belül, sürgős esetekben telefonon is elérhetők vagyunk.',
|
||||
'Munkanapokon 24 órán belül válaszolunk. Kritikus üzemzavar esetén 0–24 órás riasztási és beavatkozási rend működik.',
|
||||
'We reply within 24 hours on business days. For critical outages, a 24/7 alerting and response process is in place.'],
|
||||
]
|
||||
|
||||
export const SERVICE_CLAIM_REVISIONS: readonly TextRevision[] = CHANGES.map(([from, to, enTo]) => ({
|
||||
from,
|
||||
to,
|
||||
enWas: MEMORY[from],
|
||||
enTo,
|
||||
}))
|
||||
|
||||
/** C9 — new e-mail feature, placed right after the (revised) C8 item. */
|
||||
export const SERVICE_CLAIM_INSERTIONS: readonly ListInsertion[] = [
|
||||
{
|
||||
afterHu: 'Napi mentés, 7 napos visszaállítással',
|
||||
hu: 'Automatikus figyelmeztetés 90%-os postafiók-telítettségnél',
|
||||
afterEn: 'Daily backup with 7-day restore',
|
||||
en: 'Automatic warning when a mailbox is 90% full',
|
||||
},
|
||||
]
|
||||
|
||||
const newId = () => randomBytes(12).toString('hex')
|
||||
|
||||
export async function up(args: MigrateUpArgs): Promise<void> {
|
||||
for (const global of [Home, About, Services, Contact]) {
|
||||
const paths = collectLocalizedPaths(global.fields as never)
|
||||
const enKept = new Set<string>()
|
||||
let changed = 0
|
||||
await rewriteDocs(
|
||||
args,
|
||||
{ kind: 'global', slug: global.slug },
|
||||
[...topLevelKeys(paths), 'enTranslationStatus'],
|
||||
(data) => {
|
||||
const report = reviseContent(data, paths, SERVICE_CLAIM_REVISIONS, SERVICE_CLAIM_INSERTIONS, newId)
|
||||
report.enKept.forEach((text) => enKept.add(text))
|
||||
changed += report.changed
|
||||
return report.changed
|
||||
},
|
||||
{ versions: 'latest' },
|
||||
)
|
||||
args.payload.logger.info(`MITHOME-129 service claims: ${global.slug} — ${changed} text(s) revised`)
|
||||
for (const text of enKept) {
|
||||
args.payload.logger.warn(`MITHOME-129 English kept (edited by a person), review manually (${global.slug}): ${text.slice(0, 100)}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** DECISION: no automatic down — restore the pre-deploy dump instead. */
|
||||
export async function down(args: MigrateDownArgs): Promise<void> {
|
||||
args.payload.logger.warn('MITHOME-129 service claims: down is a no-op — restore the pre-deploy dump instead')
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import * as migration_20260929_localize_globals from './20260929_localize_global
|
||||
import * as migration_20260929_cta_page_links from './20260929_cta_page_links'
|
||||
import * as migration_20260929_localize_legal_pages from './20260929_localize_legal_pages'
|
||||
import * as migration_20260929_en_ai_draft from './20260929_en_ai_draft'
|
||||
import * as migration_20260929_service_claims from './20260929_service_claims'
|
||||
|
||||
/**
|
||||
* Payload migrations, in order. Passed to `mongooseAdapter({ prodMigrations })`
|
||||
@@ -31,4 +32,10 @@ export const migrations = [
|
||||
down: migration_20260929_en_ai_draft.down,
|
||||
name: '20260929_en_ai_draft',
|
||||
},
|
||||
{
|
||||
// MITHOME-129 — after the English import (revises the AI-draft English too).
|
||||
up: migration_20260929_service_claims.up,
|
||||
down: migration_20260929_service_claims.down,
|
||||
name: '20260929_service_claims',
|
||||
},
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user