krona-staff/docs/DATA-OWNERSHIP.md
2026-09-10 23:29:28 +07:00

9 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Владение данными
Core — system of record для tenants, user accounts, roles, permissions, platform settings, file metadata/storage access, notifications и event bus. Staff хранит только ссылки-ULID на Core records и не применяет foreign key через границу автономного deployment.
Staff станет system of record для Employee, Employment и утверждённых HR aggregates. Scheduling/attendance/leave/payroll ownership уточняется с владельцем до схемы. Внешние кадровые/бухгалтерские системы подключаются через adapters; authority и направление sync фиксируются отдельным ADR.
Каждая tenant-таблица: `tenant_id VARCHAR(26) NOT NULL`, составные unique/index keys с tenant, application scoping и forced RLS. Cross-tenant операции запрещены; системный export выполняется отдельной привилегированной ролью с audit.
PII/payroll fields получают classification, field-level permissions, шифрование и retention после определения состава. Секреты не являются settings и поступают из secret store/env.