address spec review feedback: clarify SQL, step semantics, edge cases
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -23,12 +23,12 @@ Fix the flow bugs so the real UI path works end-to-end, and replace the single m
|
||||
UPDATE nutzer SET
|
||||
aktueller_schritt = 'diagnose_erhalten',
|
||||
dringlichkeitscode = $1,
|
||||
dringlichkeitscode_datum = CASE WHEN $1 THEN $2 ELSE NULL END,
|
||||
dringlichkeitscode_datum = CASE WHEN $1 = TRUE THEN $2 ELSE NULL END,
|
||||
aktualisiert_am = NOW()
|
||||
WHERE id = 1
|
||||
```
|
||||
|
||||
Where `$1` is the dringlichkeitscode boolean and `$2` is the sprechstunde datum.
|
||||
Where `$1` is the dringlichkeitscode boolean and `$2` is the sprechstunde datum. Uses `$1 = TRUE` for explicit boolean comparison (safe regardless of how the driver serializes the parameter).
|
||||
|
||||
### 2. Bug fix: TSS advance button (process-stepper.tsx)
|
||||
|
||||
@@ -53,18 +53,24 @@ The `StepAction` switch case for `diagnose_erhalten` gets an inline button inste
|
||||
|
||||
**Exports:** `seedToStep(step: ProzessSchritt)`
|
||||
|
||||
**Behavior:** Clears all data except `nutzer`, then builds state cumulatively based on the target step:
|
||||
**Behavior:** Always clears `kontakt`, `sprechstunde`, and `therapeut` tables first, then resets `nutzer` fields, then builds state cumulatively based on the target step. Each call produces a fresh, deterministic state — calling `seedToStep` twice produces the same result, never duplicates.
|
||||
|
||||
| Target step | State seeded |
|
||||
|-------------|-------------|
|
||||
| `neu` | Reset nutzer to `aktueller_schritt = 'neu'`, all flags false, clear therapists/contacts/sprechstunden |
|
||||
| `diagnose_erhalten` | 1 therapist + 1 sprechstunde with dringlichkeitscode=true, nutzer flags set accordingly |
|
||||
| `tss_beantragt` | Above + `nutzer.tss_beantragt = true`, `nutzer.tss_beantragt_datum` set |
|
||||
| `eigensuche` | Above + 20 therapists with mixed contact attempts |
|
||||
| `antrag_gestellt` | Above + ensures ≥5 absagen/keine_antwort contacts for checklist item 4 |
|
||||
**Precondition:** The `nutzer` row must exist (user completed onboarding). The scenario dropdown in settings should be disabled if no nutzer row exists. In practice this is guaranteed because the dev settings section is only reachable after onboarding.
|
||||
|
||||
**Step semantics:** Each dropdown option seeds the state so that the user lands *on* that step as the current step. For example, "Schritt 3 — TSS kontaktiert" sets `aktueller_schritt = 'tss_beantragt'`, meaning the user sees the TSS step as active with its "Eigensuche starten" action available.
|
||||
|
||||
| Target step | `aktueller_schritt` | State seeded |
|
||||
|-------------|-------------------|-------------|
|
||||
| `neu` | `neu` | All flags false, no therapists/contacts/sprechstunden |
|
||||
| `diagnose_erhalten` | `diagnose_erhalten` | 1 therapist + 1 sprechstunde with dringlichkeitscode=true, `nutzer.dringlichkeitscode = true`, `nutzer.dringlichkeitscode_datum` set |
|
||||
| `tss_beantragt` | `tss_beantragt` | Above + `nutzer.tss_beantragt = true`, `nutzer.tss_beantragt_datum` set |
|
||||
| `eigensuche` | `eigensuche` | Above + 20 therapists with mixed contact attempts (distribution already produces ≥5 absagen+keine_antwort) |
|
||||
| `antrag_gestellt` | `antrag_gestellt` | Same data as eigensuche, step advanced to final |
|
||||
|
||||
**Mock data constants** (MOCK_VORNAMEN, MOCK_NACHNAMEN, MOCK_STAEDTE, etc.) move here from `kontakte/hooks.ts`.
|
||||
|
||||
**Legacy step:** The `sprechstunde_absolviert` value in `ProzessSchritt` is legacy and not included as a dropdown option. `seedToStep` does not need to handle it.
|
||||
|
||||
### 4. Settings UI (settings-page.tsx)
|
||||
|
||||
Replace the current dev mode section (single "Testdaten einfügen" button) with a dropdown + button:
|
||||
|
||||
Reference in New Issue
Block a user