fix(cms): keep the Atlantisz reference pending until logo and name are settled (MITHOME-133)

The Atlantisz logo has white lettering made for a dark header, invisible
on our light background, and its official name differs between the logo
and the admin entry. The partner_references migration now classifies it
as a pending client reference in environments where it has not run yet;
the follow-up 20260929_atlantisz_pending migration moves the already
granted staging entry to pending, touching only the automatic
classification (a later admin decision is left alone).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Do Siki
2026-09-29 18:23:16 +02:00
co-authored by Claude Opus 5.5
parent c6a4bd9bc9
commit 3505806358
5 changed files with 74 additions and 5 deletions
@@ -0,0 +1,42 @@
/**
* MITHOME-133: az Atlantisz Horgászüdülő és Halásztanya bejegyzést
* "Egyeztetés alatt" állapotba teszi, amíg a logó (fehér felirat, világos
* háttéren olvashatatlan) és a hivatalos név rendeződik.
*
* WHY külön migráció: a 20260929_partner_references a stagingen már
* "granted" állapottal lefutott; a még le nem futott környezetekben az
* eleve "pending"-et állít. Csak a saját, automatikus besorolást írja
* felül (egyező permissionReference) — egy későbbi admin-döntéshez nem nyúl.
*/
import type { MigrateDownArgs, MigrateUpArgs } from '@payloadcms/db-mongodb'
import { rewriteDocs } from '../lib/migrate-global-docs'
const NAME = 'Atlantisz Horgászüdülő és Halásztanya'
const AUTO_GRANTED_REFERENCE = 'Írásos engedély megvan (tulajdonosi megerősítés, 2026-09-29)'
export const PENDING_REFERENCE = 'Írásos engedély megvan; logó és hivatalos név egyeztetés alatt (MITHOME-133)'
export function markAtlantiszPending(doc: Record<string, unknown>): number {
if (doc.name !== NAME || doc.publicationPermission !== 'granted' || doc.permissionReference !== AUTO_GRANTED_REFERENCE) {
return 0
}
doc.publicationPermission = 'pending'
doc.permissionReference = PENDING_REFERENCE
return 1
}
export async function up(args: MigrateUpArgs): Promise<void> {
const changed = await rewriteDocs(
args,
{ kind: 'collection', slug: 'partners' },
['publicationPermission', 'permissionReference'],
markAtlantiszPending,
{ versions: 'latest' },
)
args.payload.logger.info(`MITHOME-133 Atlantisz: ${changed} record(s) set to pending`)
}
/** DECISION: no automatic down — set the status in the admin instead. */
export async function down(args: MigrateDownArgs): Promise<void> {
args.payload.logger.warn('MITHOME-133 Atlantisz: down is a no-op — change the status in the admin instead')
}
@@ -20,13 +20,17 @@ type Data = Record<string, unknown>
export const CONFIRMED_CLIENT_REFERENCES = [
{
name: 'Angele Pihenőház',
permission: 'granted',
permissionReference: 'Írásos engedély megvan (tulajdonosi megerősítés, 2026-09-29)',
},
{
// Contracted client (its site runs on our infrastructure) — a client
// reference, not a partner, per the research's categories.
// Kept "pending" until the logo (white text, unreadable on a light
// background) and the official name are settled (MITHOME-133).
name: 'Atlantisz Horgászüdülő és Halásztanya',
permissionReference: 'Írásos engedély megvan (tulajdonosi megerősítés, 2026-09-29)',
permission: 'pending',
permissionReference: 'Írásos engedély megvan; logó és hivatalos név egyeztetés alatt (MITHOME-133)',
},
] as const
@@ -63,7 +67,7 @@ export function classifyPartner(doc: Data): number {
const confirmed = CONFIRMED_CLIENT_REFERENCES.find((c) => c.name === doc.name)
if (confirmed) {
doc.relationship = 'client-reference'
doc.publicationPermission = 'granted'
doc.publicationPermission = confirmed.permission
doc.permissionReference = confirmed.permissionReference
} else {
doc.publicationPermission = 'none'
+7
View File
@@ -4,6 +4,7 @@ import * as migration_20260929_localize_legal_pages from './20260929_localize_le
import * as migration_20260929_en_ai_draft from './20260929_en_ai_draft'
import * as migration_20260929_service_claims from './20260929_service_claims'
import * as migration_20260929_partner_references from './20260929_partner_references'
import * as migration_20260929_atlantisz_pending from './20260929_atlantisz_pending'
/**
* Payload migrations, in order. Passed to `mongooseAdapter({ prodMigrations })`
@@ -45,4 +46,10 @@ export const migrations = [
down: migration_20260929_partner_references.down,
name: '20260929_partner_references',
},
{
// MITHOME-133 — Atlantisz on hold until logo and official name are settled.
up: migration_20260929_atlantisz_pending.up,
down: migration_20260929_atlantisz_pending.down,
name: '20260929_atlantisz_pending',
},
]