API · v1 · stable
CODEMETA OSDeveloper Center
EN
Open console
Entity · position_assignments

Position Assignment Schema

Schema ID
position_assignment
Collection
position_assignments
Permissions
  • Readposition_assignment_view
  • Createposition_assignment_create
  • Editposition_assignment_edit
  • Deleteposition_assignment_delete

Fields

Position Assignment Schema

position_assignments4 permissions

Schema for the assignment of an employee to a position (Spec docs/specs/org-chart-v2.md, ADR 0097b + ADR 0136a). The canonical subject is `employeeProfileId` — this allows assigning employees who do not (yet) have a linked user account. Resolvers (manager / settings / required-documents) derive the userId via employee_profile.userId when needed; employee-only assignments are simply skipped where a user is required.

positionIduuidrequired

FK position._id

employeeProfileIduuidrequired

FK employee_profile._id. One employee can hold multiple positions. If the employee has a linked user (employee_profile.userId), resolvers map back to that user for authorization / approver / settings flows.

assignmentKindstringrequired

PRIMARY: regular full assignment. SECONDARY: parallel role. ACTING/INTERIM: temporary, validTo required. DEPUTY: standing-deputy mapping.

PRIMARYSECONDARYACTINGDEPUTYINTERIM
isPrimaryForEmployeebooleanrequired

Settings inheritance anchor. Exactly one active assignment per employee MUST have isPrimaryForEmployee=true (validated in middleware + DB unique partial index).

Default: false
validFromdaterequired

First day this assignment is effective (ISO date).

validTodateoptional

Last day this assignment is effective. NULL = open-ended. Required when assignmentKind ∈ {ACTING, INTERIM}.

nullable
backdatedReasonstringoptional

Required reason when validFrom is in the past (audit trail). Enforced by middleware, not schema.

max 1000 charactersnullable
notesstringoptional

Free-text HR note for this assignment.

max 2000 charactersnullable

Standard endpoints

This resource follows the platform's generic CRUD contract. Read the conventions for pagination, idempotency, optimistic locking and audit. The most important endpoints:

  • GET /api/v1/position_assignments — List, paginated + filterable
  • GET /api/v1/position_assignments/<id> — Single entity
  • POST /api/v1/position_assignments — Create
  • PATCH /api/v1/position_assignments/<id> — Partial update
  • DELETE /api/v1/position_assignments/<id> — Soft delete
  • GET /api/v1/position_assignments/<id>/timeline — Audit + activities

Search