feat(0pt): record legitimate-interest stance — B2B contacts, company-linked only
Recorded decision (Simon 2026-08-31): personal data may be stored under legitimate interest ONLY as business contacts bound to a company/org entity. Gate enforces it: legitimate_interest requires purpose=business_contact and entity_linked_only=true; recordStored() requires entity_id (orgnr/rgs/LEI, hashed) and refuses person-only rows. +1 test; suite 167 pass | 1 skip; typecheck clean.
This commit is contained in:
@@ -16,6 +16,14 @@
|
||||
/** GDPR art. 6(1) legal bases 0pt accepts for personal-data sources. */
|
||||
export type LegalBasis = "legitimate_interest" | "consent" | "contract" | "legal_obligation";
|
||||
|
||||
/**
|
||||
* The purpose of processing. SIAX's recorded decision (Simon, 2026-08-31):
|
||||
* personal data may be stored when LEGITIMATE INTEREST applies for business
|
||||
* contacts — i.e. bound to a company/org entity, for business purposes.
|
||||
* Other bases are allowed but every policy records its purpose.
|
||||
*/
|
||||
export type ProcessingPurpose = "business_contact" | "consent_marketing" | "contract_performance" | "legal_obligation";
|
||||
|
||||
/** Compliance posture for one source that touches personal data. */
|
||||
export interface PiiPolicy {
|
||||
source_id: string;
|
||||
@@ -23,6 +31,13 @@ export interface PiiPolicy {
|
||||
project_id: string;
|
||||
touches_personal_data: true;
|
||||
legal_basis: LegalBasis;
|
||||
purpose: ProcessingPurpose;
|
||||
/**
|
||||
* REQUIRED under legitimate_interest (business_contact): personal data may
|
||||
* only be stored in correspondence with a company/org entity (org/rgs-nr,
|
||||
* GLEIF/LEI). recordStored() rejects stray person-only rows.
|
||||
*/
|
||||
entity_linked_only: boolean;
|
||||
/**
|
||||
* Pointer to the evidence: a recorded Legitimate Interest Assessment
|
||||
* (LIA) document id, the consent record id, the contract clause, or the
|
||||
@@ -64,6 +79,8 @@ export interface CreatePiiPolicyInput {
|
||||
basis_ref: string;
|
||||
retention_days: number;
|
||||
field_allowlist: string[];
|
||||
purpose?: ProcessingPurpose;
|
||||
entity_linked_only?: boolean;
|
||||
pseudonymize_keys?: boolean;
|
||||
robots_and_rate_confirmed?: boolean;
|
||||
created_by?: string;
|
||||
@@ -79,6 +96,8 @@ export interface CreatePiiPolicyInput {
|
||||
export interface PiiIdentityKey {
|
||||
key_hash: string;
|
||||
subject_hash: string;
|
||||
/** Company/org entity the value is bound to (orgnr/rgs/LEI), hashed. */
|
||||
entity_hash: string | null;
|
||||
source_id: string;
|
||||
tenant_id: string;
|
||||
field: string;
|
||||
|
||||
Reference in New Issue
Block a user