@smartkomm/plexus-cli 0.1.295 → 0.1.297

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- 90e4827a4cb78b9e691d0f45849f80345a87e505f7f2844a8189d928e2195712
1
+ 12b20da6f6cf99cb17f551a2f1a1f22c353a998d019fa10d56f55cfc209a6941
@@ -261,4 +261,5 @@ whole is the operator's (ask them; do not try).
261
261
  | [users/set-password.md](references/users/set-password.md) | Plattform | Set or regenerate an existing user's password. |
262
262
  | [users/use-test-account.md](references/users/use-test-account.md) | Mandant + Plattform | Play a school's application process as an applicant with a test account. |
263
263
  | [work-items/manage-work-items.md](references/work-items/manage-work-items.md) | Mandant | List a tenant's tasks, create a manual one, assign and complete it. |
264
+ | [worker-ops/set-import-default-unit.md](references/worker-ops/set-import-default-unit.md) | Plattform | Point an import source at another default unit, so the old one can be deleted. |
264
265
  | [worker-ops/debug-worker-jobs.md](references/worker-ops/debug-worker-jobs.md) | Plattform | Investigate and clean up stuck or failed imports and worker jobs. |
@@ -1,7 +1,7 @@
1
1
  # plexus-cli command reference
2
2
 
3
3
  Generated from the commands the CLI registers — do not edit; `plexus-cli <command> --help` prints the same.
4
- 303 commands. Every network command also takes `--env <local|staging|prod>`, `--tenant <slug>`,
4
+ 304 commands. Every network command also takes `--env <local|staging|prod>`, `--tenant <slug>`,
5
5
  `--json` (raw JSON instead of a table) and `--allow-prod` (required for a writing run against production).
6
6
 
7
7
  - [Admission (offline)](#admission-offline) (1)
@@ -16,7 +16,7 @@ Generated from the commands the CLI registers — do not edit; `plexus-cli <comm
16
16
  - [Feedback (platform operator)](#feedback-platform-operator) (21)
17
17
  - [Files (school token)](#files-school-token) (3)
18
18
  - [Identity (own account)](#identity-own-account) (5)
19
- - [Imports (platform operator)](#imports-platform-operator) (2)
19
+ - [Imports (platform operator)](#imports-platform-operator) (3)
20
20
  - [Imports (school token)](#imports-school-token) (2)
21
21
  - [Introspection (offline)](#introspection-offline) (2)
22
22
  - [Introspection (own account)](#introspection-own-account) (1)
@@ -1076,6 +1076,18 @@ Find/fail orphaned import runs (status 'running' with no active job). Dry-run un
1076
1076
  | `--all-tenants` | Scan every tenant (default: the active --tenant only). |
1077
1077
  | `--confirm` | Actually mark orphans failed (default: dry-run preview). |
1078
1078
 
1079
+ ### `platform imports source set-default-unit <source>`
1080
+
1081
+ Set the default unit of an import source (by source key and unit config key). Plan unless --confirm.
1082
+
1083
+ - **Right:** platform operator — needs a `_platform.*` right; a school's token is refused
1084
+ - **Effect:** plan by default — writes only with `--confirm` (and `--env`; on production also `--allow-prod`)
1085
+
1086
+ | Option | Description |
1087
+ |---|---|
1088
+ | `--unit <value>` (required) | Config key of the new default unit (one the source maps by key). |
1089
+ | `--confirm` | Write the change (without it, only the plan is printed). |
1090
+
1079
1091
  ### `platform imports trigger-all`
1080
1092
 
1081
1093
  Trigger every file-less import across all accessible tenants — bulk, plan unless --confirm (--probe --confirm: test jobs only).
@@ -68,7 +68,10 @@ Organisation shows the same tree.
68
68
  - **Deletes are hard.** A unit takes its pedagogy, profile and location rows with
69
69
  it; a Träger takes its contract party. There is no undo — export the config first
70
70
  (`config export`) if the school might want it back.
71
- - **The server refuses** a unit with programs (offers), sub-units or enrolled
71
+ - **The server refuses** a unit that is the default unit of an import source
72
+ (`[unit/importSourceDefault]`). A platform operator points the source at
73
+ another unit first ([Set the default unit of an import source](../worker-ops/set-import-default-unit.md)).
74
+ It also refuses a unit with programs (offers), sub-units or enrolled
72
75
  members, and a legal entity with units, child legal entities, a contract template
73
76
  or a process (workflow) naming it, or a contract naming it. Re-home or remove
74
77
  those first. `delete-subtree` refuses a branch with programs before it deletes
@@ -86,3 +89,4 @@ Organisation shows the same tree.
86
89
  ## Related
87
90
  - [Add a Träger or unit to a tenant's config](../config/add-legal-entity.md)
88
91
  - [Make a new school applyable](../offer/create-pedagogy-unit.md)
92
+ - [Set the default unit of an import source](../worker-ops/set-import-default-unit.md)
@@ -0,0 +1,42 @@
1
+ # Set the default unit of an import source
2
+
3
+ **When to use:** a unit that an import source uses as its default unit has to
4
+ go, or imported records should attach to another unit by default.
5
+ `org unit delete` refuses the default unit of an import source
6
+ (`[unit/importSourceDefault]`). Point the source at another unit first.
7
+
8
+ ## Prerequisites
9
+ - **Auth:** a platform operator's token with `_platform.config.manage`. A
10
+ school's own token is refused, because the import source belongs to the operator.
11
+ - **Env:** a writing run needs `--env <local|staging|prod>` on the command line,
12
+ and `--allow-prod` against production.
13
+ - You need the source key (`imports status --tenant <slug>`, column `config`)
14
+ and the new unit's config key (`org tree`, column `key`).
15
+
16
+ ## Steps
17
+
18
+ ```bash
19
+ # Plan: shows the current default and the new one, and writes nothing
20
+ plexus-cli --env prod --allow-prod platform imports source set-default-unit <source> --unit <unit-key>
21
+ # Write
22
+ plexus-cli --env prod --allow-prod platform imports source set-default-unit <source> --unit <unit-key> --confirm
23
+ ```
24
+
25
+ ## Verify
26
+ Run the plan again. It reports `unchanged`, with the new unit as the default.
27
+
28
+ ## Idempotency / gotchas
29
+ - The unit must be one the source already knows by key (every unit of the
30
+ tenant at the time the source was set up). Otherwise the command refuses with
31
+ `[import-source/unitUnknown]` and lists the keys the source knows.
32
+ - Deleting any other unit removes it from the source's key list automatically.
33
+ Only the default unit blocks a delete.
34
+ - In the tenant config the default unit is the first entry of
35
+ `foundation.units`. `config export` lists the current default first, so an
36
+ apply from a fresh export keeps it. **An apply from an export taken before
37
+ this change sets the old default back.** Its plan then shows an update on
38
+ `source`. Export again after setting the default.
39
+
40
+ ## Related
41
+ - [Edit a school's organisation structure](../organization/edit-org-structure.md)
42
+ - [Debug a stuck/failed import or worker job](./debug-worker-jobs.md)