diff --git a/docs/glossary.md b/docs/glossary.md
index ee375aa..07c35ff 100644
--- a/docs/glossary.md
+++ b/docs/glossary.md
@@ -41,3 +41,6 @@
| Недостающий текст | Нужно уточнить / Нақтылау керек / To be confirmed | заглушка, lorem, TODO | Пометка на месте неподтверждённого текста |
| Помощь деньгами | не используем | пожертвовать, donate, благотворительность | Сайт не содержит блоков о пожертвованиях |
| Сотрудничество | сотрудничество, партнёрство | спонсорство | Приглашение связаться с фондом |
+| Документ о данных | политика конфиденциальности / құпиялылық саясаты / Privacy Policy | политика приватности, privacy, GDPR | Страница `/…/privacy`, текст только от фонда |
+| Правила сайта | условия использования сайта / сайтты пайдалану шарттары / Terms of Use | пользовательское соглашение, оферта, ToS | Страница `/…/terms`, текст только от фонда |
+| Согласие у формы | «Отправляя обращение, вы соглашаетесь с политикой конфиденциальности» | согласие на обработку ПДн, чекбокс | Подпись со ссылкой у каждой формы и у блока связи |
diff --git a/src/app/(site)/[locale]/page.tsx b/src/app/(site)/[locale]/page.tsx
index f0bdb74..39cf900 100644
--- a/src/app/(site)/[locale]/page.tsx
+++ b/src/app/(site)/[locale]/page.tsx
@@ -1,5 +1,7 @@
import { notFound } from 'next/navigation'
+import { Footer } from '@/components/Footer'
import { Header } from '@/components/Header'
+import { PrivacyNote } from '@/components/PrivacyNote'
import { Tbc } from '@/components/Tbc'
import { getDict, isLocale } from '@/i18n'
import { loadContent } from '@/lib/content'
@@ -98,12 +100,11 @@ export default async function Home({ params }: { params: Promise<{ locale: strin
)}
+
-
- © {new Date().getFullYear()} {t.siteName}. {t.footer}
-
+
>
)
}
diff --git a/src/app/(site)/[locale]/privacy/page.tsx b/src/app/(site)/[locale]/privacy/page.tsx
new file mode 100644
index 0000000..336e666
--- /dev/null
+++ b/src/app/(site)/[locale]/privacy/page.tsx
@@ -0,0 +1,8 @@
+import { LegalPage, legalMetadata } from '@/components/LegalPage'
+
+export const dynamic = 'force-dynamic'
+export const generateMetadata = legalMetadata('privacy')
+
+export default function Page({ params }: { params: Promise<{ locale: string }> }) {
+ return
+}
diff --git a/src/app/(site)/[locale]/terms/page.tsx b/src/app/(site)/[locale]/terms/page.tsx
new file mode 100644
index 0000000..b45ff25
--- /dev/null
+++ b/src/app/(site)/[locale]/terms/page.tsx
@@ -0,0 +1,8 @@
+import { LegalPage, legalMetadata } from '@/components/LegalPage'
+
+export const dynamic = 'force-dynamic'
+export const generateMetadata = legalMetadata('terms')
+
+export default function Page({ params }: { params: Promise<{ locale: string }> }) {
+ return
+}
diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx
new file mode 100644
index 0000000..2f88d9c
--- /dev/null
+++ b/src/components/Footer.tsx
@@ -0,0 +1,18 @@
+import Link from 'next/link'
+import type { Dict, Locale } from '@/i18n'
+
+export function Footer({ t, locale }: { t: Dict; locale: Locale }) {
+ return (
+
+ )
+}
diff --git a/src/components/Header.tsx b/src/components/Header.tsx
index 767c934..9bcd4a4 100644
--- a/src/components/Header.tsx
+++ b/src/components/Header.tsx
@@ -1,7 +1,9 @@
import Link from 'next/link'
import { locales, type Dict, type Locale } from '@/i18n'
-export function Header({ t, locale, showProjects, showNews }: { t: Dict; locale: Locale; showProjects: boolean; showNews: boolean }) {
+/** `path` — текущая страница без языка ('' — главная): переключатель языка ведёт на ту же страницу, якоря — на главную. */
+export function Header({ t, locale, showProjects, showNews, path = '' }: { t: Dict; locale: Locale; showProjects: boolean; showNews: boolean; path?: string }) {
+ const home = path ? `/${locale}` : ''
const links = [
['#mission', t.nav.mission, true],
['#directions', t.nav.directions, true],
@@ -17,12 +19,12 @@ export function Header({ t, locale, showProjects, showNews }: { t: Dict; locale:
{links.filter((l) => l[2]).map(([href, label]) => (
- {label}
+ {label}
))}
{locales.map((l) => (
-
{l.toUpperCase()}
diff --git a/src/components/LegalPage.tsx b/src/components/LegalPage.tsx
new file mode 100644
index 0000000..9210696
--- /dev/null
+++ b/src/components/LegalPage.tsx
@@ -0,0 +1,59 @@
+import type { Metadata } from 'next'
+import Link from 'next/link'
+import { notFound } from 'next/navigation'
+import { Footer } from '@/components/Footer'
+import { Header } from '@/components/Header'
+import { Tbc } from '@/components/Tbc'
+import { getDict, isLocale, locales } from '@/i18n'
+import { loadLegal } from '@/lib/content'
+import { buildLegalModel, type LegalKind } from '@/lib/legal-model'
+
+type Props = { params: Promise<{ locale: string }> }
+
+export const legalMetadata = (kind: LegalKind) =>
+ async function generateMetadata({ params }: Props): Promise
{
+ const { locale } = await params
+ if (!isLocale(locale)) return {}
+ const t = getDict(locale)
+ const title = `${t.legal[kind].title} — ${t.siteName}`
+ return {
+ title,
+ description: t.legal[kind].description,
+ alternates: { languages: Object.fromEntries(locales.map((l) => [l, `/${l}/${kind}`])) },
+ openGraph: { title, description: t.legal[kind].description, type: 'website', locale },
+ }
+ }
+
+export async function LegalPage({ params, kind }: Props & { kind: LegalKind }) {
+ const { locale } = await params
+ if (!isLocale(locale)) notFound()
+ const t = getDict(locale)
+ const m = buildLegalModel(await loadLegal(locale), kind, t)
+ const fmt = new Intl.DateTimeFormat(locale, { day: 'numeric', month: 'long', year: 'numeric' })
+
+ return (
+ <>
+
+
+ ← {t.legal.back}
+ {m.title}
+ {m.updated && (
+
+ {t.legal.updated} {fmt.format(new Date(m.updated))}
+
+ )}
+
+ {m.tbc ? (
+
+ ) : (
+
+ {m.paragraphs.map((p, i) => (
+
{p}
+ ))}
+
+ )}
+
+
+ >
+ )
+}
diff --git a/src/components/PrivacyNote.tsx b/src/components/PrivacyNote.tsx
new file mode 100644
index 0000000..dfc0bcf
--- /dev/null
+++ b/src/components/PrivacyNote.tsx
@@ -0,0 +1,13 @@
+import Link from 'next/link'
+import type { Dict, Locale } from '@/i18n'
+
+/** Подпись со ссылкой на политику конфиденциальности — ставится у каждой формы и места связи с фондом. */
+export function PrivacyNote({ t, locale, className = '' }: { t: Dict; locale: Locale; className?: string }) {
+ return (
+
+ {t.legal.consentBefore}
+ {t.legal.consentLink}
+ {t.legal.consentAfter}
+
+ )
+}
diff --git a/src/globals/Legal.ts b/src/globals/Legal.ts
new file mode 100644
index 0000000..2f9c9f3
--- /dev/null
+++ b/src/globals/Legal.ts
@@ -0,0 +1,25 @@
+import type { Field, GlobalConfig } from 'payload'
+
+const doc = (name: string, label: string): Field => ({
+ name,
+ label,
+ type: 'group',
+ fields: [
+ {
+ name: 'body',
+ label: 'Текст документа',
+ type: 'textarea',
+ localized: true,
+ admin: { rows: 24, description: 'Только текст из документа фонда. Абзацы разделяйте пустой строкой. Пусто — сайт покажет «Нужно уточнить».' },
+ },
+ { name: 'updated', label: 'Дата редакции', type: 'date', admin: { date: { pickerAppearance: 'dayOnly' } } },
+ ],
+})
+
+/** Юридические документы фонда. Тексты вносит фонд; сайт ничего не дописывает. */
+export const Legal: GlobalConfig = {
+ slug: 'legal',
+ label: 'Юридические страницы',
+ access: { read: () => true },
+ fields: [doc('privacy', 'Политика конфиденциальности'), doc('terms', 'Условия использования сайта')],
+}
diff --git a/src/i18n/en.ts b/src/i18n/en.ts
index 793e13b..843dee9 100644
--- a/src/i18n/en.ts
+++ b/src/i18n/en.ts
@@ -31,5 +31,16 @@ export const en: Dict = {
contactMissing: 'Contact details',
},
footer: 'All rights reserved.',
+ legal: {
+ privacy: { title: 'Privacy Policy', description: 'How Qazaq Legacy Foundation handles the data of website visitors.' },
+ terms: { title: 'Website Terms of Use', description: 'Terms of use of the Qazaq Legacy Foundation website.' },
+ missing: 'the text will be provided by the foundation',
+ updated: 'Version of',
+ termsShort: 'Terms of Use',
+ back: 'Back to home',
+ consentBefore: 'By sending a message, you agree to our ',
+ consentLink: 'Privacy Policy',
+ consentAfter: '.',
+ },
language: 'Language',
}
diff --git a/src/i18n/kk.ts b/src/i18n/kk.ts
index e1f8a89..18f1f62 100644
--- a/src/i18n/kk.ts
+++ b/src/i18n/kk.ts
@@ -31,5 +31,16 @@ export const kk: Dict = {
contactMissing: 'Байланыс деректері',
},
footer: 'Барлық құқықтар қорғалған.',
+ legal: {
+ privacy: { title: 'Құпиялылық саясаты', description: 'Qazaq Legacy Foundation сайтқа келушілердің деректерін қалай өңдейді.' },
+ terms: { title: 'Сайтты пайдалану шарттары', description: 'Qazaq Legacy Foundation сайтын пайдалану шарттары.' },
+ missing: 'мәтінді қор ұсынады',
+ updated: 'Редакция күні:',
+ termsShort: 'Пайдалану шарттары',
+ back: 'Басты бетке',
+ consentBefore: 'Өтінішті жіберу арқылы сіз ',
+ consentLink: 'құпиялылық саясатымен',
+ consentAfter: ' келісесіз.',
+ },
language: 'Тіл',
}
diff --git a/src/i18n/ru.ts b/src/i18n/ru.ts
index 80a3610..1fd79d9 100644
--- a/src/i18n/ru.ts
+++ b/src/i18n/ru.ts
@@ -31,5 +31,16 @@ export const ru: Dict = {
contactMissing: 'Контакты для связи',
},
footer: 'Все права защищены.',
+ legal: {
+ privacy: { title: 'Политика конфиденциальности', description: 'Как Qazaq Legacy Foundation обрабатывает данные посетителей сайта.' },
+ terms: { title: 'Условия использования сайта', description: 'Условия использования сайта Qazaq Legacy Foundation.' },
+ missing: 'текст предоставит фонд',
+ updated: 'Редакция от',
+ termsShort: 'Условия использования',
+ back: 'На главную',
+ consentBefore: 'Отправляя обращение, вы соглашаетесь с ',
+ consentLink: 'политикой конфиденциальности',
+ consentAfter: '.',
+ },
language: 'Язык',
}
diff --git a/src/i18n/types.ts b/src/i18n/types.ts
index f57f64e..cf56926 100644
--- a/src/i18n/types.ts
+++ b/src/i18n/types.ts
@@ -15,6 +15,17 @@ export type Dict = {
news: { title: string; news: string; event: string }
collaboration: { title: string; text: string; write: string; contactMissing: string }
footer: string
+ legal: {
+ privacy: { title: string; description: string }
+ terms: { title: string; description: string }
+ missing: string
+ updated: string
+ termsShort: string
+ back: string
+ consentBefore: string
+ consentLink: string
+ consentAfter: string
+ }
language: string
}
diff --git a/src/lib/content.ts b/src/lib/content.ts
index b9518cd..dce8a8c 100644
--- a/src/lib/content.ts
+++ b/src/lib/content.ts
@@ -2,6 +2,7 @@ import config from '@payload-config'
import { getPayload } from 'payload'
import type { Locale } from '@/i18n'
import type { CmsHome, CmsNews } from './home-model'
+import type { CmsLegal } from './legal-model'
/** Читает контент из Payload. Любая ошибка (нет базы, не создана таблица) — пустой контент, страница остаётся рабочей. */
export async function loadContent(locale: Locale): Promise<{ home: CmsHome | null; news: CmsNews[] }> {
@@ -17,3 +18,14 @@ export async function loadContent(locale: Locale): Promise<{ home: CmsHome | nul
return { home: null, news: [] }
}
}
+
+/** Юридические документы. Без подстановки другого языка: пустой текст на языке страницы → «нужно уточнить». */
+export async function loadLegal(locale: Locale): Promise {
+ try {
+ const payload = await getPayload({ config })
+ return (await payload.findGlobal({ slug: 'legal', locale, fallbackLocale: false })) as unknown as CmsLegal
+ } catch (e) {
+ console.error('legal load failed', e)
+ return null
+ }
+}
diff --git a/src/lib/legal-model.test.ts b/src/lib/legal-model.test.ts
new file mode 100644
index 0000000..553010a
--- /dev/null
+++ b/src/lib/legal-model.test.ts
@@ -0,0 +1,50 @@
+import { describe, expect, it } from 'vitest'
+import { getDict, locales } from '@/i18n'
+import { buildLegalModel, toParagraphs } from './legal-model'
+
+const ru = getDict('ru')
+
+describe('Сценарий: посетитель открывает юридическую страницу', () => {
+ it.each([
+ ['ru', 'privacy', 'Политика конфиденциальности'],
+ ['ru', 'terms', 'Условия использования сайта'],
+ ['kk', 'privacy', 'Құпиялылық саясаты'],
+ ['en', 'terms', 'Website Terms of Use'],
+ ] as const)('%s/%s → «%s»', (locale, kind, title) => {
+ expect(buildLegalModel(null, kind, getDict(locale)).title).toBe(title)
+ })
+})
+
+describe('Сценарий: документ ещё не предоставлен', () => {
+ it('пустой текст — пометка, ни одного абзаца', () => {
+ const m = buildLegalModel({ privacy: { body: ' \n\n ' } }, 'privacy', ru)
+ expect(m).toEqual({ title: 'Политика конфиденциальности', paragraphs: [], updated: null, tbc: true })
+ })
+ it('нет данных из админ-панели — пометка', () => {
+ expect(buildLegalModel(null, 'terms', ru).tbc).toBe(true)
+ })
+ it('текст пометки на всех языках', () => {
+ expect(locales.map((l) => getDict(l).tbc)).toEqual(['Нужно уточнить', 'Нақтылау керек', 'To be confirmed'])
+ })
+})
+
+describe('Сценарий: фонд добавил текст', () => {
+ it('абзацы и дата редакции из админ-панели', () => {
+ const m = buildLegalModel({ privacy: { body: '1. Общие положения\r\n\r\n2. Данные\nстрока', updated: '2026-12-01T00:00:00.000Z' } }, 'privacy', ru)
+ expect(m.tbc).toBe(false)
+ expect(m.paragraphs).toEqual(['1. Общие положения', '2. Данные\nстрока'])
+ expect(m.updated).toBe('2026-12-01T00:00:00.000Z')
+ })
+ it('документы не смешиваются', () => {
+ expect(buildLegalModel({ privacy: { body: 'П' } }, 'terms', ru).tbc).toBe(true)
+ })
+})
+
+describe('Сценарий: нет пожертвований', () => {
+ it('в текстах юридических страниц нет слов о пожертвованиях', () => {
+ const text = JSON.stringify(locales.map((l) => getDict(l).legal)).toLowerCase()
+ for (const w of ['пожертв', 'donat', 'реквизит', 'қайырымдылық']) expect(text).not.toContain(w)
+ })
+})
+
+it('toParagraphs: пусто для null', () => expect(toParagraphs(null)).toEqual([]))
diff --git a/src/lib/legal-model.ts b/src/lib/legal-model.ts
new file mode 100644
index 0000000..3ce0420
--- /dev/null
+++ b/src/lib/legal-model.ts
@@ -0,0 +1,23 @@
+import type { Dict } from '@/i18n'
+
+export type LegalKind = 'privacy' | 'terms'
+export type CmsLegalDoc = { body?: string | null; updated?: string | null }
+export type CmsLegal = Partial>
+
+export type LegalModel = { title: string; paragraphs: string[]; updated: string | null; tbc: boolean }
+
+/** Делит текст на абзацы по пустой строке; переносы строк внутри абзаца сохраняются при выводе. */
+export const toParagraphs = (body?: string | null): string[] =>
+ (body ?? '')
+ .replace(/\r\n?/g, '\n')
+ .split(/\n\s*\n/)
+ .map((p) => p.trim())
+ .filter(Boolean)
+
+/** Документ показывается только из админ-панели; пусто → пометка «нужно уточнить», ничего не выдумываем. */
+export function buildLegalModel(cms: CmsLegal | null, kind: LegalKind, t: Dict): LegalModel {
+ const doc = cms?.[kind]
+ const paragraphs = toParagraphs(doc?.body)
+ const tbc = paragraphs.length === 0
+ return { title: t.legal[kind].title, paragraphs, updated: tbc ? null : (doc?.updated ?? null), tbc }
+}
diff --git a/src/migrations/20261117_045758_legal.json b/src/migrations/20261117_045758_legal.json
new file mode 100644
index 0000000..4854c9e
--- /dev/null
+++ b/src/migrations/20261117_045758_legal.json
@@ -0,0 +1,1312 @@
+{
+ "version": "6",
+ "dialect": "sqlite",
+ "tables": {
+ "users_sessions": {
+ "name": "users_sessions",
+ "columns": {
+ "_order": {
+ "name": "_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "_parent_id": {
+ "name": "_parent_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "users_sessions_order_idx": {
+ "name": "users_sessions_order_idx",
+ "columns": [
+ "_order"
+ ],
+ "isUnique": false
+ },
+ "users_sessions_parent_id_idx": {
+ "name": "users_sessions_parent_id_idx",
+ "columns": [
+ "_parent_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "users_sessions_parent_id_fk": {
+ "name": "users_sessions_parent_id_fk",
+ "tableFrom": "users_sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "_parent_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "users": {
+ "name": "users",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))"
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "reset_password_token": {
+ "name": "reset_password_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "reset_password_expiration": {
+ "name": "reset_password_expiration",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "salt": {
+ "name": "salt",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "hash": {
+ "name": "hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "reset_password_requested_at": {
+ "name": "reset_password_requested_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "login_attempts": {
+ "name": "login_attempts",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": 0
+ },
+ "lock_until": {
+ "name": "lock_until",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "users_updated_at_idx": {
+ "name": "users_updated_at_idx",
+ "columns": [
+ "updated_at"
+ ],
+ "isUnique": false
+ },
+ "users_created_at_idx": {
+ "name": "users_created_at_idx",
+ "columns": [
+ "created_at"
+ ],
+ "isUnique": false
+ },
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ "email"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "news": {
+ "name": "news",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'news'"
+ },
+ "date": {
+ "name": "date",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))"
+ }
+ },
+ "indexes": {
+ "news_updated_at_idx": {
+ "name": "news_updated_at_idx",
+ "columns": [
+ "updated_at"
+ ],
+ "isUnique": false
+ },
+ "news_created_at_idx": {
+ "name": "news_created_at_idx",
+ "columns": [
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "news_locales": {
+ "name": "news_locales",
+ "columns": {
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "place": {
+ "name": "place",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "_locale": {
+ "name": "_locale",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "_parent_id": {
+ "name": "_parent_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "news_locales_locale_parent_id_unique": {
+ "name": "news_locales_locale_parent_id_unique",
+ "columns": [
+ "_locale",
+ "_parent_id"
+ ],
+ "isUnique": true
+ },
+ "news_locales_parent_id_idx": {
+ "name": "news_locales_parent_id_idx",
+ "columns": [
+ "_parent_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "news_locales_parent_id_fk": {
+ "name": "news_locales_parent_id_fk",
+ "tableFrom": "news_locales",
+ "tableTo": "news",
+ "columnsFrom": [
+ "_parent_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "payload_kv": {
+ "name": "payload_kv",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "data": {
+ "name": "data",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "payload_kv_key_idx": {
+ "name": "payload_kv_key_idx",
+ "columns": [
+ "key"
+ ],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "payload_locked_documents": {
+ "name": "payload_locked_documents",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "global_slug": {
+ "name": "global_slug",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))"
+ }
+ },
+ "indexes": {
+ "payload_locked_documents_global_slug_idx": {
+ "name": "payload_locked_documents_global_slug_idx",
+ "columns": [
+ "global_slug"
+ ],
+ "isUnique": false
+ },
+ "payload_locked_documents_updated_at_idx": {
+ "name": "payload_locked_documents_updated_at_idx",
+ "columns": [
+ "updated_at"
+ ],
+ "isUnique": false
+ },
+ "payload_locked_documents_created_at_idx": {
+ "name": "payload_locked_documents_created_at_idx",
+ "columns": [
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "payload_locked_documents_rels": {
+ "name": "payload_locked_documents_rels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "users_id": {
+ "name": "users_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "news_id": {
+ "name": "news_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "payload_locked_documents_rels_order_idx": {
+ "name": "payload_locked_documents_rels_order_idx",
+ "columns": [
+ "order"
+ ],
+ "isUnique": false
+ },
+ "payload_locked_documents_rels_parent_idx": {
+ "name": "payload_locked_documents_rels_parent_idx",
+ "columns": [
+ "parent_id"
+ ],
+ "isUnique": false
+ },
+ "payload_locked_documents_rels_path_idx": {
+ "name": "payload_locked_documents_rels_path_idx",
+ "columns": [
+ "path"
+ ],
+ "isUnique": false
+ },
+ "payload_locked_documents_rels_users_id_idx": {
+ "name": "payload_locked_documents_rels_users_id_idx",
+ "columns": [
+ "users_id"
+ ],
+ "isUnique": false
+ },
+ "payload_locked_documents_rels_news_id_idx": {
+ "name": "payload_locked_documents_rels_news_id_idx",
+ "columns": [
+ "news_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "payload_locked_documents_rels_parent_fk": {
+ "name": "payload_locked_documents_rels_parent_fk",
+ "tableFrom": "payload_locked_documents_rels",
+ "tableTo": "payload_locked_documents",
+ "columnsFrom": [
+ "parent_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "payload_locked_documents_rels_users_fk": {
+ "name": "payload_locked_documents_rels_users_fk",
+ "tableFrom": "payload_locked_documents_rels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "users_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "payload_locked_documents_rels_news_fk": {
+ "name": "payload_locked_documents_rels_news_fk",
+ "tableFrom": "payload_locked_documents_rels",
+ "tableTo": "news",
+ "columnsFrom": [
+ "news_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "payload_preferences": {
+ "name": "payload_preferences",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))"
+ }
+ },
+ "indexes": {
+ "payload_preferences_key_idx": {
+ "name": "payload_preferences_key_idx",
+ "columns": [
+ "key"
+ ],
+ "isUnique": false
+ },
+ "payload_preferences_updated_at_idx": {
+ "name": "payload_preferences_updated_at_idx",
+ "columns": [
+ "updated_at"
+ ],
+ "isUnique": false
+ },
+ "payload_preferences_created_at_idx": {
+ "name": "payload_preferences_created_at_idx",
+ "columns": [
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "payload_preferences_rels": {
+ "name": "payload_preferences_rels",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "order": {
+ "name": "order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "users_id": {
+ "name": "users_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "payload_preferences_rels_order_idx": {
+ "name": "payload_preferences_rels_order_idx",
+ "columns": [
+ "order"
+ ],
+ "isUnique": false
+ },
+ "payload_preferences_rels_parent_idx": {
+ "name": "payload_preferences_rels_parent_idx",
+ "columns": [
+ "parent_id"
+ ],
+ "isUnique": false
+ },
+ "payload_preferences_rels_path_idx": {
+ "name": "payload_preferences_rels_path_idx",
+ "columns": [
+ "path"
+ ],
+ "isUnique": false
+ },
+ "payload_preferences_rels_users_id_idx": {
+ "name": "payload_preferences_rels_users_id_idx",
+ "columns": [
+ "users_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "payload_preferences_rels_parent_fk": {
+ "name": "payload_preferences_rels_parent_fk",
+ "tableFrom": "payload_preferences_rels",
+ "tableTo": "payload_preferences",
+ "columnsFrom": [
+ "parent_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "payload_preferences_rels_users_fk": {
+ "name": "payload_preferences_rels_users_fk",
+ "tableFrom": "payload_preferences_rels",
+ "tableTo": "users",
+ "columnsFrom": [
+ "users_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "payload_migrations": {
+ "name": "payload_migrations",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "batch": {
+ "name": "batch",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))"
+ }
+ },
+ "indexes": {
+ "payload_migrations_updated_at_idx": {
+ "name": "payload_migrations_updated_at_idx",
+ "columns": [
+ "updated_at"
+ ],
+ "isUnique": false
+ },
+ "payload_migrations_created_at_idx": {
+ "name": "payload_migrations_created_at_idx",
+ "columns": [
+ "created_at"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "home_directions": {
+ "name": "home_directions",
+ "columns": {
+ "_order": {
+ "name": "_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "_parent_id": {
+ "name": "_parent_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "home_directions_order_idx": {
+ "name": "home_directions_order_idx",
+ "columns": [
+ "_order"
+ ],
+ "isUnique": false
+ },
+ "home_directions_parent_id_idx": {
+ "name": "home_directions_parent_id_idx",
+ "columns": [
+ "_parent_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "home_directions_parent_id_fk": {
+ "name": "home_directions_parent_id_fk",
+ "tableFrom": "home_directions",
+ "tableTo": "home",
+ "columnsFrom": [
+ "_parent_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "home_directions_locales": {
+ "name": "home_directions_locales",
+ "columns": {
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "_locale": {
+ "name": "_locale",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "_parent_id": {
+ "name": "_parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "home_directions_locales_locale_parent_id_unique": {
+ "name": "home_directions_locales_locale_parent_id_unique",
+ "columns": [
+ "_locale",
+ "_parent_id"
+ ],
+ "isUnique": true
+ },
+ "home_directions_locales_parent_id_idx": {
+ "name": "home_directions_locales_parent_id_idx",
+ "columns": [
+ "_parent_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "home_directions_locales_parent_id_fk": {
+ "name": "home_directions_locales_parent_id_fk",
+ "tableFrom": "home_directions_locales",
+ "tableTo": "home_directions",
+ "columnsFrom": [
+ "_parent_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "home_projects": {
+ "name": "home_projects",
+ "columns": {
+ "_order": {
+ "name": "_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "_parent_id": {
+ "name": "_parent_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "home_projects_order_idx": {
+ "name": "home_projects_order_idx",
+ "columns": [
+ "_order"
+ ],
+ "isUnique": false
+ },
+ "home_projects_parent_id_idx": {
+ "name": "home_projects_parent_id_idx",
+ "columns": [
+ "_parent_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "home_projects_parent_id_fk": {
+ "name": "home_projects_parent_id_fk",
+ "tableFrom": "home_projects",
+ "tableTo": "home",
+ "columnsFrom": [
+ "_parent_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "home_projects_locales": {
+ "name": "home_projects_locales",
+ "columns": {
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "text": {
+ "name": "text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "_locale": {
+ "name": "_locale",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "_parent_id": {
+ "name": "_parent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "home_projects_locales_locale_parent_id_unique": {
+ "name": "home_projects_locales_locale_parent_id_unique",
+ "columns": [
+ "_locale",
+ "_parent_id"
+ ],
+ "isUnique": true
+ },
+ "home_projects_locales_parent_id_idx": {
+ "name": "home_projects_locales_parent_id_idx",
+ "columns": [
+ "_parent_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "home_projects_locales_parent_id_fk": {
+ "name": "home_projects_locales_parent_id_fk",
+ "tableFrom": "home_projects_locales",
+ "tableTo": "home_projects",
+ "columnsFrom": [
+ "_parent_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "home": {
+ "name": "home",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "contact_email": {
+ "name": "contact_email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "home_locales": {
+ "name": "home_locales",
+ "columns": {
+ "mission": {
+ "name": "mission",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "collaboration": {
+ "name": "collaboration",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "_locale": {
+ "name": "_locale",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "_parent_id": {
+ "name": "_parent_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "home_locales_locale_parent_id_unique": {
+ "name": "home_locales_locale_parent_id_unique",
+ "columns": [
+ "_locale",
+ "_parent_id"
+ ],
+ "isUnique": true
+ },
+ "home_locales_parent_id_idx": {
+ "name": "home_locales_parent_id_idx",
+ "columns": [
+ "_parent_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "home_locales_parent_id_fk": {
+ "name": "home_locales_parent_id_fk",
+ "tableFrom": "home_locales",
+ "tableTo": "home",
+ "columnsFrom": [
+ "_parent_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "legal": {
+ "name": "legal",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "privacy_updated": {
+ "name": "privacy_updated",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terms_updated": {
+ "name": "terms_updated",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "legal_locales": {
+ "name": "legal_locales",
+ "columns": {
+ "privacy_body": {
+ "name": "privacy_body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "terms_body": {
+ "name": "terms_body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "_locale": {
+ "name": "_locale",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "_parent_id": {
+ "name": "_parent_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "legal_locales_locale_parent_id_unique": {
+ "name": "legal_locales_locale_parent_id_unique",
+ "columns": [
+ "_locale",
+ "_parent_id"
+ ],
+ "isUnique": true
+ },
+ "legal_locales_parent_id_idx": {
+ "name": "legal_locales_parent_id_idx",
+ "columns": [
+ "_parent_id"
+ ],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "legal_locales_parent_id_fk": {
+ "name": "legal_locales_parent_id_fk",
+ "tableFrom": "legal_locales",
+ "tableTo": "legal",
+ "columnsFrom": [
+ "_parent_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ }
+ },
+ "views": {},
+ "enums": {},
+ "_meta": {
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "indexes": {}
+ },
+ "id": "dfde3ae4-26ae-47a2-ab58-e65e9733d489",
+ "prevId": "00000000-0000-0000-0000-000000000000"
+}
\ No newline at end of file
diff --git a/src/migrations/20261117_045758_legal.ts b/src/migrations/20261117_045758_legal.ts
new file mode 100644
index 0000000..3d9d1ac
--- /dev/null
+++ b/src/migrations/20261117_045758_legal.ts
@@ -0,0 +1,28 @@
+import { MigrateUpArgs, MigrateDownArgs, sql } from '@payloadcms/db-sqlite'
+
+export async function up({ db, payload, req }: MigrateUpArgs): Promise {
+ await db.run(sql`CREATE TABLE \`legal\` (
+ \`id\` integer PRIMARY KEY NOT NULL,
+ \`privacy_updated\` text,
+ \`terms_updated\` text,
+ \`updated_at\` text,
+ \`created_at\` text
+ );
+ `)
+ await db.run(sql`CREATE TABLE \`legal_locales\` (
+ \`privacy_body\` text,
+ \`terms_body\` text,
+ \`id\` integer PRIMARY KEY NOT NULL,
+ \`_locale\` text NOT NULL,
+ \`_parent_id\` integer NOT NULL,
+ FOREIGN KEY (\`_parent_id\`) REFERENCES \`legal\`(\`id\`) ON UPDATE no action ON DELETE cascade
+ );
+ `)
+ await db.run(sql`CREATE UNIQUE INDEX \`legal_locales_locale_parent_id_unique\` ON \`legal_locales\` (\`_locale\`,\`_parent_id\`);`)
+ await db.run(sql`CREATE INDEX \`legal_locales_parent_id_idx\` ON \`legal_locales\` (\`_parent_id\`);`)
+}
+
+export async function down({ db, payload, req }: MigrateDownArgs): Promise {
+ await db.run(sql`DROP TABLE \`legal\`;`)
+ await db.run(sql`DROP TABLE \`legal_locales\`;`)
+}
diff --git a/src/migrations/index.ts b/src/migrations/index.ts
index f00c148..942bdf1 100644
--- a/src/migrations/index.ts
+++ b/src/migrations/index.ts
@@ -1,9 +1,15 @@
import * as migration_20261116_103502_init from './20261116_103502_init';
+import * as migration_20261117_045758_legal from './20261117_045758_legal';
export const migrations = [
{
up: migration_20261116_103502_init.up,
down: migration_20261116_103502_init.down,
- name: '20261116_103502_init'
+ name: '20261116_103502_init',
+ },
+ {
+ up: migration_20261117_045758_legal.up,
+ down: migration_20261117_045758_legal.down,
+ name: '20261117_045758_legal'
},
];
diff --git a/src/payload-types.ts b/src/payload-types.ts
index 33d1a34..7efece0 100644
--- a/src/payload-types.ts
+++ b/src/payload-types.ts
@@ -89,9 +89,11 @@ export interface Config {
fallbackLocale: ('false' | 'none' | 'null') | false | null | ('ru' | 'kk' | 'en') | ('ru' | 'kk' | 'en')[];
globals: {
home: Home;
+ legal: Legal;
};
globalsSelect: {
home: HomeSelect | HomeSelect;
+ legal: LegalSelect | LegalSelect;
};
locale: 'ru' | 'kk' | 'en';
widgets: {
@@ -337,6 +339,29 @@ export interface Home {
updatedAt?: string | null;
createdAt?: string | null;
}
+/**
+ * This interface was referenced by `Config`'s JSON-Schema
+ * via the `definition` "legal".
+ */
+export interface Legal {
+ id: number;
+ privacy?: {
+ /**
+ * Только текст из документа фонда. Абзацы разделяйте пустой строкой. Пусто — сайт покажет «Нужно уточнить».
+ */
+ body?: string | null;
+ updated?: string | null;
+ };
+ terms?: {
+ /**
+ * Только текст из документа фонда. Абзацы разделяйте пустой строкой. Пусто — сайт покажет «Нужно уточнить».
+ */
+ body?: string | null;
+ updated?: string | null;
+ };
+ updatedAt?: string | null;
+ createdAt?: string | null;
+}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "home_select".
@@ -363,6 +388,27 @@ export interface HomeSelect {
createdAt?: T;
globalType?: T;
}
+/**
+ * This interface was referenced by `Config`'s JSON-Schema
+ * via the `definition` "legal_select".
+ */
+export interface LegalSelect {
+ privacy?:
+ | T
+ | {
+ body?: T;
+ updated?: T;
+ };
+ terms?:
+ | T
+ | {
+ body?: T;
+ updated?: T;
+ };
+ updatedAt?: T;
+ createdAt?: T;
+ globalType?: T;
+}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "collections_widget".
diff --git a/src/payload.config.ts b/src/payload.config.ts
index f88ef47..9211c4a 100644
--- a/src/payload.config.ts
+++ b/src/payload.config.ts
@@ -6,6 +6,7 @@ import { lexicalEditor } from '@payloadcms/richtext-lexical'
import { Users } from './collections/Users'
import { News } from './collections/News'
import { Home } from './globals/Home'
+import { Legal } from './globals/Legal'
import { migrations } from './migrations'
const dirname = path.dirname(fileURLToPath(import.meta.url))
@@ -13,7 +14,7 @@ const dirname = path.dirname(fileURLToPath(import.meta.url))
export default buildConfig({
admin: { user: Users.slug },
collections: [Users, News],
- globals: [Home],
+ globals: [Home, Legal],
editor: lexicalEditor(),
// mock-секрет только для запуска без настроек; на стенде задаётся PAYLOAD_SECRET.
secret: process.env.PAYLOAD_SECRET || 'mock-insecure-secret-replace-me',