Repository navigation
Add units (enheter), imported from the authoritative source - #30
Merged
Merged
Conversation
A unit has at most one parent and any number of sub-units (4.2 said one to one), its name, level, parent and leader come from the authoritative source (4.1), and an employee can belong to more than one unit (FO-02). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Divisions, departments and sections (LO-01), each with at most one parent, its sub-units, a leader and its people (LO-02). Like people and locations they come from Digdir's authoritative source (NF-07), from a file of their own, so only the import can create or change them. A person can belong to more than one unit (FO-02). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Models units (divisjon, avdeling, seksjon) as the basis for the organisation chart and the unit pages. This covers the structure only. What a unit leader maintains in Saman, such as the mandate (LO-03, LO-04), comes later.
Requirements: LO-01, LO-02 (except the mandate), FO-02, NF-07
Specification (own commit)
Enhet ||--|| Enhet("exactly one to exactly one") becomesEnhet }o--o| Enhet. A unit belongs to at most one parent unit and can have zero or more sub-units.decisions.md.Collection
enheter(units)externalUnitIdname,codeleveldivision/department/section, shown as Divisjon / Avdeling / SeksjonexternalParentId→parentexternalLeaderId→leaderexternalId)activefalsefor a closed unit, which is kept so its history isn't lostchildren,peoplepersonergetsexternalUnitIdsandunits, both of which can hold more than one unit.Access: the same as
personerandlokasjoner. Anyone logged in can read. Nobody can create, change or delete units through the admin panel or the API, not even administrators. Only the import, which uses the Local API, can. That's why there's no add button.The import itself isn't part of this PR. Units come in a file of their own. The import will match on
externalUnitIdand setparent,leaderand people'sunitsfrom the external IDs once everything exists, the same pattern asmanagerandlocationonpersoner.Tests
tests/int/units.int.spec.tscovers:externalUnitIdpnpm lintpasses.pnpm test: CMS 36 passed, web 15 passed. I didn't run e2e locally (the dev servers are in use); CI runs it.🤖 Generated with Claude Code