feat: HR full CRUD and link HR records to Contacts #29

Closed
opened 2026-05-05 08:06:53 +00:00 by casper-stevens · 1 comment
Member

Context

Ref: lhumina_code/home#210

The HR module is currently read-only. It also stores its own person data disconnected from the shared Contacts (/persons) records.

Required work

1. HR full CRUD

Implement create, edit, and archive flows for HR records, matching the pattern already used by other entities (Deals, Contracts, etc.):

  • Create HR record form
  • Edit HR record form (pre-populated)
  • Archive/delete action with confirmation
  • Save/redirect working via effective_base_path

An employee, contractor, advisor, or partner should reference an existing Contact record rather than storing a separate person entry.

Example HR record fields:

  • Contact — linked to a /persons record (John Smith)
  • Company — linked to a /companies record
  • Role — free text (e.g. Finance Manager)
  • Employment type — enum (Employee, Contractor, Advisor, Partner)
  • Start date
  • End date (optional, show if empty)
  • Linked contract — optional link to a /contracts record

3. HR detail page

The HR detail page should show:

  • Linked contact name (clickable → contact detail)
  • Linked company name (clickable → company detail)
  • Linked contract, if set (clickable)
  • All dates formatted (show for empty)

Acceptance criteria

  • HR list page has an "Add HR record" button that opens a working create form
  • Existing HR records have an "Edit" action that pre-populates the form
  • HR records can be archived
  • HR create/edit form includes a contact selector (links to a /persons record)
  • HR detail page shows the contact name as a clickable link, not a raw SID
## Context Ref: [lhumina_code/home#210](https://forge.ourworld.tf/lhumina_code/home/issues/210) The HR module is currently read-only. It also stores its own person data disconnected from the shared Contacts (`/persons`) records. ## Required work ### 1. HR full CRUD Implement create, edit, and archive flows for HR records, matching the pattern already used by other entities (Deals, Contracts, etc.): - Create HR record form - Edit HR record form (pre-populated) - Archive/delete action with confirmation - Save/redirect working via `effective_base_path` ### 2. Link HR records to Contacts An employee, contractor, advisor, or partner should reference an existing Contact record rather than storing a separate person entry. Example HR record fields: - **Contact** — linked to a `/persons` record (John Smith) - **Company** — linked to a `/companies` record - **Role** — free text (e.g. Finance Manager) - **Employment type** — enum (Employee, Contractor, Advisor, Partner) - **Start date** - **End date** (optional, show `–` if empty) - **Linked contract** — optional link to a `/contracts` record ### 3. HR detail page The HR detail page should show: - Linked contact name (clickable → contact detail) - Linked company name (clickable → company detail) - Linked contract, if set (clickable) - All dates formatted (show `–` for empty) ## Acceptance criteria - HR list page has an "Add HR record" button that opens a working create form - Existing HR records have an "Edit" action that pre-populates the form - HR records can be archived - HR create/edit form includes a contact selector (links to a `/persons` record) - HR detail page shows the contact name as a clickable link, not a raw SID
Author
Member

Implemented in commit 00437d9: HR full CRUD — new hr.rs model, list/detail/create/edit/archive templates and handlers, 4 routes, sidebar entry, Contact linking.

Implemented in commit 00437d9: HR full CRUD — new hr.rs model, list/detail/create/edit/archive templates and handlers, 4 routes, sidebar entry, Contact linking.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_biz#29
No description provided.