feat(cms): require multi-model validation before approving legal translations (MITHOME-113)
Legal pages get a sidebar "legal validation" record (validating models, date, report reference). Their English translation status can only be set to "approved" when at least two distinct models, the date and the report are recorded; page globals are unaffected. The admin description states that model review does not replace legal advice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
822646a82a
commit
329e2e3403
@@ -2,6 +2,7 @@ import type { CollectionConfig } from 'payload'
|
||||
|
||||
import { collectionVersions } from '../lib/payload-versions'
|
||||
import { translationStatusField } from '../globals/fields/translationStatus'
|
||||
import { validateLegalApproval } from '../lib/legal-validation'
|
||||
|
||||
/**
|
||||
* Mirrors LegalPageContent (proto/src/content/types.ts) — MITHOME-88.
|
||||
@@ -56,6 +57,24 @@ export const LegalPages: CollectionConfig = {
|
||||
{ name: 'content', type: 'textarea', required: true, localized: true },
|
||||
],
|
||||
},
|
||||
translationStatusField(),
|
||||
// MITHOME-113: legal translations need a recorded multi-model review
|
||||
// before they can be approved (src/lib/legal-validation.ts).
|
||||
translationStatusField(validateLegalApproval),
|
||||
{
|
||||
name: 'legalValidation',
|
||||
label: 'Jogi validáció (angol fordítás)',
|
||||
type: 'group',
|
||||
admin: {
|
||||
position: 'sidebar',
|
||||
description:
|
||||
'Az angol fordítás csak akkor hagyható jóvá, ha legalább két független, magas szintű modell ellenőrizte. ' +
|
||||
'A modell-validáció nem helyettesíti a jogi szakvéleményt.',
|
||||
},
|
||||
fields: [
|
||||
{ name: 'models', label: 'Validáló modellek', type: 'text', hasMany: true },
|
||||
{ name: 'validatedAt', label: 'Validálás dátuma', type: 'date' },
|
||||
{ name: 'reportRef', label: 'Validációs riport (hivatkozás)', type: 'text' },
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user