API · v1 · stable
CODEMETA OSDeveloper Center
FR
Ouvrir la console
Entité · position_assignments

Position Assignment Schema

ID du schéma
position_assignment
Collection
position_assignments
Autorisations
  • Lireposition_assignment_view
  • Créerposition_assignment_create
  • Modifierposition_assignment_edit
  • Supprimerposition_assignment_delete

Champs

Position Assignment Schema

position_assignments4 autorisations

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.

positionIduuidobligatoire

FK position._id

employeeProfileIduuidobligatoire

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.

assignmentKindstringobligatoire

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

PRIMARYSECONDARYACTINGDEPUTYINTERIM
isPrimaryForEmployeebooleanobligatoire

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

Par défaut : false
validFromdateobligatoire

First day this assignment is effective (ISO date).

validTodatefacultatif

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

nullable
backdatedReasonstringfacultatif

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

max. 1000 caractèresnullable
notesstringfacultatif

Free-text HR note for this assignment.

max. 2000 caractèresnullable

Endpoints standard

Cette ressource suit le contrat CRUD générique de la plateforme. Lisez les conventions pour la pagination, l'idempotence, le verrouillage optimiste et l'audit. Les endpoints principaux :

  • GET /api/v1/position_assignments — Liste, paginée et filtrable
  • GET /api/v1/position_assignments/<id> — Une entité
  • POST /api/v1/position_assignments — Créer
  • PATCH /api/v1/position_assignments/<id> — Mise à jour partielle
  • DELETE /api/v1/position_assignments/<id> — Suppression logique
  • GET /api/v1/position_assignments/<id>/timeline — Audit et activités

Recherche