> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Employee Document & Policy Acknowledgment — Integration

> > ⛔ DEPRECATED (2026-03-26): HR-31 has been consolidated into GR-01. The HR-31 tables (hr_policies, hr_policy_distributions, hr_policy_acknowledgments) have be…

> **⛔ DEPRECATED (2026-03-26):** HR-31 has been consolidated into GR-01. The HR-31 tables (`hr_policies`, `hr_policy_distributions`, `hr_policy_acknowledgments`) have been dropped. HR-31 features (IP/UA capture, immutability trigger, document storage, acknowledgment frequency) were backported to GR-01 tables. HR policy routes redirect to `/gr/policies` and `/gr/my-acknowledgments`.

**Version:** 1.0.0 — DEPRECATED\
**Last Updated:** 2026-03-26\
**Spec:** [HR-31 Employee Document & Policy Acknowledgment](../../../specs/hr/specs/HR-31-employee-document-policy-acknowledgment.md) — Consolidated into GR-01\
**Constitution Reference:** Section 1.2 (Core Independence), Section 1.3 (Integration Patterns)

***

## Overview

HR-31 provides HR-owned workforce policy distribution, electronic acknowledgment, reminders, compliance reporting, and re-acknowledgment on policy updates. It is **standalone** from GR-01 governance policies; cross-core coordination uses **events only** (no shared policy tables).

***

## Integration Points

### Platform Foundation (PF)

| PF Capability               | Usage                                                                                                                |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| PF-01 Organizations & Sites | Tenant and optional site-scoped distribution                                                                         |
| PF-02 RBAC / PF-30          | Permission keys (`hr.policies.*`, `hr.distributions.*`, `hr.acknowledgments.*`)                                      |
| PF-10 Notifications         | Distribution notices, reminders, overdue alerts (consume `hr_policy_distribution_created` or direct calls from edge) |
| PF-11 Documents / Storage   | Policy PDF/DOCX in Supabase Storage; authenticated URLs                                                              |

### HR (intra-domain)

| Spec  | Pattern       | Notes                                                                                                                 |
| ----- | ------------- | --------------------------------------------------------------------------------------------------------------------- |
| HR-01 | Data read     | Targeting resolves `hr_employees` by department, position, site, individual                                           |
| HR-03 | Event consume | Subscribes to `onboarding_completed`; creates new-hire distributions idempotently via `source_onboarding_instance_id` |
| HR-12 | UI surface    | "My Policies" under self-service (`/hr/self-service/policies` or aligned with `/hr/me` hub)                           |

### GR-01 (Governance)

| Direction     | Pattern | Notes                                                                                                                   |
| ------------- | ------- | ----------------------------------------------------------------------------------------------------------------------- |
| HR-31 → GR-01 | Event   | Optional consumer of `hr_policy_acknowledgment_completed` for org compliance dashboards — **no** reuse of `gr_policies` |

***

## Event Contracts

### Published by HR-31

#### `hr_policy_acknowledgment_completed`

**Subscribers:** GR-01 (optional), HR-03 (optional — onboarding step completion)\
**Status:** 📝 Planned

**Payload:**

```typescript theme={null}
{
  event_type: 'hr_policy_acknowledgment_completed';
  acknowledgment_id: string;
  employee_id: string;
  policy_id: string;
  distribution_id: string;
  organization_id: string;
  acknowledged_at: string;
  timestamp: string;
}
```

**Idempotency key:** `(organization_id, acknowledgment_id)`

***

#### `hr_policy_distribution_created`

**Subscribers:** PF-10 (notification fan-out)\
**Status:** 📝 Planned

**Payload:**

```typescript theme={null}
{
  event_type: 'hr_policy_distribution_created';
  distribution_id: string;
  policy_id: string;
  policy_title: string;
  employee_ids: string[];
  deadline_date: string;
  organization_id: string;
  timestamp: string;
}
```

**Idempotency key:** `(organization_id, distribution_id)`

***

### Consumed by HR-31

#### `onboarding_completed` (HR-03)

**Publisher:** HR-03 — see [EVENT\_CONTRACTS.md § HR-03](./EVENT_CONTRACTS.md#hr-03-onboarding--offboarding-events)\
**Status:** ✅ Implemented (event); HR-31 handler 📝 Planned

**Payload (existing):**

```typescript theme={null}
{
  event_type: 'onboarding_completed';
  employee_id: string;
  onboarding_instance_id: string;
  completed_at: string;
  organization_id: string;
  timestamp: string;
}
```

**Idempotency:** Unique partial index on `hr_policy_distributions(organization_id, source_onboarding_instance_id)` where `source_onboarding_instance_id IS NOT NULL` and not soft-deleted.

***

## Edge Functions — ⛔ ARCHIVED

> These edge functions were planned for HR-31 but were never deployed. HR-31 was consolidated into GR-01 (migration `20260326034722`). GR-01 handles policy distribution and reminders directly.

| Function                       | Purpose                                                              | Status                                 |
| ------------------------------ | -------------------------------------------------------------------- | -------------------------------------- |
| ~~`distribute-policy`~~        | Resolve targets, insert acknowledgment rows, emit distribution event | ⛔ Never deployed — superseded by GR-01 |
| ~~`process-policy-reminders`~~ | Daily: reminders, overdue transition, annual re-ack                  | ⛔ Never deployed — superseded by GR-01 |

***

## Related Documents

* [EVENT\_CONTRACTS.md](./EVENT_CONTRACTS.md) — registry of HR events
* [CROSS\_CORE\_INTEGRATIONS.md](./CROSS_CORE_INTEGRATIONS.md) — matrix row HR-31
* [HR-03 Integration](./onboarding-offboarding-integration.md) — onboarding events
