@smartkomm/plexus-cli 0.1.110 → 0.1.111

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
- 6a69afcdad9d14294e3eab37068741725a536fc660ed5f1050776419cd90153d
1
+ 2eeecd70b97df9e7875a857a9360102e7881382fd4d7745efb5ce68f38ddc480
@@ -163,6 +163,7 @@ whole is the operator's (ask them; do not try).
163
163
  | [accounts/email-changes.md](references/accounts/email-changes.md) | Mandant + Plattform | See who changed an account's sign-in address (the tenant-wide view needs a platform admin for --user). |
164
164
  | [applications/inspect-process-store.md](references/applications/inspect-process-store.md) | Mandant | Show what an application's process produced and what it still waits for. |
165
165
  | [applications/start-a-test-application.md](references/applications/start-a-test-application.md) | Mandant | Start a test application in the terminal, drive it and discard it. |
166
+ | [applications/expire-test-applications.md](references/applications/expire-test-applications.md) | Mandant | Keep a test application as a demo, and list or discard the test applications without activity for 14 days. |
166
167
  | [applications/correct-staff-input.md](references/applications/correct-staff-input.md) | Mandant | Correct an internal input staff set at the start, while no step has read it. |
167
168
  | [audit/answer-access-request.md](references/audit/answer-access-request.md) | Plattform | Answer an Art. 15 request: who looked at this application? |
168
169
  | [config/add-legal-entity.md](references/config/add-legal-entity.md) | Mandant | Add a Träger with its address or a unit to an exported config offline, then apply it. |
@@ -0,0 +1,55 @@
1
+ # Expire old test applications („Demo behalten“)
2
+
3
+ **When to use:** test applications pile up in a school after an acceptance run or a
4
+ demo. A test application **expires** when all four hold: it is a test application, its
5
+ last activity is older than 14 days, it is not marked „Demo behalten“, and the school is
6
+ a real school (never the seed tenant `test`, never the platform). Age alone never
7
+ expires anything. A daily job reports the count per school; this recipe lists and
8
+ discards them by hand, and marks the ones to keep.
9
+
10
+ „Last activity“ is the application card's „Letzte Aktivität“: the newest step,
11
+ submission, completed task or signature, decision, and chat message every staff
12
+ member can read, never earlier than the start. Draft saves and team-only chat do not
13
+ count.
14
+
15
+ ## Prerequisites
16
+ - The permission to run test actions on the tenant (the one „Testbewerbung verwerfen“ needs).
17
+ - Writes name `--env`; prod writes also need `--allow-prod`.
18
+
19
+ ## Steps
20
+ ```bash
21
+ E="--env <env> --tenant <t>" # prod writes also need --allow-prod
22
+
23
+ # 1. Keep a demo: it never expires and no discard takes it.
24
+ plexus-cli $E applications set-keep-demo <application-id>
25
+ # …and to let it expire again:
26
+ plexus-cli $E applications set-keep-demo <application-id> --off
27
+
28
+ # 2. Dry run: every test application with its verdict.
29
+ plexus-cli $E applications discard-test --all-test --older-than 14d --dry-run
30
+ # id lastActivity verdict block result
31
+ # … 2026-10-01 expired would discard
32
+ # … 2026-10-02 expired invoice blocked
33
+ # … 2026-10-30 recent kept
34
+
35
+ # 3. Discard the expired ones (the server re-checks each one before it discards).
36
+ plexus-cli $E applications discard-test --all-test --older-than 14d --confirm
37
+ ```
38
+
39
+ ## Verify
40
+ Run the dry run again: no row is left with `would discard`. Blocked rows stay until their
41
+ reason is gone.
42
+
43
+ ## Idempotency / gotchas
44
+ - **`--older-than` is at least 14 days** — a shorter period is refused; one fresh test
45
+ application goes with `applications discard-test <id>`.
46
+ - **Blocked, never attempted:** `openProviderProcess` (cancel the signing process at the
47
+ provider first), `invoice` (an invoice was written on its contract), `settled` (the
48
+ process already ended), `discarding` / `discarded` (a discard runs or ran).
49
+ - **`activityUnknown`:** the activity could not be read completely; the application is
50
+ kept rather than discarded on a guess.
51
+ - A marked demo is refused by every discard, the single one too: clear the mark first.
52
+ - Re-running is safe: discarded applications are gone, the rest are re-checked.
53
+
54
+ ## Related
55
+ - [Start a test application and drive it end to end](./start-a-test-application.md)
@@ -1,12 +1,12 @@
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
- 295 commands. Every network command also takes `--env <local|staging|prod>`, `--tenant <slug>`,
4
+ 296 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)
8
8
  - [Admission (platform operator)](#admission-platform-operator) (2)
9
- - [Admission (school token)](#admission-school-token) (12)
9
+ - [Admission (school token)](#admission-school-token) (13)
10
10
  - [Agents (offline)](#agents-offline) (2)
11
11
  - [Branding (school token)](#branding-school-token) (6)
12
12
  - [Config (offline)](#config-offline) (4)
@@ -102,13 +102,20 @@ Count an offer's applications per list
102
102
  |---|---|
103
103
  | `--offer <value>` (required) | Offer slug (its offerKey) |
104
104
 
105
- ### `applications discard-test <application>`
105
+ ### `applications discard-test [application]`
106
106
 
107
- Discard a TEST application (the server refuses a real one)
107
+ Discard a TEST application (the server refuses a real one), or with --all-test every expired one of the school
108
108
 
109
109
  - **Right:** school token — a module permission inside one school (the school's own administrator runs it)
110
110
  - **Effect:** write — needs `--env`; on production also `--allow-prod`
111
111
 
112
+ | Option | Description |
113
+ |---|---|
114
+ | `--all-test` | Every expired test application of the school instead of one id |
115
+ | `--older-than <value>` | With --all-test: days without activity, as <N>d (N ≥ 14) |
116
+ | `--dry-run` | With --all-test: list only (the default) |
117
+ | `--confirm` | With --all-test: discard (else the dry run) |
118
+
112
119
  ### `applications list`
113
120
 
114
121
  List an offer's applications (id, status, board state, applicant, test)
@@ -121,6 +128,17 @@ List an offer's applications (id, status, board state, applicant, test)
121
128
  | `--offer <value>` (required) | Offer slug (its offerKey) |
122
129
  | `--test-only` | Only test applications |
123
130
 
131
+ ### `applications set-keep-demo <application>`
132
+
133
+ Mark a TEST application „Demo behalten“ (never expires, never discarded), or clear the mark with --off
134
+
135
+ - **Right:** school token — a module permission inside one school (the school's own administrator runs it)
136
+ - **Effect:** write — needs `--env`; on production also `--allow-prod`
137
+
138
+ | Option | Description |
139
+ |---|---|
140
+ | `--off` | Clear the mark |
141
+
124
142
  ### `applications show <application>`
125
143
 
126
144
  One application: status, test flag, offer, current workflow nodes